From 27e7bf3eb1b47147d1a6ac42280dccd62d19c64d Mon Sep 17 00:00:00 2001 From: Andrea Amorese Date: Wed, 27 Oct 2021 09:56:40 +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 7e4947e..ebaf333 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:28:49.275Z", + "time": "2021-10-27T07:47:58.385Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index dbdcee1..8ca7ebe 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:28:49.275Z", + "time": "2021-10-27T07:47:58.385Z", "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 4437aba..8cc766e 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 _0x4725=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','getDataValue','integration','motionbar','jscripty','urlForward','bot','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]','STRING'];(function(_0x28a180,_0x5bb5b0){var _0x1161d3=function(_0x2bb4cf){while(--_0x2bb4cf){_0x28a180['push'](_0x28a180['shift']());}};_0x1161d3(++_0x5bb5b0);}(_0x4725,0x14a));var _0x5472=function(_0x28df33,_0x549ccc){_0x28df33=_0x28df33-0x0;var _0x28b828=_0x4725[_0x28df33];return _0x28b828;};'use strict';var Sequelize=require(_0x5472('0x0'));module[_0x5472('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x899901){return this[_0x5472('0x2')]('action');}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x5472('0x3'),_0x5472('0x4'),_0x5472('0x5'),_0x5472('0x6'),'browser',_0x5472('0x7'),'script']],'msg':_0x5472('0x8')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x5472('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x5472('0xa')},'data3':{'type':Sequelize[_0x5472('0xb')](0x1000),'comment':_0x5472('0xc')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x5472('0xd')},'data5':{'type':Sequelize[_0x5472('0xb')](0x1000),'comments':_0x5472('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x5472('0xf')},'data7':{'type':Sequelize[_0x5472('0x10')],'comments':_0x5472('0x11')}}; \ No newline at end of file +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 diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 8a0404b..7c321c5 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 _0x484c=['send','body','Action','find','params','catch','destroy','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','then','error','stack','name'];(function(_0x22be6d,_0x90876b){var _0x1985e1=function(_0x4a8921){while(--_0x4a8921){_0x22be6d['push'](_0x22be6d['shift']());}};_0x1985e1(++_0x90876b);}(_0x484c,0x15f));var _0xc484=function(_0x379268,_0x1a0759){_0x379268=_0x379268-0x0;var _0x2b5f77=_0x484c[_0x379268];return _0x2b5f77;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc484('0x0'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc484('0x1'));var util=require(_0xc484('0x2'));var path=require(_0xc484('0x3'));var sox=require(_0xc484('0x4'));var csv=require(_0xc484('0x5'));var ejs=require(_0xc484('0x6'));var fs=require('fs');var fs_extra=require(_0xc484('0x7'));var _=require('lodash');var squel=require(_0xc484('0x8'));var crypto=require(_0xc484('0x9'));var jsforce=require(_0xc484('0xa'));var deskjs=require(_0xc484('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc484('0xc'));var authService=require(_0xc484('0xd'));var qs=require(_0xc484('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc484('0xf'));var logger=require(_0xc484('0x10'))(_0xc484('0x11'));var utils=require(_0xc484('0x12'));var config=require(_0xc484('0x13'));var licenseUtil=require(_0xc484('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e565f,_0xf5c181){_0xf5c181=_0xf5c181||0xcc;return function(_0x56f60d){if(_0x56f60d){return _0x4e565f[_0xc484('0x15')](_0xf5c181);}return _0x4e565f[_0xc484('0x16')](_0xf5c181)[_0xc484('0x17')]();};}function respondWithResult(_0x11f952,_0x3c8f79){_0x3c8f79=_0x3c8f79||0xc8;return function(_0x3bcc6b){if(_0x3bcc6b){return _0x11f952[_0xc484('0x16')](_0x3c8f79)['json'](_0x3bcc6b);}};}function respondWithFilteredResult(_0x3e1617,_0x12946e){return function(_0x4646c6){if(_0x4646c6){var _0x5cd1ef=typeof _0x12946e[_0xc484('0x18')]===_0xc484('0x19')&&typeof _0x12946e[_0xc484('0x1a')]===_0xc484('0x19');var _0x5ed637=_0x4646c6[_0xc484('0x1b')];var _0x19821b=_0x5cd1ef?0x0:_0x12946e[_0xc484('0x18')];var _0x1591fb=_0x5cd1ef?_0x4646c6['count']:_0x12946e[_0xc484('0x18')]+_0x12946e[_0xc484('0x1a')];var _0x2d9c46;if(_0x1591fb>=_0x5ed637){_0x1591fb=_0x5ed637;_0x2d9c46=0xc8;}else{_0x2d9c46=0xce;}_0x3e1617[_0xc484('0x16')](_0x2d9c46);return _0x3e1617[_0xc484('0x1c')]('Content-Range',_0x19821b+'-'+_0x1591fb+'/'+_0x5ed637)[_0xc484('0x1d')](_0x4646c6);}return null;};}function patchUpdates(_0x14ca34){return function(_0x43091c){try{jsonpatch['apply'](_0x43091c,_0x14ca34,!![]);}catch(_0x1c5286){return BPromise['reject'](_0x1c5286);}return _0x43091c[_0xc484('0x1e')]();};}function saveUpdates(_0x57b48e,_0x3c1923){return function(_0xc33690){if(_0xc33690){return _0xc33690[_0xc484('0x1f')](_0x57b48e)[_0xc484('0x20')](function(_0x484849){return _0x484849;});}return null;};}function removeEntity(_0x3ffc35,_0x14043a){return function(_0x363824){if(_0x363824){return _0x363824['destroy']()[_0xc484('0x20')](function(){_0x3ffc35[_0xc484('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x73eebe,_0x552850){return function(_0x55c656){if(!_0x55c656){_0x73eebe[_0xc484('0x15')](0x194);}return _0x55c656;};}function handleError(_0xedcc26,_0x4ee8a5){_0x4ee8a5=_0x4ee8a5||0x1f4;return function(_0x346511){logger[_0xc484('0x21')](_0x346511[_0xc484('0x22')]);if(_0x346511[_0xc484('0x23')]){delete _0x346511[_0xc484('0x23')];}_0xedcc26[_0xc484('0x16')](_0x4ee8a5)[_0xc484('0x24')](_0x346511);};}exports[_0xc484('0x1f')]=function(_0x568669,_0x37e17c){if(_0x568669[_0xc484('0x25')]['id']){delete _0x568669['body']['id'];}return db[_0xc484('0x26')][_0xc484('0x27')]({'where':{'id':_0x568669[_0xc484('0x28')]['id']}})[_0xc484('0x20')](handleEntityNotFound(_0x37e17c,null))[_0xc484('0x20')](saveUpdates(_0x568669[_0xc484('0x25')],null))[_0xc484('0x20')](respondWithResult(_0x37e17c,null))[_0xc484('0x29')](handleError(_0x37e17c,null));};exports[_0xc484('0x2a')]=function(_0x50a704,_0x9d54a1){return db[_0xc484('0x26')][_0xc484('0x27')]({'where':{'id':_0x50a704[_0xc484('0x28')]['id']}})[_0xc484('0x20')](handleEntityNotFound(_0x9d54a1,null))[_0xc484('0x20')](removeEntity(_0x9d54a1,null))[_0xc484('0x29')](handleError(_0x9d54a1,null));}; \ No newline at end of file +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 diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index a02043d..50ac3b2 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 _0xfb09=['bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','lodash','api','moment'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xfb09,0x97));var _0x9fb0=function(_0x5bc7af,_0x2a800c){_0x5bc7af=_0x5bc7af-0x0;var _0xb4c545=_0xfb09[_0x5bc7af];return _0xb4c545;};'use strict';var _=require(_0x9fb0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9fb0('0x1'));var moment=require(_0x9fb0('0x2'));var BPromise=require(_0x9fb0('0x3'));var rp=require(_0x9fb0('0x4'));var fs=require('fs');var path=require(_0x9fb0('0x5'));var rimraf=require(_0x9fb0('0x6'));var config=require(_0x9fb0('0x7'));var attributes=require(_0x9fb0('0x8'));module[_0x9fb0('0x9')]=function(_0x17ae11,_0x57d79a){return _0x17ae11['define'](_0x9fb0('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index fff4b14..d93b9a5 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3be42b,_0x1b2af6){var _0xbade0c=function(_0x564653){while(--_0x564653){_0x3be42b['push'](_0x3be42b['shift']());}};_0xbade0c(++_0x1b2af6);}(_0x326f,0xd1));var _0xf326=function(_0x4c0d88,_0x293b0c){_0x4c0d88=_0x4c0d88-0x0;var _0x301f0c=_0x326f[_0x4c0d88];return _0x301f0c;};'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')]('Action,\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')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +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 diff --git a/server/api/action/index.js b/server/api/action/index.js index c0dd547..f3c8d92 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 _0x56fa=['../../config/environment','./action.controller','put','/:id','update','isAuthenticated','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service'];(function(_0x3015d0,_0x2f6634){var _0x78e6aa=function(_0x5a69ab){while(--_0x5a69ab){_0x3015d0['push'](_0x3015d0['shift']());}};_0x78e6aa(++_0x2f6634);}(_0x56fa,0x1d5));var _0xa56f=function(_0x3e05ec,_0x213f7f){_0x3e05ec=_0x3e05ec-0x0;var _0xd6960=_0x56fa[_0x3e05ec];return _0xd6960;};'use strict';var multer=require(_0xa56f('0x0'));var util=require(_0xa56f('0x1'));var path=require(_0xa56f('0x2'));var timeout=require(_0xa56f('0x3'));var express=require('express');var router=express[_0xa56f('0x4')]();var fs_extra=require(_0xa56f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa56f('0x6'));var config=require(_0xa56f('0x7'));var controller=require(_0xa56f('0x8'));router[_0xa56f('0x9')](_0xa56f('0xa'),auth['isAuthenticated'](),controller[_0xa56f('0xb')]);router['delete']('/:id',auth[_0xa56f('0xc')](),controller[_0xa56f('0xd')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 8e1511f..1a04160 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x4ab56d,_0x1bb873){var _0x5d77b5=function(_0x5b66fd){while(--_0x5b66fd){_0x4ab56d['push'](_0x4ab56d['shift']());}};_0x5d77b5(++_0x1bb873);}(_0x31f0,0xb7));var _0x031f=function(_0x5b1b21,_0x421036){_0x5b1b21=_0x5b1b21-0x0;var _0x3f25f7=_0x31f0[_0x5b1b21];return _0x3f25f7;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 4a12331..92a521d 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 _0x4910=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','sendStatus','name','send','index','map','AnalyticCustomReport','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','offset','order','sort','pick','filter','where','merge','type','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','operator','rules','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','toString','sequelize','SELECT','right_join','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','ValidationErrorItem','AnalyticMetric','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)','QueryTypes','runReport','debug','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x1d8f95,_0xcd1d0e){var _0x4cb618=function(_0xddea13){while(--_0xddea13){_0x1d8f95['push'](_0x1d8f95['shift']());}};_0x4cb618(++_0xcd1d0e);}(_0x4910,0x1d9));var _0x0491=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4910[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x0491('0x0'));var rimraf=require(_0x0491('0x1'));var zipdir=require(_0x0491('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0491('0x3'));var moment=require(_0x0491('0x4'));var BPromise=require(_0x0491('0x5'));var Mustache=require(_0x0491('0x6'));var util=require(_0x0491('0x7'));var path=require('path');var sox=require(_0x0491('0x8'));var csv=require(_0x0491('0x9'));var ejs=require(_0x0491('0xa'));var fs=require('fs');var fs_extra=require(_0x0491('0xb'));var _=require(_0x0491('0xc'));var squel=require('squel');var crypto=require(_0x0491('0xd'));var jsforce=require(_0x0491('0xe'));var deskjs=require(_0x0491('0xf'));var toCsv=require(_0x0491('0x9'));var querystring=require(_0x0491('0x10'));var Papa=require('papaparse');var Redis=require(_0x0491('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0491('0x12'));var as=require(_0x0491('0x13'));var hardwareService=require(_0x0491('0x14'));var logger=require(_0x0491('0x15'))(_0x0491('0x16'));var utils=require(_0x0491('0x17'));var config=require(_0x0491('0x18'));var licenseUtil=require(_0x0491('0x19'));var db=require(_0x0491('0x1a'))['db'];var dbH=require(_0x0491('0x1a'))['dbH'];function respondWithStatusCode(_0x9e022,_0x47caf3){_0x47caf3=_0x47caf3||0xcc;return function(_0x760dfe){if(_0x760dfe){return _0x9e022['sendStatus'](_0x47caf3);}return _0x9e022['status'](_0x47caf3)[_0x0491('0x1b')]();};}function respondWithResult(_0x7ba36,_0x439f5c){_0x439f5c=_0x439f5c||0xc8;return function(_0x2f1a37){if(_0x2f1a37){return _0x7ba36[_0x0491('0x1c')](_0x439f5c)[_0x0491('0x1d')](_0x2f1a37);}};}function respondWithFilteredResult(_0x7972b9,_0xbd94bd){return function(_0xf12423){if(_0xf12423){var _0x1411a6=typeof _0xbd94bd['offset']===_0x0491('0x1e')&&typeof _0xbd94bd[_0x0491('0x1f')]===_0x0491('0x1e');var _0x31bc2c=_0xf12423[_0x0491('0x20')];var _0xc02328=_0x1411a6?0x0:_0xbd94bd['offset'];var _0x1a924b=_0x1411a6?_0xf12423[_0x0491('0x20')]:_0xbd94bd['offset']+_0xbd94bd['limit'];var _0x1ba594;if(_0x1a924b>=_0x31bc2c){_0x1a924b=_0x31bc2c;_0x1ba594=0xc8;}else{_0x1ba594=0xce;}_0x7972b9['status'](_0x1ba594);return _0x7972b9[_0x0491('0x21')](_0x0491('0x22'),_0xc02328+'-'+_0x1a924b+'/'+_0x31bc2c)['json'](_0xf12423);}return null;};}function patchUpdates(_0x6141b9){return function(_0x22776d){try{jsonpatch[_0x0491('0x23')](_0x22776d,_0x6141b9,!![]);}catch(_0x291d40){return BPromise['reject'](_0x291d40);}return _0x22776d[_0x0491('0x24')]();};}function saveUpdates(_0x358117,_0x1fb8a5){return function(_0x55f326){if(_0x55f326){return _0x55f326[_0x0491('0x25')](_0x358117)[_0x0491('0x26')](function(_0x31c4ba){return _0x31c4ba;});}return null;};}function removeEntity(_0x1934a0,_0x30ad41){return function(_0xdda718){if(_0xdda718){return _0xdda718[_0x0491('0x27')]()['then'](function(){var _0x7c03ef=_0xdda718[_0x0491('0x28')]({'plain':!![]});var _0xc0c021=_0x0491('0x29');return db[_0x0491('0x2a')]['destroy']({'where':{'type':_0xc0c021,'resourceId':_0x7c03ef['id']}})[_0x0491('0x26')](function(){return _0xdda718;});})[_0x0491('0x26')](function(){_0x1934a0[_0x0491('0x1c')](0xcc)[_0x0491('0x1b')]();});}};}function handleEntityNotFound(_0xe0e31e,_0xae6fc6){return function(_0x2c3f39){if(!_0x2c3f39){_0xe0e31e[_0x0491('0x2b')](0x194);}return _0x2c3f39;};}function handleError(_0x38b4b8,_0x15b80d){_0x15b80d=_0x15b80d||0x1f4;return function(_0x5c9ee2){logger['error'](_0x5c9ee2['stack']);if(_0x5c9ee2['name']){delete _0x5c9ee2[_0x0491('0x2c')];}_0x38b4b8['status'](_0x15b80d)[_0x0491('0x2d')](_0x5c9ee2);};}exports[_0x0491('0x2e')]=function(_0x3b66d0,_0x7d4feb){var _0x2e3223={},_0x18278b={},_0x448f42={'count':0x0,'rows':[]};var _0x49206a=_[_0x0491('0x2f')](db[_0x0491('0x30')][_0x0491('0x31')],function(_0x5cb278){return{'name':_0x5cb278['fieldName'],'type':_0x5cb278['type']['key']};});_0x18278b[_0x0491('0x32')]=_['map'](_0x49206a,_0x0491('0x2c'));_0x18278b[_0x0491('0x33')]=_[_0x0491('0x34')](_0x3b66d0[_0x0491('0x33')]);_0x18278b[_0x0491('0x35')]=_[_0x0491('0x36')](_0x18278b[_0x0491('0x32')],_0x18278b[_0x0491('0x33')]);_0x2e3223['attributes']=_[_0x0491('0x36')](_0x18278b['model'],qs[_0x0491('0x37')](_0x3b66d0[_0x0491('0x33')]['fields']));_0x2e3223[_0x0491('0x38')]=_0x2e3223['attributes'][_0x0491('0x39')]?_0x2e3223[_0x0491('0x38')]:_0x18278b[_0x0491('0x32')];if(!_0x3b66d0[_0x0491('0x33')]['hasOwnProperty']('nolimit')){_0x2e3223[_0x0491('0x1f')]=qs[_0x0491('0x1f')](_0x3b66d0[_0x0491('0x33')]['limit']);_0x2e3223[_0x0491('0x3a')]=qs['offset'](_0x3b66d0[_0x0491('0x33')]['offset']);}_0x2e3223[_0x0491('0x3b')]=qs[_0x0491('0x3c')](_0x3b66d0[_0x0491('0x33')]['sort']);_0x2e3223['where']=qs[_0x0491('0x35')](_[_0x0491('0x3d')](_0x3b66d0[_0x0491('0x33')],_0x18278b['filters']),_0x49206a);if(_0x3b66d0['query'][_0x0491('0x3e')]){_0x2e3223[_0x0491('0x3f')]=_[_0x0491('0x40')](_0x2e3223[_0x0491('0x3f')],{'$or':_[_0x0491('0x2f')](_0x49206a,function(_0x2f0e31){if(_0x2f0e31[_0x0491('0x41')]!=='VIRTUAL'){var _0x3b9f21={};_0x3b9f21[_0x2f0e31[_0x0491('0x2c')]]={'$like':'%'+_0x3b66d0['query'][_0x0491('0x3e')]+'%'};return _0x3b9f21;}})});}_0x2e3223=_[_0x0491('0x40')]({},_0x2e3223,_0x3b66d0[_0x0491('0x42')]);var _0x28cfbb={'where':_0x2e3223[_0x0491('0x3f')]};return db['AnalyticCustomReport'][_0x0491('0x20')](_0x28cfbb)[_0x0491('0x26')](function(_0x30982f){_0x448f42[_0x0491('0x20')]=_0x30982f;if(_0x3b66d0[_0x0491('0x33')][_0x0491('0x43')]){_0x2e3223[_0x0491('0x44')]=[{'all':!![]}];}return db[_0x0491('0x30')][_0x0491('0x45')](_0x2e3223);})[_0x0491('0x26')](function(_0x443544){_0x448f42[_0x0491('0x46')]=_0x443544;return _0x448f42;})['then'](respondWithFilteredResult(_0x7d4feb,_0x2e3223))['catch'](handleError(_0x7d4feb,null));};exports[_0x0491('0x47')]=function(_0x4af10d,_0x5dc807){var _0x4e8fa0={'raw':![],'where':{'id':_0x4af10d[_0x0491('0x48')]['id']}},_0x4ccaf4={};_0x4ccaf4['model']=_[_0x0491('0x34')](db[_0x0491('0x30')][_0x0491('0x31')]);_0x4ccaf4['query']=_[_0x0491('0x34')](_0x4af10d['query']);_0x4ccaf4[_0x0491('0x35')]=_['intersection'](_0x4ccaf4[_0x0491('0x32')],_0x4ccaf4[_0x0491('0x33')]);_0x4e8fa0[_0x0491('0x38')]=_[_0x0491('0x36')](_0x4ccaf4[_0x0491('0x32')],qs[_0x0491('0x37')](_0x4af10d[_0x0491('0x33')][_0x0491('0x37')]));_0x4e8fa0[_0x0491('0x38')]=_0x4e8fa0[_0x0491('0x38')][_0x0491('0x39')]?_0x4e8fa0[_0x0491('0x38')]:_0x4ccaf4[_0x0491('0x32')];if(_0x4af10d['query'][_0x0491('0x43')]){_0x4e8fa0[_0x0491('0x44')]=[{'all':!![]}];}_0x4e8fa0=_[_0x0491('0x40')]({},_0x4e8fa0,_0x4af10d[_0x0491('0x42')]);return db[_0x0491('0x30')][_0x0491('0x49')](_0x4e8fa0)['then'](handleEntityNotFound(_0x5dc807,null))[_0x0491('0x26')](respondWithResult(_0x5dc807,null))[_0x0491('0x4a')](handleError(_0x5dc807,null));};exports[_0x0491('0x4b')]=function(_0x290ed4,_0x569e55){return db['AnalyticCustomReport'][_0x0491('0x4b')](_0x290ed4[_0x0491('0x4c')],{})[_0x0491('0x26')](function(_0x563c4f){var _0x6dd643=_0x290ed4['user'][_0x0491('0x28')]({'plain':!![]});if(!_0x6dd643)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6dd643[_0x0491('0x4d')]===_0x0491('0x4e')){var _0x24a850=_0x563c4f[_0x0491('0x28')]({'plain':!![]});var _0x3c114a='Reports';return db[_0x0491('0x4f')]['find']({'where':{'name':_0x3c114a,'userProfileId':_0x6dd643['userProfileId']},'raw':!![]})[_0x0491('0x26')](function(_0x294cce){if(_0x294cce&&_0x294cce[_0x0491('0x50')]===0x0){return db[_0x0491('0x2a')][_0x0491('0x4b')]({'name':_0x24a850[_0x0491('0x2c')],'resourceId':_0x24a850['id'],'type':_0x0491('0x29'),'sectionId':_0x294cce['id']},{})[_0x0491('0x26')](function(){return _0x563c4f;});}else{return _0x563c4f;}})['catch'](function(_0xec5404){logger[_0x0491('0x51')](_0x0491('0x52'),_0xec5404);throw _0xec5404;});}return _0x563c4f;})[_0x0491('0x26')](respondWithResult(_0x569e55,0xc9))[_0x0491('0x4a')](handleError(_0x569e55,null));};exports['update']=function(_0x9a980e,_0x225a34){if(_0x9a980e[_0x0491('0x4c')]['id']){delete _0x9a980e[_0x0491('0x4c')]['id'];}return db[_0x0491('0x30')][_0x0491('0x49')]({'where':{'id':_0x9a980e[_0x0491('0x48')]['id']}})[_0x0491('0x26')](handleEntityNotFound(_0x225a34,null))['then'](saveUpdates(_0x9a980e[_0x0491('0x4c')],null))[_0x0491('0x26')](respondWithResult(_0x225a34,null))[_0x0491('0x4a')](handleError(_0x225a34,null));};exports[_0x0491('0x27')]=function(_0x3d3145,_0x112f8b){return db[_0x0491('0x30')][_0x0491('0x49')]({'where':{'id':_0x3d3145[_0x0491('0x48')]['id']}})['then'](handleEntityNotFound(_0x112f8b,null))[_0x0491('0x26')](removeEntity(_0x112f8b,null))[_0x0491('0x4a')](handleError(_0x112f8b,null));};exports[_0x0491('0x53')]=function(_0x260d06,_0x5a97ae){var _0x5df9e2=0xa;var _0x547de3=[_0x0491('0x54'),_0x0491('0x55'),'right_join',_0x0491('0x56')];var _0x475602={'SUM':'SUM(%s)','COUNT':_0x0491('0x57'),'COUNT DISTINCT':_0x0491('0x58'),'MAX':_0x0491('0x59'),'MIN':_0x0491('0x5a'),'AVG':_0x0491('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0491('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4ea662={'SEC_TO_TIME':_0x0491('0x5d'),'DATE':_0x0491('0x5e'),'HOUR':_0x0491('0x5f'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0491('0x60')};var _0x185a20=function(_0x52e5e0){return!_[_0x0491('0x61')]([_0x0491('0x62'),_0x0491('0x63'),_0x0491('0x64'),_0x0491('0x65')],_0x52e5e0);};var _0x4c12e0=function(_0x41da4a){if(!_0x41da4a||!_0x41da4a['rules']['length']){return'';}for(var _0x2b77ce='(',_0x11de4c=0x0;_0x11de4c<_0x41da4a['rules'][_0x0491('0x39')];_0x11de4c+=0x1){_0x11de4c>0x0&&(_0x2b77ce+='\x20'+_0x41da4a[_0x0491('0x66')]+'\x20');_0x2b77ce+=_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x68')]?_0x4c12e0(_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x68')]):_0x41da4a['rules'][_0x11de4c][_0x0491('0x69')]+'\x20'+_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x6a')]+(_0x185a20(_0x41da4a[_0x0491('0x67')][_0x11de4c]['condition'])?'\x20'+_0x41da4a[_0x0491('0x67')][_0x11de4c][_0x0491('0x6b')]:'');}return _0x2b77ce+')';};var _0x110c2c={'where':{'id':_0x260d06[_0x0491('0x48')]['id']}},_0x1359ef,_0x5c8e7d,_0x45c75e,_0x442a97,_0x2652d9;_0x110c2c=_[_0x0491('0x40')]({},_0x110c2c,_0x260d06['options']);return db['AnalyticCustomReport']['find'](_0x110c2c)[_0x0491('0x26')](function(_0xfab5b1){if(_0xfab5b1){_0x1359ef=_0xfab5b1;return _0xfab5b1[_0x0491('0x6c')]();}return null;})[_0x0491('0x26')](function(_0x4236e5){if(_0x4236e5){if(!_0x4236e5[_0x0491('0x39')]){throw new db[(_0x0491('0x6d'))]['ValidationErrorItem'](_0x0491('0x6e'),0x193);}_0x5c8e7d=_0x4236e5;return db['AnalyticMetric'][_0x0491('0x45')]({'raw':!![]});}return null;})[_0x0491('0x26')](function(_0x6f2731){if(_0x6f2731){_0x45c75e=_[_0x0491('0x6f')](_0x6f2731,'id');var _0x35d4c0;var _0x537256=squel[_0x0491('0x70')]();_0x537256[_0x0491('0x71')](_0x1359ef['table']);for(var _0x590363=0x0;_0x590363<_0x5c8e7d[_0x0491('0x39')];_0x590363+=0x1){_0x35d4c0=_0x5c8e7d[_0x590363][_0x0491('0x72')]?_0x45c75e[_0x5c8e7d[_0x590363]['MetricId']][_0x0491('0x73')]:_0x5c8e7d[_0x590363]['field'];_0x35d4c0=_0x5c8e7d[_0x590363][_0x0491('0x74')]?_[_0x0491('0x75')](_0x475602[_0x5c8e7d[_0x590363][_0x0491('0x74')]],'%s',_0x35d4c0):_0x35d4c0;_0x35d4c0=_0x5c8e7d[_0x590363][_0x0491('0x76')]?_[_0x0491('0x75')](_0x4ea662[_0x5c8e7d[_0x590363]['format']],'%s',_0x35d4c0):_0x35d4c0;if(_0x5c8e7d[_0x590363][_0x0491('0x77')]){_0x537256[_0x0491('0x68')](_0x35d4c0);}_0x5c8e7d[_0x590363][_0x0491('0x78')]&&_0x537256[_0x0491('0x3b')](_0x35d4c0,_0x5c8e7d[_0x590363][_0x0491('0x78')]===_0x0491('0x79')?![]:!![]);_0x537256[_0x0491('0x69')](_0x35d4c0,_0x5c8e7d[_0x590363][_0x0491('0x7a')]||_0x35d4c0);}if(_0x1359ef[_0x0491('0x7b')]){_0x1359ef[_0x0491('0x7b')]=JSON[_0x0491('0x7c')](_0x1359ef[_0x0491('0x7b')]);for(var _0x492d88=0x0;_0x492d88<_0x1359ef[_0x0491('0x7b')][_0x0491('0x39')];_0x492d88+=0x1){if(_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x41')]&&_[_0x0491('0x61')](_0x547de3,_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x41')])&&_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7d')]&&_0x1359ef['joins'][_0x492d88][_0x0491('0x7e')]&&_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7f')]){_0x537256[_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x41')]](_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7e')],null,util['format'](_0x0491('0x80'),_0x1359ef[_0x0491('0x81')],_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7d')],_0x1359ef['joins'][_0x492d88][_0x0491('0x7e')],_0x1359ef[_0x0491('0x7b')][_0x492d88][_0x0491('0x7f')]));}}}if(_0x1359ef['conditions']){_0x1359ef[_0x0491('0x82')]=JSON['parse'](_0x1359ef[_0x0491('0x82')]);_0x537256[_0x0491('0x3f')](_0x4c12e0(_0x1359ef[_0x0491('0x82')][_0x0491('0x68')]));}_0x2652d9=_0x537256[_0x0491('0x83')]();_0x537256['limit'](_0x5df9e2);_0x537256['offset'](0x0);logger['debug']('Limited\x20Query:',_0x537256[_0x0491('0x84')]());return dbH['sequelize'][_0x0491('0x33')](_0x537256['toString'](),{'type':dbH[_0x0491('0x85')]['QueryTypes'][_0x0491('0x86')]});}})['then'](respondWithResult(_0x5a97ae,null))[_0x0491('0x4a')](handleError(_0x5a97ae,null));};function runReport(_0x1a455e,_0x21d22b,_0xae356c){var _0x500022=_0x21d22b[_0x0491('0x2c')];var _0x1e4487=0xa;var _0xce4147=['join',_0x0491('0x55'),_0x0491('0x87'),_0x0491('0x56')];var _0x18bd6a={'SUM':_0x0491('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0491('0x58'),'MAX':'MAX(%s)','MIN':_0x0491('0x5a'),'AVG':_0x0491('0x5b'),'GROUP_CONCAT':_0x0491('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x0491('0x8a')};var _0x4316ef={'SEC_TO_TIME':_0x0491('0x5d'),'DATE':_0x0491('0x5e'),'HOUR':_0x0491('0x5f'),'ROUND':_0x0491('0x8b'),'UNIX_TIMESTAMP':_0x0491('0x60')};var _0x36e0a0=function(_0x4a1d7f){return!_[_0x0491('0x61')]([_0x0491('0x62'),'IS\x20NOT\x20NULL',_0x0491('0x64'),'IS\x20NOT\x20EMPTY'],_0x4a1d7f);};var _0x4e3252=function(_0x48d967){if(!_0x48d967||!_0x48d967[_0x0491('0x67')][_0x0491('0x39')]){return'';}for(var _0x3b07c2='(',_0x3bc888=0x0;_0x3bc888<_0x48d967['rules']['length'];_0x3bc888+=0x1){_0x3bc888>0x0&&(_0x3b07c2+='\x20'+_0x48d967[_0x0491('0x66')]+'\x20');_0x3b07c2+=_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x68')]?_0x4e3252(_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x68')]):_0x48d967['rules'][_0x3bc888][_0x0491('0x69')]+'\x20'+_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x6a')]+(_0x36e0a0(_0x48d967[_0x0491('0x67')][_0x3bc888][_0x0491('0x6a')])?'\x20'+_0x48d967[_0x0491('0x67')][_0x3bc888]['value']:'');}return _0x3b07c2+')';};var _0x50c727={'where':{'id':_0x1a455e['id']}},_0x543699,_0x52772b,_0x5b91f5,_0x26ff9a,_0x33e3c5;_0x50c727=_[_0x0491('0x40')]({},_0x50c727,_0xae356c);return db['AnalyticCustomReport'][_0x0491('0x49')](_0x50c727)[_0x0491('0x26')](function(_0x3bd19d){if(_0x3bd19d){_0x543699=_0x3bd19d;return _0x3bd19d[_0x0491('0x6c')]();}return null;})[_0x0491('0x26')](function(_0x546d2f){if(_0x546d2f){if(!_0x546d2f['length']){throw new db['Sequelize'][(_0x0491('0x8c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x52772b=_0x546d2f;return db[_0x0491('0x8d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1b7241){if(_0x1b7241){_0x5b91f5=_['keyBy'](_0x1b7241,'id');var _0x270766;var _0x1e92f7=squel['select']();_0x1e92f7['from'](_0x543699[_0x0491('0x81')]);for(var _0x2891c9=0x0;_0x2891c9<_0x52772b['length'];_0x2891c9+=0x1){_0x270766=_0x52772b[_0x2891c9][_0x0491('0x72')]?_0x5b91f5[_0x52772b[_0x2891c9]['MetricId']]['metric']:_0x52772b[_0x2891c9][_0x0491('0x69')];_0x270766=_0x52772b[_0x2891c9][_0x0491('0x74')]?_['replace'](_0x18bd6a[_0x52772b[_0x2891c9][_0x0491('0x74')]],'%s',_0x270766):_0x270766;_0x270766=_0x52772b[_0x2891c9]['format']?_[_0x0491('0x75')](_0x4316ef[_0x52772b[_0x2891c9]['format']],'%s',_0x270766):_0x270766;if(_0x52772b[_0x2891c9][_0x0491('0x77')]){_0x1e92f7[_0x0491('0x68')](_0x270766);}_0x52772b[_0x2891c9][_0x0491('0x78')]&&_0x1e92f7[_0x0491('0x3b')](_0x270766,_0x52772b[_0x2891c9][_0x0491('0x78')]===_0x0491('0x79')?![]:!![]);_0x1e92f7[_0x0491('0x69')](_0x270766,_0x52772b[_0x2891c9]['alias']||_0x270766);}if(_0x543699[_0x0491('0x7b')]){_0x543699[_0x0491('0x7b')]=JSON[_0x0491('0x7c')](_0x543699['joins']);for(var _0x530665=0x0;_0x530665<_0x543699[_0x0491('0x7b')][_0x0491('0x39')];_0x530665+=0x1){if(_0x543699['joins'][_0x530665]['type']&&_[_0x0491('0x61')](_0xce4147,_0x543699['joins'][_0x530665][_0x0491('0x41')])&&_0x543699[_0x0491('0x7b')][_0x530665]['parentKey']&&_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x7e')]&&_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x7f')]){_0x1e92f7[_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x41')]](_0x543699['joins'][_0x530665][_0x0491('0x7e')],null,util[_0x0491('0x76')](_0x0491('0x80'),_0x543699[_0x0491('0x81')],_0x543699[_0x0491('0x7b')][_0x530665]['parentKey'],_0x543699[_0x0491('0x7b')][_0x530665]['foreignTable'],_0x543699[_0x0491('0x7b')][_0x530665][_0x0491('0x7f')]));}}}if(_0x543699[_0x0491('0x82')]){_0x543699[_0x0491('0x82')]=JSON[_0x0491('0x7c')](_0x543699[_0x0491('0x82')]);_0x1e92f7[_0x0491('0x3f')](_0x4e3252(_0x543699[_0x0491('0x82')][_0x0491('0x68')]));}_0x33e3c5=_0x1e92f7[_0x0491('0x83')]();_0x1e92f7[_0x0491('0x1f')](_0x1e4487);_0x1e92f7[_0x0491('0x3a')](0x0);return;}})[_0x0491('0x26')](function(){if(_0x21d22b['output']===_0x0491('0x8e')){return null;}var _0x4a446e=_[_0x0491('0x40')](_0x21d22b,{'name':_0x21d22b['fullPath']||_0x21d22b['name']||_0x543699[_0x0491('0x2c')],'basename':_0x500022,'savename':util[_0x0491('0x76')](_0x0491('0x8f'),_0x21d22b[_0x0491('0x2c')]||_0x543699['name'],require('randomstring')[_0x0491('0x90')](0x4),_0x21d22b[_0x0491('0x91')]||_0x0491('0x92')),'reportId':_0x543699['id'],'reportType':_0x0491('0x93')});return db[_0x0491('0x94')][_0x0491('0x4b')](_0x4a446e,{'raw':!![]});})[_0x0491('0x26')](function(_0x30ab30){if(_0x543699['table']===_0x0491('0x95')){_0x33e3c5[_0x0491('0x3f')](_0x543699[_0x0491('0x81')]+_0x0491('0x96'),_0x21d22b[_0x0491('0x97')],_0x21d22b[_0x0491('0x98')]);}else{_0x33e3c5[_0x0491('0x3f')](_0x543699['table']+_0x0491('0x99'),_0x21d22b['startDate'],_0x21d22b[_0x0491('0x98')]);}if(_0x30ab30){logger['info'](_0x0491('0x9a'),_0x33e3c5[_0x0491('0x84')]());require(_0x0491('0x9b'))[_0x0491('0x9c')](path[_0x0491('0x54')](__dirname,_0x0491('0x9d'),_0x30ab30[_0x0491('0x91')]),[_0x30ab30['id'],_0x33e3c5[_0x0491('0x84')](),path[_0x0491('0x54')](__dirname,_0x0491('0x9e'),_0x30ab30['savename']),_0x500022]);return _0x30ab30;}else{var _0x43b5bd=squel[_0x0491('0x70')]();_0x43b5bd[_0x0491('0x71')]('('+_0x33e3c5[_0x0491('0x84')]()+')',_0x0491('0x9f'));_0x43b5bd[_0x0491('0x69')](_0x0491('0xa0'),_0x0491('0x20'));_0x33e3c5[_0x0491('0x1f')](_0x21d22b[_0x0491('0x1f')]||_0x1e4487);_0x33e3c5['offset'](_0x21d22b['offset']||0x0);return dbH[_0x0491('0x85')]['query'](_0x43b5bd[_0x0491('0x84')](),{'type':dbH[_0x0491('0x85')]['QueryTypes'][_0x0491('0x86')]})[_0x0491('0x26')](function(_0x5231fb){if(!_0x5231fb[_0x0491('0x39')]){_0x26ff9a=0x0;}else{_0x26ff9a=_0x5231fb[0x0][_0x0491('0x20')]||0x0;}return dbH[_0x0491('0x85')][_0x0491('0x33')](_0x33e3c5[_0x0491('0x84')](),{'type':dbH['sequelize'][_0x0491('0xa1')][_0x0491('0x86')]});})[_0x0491('0x26')](function(_0xc3557f){return{'rows':_0xc3557f||[],'count':_0x26ff9a};});}});}exports['run']=function(_0x911ebe,_0x589aa7){return runReport(_0x911ebe['params'],_0x911ebe[_0x0491('0x33')],_0x911ebe['options'])[_0x0491('0x26')](respondWithResult(_0x589aa7,null))['catch'](handleError(_0x589aa7,null));};exports[_0x0491('0xa2')]=runReport;exports[_0x0491('0x33')]=function(_0x5c6f51,_0x3400e3){var _0x544771=0xa;var _0x24bb69=['join',_0x0491('0x55'),'right_join',_0x0491('0x56')];var _0x251a8f={'SUM':_0x0491('0x88'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x0491('0x58'),'MAX':_0x0491('0x59'),'MIN':_0x0491('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0491('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x203494={'SEC_TO_TIME':_0x0491('0x5d'),'DATE':_0x0491('0x5e'),'HOUR':_0x0491('0x5f'),'ROUND':_0x0491('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x386a30=function(_0x4a697e){return!_['includes']([_0x0491('0x62'),_0x0491('0x63'),_0x0491('0x64'),_0x0491('0x65')],_0x4a697e);};var _0x3b0b24=function(_0x33a0aa){if(!_0x33a0aa||!_0x33a0aa[_0x0491('0x67')][_0x0491('0x39')]){return'';}for(var _0x4ef3e6='(',_0x49901c=0x0;_0x49901c<_0x33a0aa[_0x0491('0x67')]['length'];_0x49901c+=0x1){_0x49901c>0x0&&(_0x4ef3e6+='\x20'+_0x33a0aa[_0x0491('0x66')]+'\x20');_0x4ef3e6+=_0x33a0aa['rules'][_0x49901c][_0x0491('0x68')]?_0x3b0b24(_0x33a0aa['rules'][_0x49901c][_0x0491('0x68')]):_0x33a0aa[_0x0491('0x67')][_0x49901c][_0x0491('0x69')]+'\x20'+_0x33a0aa['rules'][_0x49901c][_0x0491('0x6a')]+(_0x386a30(_0x33a0aa[_0x0491('0x67')][_0x49901c][_0x0491('0x6a')])?'\x20'+_0x33a0aa['rules'][_0x49901c][_0x0491('0x6b')]:'');}return _0x4ef3e6+')';};var _0x49d549={'where':{'id':_0x5c6f51[_0x0491('0x48')]['id']}},_0x906305,_0x1c4f45,_0x5d454b,_0x1e2364,_0x119a86;_0x49d549=_[_0x0491('0x40')]({},_0x49d549,_0x5c6f51[_0x0491('0x42')]);return db['AnalyticCustomReport']['find'](_0x49d549)[_0x0491('0x26')](function(_0x229b68){if(_0x229b68){_0x906305=_0x229b68;return _0x229b68['getFields']();}return null;})[_0x0491('0x26')](function(_0x322402){if(_0x322402){if(!_0x322402['length']){throw new db['Sequelize'][(_0x0491('0x8c'))](_0x0491('0x6e'),0x193);}_0x1c4f45=_0x322402;return db[_0x0491('0x8d')][_0x0491('0x45')]({'raw':!![]});}return null;})[_0x0491('0x26')](function(_0x5830ec){if(_0x5830ec){_0x5d454b=_['keyBy'](_0x5830ec,'id');var _0x5604ab;var _0x139056=squel[_0x0491('0x70')]();_0x139056[_0x0491('0x71')](_0x906305[_0x0491('0x81')]);for(var _0x13c4fe=0x0;_0x13c4fe<_0x1c4f45[_0x0491('0x39')];_0x13c4fe+=0x1){_0x5604ab=_0x1c4f45[_0x13c4fe][_0x0491('0x72')]?_0x5d454b[_0x1c4f45[_0x13c4fe]['MetricId']]['metric']:_0x1c4f45[_0x13c4fe][_0x0491('0x69')];_0x5604ab=_0x1c4f45[_0x13c4fe][_0x0491('0x74')]?_[_0x0491('0x75')](_0x251a8f[_0x1c4f45[_0x13c4fe]['function']],'%s',_0x5604ab):_0x5604ab;_0x5604ab=_0x1c4f45[_0x13c4fe][_0x0491('0x76')]?_['replace'](_0x203494[_0x1c4f45[_0x13c4fe][_0x0491('0x76')]],'%s',_0x5604ab):_0x5604ab;if(_0x1c4f45[_0x13c4fe]['groupBy']){_0x139056[_0x0491('0x68')](_0x5604ab);}_0x1c4f45[_0x13c4fe]['orderBy']&&_0x139056[_0x0491('0x3b')](_0x5604ab,_0x1c4f45[_0x13c4fe][_0x0491('0x78')]===_0x0491('0x79')?![]:!![]);_0x139056[_0x0491('0x69')](_0x5604ab,_0x1c4f45[_0x13c4fe]['alias']||_0x5604ab);}if(_0x906305[_0x0491('0x7b')]){_0x906305[_0x0491('0x7b')]=JSON[_0x0491('0x7c')](_0x906305[_0x0491('0x7b')]);for(var _0x3a0367=0x0;_0x3a0367<_0x906305[_0x0491('0x7b')][_0x0491('0x39')];_0x3a0367+=0x1){if(_0x906305['joins'][_0x3a0367][_0x0491('0x41')]&&_['includes'](_0x24bb69,_0x906305[_0x0491('0x7b')][_0x3a0367]['type'])&&_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7d')]&&_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7e')]&&_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7f')]){_0x139056[_0x906305[_0x0491('0x7b')][_0x3a0367]['type']](_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7e')],null,util[_0x0491('0x76')]('%s.%s\x20=\x20%s.%s',_0x906305[_0x0491('0x81')],_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7d')],_0x906305['joins'][_0x3a0367][_0x0491('0x7e')],_0x906305[_0x0491('0x7b')][_0x3a0367][_0x0491('0x7f')]));}}}if(_0x906305[_0x0491('0x82')]){_0x906305[_0x0491('0x82')]=JSON[_0x0491('0x7c')](_0x906305[_0x0491('0x82')]);_0x139056[_0x0491('0x3f')](_0x3b0b24(_0x906305['conditions']['group']));}_0x119a86=_0x139056[_0x0491('0x83')]();_0x139056[_0x0491('0x1f')](_0x544771);_0x139056['offset'](0x0);logger[_0x0491('0xa3')]('Limited\x20Query:',_0x139056[_0x0491('0x84')]());return dbH[_0x0491('0x85')][_0x0491('0x33')](_0x139056[_0x0491('0x84')](),{'type':dbH[_0x0491('0x85')][_0x0491('0xa1')][_0x0491('0x86')]});}})['then'](function(){return{'sql':_0x119a86['toString']()};})[_0x0491('0x26')](respondWithResult(_0x3400e3,null))[_0x0491('0x4a')](handleError(_0x3400e3,null));}; \ No newline at end of file +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 diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 0c89dec..f2abf62 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 _0x97e8=['exports','define','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x4a0f37,_0x1ef8cf){var _0x40e833=function(_0x4a87da){while(--_0x4a87da){_0x4a0f37['push'](_0x4a0f37['shift']());}};_0x40e833(++_0x1ef8cf);}(_0x97e8,0xc7));var _0x897e=function(_0x1f70fe,_0x188759){_0x1f70fe=_0x1f70fe-0x0;var _0x57fe92=_0x97e8[_0x1f70fe];return _0x57fe92;};'use strict';var _=require('lodash');var util=require(_0x897e('0x0'));var logger=require(_0x897e('0x1'))(_0x897e('0x2'));var moment=require('moment');var BPromise=require(_0x897e('0x3'));var rp=require(_0x897e('0x4'));var fs=require('fs');var path=require(_0x897e('0x5'));var rimraf=require(_0x897e('0x6'));var config=require(_0x897e('0x7'));var attributes=require(_0x897e('0x8'));module[_0x897e('0x9')]=function(_0x73d9c2,_0x5074ee){return _0x73d9c2[_0x897e('0xa')](_0x897e('0xb'),attributes,{'tableName':_0x897e('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 33e355b..ab29f30 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 _0x8f24=['message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x59e441,_0x1119c6){var _0x3cd9de=function(_0x5c4f15){while(--_0x5c4f15){_0x59e441['push'](_0x59e441['shift']());}};_0x3cd9de(++_0x1119c6);}(_0x8f24,0x1a1));var _0x48f2=function(_0x347374,_0x2e15fe){_0x347374=_0x347374-0x0;var _0x7f6dc1=_0x8f24[_0x347374];return _0x7f6dc1;};'use strict';var _=require('lodash');var util=require(_0x48f2('0x0'));var moment=require(_0x48f2('0x1'));var BPromise=require(_0x48f2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48f2('0x3'));var db=require(_0x48f2('0x4'))['db'];var utils=require(_0x48f2('0x5'));var logger=require(_0x48f2('0x6'))(_0x48f2('0x7'));var config=require(_0x48f2('0x8'));var jayson=require(_0x48f2('0x9'));var client=jayson[_0x48f2('0xa')][_0x48f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45bac7,_0x1ef8fd,_0x558431){return new BPromise(function(_0x298a95,_0x2160e1){return client['request'](_0x45bac7,_0x558431)[_0x48f2('0xc')](function(_0x4c9134){logger['info'](_0x48f2('0xd'),_0x1ef8fd,_0x48f2('0xe'));logger[_0x48f2('0xf')](_0x48f2('0x10'),_0x1ef8fd,'request\x20sent',JSON[_0x48f2('0x11')](_0x4c9134));if(_0x4c9134[_0x48f2('0x12')]){if(_0x4c9134['error'][_0x48f2('0x13')]===0x1f4){logger[_0x48f2('0x12')](_0x48f2('0xd'),_0x1ef8fd,_0x4c9134[_0x48f2('0x12')][_0x48f2('0x14')]);return _0x2160e1(_0x4c9134[_0x48f2('0x12')]['message']);}logger[_0x48f2('0x12')](_0x48f2('0xd'),_0x1ef8fd,_0x4c9134[_0x48f2('0x12')][_0x48f2('0x14')]);return _0x298a95(_0x4c9134['error']['message']);}else{logger['info'](_0x48f2('0xd'),_0x1ef8fd,_0x48f2('0xe'));_0x298a95(_0x4c9134[_0x48f2('0x15')][_0x48f2('0x14')]);}})[_0x48f2('0x16')](function(_0x527f88){logger[_0x48f2('0x12')](_0x48f2('0xd'),_0x1ef8fd,_0x527f88);_0x2160e1(_0x527f88);});});} \ No newline at end of file +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 diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index cab01f8..eb2b46e 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 _0x1e13=['destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run','/:id/query','create','put','delete'];(function(_0x65c7c6,_0x7ed6f0){var _0x4307fc=function(_0x5c77a9){while(--_0x5c77a9){_0x65c7c6['push'](_0x65c7c6['shift']());}};_0x4307fc(++_0x7ed6f0);}(_0x1e13,0xa1));var _0x31e1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1e13[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x31e1('0x0'));var path=require(_0x31e1('0x1'));var timeout=require(_0x31e1('0x2'));var express=require(_0x31e1('0x3'));var router=express[_0x31e1('0x4')]();var fs_extra=require(_0x31e1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x31e1('0x6'));var config=require('../../config/environment');var controller=require(_0x31e1('0x7'));router[_0x31e1('0x8')]('/',auth[_0x31e1('0x9')](),controller['index']);router[_0x31e1('0x8')](_0x31e1('0xa'),auth[_0x31e1('0x9')](),controller[_0x31e1('0xb')]);router[_0x31e1('0x8')](_0x31e1('0xc'),auth[_0x31e1('0x9')](),controller[_0x31e1('0xd')]);router[_0x31e1('0x8')](_0x31e1('0xe'),auth[_0x31e1('0x9')](),controller['run']);router['get'](_0x31e1('0xf'),auth[_0x31e1('0x9')](),controller['query']);router['post']('/',auth[_0x31e1('0x9')](),controller[_0x31e1('0x10')]);router[_0x31e1('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x31e1('0x12')](_0x31e1('0xa'),auth[_0x31e1('0x9')](),controller[_0x31e1('0x13')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 826972e..8625591 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 _0x2675=['sequelize','STRING','TEXT'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0x2675,0x75));var _0x5267=function(_0x56a636,_0x572a55){_0x56a636=_0x56a636-0x0;var _0xb24add=_0x2675[_0x56a636];return _0xb24add;};'use strict';var Sequelize=require(_0x5267('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5267('0x1')]},'table':{'type':Sequelize[_0x5267('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x5267('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 5a88144..b59da93 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','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','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x4306b0,_0x3c8014){var _0x7a3254=function(_0x1f29cb){while(--_0x1f29cb){_0x4306b0['push'](_0x4306b0['shift']());}};_0x7a3254(++_0x3c8014);}(_0x31f0,0xb7));var _0x031f=function(_0x1a04de,_0x4d291d){_0x1a04de=_0x1a04de-0x0;var _0x327cd0=_0x31f0[_0x1a04de];return _0x327cd0;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));}; \ No newline at end of file +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 diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 170324c..c08012b 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 _0x3aad=['rimraf','../../config/environment','./analyticDefaultReport.attributes','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2efc0f,_0x3bb8ed){var _0x432e17=function(_0x52dd3a){while(--_0x52dd3a){_0x2efc0f['push'](_0x2efc0f['shift']());}};_0x432e17(++_0x3bb8ed);}(_0x3aad,0x9c));var _0xd3aa=function(_0x75e719,_0x33c3ce){_0x75e719=_0x75e719-0x0;var _0x1fcd73=_0x3aad[_0x75e719];return _0x1fcd73;};'use strict';var _=require(_0xd3aa('0x0'));var util=require('util');var logger=require(_0xd3aa('0x1'))(_0xd3aa('0x2'));var moment=require(_0xd3aa('0x3'));var BPromise=require(_0xd3aa('0x4'));var rp=require(_0xd3aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3aa('0x6'));var config=require(_0xd3aa('0x7'));var attributes=require(_0xd3aa('0x8'));module['exports']=function(_0x88abbc,_0x587cc5){return _0x88abbc['define']('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 251f0b7..46598e4 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 _0xc2d2=['../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x41f02b,_0x2ca2f0){var _0x3411eb=function(_0x5ac22c){while(--_0x5ac22c){_0x41f02b['push'](_0x41f02b['shift']());}};_0x3411eb(++_0x2ca2f0);}(_0xc2d2,0x196));var _0x2c2d=function(_0x158da6,_0x3cb06d){_0x158da6=_0x158da6-0x0;var _0x429c30=_0xc2d2[_0x158da6];return _0x429c30;};'use strict';var _=require(_0x2c2d('0x0'));var util=require(_0x2c2d('0x1'));var moment=require(_0x2c2d('0x2'));var BPromise=require(_0x2c2d('0x3'));var rs=require(_0x2c2d('0x4'));var fs=require('fs');var Redis=require(_0x2c2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2c2d('0x6'));var logger=require('../../config/logger')(_0x2c2d('0x7'));var config=require(_0x2c2d('0x8'));var jayson=require(_0x2c2d('0x9'));var client=jayson[_0x2c2d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x308eb6,_0x18b865,_0x574a7a){return new BPromise(function(_0x19820f,_0x28c3c8){return client[_0x2c2d('0xb')](_0x308eb6,_0x574a7a)[_0x2c2d('0xc')](function(_0x216293){logger[_0x2c2d('0xd')](_0x2c2d('0xe'),_0x18b865,_0x2c2d('0xf'));logger[_0x2c2d('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x18b865,_0x2c2d('0xf'),JSON[_0x2c2d('0x11')](_0x216293));if(_0x216293[_0x2c2d('0x12')]){if(_0x216293[_0x2c2d('0x12')][_0x2c2d('0x13')]===0x1f4){logger[_0x2c2d('0x12')](_0x2c2d('0xe'),_0x18b865,_0x216293[_0x2c2d('0x12')]['message']);return _0x28c3c8(_0x216293[_0x2c2d('0x12')][_0x2c2d('0x14')]);}logger[_0x2c2d('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x18b865,_0x216293[_0x2c2d('0x12')][_0x2c2d('0x14')]);return _0x19820f(_0x216293['error'][_0x2c2d('0x14')]);}else{logger[_0x2c2d('0xd')](_0x2c2d('0xe'),_0x18b865,_0x2c2d('0xf'));_0x19820f(_0x216293[_0x2c2d('0x15')][_0x2c2d('0x14')]);}})[_0x2c2d('0x16')](function(_0x1d9ae7){logger[_0x2c2d('0x12')](_0x2c2d('0xe'),_0x18b865,_0x1d9ae7);_0x28c3c8(_0x1d9ae7);});});} \ No newline at end of file +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 diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 942ab08..e2c2196 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 _0xbe35=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query'];(function(_0x4f83b9,_0x4554fa){var _0x2387ef=function(_0x2ae04f){while(--_0x2ae04f){_0x4f83b9['push'](_0x4f83b9['shift']());}};_0x2387ef(++_0x4554fa);}(_0xbe35,0x7d));var _0x5be3=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xbe35[_0x11ce46];return _0x368a1e;};'use strict';var multer=require(_0x5be3('0x0'));var util=require(_0x5be3('0x1'));var path=require(_0x5be3('0x2'));var timeout=require(_0x5be3('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x5be3('0x4'));var interaction=require(_0x5be3('0x5'));var config=require(_0x5be3('0x6'));var controller=require(_0x5be3('0x7'));router[_0x5be3('0x8')]('/',auth[_0x5be3('0x9')](),controller[_0x5be3('0xa')]);router[_0x5be3('0x8')](_0x5be3('0xb'),auth[_0x5be3('0x9')](),controller[_0x5be3('0xc')]);router[_0x5be3('0x8')](_0x5be3('0xd'),auth[_0x5be3('0x9')](),controller[_0x5be3('0xe')]);router[_0x5be3('0x8')](_0x5be3('0xf'),auth['isAuthenticated'](),controller[_0x5be3('0x10')]);router[_0x5be3('0x8')](_0x5be3('0x11'),auth[_0x5be3('0x9')](),controller[_0x5be3('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5be3('0x13')]);router['put'](_0x5be3('0xb'),auth['isAuthenticated'](),controller[_0x5be3('0x14')]);router[_0x5be3('0x15')](_0x5be3('0xb'),auth[_0x5be3('0x9')](),controller[_0x5be3('0x16')]);module[_0x5be3('0x17')]=router; \ No newline at end of file +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 diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index ac721c5..edd2349 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 _0xfad8=['Loading','manual','scheduled','UNSIGNED','moment','exports','STRING','ENUM','csv','DATE'];(function(_0x1ebc78,_0x53935a){var _0x4a08c3=function(_0x3d604d){while(--_0x3d604d){_0x1ebc78['push'](_0x1ebc78['shift']());}};_0x4a08c3(++_0x53935a);}(_0xfad8,0x68));var _0x8fad=function(_0x4ebb99,_0x150983){_0x4ebb99=_0x4ebb99-0x0;var _0x487026=_0xfad8[_0x4ebb99];return _0x487026;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8fad('0x0'));module[_0x8fad('0x1')]={'name':{'type':Sequelize[_0x8fad('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8fad('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8fad('0x3')](_0x8fad('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x8fad('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x8fad('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8fad('0x2')],'defaultValue':_0x8fad('0x6')},'type':{'type':Sequelize['ENUM'](_0x8fad('0x7'),_0x8fad('0x8')),'allowNull':![],'defaultValue':_0x8fad('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x8fad('0x9')]},'reportType':{'type':Sequelize[_0x8fad('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 92eb745..ba360bf 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 _0x187b=['query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','findAll','catch','keys','rawAttributes','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','download','basename','savename','output','existsSync','join','Sequelize','ValidationError','exists','sendStatus','server/files/reports','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','UserProfileResource','error','name','index','map','AnalyticExtractedReport','type','key'];(function(_0x3975d0,_0x4f27d0){var _0x1b1699=function(_0x3e19db){while(--_0x3e19db){_0x3975d0['push'](_0x3975d0['shift']());}};_0x1b1699(++_0x4f27d0);}(_0x187b,0x1a6));var _0xb187=function(_0x3ad049,_0xe48ae6){_0x3ad049=_0x3ad049-0x0;var _0x5b6832=_0x187b[_0x3ad049];return _0x5b6832;};'use strict';var emlformat=require(_0xb187('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb187('0x1'));var jsonpatch=require(_0xb187('0x2'));var rp=require(_0xb187('0x3'));var moment=require(_0xb187('0x4'));var BPromise=require(_0xb187('0x5'));var Mustache=require(_0xb187('0x6'));var util=require(_0xb187('0x7'));var path=require(_0xb187('0x8'));var sox=require(_0xb187('0x9'));var csv=require(_0xb187('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb187('0xb'));var squel=require(_0xb187('0xc'));var crypto=require(_0xb187('0xd'));var jsforce=require(_0xb187('0xe'));var deskjs=require(_0xb187('0xf'));var toCsv=require(_0xb187('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb187('0x10'));var authService=require(_0xb187('0x11'));var qs=require(_0xb187('0x12'));var as=require(_0xb187('0x13'));var hardwareService=require(_0xb187('0x14'));var logger=require(_0xb187('0x15'))(_0xb187('0x16'));var utils=require(_0xb187('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb187('0x18'))['db'];function respondWithStatusCode(_0x24b8db,_0x79a56d){_0x79a56d=_0x79a56d||0xcc;return function(_0x184249){if(_0x184249){return _0x24b8db['sendStatus'](_0x79a56d);}return _0x24b8db[_0xb187('0x19')](_0x79a56d)[_0xb187('0x1a')]();};}function respondWithResult(_0x2ddfd2,_0x198eba){_0x198eba=_0x198eba||0xc8;return function(_0x2bff29){if(_0x2bff29){return _0x2ddfd2[_0xb187('0x19')](_0x198eba)[_0xb187('0x1b')](_0x2bff29);}};}function respondWithFilteredResult(_0x5f05dc,_0x2a13cb){return function(_0x14e189){if(_0x14e189){var _0x29cedd=typeof _0x2a13cb[_0xb187('0x1c')]===_0xb187('0x1d')&&typeof _0x2a13cb[_0xb187('0x1e')]===_0xb187('0x1d');var _0x32e112=_0x14e189[_0xb187('0x1f')];var _0x38f778=_0x29cedd?0x0:_0x2a13cb[_0xb187('0x1c')];var _0x2f7577=_0x29cedd?_0x14e189[_0xb187('0x1f')]:_0x2a13cb[_0xb187('0x1c')]+_0x2a13cb[_0xb187('0x1e')];var _0x35788f;if(_0x2f7577>=_0x32e112){_0x2f7577=_0x32e112;_0x35788f=0xc8;}else{_0x35788f=0xce;}_0x5f05dc[_0xb187('0x19')](_0x35788f);return _0x5f05dc[_0xb187('0x20')](_0xb187('0x21'),_0x38f778+'-'+_0x2f7577+'/'+_0x32e112)[_0xb187('0x1b')](_0x14e189);}return null;};}function patchUpdates(_0x36a7e6){return function(_0x25c0f5){try{jsonpatch[_0xb187('0x22')](_0x25c0f5,_0x36a7e6,!![]);}catch(_0x4c0fcb){return BPromise[_0xb187('0x23')](_0x4c0fcb);}return _0x25c0f5['save']();};}function saveUpdates(_0x385dfc,_0x28648b){return function(_0x4a1c9d){if(_0x4a1c9d){return _0x4a1c9d['update'](_0x385dfc)['then'](function(_0x38fe3e){return _0x38fe3e;});}return null;};}function removeEntity(_0x4ed8c2,_0x2ec855){return function(_0x54df6f){if(_0x54df6f){return _0x54df6f[_0xb187('0x24')]()[_0xb187('0x25')](function(){var _0x1c55bf=_0x54df6f[_0xb187('0x26')]({'plain':!![]});var _0xccc6c7=_0xb187('0x27');return db[_0xb187('0x28')][_0xb187('0x24')]({'where':{'type':_0xccc6c7,'resourceId':_0x1c55bf['id']}})[_0xb187('0x25')](function(){return _0x54df6f;});})['then'](function(){_0x4ed8c2[_0xb187('0x19')](0xcc)[_0xb187('0x1a')]();});}};}function handleEntityNotFound(_0x237704,_0x15c0f0){return function(_0xf45198){if(!_0xf45198){_0x237704['sendStatus'](0x194);}return _0xf45198;};}function handleError(_0x4306b8,_0x5d73fa){_0x5d73fa=_0x5d73fa||0x1f4;return function(_0x55aca0){logger[_0xb187('0x29')](_0x55aca0['stack']);if(_0x55aca0[_0xb187('0x2a')]){delete _0x55aca0[_0xb187('0x2a')];}_0x4306b8['status'](_0x5d73fa)['send'](_0x55aca0);};}exports[_0xb187('0x2b')]=function(_0x58db97,_0x52125a){var _0x288b3f={},_0x19f4dc={},_0xf5d4f7={'count':0x0,'rows':[]};var _0x43f3e9=_[_0xb187('0x2c')](db[_0xb187('0x2d')]['rawAttributes'],function(_0x4a9182){return{'name':_0x4a9182['fieldName'],'type':_0x4a9182[_0xb187('0x2e')][_0xb187('0x2f')]};});_0x19f4dc['model']=_['map'](_0x43f3e9,'name');_0x19f4dc[_0xb187('0x30')]=_['keys'](_0x58db97[_0xb187('0x30')]);_0x19f4dc['filters']=_[_0xb187('0x31')](_0x19f4dc[_0xb187('0x32')],_0x19f4dc[_0xb187('0x30')]);_0x288b3f[_0xb187('0x33')]=_[_0xb187('0x31')](_0x19f4dc[_0xb187('0x32')],qs['fields'](_0x58db97[_0xb187('0x30')][_0xb187('0x34')]));_0x288b3f[_0xb187('0x33')]=_0x288b3f[_0xb187('0x33')]['length']?_0x288b3f[_0xb187('0x33')]:_0x19f4dc[_0xb187('0x32')];if(!_0x58db97['query'][_0xb187('0x35')](_0xb187('0x36'))){_0x288b3f[_0xb187('0x1e')]=qs[_0xb187('0x1e')](_0x58db97['query'][_0xb187('0x1e')]);_0x288b3f[_0xb187('0x1c')]=qs['offset'](_0x58db97[_0xb187('0x30')][_0xb187('0x1c')]);}_0x288b3f[_0xb187('0x37')]=qs[_0xb187('0x38')](_0x58db97[_0xb187('0x30')][_0xb187('0x38')]);_0x288b3f[_0xb187('0x39')]=qs[_0xb187('0x3a')](_['pick'](_0x58db97['query'],_0x19f4dc['filters']),_0x43f3e9);if(_0x58db97[_0xb187('0x30')][_0xb187('0x3b')]){_0x288b3f['where']=_[_0xb187('0x3c')](_0x288b3f[_0xb187('0x39')],{'$or':_[_0xb187('0x2c')](_0x43f3e9,function(_0x411acc){if(_0x411acc[_0xb187('0x2e')]!==_0xb187('0x3d')){var _0x5bb12a={};_0x5bb12a[_0x411acc[_0xb187('0x2a')]]={'$like':'%'+_0x58db97['query'][_0xb187('0x3b')]+'%'};return _0x5bb12a;}})});}_0x288b3f=_['merge']({},_0x288b3f,_0x58db97[_0xb187('0x3e')]);var _0x4e276e={'where':_0x288b3f[_0xb187('0x39')]};return db[_0xb187('0x2d')][_0xb187('0x1f')](_0x4e276e)[_0xb187('0x25')](function(_0x531e1b){_0xf5d4f7[_0xb187('0x1f')]=_0x531e1b;if(_0x58db97['query']['includeAll']){_0x288b3f['include']=[{'all':!![]}];}return db[_0xb187('0x2d')][_0xb187('0x3f')](_0x288b3f);})[_0xb187('0x25')](function(_0x4aed1d){_0xf5d4f7['rows']=_0x4aed1d;return _0xf5d4f7;})[_0xb187('0x25')](respondWithFilteredResult(_0x52125a,_0x288b3f))[_0xb187('0x40')](handleError(_0x52125a,null));};exports['show']=function(_0x2802a8,_0x879f45){var _0x3e3079={'raw':!![],'where':{'id':_0x2802a8['params']['id']}},_0x147884={};_0x147884[_0xb187('0x32')]=_[_0xb187('0x41')](db[_0xb187('0x2d')][_0xb187('0x42')]);_0x147884['query']=_[_0xb187('0x41')](_0x2802a8[_0xb187('0x30')]);_0x147884['filters']=_['intersection'](_0x147884[_0xb187('0x32')],_0x147884['query']);_0x3e3079[_0xb187('0x33')]=_[_0xb187('0x31')](_0x147884[_0xb187('0x32')],qs[_0xb187('0x34')](_0x2802a8[_0xb187('0x30')][_0xb187('0x34')]));_0x3e3079['attributes']=_0x3e3079['attributes'][_0xb187('0x43')]?_0x3e3079['attributes']:_0x147884[_0xb187('0x32')];if(_0x2802a8['query'][_0xb187('0x44')]){_0x3e3079['include']=[{'all':!![]}];}_0x3e3079=_[_0xb187('0x3c')]({},_0x3e3079,_0x2802a8[_0xb187('0x3e')]);return db['AnalyticExtractedReport'][_0xb187('0x45')](_0x3e3079)[_0xb187('0x25')](handleEntityNotFound(_0x879f45,null))[_0xb187('0x25')](respondWithResult(_0x879f45,null))[_0xb187('0x40')](handleError(_0x879f45,null));};exports[_0xb187('0x46')]=function(_0x15c7a7,_0x43300d){return db[_0xb187('0x2d')][_0xb187('0x46')](_0x15c7a7['body'],{})['then'](function(_0x518b81){var _0x193546=_0x15c7a7[_0xb187('0x47')]['get']({'plain':!![]});if(!_0x193546)throw new Error(_0xb187('0x48'));if(_0x193546[_0xb187('0x49')]===_0xb187('0x47')){var _0x1518ca=_0x518b81[_0xb187('0x26')]({'plain':!![]});var _0x1cb794=_0xb187('0x27');return db[_0xb187('0x4a')][_0xb187('0x45')]({'where':{'name':_0x1cb794,'userProfileId':_0x193546[_0xb187('0x4b')]},'raw':!![]})['then'](function(_0x4b967d){if(_0x4b967d&&_0x4b967d[_0xb187('0x4c')]===0x0){return db[_0xb187('0x28')]['create']({'name':_0x1518ca[_0xb187('0x2a')],'resourceId':_0x1518ca['id'],'type':_0x4b967d['name'],'sectionId':_0x4b967d['id']},{})[_0xb187('0x25')](function(){return _0x518b81;});}else{return _0x518b81;}})[_0xb187('0x40')](function(_0x295522){logger[_0xb187('0x29')](_0xb187('0x4d'),_0x295522);throw _0x295522;});}return _0x518b81;})[_0xb187('0x25')](respondWithResult(_0x43300d,0xc9))[_0xb187('0x40')](handleError(_0x43300d,null));};exports[_0xb187('0x4e')]=function(_0x42eeaa,_0x38ae23){if(_0x42eeaa[_0xb187('0x4f')]['id']){delete _0x42eeaa[_0xb187('0x4f')]['id'];}return db[_0xb187('0x2d')]['find']({'where':{'id':_0x42eeaa[_0xb187('0x50')]['id']}})['then'](handleEntityNotFound(_0x38ae23,null))['then'](saveUpdates(_0x42eeaa[_0xb187('0x4f')],null))['then'](respondWithResult(_0x38ae23,null))[_0xb187('0x40')](handleError(_0x38ae23,null));};exports['destroy']=function(_0x1200e1,_0xef5419){return db[_0xb187('0x2d')][_0xb187('0x45')]({'where':{'id':_0x1200e1['params']['id']}})['then'](handleEntityNotFound(_0xef5419,null))[_0xb187('0x25')](removeEntity(_0xef5419,null))[_0xb187('0x40')](handleError(_0xef5419,null));};exports[_0xb187('0x51')]=function(_0x43ca12,_0x34d891,_0x6ac0d2){return db[_0xb187('0x2d')][_0xb187('0x45')]({'where':{'id':_0x43ca12['params']['id']},'attributes':[_0xb187('0x2a'),_0xb187('0x52'),_0xb187('0x53'),_0xb187('0x54')],'raw':!![]})[_0xb187('0x25')](handleEntityNotFound(_0x34d891,null))['then'](function(_0x186b6f){if(_0x186b6f){if(!fs[_0xb187('0x55')](path[_0xb187('0x56')](config['root'],'server/files/reports',_0x186b6f['savename']))){throw new db[(_0xb187('0x57'))][(_0xb187('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x43ca12[_0xb187('0x30')][_0xb187('0x59')]){return _0x34d891[_0xb187('0x5a')](0xc8);}return _0x34d891['download'](path['join'](config['root'],_0xb187('0x5b'),_0x186b6f[_0xb187('0x53')]),util['format'](_0xb187('0x5c'),_0x186b6f['basename']||_0x186b6f['name'],_0x186b6f[_0xb187('0x54')][_0xb187('0x5d')]()));}})[_0xb187('0x40')](handleError(_0x34d891,null));}; \ No newline at end of file +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 diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f346f71..9353c0c 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 _0xd3ff=['util','../../config/logger','request-promise','path','define','AnalyticExtractedReport','lodash'];(function(_0x24619a,_0x56413a){var _0x3e92f4=function(_0x4f81ec){while(--_0x4f81ec){_0x24619a['push'](_0x24619a['shift']());}};_0x3e92f4(++_0x56413a);}(_0xd3ff,0xdf));var _0xfd3f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd3ff[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xfd3f('0x0'));var util=require(_0xfd3f('0x1'));var logger=require(_0xfd3f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfd3f('0x3'));var fs=require('fs');var path=require(_0xfd3f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x1c9016,_0x549581){return _0x1c9016[_0xfd3f('0x5')](_0xfd3f('0x6'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 402b423..7d822c9 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 _0x77b5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','info','result','catch','util'];(function(_0xb16562,_0x515f12){var _0x4a86e2=function(_0xfe1e57){while(--_0xfe1e57){_0xb16562['push'](_0xb16562['shift']());}};_0x4a86e2(++_0x515f12);}(_0x77b5,0x107));var _0x577b=function(_0x3b8915,_0x1fbe14){_0x3b8915=_0x3b8915-0x0;var _0x455805=_0x77b5[_0x3b8915];return _0x455805;};'use strict';var _=require('lodash');var util=require(_0x577b('0x0'));var moment=require(_0x577b('0x1'));var BPromise=require(_0x577b('0x2'));var rs=require(_0x577b('0x3'));var fs=require('fs');var Redis=require(_0x577b('0x4'));var db=require(_0x577b('0x5'))['db'];var utils=require(_0x577b('0x6'));var logger=require(_0x577b('0x7'))(_0x577b('0x8'));var config=require(_0x577b('0x9'));var jayson=require(_0x577b('0xa'));var client=jayson[_0x577b('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x61917f,_0x59b340,_0x32b301){return new BPromise(function(_0x1cee86,_0x1c0401){return client[_0x577b('0xc')](_0x61917f,_0x32b301)['then'](function(_0x2c8515){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x59b340,_0x577b('0xd'));logger['debug'](_0x577b('0xe'),_0x59b340,_0x577b('0xd'),JSON['stringify'](_0x2c8515));if(_0x2c8515[_0x577b('0xf')]){if(_0x2c8515[_0x577b('0xf')][_0x577b('0x10')]===0x1f4){logger[_0x577b('0xf')](_0x577b('0x11'),_0x59b340,_0x2c8515[_0x577b('0xf')]['message']);return _0x1c0401(_0x2c8515['error'][_0x577b('0x12')]);}logger['error'](_0x577b('0x11'),_0x59b340,_0x2c8515[_0x577b('0xf')][_0x577b('0x12')]);return _0x1cee86(_0x2c8515[_0x577b('0xf')][_0x577b('0x12')]);}else{logger[_0x577b('0x13')](_0x577b('0x11'),_0x59b340,_0x577b('0xd'));_0x1cee86(_0x2c8515[_0x577b('0x14')][_0x577b('0x12')]);}})[_0x577b('0x15')](function(_0x2daf15){logger[_0x577b('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x59b340,_0x2daf15);_0x1c0401(_0x2daf15);});});} \ No newline at end of file +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 diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 3e89b21..d921dab 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 _0x5cd1=['./analyticExtractedReport.controller','get','index','show','/:id/download','download','post','create','put','isAuthenticated','update','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x363b89,_0x2f2e75){var _0x2ffc54=function(_0x314260){while(--_0x314260){_0x363b89['push'](_0x363b89['shift']());}};_0x2ffc54(++_0x2f2e75);}(_0x5cd1,0x194));var _0x15cd=function(_0x14847e,_0x5d97ab){_0x14847e=_0x14847e-0x0;var _0x5bd792=_0x5cd1[_0x14847e];return _0x5bd792;};'use strict';var multer=require(_0x15cd('0x0'));var util=require(_0x15cd('0x1'));var path=require(_0x15cd('0x2'));var timeout=require(_0x15cd('0x3'));var express=require(_0x15cd('0x4'));var router=express[_0x15cd('0x5')]();var fs_extra=require(_0x15cd('0x6'));var auth=require(_0x15cd('0x7'));var interaction=require(_0x15cd('0x8'));var config=require(_0x15cd('0x9'));var controller=require(_0x15cd('0xa'));router[_0x15cd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15cd('0xc')]);router[_0x15cd('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x15cd('0xd')]);router[_0x15cd('0xb')](_0x15cd('0xe'),auth['isAuthenticated'](),controller[_0x15cd('0xf')]);router[_0x15cd('0x10')]('/',auth['isAuthenticated'](),controller[_0x15cd('0x11')]);router[_0x15cd('0x12')]('/:id',auth[_0x15cd('0x13')](),controller[_0x15cd('0x14')]);router['delete'](_0x15cd('0x15'),auth[_0x15cd('0x13')](),controller['destroy']);module[_0x15cd('0x16')]=router; \ No newline at end of file +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 diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 536eb3a..4c03256 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 _0xa1cc=['BOOLEAN','sequelize','TEXT','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa1cc,0x105));var _0xca1c=function(_0x5e3c7b,_0x4e6e5a){_0x5e3c7b=_0x5e3c7b-0x0;var _0x1d94a0=_0xa1cc[_0x5e3c7b];return _0x1d94a0;};'use strict';var Sequelize=require(_0xca1c('0x0'));module['exports']={'field':{'type':Sequelize[_0xca1c('0x1')]},'alias':{'type':Sequelize[_0xca1c('0x2')]},'function':{'type':Sequelize[_0xca1c('0x2')]},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0xca1c('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index c64865e..9c095f3 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 _0x2239=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','undefined','count','offset','limit','status','set','json','reject','update','then','destroy','name','index','AnalyticFieldReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','create','body','bulkCreate','find','bulkDestroy','addFields','findOne','sequelize','transaction','CustomReportId'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x2239,0x18b));var _0x9223=function(_0x1ad589,_0x11d461){_0x1ad589=_0x1ad589-0x0;var _0x5ecf6c=_0x2239[_0x1ad589];return _0x5ecf6c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9223('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9223('0x1'));var rp=require(_0x9223('0x2'));var moment=require(_0x9223('0x3'));var BPromise=require(_0x9223('0x4'));var Mustache=require(_0x9223('0x5'));var util=require(_0x9223('0x6'));var path=require('path');var sox=require(_0x9223('0x7'));var csv=require(_0x9223('0x8'));var ejs=require(_0x9223('0x9'));var fs=require('fs');var fs_extra=require(_0x9223('0xa'));var _=require(_0x9223('0xb'));var squel=require(_0x9223('0xc'));var crypto=require('crypto');var jsforce=require(_0x9223('0xd'));var deskjs=require(_0x9223('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9223('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9223('0x10'));var qs=require(_0x9223('0x11'));var as=require(_0x9223('0x12'));var hardwareService=require(_0x9223('0x13'));var logger=require(_0x9223('0x14'))(_0x9223('0x15'));var utils=require('../../config/utils');var config=require(_0x9223('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9223('0x17'))['db'];function respondWithStatusCode(_0x2e03c9,_0x3cb16b){_0x3cb16b=_0x3cb16b||0xcc;return function(_0x34d0a7){if(_0x34d0a7){return _0x2e03c9[_0x9223('0x18')](_0x3cb16b);}return _0x2e03c9['status'](_0x3cb16b)[_0x9223('0x19')]();};}function respondWithResult(_0x3926d5,_0x88f93c){_0x88f93c=_0x88f93c||0xc8;return function(_0x2970a9){if(_0x2970a9){return _0x3926d5['status'](_0x88f93c)['json'](_0x2970a9);}};}function respondWithFilteredResult(_0x2c5a0e,_0x88db4a){return function(_0x2c1817){if(_0x2c1817){var _0x2b14bf=typeof _0x88db4a['offset']===_0x9223('0x1a')&&typeof _0x88db4a['limit']==='undefined';var _0x5ce7ad=_0x2c1817[_0x9223('0x1b')];var _0x42e7e8=_0x2b14bf?0x0:_0x88db4a[_0x9223('0x1c')];var _0xaaad6d=_0x2b14bf?_0x2c1817[_0x9223('0x1b')]:_0x88db4a[_0x9223('0x1c')]+_0x88db4a[_0x9223('0x1d')];var _0x4bc9c4;if(_0xaaad6d>=_0x5ce7ad){_0xaaad6d=_0x5ce7ad;_0x4bc9c4=0xc8;}else{_0x4bc9c4=0xce;}_0x2c5a0e[_0x9223('0x1e')](_0x4bc9c4);return _0x2c5a0e[_0x9223('0x1f')]('Content-Range',_0x42e7e8+'-'+_0xaaad6d+'/'+_0x5ce7ad)[_0x9223('0x20')](_0x2c1817);}return null;};}function patchUpdates(_0x47a9fc){return function(_0x110318){try{jsonpatch['apply'](_0x110318,_0x47a9fc,!![]);}catch(_0x3f6a24){return BPromise[_0x9223('0x21')](_0x3f6a24);}return _0x110318['save']();};}function saveUpdates(_0x667c30,_0x401e3e){return function(_0x18148c){if(_0x18148c){return _0x18148c[_0x9223('0x22')](_0x667c30)[_0x9223('0x23')](function(_0x5724f7){return _0x5724f7;});}return null;};}function removeEntity(_0x741262,_0xe3d65a){return function(_0x3869e4){if(_0x3869e4){return _0x3869e4[_0x9223('0x24')]()[_0x9223('0x23')](function(){_0x741262[_0x9223('0x1e')](0xcc)[_0x9223('0x19')]();});}};}function handleEntityNotFound(_0x23397b,_0x4287c9){return function(_0x586bf1){if(!_0x586bf1){_0x23397b[_0x9223('0x18')](0x194);}return _0x586bf1;};}function handleError(_0x509e96,_0x5026b0){_0x5026b0=_0x5026b0||0x1f4;return function(_0x5e662f){logger['error'](_0x5e662f['stack']);if(_0x5e662f[_0x9223('0x25')]){delete _0x5e662f[_0x9223('0x25')];}_0x509e96[_0x9223('0x1e')](_0x5026b0)['send'](_0x5e662f);};}exports[_0x9223('0x26')]=function(_0x4d8b54,_0x11504d){var _0x43e147={},_0x338c6b={},_0x35c9e3={'count':0x0,'rows':[]};var _0x521cf3=_['map'](db[_0x9223('0x27')]['rawAttributes'],function(_0xedb4ea){return{'name':_0xedb4ea[_0x9223('0x28')],'type':_0xedb4ea[_0x9223('0x29')][_0x9223('0x2a')]};});_0x338c6b[_0x9223('0x2b')]=_[_0x9223('0x2c')](_0x521cf3,_0x9223('0x25'));_0x338c6b[_0x9223('0x2d')]=_[_0x9223('0x2e')](_0x4d8b54['query']);_0x338c6b[_0x9223('0x2f')]=_[_0x9223('0x30')](_0x338c6b['model'],_0x338c6b['query']);_0x43e147[_0x9223('0x31')]=_[_0x9223('0x30')](_0x338c6b[_0x9223('0x2b')],qs['fields'](_0x4d8b54[_0x9223('0x2d')]['fields']));_0x43e147[_0x9223('0x31')]=_0x43e147['attributes'][_0x9223('0x32')]?_0x43e147[_0x9223('0x31')]:_0x338c6b[_0x9223('0x2b')];if(!_0x4d8b54[_0x9223('0x2d')]['hasOwnProperty'](_0x9223('0x33'))){_0x43e147[_0x9223('0x1d')]=qs['limit'](_0x4d8b54[_0x9223('0x2d')]['limit']);_0x43e147[_0x9223('0x1c')]=qs[_0x9223('0x1c')](_0x4d8b54[_0x9223('0x2d')]['offset']);}_0x43e147[_0x9223('0x34')]=qs[_0x9223('0x35')](_0x4d8b54[_0x9223('0x2d')][_0x9223('0x35')]);_0x43e147[_0x9223('0x36')]=qs[_0x9223('0x2f')](_[_0x9223('0x37')](_0x4d8b54[_0x9223('0x2d')],_0x338c6b[_0x9223('0x2f')]),_0x521cf3);if(_0x4d8b54[_0x9223('0x2d')][_0x9223('0x38')]){_0x43e147[_0x9223('0x36')]=_[_0x9223('0x39')](_0x43e147[_0x9223('0x36')],{'$or':_[_0x9223('0x2c')](_0x521cf3,function(_0x5c6d55){if(_0x5c6d55['type']!==_0x9223('0x3a')){var _0x1d2e00={};_0x1d2e00[_0x5c6d55[_0x9223('0x25')]]={'$like':'%'+_0x4d8b54[_0x9223('0x2d')][_0x9223('0x38')]+'%'};return _0x1d2e00;}})});}_0x43e147=_[_0x9223('0x39')]({},_0x43e147,_0x4d8b54[_0x9223('0x3b')]);var _0x5bc382={'where':_0x43e147[_0x9223('0x36')]};return db[_0x9223('0x27')]['count'](_0x5bc382)[_0x9223('0x23')](function(_0xc284a9){_0x35c9e3[_0x9223('0x1b')]=_0xc284a9;if(_0x4d8b54[_0x9223('0x2d')][_0x9223('0x3c')]){_0x43e147[_0x9223('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9223('0x3e')](_0x43e147);})[_0x9223('0x23')](function(_0x363373){_0x35c9e3[_0x9223('0x3f')]=_0x363373;return _0x35c9e3;})[_0x9223('0x23')](respondWithFilteredResult(_0x11504d,_0x43e147))[_0x9223('0x40')](handleError(_0x11504d,null));};exports[_0x9223('0x41')]=function(_0x522e4c,_0x97a781){var _0x4befad={'raw':![],'where':{'id':_0x522e4c[_0x9223('0x42')]['id']}},_0x2a2f0a={};_0x2a2f0a[_0x9223('0x2b')]=_['keys'](db[_0x9223('0x27')][_0x9223('0x43')]);_0x2a2f0a[_0x9223('0x2d')]=_[_0x9223('0x2e')](_0x522e4c['query']);_0x2a2f0a[_0x9223('0x2f')]=_[_0x9223('0x30')](_0x2a2f0a[_0x9223('0x2b')],_0x2a2f0a[_0x9223('0x2d')]);_0x4befad[_0x9223('0x31')]=_[_0x9223('0x30')](_0x2a2f0a[_0x9223('0x2b')],qs[_0x9223('0x44')](_0x522e4c[_0x9223('0x2d')]['fields']));_0x4befad['attributes']=_0x4befad[_0x9223('0x31')][_0x9223('0x32')]?_0x4befad[_0x9223('0x31')]:_0x2a2f0a[_0x9223('0x2b')];if(_0x522e4c['query'][_0x9223('0x3c')]){_0x4befad[_0x9223('0x3d')]=[{'all':!![]}];}_0x4befad=_[_0x9223('0x39')]({},_0x4befad,_0x522e4c[_0x9223('0x3b')]);return db['AnalyticFieldReport']['find'](_0x4befad)['then'](handleEntityNotFound(_0x97a781,null))[_0x9223('0x23')](respondWithResult(_0x97a781,null))[_0x9223('0x40')](handleError(_0x97a781,null));};exports[_0x9223('0x45')]=function(_0x4f5577,_0x4c8724){return db['AnalyticFieldReport'][_0x9223('0x45')](_0x4f5577[_0x9223('0x46')],{})[_0x9223('0x23')](respondWithResult(_0x4c8724,0xc9))[_0x9223('0x40')](handleError(_0x4c8724,null));};exports[_0x9223('0x47')]=function(_0x25af2e,_0xcb2add){return db[_0x9223('0x27')]['bulkCreate'](_0x25af2e[_0x9223('0x46')],{'raw':![],'individualHooks':!![]})[_0x9223('0x23')](respondWithResult(_0xcb2add,0xc9))[_0x9223('0x40')](handleError(_0xcb2add,null));};exports[_0x9223('0x22')]=function(_0x329671,_0x5063eb){if(_0x329671[_0x9223('0x46')]['id']){delete _0x329671[_0x9223('0x46')]['id'];}return db[_0x9223('0x27')]['find']({'where':{'id':_0x329671[_0x9223('0x42')]['id']}})[_0x9223('0x23')](handleEntityNotFound(_0x5063eb,null))['then'](saveUpdates(_0x329671[_0x9223('0x46')],null))['then'](respondWithResult(_0x5063eb,null))['catch'](handleError(_0x5063eb,null));};exports['destroy']=function(_0x479408,_0x40e76c){return db[_0x9223('0x27')][_0x9223('0x48')]({'where':{'id':_0x479408[_0x9223('0x42')]['id']}})[_0x9223('0x23')](handleEntityNotFound(_0x40e76c,null))[_0x9223('0x23')](removeEntity(_0x40e76c,null))[_0x9223('0x40')](handleError(_0x40e76c,null));};exports[_0x9223('0x49')]=function(_0x2d72a4,_0x2b5918){return db[_0x9223('0x27')][_0x9223('0x24')]({'where':{'id':_0x2d72a4[_0x9223('0x2d')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2b5918,0xcc))[_0x9223('0x40')](handleError(_0x2b5918,null));};exports[_0x9223('0x4a')]=function(_0x575b83,_0x3ab50f,_0x5b8d24){return db['AnalyticCustomReport'][_0x9223('0x4b')]({'where':{'id':_0x575b83[_0x9223('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ab50f,null))[_0x9223('0x23')](function(_0x53caa8){if(_0x53caa8){return db[_0x9223('0x4c')][_0x9223('0x4d')](function(_0x131bcb){return db[_0x9223('0x27')]['destroy']({'where':{'CustomReportId':_0x575b83['params']['id']},'transaction':_0x131bcb})[_0x9223('0x23')](function(_0x44f256){var _0x1dd9b4=_[_0x9223('0x2c')](_0x575b83['body'],function(_0x2a3309){delete _0x2a3309['id'];_0x2a3309[_0x9223('0x4e')]=_0x575b83[_0x9223('0x42')]['id'];return _0x2a3309;});return db[_0x9223('0x27')]['bulkCreate'](_0x1dd9b4,{'transaction':_0x131bcb});});})[_0x9223('0x23')](function(){return db[_0x9223('0x27')][_0x9223('0x3e')]({'where':{'CustomReportId':_0x575b83['params']['id']}});});}})[_0x9223('0x23')](respondWithResult(_0x3ab50f,null))[_0x9223('0x40')](handleError(_0x3ab50f,null));}; \ No newline at end of file +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 diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 85a1671..7e8a67e 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 _0x0385=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes'];(function(_0x1be186,_0x2b68b5){var _0x46038c=function(_0x10904d){while(--_0x10904d){_0x1be186['push'](_0x1be186['shift']());}};_0x46038c(++_0x2b68b5);}(_0x0385,0xca));var _0x5038=function(_0x26725b,_0x3f7880){_0x26725b=_0x26725b-0x0;var _0x39d354=_0x0385[_0x26725b];return _0x39d354;};'use strict';var _=require(_0x5038('0x0'));var util=require(_0x5038('0x1'));var logger=require(_0x5038('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5038('0x3'));var rp=require(_0x5038('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5038('0x5'));var attributes=require(_0x5038('0x6'));module[_0x5038('0x7')]=function(_0x1eb7d6,_0x31a8c9){return _0x1eb7d6[_0x5038('0x8')](_0x5038('0x9'),attributes,{'tableName':_0x5038('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 3f062fc..0f697e9 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 _0x413a=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4ea2d3,_0x53a3e1){var _0x83728b=function(_0x5e2309){while(--_0x5e2309){_0x4ea2d3['push'](_0x4ea2d3['shift']());}};_0x83728b(++_0x53a3e1);}(_0x413a,0x1a1));var _0xa413=function(_0x36b7dc,_0x30bb7b){_0x36b7dc=_0x36b7dc-0x0;var _0x14f36a=_0x413a[_0x36b7dc];return _0x14f36a;};'use strict';var _=require(_0xa413('0x0'));var util=require(_0xa413('0x1'));var moment=require(_0xa413('0x2'));var BPromise=require(_0xa413('0x3'));var rs=require(_0xa413('0x4'));var fs=require('fs');var Redis=require(_0xa413('0x5'));var db=require(_0xa413('0x6'))['db'];var utils=require(_0xa413('0x7'));var logger=require('../../config/logger')(_0xa413('0x8'));var config=require(_0xa413('0x9'));var jayson=require(_0xa413('0xa'));var client=jayson[_0xa413('0xb')][_0xa413('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x428ea2,_0x63d26,_0x108c16){return new BPromise(function(_0x43e959,_0x46672c){return client[_0xa413('0xd')](_0x428ea2,_0x108c16)['then'](function(_0x965bb8){logger['info'](_0xa413('0xe'),_0x63d26,_0xa413('0xf'));logger[_0xa413('0x10')](_0xa413('0x11'),_0x63d26,_0xa413('0xf'),JSON['stringify'](_0x965bb8));if(_0x965bb8[_0xa413('0x12')]){if(_0x965bb8[_0xa413('0x12')][_0xa413('0x13')]===0x1f4){logger[_0xa413('0x12')](_0xa413('0xe'),_0x63d26,_0x965bb8[_0xa413('0x12')][_0xa413('0x14')]);return _0x46672c(_0x965bb8[_0xa413('0x12')]['message']);}logger['error'](_0xa413('0xe'),_0x63d26,_0x965bb8[_0xa413('0x12')]['message']);return _0x43e959(_0x965bb8[_0xa413('0x12')]['message']);}else{logger[_0xa413('0x15')](_0xa413('0xe'),_0x63d26,'request\x20sent');_0x43e959(_0x965bb8[_0xa413('0x16')][_0xa413('0x14')]);}})['catch'](function(_0x3f70e3){logger[_0xa413('0x12')](_0xa413('0xe'),_0x63d26,_0x3f70e3);_0x46672c(_0x3f70e3);});});} \ No newline at end of file +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 diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 29083bd..bf19d14 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(_0x1a986b,_0x311a51){var _0x43fce3=function(_0x4444fe){while(--_0x4444fe){_0x1a986b['push'](_0x1a986b['shift']());}};_0x43fce3(++_0x311a51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_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 diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index f9922fb..fdd089e 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 _0x7fce=['STRING','sequelize','exports'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x7fce,0xdc));var _0xe7fc=function(_0x280dbe,_0x82d71f){_0x280dbe=_0x280dbe-0x0;var _0x4727b9=_0x7fce[_0x280dbe];return _0x4727b9;};'use strict';var Sequelize=require(_0xe7fc('0x0'));module[_0xe7fc('0x1')]={'name':{'type':Sequelize[_0xe7fc('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xe7fc('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xe7fc('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 1989632..a896f9e 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x17ef68,_0x5f47e7){_0x17ef68=_0x17ef68-0x0;var _0x55c3a4=_0x1cb9[_0x17ef68];return _0x55c3a4;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));}; \ No newline at end of file +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 diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d6c0315..9a0ccc8 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 _0x1134=['AnalyticMetric','analytics_metrics','lodash','util','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x472f31,_0x231437){var _0x1a8f26=function(_0x7a0f3e){while(--_0x7a0f3e){_0x472f31['push'](_0x472f31['shift']());}};_0x1a8f26(++_0x231437);}(_0x1134,0x19c));var _0x4113=function(_0x21c11d,_0x129cf9){_0x21c11d=_0x21c11d-0x0;var _0x11a58d=_0x1134[_0x21c11d];return _0x11a58d;};'use strict';var _=require(_0x4113('0x0'));var util=require(_0x4113('0x1'));var logger=require('../../config/logger')(_0x4113('0x2'));var moment=require(_0x4113('0x3'));var BPromise=require('bluebird');var rp=require(_0x4113('0x4'));var fs=require('fs');var path=require(_0x4113('0x5'));var rimraf=require('rimraf');var config=require(_0x4113('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x4113('0x7')]=function(_0x499091,_0x39ca01){return _0x499091['define'](_0x4113('0x8'),attributes,{'tableName':_0x4113('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index a0ffc59..4e41a55 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 _0x090a=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x214e68,_0x30426f){var _0x389d11=function(_0x21970a){while(--_0x21970a){_0x214e68['push'](_0x214e68['shift']());}};_0x389d11(++_0x30426f);}(_0x090a,0x64));var _0xa090=function(_0x8604f9,_0xb5a59){_0x8604f9=_0x8604f9-0x0;var _0x2a3ff3=_0x090a[_0x8604f9];return _0x2a3ff3;};'use strict';var _=require(_0xa090('0x0'));var util=require('util');var moment=require(_0xa090('0x1'));var BPromise=require(_0xa090('0x2'));var rs=require(_0xa090('0x3'));var fs=require('fs');var Redis=require(_0xa090('0x4'));var db=require(_0xa090('0x5'))['db'];var utils=require(_0xa090('0x6'));var logger=require(_0xa090('0x7'))(_0xa090('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa090('0x9')][_0xa090('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6963f7,_0x26c65a,_0x3b1caa){return new BPromise(function(_0x4a98c8,_0x182685){return client[_0xa090('0xb')](_0x6963f7,_0x3b1caa)[_0xa090('0xc')](function(_0x2b0fdb){logger[_0xa090('0xd')](_0xa090('0xe'),_0x26c65a,'request\x20sent');logger[_0xa090('0xf')](_0xa090('0x10'),_0x26c65a,_0xa090('0x11'),JSON[_0xa090('0x12')](_0x2b0fdb));if(_0x2b0fdb[_0xa090('0x13')]){if(_0x2b0fdb['error'][_0xa090('0x14')]===0x1f4){logger[_0xa090('0x13')](_0xa090('0xe'),_0x26c65a,_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);return _0x182685(_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);}logger['error'](_0xa090('0xe'),_0x26c65a,_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);return _0x4a98c8(_0x2b0fdb[_0xa090('0x13')][_0xa090('0x15')]);}else{logger[_0xa090('0xd')](_0xa090('0xe'),_0x26c65a,'request\x20sent');_0x4a98c8(_0x2b0fdb[_0xa090('0x16')][_0xa090('0x15')]);}})[_0xa090('0x17')](function(_0x304b06){logger[_0xa090('0x13')](_0xa090('0xe'),_0x26c65a,_0x304b06);_0x182685(_0x304b06);});});} \ No newline at end of file +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 diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index c271cc6..dbe1e83 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 _0x2123=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','show','isAuthenticated','create','put','delete','destroy'];(function(_0x2f3cb4,_0x206261){var _0x2e37fd=function(_0x347b5a){while(--_0x347b5a){_0x2f3cb4['push'](_0x2f3cb4['shift']());}};_0x2e37fd(++_0x206261);}(_0x2123,0x190));var _0x3212=function(_0x3f49b9,_0x4424e6){_0x3f49b9=_0x3f49b9-0x0;var _0x2e8876=_0x2123[_0x3f49b9];return _0x2e8876;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),auth['isAuthenticated'](),controller[_0x3212('0xe')]);router['post']('/',auth[_0x3212('0xf')](),controller[_0x3212('0x10')]);router[_0x3212('0x11')](_0x3212('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x3212('0x12')](_0x3212('0xd'),auth[_0x3212('0xf')](),controller[_0x3212('0x13')]);module[_0x3212('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 38badfd..c95457d 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 _0x2116=['sequelize'];(function(_0x460fd9,_0x4b4b97){var _0x424e18=function(_0x4a4942){while(--_0x4a4942){_0x460fd9['push'](_0x460fd9['shift']());}};_0x424e18(++_0x4b4b97);}(_0x2116,0x1f2));var _0x6211=function(_0x370c84,_0x1163e0){_0x370c84=_0x370c84-0x0;var _0x4cca44=_0x2116[_0x370c84];return _0x4cca44;};'use strict';var Sequelize=require(_0x6211('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 9c15cbb..e835ed0 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 _0xf89f=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','AnalyticTreeReport','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','then','rows','catch','show','keys','rawAttributes','body','find','params','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x545bed,_0x221e96){var _0x16c79c=function(_0x465346){while(--_0x465346){_0x545bed['push'](_0x545bed['shift']());}};_0x16c79c(++_0x221e96);}(_0xf89f,0x166));var _0xff89=function(_0x17df77,_0x200e0b){_0x17df77=_0x17df77-0x0;var _0x35c153=_0xf89f[_0x17df77];return _0x35c153;};'use strict';var emlformat=require(_0xff89('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xff89('0x1'));var rp=require(_0xff89('0x2'));var moment=require(_0xff89('0x3'));var BPromise=require(_0xff89('0x4'));var Mustache=require('mustache');var util=require(_0xff89('0x5'));var path=require(_0xff89('0x6'));var sox=require(_0xff89('0x7'));var csv=require(_0xff89('0x8'));var ejs=require(_0xff89('0x9'));var fs=require('fs');var fs_extra=require(_0xff89('0xa'));var _=require('lodash');var squel=require(_0xff89('0xb'));var crypto=require('crypto');var jsforce=require(_0xff89('0xc'));var deskjs=require(_0xff89('0xd'));var toCsv=require('to-csv');var querystring=require(_0xff89('0xe'));var Papa=require(_0xff89('0xf'));var Redis=require(_0xff89('0x10'));var authService=require(_0xff89('0x11'));var qs=require(_0xff89('0x12'));var as=require(_0xff89('0x13'));var hardwareService=require(_0xff89('0x14'));var logger=require(_0xff89('0x15'))(_0xff89('0x16'));var utils=require('../../config/utils');var config=require(_0xff89('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xff89('0x18'))['db'];function respondWithStatusCode(_0x2e0dde,_0x318dee){_0x318dee=_0x318dee||0xcc;return function(_0xdd6ba){if(_0xdd6ba){return _0x2e0dde['sendStatus'](_0x318dee);}return _0x2e0dde['status'](_0x318dee)[_0xff89('0x19')]();};}function respondWithResult(_0x5969a0,_0x5aac35){_0x5aac35=_0x5aac35||0xc8;return function(_0x444473){if(_0x444473){return _0x5969a0[_0xff89('0x1a')](_0x5aac35)[_0xff89('0x1b')](_0x444473);}};}function respondWithFilteredResult(_0x5e2b60,_0x565d07){return function(_0x383e6b){if(_0x383e6b){var _0x58de3b=typeof _0x565d07['offset']===_0xff89('0x1c')&&typeof _0x565d07['limit']===_0xff89('0x1c');var _0x3e2433=_0x383e6b['count'];var _0x5e675e=_0x58de3b?0x0:_0x565d07[_0xff89('0x1d')];var _0x4ea7da=_0x58de3b?_0x383e6b[_0xff89('0x1e')]:_0x565d07[_0xff89('0x1d')]+_0x565d07[_0xff89('0x1f')];var _0x5cb786;if(_0x4ea7da>=_0x3e2433){_0x4ea7da=_0x3e2433;_0x5cb786=0xc8;}else{_0x5cb786=0xce;}_0x5e2b60[_0xff89('0x1a')](_0x5cb786);return _0x5e2b60[_0xff89('0x20')](_0xff89('0x21'),_0x5e675e+'-'+_0x4ea7da+'/'+_0x3e2433)[_0xff89('0x1b')](_0x383e6b);}return null;};}function patchUpdates(_0x44c5c1){return function(_0x5b1b34){try{jsonpatch[_0xff89('0x22')](_0x5b1b34,_0x44c5c1,!![]);}catch(_0x48477c){return BPromise[_0xff89('0x23')](_0x48477c);}return _0x5b1b34[_0xff89('0x24')]();};}function saveUpdates(_0x19c493,_0x392001){return function(_0x2d63aa){if(_0x2d63aa){return _0x2d63aa[_0xff89('0x25')](_0x19c493)['then'](function(_0x1a5bf8){return _0x1a5bf8;});}return null;};}function removeEntity(_0x5aebbe,_0x4dc956){return function(_0x446e16){if(_0x446e16){return _0x446e16[_0xff89('0x26')]()['then'](function(){_0x5aebbe[_0xff89('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d807d,_0xf2d7a8){return function(_0x43908b){if(!_0x43908b){_0x3d807d['sendStatus'](0x194);}return _0x43908b;};}function handleError(_0x3feaf1,_0x5890ae){_0x5890ae=_0x5890ae||0x1f4;return function(_0x5ef937){logger['error'](_0x5ef937[_0xff89('0x27')]);if(_0x5ef937[_0xff89('0x28')]){delete _0x5ef937[_0xff89('0x28')];}_0x3feaf1['status'](_0x5890ae)[_0xff89('0x29')](_0x5ef937);};}exports['index']=function(_0x211b99,_0x408e87){var _0x1fc9ef={},_0x49f689={},_0x404f87={'count':0x0,'rows':[]};var _0x36b0b3=_['map'](db[_0xff89('0x2a')]['rawAttributes'],function(_0x280e96){return{'name':_0x280e96[_0xff89('0x2b')],'type':_0x280e96[_0xff89('0x2c')][_0xff89('0x2d')]};});_0x49f689[_0xff89('0x2e')]=_[_0xff89('0x2f')](_0x36b0b3,_0xff89('0x28'));_0x49f689[_0xff89('0x30')]=_['keys'](_0x211b99[_0xff89('0x30')]);_0x49f689[_0xff89('0x31')]=_[_0xff89('0x32')](_0x49f689[_0xff89('0x2e')],_0x49f689[_0xff89('0x30')]);_0x1fc9ef['attributes']=_[_0xff89('0x32')](_0x49f689['model'],qs[_0xff89('0x33')](_0x211b99['query']['fields']));_0x1fc9ef[_0xff89('0x34')]=_0x1fc9ef['attributes'][_0xff89('0x35')]?_0x1fc9ef[_0xff89('0x34')]:_0x49f689[_0xff89('0x2e')];if(!_0x211b99[_0xff89('0x30')][_0xff89('0x36')](_0xff89('0x37'))){_0x1fc9ef[_0xff89('0x1f')]=qs[_0xff89('0x1f')](_0x211b99[_0xff89('0x30')][_0xff89('0x1f')]);_0x1fc9ef[_0xff89('0x1d')]=qs[_0xff89('0x1d')](_0x211b99[_0xff89('0x30')][_0xff89('0x1d')]);}_0x1fc9ef[_0xff89('0x38')]=qs[_0xff89('0x39')](_0x211b99[_0xff89('0x30')][_0xff89('0x39')]);_0x1fc9ef[_0xff89('0x3a')]=qs[_0xff89('0x31')](_['pick'](_0x211b99[_0xff89('0x30')],_0x49f689['filters']),_0x36b0b3);if(_0x211b99[_0xff89('0x30')][_0xff89('0x3b')]){_0x1fc9ef[_0xff89('0x3a')]=_[_0xff89('0x3c')](_0x1fc9ef[_0xff89('0x3a')],{'$or':_[_0xff89('0x2f')](_0x36b0b3,function(_0x4a8a8a){if(_0x4a8a8a['type']!==_0xff89('0x3d')){var _0x171bcd={};_0x171bcd[_0x4a8a8a['name']]={'$like':'%'+_0x211b99[_0xff89('0x30')][_0xff89('0x3b')]+'%'};return _0x171bcd;}})});}_0x1fc9ef=_[_0xff89('0x3c')]({},_0x1fc9ef,_0x211b99[_0xff89('0x3e')]);var _0x23dc00={'where':_0x1fc9ef[_0xff89('0x3a')]};return db['AnalyticTreeReport'][_0xff89('0x1e')](_0x23dc00)['then'](function(_0x5d8317){_0x404f87['count']=_0x5d8317;if(_0x211b99[_0xff89('0x30')][_0xff89('0x3f')]){_0x1fc9ef[_0xff89('0x40')]=[{'all':!![]}];}return db[_0xff89('0x2a')][_0xff89('0x41')](_0x1fc9ef);})[_0xff89('0x42')](function(_0x2726fd){_0x404f87[_0xff89('0x43')]=_0x2726fd;return _0x404f87;})['then'](respondWithFilteredResult(_0x408e87,_0x1fc9ef))[_0xff89('0x44')](handleError(_0x408e87,null));};exports[_0xff89('0x45')]=function(_0x1f0060,_0x25c5fe){var _0x3dfd8a={'raw':!![],'where':{'id':_0x1f0060['params']['id']}},_0x3f41a4={};_0x3f41a4[_0xff89('0x2e')]=_[_0xff89('0x46')](db[_0xff89('0x2a')][_0xff89('0x47')]);_0x3f41a4[_0xff89('0x30')]=_[_0xff89('0x46')](_0x1f0060[_0xff89('0x30')]);_0x3f41a4[_0xff89('0x31')]=_[_0xff89('0x32')](_0x3f41a4[_0xff89('0x2e')],_0x3f41a4[_0xff89('0x30')]);_0x3dfd8a[_0xff89('0x34')]=_['intersection'](_0x3f41a4[_0xff89('0x2e')],qs['fields'](_0x1f0060['query']['fields']));_0x3dfd8a[_0xff89('0x34')]=_0x3dfd8a['attributes'][_0xff89('0x35')]?_0x3dfd8a['attributes']:_0x3f41a4[_0xff89('0x2e')];if(_0x1f0060[_0xff89('0x30')]['includeAll']){_0x3dfd8a[_0xff89('0x40')]=[{'all':!![]}];}_0x3dfd8a=_[_0xff89('0x3c')]({},_0x3dfd8a,_0x1f0060[_0xff89('0x3e')]);return db[_0xff89('0x2a')]['find'](_0x3dfd8a)['then'](handleEntityNotFound(_0x25c5fe,null))[_0xff89('0x42')](respondWithResult(_0x25c5fe,null))[_0xff89('0x44')](handleError(_0x25c5fe,null));};exports['create']=function(_0x2978e0,_0x4f849f){return db[_0xff89('0x2a')]['create'](_0x2978e0[_0xff89('0x48')],{})[_0xff89('0x42')](respondWithResult(_0x4f849f,0xc9))['catch'](handleError(_0x4f849f,null));};exports[_0xff89('0x25')]=function(_0x1ecb14,_0x95f5){if(_0x1ecb14['body']['id']){delete _0x1ecb14['body']['id'];}return db[_0xff89('0x2a')][_0xff89('0x49')]({'where':{'id':_0x1ecb14[_0xff89('0x4a')]['id']}})[_0xff89('0x42')](handleEntityNotFound(_0x95f5,null))['then'](saveUpdates(_0x1ecb14['body'],null))['then'](respondWithResult(_0x95f5,null))[_0xff89('0x44')](handleError(_0x95f5,null));};exports['destroy']=function(_0x38db6c,_0x1caa39){return db[_0xff89('0x2a')][_0xff89('0x49')]({'where':{'id':_0x38db6c['params']['id']}})[_0xff89('0x42')](handleEntityNotFound(_0x1caa39,null))['then'](removeEntity(_0x1caa39,null))[_0xff89('0x44')](handleError(_0x1caa39,null));}; \ No newline at end of file +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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 8e62d79..77c592f 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 _0xc310=['moment','bluebird','request-promise','rimraf','exports','define','AnalyticTreeReport','lodash','../../config/logger','api'];(function(_0x2a6ddc,_0x26c454){var _0x4e76c3=function(_0x2ee9cd){while(--_0x2ee9cd){_0x2a6ddc['push'](_0x2a6ddc['shift']());}};_0x4e76c3(++_0x26c454);}(_0xc310,0xcf));var _0x0c31=function(_0x5b56c8,_0x12eb0b){_0x5b56c8=_0x5b56c8-0x0;var _0x499a47=_0xc310[_0x5b56c8];return _0x499a47;};'use strict';var _=require(_0x0c31('0x0'));var util=require('util');var logger=require(_0x0c31('0x1'))(_0x0c31('0x2'));var moment=require(_0x0c31('0x3'));var BPromise=require(_0x0c31('0x4'));var rp=require(_0x0c31('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c31('0x6'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0x0c31('0x7')]=function(_0x1bf2a9,_0x482567){return _0x1bf2a9[_0x0c31('0x8')](_0x0c31('0x9'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 7657daf..663b8c1 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x5cbd7e,_0x37db0e){_0x5cbd7e=_0x5cbd7e-0x0;var _0x55c701=_0x7a54[_0x5cbd7e];return _0x55c701;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +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 diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 32bf39f..ad01c3c 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 _0xbb02=['show','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index'];(function(_0x36fe46,_0x40010c){var _0x4d2e9c=function(_0x2dfa20){while(--_0x2dfa20){_0x36fe46['push'](_0x36fe46['shift']());}};_0x4d2e9c(++_0x40010c);}(_0xbb02,0x93));var _0x2bb0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xbb02[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x2bb0('0x0'));var util=require(_0x2bb0('0x1'));var path=require(_0x2bb0('0x2'));var timeout=require(_0x2bb0('0x3'));var express=require('express');var router=express[_0x2bb0('0x4')]();var fs_extra=require(_0x2bb0('0x5'));var auth=require(_0x2bb0('0x6'));var interaction=require(_0x2bb0('0x7'));var config=require(_0x2bb0('0x8'));var controller=require(_0x2bb0('0x9'));router[_0x2bb0('0xa')]('/',auth[_0x2bb0('0xb')](),controller[_0x2bb0('0xc')]);router[_0x2bb0('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x2bb0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2bb0('0xe')](_0x2bb0('0xf'),auth[_0x2bb0('0xb')](),controller[_0x2bb0('0x10')]);router[_0x2bb0('0x11')](_0x2bb0('0xf'),auth['isAuthenticated'](),controller[_0x2bb0('0x12')]);module[_0x2bb0('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 5f98e78..307aede 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 _0x7a72=['exports','STRING'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0x7a72,0x1be));var _0x27a7=function(_0x226e13,_0x26ef2a){_0x226e13=_0x226e13-0x0;var _0x53ce21=_0x7a72[_0x226e13];return _0x53ce21;};'use strict';var Sequelize=require('sequelize');module[_0x27a7('0x0')]={'name':{'type':Sequelize[_0x27a7('0x1')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x27a7('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index b2931f9..2f4302b 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 _0x968b=['pick','filter','merge','type','options','includeAll','catch','show','params','clone','get','omit','createdAt','updatedAt','body','find','create','basename','file','filename','mimetype','download','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','update','then','destroy','error','name','send','index','Attachment','rawAttributes','fieldName','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x2e83e1,_0x45c0b1){var _0x2e91c0=function(_0x45697d){while(--_0x45697d){_0x2e83e1['push'](_0x2e83e1['shift']());}};_0x2e91c0(++_0x45c0b1);}(_0x968b,0x16e));var _0xb968=function(_0x148bc0,_0xf5cfdc){_0x148bc0=_0x148bc0-0x0;var _0x34d7d0=_0x968b[_0x148bc0];return _0x34d7d0;};'use strict';var emlformat=require(_0xb968('0x0'));var rimraf=require(_0xb968('0x1'));var zipdir=require(_0xb968('0x2'));var jsonpatch=require(_0xb968('0x3'));var rp=require(_0xb968('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb968('0x5'));var util=require('util');var path=require(_0xb968('0x6'));var sox=require(_0xb968('0x7'));var csv=require(_0xb968('0x8'));var ejs=require(_0xb968('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb968('0xa'));var squel=require(_0xb968('0xb'));var crypto=require('crypto');var jsforce=require(_0xb968('0xc'));var deskjs=require(_0xb968('0xd'));var toCsv=require(_0xb968('0x8'));var querystring=require(_0xb968('0xe'));var Papa=require(_0xb968('0xf'));var Redis=require('ioredis');var authService=require(_0xb968('0x10'));var qs=require(_0xb968('0x11'));var as=require(_0xb968('0x12'));var hardwareService=require(_0xb968('0x13'));var logger=require(_0xb968('0x14'))(_0xb968('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb968('0x16'));var db=require(_0xb968('0x17'))['db'];function respondWithStatusCode(_0x489ae6,_0xb2a066){_0xb2a066=_0xb2a066||0xcc;return function(_0x570384){if(_0x570384){return _0x489ae6[_0xb968('0x18')](_0xb2a066);}return _0x489ae6[_0xb968('0x19')](_0xb2a066)[_0xb968('0x1a')]();};}function respondWithResult(_0x22c2b2,_0x4e2415){_0x4e2415=_0x4e2415||0xc8;return function(_0x1d209c){if(_0x1d209c){return _0x22c2b2[_0xb968('0x19')](_0x4e2415)['json'](_0x1d209c);}};}function respondWithFilteredResult(_0x5691b5,_0x507269){return function(_0xef004e){if(_0xef004e){var _0x785e82=typeof _0x507269[_0xb968('0x1b')]===_0xb968('0x1c')&&typeof _0x507269['limit']===_0xb968('0x1c');var _0x1c1daf=_0xef004e[_0xb968('0x1d')];var _0x17c914=_0x785e82?0x0:_0x507269[_0xb968('0x1b')];var _0x42ad5c=_0x785e82?_0xef004e[_0xb968('0x1d')]:_0x507269[_0xb968('0x1b')]+_0x507269['limit'];var _0x23f3b9;if(_0x42ad5c>=_0x1c1daf){_0x42ad5c=_0x1c1daf;_0x23f3b9=0xc8;}else{_0x23f3b9=0xce;}_0x5691b5[_0xb968('0x19')](_0x23f3b9);return _0x5691b5[_0xb968('0x1e')]('Content-Range',_0x17c914+'-'+_0x42ad5c+'/'+_0x1c1daf)[_0xb968('0x1f')](_0xef004e);}return null;};}function patchUpdates(_0x1f3a00){return function(_0x4736ef){try{jsonpatch[_0xb968('0x20')](_0x4736ef,_0x1f3a00,!![]);}catch(_0x2a7616){return BPromise[_0xb968('0x21')](_0x2a7616);}return _0x4736ef['save']();};}function saveUpdates(_0x427b2f,_0x5321bb){return function(_0x41c3a9){if(_0x41c3a9){return _0x41c3a9[_0xb968('0x22')](_0x427b2f)[_0xb968('0x23')](function(_0x2e1b14){return _0x2e1b14;});}return null;};}function removeEntity(_0x5bb351,_0x3d7665){return function(_0x43f766){if(_0x43f766){return _0x43f766[_0xb968('0x24')]()[_0xb968('0x23')](function(){_0x5bb351[_0xb968('0x19')](0xcc)[_0xb968('0x1a')]();});}};}function handleEntityNotFound(_0x11199d,_0xa98390){return function(_0x6652a7){if(!_0x6652a7){_0x11199d[_0xb968('0x18')](0x194);}return _0x6652a7;};}function handleError(_0x51e3c9,_0x36a2c8){_0x36a2c8=_0x36a2c8||0x1f4;return function(_0x4a6527){logger[_0xb968('0x25')](_0x4a6527['stack']);if(_0x4a6527['name']){delete _0x4a6527[_0xb968('0x26')];}_0x51e3c9[_0xb968('0x19')](_0x36a2c8)[_0xb968('0x27')](_0x4a6527);};}exports[_0xb968('0x28')]=function(_0x174c62,_0x1099df){var _0x40366f={},_0xeafb76={},_0x1f5ab4={'count':0x0,'rows':[]};var _0x4dd2ed=_['map'](db[_0xb968('0x29')][_0xb968('0x2a')],function(_0x110d89){return{'name':_0x110d89[_0xb968('0x2b')],'type':_0x110d89['type'][_0xb968('0x2c')]};});_0xeafb76[_0xb968('0x2d')]=_[_0xb968('0x2e')](_0x4dd2ed,_0xb968('0x26'));_0xeafb76['query']=_[_0xb968('0x2f')](_0x174c62['query']);_0xeafb76[_0xb968('0x30')]=_[_0xb968('0x31')](_0xeafb76[_0xb968('0x2d')],_0xeafb76[_0xb968('0x32')]);_0x40366f[_0xb968('0x33')]=_[_0xb968('0x31')](_0xeafb76[_0xb968('0x2d')],qs[_0xb968('0x34')](_0x174c62[_0xb968('0x32')][_0xb968('0x34')]));_0x40366f[_0xb968('0x33')]=_0x40366f[_0xb968('0x33')]['length']?_0x40366f['attributes']:_0xeafb76['model'];if(!_0x174c62['query'][_0xb968('0x35')](_0xb968('0x36'))){_0x40366f[_0xb968('0x37')]=qs[_0xb968('0x37')](_0x174c62['query'][_0xb968('0x37')]);_0x40366f[_0xb968('0x1b')]=qs[_0xb968('0x1b')](_0x174c62[_0xb968('0x32')][_0xb968('0x1b')]);}_0x40366f[_0xb968('0x38')]=qs[_0xb968('0x39')](_0x174c62['query'][_0xb968('0x39')]);_0x40366f[_0xb968('0x3a')]=qs['filters'](_[_0xb968('0x3b')](_0x174c62[_0xb968('0x32')],_0xeafb76[_0xb968('0x30')]),_0x4dd2ed);if(_0x174c62[_0xb968('0x32')][_0xb968('0x3c')]){_0x40366f['where']=_[_0xb968('0x3d')](_0x40366f[_0xb968('0x3a')],{'$or':_['map'](_0x4dd2ed,function(_0x4b9175){if(_0x4b9175[_0xb968('0x3e')]!=='VIRTUAL'){var _0x35469f={};_0x35469f[_0x4b9175[_0xb968('0x26')]]={'$like':'%'+_0x174c62['query']['filter']+'%'};return _0x35469f;}})});}_0x40366f=_[_0xb968('0x3d')]({},_0x40366f,_0x174c62[_0xb968('0x3f')]);var _0x22ebb8={'where':_0x40366f['where']};return db[_0xb968('0x29')][_0xb968('0x1d')](_0x22ebb8)['then'](function(_0x4928ad){_0x1f5ab4[_0xb968('0x1d')]=_0x4928ad;if(_0x174c62[_0xb968('0x32')][_0xb968('0x40')]){_0x40366f['include']=[{'all':!![]}];}return db[_0xb968('0x29')]['findAll'](_0x40366f);})[_0xb968('0x23')](function(_0x1f8976){_0x1f5ab4['rows']=_0x1f8976;return _0x1f5ab4;})[_0xb968('0x23')](respondWithFilteredResult(_0x1099df,_0x40366f))[_0xb968('0x41')](handleError(_0x1099df,null));};exports[_0xb968('0x42')]=function(_0x4f227b,_0x50016e){var _0x19780f={'raw':!![],'where':{'id':_0x4f227b[_0xb968('0x43')]['id']}},_0x20d743={};_0x20d743[_0xb968('0x2d')]=_[_0xb968('0x2f')](db[_0xb968('0x29')]['rawAttributes']);_0x20d743[_0xb968('0x32')]=_[_0xb968('0x2f')](_0x4f227b['query']);_0x20d743[_0xb968('0x30')]=_[_0xb968('0x31')](_0x20d743[_0xb968('0x2d')],_0x20d743['query']);_0x19780f[_0xb968('0x33')]=_['intersection'](_0x20d743[_0xb968('0x2d')],qs[_0xb968('0x34')](_0x4f227b[_0xb968('0x32')][_0xb968('0x34')]));_0x19780f[_0xb968('0x33')]=_0x19780f[_0xb968('0x33')]['length']?_0x19780f['attributes']:_0x20d743['model'];if(_0x4f227b[_0xb968('0x32')][_0xb968('0x40')]){_0x19780f['include']=[{'all':!![]}];}_0x19780f=_[_0xb968('0x3d')]({},_0x19780f,_0x4f227b['options']);return db['Attachment']['find'](_0x19780f)[_0xb968('0x23')](handleEntityNotFound(_0x50016e,null))[_0xb968('0x23')](respondWithResult(_0x50016e,null))['catch'](handleError(_0x50016e,null));};exports[_0xb968('0x44')]=function(_0x3a9f7d,_0x129b4b){var _0x2d0763={'where':{'id':_0x3a9f7d[_0xb968('0x43')]['id']}},_0x5da24e={};_0x5da24e[_0xb968('0x2d')]=_[_0xb968('0x2f')](db['Attachment'][_0xb968('0x2a')]);_0x2d0763[_0xb968('0x33')]=_[_0xb968('0x31')](_0x5da24e[_0xb968('0x2d')],qs[_0xb968('0x34')](_0x3a9f7d[_0xb968('0x32')][_0xb968('0x34')]));_0x2d0763[_0xb968('0x33')]=_0x2d0763[_0xb968('0x33')]['length']?_0x2d0763[_0xb968('0x33')]:_0x5da24e['model'];if(_0x3a9f7d[_0xb968('0x32')][_0xb968('0x40')]){_0x2d0763['include']=[{'all':!![]}];}_0x2d0763=_['merge']({},_0x2d0763,_0x3a9f7d['options']);return db[_0xb968('0x29')]['find'](_0x2d0763)[_0xb968('0x23')](handleEntityNotFound(_0x129b4b,null))[_0xb968('0x23')](function(_0xb4b323){if(_0xb4b323){var _0x115281=_0xb4b323[_0xb968('0x45')]({'plain':!![]});_0x115281=qs[_0xb968('0x46')](_0x115281,['id',_0xb968('0x47'),_0xb968('0x48')]);_0x3a9f7d['body']=_[_0xb968('0x46')](_0x3a9f7d[_0xb968('0x49')],['id',_0xb968('0x47'),_0xb968('0x48')]);return db[_0xb968('0x29')]['create'](_[_0xb968('0x3d')](_0x115281,_0x3a9f7d[_0xb968('0x49')]),{'include':_0x3a9f7d[_0xb968('0x32')][_0xb968('0x40')]?[{'all':!![]}]:undefined});}})[_0xb968('0x23')](respondWithResult(_0x129b4b,0xc9))[_0xb968('0x41')](handleError(_0x129b4b,null));};exports[_0xb968('0x22')]=function(_0x345e72,_0x1d12d8){if(_0x345e72['body']['id']){delete _0x345e72['body']['id'];}return db['Attachment'][_0xb968('0x4a')]({'where':{'id':_0x345e72['params']['id']}})[_0xb968('0x23')](handleEntityNotFound(_0x1d12d8,null))[_0xb968('0x23')](saveUpdates(_0x345e72['body'],null))[_0xb968('0x23')](respondWithResult(_0x1d12d8,null))[_0xb968('0x41')](handleError(_0x1d12d8,null));};exports[_0xb968('0x24')]=function(_0x333eeb,_0x393821){return db['Attachment']['find']({'where':{'id':_0x333eeb[_0xb968('0x43')]['id']}})['then'](handleEntityNotFound(_0x393821,null))[_0xb968('0x23')](removeEntity(_0x393821,null))[_0xb968('0x41')](handleError(_0x393821,null));};exports[_0xb968('0x4b')]=function(_0x4c1313,_0xc49574,_0x44d623){_0x4c1313[_0xb968('0x49')][_0xb968('0x26')]=_0x4c1313['file']['originalname'];_0x4c1313[_0xb968('0x49')][_0xb968('0x4c')]=_0x4c1313[_0xb968('0x4d')][_0xb968('0x4e')];_0x4c1313[_0xb968('0x49')][_0xb968('0x3e')]=_0x4c1313['file'][_0xb968('0x4f')];return db[_0xb968('0x29')][_0xb968('0x4b')](_0x4c1313['body'])[_0xb968('0x23')](respondWithResult(_0xc49574,0xc9))['catch'](handleError(_0xc49574,null));};exports[_0xb968('0x50')]=function(_0x189f07,_0x5791a2,_0x3c4055){return db['Attachment']['findOne']({'where':{'id':_0x189f07[_0xb968('0x43')]['id']},'raw':!![]})[_0xb968('0x23')](handleEntityNotFound(_0x5791a2,null))[_0xb968('0x23')](function(_0x216194){if(_0x216194){var _0x32b5d5=_0x216194['ChatOfflineMessageId']!==null;var _0x24e391=path[_0xb968('0x51')](config[_0xb968('0x52')],_0xb968('0x53'));if(_0x32b5d5){_0x24e391=path['join'](_0x24e391,_0xb968('0x54'));}var _0x2f435c=path[_0xb968('0x51')](_0x24e391,_0x216194[_0xb968('0x4c')]);return _0x5791a2[_0xb968('0x50')](_0x2f435c);}})['catch'](handleError(_0x5791a2,null));}; \ No newline at end of file +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 diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index f124f30..763a30c 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 _0xf39f=['request-promise','path','rimraf','../../config/environment','exports','define','Attachment','attachments','lodash','util','../../config/logger','moment','bluebird'];(function(_0x59dccc,_0x184c1c){var _0xc97bcb=function(_0x1ddbcb){while(--_0x1ddbcb){_0x59dccc['push'](_0x59dccc['shift']());}};_0xc97bcb(++_0x184c1c);}(_0xf39f,0xff));var _0xff39=function(_0x27ef6a,_0x135e40){_0x27ef6a=_0x27ef6a-0x0;var _0x5371b1=_0xf39f[_0x27ef6a];return _0x5371b1;};'use strict';var _=require(_0xff39('0x0'));var util=require(_0xff39('0x1'));var logger=require(_0xff39('0x2'))('api');var moment=require(_0xff39('0x3'));var BPromise=require(_0xff39('0x4'));var rp=require(_0xff39('0x5'));var fs=require('fs');var path=require(_0xff39('0x6'));var rimraf=require(_0xff39('0x7'));var config=require(_0xff39('0x8'));var attributes=require('./attachment.attributes');module[_0xff39('0x9')]=function(_0x33fb02,_0x34fdd2){return _0x33fb02[_0xff39('0xa')](_0xff39('0xb'),attributes,{'tableName':_0xff39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js index 38037c4..4510e67 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 _0xc6d8=['moment','randomstring','../../mysqldb','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','message','catch','create','body','options','raw','CreateAttachment','lodash'];(function(_0x54e141,_0x13a666){var _0x325464=function(_0xfe5aad){while(--_0xfe5aad){_0x54e141['push'](_0x54e141['shift']());}};_0x325464(++_0x13a666);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x4b4340,_0x295fc0){_0x4b4340=_0x4b4340-0x0;var _0x4cdb42=_0xc6d8[_0x4b4340];return _0x4cdb42;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var moment=require(_0x8c6d('0x1'));var BPromise=require('bluebird');var rs=require(_0x8c6d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8c6d('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8c6d('0x4'));var config=require(_0x8c6d('0x5'));var jayson=require(_0x8c6d('0x6'));var client=jayson[_0x8c6d('0x7')][_0x8c6d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2dbb52,_0x98cae4,_0x5529f1){return new BPromise(function(_0x1496ba,_0x75c49f){return client[_0x8c6d('0x9')](_0x2dbb52,_0x5529f1)['then'](function(_0x3cecc1){logger[_0x8c6d('0xa')](_0x8c6d('0xb'),_0x98cae4,_0x8c6d('0xc'));logger[_0x8c6d('0xd')](_0x8c6d('0xe'),_0x98cae4,_0x8c6d('0xc'),JSON[_0x8c6d('0xf')](_0x3cecc1));if(_0x3cecc1['error']){if(_0x3cecc1[_0x8c6d('0x10')]['code']===0x1f4){logger['error'](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x75c49f(_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);}logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x3cecc1[_0x8c6d('0x10')][_0x8c6d('0x11')]);return _0x1496ba(_0x3cecc1[_0x8c6d('0x10')]['message']);}else{logger[_0x8c6d('0xa')]('Attachment,\x20%s,\x20%s',_0x98cae4,_0x8c6d('0xc'));_0x1496ba(_0x3cecc1['result'][_0x8c6d('0x11')]);}})[_0x8c6d('0x12')](function(_0x52ed7b){logger[_0x8c6d('0x10')](_0x8c6d('0xb'),_0x98cae4,_0x52ed7b);_0x75c49f(_0x52ed7b);});});}exports['CreateAttachment']=function(_0x3e5495){var _0x5a22de=this;return new Promise(function(_0x4c2f8d,_0x21b8ee){return db['Attachment'][_0x8c6d('0x13')](_0x3e5495[_0x8c6d('0x14')],{'raw':_0x3e5495[_0x8c6d('0x15')]?_0x3e5495[_0x8c6d('0x15')][_0x8c6d('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x5512be){logger['info'](_0x8c6d('0x17'),_0x3e5495);logger['debug'](_0x8c6d('0x17'),_0x3e5495,JSON['stringify'](_0x5512be));_0x4c2f8d(_0x5512be);})['catch'](function(_0x37fd7c){logger[_0x8c6d('0x10')]('CreateAttachment',_0x37fd7c['message'],_0x3e5495);_0x21b8ee(_0x5a22de['error'](0x1f4,_0x37fd7c['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 43f4b5f..d2e5963 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 _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x18aaaf,_0x385db6){_0x18aaaf=_0x18aaaf-0x0;var _0x52d892=_0x0b0e[_0x18aaaf];return _0x52d892;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_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 diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index fcc650c..afa26a8 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 _0x44c3=['agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','getLicense','catch','passport','passport-google-oauth20','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','/login','callback','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','User','map','value','admin','user'];(function(_0x46688f,_0x302e66){var _0x5ee527=function(_0x38337c){while(--_0x38337c){_0x46688f['push'](_0x46688f['shift']());}};_0x5ee527(++_0x302e66);}(_0x44c3,0x1a0));var _0x344c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x44c3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var passport=require(_0x344c('0x0'));var GoogleStrategy=require(_0x344c('0x1'))['Strategy'];var moment=require('moment');var db=require(_0x344c('0x2'))['db'];var config=require(_0x344c('0x3'));var signToken=require(_0x344c('0x4'))[_0x344c('0x5')];var utils=require(_0x344c('0x6'));exports[_0x344c('0x7')]=passport[_0x344c('0x8')](_0x344c('0x9'),{'failureRedirect':_0x344c('0xa'),'scope':['profile','email'],'session':![]});exports[_0x344c('0xb')]=passport['authenticate'](_0x344c('0x9'),{'failureRedirect':_0x344c('0xa'),'session':![]});passport[_0x344c('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x344c('0x9')][_0x344c('0xd')]:'id','clientSecret':config[_0x344c('0x9')]?config[_0x344c('0x9')][_0x344c('0xe')]:_0x344c('0xf'),'callbackURL':config[_0x344c('0x9')]?config[_0x344c('0x9')][_0x344c('0x10')]:''},function(_0x4fe977,_0x6b66fa,_0x498ed0,_0x24863c){var _0x3b291a,_0x791553;return db[_0x344c('0x11')][_0x344c('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x344c('0x13')],'raw':!![]})[_0x344c('0x14')](function(_0x56358c){_0x3b291a=_0x56358c;return db[_0x344c('0x15')]['find']({'where':{'email':_[_0x344c('0x16')](_0x498ed0['emails'],_0x344c('0x17')),'role':{'$or':[_0x344c('0x18'),_0x344c('0x19'),_0x344c('0x1a')]}}});})[_0x344c('0x14')](function(_0xab16b3){_0x791553=_0xab16b3;if(_0x791553){if(_0x791553[_0x344c('0x1b')]){return _0x24863c(_0x344c('0x1c'));}else if(_0x3b291a[_0x344c('0x13')]>0x0){if(_0x791553[_0x344c('0x1d')]){if(moment(_0x791553['blockedAt'])[_0x344c('0x1e')](_0x3b291a[_0x344c('0x13')],_0x344c('0x1f'))>moment()){return _0x24863c(_0x344c('0x1c'));}else{return utils['clearBlockUser'](_0x791553,0x0,![],null)['then'](function(){return utils['getLicense'](_0x791553);})[_0x344c('0x14')](function(){return _0x24863c(null,_0x791553);});}}else{return utils[_0x344c('0x20')](_0x791553)['then'](function(){return _0x24863c(null,_0x791553);});}}else{return utils[_0x344c('0x20')](_0x791553)[_0x344c('0x14')](function(){return _0x24863c(null,_0x791553);});}}return _0x24863c(_0x344c('0x1c'));})[_0x344c('0x21')](function(_0x57e375){_0x24863c(_0x57e375);});})); \ No newline at end of file +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 diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 9e9e7ee..dc036c7 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 _0xbf24=['exports','express','passport','Router','../../components/auth/service','get','login','callback','isMiddleware','setTokenCookie'];(function(_0x29e116,_0x451907){var _0x918c53=function(_0x125adc){while(--_0x125adc){_0x29e116['push'](_0x29e116['shift']());}};_0x918c53(++_0x451907);}(_0xbf24,0x155));var _0x4bf2=function(_0x153c6a,_0x2a217a){_0x153c6a=_0x153c6a-0x0;var _0xce898f=_0xbf24[_0x153c6a];return _0xce898f;};'use strict';var express=require(_0x4bf2('0x0'));var passport=require(_0x4bf2('0x1'));var router=express[_0x4bf2('0x2')]();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require(_0x4bf2('0x3'));router[_0x4bf2('0x4')]('/',controller[_0x4bf2('0x5')]);router[_0x4bf2('0x4')]('/callback',controller[_0x4bf2('0x6')],authService[_0x4bf2('0x7')],userController[_0x4bf2('0x5')],authService[_0x4bf2('0x8')]);module[_0x4bf2('0x9')]=router; \ No newline at end of file +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 diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 0b11c49..e4b1682 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 _0xea85=['request','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','email','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','pass','format','\x22%s\x22\x20<%s>'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xea85,0x1cd));var _0x5ea8=function(_0x1ff48d,_0x488d6c){_0x1ff48d=_0x1ff48d-0x0;var _0x4958c1=_0xea85[_0x1ff48d];return _0x4958c1;};'use strict';var util=require(_0x5ea8('0x0'));var passport=require('passport');var LocalStrategy=require(_0x5ea8('0x1'))[_0x5ea8('0x2')];var jayson=require(_0x5ea8('0x3'));var _=require(_0x5ea8('0x4'));var rs=require(_0x5ea8('0x5'));var moment=require(_0x5ea8('0x6'));var db=require(_0x5ea8('0x7'))['db'];var authService=require(_0x5ea8('0x8'));var utils=require(_0x5ea8('0x9'));var client=jayson[_0x5ea8('0xa')][_0x5ea8('0xb')]({'port':0x232b});function localAuthenticate(_0x3e8eeb,_0x322848,_0x25aa3c,_0xa604ff){var _0x53baa9,_0x27938b;return db[_0x5ea8('0xc')][_0x5ea8('0xd')]({'where':{'id':0x1},'attributes':[_0x5ea8('0xe'),'blockDuration'],'raw':!![]})[_0x5ea8('0xf')](function(_0x1fa8ba){_0x53baa9=_0x1fa8ba;return _0x3e8eeb[_0x5ea8('0xd')]({'attributes':['id',_0x5ea8('0x10'),_0x5ea8('0x11'),_0x5ea8('0x12'),_0x5ea8('0x13'),_0x5ea8('0x14'),_0x5ea8('0x15'),_0x5ea8('0x16'),_0x5ea8('0x17')],'where':{'name':_0x322848,'role':{'$or':['admin',_0x5ea8('0x18'),'agent']}}});})[_0x5ea8('0xf')](function(_0x35dbf4){if(!_0x35dbf4||_0x35dbf4&&_0x35dbf4[_0x5ea8('0x10')]!==_0x322848){throw new Error(_0x5ea8('0x19'));}else{_0x27938b=_0x35dbf4;return _0x27938b;}})[_0x5ea8('0xf')](function(){_0x27938b[_0x5ea8('0x1a')](_0x25aa3c,function(_0x326643,_0x2a82e3){var _0xf63e52=_0x27938b[_0x5ea8('0x17')]+0x1;if(_0x326643){return _0xa604ff(_0x326643);}else if(!_0x2a82e3){if(_0x27938b['disabled']){return _0xa604ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x53baa9[_0x5ea8('0xe')]>0x0){if(_0x27938b[_0x5ea8('0x15')]){if(_0x53baa9[_0x5ea8('0x1b')]>0x0){if(moment(_0x27938b[_0x5ea8('0x16')])[_0x5ea8('0x1c')](_0x53baa9[_0x5ea8('0x1b')],_0x5ea8('0x1d'))>moment()){return _0xa604ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5ea8('0x1e')](_0x27938b,_0xf63e52,![],null)[_0x5ea8('0xf')](function(){return _0xa604ff(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}}else{if(_0xf63e52>=_0x53baa9[_0x5ea8('0xe')]){return utils['clearBlockUser'](_0x27938b,0x0,!![],moment())[_0x5ea8('0xf')](function(){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});});}else{return utils[_0x5ea8('0x1e')](_0x27938b,_0xf63e52,![],null)['then'](function(){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});});}}}else{return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}}else{if(_0x27938b[_0x5ea8('0x14')]){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}else if(_0x53baa9[_0x5ea8('0xe')]>0x0){if(_0x27938b[_0x5ea8('0x15')]){if(_0x53baa9[_0x5ea8('0x1b')]>0x0){if(moment(_0x27938b[_0x5ea8('0x16')])[_0x5ea8('0x1c')](_0x53baa9[_0x5ea8('0x1b')],'minutes')>moment()){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}else{return utils['clearBlockUser'](_0x27938b,0x0,![],null)[_0x5ea8('0xf')](function(){return utils[_0x5ea8('0x1f')](_0x27938b);})['then'](function(){return _0xa604ff(null,_0x27938b);});}}else{return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}}else{return utils[_0x5ea8('0x1e')](_0x27938b,0x0,![],null)[_0x5ea8('0xf')](function(){return utils[_0x5ea8('0x1f')](_0x27938b);})[_0x5ea8('0xf')](function(){return _0xa604ff(null,_0x27938b);})['catch'](function(_0x26dcf2){return _0xa604ff(null,![],_0x26dcf2);});}}else{if(_0x27938b[_0x5ea8('0x15')]){return _0xa604ff(null,![],{'message':_0x5ea8('0x19')});}else{return utils[_0x5ea8('0x1f')](_0x27938b)[_0x5ea8('0xf')](function(){return _0xa604ff(null,_0x27938b);});}}}});})[_0x5ea8('0x20')](function(_0x310f00){return _0xa604ff(null,![],_0x310f00);});}function sendServiceMail(_0x1d15ff){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0x5ea8('0x10'),_0x5ea8('0x21')],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]})[_0x5ea8('0xf')](function(_0x10d7ee){if(!_0x10d7ee){throw new Error(_0x5ea8('0x22'));}var _0x5ccdc0={'tls':{'rejectUnauthorized':![]}};if(_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x24')]){_0x5ccdc0[_0x5ea8('0x24')]=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x24')];}else{_0x5ccdc0['host']=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x25')];_0x5ccdc0[_0x5ea8('0x26')]=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x26')];_0x5ccdc0[_0x5ea8('0x27')]=_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x27')];}if(_0x10d7ee['Smtp']['authentication']){_0x5ccdc0['auth']={'user':_0x10d7ee['Smtp'][_0x5ea8('0x18')],'pass':_0x10d7ee[_0x5ea8('0x23')][_0x5ea8('0x28')]};}var _0x2d8569={'account':_0x5ccdc0,'message':_['merge']({'from':util[_0x5ea8('0x29')](_0x5ea8('0x2a'),_0x10d7ee[_0x5ea8('0x10')],_0x10d7ee['email']||_0x10d7ee['Smtp'][_0x5ea8('0x18')])},_0x1d15ff)};return client[_0x5ea8('0x2b')]('SendMail',_0x2d8569);})[_0x5ea8('0xf')](function(_0x2043f7){if(_0x2043f7['error']){throw new Error(util[_0x5ea8('0x29')](_0x5ea8('0x2c'),_0x2043f7[_0x5ea8('0x2d')][_0x5ea8('0x2e')]||JSON[_0x5ea8('0x2f')](_0x2043f7['error'])));}return!![];});}function handleError(_0x5cd6ad,_0x26cce2,_0x4b6f75){return _0x5cd6ad[_0x5ea8('0x30')](_0x26cce2||0x1f4)[_0x5ea8('0x31')]({'message':_0x4b6f75?_0x4b6f75['message']||_0x4b6f75:''});}exports[_0x5ea8('0x32')]=function(_0x336484,_0x29b858,_0x2f32be){passport[_0x5ea8('0x1a')]('local',function(_0x37e513,_0x1d41af,_0x272f4d){var _0x1ca94d=_0x37e513||_0x272f4d;if(_0x1ca94d){return handleError(_0x29b858,0x191,_0x1ca94d);}if(!_0x1d41af){return handleError(_0x29b858,0x194,{'message':_0x5ea8('0x33')});}else{var _0x26194a={'payload':{'id':_0x1d41af['id'],'role':_0x1d41af['role']},'options':{'expiresIn':0x15180}};return authService[_0x5ea8('0x34')](_0x26194a)[_0x5ea8('0xf')](function(_0x53bb00){_0x29b858[_0x5ea8('0x35')]({'id':_0x1d41af['id'],'token':_0x53bb00,'statusCall':'','isAlreadyLogged':_0x1d41af[_0x5ea8('0x36')]});});}})(_0x336484,_0x29b858,_0x2f32be);};exports[_0x5ea8('0x37')]=function(_0x36479e,_0x5693f9,_0x149b69){if(!_0x36479e['body']['email']){return handleError(_0x5693f9,0x1f4,{'message':_0x5ea8('0x38')});}var _0x3fb795=rs[_0x5ea8('0x39')]();_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')]=_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')][_0x5ea8('0x3b')]()[_0x5ea8('0x3c')]();var _0x5ece13;return db[_0x5ea8('0xc')][_0x5ea8('0xd')]({'where':{'id':0x1},'attributes':[_0x5ea8('0xe'),_0x5ea8('0x1b')],'raw':!![]})[_0x5ea8('0xf')](function(_0x589e00){_0x5ece13=_0x589e00;return db[_0x5ea8('0x3d')][_0x5ea8('0x3e')]({'where':{'email':_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')]}});})[_0x5ea8('0xf')](function(_0x40b0ee){if(!_0x40b0ee){throw new Error(_0x5ea8('0x3f'));}if(_0x40b0ee['disabled']){throw new Error(_0x5ea8('0x40'));}if(_0x40b0ee[_0x5ea8('0x15')]){if(moment(_0x40b0ee['blockedAt'])['add'](_0x5ece13[_0x5ea8('0x1b')],_0x5ea8('0x1d'))>moment()){throw new Error(_0x5ea8('0x41'));}else{_0x40b0ee['blocked']=![];_0x40b0ee['blockedAt']=null;}}_0x40b0ee[_0x5ea8('0x42')]=_0x3fb795;_0x40b0ee['resetPasswordExpires']=Date[_0x5ea8('0x43')]()+0x36ee80;return _0x40b0ee[_0x5ea8('0x44')]();})[_0x5ea8('0xf')](function(){return sendServiceMail({'to':_0x36479e[_0x5ea8('0x3a')][_0x5ea8('0x21')],'subject':_0x5ea8('0x45'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x5ea8('0x46')+_0x5ea8('0x47')+_0x36479e['headers'][_0x5ea8('0x25')]+'/reset/'+_0x3fb795+'\x0a\x0a'+_0x5ea8('0x48')});})[_0x5ea8('0xf')](function(){_0x5693f9[_0x5ea8('0x30')](0xc8)[_0x5ea8('0x31')]({'message':_0x5ea8('0x49')});})[_0x5ea8('0x20')](function(_0x2ffa03){return handleError(_0x5693f9,0x1f4,_0x2ffa03);});};exports[_0x5ea8('0x4a')]=function(_0x225bee,_0x1d017d,_0x2d9508){return db[_0x5ea8('0x3d')][_0x5ea8('0x3e')]({'where':{'resetPasswordToken':_0x225bee['params'][_0x5ea8('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x5ea8('0x43')]()}}})['then'](function(_0xe4e9f6){if(!_0xe4e9f6){throw new Error(_0x5ea8('0x4c'));}return db['Setting']['findOne']({'attributes':['id','securePassword',_0x5ea8('0x4d'),_0x5ea8('0x4e')]})[_0x5ea8('0xf')](function(_0xeb4ceb){if(_0xeb4ceb[_0x5ea8('0x4f')])authService[_0x5ea8('0x50')](_0x225bee['body'][_0x5ea8('0x11')]);if(!_0xeb4ceb[_0x5ea8('0x4d')]||!_0xe4e9f6[_0x5ea8('0x51')])return _0xe4e9f6;authService[_0x5ea8('0x52')](_0x225bee['body'][_0x5ea8('0x11')],_0xe4e9f6['previousPasswords'],_0xeb4ceb[_0x5ea8('0x4e')]);return _0xe4e9f6;})[_0x5ea8('0xf')](function(){_0xe4e9f6[_0x5ea8('0x11')]=_0x225bee[_0x5ea8('0x3a')][_0x5ea8('0x11')];_0xe4e9f6[_0x5ea8('0x42')]=null;_0xe4e9f6['resetPasswordExpires']=null;return _0xe4e9f6['save']();});})[_0x5ea8('0xf')](function(){_0x1d017d[_0x5ea8('0x30')](0xc8)[_0x5ea8('0x31')]({'message':'Password\x20reset!'});})[_0x5ea8('0x20')](function(_0x20b5ff){return handleError(_0x1d017d,0x1f4,_0x20b5ff);});};passport[_0x5ea8('0x53')](new LocalStrategy({'usernameField':_0x5ea8('0x10'),'passwordField':_0x5ea8('0x11')},function(_0x77112f,_0x81993c,_0x168cc9){return localAuthenticate(db['User'],_0x77112f,_0x81993c,_0x168cc9);})); \ No newline at end of file +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 diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index f934ef3..bcd1c63 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 _0xb52c=['post','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x2d6e76,_0x3684f0){var _0x4f651b=function(_0x469f42){while(--_0x469f42){_0x2d6e76['push'](_0x2d6e76['shift']());}};_0x4f651b(++_0x3684f0);}(_0xb52c,0xfd));var _0xcb52=function(_0x3706c9,_0x116ed2){_0x3706c9=_0x3706c9-0x0;var _0x381b53=_0xb52c[_0x3706c9];return _0x381b53;};'use strict';var express=require(_0xcb52('0x0'));var router=express[_0xcb52('0x1')]();var controller=require(_0xcb52('0x2'));router[_0xcb52('0x3')]('/',controller['login']);router[_0xcb52('0x3')]('/forgot',controller[_0xcb52('0x4')]);router[_0xcb52('0x3')](_0xcb52('0x5'),controller[_0xcb52('0x6')]);module[_0xcb52('0x7')]=router; \ No newline at end of file +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 diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 2bb5fdf..30d3c2f 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 _0x6bbe=['STRING','sequelize'];(function(_0x309c84,_0x4b6cd4){var _0x13e5ce=function(_0x3a2d94){while(--_0x3a2d94){_0x309c84['push'](_0x309c84['shift']());}};_0x13e5ce(++_0x4b6cd4);}(_0x6bbe,0x87));var _0xe6bb=function(_0x2b3a83,_0x17a5ea){_0x2b3a83=_0x2b3a83-0x0;var _0x2881c1=_0x6bbe[_0x2b3a83];return _0x2881c1;};'use strict';var Sequelize=require(_0xe6bb('0x0'));module['exports']={'name':{'type':Sequelize[_0xe6bb('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe6bb('0x1')]},'description':{'type':Sequelize[_0xe6bb('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file +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 diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index bde0007..8997390 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 _0x63da=['catch','show','params','keys','options','create','body','find','addConditions','Condition','ids','omit','findOne','order','nolimit','getConditions','addActions','Action','getActions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows'];(function(_0x3b37ba,_0x3dc349){var _0x3e6483=function(_0x5b51d7){while(--_0x5b51d7){_0x3b37ba['push'](_0x3b37ba['shift']());}};_0x3e6483(++_0x3dc349);}(_0x63da,0x67));var _0xa63d=function(_0x45f7c9,_0x192a73){_0x45f7c9=_0x45f7c9-0x0;var _0x2c6810=_0x63da[_0x45f7c9];return _0x2c6810;};'use strict';var emlformat=require(_0xa63d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa63d('0x1'));var jsonpatch=require(_0xa63d('0x2'));var rp=require('request-promise');var moment=require(_0xa63d('0x3'));var BPromise=require(_0xa63d('0x4'));var Mustache=require(_0xa63d('0x5'));var util=require(_0xa63d('0x6'));var path=require(_0xa63d('0x7'));var sox=require('sox');var csv=require(_0xa63d('0x8'));var ejs=require(_0xa63d('0x9'));var fs=require('fs');var fs_extra=require(_0xa63d('0xa'));var _=require(_0xa63d('0xb'));var squel=require('squel');var crypto=require(_0xa63d('0xc'));var jsforce=require(_0xa63d('0xd'));var deskjs=require(_0xa63d('0xe'));var toCsv=require(_0xa63d('0x8'));var querystring=require(_0xa63d('0xf'));var Papa=require('papaparse');var Redis=require(_0xa63d('0x10'));var authService=require(_0xa63d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa63d('0x12'));var hardwareService=require(_0xa63d('0x13'));var logger=require(_0xa63d('0x14'))(_0xa63d('0x15'));var utils=require('../../config/utils');var config=require(_0xa63d('0x16'));var licenseUtil=require(_0xa63d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d6fad,_0x1e841b){_0x1e841b=_0x1e841b||0xcc;return function(_0x4c7143){if(_0x4c7143){return _0x2d6fad[_0xa63d('0x18')](_0x1e841b);}return _0x2d6fad[_0xa63d('0x19')](_0x1e841b)[_0xa63d('0x1a')]();};}function respondWithResult(_0x29a41e,_0x4c4cc6){_0x4c4cc6=_0x4c4cc6||0xc8;return function(_0xe47f98){if(_0xe47f98){return _0x29a41e['status'](_0x4c4cc6)[_0xa63d('0x1b')](_0xe47f98);}};}function respondWithFilteredResult(_0x4426c1,_0x10c829){return function(_0x3f46cf){if(_0x3f46cf){var _0x381392=typeof _0x10c829[_0xa63d('0x1c')]==='undefined'&&typeof _0x10c829[_0xa63d('0x1d')]===_0xa63d('0x1e');var _0x4e248e=_0x3f46cf[_0xa63d('0x1f')];var _0x2f4409=_0x381392?0x0:_0x10c829[_0xa63d('0x1c')];var _0x2b1d7e=_0x381392?_0x3f46cf[_0xa63d('0x1f')]:_0x10c829[_0xa63d('0x1c')]+_0x10c829['limit'];var _0x3f84f1;if(_0x2b1d7e>=_0x4e248e){_0x2b1d7e=_0x4e248e;_0x3f84f1=0xc8;}else{_0x3f84f1=0xce;}_0x4426c1[_0xa63d('0x19')](_0x3f84f1);return _0x4426c1[_0xa63d('0x20')](_0xa63d('0x21'),_0x2f4409+'-'+_0x2b1d7e+'/'+_0x4e248e)[_0xa63d('0x1b')](_0x3f46cf);}return null;};}function patchUpdates(_0x4f3a63){return function(_0x4b2abe){try{jsonpatch[_0xa63d('0x22')](_0x4b2abe,_0x4f3a63,!![]);}catch(_0x58c879){return BPromise[_0xa63d('0x23')](_0x58c879);}return _0x4b2abe['save']();};}function saveUpdates(_0x2cf643,_0x195c66){return function(_0x4d6119){if(_0x4d6119){return _0x4d6119[_0xa63d('0x24')](_0x2cf643)[_0xa63d('0x25')](function(_0x12b9ec){return _0x12b9ec;});}return null;};}function removeEntity(_0x23bb42,_0x547a7a){return function(_0x3831b8){if(_0x3831b8){return _0x3831b8[_0xa63d('0x26')]()['then'](function(){_0x23bb42[_0xa63d('0x19')](0xcc)[_0xa63d('0x1a')]();});}};}function handleEntityNotFound(_0x4becd1,_0x10709a){return function(_0x1e1b3c){if(!_0x1e1b3c){_0x4becd1[_0xa63d('0x18')](0x194);}return _0x1e1b3c;};}function handleError(_0x227267,_0x303519){_0x303519=_0x303519||0x1f4;return function(_0x4353c2){logger['error'](_0x4353c2[_0xa63d('0x27')]);if(_0x4353c2[_0xa63d('0x28')]){delete _0x4353c2[_0xa63d('0x28')];}_0x227267[_0xa63d('0x19')](_0x303519)['send'](_0x4353c2);};}exports[_0xa63d('0x29')]=function(_0x15f03a,_0x5e8771){var _0x432316={},_0xf94d1e={},_0x501a3d={'count':0x0,'rows':[]};var _0x34524b=_[_0xa63d('0x2a')](db[_0xa63d('0x2b')][_0xa63d('0x2c')],function(_0x25576a){return{'name':_0x25576a[_0xa63d('0x2d')],'type':_0x25576a[_0xa63d('0x2e')][_0xa63d('0x2f')]};});_0xf94d1e['model']=_[_0xa63d('0x2a')](_0x34524b,_0xa63d('0x28'));_0xf94d1e[_0xa63d('0x30')]=_['keys'](_0x15f03a[_0xa63d('0x30')]);_0xf94d1e['filters']=_[_0xa63d('0x31')](_0xf94d1e[_0xa63d('0x32')],_0xf94d1e[_0xa63d('0x30')]);_0x432316[_0xa63d('0x33')]=_[_0xa63d('0x31')](_0xf94d1e['model'],qs['fields'](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x34')]));_0x432316['attributes']=_0x432316['attributes'][_0xa63d('0x35')]?_0x432316[_0xa63d('0x33')]:_0xf94d1e[_0xa63d('0x32')];if(!_0x15f03a[_0xa63d('0x30')][_0xa63d('0x36')]('nolimit')){_0x432316['limit']=qs['limit'](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x1d')]);_0x432316[_0xa63d('0x1c')]=qs[_0xa63d('0x1c')](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x1c')]);}_0x432316['order']=qs['sort'](_0x15f03a[_0xa63d('0x30')][_0xa63d('0x37')]);_0x432316[_0xa63d('0x38')]=qs[_0xa63d('0x39')](_[_0xa63d('0x3a')](_0x15f03a[_0xa63d('0x30')],_0xf94d1e[_0xa63d('0x39')]),_0x34524b);if(_0x15f03a['query']['filter']){_0x432316[_0xa63d('0x38')]=_[_0xa63d('0x3b')](_0x432316[_0xa63d('0x38')],{'$or':_[_0xa63d('0x2a')](_0x34524b,function(_0x40003a){if(_0x40003a[_0xa63d('0x2e')]!==_0xa63d('0x3c')){var _0x558652={};_0x558652[_0x40003a[_0xa63d('0x28')]]={'$like':'%'+_0x15f03a[_0xa63d('0x30')][_0xa63d('0x3d')]+'%'};return _0x558652;}})});}_0x432316=_[_0xa63d('0x3b')]({},_0x432316,_0x15f03a['options']);var _0x1026a2={'where':_0x432316[_0xa63d('0x38')]};return db[_0xa63d('0x2b')][_0xa63d('0x1f')](_0x1026a2)['then'](function(_0x2066be){_0x501a3d[_0xa63d('0x1f')]=_0x2066be;if(_0x15f03a[_0xa63d('0x30')]['includeAll']){_0x432316[_0xa63d('0x3e')]=[{'all':!![]}];}return db[_0xa63d('0x2b')][_0xa63d('0x3f')](_0x432316);})[_0xa63d('0x25')](function(_0x41125d){_0x501a3d[_0xa63d('0x40')]=_0x41125d;return _0x501a3d;})['then'](respondWithFilteredResult(_0x5e8771,_0x432316))[_0xa63d('0x41')](handleError(_0x5e8771,null));};exports[_0xa63d('0x42')]=function(_0x3701cd,_0x54d3f2){var _0x1546b5={'raw':![],'where':{'id':_0x3701cd[_0xa63d('0x43')]['id']}},_0x4ba20d={};_0x4ba20d['model']=_[_0xa63d('0x44')](db['Automation'][_0xa63d('0x2c')]);_0x4ba20d['query']=_['keys'](_0x3701cd[_0xa63d('0x30')]);_0x4ba20d[_0xa63d('0x39')]=_[_0xa63d('0x31')](_0x4ba20d[_0xa63d('0x32')],_0x4ba20d[_0xa63d('0x30')]);_0x1546b5[_0xa63d('0x33')]=_[_0xa63d('0x31')](_0x4ba20d[_0xa63d('0x32')],qs[_0xa63d('0x34')](_0x3701cd[_0xa63d('0x30')][_0xa63d('0x34')]));_0x1546b5[_0xa63d('0x33')]=_0x1546b5[_0xa63d('0x33')]['length']?_0x1546b5['attributes']:_0x4ba20d['model'];if(_0x3701cd[_0xa63d('0x30')]['includeAll']){_0x1546b5['include']=[{'all':!![]}];}_0x1546b5=_['merge']({},_0x1546b5,_0x3701cd[_0xa63d('0x45')]);return db[_0xa63d('0x2b')]['find'](_0x1546b5)[_0xa63d('0x25')](handleEntityNotFound(_0x54d3f2,null))[_0xa63d('0x25')](respondWithResult(_0x54d3f2,null))['catch'](handleError(_0x54d3f2,null));};exports[_0xa63d('0x46')]=function(_0xa9086b,_0x5709b7){return db[_0xa63d('0x2b')][_0xa63d('0x46')](_0xa9086b[_0xa63d('0x47')],{})[_0xa63d('0x25')](respondWithResult(_0x5709b7,0xc9))['catch'](handleError(_0x5709b7,null));};exports[_0xa63d('0x24')]=function(_0x55984e,_0x233dc0){if(_0x55984e['body']['id']){delete _0x55984e[_0xa63d('0x47')]['id'];}return db[_0xa63d('0x2b')][_0xa63d('0x48')]({'where':{'id':_0x55984e[_0xa63d('0x43')]['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x233dc0,null))['then'](saveUpdates(_0x55984e[_0xa63d('0x47')],null))[_0xa63d('0x25')](respondWithResult(_0x233dc0,null))['catch'](handleError(_0x233dc0,null));};exports['destroy']=function(_0x9196c,_0x76891d){return db[_0xa63d('0x2b')][_0xa63d('0x48')]({'where':{'id':_0x9196c[_0xa63d('0x43')]['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x76891d,null))[_0xa63d('0x25')](removeEntity(_0x76891d,null))['catch'](handleError(_0x76891d,null));};exports[_0xa63d('0x49')]=function(_0xe9e1cc,_0x5f1c29,_0x5de103){return db[_0xa63d('0x4a')][_0xa63d('0x48')]({'where':{'id':_0xe9e1cc['params']['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x5f1c29,null))[_0xa63d('0x25')](function(_0x4bc459){if(_0x4bc459){return _0x4bc459['addConditions'](_0xe9e1cc[_0xa63d('0x47')][_0xa63d('0x4b')],_[_0xa63d('0x4c')](_0xe9e1cc['body'],[_0xa63d('0x4b'),'id'])||{});}})[_0xa63d('0x25')](respondWithResult(_0x5f1c29,null))[_0xa63d('0x41')](handleError(_0x5f1c29,null));};exports['getConditions']=function(_0x24c971,_0x324c4b,_0x271b55){var _0x853f29={};var _0xffc7e5={};var _0x3c2608;var _0x102d40;return db[_0xa63d('0x2b')][_0xa63d('0x4d')]({'where':{'id':_0x24c971['params']['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x324c4b,null))[_0xa63d('0x25')](function(_0x2717ae){if(_0x2717ae){_0x3c2608=_0x2717ae;_0xffc7e5['model']=_[_0xa63d('0x44')](db[_0xa63d('0x4a')][_0xa63d('0x2c')]);_0xffc7e5[_0xa63d('0x30')]=_['keys'](_0x24c971['query']);_0xffc7e5['filters']=_[_0xa63d('0x31')](_0xffc7e5['model'],_0xffc7e5[_0xa63d('0x30')]);_0x853f29[_0xa63d('0x33')]=_['intersection'](_0xffc7e5[_0xa63d('0x32')],qs[_0xa63d('0x34')](_0x24c971[_0xa63d('0x30')][_0xa63d('0x34')]));_0x853f29['attributes']=_0x853f29[_0xa63d('0x33')]['length']?_0x853f29[_0xa63d('0x33')]:_0xffc7e5[_0xa63d('0x32')];_0x853f29[_0xa63d('0x4e')]=qs['sort'](_0x24c971['query'][_0xa63d('0x37')]);_0x853f29[_0xa63d('0x38')]=qs[_0xa63d('0x39')](_['pick'](_0x24c971[_0xa63d('0x30')],_0xffc7e5[_0xa63d('0x39')]));if(_0x24c971['query']['filter']){_0x853f29[_0xa63d('0x38')]=_['merge'](_0x853f29[_0xa63d('0x38')],{'$or':_[_0xa63d('0x2a')](_0x853f29[_0xa63d('0x33')],function(_0x24f96e){var _0x2a824a={};_0x2a824a[_0x24f96e]={'$like':'%'+_0x24c971['query'][_0xa63d('0x3d')]+'%'};return _0x2a824a;})});}_0x853f29=_['merge']({},_0x853f29,_0x24c971[_0xa63d('0x45')]);return _0x3c2608['getConditions'](_0x853f29);}})[_0xa63d('0x25')](function(_0x3ec44e){if(_0x3ec44e){_0x102d40=_0x3ec44e[_0xa63d('0x35')];if(!_0x24c971[_0xa63d('0x30')][_0xa63d('0x36')](_0xa63d('0x4f'))){_0x853f29[_0xa63d('0x1d')]=qs[_0xa63d('0x1d')](_0x24c971[_0xa63d('0x30')][_0xa63d('0x1d')]);_0x853f29[_0xa63d('0x1c')]=qs[_0xa63d('0x1c')](_0x24c971[_0xa63d('0x30')][_0xa63d('0x1c')]);}return _0x3c2608[_0xa63d('0x50')](_0x853f29);}})[_0xa63d('0x25')](function(_0x5499ee){if(_0x5499ee){return _0x5499ee?{'count':_0x102d40,'rows':_0x5499ee}:null;}})[_0xa63d('0x25')](respondWithResult(_0x324c4b,null))[_0xa63d('0x41')](handleError(_0x324c4b,null));};exports[_0xa63d('0x51')]=function(_0x1d37e4,_0x552d8e,_0x207777){return db[_0xa63d('0x52')]['find']({'where':{'id':_0x1d37e4[_0xa63d('0x43')]['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x552d8e,null))[_0xa63d('0x25')](function(_0x1b13c0){if(_0x1b13c0){return _0x1b13c0['addActions'](_0x1d37e4[_0xa63d('0x47')][_0xa63d('0x4b')],_[_0xa63d('0x4c')](_0x1d37e4[_0xa63d('0x47')],[_0xa63d('0x4b'),'id'])||{});}})[_0xa63d('0x25')](respondWithResult(_0x552d8e,null))[_0xa63d('0x41')](handleError(_0x552d8e,null));};exports[_0xa63d('0x53')]=function(_0x5f3db1,_0x4276c0,_0x1ec35d){var _0x2a814c={};var _0x309a3a={};var _0x4523bc;var _0x187d2d;return db[_0xa63d('0x2b')][_0xa63d('0x4d')]({'where':{'id':_0x5f3db1['params']['id']}})[_0xa63d('0x25')](handleEntityNotFound(_0x4276c0,null))['then'](function(_0x3b1989){if(_0x3b1989){_0x4523bc=_0x3b1989;_0x309a3a[_0xa63d('0x32')]=_[_0xa63d('0x44')](db[_0xa63d('0x52')][_0xa63d('0x2c')]);_0x309a3a['query']=_[_0xa63d('0x44')](_0x5f3db1[_0xa63d('0x30')]);_0x309a3a[_0xa63d('0x39')]=_[_0xa63d('0x31')](_0x309a3a[_0xa63d('0x32')],_0x309a3a[_0xa63d('0x30')]);_0x2a814c['attributes']=_[_0xa63d('0x31')](_0x309a3a['model'],qs[_0xa63d('0x34')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x34')]));_0x2a814c[_0xa63d('0x33')]=_0x2a814c['attributes'][_0xa63d('0x35')]?_0x2a814c[_0xa63d('0x33')]:_0x309a3a[_0xa63d('0x32')];_0x2a814c[_0xa63d('0x4e')]=qs[_0xa63d('0x37')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x37')]);_0x2a814c[_0xa63d('0x38')]=qs[_0xa63d('0x39')](_[_0xa63d('0x3a')](_0x5f3db1[_0xa63d('0x30')],_0x309a3a[_0xa63d('0x39')]));if(_0x5f3db1[_0xa63d('0x30')]['filter']){_0x2a814c[_0xa63d('0x38')]=_[_0xa63d('0x3b')](_0x2a814c[_0xa63d('0x38')],{'$or':_[_0xa63d('0x2a')](_0x2a814c[_0xa63d('0x33')],function(_0x2e2c02){var _0x24853a={};_0x24853a[_0x2e2c02]={'$like':'%'+_0x5f3db1['query'][_0xa63d('0x3d')]+'%'};return _0x24853a;})});}_0x2a814c=_['merge']({},_0x2a814c,_0x5f3db1['options']);return _0x4523bc[_0xa63d('0x53')](_0x2a814c);}})['then'](function(_0x19057e){if(_0x19057e){_0x187d2d=_0x19057e[_0xa63d('0x35')];if(!_0x5f3db1['query'][_0xa63d('0x36')](_0xa63d('0x4f'))){_0x2a814c[_0xa63d('0x1d')]=qs[_0xa63d('0x1d')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x1d')]);_0x2a814c[_0xa63d('0x1c')]=qs[_0xa63d('0x1c')](_0x5f3db1[_0xa63d('0x30')][_0xa63d('0x1c')]);}return _0x4523bc[_0xa63d('0x53')](_0x2a814c);}})[_0xa63d('0x25')](function(_0xc847b9){if(_0xc847b9){return _0xc847b9?{'count':_0x187d2d,'rows':_0xc847b9}:null;}})[_0xa63d('0x25')](respondWithResult(_0x4276c0,null))[_0xa63d('0x41')](handleError(_0x4276c0,null));}; \ No newline at end of file +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 diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 3f2899b..c1d0f6b 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 _0x0540=['moment','bluebird','request-promise','./automation.attributes','exports','define','Automation','lodash','util'];(function(_0x4ff15a,_0x509c8e){var _0x281ac6=function(_0x1de6d1){while(--_0x1de6d1){_0x4ff15a['push'](_0x4ff15a['shift']());}};_0x281ac6(++_0x509c8e);}(_0x0540,0x103));var _0x0054=function(_0x3baf7f,_0x2c14ce){_0x3baf7f=_0x3baf7f-0x0;var _0x49cf7b=_0x0540[_0x3baf7f];return _0x49cf7b;};'use strict';var _=require(_0x0054('0x0'));var util=require(_0x0054('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0054('0x2'));var BPromise=require(_0x0054('0x3'));var rp=require(_0x0054('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0054('0x5'));module[_0x0054('0x6')]=function(_0x449b7f,_0x5e9d2b){return _0x449b7f[_0x0054('0x7')](_0x0054('0x8'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 6e0ea5e..f24d842 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 _0x45d8=['../../config/utils','rpc','../../config/environment','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5497d3,_0x193adf){var _0x42f1ef=function(_0x83263f){while(--_0x83263f){_0x5497d3['push'](_0x5497d3['shift']());}};_0x42f1ef(++_0x193adf);}(_0x45d8,0x174));var _0x845d=function(_0x9e05d1,_0x3cef4a){_0x9e05d1=_0x9e05d1-0x0;var _0x4f7e97=_0x45d8[_0x9e05d1];return _0x4f7e97;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var moment=require(_0x845d('0x2'));var BPromise=require(_0x845d('0x3'));var rs=require(_0x845d('0x4'));var fs=require('fs');var Redis=require(_0x845d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845d('0x6'));var logger=require('../../config/logger')(_0x845d('0x7'));var config=require(_0x845d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x845d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a59a2,_0x33c493,_0x94a7f5){return new BPromise(function(_0x34a0bf,_0xc26c7d){return client[_0x845d('0xa')](_0x4a59a2,_0x94a7f5)[_0x845d('0xb')](function(_0x5a9113){logger[_0x845d('0xc')](_0x845d('0xd'),_0x33c493,'request\x20sent');logger['debug'](_0x845d('0xe'),_0x33c493,_0x845d('0xf'),JSON[_0x845d('0x10')](_0x5a9113));if(_0x5a9113[_0x845d('0x11')]){if(_0x5a9113[_0x845d('0x11')]['code']===0x1f4){logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')][_0x845d('0x12')]);return _0xc26c7d(_0x5a9113['error']['message']);}logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')]['message']);return _0x34a0bf(_0x5a9113[_0x845d('0x11')]['message']);}else{logger[_0x845d('0xc')]('Automation,\x20%s,\x20%s',_0x33c493,_0x845d('0xf'));_0x34a0bf(_0x5a9113[_0x845d('0x13')][_0x845d('0x12')]);}})[_0x845d('0x14')](function(_0x2a592){logger['error']('Automation,\x20%s,\x20%s',_0x33c493,_0x2a592);_0xc26c7d(_0x2a592);});});} \ No newline at end of file +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 diff --git a/server/api/automation/index.js b/server/api/automation/index.js index b8db463..cc7ab36 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 _0xabcb=['isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','create','addConditions','addActions','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get'];(function(_0x8e2972,_0x349a62){var _0x29b2f4=function(_0x45009c){while(--_0x45009c){_0x8e2972['push'](_0x8e2972['shift']());}};_0x29b2f4(++_0x349a62);}(_0xabcb,0xf9));var _0xbabc=function(_0x59399b,_0x355fdf){_0x59399b=_0x59399b-0x0;var _0x5658bb=_0xabcb[_0x59399b];return _0x5658bb;};'use strict';var multer=require('multer');var util=require(_0xbabc('0x0'));var path=require(_0xbabc('0x1'));var timeout=require(_0xbabc('0x2'));var express=require(_0xbabc('0x3'));var router=express[_0xbabc('0x4')]();var fs_extra=require(_0xbabc('0x5'));var auth=require(_0xbabc('0x6'));var interaction=require(_0xbabc('0x7'));var config=require(_0xbabc('0x8'));var controller=require(_0xbabc('0x9'));router[_0xbabc('0xa')]('/',auth[_0xbabc('0xb')](),controller[_0xbabc('0xc')]);router[_0xbabc('0xa')](_0xbabc('0xd'),auth[_0xbabc('0xb')](),controller[_0xbabc('0xe')]);router[_0xbabc('0xa')](_0xbabc('0xf'),auth[_0xbabc('0xb')](),controller['getConditions']);router[_0xbabc('0xa')](_0xbabc('0x10'),auth[_0xbabc('0xb')](),controller['getActions']);router[_0xbabc('0x11')]('/',auth[_0xbabc('0xb')](),controller[_0xbabc('0x12')]);router[_0xbabc('0x11')]('/:id/conditions',auth[_0xbabc('0xb')](),controller[_0xbabc('0x13')]);router[_0xbabc('0x11')](_0xbabc('0x10'),auth[_0xbabc('0xb')](),controller[_0xbabc('0x14')]);router[_0xbabc('0x15')]('/:id',auth[_0xbabc('0xb')](),controller[_0xbabc('0x16')]);router[_0xbabc('0x17')]('/:id',auth[_0xbabc('0xb')](),controller[_0xbabc('0x18')]);module[_0xbabc('0x19')]=router; \ No newline at end of file +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 diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index e2f41ea..241e49d 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 _0xe285=['#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','BOOLEAN','Active/Disactive\x20AMD','#AMD\x20Greeting'];(function(_0x15dfac,_0x14f237){var _0x106f8f=function(_0x31dad9){while(--_0x31dad9){_0x15dfac['push'](_0x15dfac['shift']());}};_0x106f8f(++_0x14f237);}(_0xe285,0xe5));var _0x5e28=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xe285[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x5e28('0x0'));module[_0x5e28('0x1')]={'name':{'type':Sequelize[_0x5e28('0x2')],'unique':_0x5e28('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5e28('0x4')](_0x5e28('0x5')),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5e28('0x6')},'limitCalls':{'type':Sequelize[_0x5e28('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5e28('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5e28('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5e28('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0xc')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'comment':_0x5e28('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0xf')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5e28('0x10')},'dialTimezone':{'type':Sequelize[_0x5e28('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x5e28('0x2')],'defaultValue':_0x5e28('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0x5e28('0x4')](_0x5e28('0x12'),'never',_0x5e28('0x13')),'defaultValue':_0x5e28('0x12')},'dialAMDActive':{'type':Sequelize[_0x5e28('0x14')],'defaultValue':0x0,'comment':_0x5e28('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0x5e28('0x7')](0x9)[_0x5e28('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5e28('0x16')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5e28('0x7')](0x9)[_0x5e28('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5e28('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5e28('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5e28('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5e28('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5e28('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5e28('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5e28('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5e28('0x4')](_0x5e28('0x1c'),_0x5e28('0x1d')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x5e28('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e28('0x1e')},'dialCutDigit':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5e28('0x1f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x21')},'dialDropMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x5e28('0x7')](0x3)[_0x5e28('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5e28('0x28')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x5e28('0x7')](0x5)[_0x5e28('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5e28('0x29')}}; \ No newline at end of file +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 diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 53e9910..621f5da 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 _0x767c=['status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','name','index','map','Campaign','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','updatedAt','createdAt','UserProfileSection','error','findOne','CmHopper','getHopperHistories','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','fromQuery','from','phone\x20NOT\x20IN\x20(?)','insert','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end'];(function(_0x82a995,_0xa40fb8){var _0x2e0f77=function(_0x396659){while(--_0x396659){_0x82a995['push'](_0x82a995['shift']());}};_0x2e0f77(++_0xa40fb8);}(_0x767c,0x183));var _0xc767=function(_0x9de3e0,_0x186627){_0x9de3e0=_0x9de3e0-0x0;var _0x4ad4bc=_0x767c[_0x9de3e0];return _0x4ad4bc;};'use strict';var emlformat=require(_0xc767('0x0'));var rimraf=require(_0xc767('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc767('0x2'));var moment=require(_0xc767('0x3'));var BPromise=require(_0xc767('0x4'));var Mustache=require(_0xc767('0x5'));var util=require(_0xc767('0x6'));var path=require(_0xc767('0x7'));var sox=require(_0xc767('0x8'));var csv=require(_0xc767('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc767('0xa'));var _=require('lodash');var squel=require(_0xc767('0xb'));var crypto=require(_0xc767('0xc'));var jsforce=require(_0xc767('0xd'));var deskjs=require(_0xc767('0xe'));var toCsv=require(_0xc767('0x9'));var querystring=require(_0xc767('0xf'));var Papa=require(_0xc767('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc767('0x11'));var as=require(_0xc767('0x12'));var hardwareService=require(_0xc767('0x13'));var logger=require(_0xc767('0x14'))(_0xc767('0x15'));var utils=require(_0xc767('0x16'));var config=require(_0xc767('0x17'));var licenseUtil=require(_0xc767('0x18'));var db=require(_0xc767('0x19'))['db'];function respondWithStatusCode(_0x449241,_0x19caec){_0x19caec=_0x19caec||0xcc;return function(_0x1342dd){if(_0x1342dd){return _0x449241['sendStatus'](_0x19caec);}return _0x449241['status'](_0x19caec)[_0xc767('0x1a')]();};}function respondWithResult(_0x3a89ca,_0x2c6670){_0x2c6670=_0x2c6670||0xc8;return function(_0x49f8c8){if(_0x49f8c8){return _0x3a89ca[_0xc767('0x1b')](_0x2c6670)[_0xc767('0x1c')](_0x49f8c8);}};}function respondWithFilteredResult(_0x46cd1d,_0x41ba67){return function(_0x15acc4){if(_0x15acc4){var _0x3a8a7f=typeof _0x41ba67[_0xc767('0x1d')]===_0xc767('0x1e')&&typeof _0x41ba67['limit']===_0xc767('0x1e');var _0x3a16fa=_0x15acc4[_0xc767('0x1f')];var _0x1f856a=_0x3a8a7f?0x0:_0x41ba67[_0xc767('0x1d')];var _0x3746b7=_0x3a8a7f?_0x15acc4[_0xc767('0x1f')]:_0x41ba67['offset']+_0x41ba67['limit'];var _0x566712;if(_0x3746b7>=_0x3a16fa){_0x3746b7=_0x3a16fa;_0x566712=0xc8;}else{_0x566712=0xce;}_0x46cd1d[_0xc767('0x1b')](_0x566712);return _0x46cd1d[_0xc767('0x20')](_0xc767('0x21'),_0x1f856a+'-'+_0x3746b7+'/'+_0x3a16fa)[_0xc767('0x1c')](_0x15acc4);}return null;};}function patchUpdates(_0x2a1156){return function(_0x12df88){try{jsonpatch[_0xc767('0x22')](_0x12df88,_0x2a1156,!![]);}catch(_0x61cab3){return BPromise[_0xc767('0x23')](_0x61cab3);}return _0x12df88[_0xc767('0x24')]();};}function saveUpdates(_0x143e32,_0x45b5d1){return function(_0x59c03f){if(_0x59c03f){return _0x59c03f[_0xc767('0x25')](_0x143e32)[_0xc767('0x26')](function(_0x54bdc5){return _0x54bdc5;});}return null;};}function removeEntity(_0x454ccc,_0x5990bd){return function(_0x39b227){if(_0x39b227){return _0x39b227[_0xc767('0x27')]()['then'](function(){var _0x57c54a=_0x39b227[_0xc767('0x28')]({'plain':!![]});var _0x36c62c=_0xc767('0x29');return db[_0xc767('0x2a')][_0xc767('0x27')]({'where':{'type':_0x36c62c,'resourceId':_0x57c54a['id']}})[_0xc767('0x26')](function(){return _0x39b227;});})[_0xc767('0x26')](function(){_0x454ccc[_0xc767('0x1b')](0xcc)[_0xc767('0x1a')]();});}};}function handleEntityNotFound(_0x4867f1,_0x18fd59){return function(_0x15cfda){if(!_0x15cfda){_0x4867f1[_0xc767('0x2b')](0x194);}return _0x15cfda;};}function handleError(_0xf9de41,_0x914ba2){_0x914ba2=_0x914ba2||0x1f4;return function(_0x456ad5){logger['error'](_0x456ad5['stack']);if(_0x456ad5[_0xc767('0x2c')]){delete _0x456ad5['name'];}_0xf9de41[_0xc767('0x1b')](_0x914ba2)['send'](_0x456ad5);};}exports[_0xc767('0x2d')]=function(_0xbfedff,_0x4a4fc2){var _0x34c793={},_0x226350={},_0x319d68={'count':0x0,'rows':[]};var _0x7cbd57=_[_0xc767('0x2e')](db[_0xc767('0x2f')][_0xc767('0x30')],function(_0x1684f9){return{'name':_0x1684f9[_0xc767('0x31')],'type':_0x1684f9['type'][_0xc767('0x32')]};});_0x226350[_0xc767('0x33')]=_[_0xc767('0x2e')](_0x7cbd57,'name');_0x226350[_0xc767('0x34')]=_[_0xc767('0x35')](_0xbfedff[_0xc767('0x34')]);_0x226350[_0xc767('0x36')]=_[_0xc767('0x37')](_0x226350['model'],_0x226350[_0xc767('0x34')]);_0x34c793[_0xc767('0x38')]=_[_0xc767('0x37')](_0x226350[_0xc767('0x33')],qs[_0xc767('0x39')](_0xbfedff[_0xc767('0x34')][_0xc767('0x39')]));_0x34c793['attributes']=_0x34c793['attributes']['length']?_0x34c793[_0xc767('0x38')]:_0x226350[_0xc767('0x33')];if(!_0xbfedff[_0xc767('0x34')][_0xc767('0x3a')](_0xc767('0x3b'))){_0x34c793[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0xbfedff[_0xc767('0x34')][_0xc767('0x3c')]);_0x34c793[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0xbfedff[_0xc767('0x34')][_0xc767('0x1d')]);}_0x34c793['order']=qs[_0xc767('0x3d')](_0xbfedff['query'][_0xc767('0x3d')]);_0x34c793[_0xc767('0x3e')]=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0xbfedff[_0xc767('0x34')],_0x226350[_0xc767('0x36')]),_0x7cbd57);if(_0xbfedff[_0xc767('0x34')]['filter']){_0x34c793[_0xc767('0x3e')]=_[_0xc767('0x40')](_0x34c793[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0x7cbd57,function(_0xf395fc){if(_0xf395fc[_0xc767('0x41')]!==_0xc767('0x42')){var _0x2e1f4f={};_0x2e1f4f[_0xf395fc[_0xc767('0x2c')]]={'$like':'%'+_0xbfedff[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x2e1f4f;}})});}_0x34c793=_[_0xc767('0x40')]({},_0x34c793,_0xbfedff[_0xc767('0x44')]);var _0x20ad73={'where':_0x34c793[_0xc767('0x3e')]};return db[_0xc767('0x2f')][_0xc767('0x1f')](_0x20ad73)[_0xc767('0x26')](function(_0x597780){_0x319d68[_0xc767('0x1f')]=_0x597780;if(_0xbfedff[_0xc767('0x34')][_0xc767('0x45')]){_0x34c793[_0xc767('0x46')]=[{'all':!![]}];}return db['Campaign'][_0xc767('0x47')](_0x34c793);})[_0xc767('0x26')](function(_0x4728e9){_0x319d68[_0xc767('0x48')]=_0x4728e9;return _0x319d68;})['then'](respondWithFilteredResult(_0x4a4fc2,_0x34c793))['catch'](handleError(_0x4a4fc2,null));};exports['show']=function(_0x4be2c4,_0x39da01){var _0x1074fb={'raw':![],'where':{'id':_0x4be2c4['params']['id']}},_0x2d6b30={};_0x2d6b30[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x2f')][_0xc767('0x30')]);_0x2d6b30[_0xc767('0x34')]=_[_0xc767('0x35')](_0x4be2c4['query']);_0x2d6b30[_0xc767('0x36')]=_[_0xc767('0x37')](_0x2d6b30[_0xc767('0x33')],_0x2d6b30[_0xc767('0x34')]);_0x1074fb[_0xc767('0x38')]=_[_0xc767('0x37')](_0x2d6b30[_0xc767('0x33')],qs[_0xc767('0x39')](_0x4be2c4['query'][_0xc767('0x39')]));_0x1074fb[_0xc767('0x38')]=_0x1074fb[_0xc767('0x38')][_0xc767('0x49')]?_0x1074fb['attributes']:_0x2d6b30[_0xc767('0x33')];if(_0x4be2c4[_0xc767('0x34')][_0xc767('0x45')]){_0x1074fb['include']=[{'all':!![]}];}_0x1074fb=_['merge']({},_0x1074fb,_0x4be2c4[_0xc767('0x44')]);return db[_0xc767('0x2f')][_0xc767('0x4a')](_0x1074fb)['then'](handleEntityNotFound(_0x39da01,null))['then'](respondWithResult(_0x39da01,null))[_0xc767('0x4b')](handleError(_0x39da01,null));};exports['create']=function(_0x543d36,_0xa32e38){return db[_0xc767('0x2f')][_0xc767('0x4c')](_0x543d36[_0xc767('0x4d')],{})[_0xc767('0x26')](function(_0x2d9259){var _0x299012=_0x543d36['user'][_0xc767('0x28')]({'plain':!![]});if(!_0x299012)throw new Error(_0xc767('0x4e'));if(_0x299012[_0xc767('0x4f')]===_0xc767('0x50')){var _0x4b8f06=_0x2d9259[_0xc767('0x28')]({'plain':!![]});var _0x1b88dd=_0xc767('0x29');return db['UserProfileSection'][_0xc767('0x4a')]({'where':{'name':_0x1b88dd,'userProfileId':_0x299012[_0xc767('0x51')]},'raw':!![]})[_0xc767('0x26')](function(_0x2a6c09){if(_0x2a6c09&&_0x2a6c09[_0xc767('0x52')]===0x0){return db[_0xc767('0x2a')][_0xc767('0x4c')]({'name':_0x4b8f06[_0xc767('0x2c')],'resourceId':_0x4b8f06['id'],'type':_0x2a6c09[_0xc767('0x2c')],'sectionId':_0x2a6c09['id']},{})[_0xc767('0x26')](function(){return _0x2d9259;});}else{return _0x2d9259;}})[_0xc767('0x4b')](function(_0x5bda83){logger['error'](_0xc767('0x53'),_0x5bda83);throw _0x5bda83;});}return _0x2d9259;})['then'](respondWithResult(_0xa32e38,0xc9))['catch'](handleError(_0xa32e38,null));};exports[_0xc767('0x54')]=function(_0x2cba2b,_0x6de5fe){var _0x208c58={'where':{'id':_0x2cba2b[_0xc767('0x55')]['id']}},_0x5cc350={};_0x5cc350[_0xc767('0x33')]=_['keys'](db[_0xc767('0x2f')][_0xc767('0x30')]);_0x208c58['attributes']=_['intersection'](_0x5cc350[_0xc767('0x33')],qs[_0xc767('0x39')](_0x2cba2b['query'][_0xc767('0x39')]));_0x208c58[_0xc767('0x38')]=_0x208c58[_0xc767('0x38')][_0xc767('0x49')]?_0x208c58[_0xc767('0x38')]:_0x5cc350[_0xc767('0x33')];if(_0x2cba2b['query'][_0xc767('0x45')]){_0x208c58['include']=[{'all':!![]}];}_0x208c58=_['merge']({},_0x208c58,_0x2cba2b[_0xc767('0x44')]);return db[_0xc767('0x2f')][_0xc767('0x4a')](_0x208c58)[_0xc767('0x26')](handleEntityNotFound(_0x6de5fe,null))['then'](function(_0x2d467a){if(_0x2d467a){var _0x4ce63c=_0x2d467a[_0xc767('0x28')]({'plain':!![]});_0x4ce63c=qs[_0xc767('0x56')](_0x4ce63c,['id','createdAt',_0xc767('0x57')]);_0x2cba2b[_0xc767('0x4d')]=_['omit'](_0x2cba2b[_0xc767('0x4d')],['id',_0xc767('0x58'),'updatedAt']);return db[_0xc767('0x2f')][_0xc767('0x4c')](_[_0xc767('0x40')](_0x4ce63c,_0x2cba2b[_0xc767('0x4d')]),{'include':_0x2cba2b['query'][_0xc767('0x45')]?[{'all':!![]}]:undefined})[_0xc767('0x26')](function(_0x4196eb){var _0x5b2438=_0x2cba2b[_0xc767('0x50')][_0xc767('0x28')]({'plain':!![]});if(!_0x5b2438)throw new Error(_0xc767('0x4e'));if(_0x5b2438[_0xc767('0x4f')]===_0xc767('0x50')){var _0x350ffa=_0x4196eb[_0xc767('0x28')]({'plain':!![]});var _0x57ec0a='IvrCampaigns';return db[_0xc767('0x59')][_0xc767('0x4a')]({'where':{'name':_0x57ec0a,'userProfileId':_0x5b2438[_0xc767('0x51')]},'raw':!![]})[_0xc767('0x26')](function(_0x5e1b6c){if(_0x5e1b6c&&_0x5e1b6c['autoAssociation']===0x0){return db[_0xc767('0x2a')][_0xc767('0x4c')]({'name':_0x350ffa[_0xc767('0x2c')],'resourceId':_0x350ffa['id'],'type':_0x5e1b6c[_0xc767('0x2c')],'sectionId':_0x5e1b6c['id']},{})[_0xc767('0x26')](function(){return _0x4196eb;});}else{return _0x4196eb;}})[_0xc767('0x4b')](function(_0x415607){logger[_0xc767('0x5a')](_0xc767('0x53'),_0x415607);throw _0x415607;});}return _0x4196eb;});}})[_0xc767('0x26')](respondWithResult(_0x6de5fe,0xc9))[_0xc767('0x4b')](handleError(_0x6de5fe,null));};exports['update']=function(_0x1101e3,_0x15e483){if(_0x1101e3[_0xc767('0x4d')]['id']){delete _0x1101e3[_0xc767('0x4d')]['id'];}return db[_0xc767('0x2f')][_0xc767('0x4a')]({'where':{'id':_0x1101e3['params']['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x15e483,null))['then'](saveUpdates(_0x1101e3['body'],null))['then'](respondWithResult(_0x15e483,null))[_0xc767('0x4b')](handleError(_0x15e483,null));};exports['destroy']=function(_0x2eecb7,_0x17aa46){return db['Campaign'][_0xc767('0x4a')]({'where':{'id':_0x2eecb7['params']['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x17aa46,null))[_0xc767('0x26')](removeEntity(_0x17aa46,null))[_0xc767('0x4b')](handleError(_0x17aa46,null));};exports['getHoppers']=function(_0x5a1ec1,_0x365e23,_0xa7d687){var _0xe63a69={'raw':!![],'where':{}};var _0x25754f={};var _0x20cf73={'count':0x0,'rows':[]};return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x5a1ec1[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x365e23,null))[_0xc767('0x26')](function(_0x45beb8){if(_0x45beb8){_0x25754f[_0xc767('0x33')]=_['keys'](db[_0xc767('0x5c')][_0xc767('0x30')]);_0x25754f[_0xc767('0x34')]=_[_0xc767('0x35')](_0x5a1ec1['query']);_0x25754f['filters']=_[_0xc767('0x37')](_0x25754f[_0xc767('0x33')],_0x25754f[_0xc767('0x34')]);_0xe63a69[_0xc767('0x38')]=_[_0xc767('0x37')](_0x25754f['model'],qs[_0xc767('0x39')](_0x5a1ec1[_0xc767('0x34')][_0xc767('0x39')]));_0xe63a69['attributes']=_0xe63a69[_0xc767('0x38')][_0xc767('0x49')]?_0xe63a69['attributes']:_0x25754f[_0xc767('0x33')];if(!_0x5a1ec1[_0xc767('0x34')]['hasOwnProperty'](_0xc767('0x3b'))){_0xe63a69['limit']=qs[_0xc767('0x3c')](_0x5a1ec1[_0xc767('0x34')][_0xc767('0x3c')]);_0xe63a69[_0xc767('0x1d')]=qs['offset'](_0x5a1ec1[_0xc767('0x34')]['offset']);}_0xe63a69['order']=qs['sort'](_0x5a1ec1[_0xc767('0x34')][_0xc767('0x3d')]);_0xe63a69['where']=qs['filters'](_[_0xc767('0x3f')](_0x5a1ec1[_0xc767('0x34')],_0x25754f[_0xc767('0x36')]));_0xe63a69['where']['CampaignId']=_0x45beb8['id'];if(_0x5a1ec1['query']['filter']){_0xe63a69[_0xc767('0x3e')]=_[_0xc767('0x40')](_0xe63a69['where'],{'$or':_[_0xc767('0x2e')](_0xe63a69[_0xc767('0x38')],function(_0x23c6e3){var _0x52cf12={};_0x52cf12[_0x23c6e3]={'$like':'%'+_0x5a1ec1[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x52cf12;})});}_0xe63a69=_[_0xc767('0x40')]({},_0xe63a69,_0x5a1ec1[_0xc767('0x44')]);return db['CmHopper']['count']({'where':_0xe63a69[_0xc767('0x3e')]})[_0xc767('0x26')](function(_0xc4863f){_0x20cf73[_0xc767('0x1f')]=_0xc4863f;if(_0x5a1ec1['query'][_0xc767('0x45')]){_0xe63a69[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x5c')][_0xc767('0x47')](_0xe63a69);})[_0xc767('0x26')](function(_0xa8e6d2){_0x20cf73[_0xc767('0x48')]=_0xa8e6d2;return _0x20cf73;});}})['then'](respondWithFilteredResult(_0x365e23,_0xe63a69))[_0xc767('0x4b')](handleError(_0x365e23,null));};exports[_0xc767('0x5d')]=function(_0x50e93a,_0x5af055,_0x1ae9d2){var _0x4785fc={'raw':!![],'where':{}};var _0x5b752f={};var _0x2bf022={'count':0x0,'rows':[]};return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x50e93a[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x5af055,null))[_0xc767('0x26')](function(_0x589c0d){if(_0x589c0d){_0x5b752f[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x5e')][_0xc767('0x30')]);_0x5b752f[_0xc767('0x34')]=_[_0xc767('0x35')](_0x50e93a[_0xc767('0x34')]);_0x5b752f[_0xc767('0x36')]=_[_0xc767('0x37')](_0x5b752f[_0xc767('0x33')],_0x5b752f['query']);_0x4785fc['attributes']=_['intersection'](_0x5b752f[_0xc767('0x33')],qs[_0xc767('0x39')](_0x50e93a['query'][_0xc767('0x39')]));_0x4785fc[_0xc767('0x38')]=_0x4785fc[_0xc767('0x38')][_0xc767('0x49')]?_0x4785fc[_0xc767('0x38')]:_0x5b752f[_0xc767('0x33')];if(!_0x50e93a[_0xc767('0x34')]['hasOwnProperty'](_0xc767('0x3b'))){_0x4785fc['limit']=qs['limit'](_0x50e93a[_0xc767('0x34')][_0xc767('0x3c')]);_0x4785fc[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x50e93a[_0xc767('0x34')][_0xc767('0x1d')]);}_0x4785fc['order']=qs['sort'](_0x50e93a['query'][_0xc767('0x3d')]);_0x4785fc[_0xc767('0x3e')]=qs[_0xc767('0x36')](_['pick'](_0x50e93a[_0xc767('0x34')],_0x5b752f['filters']));_0x4785fc[_0xc767('0x3e')][_0xc767('0x5f')]=_0x589c0d['id'];if(_0x50e93a[_0xc767('0x34')][_0xc767('0x43')]){_0x4785fc[_0xc767('0x3e')]=_[_0xc767('0x40')](_0x4785fc[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0x4785fc[_0xc767('0x38')],function(_0x254868){var _0x1e1385={};_0x1e1385[_0x254868]={'$like':'%'+_0x50e93a[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x1e1385;})});}_0x4785fc=_['merge']({},_0x4785fc,_0x50e93a[_0xc767('0x44')]);return db[_0xc767('0x5e')][_0xc767('0x1f')]({'where':_0x4785fc[_0xc767('0x3e')]})[_0xc767('0x26')](function(_0x3842a6){_0x2bf022[_0xc767('0x1f')]=_0x3842a6;if(_0x50e93a[_0xc767('0x34')][_0xc767('0x45')]){_0x4785fc[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x5e')]['findAll'](_0x4785fc);})[_0xc767('0x26')](function(_0x1dae6b){_0x2bf022[_0xc767('0x48')]=_0x1dae6b;return _0x2bf022;});}})[_0xc767('0x26')](respondWithFilteredResult(_0x5af055,_0x4785fc))[_0xc767('0x4b')](handleError(_0x5af055,null));};exports[_0xc767('0x60')]=function(_0x5f0bbe,_0x37545c,_0x54a70a){var _0x36a70b={'raw':!![],'where':{}};var _0x108e5b={};var _0x5db1fb={'count':0x0,'rows':[]};return db['Campaign'][_0xc767('0x5b')]({'where':{'id':_0x5f0bbe[_0xc767('0x55')]['id']}})['then'](handleEntityNotFound(_0x37545c,null))[_0xc767('0x26')](function(_0x4c1283){if(_0x4c1283){_0x108e5b[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x61')][_0xc767('0x30')]);_0x108e5b[_0xc767('0x34')]=_[_0xc767('0x35')](_0x5f0bbe[_0xc767('0x34')]);_0x108e5b[_0xc767('0x36')]=_[_0xc767('0x37')](_0x108e5b[_0xc767('0x33')],_0x108e5b[_0xc767('0x34')]);_0x36a70b[_0xc767('0x38')]=_[_0xc767('0x37')](_0x108e5b['model'],qs['fields'](_0x5f0bbe[_0xc767('0x34')][_0xc767('0x39')]));_0x36a70b['attributes']=_0x36a70b[_0xc767('0x38')][_0xc767('0x49')]?_0x36a70b[_0xc767('0x38')]:_0x108e5b[_0xc767('0x33')];if(!_0x5f0bbe[_0xc767('0x34')][_0xc767('0x3a')](_0xc767('0x3b'))){_0x36a70b[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0x5f0bbe['query'][_0xc767('0x3c')]);_0x36a70b[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x5f0bbe['query'][_0xc767('0x1d')]);}_0x36a70b[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x5f0bbe['query'][_0xc767('0x3d')]);_0x36a70b[_0xc767('0x3e')]=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0x5f0bbe[_0xc767('0x34')],_0x108e5b[_0xc767('0x36')]));_0x36a70b[_0xc767('0x3e')][_0xc767('0x5f')]=_0x4c1283['id'];if(_0x5f0bbe[_0xc767('0x34')][_0xc767('0x43')]){_0x36a70b['where']=_[_0xc767('0x40')](_0x36a70b[_0xc767('0x3e')],{'$or':_['map'](_0x36a70b[_0xc767('0x38')],function(_0x416b50){var _0x1317e6={};_0x1317e6[_0x416b50]={'$like':'%'+_0x5f0bbe['query'][_0xc767('0x43')]+'%'};return _0x1317e6;})});}_0x36a70b=_[_0xc767('0x40')]({},_0x36a70b,_0x5f0bbe[_0xc767('0x44')]);return db['CmHopperFinal']['count']({'where':_0x36a70b[_0xc767('0x3e')]})[_0xc767('0x26')](function(_0x5e8817){_0x5db1fb[_0xc767('0x1f')]=_0x5e8817;if(_0x5f0bbe[_0xc767('0x34')][_0xc767('0x45')]){_0x36a70b[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x61')][_0xc767('0x47')](_0x36a70b);})['then'](function(_0x3269fb){_0x5db1fb[_0xc767('0x48')]=_0x3269fb;return _0x5db1fb;});}})[_0xc767('0x26')](respondWithFilteredResult(_0x37545c,_0x36a70b))['catch'](handleError(_0x37545c,null));};exports[_0xc767('0x63')]=function(_0x1d25c4,_0x125b5a,_0x43181d){var _0xb3093={'raw':!![],'where':{}};var _0x4141bc={};var _0x590ec3={'count':0x0,'rows':[]};return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x1d25c4['params']['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x125b5a,null))[_0xc767('0x26')](function(_0x481c18){if(_0x481c18){_0x4141bc[_0xc767('0x33')]=_[_0xc767('0x35')](db['CmHopperBlack'][_0xc767('0x30')]);_0x4141bc['query']=_[_0xc767('0x35')](_0x1d25c4[_0xc767('0x34')]);_0x4141bc[_0xc767('0x36')]=_[_0xc767('0x37')](_0x4141bc[_0xc767('0x33')],_0x4141bc['query']);_0xb3093[_0xc767('0x38')]=_['intersection'](_0x4141bc['model'],qs[_0xc767('0x39')](_0x1d25c4[_0xc767('0x34')][_0xc767('0x39')]));_0xb3093[_0xc767('0x38')]=_0xb3093[_0xc767('0x38')]['length']?_0xb3093[_0xc767('0x38')]:_0x4141bc[_0xc767('0x33')];if(!_0x1d25c4[_0xc767('0x34')][_0xc767('0x3a')](_0xc767('0x3b'))){_0xb3093[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0x1d25c4[_0xc767('0x34')]['limit']);_0xb3093[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x1d25c4[_0xc767('0x34')][_0xc767('0x1d')]);}_0xb3093[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x1d25c4['query'][_0xc767('0x3d')]);_0xb3093['where']=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0x1d25c4['query'],_0x4141bc[_0xc767('0x36')]));_0xb3093[_0xc767('0x3e')][_0xc767('0x5f')]=_0x481c18['id'];if(_0x1d25c4[_0xc767('0x34')][_0xc767('0x43')]){_0xb3093[_0xc767('0x3e')]=_['merge'](_0xb3093[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0xb3093['attributes'],function(_0x3ef298){var _0x1cbef4={};_0x1cbef4[_0x3ef298]={'$like':'%'+_0x1d25c4[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x1cbef4;})});}_0xb3093=_[_0xc767('0x40')]({},_0xb3093,_0x1d25c4[_0xc767('0x44')]);return db[_0xc767('0x64')]['count']({'where':_0xb3093[_0xc767('0x3e')]})['then'](function(_0xa9070c){_0x590ec3[_0xc767('0x1f')]=_0xa9070c;if(_0x1d25c4[_0xc767('0x34')][_0xc767('0x45')]){_0xb3093[_0xc767('0x46')]=[{'all':!![]}];}return db[_0xc767('0x64')][_0xc767('0x47')](_0xb3093);})[_0xc767('0x26')](function(_0x1691e3){_0x590ec3['rows']=_0x1691e3;return _0x590ec3;});}})[_0xc767('0x26')](respondWithFilteredResult(_0x125b5a,_0xb3093))['catch'](handleError(_0x125b5a,null));};exports['getLists']=function(_0x4308a0,_0x4d2e2f,_0xfa2392){var _0x38a618={};var _0x585700={};var _0x5f49ba;var _0x1a3f39;return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x4308a0[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x4d2e2f,null))[_0xc767('0x26')](function(_0x12a19c){if(_0x12a19c){_0x5f49ba=_0x12a19c;_0x585700[_0xc767('0x33')]=_['keys'](db[_0xc767('0x65')]['rawAttributes']);_0x585700[_0xc767('0x34')]=_[_0xc767('0x35')](_0x4308a0[_0xc767('0x34')]);_0x585700['filters']=_[_0xc767('0x37')](_0x585700['model'],_0x585700[_0xc767('0x34')]);_0x38a618['attributes']=_[_0xc767('0x37')](_0x585700['model'],qs[_0xc767('0x39')](_0x4308a0[_0xc767('0x34')][_0xc767('0x39')]));_0x38a618[_0xc767('0x38')]=_0x38a618['attributes']['length']?_0x38a618['attributes']:_0x585700[_0xc767('0x33')];_0x38a618[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x4308a0['query'][_0xc767('0x3d')]);_0x38a618['where']=qs[_0xc767('0x36')](_[_0xc767('0x3f')](_0x4308a0[_0xc767('0x34')],_0x585700['filters']));if(_0x4308a0[_0xc767('0x34')][_0xc767('0x43')]){_0x38a618[_0xc767('0x3e')]=_[_0xc767('0x40')](_0x38a618['where'],{'$or':_['map'](_0x38a618[_0xc767('0x38')],function(_0x4cae68){var _0x42f382={};_0x42f382[_0x4cae68]={'$like':'%'+_0x4308a0[_0xc767('0x34')][_0xc767('0x43')]+'%'};return _0x42f382;})});}_0x38a618=_['merge']({},_0x38a618,_0x4308a0[_0xc767('0x44')]);return _0x5f49ba['getLists'](_0x38a618);}})[_0xc767('0x26')](function(_0x596d15){if(_0x596d15){_0x1a3f39=_0x596d15[_0xc767('0x49')];if(!_0x4308a0[_0xc767('0x34')][_0xc767('0x3a')]('nolimit')){_0x38a618['limit']=qs[_0xc767('0x3c')](_0x4308a0[_0xc767('0x34')][_0xc767('0x3c')]);_0x38a618[_0xc767('0x1d')]=qs[_0xc767('0x1d')](_0x4308a0[_0xc767('0x34')][_0xc767('0x1d')]);}return _0x5f49ba[_0xc767('0x66')](_0x38a618);}})[_0xc767('0x26')](function(_0x29a21e){if(_0x29a21e){return _0x29a21e?{'count':_0x1a3f39,'rows':_0x29a21e}:null;}})[_0xc767('0x26')](respondWithResult(_0x4d2e2f,null))[_0xc767('0x4b')](handleError(_0x4d2e2f,null));};exports[_0xc767('0x67')]=function(_0x534674,_0x5f28ea,_0x509077){var _0xb8eafa,_0x56def2;return db[_0xc767('0x2f')][_0xc767('0x4a')]({'where':{'id':_0x534674[_0xc767('0x55')]['id']}})['then'](handleEntityNotFound(_0x5f28ea,null))[_0xc767('0x26')](function(_0x347b0b){if(_0x347b0b){_0x56def2=_0x347b0b;return _0x347b0b['addLists'](_0x534674[_0xc767('0x4d')][_0xc767('0x68')],_[_0xc767('0x56')](_0x534674[_0xc767('0x4d')],[_0xc767('0x68'),'id'])||{});}return null;})[_0xc767('0x69')](function(_0x526b57){var _0x4f55e7;_0xb8eafa=_0x526b57||[];var _0x128de1=[];if(_0x526b57){for(var _0x4c3c86=0x0;_0x4c3c86<_0x526b57[_0xc767('0x49')];_0x4c3c86+=0x1){var _0x2d5eb8=_0x526b57[_0x4c3c86][_0xc767('0x28')]({'plain':!![]});_0x56def2[_0xc767('0x6a')]=_0x534674[_0xc767('0x4d')]['dialCheckDuplicateType']?_0x534674['body'][_0xc767('0x6a')]:_0x56def2[_0xc767('0x6a')];switch(_0x56def2[_0xc767('0x6a')]){case'always':_0x4f55e7=squel['insert']()[_0xc767('0x6b')](_0xc767('0x6c'))['fromQuery']([_0xc767('0x6d'),_0xc767('0x6e'),_0xc767('0x6f'),_0xc767('0x70'),'CampaignId',_0xc767('0x58'),_0xc767('0x57')],squel[_0xc767('0x71')]()[_0xc767('0x72')]('phone','phone')[_0xc767('0x72')]('NOW()',_0xc767('0x6e'))[_0xc767('0x72')]('id',_0xc767('0x6f'))[_0xc767('0x72')](_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')](),_0xc767('0x70'))[_0xc767('0x72')](_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')](),_0xc767('0x5f'))['field'](_0xc767('0x75'),_0xc767('0x58'))[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x57'))['from'](_0xc767('0x76'))[_0xc767('0x3e')](_0xc767('0x77'))[_0xc767('0x3e')](_0xc767('0x78'),_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79'))[_0xc767('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xc767('0x72')](_0xc767('0x7a'))['from'](_0xc767('0x7b'))['where'](_0xc767('0x7c'),_0x534674['params']['id']['toString']()))[_0xc767('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc767('0x71')]()[_0xc767('0x72')](_0xc767('0x7d'))['from'](_0xc767('0x6c'))[_0xc767('0x3e')]('CampaignId\x20=\x20?',_0x534674[_0xc767('0x55')]['id']['toString']())))[_0xc767('0x74')]();break;case'onlyIfOpen':_0x4f55e7=squel['insert']()[_0xc767('0x6b')](_0xc767('0x6c'))[_0xc767('0x7e')]([_0xc767('0x6d'),'scheduledAt',_0xc767('0x6f'),_0xc767('0x70'),_0xc767('0x5f'),_0xc767('0x58'),_0xc767('0x57')],squel[_0xc767('0x71')]()[_0xc767('0x72')](_0xc767('0x6d'),_0xc767('0x6d'))[_0xc767('0x72')]('NOW()',_0xc767('0x6e'))[_0xc767('0x72')]('id','ContactId')[_0xc767('0x72')](_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')](),_0xc767('0x70'))['field'](_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')](),'CampaignId')[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x58'))[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x57'))[_0xc767('0x7f')](_0xc767('0x76'))['where'](_0xc767('0x77'))['where'](_0xc767('0x78'),_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79'))['where'](_0xc767('0x80'),squel['select']()[_0xc767('0x72')]('COALESCE(phone,\x27\x27)')['from'](_0xc767('0x6c'))[_0xc767('0x3e')]('CampaignId\x20=\x20?',_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')]())))[_0xc767('0x74')]();break;default:_0x4f55e7=squel[_0xc767('0x81')]()[_0xc767('0x6b')](_0xc767('0x6c'))['fromQuery']([_0xc767('0x6d'),_0xc767('0x6e'),_0xc767('0x6f'),_0xc767('0x70'),_0xc767('0x5f'),_0xc767('0x58'),'updatedAt'],squel[_0xc767('0x71')]()[_0xc767('0x72')](_0xc767('0x6d'),_0xc767('0x6d'))['field']('NOW()',_0xc767('0x6e'))[_0xc767('0x72')]('id',_0xc767('0x6f'))[_0xc767('0x72')](_0x2d5eb8[_0xc767('0x73')]['toString'](),'ListId')[_0xc767('0x72')](_0x534674[_0xc767('0x55')]['id'][_0xc767('0x74')](),_0xc767('0x5f'))[_0xc767('0x72')](_0xc767('0x75'),'createdAt')[_0xc767('0x72')](_0xc767('0x75'),_0xc767('0x57'))[_0xc767('0x7f')](_0xc767('0x76'))[_0xc767('0x3e')](_0xc767('0x77'))[_0xc767('0x3e')](_0xc767('0x78'),_0x2d5eb8[_0xc767('0x73')][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79')))[_0xc767('0x74')]();}_0x128de1[_0xc767('0x82')](db['sequelize'][_0xc767('0x34')](_0x4f55e7));}return BPromise[_0xc767('0x83')](_0x128de1);}})[_0xc767('0x26')](function(){return _0xb8eafa;})[_0xc767('0x26')](respondWithResult(_0x5f28ea,null))[_0xc767('0x4b')](handleError(_0x5f28ea,null));};exports['removeLists']=function(_0x42290a,_0x21d2e6,_0x4e75dc){return db['Campaign']['find']({'where':{'id':_0x42290a['params']['id']}})['then'](handleEntityNotFound(_0x21d2e6,null))[_0xc767('0x26')](function(_0x18bd60){if(_0x18bd60){return _0x18bd60[_0xc767('0x84')](_0x42290a[_0xc767('0x34')]['ids']);}})['then'](function(_0x59cf12){if(_0x59cf12){return db[_0xc767('0x5c')][_0xc767('0x27')]({'where':{'ListId':_0x42290a['query'][_0xc767('0x68')],'CampaignId':_0x42290a[_0xc767('0x55')]['id']}})[_0xc767('0x26')](function(){return _0x59cf12;});}})[_0xc767('0x26')](respondWithStatusCode(_0x21d2e6,null))['catch'](handleError(_0x21d2e6,null));};exports['getBlackLists']=function(_0x2061a3,_0x44b3bc,_0x312de7){var _0x5b3788={};var _0x4ae947={};var _0x51959a;var _0x4cdf17;return db[_0xc767('0x2f')][_0xc767('0x5b')]({'where':{'id':_0x2061a3[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0x44b3bc,null))[_0xc767('0x26')](function(_0x53fcf3){if(_0x53fcf3){_0x51959a=_0x53fcf3;_0x4ae947[_0xc767('0x33')]=_[_0xc767('0x35')](db[_0xc767('0x65')]['rawAttributes']);_0x4ae947[_0xc767('0x34')]=_[_0xc767('0x35')](_0x2061a3[_0xc767('0x34')]);_0x4ae947[_0xc767('0x36')]=_[_0xc767('0x37')](_0x4ae947[_0xc767('0x33')],_0x4ae947['query']);_0x5b3788['attributes']=_[_0xc767('0x37')](_0x4ae947['model'],qs[_0xc767('0x39')](_0x2061a3[_0xc767('0x34')][_0xc767('0x39')]));_0x5b3788[_0xc767('0x38')]=_0x5b3788['attributes'][_0xc767('0x49')]?_0x5b3788[_0xc767('0x38')]:_0x4ae947[_0xc767('0x33')];_0x5b3788[_0xc767('0x62')]=qs[_0xc767('0x3d')](_0x2061a3[_0xc767('0x34')][_0xc767('0x3d')]);_0x5b3788[_0xc767('0x3e')]=qs['filters'](_['pick'](_0x2061a3[_0xc767('0x34')],_0x4ae947[_0xc767('0x36')]));if(_0x2061a3['query'][_0xc767('0x43')]){_0x5b3788[_0xc767('0x3e')]=_['merge'](_0x5b3788[_0xc767('0x3e')],{'$or':_[_0xc767('0x2e')](_0x5b3788[_0xc767('0x38')],function(_0x56f599){var _0x454feb={};_0x454feb[_0x56f599]={'$like':'%'+_0x2061a3['query'][_0xc767('0x43')]+'%'};return _0x454feb;})});}_0x5b3788=_['merge']({},_0x5b3788,_0x2061a3['options']);return _0x51959a[_0xc767('0x85')](_0x5b3788);}})[_0xc767('0x26')](function(_0x3d0a35){if(_0x3d0a35){_0x4cdf17=_0x3d0a35['length'];if(!_0x2061a3['query'][_0xc767('0x3a')](_0xc767('0x3b'))){_0x5b3788[_0xc767('0x3c')]=qs[_0xc767('0x3c')](_0x2061a3['query']['limit']);_0x5b3788[_0xc767('0x1d')]=qs['offset'](_0x2061a3[_0xc767('0x34')][_0xc767('0x1d')]);}return _0x51959a[_0xc767('0x85')](_0x5b3788);}})['then'](function(_0x13aa75){if(_0x13aa75){return _0x13aa75?{'count':_0x4cdf17,'rows':_0x13aa75}:null;}})[_0xc767('0x26')](respondWithResult(_0x44b3bc,null))['catch'](handleError(_0x44b3bc,null));};exports[_0xc767('0x86')]=function(_0x56bf5e,_0xf12eac,_0x442bd9){var _0x1feb24,_0x1e0280;return db[_0xc767('0x2f')]['find']({'where':{'id':_0x56bf5e[_0xc767('0x55')]['id']}})[_0xc767('0x26')](handleEntityNotFound(_0xf12eac,null))[_0xc767('0x26')](function(_0x42ab2c){if(_0x42ab2c){_0x1e0280=_0x42ab2c;return _0x42ab2c[_0xc767('0x86')](_0x56bf5e[_0xc767('0x4d')]['ids'],_[_0xc767('0x56')](_0x56bf5e['body'],[_0xc767('0x68'),'id'])||{});}return null;})[_0xc767('0x69')](function(_0x348552){var _0x469fd1;_0x1feb24=_0x348552||[];var _0x5156fe=[];if(_0x348552){for(var _0x418979=0x0;_0x418979<_0x348552[_0xc767('0x49')];_0x418979+=0x1){var _0x3772e6=_0x348552[_0x418979][_0xc767('0x28')]({'plain':!![]});_0x469fd1=squel[_0xc767('0x81')]()['into'](_0xc767('0x87'))[_0xc767('0x7e')]([_0xc767('0x6d'),_0xc767('0x6f'),_0xc767('0x70'),'CampaignId',_0xc767('0x58'),'updatedAt'],squel['select']()[_0xc767('0x72')](_0xc767('0x6d'),_0xc767('0x6d'))['field']('id',_0xc767('0x6f'))[_0xc767('0x72')](_0x3772e6['CmListId'][_0xc767('0x74')](),_0xc767('0x70'))[_0xc767('0x72')](_0x56bf5e[_0xc767('0x55')]['id']['toString'](),'CampaignId')['field'](_0xc767('0x75'),_0xc767('0x58'))['field'](_0xc767('0x75'),_0xc767('0x57'))[_0xc767('0x7f')]('cm_contacts')[_0xc767('0x3e')](_0xc767('0x77'))[_0xc767('0x3e')]('ListId\x20=\x20?',_0x3772e6['CmListId'][_0xc767('0x74')]())[_0xc767('0x3e')](_0xc767('0x79')))[_0xc767('0x74')]();_0x5156fe['push'](db[_0xc767('0x88')][_0xc767('0x34')](_0x469fd1));}return BPromise[_0xc767('0x83')](_0x5156fe);}})['then'](function(){return _0x1feb24;})[_0xc767('0x26')](respondWithResult(_0xf12eac,null))[_0xc767('0x4b')](handleError(_0xf12eac,null));};exports['removeBlackLists']=function(_0xe1d62d,_0x94481a,_0x489aaa){return db['Campaign'][_0xc767('0x4a')]({'where':{'id':_0xe1d62d['params']['id']}})['then'](handleEntityNotFound(_0x94481a,null))[_0xc767('0x26')](function(_0xbeeb1c){if(_0xbeeb1c){return _0xbeeb1c[_0xc767('0x89')](_0xe1d62d[_0xc767('0x34')][_0xc767('0x68')]);}})[_0xc767('0x26')](function(_0x568780){if(_0x568780){return db[_0xc767('0x64')][_0xc767('0x27')]({'where':{'ListId':_0xe1d62d[_0xc767('0x34')][_0xc767('0x68')],'CampaignId':_0xe1d62d[_0xc767('0x55')]['id']}})[_0xc767('0x26')](function(){return _0x568780;});}})[_0xc767('0x26')](respondWithStatusCode(_0x94481a,null))[_0xc767('0x4b')](handleError(_0x94481a,null));}; \ No newline at end of file +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 diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f11ae70..0dcc405 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_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 diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index a98356c..8c624c5 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 _0xfc1e=['result','GetCampaign','findAll','options','attributes','limit','include','map','model','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x945b63,_0x59dc52){var _0x40697f=function(_0x3bf9b1){while(--_0x3bf9b1){_0x945b63['push'](_0x945b63['shift']());}};_0x40697f(++_0x59dc52);}(_0xfc1e,0x1c9));var _0xefc1=function(_0xf2662b,_0x4d8f41){_0xf2662b=_0xf2662b-0x0;var _0x257dc7=_0xfc1e[_0xf2662b];return _0x257dc7;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Campaign,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Campaign'][_0xefc1('0x15')]({'raw':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x257914['options']?_0x257914[_0xefc1('0x16')]['where']||null:null,'attributes':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x17')]||null:null,'limit':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x18')]||null:null,'include':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')][_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x257914[_0xefc1('0x16')]['include'],function(_0x2f4935){return{'model':db[_0x2f4935[_0xefc1('0x1b')]],'as':_0x2f4935['as'],'attributes':_0x2f4935['attributes'],'include':_0x2f4935[_0xefc1('0x19')]?_['map'](_0x2f4935['include'],function(_0x21aa3b){return{'model':db[_0x21aa3b[_0xefc1('0x1b')]],'as':_0x21aa3b['as'],'attributes':_0x21aa3b[_0xefc1('0x17')],'include':_0x21aa3b[_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x21aa3b[_0xefc1('0x19')],function(_0x538145){return{'model':db[_0x538145['model']],'as':_0x538145['as'],'attributes':_0x538145[_0xefc1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xefc1('0x9')](function(_0x20e438){logger[_0xefc1('0xa')](_0xefc1('0x14'),_0x257914);logger['debug'](_0xefc1('0x14'),_0x257914,JSON[_0xefc1('0xf')](_0x20e438));_0x3b5a6e(_0x20e438);})['catch'](function(_0x486a5b){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x486a5b[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c['error'](0x1f4,_0x486a5b[_0xefc1('0x12')]));});});}; \ No newline at end of file +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 diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index add68e5..35f88a8 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 _0x2828=['Router','fs-extra','../../components/interaction/service','./campaign.controller','isAuthenticated','index','get','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','addLists','update','delete','destroy','removeBlackLists','exports','util','path','connect-timeout','express'];(function(_0x105cd1,_0x277472){var _0x28480f=function(_0x4a706a){while(--_0x4a706a){_0x105cd1['push'](_0x105cd1['shift']());}};_0x28480f(++_0x277472);}(_0x2828,0x1dc));var _0x8282=function(_0x4a1cb6,_0x2401f4){_0x4a1cb6=_0x4a1cb6-0x0;var _0x5c33cf=_0x2828[_0x4a1cb6];return _0x5c33cf;};'use strict';var multer=require('multer');var util=require(_0x8282('0x0'));var path=require(_0x8282('0x1'));var timeout=require(_0x8282('0x2'));var express=require(_0x8282('0x3'));var router=express[_0x8282('0x4')]();var fs_extra=require(_0x8282('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8282('0x6'));var config=require('../../config/environment');var controller=require(_0x8282('0x7'));router['get']('/',auth[_0x8282('0x8')](),controller[_0x8282('0x9')]);router[_0x8282('0xa')](_0x8282('0xb'),auth[_0x8282('0x8')](),controller['show']);router[_0x8282('0xa')](_0x8282('0xc'),auth[_0x8282('0x8')](),controller[_0x8282('0xd')]);router[_0x8282('0xa')](_0x8282('0xe'),auth[_0x8282('0x8')](),controller['getHopperHistories']);router[_0x8282('0xa')](_0x8282('0xf'),auth['isAuthenticated'](),controller[_0x8282('0x10')]);router[_0x8282('0xa')](_0x8282('0x11'),auth['isAuthenticated'](),controller[_0x8282('0x12')]);router[_0x8282('0xa')](_0x8282('0x13'),auth['isAuthenticated'](),controller['getLists']);router[_0x8282('0xa')](_0x8282('0x14'),auth[_0x8282('0x8')](),controller[_0x8282('0x15')]);router[_0x8282('0x16')]('/',auth[_0x8282('0x8')](),controller['create']);router[_0x8282('0x16')](_0x8282('0x17'),auth[_0x8282('0x8')](),controller['clone']);router[_0x8282('0x16')](_0x8282('0x13'),auth[_0x8282('0x8')](),controller[_0x8282('0x18')]);router[_0x8282('0x16')](_0x8282('0x14'),auth['isAuthenticated'](),controller['addBlackLists']);router['put']('/:id',auth[_0x8282('0x8')](),controller[_0x8282('0x19')]);router[_0x8282('0x1a')](_0x8282('0xb'),auth['isAuthenticated'](),controller[_0x8282('0x1b')]);router['delete'](_0x8282('0x13'),auth['isAuthenticated'](),controller['removeLists']);router[_0x8282('0x1a')](_0x8282('0x14'),auth['isAuthenticated'](),controller[_0x8282('0x1c')]);module[_0x8282('0x1d')]=router; \ No newline at end of file +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 diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 9e16267..089691b 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 _0x2d92=['exports','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x41396d,_0x2bdcc7){var _0x3ec7f0=function(_0x430fb9){while(--_0x430fb9){_0x41396d['push'](_0x41396d['shift']());}};_0x3ec7f0(++_0x2bdcc7);}(_0x2d92,0x1df));var _0x22d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2d92[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x22d9('0x0'));module[_0x22d9('0x1')]={'key':{'type':Sequelize[_0x22d9('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x22d9('0x2')]},'name':{'type':Sequelize[_0x22d9('0x3')],'get':function(){return this[_0x22d9('0x4')](_0x22d9('0x5'));}}}; \ No newline at end of file +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 diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f92ac10..35587b7 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 _0x5a93=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','get','CannedAnswers','UserProfileResource','then','end','error','stack','name','send','map','CannedAnswer','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service'];(function(_0x2e2eb2,_0x29d6fb){var _0x1d0647=function(_0x9c5826){while(--_0x9c5826){_0x2e2eb2['push'](_0x2e2eb2['shift']());}};_0x1d0647(++_0x29d6fb);}(_0x5a93,0xab));var _0x35a9=function(_0x228685,_0x2fdfe3){_0x228685=_0x228685-0x0;var _0x2364ac=_0x5a93[_0x228685];return _0x2364ac;};'use strict';var emlformat=require(_0x35a9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x35a9('0x1'));var rp=require(_0x35a9('0x2'));var moment=require(_0x35a9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x35a9('0x4'));var util=require(_0x35a9('0x5'));var path=require(_0x35a9('0x6'));var sox=require(_0x35a9('0x7'));var csv=require(_0x35a9('0x8'));var ejs=require(_0x35a9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35a9('0xa'));var squel=require(_0x35a9('0xb'));var crypto=require(_0x35a9('0xc'));var jsforce=require(_0x35a9('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x35a9('0x8'));var querystring=require(_0x35a9('0xe'));var Papa=require(_0x35a9('0xf'));var Redis=require('ioredis');var authService=require(_0x35a9('0x10'));var qs=require(_0x35a9('0x11'));var as=require(_0x35a9('0x12'));var hardwareService=require(_0x35a9('0x13'));var logger=require(_0x35a9('0x14'))(_0x35a9('0x15'));var utils=require('../../config/utils');var config=require(_0x35a9('0x16'));var licenseUtil=require(_0x35a9('0x17'));var db=require(_0x35a9('0x18'))['db'];function respondWithStatusCode(_0x5dfe37,_0x111e2d){_0x111e2d=_0x111e2d||0xcc;return function(_0x3067c8){if(_0x3067c8){return _0x5dfe37[_0x35a9('0x19')](_0x111e2d);}return _0x5dfe37[_0x35a9('0x1a')](_0x111e2d)['end']();};}function respondWithResult(_0x3d9241,_0x4af1c7){_0x4af1c7=_0x4af1c7||0xc8;return function(_0x335469){if(_0x335469){return _0x3d9241[_0x35a9('0x1a')](_0x4af1c7)[_0x35a9('0x1b')](_0x335469);}};}function respondWithFilteredResult(_0x3a7ff3,_0x3a8403){return function(_0x1f1ac5){if(_0x1f1ac5){var _0x5af421=typeof _0x3a8403['offset']===_0x35a9('0x1c')&&typeof _0x3a8403[_0x35a9('0x1d')]==='undefined';var _0x24398e=_0x1f1ac5[_0x35a9('0x1e')];var _0x158e67=_0x5af421?0x0:_0x3a8403[_0x35a9('0x1f')];var _0x2374c4=_0x5af421?_0x1f1ac5[_0x35a9('0x1e')]:_0x3a8403[_0x35a9('0x1f')]+_0x3a8403[_0x35a9('0x1d')];var _0x124a8e;if(_0x2374c4>=_0x24398e){_0x2374c4=_0x24398e;_0x124a8e=0xc8;}else{_0x124a8e=0xce;}_0x3a7ff3['status'](_0x124a8e);return _0x3a7ff3['set'](_0x35a9('0x20'),_0x158e67+'-'+_0x2374c4+'/'+_0x24398e)[_0x35a9('0x1b')](_0x1f1ac5);}return null;};}function patchUpdates(_0x3a8f85){return function(_0x146b99){try{jsonpatch[_0x35a9('0x21')](_0x146b99,_0x3a8f85,!![]);}catch(_0x562f81){return BPromise[_0x35a9('0x22')](_0x562f81);}return _0x146b99[_0x35a9('0x23')]();};}function saveUpdates(_0x1e9f58,_0x14d884){return function(_0x3b31a1){if(_0x3b31a1){return _0x3b31a1[_0x35a9('0x24')](_0x1e9f58)['then'](function(_0x33dc58){return _0x33dc58;});}return null;};}function removeEntity(_0x4f57e3,_0x3953c6){return function(_0xcf1c03){if(_0xcf1c03){return _0xcf1c03[_0x35a9('0x25')]()['then'](function(){var _0x33c4f8=_0xcf1c03[_0x35a9('0x26')]({'plain':!![]});var _0x4a18e3=_0x35a9('0x27');return db[_0x35a9('0x28')][_0x35a9('0x25')]({'where':{'type':_0x4a18e3,'resourceId':_0x33c4f8['id']}})[_0x35a9('0x29')](function(){return _0xcf1c03;});})[_0x35a9('0x29')](function(){_0x4f57e3['status'](0xcc)[_0x35a9('0x2a')]();});}};}function handleEntityNotFound(_0x2b7dd0,_0x516e5b){return function(_0x42d348){if(!_0x42d348){_0x2b7dd0[_0x35a9('0x19')](0x194);}return _0x42d348;};}function handleError(_0x784b3b,_0x566dcb){_0x566dcb=_0x566dcb||0x1f4;return function(_0x5dd3fc){logger[_0x35a9('0x2b')](_0x5dd3fc[_0x35a9('0x2c')]);if(_0x5dd3fc['name']){delete _0x5dd3fc[_0x35a9('0x2d')];}_0x784b3b[_0x35a9('0x1a')](_0x566dcb)[_0x35a9('0x2e')](_0x5dd3fc);};}exports['index']=function(_0x4f0e2c,_0x28c407){var _0x3b00ae={},_0x17c481={},_0x29d9c6={'count':0x0,'rows':[]};var _0x3fa77d=_[_0x35a9('0x2f')](db[_0x35a9('0x30')]['rawAttributes'],function(_0x19d3ad){return{'name':_0x19d3ad[_0x35a9('0x31')],'type':_0x19d3ad[_0x35a9('0x32')][_0x35a9('0x33')]};});_0x17c481['model']=_[_0x35a9('0x2f')](_0x3fa77d,'name');_0x17c481[_0x35a9('0x34')]=_[_0x35a9('0x35')](_0x4f0e2c[_0x35a9('0x34')]);_0x17c481[_0x35a9('0x36')]=_[_0x35a9('0x37')](_0x17c481[_0x35a9('0x38')],_0x17c481['query']);_0x3b00ae['attributes']=_[_0x35a9('0x37')](_0x17c481[_0x35a9('0x38')],qs[_0x35a9('0x39')](_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x39')]));_0x3b00ae[_0x35a9('0x3a')]=_0x3b00ae['attributes'][_0x35a9('0x3b')]?_0x3b00ae['attributes']:_0x17c481[_0x35a9('0x38')];if(!_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x3c')](_0x35a9('0x3d'))){_0x3b00ae[_0x35a9('0x1d')]=qs[_0x35a9('0x1d')](_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x1d')]);_0x3b00ae['offset']=qs[_0x35a9('0x1f')](_0x4f0e2c[_0x35a9('0x34')]['offset']);}_0x3b00ae[_0x35a9('0x3e')]=qs[_0x35a9('0x3f')](_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x3f')]);_0x3b00ae[_0x35a9('0x40')]=qs[_0x35a9('0x36')](_[_0x35a9('0x41')](_0x4f0e2c[_0x35a9('0x34')],_0x17c481['filters']),_0x3fa77d);if(_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x42')]){_0x3b00ae[_0x35a9('0x40')]=_[_0x35a9('0x43')](_0x3b00ae[_0x35a9('0x40')],{'$or':[{'key':{'$like':'%'+_0x4f0e2c['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x42')]+'%'}}]});}_0x3b00ae=_[_0x35a9('0x43')]({},_0x3b00ae,_0x4f0e2c['options']);var _0x10dc44={'where':_0x3b00ae[_0x35a9('0x40')]};return db[_0x35a9('0x30')]['count'](_0x10dc44)[_0x35a9('0x29')](function(_0x36f4d9){_0x29d9c6[_0x35a9('0x1e')]=_0x36f4d9;if(_0x4f0e2c[_0x35a9('0x34')][_0x35a9('0x44')]){_0x3b00ae[_0x35a9('0x45')]=[{'all':!![]}];}return db[_0x35a9('0x30')][_0x35a9('0x46')](_0x3b00ae);})[_0x35a9('0x29')](function(_0x11e25e){_0x29d9c6[_0x35a9('0x47')]=_0x11e25e;return _0x29d9c6;})[_0x35a9('0x29')](respondWithFilteredResult(_0x28c407,_0x3b00ae))[_0x35a9('0x48')](handleError(_0x28c407,null));};exports[_0x35a9('0x49')]=function(_0x9dc6fe,_0x18b7c3){var _0x41614f={'raw':!![],'where':{'id':_0x9dc6fe[_0x35a9('0x4a')]['id']}},_0x38238a={};_0x38238a['model']=_['keys'](db[_0x35a9('0x30')][_0x35a9('0x4b')]);_0x38238a[_0x35a9('0x34')]=_[_0x35a9('0x35')](_0x9dc6fe[_0x35a9('0x34')]);_0x38238a[_0x35a9('0x36')]=_['intersection'](_0x38238a[_0x35a9('0x38')],_0x38238a[_0x35a9('0x34')]);_0x41614f[_0x35a9('0x3a')]=_[_0x35a9('0x37')](_0x38238a[_0x35a9('0x38')],qs['fields'](_0x9dc6fe['query'][_0x35a9('0x39')]));_0x41614f[_0x35a9('0x3a')]=_0x41614f[_0x35a9('0x3a')]['length']?_0x41614f[_0x35a9('0x3a')]:_0x38238a['model'];if(_0x9dc6fe[_0x35a9('0x34')][_0x35a9('0x44')]){_0x41614f['include']=[{'all':!![]}];}_0x41614f=_[_0x35a9('0x43')]({},_0x41614f,_0x9dc6fe[_0x35a9('0x4c')]);return db['CannedAnswer'][_0x35a9('0x4d')](_0x41614f)[_0x35a9('0x29')](handleEntityNotFound(_0x18b7c3,null))['then'](respondWithResult(_0x18b7c3,null))[_0x35a9('0x48')](handleError(_0x18b7c3,null));};exports[_0x35a9('0x24')]=function(_0x14905e,_0x1c7666){if(_0x14905e[_0x35a9('0x4e')]['id']){delete _0x14905e[_0x35a9('0x4e')]['id'];}return db[_0x35a9('0x30')]['find']({'where':{'id':_0x14905e[_0x35a9('0x4a')]['id']}})[_0x35a9('0x29')](handleEntityNotFound(_0x1c7666,null))[_0x35a9('0x29')](saveUpdates(_0x14905e[_0x35a9('0x4e')],null))['then'](respondWithResult(_0x1c7666,null))[_0x35a9('0x48')](handleError(_0x1c7666,null));};exports['destroy']=function(_0x5b38a3,_0x8cd91d){return db[_0x35a9('0x30')][_0x35a9('0x4d')]({'where':{'id':_0x5b38a3[_0x35a9('0x4a')]['id']}})[_0x35a9('0x29')](handleEntityNotFound(_0x8cd91d,null))['then'](removeEntity(_0x8cd91d,null))['catch'](handleError(_0x8cd91d,null));};exports[_0x35a9('0x4f')]=function(_0x43139a,_0x5656af){var _0x2676de={'key':_0x43139a[_0x35a9('0x4e')][_0x35a9('0x33')]};if(_0x43139a[_0x35a9('0x4e')]['MailAccountId']){_0x2676de[_0x35a9('0x50')]=_0x43139a[_0x35a9('0x4e')]['MailAccountId'];}else if(_0x43139a[_0x35a9('0x4e')][_0x35a9('0x51')]){_0x2676de[_0x35a9('0x51')]=_0x43139a[_0x35a9('0x4e')][_0x35a9('0x51')];}else if(_0x43139a[_0x35a9('0x4e')][_0x35a9('0x52')]){_0x2676de[_0x35a9('0x52')]=_0x43139a[_0x35a9('0x4e')][_0x35a9('0x52')];}else if(_0x43139a[_0x35a9('0x4e')][_0x35a9('0x53')]){_0x2676de[_0x35a9('0x53')]=_0x43139a[_0x35a9('0x4e')][_0x35a9('0x53')];}return db[_0x35a9('0x30')]['find']({'where':_0x2676de})[_0x35a9('0x29')](function(_0x127dbc){if(_0x127dbc){throw new db[(_0x35a9('0x54'))][(_0x35a9('0x55'))](_0x35a9('0x56'));}return db['CannedAnswer'][_0x35a9('0x4f')](_0x43139a[_0x35a9('0x4e')]);})[_0x35a9('0x29')](function(_0x3f846e){var _0x23496c=_0x43139a[_0x35a9('0x57')]['get']({'plain':!![]});if(!_0x23496c)throw new Error(_0x35a9('0x58'));if(_0x23496c[_0x35a9('0x59')]==='user'){var _0x26ee4c=_0x3f846e[_0x35a9('0x26')]({'plain':!![]});return db[_0x35a9('0x5a')][_0x35a9('0x4d')]({'where':{'name':_0x35a9('0x27'),'userProfileId':_0x23496c[_0x35a9('0x5b')]},'raw':!![]})[_0x35a9('0x29')](function(_0x29733a){if(_0x29733a&&_0x29733a[_0x35a9('0x5c')]===0x0){return db['UserProfileResource'][_0x35a9('0x4f')]({'name':_0x26ee4c[_0x35a9('0x2d')],'resourceId':_0x26ee4c['id'],'type':_0x29733a[_0x35a9('0x2d')],'sectionId':_0x29733a['id']},{})[_0x35a9('0x29')](function(){return _0x3f846e;});}else{return _0x3f846e;}})[_0x35a9('0x48')](function(_0x442e9c){logger[_0x35a9('0x2b')](_0x35a9('0x5d'),_0x442e9c);throw _0x442e9c;});}return _0x3f846e;})['then'](respondWithResult(_0x5656af,0xc9))['catch'](handleError(_0x5656af,null));}; \ No newline at end of file +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 diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 1210012..9081d36 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 _0x4ca0=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash'];(function(_0x27081f,_0x5942ef){var _0x43d207=function(_0x25be6c){while(--_0x25be6c){_0x27081f['push'](_0x27081f['shift']());}};_0x43d207(++_0x5942ef);}(_0x4ca0,0x1c1));var _0x04ca=function(_0x349148,_0x31eabb){_0x349148=_0x349148-0x0;var _0x2f2b0f=_0x4ca0[_0x349148];return _0x2f2b0f;};'use strict';var _=require(_0x04ca('0x0'));var util=require(_0x04ca('0x1'));var logger=require(_0x04ca('0x2'))('api');var moment=require(_0x04ca('0x3'));var BPromise=require(_0x04ca('0x4'));var rp=require(_0x04ca('0x5'));var fs=require('fs');var path=require(_0x04ca('0x6'));var rimraf=require(_0x04ca('0x7'));var config=require(_0x04ca('0x8'));var attributes=require(_0x04ca('0x9'));module[_0x04ca('0xa')]=function(_0x32c73b,_0x338dd6){return _0x32c73b[_0x04ca('0xb')](_0x04ca('0xc'),attributes,{'tableName':_0x04ca('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x04ca('0xe')});}; \ No newline at end of file +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 diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 6769f83..4c1e561 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(_0x5e1b60,_0x41fcca){var _0x284a1e=function(_0x38f226){while(--_0x38f226){_0x5e1b60['push'](_0x5e1b60['shift']());}};_0x284a1e(++_0x41fcca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'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(_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 diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 7870614..c488043 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 _0xefde=['fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xefde,0xaf));var _0xeefd=function(_0x39956f,_0x3cf033){_0x39956f=_0x39956f-0x0;var _0x220c40=_0xefde[_0x39956f];return _0x220c40;};'use strict';var multer=require(_0xeefd('0x0'));var util=require(_0xeefd('0x1'));var path=require(_0xeefd('0x2'));var timeout=require(_0xeefd('0x3'));var express=require(_0xeefd('0x4'));var router=express['Router']();var fs_extra=require(_0xeefd('0x5'));var auth=require(_0xeefd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeefd('0x7'));router[_0xeefd('0x8')]('/',auth[_0xeefd('0x9')](),controller[_0xeefd('0xa')]);router[_0xeefd('0x8')](_0xeefd('0xb'),auth['isAuthenticated'](),controller[_0xeefd('0xc')]);router[_0xeefd('0xd')]('/',auth[_0xeefd('0x9')](),controller['create']);router['put'](_0xeefd('0xb'),auth[_0xeefd('0x9')](),controller[_0xeefd('0xe')]);router[_0xeefd('0xf')](_0xeefd('0xb'),auth[_0xeefd('0x9')](),controller[_0xeefd('0x10')]);module[_0xeefd('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 6dfa174..d1d4649 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 _0x38d0=['INTEGER','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x2b4f12,_0x281a09){var _0x53a86b=function(_0x5592a1){while(--_0x5592a1){_0x2b4f12['push'](_0x2b4f12['shift']());}};_0x53a86b(++_0x281a09);}(_0x38d0,0x123));var _0x038d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x38d0[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0x038d('0x0')]={'calldate':{'type':Sequelize[_0x038d('0x1')],'allowNull':![],'defaultValue':_0x038d('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x038d('0x3')]},'dst':{'type':Sequelize[_0x038d('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0x038d('0x3')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x038d('0x3')]},'duration':{'type':Sequelize[_0x038d('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x038d('0x3')]},'amaflags':{'type':Sequelize[_0x038d('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x038d('0x3')]},'userfield':{'type':Sequelize[_0x038d('0x3')]},'uniqueid':{'type':Sequelize[_0x038d('0x3')]},'linkedid':{'type':Sequelize[_0x038d('0x3')]},'sequence':{'type':Sequelize[_0x038d('0x3')]},'peeraccount':{'type':Sequelize[_0x038d('0x3')]},'type':{'type':Sequelize[_0x038d('0x3')]},'tag':{'type':Sequelize[_0x038d('0x3')]}}; \ No newline at end of file +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 diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index bc4b36d..bb8eb13 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 _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x2b05b5,_0x4484cc){var _0x1977ba=function(_0x2357a6){while(--_0x2357a6){_0x2b05b5['push'](_0x2b05b5['shift']());}};_0x1977ba(++_0x4484cc);}(_0x86f4,0x18a));var _0x486f=function(_0x2dbd46,_0x1120dd){_0x2dbd46=_0x2dbd46-0x0;var _0x2a7979=_0x86f4[_0x2dbd46];return _0x2a7979;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));}; \ No newline at end of file +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 diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 4dd8c5d..c1d9165 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(_0x37397b,_0x408952){var _0x3c1277=function(_0x13289d){while(--_0x13289d){_0x37397b['push'](_0x37397b['shift']());}};_0x3c1277(++_0x408952);}(_0x7a54,0x106));var _0x47a5=function(_0x2526c4,_0x875be6){_0x2526c4=_0x2526c4-0x0;var _0x1f4759=_0x7a54[_0x2526c4];return _0x1f4759;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_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 diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 62550ad..9192d05 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 _0x5c2a=['client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment','jayson/promise'];(function(_0x20beae,_0x5eac6d){var _0xf5725=function(_0x926a3b){while(--_0x926a3b){_0x20beae['push'](_0x20beae['shift']());}};_0xf5725(++_0x5eac6d);}(_0x5c2a,0x159));var _0xa5c2=function(_0x57966a,_0x477964){_0x57966a=_0x57966a-0x0;var _0x191765=_0x5c2a[_0x57966a];return _0x191765;};'use strict';var _=require(_0xa5c2('0x0'));var util=require(_0xa5c2('0x1'));var moment=require(_0xa5c2('0x2'));var BPromise=require('bluebird');var rs=require(_0xa5c2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa5c2('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa5c2('0x5'));var jayson=require(_0xa5c2('0x6'));var client=jayson[_0xa5c2('0x7')][_0xa5c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5252d7,_0x56522c,_0x43efdc){return new BPromise(function(_0xc2e593,_0x28ee2c){return client[_0xa5c2('0x9')](_0x5252d7,_0x43efdc)[_0xa5c2('0xa')](function(_0x3a68a2){logger[_0xa5c2('0xb')](_0xa5c2('0xc'),_0x56522c,_0xa5c2('0xd'));logger[_0xa5c2('0xe')](_0xa5c2('0xf'),_0x56522c,_0xa5c2('0xd'),JSON[_0xa5c2('0x10')](_0x3a68a2));if(_0x3a68a2[_0xa5c2('0x11')]){if(_0x3a68a2['error'][_0xa5c2('0x12')]===0x1f4){logger['error'](_0xa5c2('0xc'),_0x56522c,_0x3a68a2[_0xa5c2('0x11')][_0xa5c2('0x13')]);return _0x28ee2c(_0x3a68a2[_0xa5c2('0x11')][_0xa5c2('0x13')]);}logger['error'](_0xa5c2('0xc'),_0x56522c,_0x3a68a2[_0xa5c2('0x11')]['message']);return _0xc2e593(_0x3a68a2[_0xa5c2('0x11')][_0xa5c2('0x13')]);}else{logger[_0xa5c2('0xb')](_0xa5c2('0xc'),_0x56522c,'request\x20sent');_0xc2e593(_0x3a68a2[_0xa5c2('0x14')][_0xa5c2('0x13')]);}})[_0xa5c2('0x15')](function(_0x5792b7){logger['error'](_0xa5c2('0xc'),_0x56522c,_0x5792b7);_0x28ee2c(_0x5792b7);});});} \ No newline at end of file +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 diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index cca6550..59e9d6c 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(_0x4da196,_0x357dc9){var _0x375df3=function(_0x366603){while(--_0x366603){_0x4da196['push'](_0x4da196['shift']());}};_0x375df3(++_0x357dc9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index e710d59..c495b0d 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 _0x42a3=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x247357,_0x13b9ce){var _0x50f127=function(_0x295423){while(--_0x295423){_0x247357['push'](_0x247357['shift']());}};_0x50f127(++_0x13b9ce);}(_0x42a3,0x133));var _0x342a=function(_0x285457,_0x4fb41a){_0x285457=_0x285457-0x0;var _0x129ed9=_0x42a3[_0x285457];return _0x129ed9;};'use strict';var Sequelize=require(_0x342a('0x0'));module[_0x342a('0x1')]={'priority':{'type':Sequelize[_0x342a('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x342a('0x3')},'appdata':{'type':Sequelize[_0x342a('0x4')]()},'description':{'type':Sequelize[_0x342a('0x5')]},'interval':{'type':Sequelize[_0x342a('0x5')],'defaultValue':_0x342a('0x6')}}; \ No newline at end of file +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 diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1169c83..a5d52f4 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 _0xbf3f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','options','find','catch','body','eml-format','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xbf3f,0x10f));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xfbf3('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(_0xfbf3('0x1'));var Mustache=require(_0xfbf3('0x2'));var util=require(_0xfbf3('0x3'));var path=require('path');var sox=require(_0xfbf3('0x4'));var csv=require(_0xfbf3('0x5'));var ejs=require(_0xfbf3('0x6'));var fs=require('fs');var fs_extra=require(_0xfbf3('0x7'));var _=require(_0xfbf3('0x8'));var squel=require(_0xfbf3('0x9'));var crypto=require(_0xfbf3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfbf3('0xb'));var toCsv=require(_0xfbf3('0x5'));var querystring=require(_0xfbf3('0xc'));var Papa=require(_0xfbf3('0xd'));var Redis=require(_0xfbf3('0xe'));var authService=require(_0xfbf3('0xf'));var qs=require(_0xfbf3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbf3('0x11'));var logger=require(_0xfbf3('0x12'))('api');var utils=require(_0xfbf3('0x13'));var config=require(_0xfbf3('0x14'));var licenseUtil=require(_0xfbf3('0x15'));var db=require(_0xfbf3('0x16'))['db'];function respondWithStatusCode(_0x4a9f3c,_0x4c3898){_0x4c3898=_0x4c3898||0xcc;return function(_0x258bc4){if(_0x258bc4){return _0x4a9f3c[_0xfbf3('0x17')](_0x4c3898);}return _0x4a9f3c[_0xfbf3('0x18')](_0x4c3898)[_0xfbf3('0x19')]();};}function respondWithResult(_0x260348,_0x2683a1){_0x2683a1=_0x2683a1||0xc8;return function(_0x46c54c){if(_0x46c54c){return _0x260348[_0xfbf3('0x18')](_0x2683a1)['json'](_0x46c54c);}};}function respondWithFilteredResult(_0x51b30b,_0x3a24a5){return function(_0x565361){if(_0x565361){var _0x3cb3de=typeof _0x3a24a5[_0xfbf3('0x1a')]==='undefined'&&typeof _0x3a24a5[_0xfbf3('0x1b')]===_0xfbf3('0x1c');var _0x2e139b=_0x565361['count'];var _0x543b69=_0x3cb3de?0x0:_0x3a24a5[_0xfbf3('0x1a')];var _0x51af71=_0x3cb3de?_0x565361[_0xfbf3('0x1d')]:_0x3a24a5[_0xfbf3('0x1a')]+_0x3a24a5[_0xfbf3('0x1b')];var _0x228dfd;if(_0x51af71>=_0x2e139b){_0x51af71=_0x2e139b;_0x228dfd=0xc8;}else{_0x228dfd=0xce;}_0x51b30b[_0xfbf3('0x18')](_0x228dfd);return _0x51b30b['set'](_0xfbf3('0x1e'),_0x543b69+'-'+_0x51af71+'/'+_0x2e139b)[_0xfbf3('0x1f')](_0x565361);}return null;};}function patchUpdates(_0x3daba0){return function(_0x3ac52c){try{jsonpatch[_0xfbf3('0x20')](_0x3ac52c,_0x3daba0,!![]);}catch(_0x589300){return BPromise['reject'](_0x589300);}return _0x3ac52c['save']();};}function saveUpdates(_0x328c6f,_0x3233f5){return function(_0x4eb4dc){if(_0x4eb4dc){return _0x4eb4dc[_0xfbf3('0x21')](_0x328c6f)[_0xfbf3('0x22')](function(_0x512cec){return _0x512cec;});}return null;};}function removeEntity(_0x5ee5f7,_0x4f8175){return function(_0x147306){if(_0x147306){return _0x147306[_0xfbf3('0x23')]()[_0xfbf3('0x22')](function(){_0x5ee5f7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf72528,_0xc9240f){return function(_0x441a99){if(!_0x441a99){_0xf72528['sendStatus'](0x194);}return _0x441a99;};}function handleError(_0x52e145,_0x3bdafe){_0x3bdafe=_0x3bdafe||0x1f4;return function(_0x5d6a07){logger[_0xfbf3('0x24')](_0x5d6a07[_0xfbf3('0x25')]);if(_0x5d6a07[_0xfbf3('0x26')]){delete _0x5d6a07[_0xfbf3('0x26')];}_0x52e145['status'](_0x3bdafe)[_0xfbf3('0x27')](_0x5d6a07);};}exports[_0xfbf3('0x28')]=function(_0xfe5877,_0x2191b2){var _0x4dbb5b={'raw':!![],'where':{'id':_0xfe5877[_0xfbf3('0x29')]['id']}},_0x2315ba={};_0x2315ba[_0xfbf3('0x2a')]=_[_0xfbf3('0x2b')](db[_0xfbf3('0x2c')][_0xfbf3('0x2d')]);_0x2315ba[_0xfbf3('0x2e')]=_['keys'](_0xfe5877[_0xfbf3('0x2e')]);_0x2315ba[_0xfbf3('0x2f')]=_[_0xfbf3('0x30')](_0x2315ba[_0xfbf3('0x2a')],_0x2315ba['query']);_0x4dbb5b[_0xfbf3('0x31')]=_[_0xfbf3('0x30')](_0x2315ba[_0xfbf3('0x2a')],qs['fields'](_0xfe5877[_0xfbf3('0x2e')][_0xfbf3('0x32')]));_0x4dbb5b[_0xfbf3('0x31')]=_0x4dbb5b[_0xfbf3('0x31')][_0xfbf3('0x33')]?_0x4dbb5b[_0xfbf3('0x31')]:_0x2315ba[_0xfbf3('0x2a')];if(_0xfe5877['query'][_0xfbf3('0x34')]){_0x4dbb5b[_0xfbf3('0x35')]=[{'all':!![]}];}_0x4dbb5b=_['merge']({},_0x4dbb5b,_0xfe5877[_0xfbf3('0x36')]);return db['ChatApplication'][_0xfbf3('0x37')](_0x4dbb5b)[_0xfbf3('0x22')](handleEntityNotFound(_0x2191b2,null))[_0xfbf3('0x22')](respondWithResult(_0x2191b2,null))[_0xfbf3('0x38')](handleError(_0x2191b2,null));};exports[_0xfbf3('0x21')]=function(_0x1c2071,_0x239869){if(_0x1c2071[_0xfbf3('0x39')]['id']){delete _0x1c2071['body']['id'];}return db[_0xfbf3('0x2c')]['find']({'where':{'id':_0x1c2071[_0xfbf3('0x29')]['id']}})[_0xfbf3('0x22')](handleEntityNotFound(_0x239869,null))[_0xfbf3('0x22')](saveUpdates(_0x1c2071[_0xfbf3('0x39')],null))[_0xfbf3('0x22')](respondWithResult(_0x239869,null))['catch'](handleError(_0x239869,null));};exports[_0xfbf3('0x23')]=function(_0x5aea6e,_0x49b116){return db['ChatApplication'][_0xfbf3('0x37')]({'where':{'id':_0x5aea6e[_0xfbf3('0x29')]['id']}})[_0xfbf3('0x22')](handleEntityNotFound(_0x49b116,null))[_0xfbf3('0x22')](removeEntity(_0x49b116,null))[_0xfbf3('0x38')](handleError(_0x49b116,null));}; \ No newline at end of file +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 diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index d233c63..02339ba 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 _0xece1=['define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x5eaaa6,_0x17fcbd){var _0x265df4=function(_0x374db6){while(--_0x374db6){_0x5eaaa6['push'](_0x5eaaa6['shift']());}};_0x265df4(++_0x17fcbd);}(_0xece1,0x8a));var _0x1ece=function(_0x389089,_0x2f0865){_0x389089=_0x389089-0x0;var _0x2bc120=_0xece1[_0x389089];return _0x2bc120;};'use strict';var _=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var logger=require(_0x1ece('0x2'))(_0x1ece('0x3'));var moment=require(_0x1ece('0x4'));var BPromise=require(_0x1ece('0x5'));var rp=require(_0x1ece('0x6'));var fs=require('fs');var path=require(_0x1ece('0x7'));var rimraf=require(_0x1ece('0x8'));var config=require(_0x1ece('0x9'));var attributes=require(_0x1ece('0xa'));module[_0x1ece('0xb')]=function(_0xfe0b6c,_0x5a65b6){return _0xfe0b6c[_0x1ece('0xc')](_0x1ece('0xd'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ece('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +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 diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index d2b1eb7..a14f6db 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 _0x671f=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3f1a94,_0x414986){var _0x565cf2=function(_0x1a730d){while(--_0x1a730d){_0x3f1a94['push'](_0x3f1a94['shift']());}};_0x565cf2(++_0x414986);}(_0x671f,0x9d));var _0xf671=function(_0x76c29a,_0xc993c6){_0x76c29a=_0x76c29a-0x0;var _0x274783=_0x671f[_0x76c29a];return _0x274783;};'use strict';var _=require(_0xf671('0x0'));var util=require(_0xf671('0x1'));var moment=require(_0xf671('0x2'));var BPromise=require(_0xf671('0x3'));var rs=require(_0xf671('0x4'));var fs=require('fs');var Redis=require(_0xf671('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf671('0x6'));var logger=require(_0xf671('0x7'))('rpc');var config=require(_0xf671('0x8'));var jayson=require(_0xf671('0x9'));var client=jayson['client'][_0xf671('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40da19,_0x5e944,_0x5c44b6){return new BPromise(function(_0x5071a9,_0x1d11ed){return client[_0xf671('0xb')](_0x40da19,_0x5c44b6)[_0xf671('0xc')](function(_0x2ab582){logger[_0xf671('0xd')](_0xf671('0xe'),_0x5e944,_0xf671('0xf'));logger[_0xf671('0x10')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x5e944,_0xf671('0xf'),JSON[_0xf671('0x11')](_0x2ab582));if(_0x2ab582['error']){if(_0x2ab582[_0xf671('0x12')][_0xf671('0x13')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5e944,_0x2ab582[_0xf671('0x12')][_0xf671('0x14')]);return _0x1d11ed(_0x2ab582[_0xf671('0x12')][_0xf671('0x14')]);}logger[_0xf671('0x12')](_0xf671('0xe'),_0x5e944,_0x2ab582['error'][_0xf671('0x14')]);return _0x5071a9(_0x2ab582[_0xf671('0x12')]['message']);}else{logger[_0xf671('0xd')](_0xf671('0xe'),_0x5e944,'request\x20sent');_0x5071a9(_0x2ab582[_0xf671('0x15')][_0xf671('0x14')]);}})[_0xf671('0x16')](function(_0x398f26){logger['error']('ChatApplication,\x20%s,\x20%s',_0x5e944,_0x398f26);_0x1d11ed(_0x398f26);});});} \ No newline at end of file +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 diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f6a2a3e..d797643 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 _0x75a6=['isAuthenticated','show','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','/:id'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x75a6,0x1a8));var _0x675a=function(_0x3de426,_0xf9d115){_0x3de426=_0x3de426-0x0;var _0x5b6286=_0x75a6[_0x3de426];return _0x5b6286;};'use strict';var multer=require(_0x675a('0x0'));var util=require(_0x675a('0x1'));var path=require(_0x675a('0x2'));var timeout=require(_0x675a('0x3'));var express=require(_0x675a('0x4'));var router=express[_0x675a('0x5')]();var fs_extra=require(_0x675a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x675a('0x7'));var config=require(_0x675a('0x8'));var controller=require(_0x675a('0x9'));router['get'](_0x675a('0xa'),auth[_0x675a('0xb')](),controller[_0x675a('0xc')]);router['put'](_0x675a('0xa'),auth[_0x675a('0xb')](),controller['update']);router[_0x675a('0xd')]('/:id',auth[_0x675a('0xb')](),controller[_0x675a('0xe')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e1f5f23..5ba1f21 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 _0xef2a=['sequelize','exports','STRING','BOOLEAN'];(function(_0x4b5815,_0x44fb95){var _0x58634a=function(_0x5565ce){while(--_0x5565ce){_0x4b5815['push'](_0x4b5815['shift']());}};_0x58634a(++_0x44fb95);}(_0xef2a,0x1a0));var _0xaef2=function(_0x4539ac,_0x472c08){_0x4539ac=_0x4539ac-0x0;var _0x547d11=_0xef2a[_0x4539ac];return _0x547d11;};'use strict';var Sequelize=require(_0xaef2('0x0'));module[_0xaef2('0x1')]={'name':{'type':Sequelize[_0xaef2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xaef2('0x2')]},'write':{'type':Sequelize[_0xaef2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +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 diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 62e60e8..7949474 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 _0x0ffc=['removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','show','params','options','find','catch','create','body','describe','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User'];(function(_0x8904d4,_0x4caecf){var _0x1f90a4=function(_0x4fae06){while(--_0x4fae06){_0x8904d4['push'](_0x8904d4['shift']());}};_0x1f90a4(++_0x4caecf);}(_0x0ffc,0x198));var _0xc0ff=function(_0x35293e,_0x4197ed){_0x35293e=_0x35293e-0x0;var _0x5709b3=_0x0ffc[_0x35293e];return _0x5709b3;};'use strict';var emlformat=require(_0xc0ff('0x0'));var rimraf=require(_0xc0ff('0x1'));var zipdir=require(_0xc0ff('0x2'));var jsonpatch=require(_0xc0ff('0x3'));var rp=require(_0xc0ff('0x4'));var moment=require('moment');var BPromise=require(_0xc0ff('0x5'));var Mustache=require(_0xc0ff('0x6'));var util=require(_0xc0ff('0x7'));var path=require('path');var sox=require(_0xc0ff('0x8'));var csv=require(_0xc0ff('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc0ff('0xa'));var _=require('lodash');var squel=require(_0xc0ff('0xb'));var crypto=require(_0xc0ff('0xc'));var jsforce=require(_0xc0ff('0xd'));var deskjs=require(_0xc0ff('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc0ff('0xf'));var Papa=require(_0xc0ff('0x10'));var Redis=require('ioredis');var authService=require(_0xc0ff('0x11'));var qs=require(_0xc0ff('0x12'));var as=require(_0xc0ff('0x13'));var hardwareService=require(_0xc0ff('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xc0ff('0x15'));var config=require(_0xc0ff('0x16'));var licenseUtil=require(_0xc0ff('0x17'));var db=require(_0xc0ff('0x18'))['db'];config[_0xc0ff('0x19')]=_[_0xc0ff('0x1a')](config[_0xc0ff('0x19')],{'host':_0xc0ff('0x1b'),'port':0x18eb});var socket=require(_0xc0ff('0x1c'))(new Redis(config[_0xc0ff('0x19')]));require('./chatGroup.socket')[_0xc0ff('0x1d')](socket);function respondWithStatusCode(_0x2d373a,_0x58bca5){_0x58bca5=_0x58bca5||0xcc;return function(_0x12923c){if(_0x12923c){return _0x2d373a[_0xc0ff('0x1e')](_0x58bca5);}return _0x2d373a['status'](_0x58bca5)[_0xc0ff('0x1f')]();};}function respondWithResult(_0x2fd48f,_0x50e263){_0x50e263=_0x50e263||0xc8;return function(_0x1f5b8f){if(_0x1f5b8f){return _0x2fd48f[_0xc0ff('0x20')](_0x50e263)[_0xc0ff('0x21')](_0x1f5b8f);}};}function respondWithFilteredResult(_0x34d500,_0x116394){return function(_0x170d4f){if(_0x170d4f){var _0x2b4457=typeof _0x116394[_0xc0ff('0x22')]===_0xc0ff('0x23')&&typeof _0x116394[_0xc0ff('0x24')]===_0xc0ff('0x23');var _0x8bf309=_0x170d4f[_0xc0ff('0x25')];var _0x385793=_0x2b4457?0x0:_0x116394['offset'];var _0x30a54d=_0x2b4457?_0x170d4f[_0xc0ff('0x25')]:_0x116394['offset']+_0x116394[_0xc0ff('0x24')];var _0x1e3188;if(_0x30a54d>=_0x8bf309){_0x30a54d=_0x8bf309;_0x1e3188=0xc8;}else{_0x1e3188=0xce;}_0x34d500[_0xc0ff('0x20')](_0x1e3188);return _0x34d500[_0xc0ff('0x26')](_0xc0ff('0x27'),_0x385793+'-'+_0x30a54d+'/'+_0x8bf309)[_0xc0ff('0x21')](_0x170d4f);}return null;};}function patchUpdates(_0x51a79c){return function(_0x5ca030){try{jsonpatch[_0xc0ff('0x28')](_0x5ca030,_0x51a79c,!![]);}catch(_0x4d7668){return BPromise[_0xc0ff('0x29')](_0x4d7668);}return _0x5ca030[_0xc0ff('0x2a')]();};}function saveUpdates(_0x44f00b,_0x5b9229){return function(_0x4bdbf8){if(_0x4bdbf8){return _0x4bdbf8[_0xc0ff('0x2b')](_0x44f00b)[_0xc0ff('0x2c')](function(_0x237063){return _0x237063;});}return null;};}function removeEntity(_0x2dbc86,_0x5f775){return function(_0x54ceab){if(_0x54ceab){return _0x54ceab[_0xc0ff('0x2d')]()[_0xc0ff('0x2c')](function(){_0x2dbc86[_0xc0ff('0x20')](0xcc)[_0xc0ff('0x1f')]();});}};}function handleEntityNotFound(_0x4e741b,_0x45f099){return function(_0x1c1e96){if(!_0x1c1e96){_0x4e741b[_0xc0ff('0x1e')](0x194);}return _0x1c1e96;};}function handleError(_0x126a0a,_0x41f3c3){_0x41f3c3=_0x41f3c3||0x1f4;return function(_0x32f2c5){logger[_0xc0ff('0x2e')](_0x32f2c5[_0xc0ff('0x2f')]);if(_0x32f2c5['name']){delete _0x32f2c5[_0xc0ff('0x30')];}_0x126a0a[_0xc0ff('0x20')](_0x41f3c3)[_0xc0ff('0x31')](_0x32f2c5);};}exports['index']=function(_0x32b259,_0x1cefbd){var _0x3b50f9={},_0x6e283b={},_0x2c6d66={'count':0x0,'rows':[]};var _0x5a265f=_[_0xc0ff('0x32')](db[_0xc0ff('0x33')][_0xc0ff('0x34')],function(_0x396b94){return{'name':_0x396b94[_0xc0ff('0x35')],'type':_0x396b94[_0xc0ff('0x36')][_0xc0ff('0x37')]};});_0x6e283b[_0xc0ff('0x38')]=_[_0xc0ff('0x32')](_0x5a265f,_0xc0ff('0x30'));_0x6e283b[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0x32b259[_0xc0ff('0x39')]);_0x6e283b[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0x6e283b['model'],_0x6e283b[_0xc0ff('0x39')]);_0x3b50f9[_0xc0ff('0x3d')]=_[_0xc0ff('0x3c')](_0x6e283b[_0xc0ff('0x38')],qs['fields'](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x3e')]));_0x3b50f9[_0xc0ff('0x3d')]=_0x3b50f9[_0xc0ff('0x3d')][_0xc0ff('0x3f')]?_0x3b50f9[_0xc0ff('0x3d')]:_0x6e283b['model'];if(!_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x40')](_0xc0ff('0x41'))){_0x3b50f9[_0xc0ff('0x24')]=qs['limit'](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x24')]);_0x3b50f9[_0xc0ff('0x22')]=qs[_0xc0ff('0x22')](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x22')]);}_0x3b50f9[_0xc0ff('0x42')]=qs[_0xc0ff('0x43')](_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x43')]);_0x3b50f9[_0xc0ff('0x44')]=qs[_0xc0ff('0x3b')](_[_0xc0ff('0x45')](_0x32b259[_0xc0ff('0x39')],_0x6e283b[_0xc0ff('0x3b')]),_0x5a265f);if(_0x32b259[_0xc0ff('0x39')]['filter']){_0x3b50f9[_0xc0ff('0x44')]=_[_0xc0ff('0x46')](_0x3b50f9[_0xc0ff('0x44')],{'$or':_[_0xc0ff('0x32')](_0x5a265f,function(_0x12762f){if(_0x12762f[_0xc0ff('0x36')]!==_0xc0ff('0x47')){var _0x449588={};_0x449588[_0x12762f[_0xc0ff('0x30')]]={'$like':'%'+_0x32b259['query'][_0xc0ff('0x48')]+'%'};return _0x449588;}})});}_0x3b50f9=_['merge']({},_0x3b50f9,_0x32b259['options']);var _0x5904c6={'where':_0x3b50f9[_0xc0ff('0x44')]};return db['ChatGroup'][_0xc0ff('0x25')](_0x5904c6)['then'](function(_0x512bba){_0x2c6d66[_0xc0ff('0x25')]=_0x512bba;if(_0x32b259[_0xc0ff('0x39')][_0xc0ff('0x49')]){_0x3b50f9[_0xc0ff('0x4a')]=[{'all':!![]}];}return db[_0xc0ff('0x33')]['findAll'](_0x3b50f9);})[_0xc0ff('0x2c')](function(_0x346fd3){_0x2c6d66['rows']=_0x346fd3;return _0x2c6d66;})[_0xc0ff('0x2c')](respondWithFilteredResult(_0x1cefbd,_0x3b50f9))['catch'](handleError(_0x1cefbd,null));};exports[_0xc0ff('0x4b')]=function(_0xc4e082,_0x38e059){var _0xc08011={'raw':!![],'where':{'id':_0xc4e082[_0xc0ff('0x4c')]['id']}},_0xae3478={};_0xae3478['model']=_[_0xc0ff('0x3a')](db[_0xc0ff('0x33')][_0xc0ff('0x34')]);_0xae3478[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0xc4e082['query']);_0xae3478[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0xae3478[_0xc0ff('0x38')],_0xae3478[_0xc0ff('0x39')]);_0xc08011[_0xc0ff('0x3d')]=_['intersection'](_0xae3478[_0xc0ff('0x38')],qs[_0xc0ff('0x3e')](_0xc4e082['query'][_0xc0ff('0x3e')]));_0xc08011['attributes']=_0xc08011['attributes'][_0xc0ff('0x3f')]?_0xc08011[_0xc0ff('0x3d')]:_0xae3478[_0xc0ff('0x38')];if(_0xc4e082[_0xc0ff('0x39')][_0xc0ff('0x49')]){_0xc08011[_0xc0ff('0x4a')]=[{'all':!![]}];}_0xc08011=_[_0xc0ff('0x46')]({},_0xc08011,_0xc4e082[_0xc0ff('0x4d')]);return db['ChatGroup'][_0xc0ff('0x4e')](_0xc08011)[_0xc0ff('0x2c')](handleEntityNotFound(_0x38e059,null))[_0xc0ff('0x2c')](respondWithResult(_0x38e059,null))[_0xc0ff('0x4f')](handleError(_0x38e059,null));};exports[_0xc0ff('0x50')]=function(_0x4521ce,_0x353d70){return db[_0xc0ff('0x33')]['create'](_0x4521ce[_0xc0ff('0x51')],{})[_0xc0ff('0x2c')](respondWithResult(_0x353d70,0xc9))[_0xc0ff('0x4f')](handleError(_0x353d70,null));};exports[_0xc0ff('0x2b')]=function(_0x5c319a,_0x13edda){if(_0x5c319a[_0xc0ff('0x51')]['id']){delete _0x5c319a[_0xc0ff('0x51')]['id'];}return db[_0xc0ff('0x33')][_0xc0ff('0x4e')]({'where':{'id':_0x5c319a['params']['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x13edda,null))[_0xc0ff('0x2c')](saveUpdates(_0x5c319a[_0xc0ff('0x51')],null))[_0xc0ff('0x2c')](respondWithResult(_0x13edda,null))[_0xc0ff('0x4f')](handleError(_0x13edda,null));};exports[_0xc0ff('0x2d')]=function(_0x27107b,_0x2c9586){return db[_0xc0ff('0x33')]['find']({'where':{'id':_0x27107b[_0xc0ff('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c9586,null))[_0xc0ff('0x2c')](removeEntity(_0x2c9586,null))[_0xc0ff('0x4f')](handleError(_0x2c9586,null));};exports[_0xc0ff('0x52')]=function(_0x11aa14,_0x5ef485){return db['ChatGroup'][_0xc0ff('0x52')]()['then'](respondWithResult(_0x5ef485,null))[_0xc0ff('0x4f')](handleError(_0x5ef485,null));};exports['getUnread']=function(_0x3253bd,_0x1f6599,_0x3f3acf){return db[_0xc0ff('0x53')][_0xc0ff('0x25')]({'where':{'ChatGroupId':_0x3253bd[_0xc0ff('0x4c')]['id'],'ToId':_0x3253bd[_0xc0ff('0x54')]['id'],'read':![]}})[_0xc0ff('0x2c')](function(_0x594a93){return{'id':_[_0xc0ff('0x55')](_0x3253bd[_0xc0ff('0x4c')]['id']),'count':_0x594a93};})[_0xc0ff('0x2c')](respondWithResult(_0x1f6599,null))['catch'](handleError(_0x1f6599,null));};exports[_0xc0ff('0x56')]=function(_0x583b5f,_0x538628,_0x494f96){return db[_0xc0ff('0x33')][_0xc0ff('0x4e')]({'where':{'id':_0x583b5f[_0xc0ff('0x4c')]['id']}})['then'](handleEntityNotFound(_0x538628,null))['then'](function(_0xef5dd3){if(_0xef5dd3){return _0xef5dd3[_0xc0ff('0x56')](_0x583b5f[_0xc0ff('0x51')][_0xc0ff('0x57')],_[_0xc0ff('0x58')](_0x583b5f[_0xc0ff('0x51')],[_0xc0ff('0x57'),'id'])||{});}})[_0xc0ff('0x2c')](respondWithResult(_0x538628,null))[_0xc0ff('0x4f')](handleError(_0x538628,null));};exports[_0xc0ff('0x59')]=function(_0x13768f,_0x189f25,_0x5a396e){var _0x4fb8eb={};var _0x49fbe2={};var _0x5add53;var _0x6825bd;return db[_0xc0ff('0x33')][_0xc0ff('0x5a')]({'where':{'id':_0x13768f['params']['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x189f25,null))['then'](function(_0x3a5e83){if(_0x3a5e83){_0x5add53=_0x3a5e83;_0x49fbe2[_0xc0ff('0x38')]=_['keys'](db[_0xc0ff('0x5b')][_0xc0ff('0x34')]);_0x49fbe2[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0x13768f[_0xc0ff('0x39')]);_0x49fbe2[_0xc0ff('0x3b')]=_['intersection'](_0x49fbe2[_0xc0ff('0x38')],_0x49fbe2[_0xc0ff('0x39')]);_0x4fb8eb[_0xc0ff('0x3d')]=_['intersection'](_0x49fbe2['model'],qs['fields'](_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x3e')]));_0x4fb8eb['attributes']=_0x4fb8eb['attributes'][_0xc0ff('0x3f')]?_0x4fb8eb[_0xc0ff('0x3d')]:_0x49fbe2[_0xc0ff('0x38')];_0x4fb8eb['order']=qs[_0xc0ff('0x43')](_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x43')]);_0x4fb8eb[_0xc0ff('0x44')]=qs[_0xc0ff('0x3b')](_[_0xc0ff('0x45')](_0x13768f[_0xc0ff('0x39')],_0x49fbe2[_0xc0ff('0x3b')]));if(_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x48')]){_0x4fb8eb[_0xc0ff('0x44')]=_[_0xc0ff('0x46')](_0x4fb8eb[_0xc0ff('0x44')],{'$or':_['map'](_0x4fb8eb['attributes'],function(_0x46b339){var _0xd59441={};_0xd59441[_0x46b339]={'$like':'%'+_0x13768f['query'][_0xc0ff('0x48')]+'%'};return _0xd59441;})});}_0x4fb8eb=_[_0xc0ff('0x46')]({},_0x4fb8eb,_0x13768f[_0xc0ff('0x4d')]);return _0x5add53[_0xc0ff('0x59')](_0x4fb8eb);}})[_0xc0ff('0x2c')](function(_0x3b1c96){if(_0x3b1c96){_0x6825bd=_0x3b1c96[_0xc0ff('0x3f')];if(!_0x13768f[_0xc0ff('0x39')]['hasOwnProperty'](_0xc0ff('0x41'))){_0x4fb8eb[_0xc0ff('0x24')]=qs[_0xc0ff('0x24')](_0x13768f[_0xc0ff('0x39')][_0xc0ff('0x24')]);_0x4fb8eb[_0xc0ff('0x22')]=qs[_0xc0ff('0x22')](_0x13768f['query'][_0xc0ff('0x22')]);}return _0x5add53[_0xc0ff('0x59')](_0x4fb8eb);}})['then'](function(_0x314d55){if(_0x314d55){return _0x314d55?{'count':_0x6825bd,'rows':_0x314d55}:null;}})[_0xc0ff('0x2c')](respondWithResult(_0x189f25,null))[_0xc0ff('0x4f')](handleError(_0x189f25,null));};exports[_0xc0ff('0x5c')]=function(_0x1f2a7b,_0x45e448,_0x1b8378){return db['ChatGroup'][_0xc0ff('0x4e')]({'where':{'id':_0x1f2a7b[_0xc0ff('0x4c')]['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x45e448,null))[_0xc0ff('0x2c')](function(_0x46ce38){if(_0x46ce38){return _0x46ce38[_0xc0ff('0x5c')](_0x1f2a7b[_0xc0ff('0x39')][_0xc0ff('0x57')]);}})[_0xc0ff('0x2c')](respondWithStatusCode(_0x45e448,null))[_0xc0ff('0x4f')](handleError(_0x45e448,null));};exports[_0xc0ff('0x5d')]=function(_0x1a6c9,_0x47ee79,_0x486afa){if(_0x1a6c9['body']['id']){delete _0x1a6c9[_0xc0ff('0x51')]['id'];}return db[_0xc0ff('0x33')][_0xc0ff('0x4e')]({'where':{'id':_0x1a6c9[_0xc0ff('0x4c')]['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x47ee79,null))[_0xc0ff('0x2c')](function(_0x2f4ff0){if(_0x2f4ff0){_0x1a6c9[_0xc0ff('0x51')][_0xc0ff('0x5e')]=_0x2f4ff0['id'];return db[_0xc0ff('0x53')][_0xc0ff('0x50')](_0x1a6c9[_0xc0ff('0x51')]);}})[_0xc0ff('0x2c')](respondWithResult(_0x47ee79,null))[_0xc0ff('0x4f')](handleError(_0x47ee79,null));};exports[_0xc0ff('0x5f')]=function(_0xec8b51,_0x85a3fd,_0x1035ab){var _0x4501ce={};var _0x5ecaa7={};var _0x3c9e42;var _0x20606a;return db[_0xc0ff('0x33')]['findOne']({'where':{'id':_0xec8b51[_0xc0ff('0x4c')]['id']}})[_0xc0ff('0x2c')](handleEntityNotFound(_0x85a3fd,null))[_0xc0ff('0x2c')](function(_0x328298){if(_0x328298){_0x3c9e42=_0x328298;_0x5ecaa7[_0xc0ff('0x38')]=_['keys'](db[_0xc0ff('0x53')][_0xc0ff('0x34')]);_0x5ecaa7[_0xc0ff('0x39')]=_[_0xc0ff('0x3a')](_0xec8b51[_0xc0ff('0x39')]);_0x5ecaa7[_0xc0ff('0x3b')]=_[_0xc0ff('0x3c')](_0x5ecaa7[_0xc0ff('0x38')],_0x5ecaa7[_0xc0ff('0x39')]);_0x4501ce['attributes']=_[_0xc0ff('0x3c')](_0x5ecaa7[_0xc0ff('0x38')],qs['fields'](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x3e')]));_0x4501ce[_0xc0ff('0x3d')]=_0x4501ce[_0xc0ff('0x3d')][_0xc0ff('0x3f')]?_0x4501ce[_0xc0ff('0x3d')]:_0x5ecaa7['model'];_0x4501ce[_0xc0ff('0x42')]=qs[_0xc0ff('0x43')](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x43')]);_0x4501ce['where']=qs[_0xc0ff('0x3b')](_[_0xc0ff('0x45')](_0xec8b51[_0xc0ff('0x39')],_0x5ecaa7[_0xc0ff('0x3b')]));if(_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x48')]){_0x4501ce[_0xc0ff('0x44')]=_[_0xc0ff('0x46')](_0x4501ce[_0xc0ff('0x44')],{'$or':_[_0xc0ff('0x32')](_0x4501ce['attributes'],function(_0xcb2e22){var _0x4dc473={};_0x4dc473[_0xcb2e22]={'$like':'%'+_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x48')]+'%'};return _0x4dc473;})});}if(_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x60')]){var _0x376c61=_0xec8b51['query'][_0xc0ff('0x60')][_0xc0ff('0x61')](',');var _0x19688c={};_0x19688c[_0x376c61[0x0]]={'$gte':moment(_0x376c61[0x1])[_0xc0ff('0x62')](_0xc0ff('0x63'))};_0x4501ce['where']=_[_0xc0ff('0x46')](_0x4501ce[_0xc0ff('0x44')],_0x19688c);}_0x4501ce=_[_0xc0ff('0x46')]({},_0x4501ce,_0xec8b51['options']);return _0x3c9e42[_0xc0ff('0x5f')](_0x4501ce);}})[_0xc0ff('0x2c')](function(_0x4b87fa){if(_0x4b87fa){_0x20606a=_0x4b87fa[_0xc0ff('0x3f')];if(!_0xec8b51['query'][_0xc0ff('0x40')]('nolimit')){_0x4501ce['limit']=qs[_0xc0ff('0x24')](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x24')]);_0x4501ce[_0xc0ff('0x22')]=qs['offset'](_0xec8b51[_0xc0ff('0x39')][_0xc0ff('0x22')]);}return _0x3c9e42[_0xc0ff('0x5f')](_0x4501ce);}})[_0xc0ff('0x2c')](function(_0x555218){if(_0x555218){return _0x555218?{'count':_0x20606a,'rows':_0x555218}:null;}})['then'](respondWithResult(_0x85a3fd,null))['catch'](handleError(_0x85a3fd,null));}; \ No newline at end of file +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 diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index d72337c..86aa216 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 _0x85e6=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','setMaxListeners'];(function(_0x42f8fb,_0x326d5b){var _0x3e3df9=function(_0xdbaea4){while(--_0xdbaea4){_0x42f8fb['push'](_0x42f8fb['shift']());}};_0x3e3df9(++_0x326d5b);}(_0x85e6,0x1a5));var _0x685e=function(_0x2d4176,_0xa2a1b2){_0x2d4176=_0x2d4176-0x0;var _0x4ef7d9=_0x85e6[_0x2d4176];return _0x4ef7d9;};'use strict';var EventEmitter=require(_0x685e('0x0'));var ChatGroup=require(_0x685e('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x685e('0x2')](0x0);var events={'afterCreate':_0x685e('0x3'),'afterUpdate':'update','afterDestroy':_0x685e('0x4')};function emitEvent(_0xe95f5d){return function(_0x438489,_0x53630e,_0x1cdf9d){ChatGroupEvents['emit'](_0xe95f5d+':'+_0x438489['id'],_0x438489);ChatGroupEvents[_0x685e('0x5')](_0xe95f5d,_0x438489);_0x1cdf9d(null);};}for(var e in events){if(events[_0x685e('0x6')](e)){var event=events[e];ChatGroup[_0x685e('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file +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 diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index c58f9f0..e4afe1d 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 _0x2a7b=['util','../../config/logger','bluebird','request-promise','path','rimraf','./chatGroup.attributes','define','ChatGroup','chat_groups','lodash'];(function(_0x1ee5ef,_0x38d42b){var _0x448ab8=function(_0x508932){while(--_0x508932){_0x1ee5ef['push'](_0x1ee5ef['shift']());}};_0x448ab8(++_0x38d42b);}(_0x2a7b,0x1a1));var _0xb2a7=function(_0x4132b5,_0x2c5d9d){_0x4132b5=_0x4132b5-0x0;var _0x47b4db=_0x2a7b[_0x4132b5];return _0x47b4db;};'use strict';var _=require(_0xb2a7('0x0'));var util=require(_0xb2a7('0x1'));var logger=require(_0xb2a7('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb2a7('0x3'));var rp=require(_0xb2a7('0x4'));var fs=require('fs');var path=require(_0xb2a7('0x5'));var rimraf=require(_0xb2a7('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2a7('0x7'));module['exports']=function(_0x660743,_0x5a52cf){return _0x660743[_0xb2a7('0x8')](_0xb2a7('0x9'),attributes,{'tableName':_0xb2a7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index a1be960..ed9d93c 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 _0x2cbe=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','info','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x3d4e2f,_0x416ced){var _0x2023d3=function(_0x37abbf){while(--_0x37abbf){_0x3d4e2f['push'](_0x3d4e2f['shift']());}};_0x2023d3(++_0x416ced);}(_0x2cbe,0x110));var _0xe2cb=function(_0x5ef905,_0x564b87){_0x5ef905=_0x5ef905-0x0;var _0x367808=_0x2cbe[_0x5ef905];return _0x367808;};'use strict';var _=require('lodash');var util=require(_0xe2cb('0x0'));var moment=require(_0xe2cb('0x1'));var BPromise=require(_0xe2cb('0x2'));var rs=require(_0xe2cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe2cb('0x4'))(_0xe2cb('0x5'));var config=require(_0xe2cb('0x6'));var jayson=require(_0xe2cb('0x7'));var client=jayson[_0xe2cb('0x8')]['http']({'port':0x232a});config[_0xe2cb('0x9')]=_['defaults'](config['redis'],{'host':_0xe2cb('0xa'),'port':0x18eb});var socket=require(_0xe2cb('0xb'))(new Redis(config[_0xe2cb('0x9')]));require('./chatGroup.socket')[_0xe2cb('0xc')](socket);function respondWithRpcPromise(_0x1887b9,_0x1466a3,_0x4c66af){return new BPromise(function(_0xb161fc,_0x2b3357){return client[_0xe2cb('0xd')](_0x1887b9,_0x4c66af)['then'](function(_0x105190){logger[_0xe2cb('0xe')]('ChatGroup,\x20%s,\x20%s',_0x1466a3,'request\x20sent');logger['debug'](_0xe2cb('0xf'),_0x1466a3,_0xe2cb('0x10'),JSON['stringify'](_0x105190));if(_0x105190['error']){if(_0x105190[_0xe2cb('0x11')][_0xe2cb('0x12')]===0x1f4){logger['error'](_0xe2cb('0x13'),_0x1466a3,_0x105190['error'][_0xe2cb('0x14')]);return _0x2b3357(_0x105190[_0xe2cb('0x11')][_0xe2cb('0x14')]);}logger[_0xe2cb('0x11')](_0xe2cb('0x13'),_0x1466a3,_0x105190[_0xe2cb('0x11')][_0xe2cb('0x14')]);return _0xb161fc(_0x105190[_0xe2cb('0x11')][_0xe2cb('0x14')]);}else{logger[_0xe2cb('0xe')](_0xe2cb('0x13'),_0x1466a3,_0xe2cb('0x10'));_0xb161fc(_0x105190[_0xe2cb('0x15')]['message']);}})[_0xe2cb('0x16')](function(_0x136bab){logger[_0xe2cb('0x11')]('ChatGroup,\x20%s,\x20%s',_0x1466a3,_0x136bab);_0x2b3357(_0x136bab);});});} \ No newline at end of file +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 diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 41f7c24..b348ecf 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 _0xf03c=['emit','removeListener','register','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf03c,0x1bc));var _0xcf03=function(_0x3e54a6,_0x1733a8){_0x3e54a6=_0x3e54a6-0x0;var _0x180b03=_0xf03c[_0x3e54a6];return _0x180b03;};'use strict';var ChatGroupEvents=require(_0xcf03('0x0'));var events=[_0xcf03('0x1'),_0xcf03('0x2'),_0xcf03('0x3')];function createListener(_0xebd906,_0x475eb9){return function(_0x2d55a5){_0x475eb9[_0xcf03('0x4')](_0xebd906,_0x2d55a5);};}function removeListener(_0x11f565,_0x13a510){return function(){ChatGroupEvents[_0xcf03('0x5')](_0x11f565,_0x13a510);};}exports[_0xcf03('0x6')]=function(_0x6ced06){for(var _0x1df041=0x0,_0x16c2b6=events['length'];_0x1df041<_0x16c2b6;_0x1df041++){var _0x5983af=events[_0x1df041];var _0x516426=createListener(_0xcf03('0x7')+_0x5983af,_0x6ced06);ChatGroupEvents['on'](_0x5983af,_0x516426);}}; \ No newline at end of file +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 diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 77b2cd8..b17cf64 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 _0x7b93=['getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','removeMembers','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','show','/:id/unread','getUnread','/:id/members'];(function(_0x33d17c,_0x5aa51c){var _0x1e5980=function(_0xd75367){while(--_0xd75367){_0x33d17c['push'](_0x33d17c['shift']());}};_0x1e5980(++_0x5aa51c);}(_0x7b93,0xd8));var _0x37b9=function(_0x3dcabf,_0x3af156){_0x3dcabf=_0x3dcabf-0x0;var _0x4ad179=_0x7b93[_0x3dcabf];return _0x4ad179;};'use strict';var multer=require(_0x37b9('0x0'));var util=require(_0x37b9('0x1'));var path=require('path');var timeout=require(_0x37b9('0x2'));var express=require(_0x37b9('0x3'));var router=express[_0x37b9('0x4')]();var fs_extra=require(_0x37b9('0x5'));var auth=require(_0x37b9('0x6'));var interaction=require(_0x37b9('0x7'));var config=require(_0x37b9('0x8'));var controller=require(_0x37b9('0x9'));router[_0x37b9('0xa')]('/',auth[_0x37b9('0xb')](),controller['index']);router[_0x37b9('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x37b9('0xb')](),controller[_0x37b9('0xc')]);router[_0x37b9('0xa')](_0x37b9('0xd'),auth[_0x37b9('0xb')](),controller[_0x37b9('0xe')]);router[_0x37b9('0xa')](_0x37b9('0xf'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x10')]);router['get'](_0x37b9('0x11'),auth['isAuthenticated'](),controller[_0x37b9('0x12')]);router[_0x37b9('0x13')]('/',auth[_0x37b9('0xb')](),controller[_0x37b9('0x14')]);router['post']('/:id/members',auth[_0x37b9('0xb')](),controller[_0x37b9('0x15')]);router[_0x37b9('0x13')](_0x37b9('0x11'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x16')]);router[_0x37b9('0x17')](_0x37b9('0x18'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x19')]);router[_0x37b9('0x1a')](_0x37b9('0x18'),auth[_0x37b9('0xb')](),controller[_0x37b9('0x1b')]);router[_0x37b9('0x1a')](_0x37b9('0xf'),auth['isAuthenticated'](),controller[_0x37b9('0x1c')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 78198ce..4c87b00 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 _0x02a7=['STRING','long','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT'];(function(_0x4045ff,_0x46cbcd){var _0x5797ac=function(_0x32003f){while(--_0x32003f){_0x4045ff['push'](_0x4045ff['shift']());}};_0x5797ac(++_0x46cbcd);}(_0x02a7,0x1a6));var _0x702a=function(_0x1166a0,_0x343907){_0x1166a0=_0x1166a0-0x0;var _0x5b8a2a=_0x02a7[_0x1166a0];return _0x5b8a2a;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'closed':{'type':Sequelize[_0x702a('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x702a('0x2')]},'ratingType':{'type':Sequelize[_0x702a('0x3')](_0x702a('0x4'),_0x702a('0x5')),'defaultValue':_0x702a('0x4')},'ratingMessage':{'type':Sequelize[_0x702a('0x6')]},'pathTranscript':{'type':Sequelize[_0x702a('0x6')]},'mailTranscript':{'type':Sequelize[_0x702a('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x702a('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x702a('0x7')]},'browserName':{'type':Sequelize[_0x702a('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x702a('0x7')]},'deviceType':{'type':Sequelize[_0x702a('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x702a('0x7')]},'formData':{'type':Sequelize[_0x702a('0x6')](_0x702a('0x8'))},'read1stAt':{'type':Sequelize[_0x702a('0x9')]},'lastMsgAt':{'type':Sequelize[_0x702a('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x702a('0x3')]('in',_0x702a('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x702a('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x702a('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x702a('0x1')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index ae44eda..8d3d7ac 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 _0x36ee=['filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','u.id\x20=\x20ui.UserId','chat_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','value','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','UserId','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','where','\x20=\x20?','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','POST','email','vidaooNote','isNull','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','attachId','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','mailTranscript','transcript-%s.txt','Messages','format','customer','%s%d','Visitor','agentIdentifier','website_alias','agentAlias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','addMessage','omit','ids','getMessages','include','findAll','rows','getMyMessages','includeAgent','spread','emit','chatInteractionTags:save','removeTags','unix','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','direction','secret','read','Owner','get','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','osName','referer','customerIp','createReadStream','pipe','createWriteStream','out','server','views','downloadInteraction.ejs','log','err','unlinkSync','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','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','jayson/promise','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','limit','undefined','offset','count','set','apply','reject','save','update','then','end','sendStatus','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','fullname','TagIds','Tags','split','forEach','push','index','map','ChatInteraction','rawAttributes','type','key','model','query','keys'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0x36ee,0xe8));var _0xe36e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x36ee[_0x5b644e];return _0x49c6bf;};'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 pdf=require(_0xe36e('0x12'));var hardwareService=require(_0xe36e('0x13'));var logger=require(_0xe36e('0x14'))(_0xe36e('0x15'));var utils=require(_0xe36e('0x16'));var config=require(_0xe36e('0x17'));var licenseUtil=require(_0xe36e('0x18'));var db=require('../../mysqldb')['db'];config[_0xe36e('0x19')]=_[_0xe36e('0x1a')](config[_0xe36e('0x19')],{'host':_0xe36e('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0x19')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0xe36e('0x1c'));var client=jayson[_0xe36e('0x1d')][_0xe36e('0x1e')]({'port':0x232b});var client9004=jayson[_0xe36e('0x1d')][_0xe36e('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x924cd5,_0x2096f6,_0x39bae8,_0x387c37){return new BPromise(function(_0x428d34,_0x5792e8){var _0x333554=_0x387c37||client;return _0x333554[_0xe36e('0x1f')](_0x924cd5,_0x39bae8)['then'](function(_0x21d9a3){logger['info'](_0xe36e('0x20'),_0x2096f6,_0xe36e('0x21'));logger['debug'](_0xe36e('0x22'),_0x2096f6,_0xe36e('0x21'),JSON[_0xe36e('0x23')](_0x21d9a3));if(_0x21d9a3['error']){if(_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x25')]===0x1f4){logger[_0xe36e('0x24')](_0xe36e('0x20'),_0x2096f6,_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x5792e8(_0x21d9a3['error'][_0xe36e('0x26')]);}logger[_0xe36e('0x24')](_0xe36e('0x20'),_0x2096f6,_0x21d9a3[_0xe36e('0x24')][_0xe36e('0x26')]);return _0x428d34(_0x21d9a3['error']['message']);}else{logger[_0xe36e('0x27')](_0xe36e('0x20'),_0x2096f6,_0xe36e('0x21'));_0x428d34(_0x21d9a3[_0xe36e('0x28')][_0xe36e('0x26')]);}})[_0xe36e('0x29')](function(_0x1a045c){logger['error'](_0xe36e('0x20'),_0x2096f6,_0x1a045c);_0x5792e8(_0x1a045c);});});}function respondWithStatusCode(_0x35f9e7,_0x10597f){_0x10597f=_0x10597f||0xcc;return function(_0x262caa){if(_0x262caa){return _0x35f9e7['sendStatus'](_0x10597f);}return _0x35f9e7[_0xe36e('0x2a')](_0x10597f)['end']();};}function respondWithResult(_0xf7b02e,_0x5993de){_0x5993de=_0x5993de||0xc8;return function(_0x19f001){if(_0x19f001){return _0xf7b02e['status'](_0x5993de)[_0xe36e('0x2b')](_0x19f001);}};}function respondWithFilteredResult(_0x4c5d98,_0x3b1045){return function(_0x59548b){if(_0x59548b){var _0x4bb75b=typeof _0x3b1045['offset']==='undefined'&&typeof _0x3b1045[_0xe36e('0x2c')]===_0xe36e('0x2d');var _0x4cf185=_0x59548b['count'];var _0x1fa1ec=_0x4bb75b?0x0:_0x3b1045[_0xe36e('0x2e')];var _0x259e19=_0x4bb75b?_0x59548b[_0xe36e('0x2f')]:_0x3b1045[_0xe36e('0x2e')]+_0x3b1045[_0xe36e('0x2c')];var _0x57bb9b;if(_0x259e19>=_0x4cf185){_0x259e19=_0x4cf185;_0x57bb9b=0xc8;}else{_0x57bb9b=0xce;}_0x4c5d98[_0xe36e('0x2a')](_0x57bb9b);return _0x4c5d98[_0xe36e('0x30')]('Content-Range',_0x1fa1ec+'-'+_0x259e19+'/'+_0x4cf185)[_0xe36e('0x2b')](_0x59548b);}return null;};}function patchUpdates(_0xa06f61){return function(_0xba4869){try{jsonpatch[_0xe36e('0x31')](_0xba4869,_0xa06f61,!![]);}catch(_0x21623e){return BPromise[_0xe36e('0x32')](_0x21623e);}return _0xba4869[_0xe36e('0x33')]();};}function saveUpdates(_0x127807,_0x36cee2){return function(_0x1cc329){if(_0x1cc329){return _0x1cc329[_0xe36e('0x34')](_0x127807)['then'](function(_0x4507b9){return _0x4507b9;});}return null;};}function removeEntity(_0x59231e,_0x4a717e){return function(_0x81cf9a){if(_0x81cf9a){return _0x81cf9a['destroy']()[_0xe36e('0x35')](function(){_0x59231e[_0xe36e('0x2a')](0xcc)[_0xe36e('0x36')]();});}};}function handleEntityNotFound(_0x235437,_0x4a6a2b){return function(_0x56135c){if(!_0x56135c){_0x235437[_0xe36e('0x37')](0x194);}return _0x56135c;};}function handleError(_0x222c65,_0x19a53f){_0x19a53f=_0x19a53f||0x1f4;return function(_0x243338){logger['error'](_0x243338[_0xe36e('0x38')]);if(_0x243338[_0xe36e('0x39')]){delete _0x243338[_0xe36e('0x39')];}_0x222c65['status'](_0x19a53f)[_0xe36e('0x3a')](_0x243338);};}function getMustacheRender(_0x2ff8f4,_0x5d9f64){return Mustache[_0xe36e('0x3b')](_0x2ff8f4,_[_0xe36e('0x3c')](_0x5d9f64[_0xe36e('0x3d')],{'contact':_0x5d9f64[_0xe36e('0x3e')],'message':_0x5d9f64[_0xe36e('0x26')],'agent':_0x5d9f64[_0xe36e('0x3f')],'interaction':_0x5d9f64[_0xe36e('0x40')],'account':_0x5d9f64[_0xe36e('0x41')]}))||'';}function getInteractionUsers(_0x458a4e,_0x23da09){return new BPromise(function(_0x2f1933,_0x39dd9b){try{if(_0x23da09[_0x458a4e['id']]){_0x458a4e[_0xe36e('0x42')]=_['map'](_0x23da09[_0x458a4e['id']],function(_0x23d36e){return{'id':_0x23d36e['id'],'fullname':_0x23d36e[_0xe36e('0x43')]};});}}catch(_0xd45bb3){_0x39dd9b(_0xd45bb3);}_0x2f1933(_0x458a4e);});}function getInteractionTags(_0x11ee1d,_0x295feb){return new BPromise(function(_0x4d133b,_0x591e33){try{if(_0x11ee1d[_0xe36e('0x44')]){_0x11ee1d[_0xe36e('0x45')]=[];_0x11ee1d[_0xe36e('0x44')][_0xe36e('0x46')](',')[_0xe36e('0x47')](function(_0x34a1ba){_0x11ee1d[_0xe36e('0x45')][_0xe36e('0x48')](_0x295feb[_0x34a1ba]);});}delete _0x11ee1d['TagIds'];}catch(_0x198a40){_0x591e33(_0x198a40);}_0x4d133b(_0x11ee1d);});}function updateChatInteraction(_0x2d392c,_0x4788a0,_0x21dc35){return new BPromise(function(_0x5ef3e4,_0x23e344){return getInteractionUsers(_0x2d392c,_0x21dc35)[_0xe36e('0x35')](function(_0x1d45a4){return getInteractionTags(_0x1d45a4,_0x4788a0);})[_0xe36e('0x35')](function(_0x3b1269){_0x5ef3e4(_0x3b1269);})['catch'](function(_0x2ffc34){_0x23e344(_0x2ffc34);});});}exports[_0xe36e('0x49')]=function(_0x2265c4,_0x1dddfe){var _0x2e57f4={},_0x31760e={},_0x569809={'count':0x0,'rows':[]};var _0x122704=_[_0xe36e('0x4a')](db[_0xe36e('0x4b')][_0xe36e('0x4c')],function(_0x1cbb7d){return{'name':_0x1cbb7d['fieldName'],'type':_0x1cbb7d[_0xe36e('0x4d')][_0xe36e('0x4e')]};});_0x31760e[_0xe36e('0x4f')]=_[_0xe36e('0x4a')](_0x122704,_0xe36e('0x39'));_0x31760e[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x2265c4[_0xe36e('0x50')]);_0x31760e[_0xe36e('0x52')]=_['intersection'](_0x31760e['model'],_0x31760e[_0xe36e('0x50')]);_0x2e57f4['attributes']=_[_0xe36e('0x53')](_0x31760e[_0xe36e('0x4f')],qs[_0xe36e('0x54')](_0x2265c4[_0xe36e('0x50')]['fields']));_0x2e57f4[_0xe36e('0x55')]=_0x2e57f4[_0xe36e('0x55')]['length']?_0x2e57f4[_0xe36e('0x55')]:_0x31760e[_0xe36e('0x4f')];if(!_0x2265c4[_0xe36e('0x50')][_0xe36e('0x56')](_0xe36e('0x57'))){_0x2e57f4[_0xe36e('0x2c')]=qs[_0xe36e('0x2c')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x2c')]);_0x2e57f4[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x2e57f4[_0xe36e('0x58')]=qs[_0xe36e('0x59')](_0x2265c4['query'][_0xe36e('0x59')]);_0x2e57f4['where']=qs['filters'](_[_0xe36e('0x5a')](_0x2265c4[_0xe36e('0x50')],_0x31760e['filters']),_0x122704);var _0x3ec864=[];var _0x3814eb=squel[_0xe36e('0x5b')]()[_0xe36e('0x5c')]('id')[_0xe36e('0x5c')](_0xe36e('0x39'))[_0xe36e('0x5c')](_0xe36e('0x5d'))[_0xe36e('0x5e')]('tools_tags');var _0x22117e=squel[_0xe36e('0x5b')]()['field'](_0xe36e('0x5f'))[_0xe36e('0x5c')](_0xe36e('0x60'))[_0xe36e('0x5c')](_0xe36e('0x61'))['from']('user_has_chat_interactions','ui')['left_join']('users','u',_0xe36e('0x62'));var _0x2fab4c=squel[_0xe36e('0x5b')]()[_0xe36e('0x5e')](_0xe36e('0x63'),'i')[_0xe36e('0x64')](_0xe36e('0x65'),'c',_0xe36e('0x66'))[_0xe36e('0x64')]('users','o',_0xe36e('0x67'))[_0xe36e('0x64')]('chat_websites','a',_0xe36e('0x68'))[_0xe36e('0x64')](_0xe36e('0x69'),'me',_0xe36e('0x6a'))[_0xe36e('0x64')](_0xe36e('0x6b'),'it',_0xe36e('0x6c'))[_0xe36e('0x64')](_0xe36e('0x6d'),'t',_0xe36e('0x6e'));var _0x56718a=squel[_0xe36e('0x6f')]();var _0x389e91=[];var _0x6f979f=squel[_0xe36e('0x6f')]();var _0x3e4860;if(_0x2265c4[_0xe36e('0x50')][_0xe36e('0x70')]){_0x3e4860=as[_0xe36e('0x71')](_0x2265c4[_0xe36e('0x50')][_0xe36e('0x70')]);var _0x432584=_0x3e4860[_0xe36e('0x72')];for(var _0x434d88=0x0;_0x434d88<_0x3e4860[_0xe36e('0x73')]['length'];_0x434d88++){var _0x429a01=_0x3e4860[_0xe36e('0x73')][_0x434d88];var _0x49336b='i';var _0xce5583=_[_0xe36e('0x74')](_0x122704,[_0xe36e('0x39'),_0x429a01[_0xe36e('0x5c')]]);if(!_0xce5583){switch(_0x429a01[_0xe36e('0x5c')]){case _0xe36e('0x75'):if(_0x429a01['value']==0x1){_0x2fab4c[_0xe36e('0x76')]('`'+_0x429a01['field']+_0xe36e('0x77'));}else{_0x2fab4c[_0xe36e('0x76')]('`'+_0x429a01[_0xe36e('0x5c')]+_0xe36e('0x78'));}break;case _0xe36e('0x79'):if(_0x429a01[_0xe36e('0x7a')]===_0xe36e('0x7b')){if(_0x429a01[_0xe36e('0x7c')]['split']('\x20')[_0xe36e('0x7d')]>0x1){_0x56718a[_0x432584](_0xe36e('0x7e'),qs['getFullTextValue'](_0x429a01[_0xe36e('0x7c')]),null);}else{var _0x2bf9ac='%'+_0x429a01[_0xe36e('0x7c')]+'%';_0x56718a[_0x432584](_0xe36e('0x7f'),_0x2bf9ac,_0x2bf9ac,_0x2bf9ac);}}else{_0xce5583=_[_0xe36e('0x74')](_0x122704,[_0xe36e('0x39'),_0xe36e('0x80')]);_0x429a01['field']=_0xe36e('0x80');_0x483e06=as[_0xe36e('0x81')](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);}break;case _0xe36e('0x84'):var _0xeab452=_0x429a01[_0xe36e('0x7c')]['split'](',')[_0xe36e('0x4a')](function(_0x9a77de){return Number(_0x9a77de);});_0xeab452[_0xe36e('0x47')](function(_0x2f05f5){_0x6f979f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2f05f5+',%');});_0x389e91=_['union'](_0x389e91,_0xeab452);break;case _0xe36e('0x85'):if(_0x429a01['operator']==='$substring'){_0x56718a[_0x432584]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x429a01[_0xe36e('0x7c')]+'%',null);}else{_0xce5583=_['find'](_0x122704,[_0xe36e('0x39'),_0xe36e('0x86')]);_0x429a01[_0xe36e('0x5c')]=_0xe36e('0x86');_0x483e06=as[_0xe36e('0x81')](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06['value'][_0xe36e('0x36')]);}break;case'body':_0x483e06=as[_0xe36e('0x81')]('me',null,_0x429a01);_0x56718a[_0x432584](_0x483e06['text'],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);break;}}else{var _0x483e06=as['buildExpression'](_0x49336b,_0xce5583[_0xe36e('0x4d')],_0x429a01);_0x56718a[_0x432584](_0x483e06[_0xe36e('0x82')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x83')],_0x483e06[_0xe36e('0x7c')][_0xe36e('0x36')]);}}}else{var _0x57ae0d=_(_0x2265c4[_0xe36e('0x50')])[_0xe36e('0x51')]()['map'](function(_0xb83ea7){return _['some'](_0x122704,[_0xe36e('0x39'),_0xb83ea7])?_0xb83ea7:undefined;})[_0xe36e('0x87')]()[_0xe36e('0x7c')]();if(!_[_0xe36e('0x88')](_0x57ae0d)){_0x57ae0d['forEach'](function(_0x2d920e){if(_0x2d920e==='ChatWebsiteId'){_0x2fab4c['where'](_0xe36e('0x89'),[][_0xe36e('0x8a')](_0x2265c4['query'][_0x2d920e]));}else if(_0x2d920e==='createdAt'){var _0x460cc9=JSON['parse'](_0x2265c4[_0xe36e('0x50')][_0x2d920e])[_0xe36e('0x8b')];var _0x2c0ed5=JSON[_0xe36e('0x8c')](_0x2265c4[_0xe36e('0x50')][_0x2d920e])[_0xe36e('0x8d')];_0x2fab4c['where'](_0xe36e('0x8e'),_0x460cc9,_0x2c0ed5);}else{if(_0x2265c4[_0xe36e('0x50')][_0x2d920e]===_0xe36e('0x8f')){_0x2fab4c[_0xe36e('0x90')]('i.'+_0x2d920e+'\x20IS\x20NULL');}else{_0x2fab4c[_0xe36e('0x90')]('i.'+_0x2d920e+_0xe36e('0x91'),_0x2265c4[_0xe36e('0x50')][_0x2d920e]);}}});}if(_0x2265c4[_0xe36e('0x50')]['read']){if(_0x2265c4[_0xe36e('0x50')]['read']==0x1){_0x2fab4c[_0xe36e('0x76')]('`unreadMessages`\x20=\x200');}else{_0x2fab4c[_0xe36e('0x76')]('`unreadMessages`\x20>\x200');}}if(_0x2265c4['query'][_0xe36e('0x92')]){_0x389e91=_[_0xe36e('0x93')](_0x2265c4[_0xe36e('0x50')]['tag'])?_0x2265c4[_0xe36e('0x50')][_0xe36e('0x92')]:new Array(_0x2265c4['query'][_0xe36e('0x92')]);_0x389e91[_0xe36e('0x47')](function(_0x156e7f){_0x6f979f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x156e7f+',%');});}if(_0x2265c4['query'][_0xe36e('0x94')]){var _0x2ba37a=_0x2265c4[_0xe36e('0x50')][_0xe36e('0x94')][_0xe36e('0x95')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe36e('0x96')](_0x2ba37a)){_0x56718a['or'](_0xe36e('0x97'),_0x2ba37a+'%');}else{_0x56718a['or'](_0xe36e('0x98'),qs[_0xe36e('0x99')](_0x2ba37a))['or'](_0xe36e('0x9a'),_0x2ba37a+'%');}}}_0x2fab4c['where'](_0x56718a);_0x2fab4c[_0xe36e('0x9b')](_0xe36e('0x9c'));var _0x188dc9={'type':db['Sequelize'][_0xe36e('0x9d')]['SELECT'],'raw':!![]};var _0x2ee394=_0x2fab4c['clone']();_0x2ee394[_0xe36e('0x5c')](_0xe36e('0x9c'));_0x2ee394['field'](_0xe36e('0x9e'),'unreadMessages');if(_0x2e57f4[_0xe36e('0x58')]){_0x2e57f4[_0xe36e('0x58')][_0xe36e('0x47')](function(_0x201212){var _0x431aac=_0x201212[0x0]==='contactName'?_0x201212[0x0]:'i.'+_0x201212[0x0];_0x2fab4c[_0xe36e('0x58')](_0x431aac,_0x201212[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe36e('0x88')](_0x389e91)){_0x2fab4c[_0xe36e('0x76')](_0x6f979f);_0x2ee394[_0xe36e('0x90')](_0xe36e('0x9f'),_0x389e91);}BPromise[_0xe36e('0xa0')]()[_0xe36e('0x35')](function(){if(!_0x3e4860){if(_0x2265c4['query'][_0xe36e('0xa1')])return;_0x2ee394[_0xe36e('0x90')](_0xe36e('0xa2'));_0x2fab4c['where'](_0xe36e('0xa2'));return;}if(_0x2265c4[_0xe36e('0xa3')][_0xe36e('0xa4')]!==_0xe36e('0x3f'))return;return _0x2265c4['user'][_0xe36e('0xa5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11ebdd){if(_['isEmpty'](_0x11ebdd)){_0x2ee394[_0xe36e('0x90')](_0xe36e('0xa6'));_0x2fab4c[_0xe36e('0x90')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x2ee394[_0xe36e('0x90')](_0xe36e('0x89'),_['map'](_0x11ebdd,'id'));_0x2fab4c[_0xe36e('0x90')](_0xe36e('0x89'),_[_0xe36e('0x4a')](_0x11ebdd,'id'));}});})['then'](function(){if(_0x2265c4['user'][_0xe36e('0xa4')]===_0xe36e('0x3f')&&!_0x3e4860&&!_0x2265c4[_0xe36e('0x50')][_0xe36e('0xa1')])return[];return db[_0xe36e('0xa7')]['query'](_0x2ee394[_0xe36e('0xa8')](),_0x188dc9);})[_0xe36e('0x35')](function(_0x2c923b){_0x569809[_0xe36e('0x2f')]=_0x2c923b['length'];if(_0x569809[_0xe36e('0x2f')]===0x0)return[];return db[_0xe36e('0xa7')]['query'](_0x3814eb['toString'](),_0x188dc9)['then'](function(_0x1acffb){_0x3ec864=_['keyBy'](_0x1acffb,'id');_0x188dc9=_['merge'](_0x188dc9,{'model':db[_0xe36e('0x4b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2265c4[_0xe36e('0x50')][_0xe36e('0x54')]){_0x2e57f4[_0xe36e('0x55')][_0xe36e('0x47')](function(_0x378126){_0x2fab4c['field']('i.'+_0x378126);});}else{_0x2fab4c[_0xe36e('0x5c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xa9'),_0xe36e('0xaa'));_0x2fab4c[_0xe36e('0x5c')]('a.mandatoryDisposition',_0xe36e('0xab'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xac'),_0xe36e('0xad'));_0x2fab4c['field'](_0xe36e('0xae'));_0x2fab4c['field'](_0xe36e('0xaf'),_0xe36e('0xb0'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb1'),_0xe36e('0xb2'));_0x2fab4c['field'](_0xe36e('0xb3'),_0xe36e('0xb4'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb5'),_0xe36e('0xb6'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb7'),_0xe36e('0xb8'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xb9'),_0xe36e('0xba'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xbb'),'Owner.fullname');_0x2fab4c['field']('o.internal',_0xe36e('0xbc'));_0x2fab4c[_0xe36e('0x5c')](_0xe36e('0xbd'),_0xe36e('0x44'));}if(_0x2e57f4['limit'])_0x2fab4c[_0xe36e('0x2c')](_0x2e57f4[_0xe36e('0x2c')]);if(_0x2e57f4[_0xe36e('0x2e')])_0x2fab4c[_0xe36e('0x2e')](_0x2e57f4['offset']);return db[_0xe36e('0xa7')][_0xe36e('0x50')](_0x2fab4c[_0xe36e('0xa8')](),_0x188dc9);})[_0xe36e('0x35')](function(_0x515a79){if(_0x515a79['length']>0x0)_0x22117e[_0xe36e('0x90')](_0xe36e('0xbe'),_['map'](_0x515a79,'id'));return db['sequelize']['query'](_0x22117e[_0xe36e('0xa8')](),_0x188dc9)[_0xe36e('0x35')](function(_0xd57a9e){var _0x4d7f1a=_[_0xe36e('0xbf')](_0xd57a9e,_0xe36e('0xc0'));var _0x280812=[];_0x515a79[_0xe36e('0x47')](function(_0x5250c9){_0x280812[_0xe36e('0x48')](updateChatInteraction(_0x5250c9,_0x3ec864,_0x4d7f1a));});return BPromise[_0xe36e('0xc1')](_0x280812);});});})[_0xe36e('0x35')](function(_0x3b4152){_0x569809['rows']=_0x3b4152;return _0x569809;})[_0xe36e('0x35')](respondWithFilteredResult(_0x1dddfe,_0x2e57f4))['catch'](handleError(_0x1dddfe,null));};exports[_0xe36e('0xc2')]=function(_0x4c169c,_0x1c95cd){var _0x2b3e81={'raw':![],'where':{'id':_0x4c169c[_0xe36e('0xc3')]['id']}},_0x498822={};_0x498822[_0xe36e('0x4f')]=_['keys'](db[_0xe36e('0x4b')][_0xe36e('0x4c')]);_0x498822[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x4c169c[_0xe36e('0x50')]);_0x498822[_0xe36e('0x52')]=_['intersection'](_0x498822[_0xe36e('0x4f')],_0x498822[_0xe36e('0x50')]);_0x2b3e81['attributes']=_[_0xe36e('0x53')](_0x498822['model'],qs[_0xe36e('0x54')](_0x4c169c[_0xe36e('0x50')][_0xe36e('0x54')]));_0x2b3e81[_0xe36e('0x55')]=_0x2b3e81['attributes'][_0xe36e('0x7d')]?_0x2b3e81[_0xe36e('0x55')]:_0x498822[_0xe36e('0x4f')];if(_0x4c169c[_0xe36e('0x50')][_0xe36e('0xc4')]){_0x2b3e81['include']=[{'all':!![]}];}_0x2b3e81=_[_0xe36e('0x3c')]({},_0x2b3e81,_0x4c169c[_0xe36e('0xc5')]);return db['ChatInteraction']['find'](_0x2b3e81)[_0xe36e('0x35')](handleEntityNotFound(_0x1c95cd,null))['then'](respondWithResult(_0x1c95cd,null))[_0xe36e('0x29')](handleError(_0x1c95cd,null));};exports[_0xe36e('0xc6')]=function(_0x23dfd7,_0x3f9c84){return db[_0xe36e('0x4b')][_0xe36e('0xc6')](_0x23dfd7[_0xe36e('0x3d')],{})[_0xe36e('0x35')](respondWithResult(_0x3f9c84,0xc9))[_0xe36e('0x29')](handleError(_0x3f9c84,null));};exports[_0xe36e('0x34')]=function(_0x4ca2cc,_0xab0e50){if(_0x4ca2cc['body']['id']){delete _0x4ca2cc[_0xe36e('0x3d')]['id'];}return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x4ca2cc['params']['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0xab0e50,null))[_0xe36e('0x35')](saveUpdates(_0x4ca2cc['body'],null))[_0xe36e('0x35')](respondWithResult(_0xab0e50,null))['catch'](handleError(_0xab0e50,null));};exports[_0xe36e('0xc7')]=function(_0x3d14b1,_0x3246c6){return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x3d14b1[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x3246c6,null))[_0xe36e('0x35')](removeEntity(_0x3246c6,null))[_0xe36e('0x29')](handleError(_0x3246c6,null));};exports[_0xe36e('0xc8')]=function(_0x166c22,_0x47b082){return db['ChatInteraction'][_0xe36e('0xc8')]()[_0xe36e('0x35')](respondWithResult(_0x47b082,null))[_0xe36e('0x29')](handleError(_0x47b082,null));};exports[_0xe36e('0xc9')]=function(_0x5b3f98,_0xf38a08){var _0x24a0f6=_0x5b3f98['params']['id'];var _0x281519;var _0x4d12f6;var _0x260fff;return db[_0xe36e('0x4b')][_0xe36e('0xca')]({'where':{'id':_0x24a0f6}})['then'](function(_0x142caa){_0x281519=_0x142caa;return db[_0xe36e('0xcb')][_0xe36e('0xca')]({'where':{'id':_0x142caa[_0xe36e('0xa1')]},'attributes':['id',_0xe36e('0xcc'),_0xe36e('0xcd'),_0xe36e('0xce'),'vidaooNote',_0xe36e('0xcf')],'raw':!![]});})[_0xe36e('0x35')](function(_0x2d890a){if(_0x2d890a&&_0x2d890a[_0xe36e('0xcc')]&&_0x2d890a[_0xe36e('0xcd')]){_0x4d12f6=_0x2d890a;var _0x165372={'interaction':{'id':_0x24a0f6},'agent':{'id':_0x5b3f98[_0xe36e('0xa3')]['id'],'name':_0x5b3f98[_0xe36e('0xa3')][_0xe36e('0x39')],'fullname':_0x5b3f98['user'][_0xe36e('0x43')],'email':_0x5b3f98[_0xe36e('0xa3')]['email']},'contact':_0x5b3f98['body']['contact'],'account':_0x5b3f98[_0xe36e('0x3d')][_0xe36e('0x41')]};var _0x4ed60e={'rejectUnauthorized':![],'method':_0xe36e('0xd0'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x2d890a['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5b3f98['user'][_0xe36e('0xd1')]],'buttons':null,'topic':_0x4d12f6[_0xe36e('0xce')],'note':_['isNull'](_0x4d12f6[_0xe36e('0xd2')])?null:getMustacheRender(_0x4d12f6[_0xe36e('0xd2')],_0x165372),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0xe36e('0xd3')](_0x4d12f6[_0xe36e('0xcf')])){var _0x493407=getMustacheRender(_0x4d12f6[_0xe36e('0xcf')],_0x165372);var _0x3d451f=JSON['parse'](_0x493407);_0x4ed60e['body'][_0xe36e('0xd4')]=_0x3d451f;}}catch(_0x1e018b){throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xd7'));}return rp(_0x4ed60e);}else{throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xd8'));}})['then'](function(_0x44cf3d){_0x260fff=_0x44cf3d;if(_0x260fff['id']){var _0x7b1e8f={'body':_0x260fff[_0xe36e('0xd9')],'ChatWebsiteId':_0x4d12f6['id'],'ChatInteractionId':_0x281519['id'],'direction':'out','UserId':_0x5b3f98[_0xe36e('0xa3')]['id']};return db[_0xe36e('0xda')][_0xe36e('0xc6')](_0x7b1e8f,{});}else{throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xdb'));}})['then'](function(){return _0x281519[_0xe36e('0xdc')]({'vidaooSessionId':_0x260fff['id']});})[_0xe36e('0x35')](respondWithResult(_0xf38a08,null))['catch'](handleError(_0xf38a08,null));};exports['customUpdate']=function(_0x33f382,_0x4a6986){if(_0x33f382[_0xe36e('0x3d')]['id']){delete _0x33f382[_0xe36e('0x3d')]['id'];}return db['ChatInteraction'][_0xe36e('0x74')]({'where':{'id':_0x33f382[_0xe36e('0xc3')]['id']},'include':[{'model':db[_0xe36e('0xdd')],'as':_0xe36e('0x79')}]})['then'](handleEntityNotFound(_0x4a6986,null))['then'](saveUpdates(_0x33f382[_0xe36e('0x3d')],null))[_0xe36e('0x35')](respondWithResult(_0x4a6986,null))[_0xe36e('0x29')](handleError(_0x4a6986,null));};exports[_0xe36e('0xde')]=function(_0x15bf65,_0x2c2f12,_0x1ec6c5){if(_0x15bf65['body']['id']){delete _0x15bf65[_0xe36e('0x3d')]['id'];}return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x15bf65[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](function(_0x322fc4){if(!_0x322fc4){logger[_0xe36e('0x24')](_0xe36e('0xdf'),_0xe36e('0xde'),0x194,_0xe36e('0xe0'));_0x2c2f12[_0xe36e('0x37')](0x194);}else{if(_0x322fc4['UserId']){throw new db[(_0xe36e('0xd5'))][(_0xe36e('0xd6'))](_0xe36e('0xe1'));}}return _0x322fc4;})[_0xe36e('0x35')](function(_0x478cc9){if(_0x478cc9){return _0x478cc9['update']({'closed':_0x15bf65[_0xe36e('0x3d')]['closed'],'disposition':_0x15bf65[_0xe36e('0x3d')]['disposition']})[_0xe36e('0x35')](function(_0x52de0f){return _0x52de0f;});}})[_0xe36e('0x35')](function(_0x30928a){return respondWithRpcPromise(_0xe36e('0xe2'),_0xe36e('0xde'),_0x15bf65[_0xe36e('0x3d')],client9004);})['then'](respondWithResult(_0x2c2f12,null))[_0xe36e('0x29')](handleError(_0x2c2f12,null));};exports[_0xe36e('0xe3')]=function(_0x3b8631,_0x5bf046,_0x4fc846){_0x3b8631[_0xe36e('0x3d')][_0xe36e('0x39')]=_0x3b8631['file'][_0xe36e('0xe4')];_0x3b8631['body'][_0xe36e('0xe5')]=_0x3b8631[_0xe36e('0xe6')][_0xe36e('0xe7')];_0x3b8631[_0xe36e('0x3d')][_0xe36e('0x4d')]=_0x3b8631[_0xe36e('0xe6')][_0xe36e('0xe8')];return db[_0xe36e('0xe9')][_0xe36e('0xc6')](_0x3b8631[_0xe36e('0x3d')])[_0xe36e('0x35')](respondWithResult(_0x5bf046,0xc9))[_0xe36e('0x29')](handleError(_0x5bf046,null));};exports[_0xe36e('0xea')]=function(_0x50cc85,_0x2ad011,_0x5466b8){return db[_0xe36e('0x4b')][_0xe36e('0xca')]({'where':{'id':_0x50cc85[_0xe36e('0xc3')]['id']},'raw':!![]})[_0xe36e('0x35')](handleEntityNotFound(_0x2ad011,null))[_0xe36e('0x35')](function(_0x57456d){if(_0x57456d){if(_0x57456d[_0xe36e('0xeb')]){return _0x2ad011[_0xe36e('0x2a')](0x193)[_0xe36e('0x2b')]({'status':0x193,'message':_0xe36e('0xec')});}return db[_0xe36e('0xe9')][_0xe36e('0xca')]({'where':{'id':_0x50cc85[_0xe36e('0x50')][_0xe36e('0xed')]},'raw':!![]})[_0xe36e('0x35')](handleEntityNotFound(_0x2ad011,null));}})[_0xe36e('0x35')](function(_0x1a380e){if(_0x1a380e){var _0xd786b8=_0x1a380e[_0xe36e('0xee')]!==null;var _0x38d16c=path['join'](config[_0xe36e('0xef')],_0xe36e('0xf0'));if(_0xd786b8){_0x38d16c=path['join'](_0x38d16c,_0xe36e('0xf1'));}var _0x512a19=path[_0xe36e('0xf2')](_0x38d16c,_0x1a380e['basename']);return _0x2ad011[_0xe36e('0xf3')](_0x512a19);}})[_0xe36e('0x29')](handleError(_0x2ad011,null));};exports[_0xe36e('0xf4')]=function(_0x153b4f,_0x5d2afc){var _0xeb0eb3=null;var _0x67afa3=null;var _0x2e0f59=null;var _0x2644c7=null;if(_0x153b4f[_0xe36e('0x3d')]['id']){delete _0x153b4f[_0xe36e('0x3d')]['id'];}if(_0x153b4f['body'][_0xe36e('0xf5')]){_0x2644c7=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server/files/chat/upload/',util['format'](_0xe36e('0xf6'),Date['now']()));_0x153b4f[_0xe36e('0x3d')]['pathTranscript']=_0x2644c7;}return db[_0xe36e('0x4b')]['find']({'where':{'id':_0x153b4f[_0xe36e('0xc3')]['id']},'include':[{'model':db[_0xe36e('0xda')],'as':_0xe36e('0xf7'),'include':[{'model':db[_0xe36e('0x85')],'as':_0xe36e('0x85')}]}]})[_0xe36e('0x35')](handleEntityNotFound(_0x5d2afc,null))['then'](saveUpdates(_0x153b4f['body'],null))[_0xe36e('0x35')](function(_0x26031e){if(_0x26031e){_0xeb0eb3=_0x26031e;return db[_0xe36e('0xcb')]['find']({'where':{'id':_0xeb0eb3[_0xe36e('0xa1')]}});}})[_0xe36e('0x35')](function(_0xc1d0bd){if(_0xc1d0bd){_0x2e0f59=_0xc1d0bd;return db[_0xe36e('0xdd')][_0xe36e('0x74')]({'where':{'id':_0xeb0eb3[_0xe36e('0x80')]}});}})[_0xe36e('0x35')](function(_0x518d30){if(_0x518d30){_0x67afa3=_0x518d30;if(_0x2644c7){var _0xfb015e=null;for(var _0xd2176=0x1;_0xd2176<_0xeb0eb3[_0xe36e('0xf7')]['length'];++_0xd2176){_0xfb015e=_0xeb0eb3[_0xe36e('0xf7')][_0xd2176];var _0x4727cd=_0xfb015e['UserId']?util[_0xe36e('0xf8')]('%s%d',_0x2e0f59['agentAlias'],_0xfb015e[_0xe36e('0x86')]):'System';var _0x3ac919=_0x153b4f[_0xe36e('0x3d')][_0xe36e('0xf9')]||util['format'](_0xe36e('0xfa'),_0xe36e('0xfb'),_0xfb015e[_0xe36e('0x80')]);switch(_0x2e0f59[_0xe36e('0xfc')]){case _0xe36e('0xfd'):_0x4727cd=_0xfb015e[_0xe36e('0x86')]?util[_0xe36e('0xf8')](_0xe36e('0xfa'),_0x2e0f59[_0xe36e('0xfe')],_0xfb015e[_0xe36e('0x86')]):_0xe36e('0xff');break;case _0xe36e('0x100'):_0x4727cd=_0xfb015e['UserId']?_0xfb015e[_0xe36e('0x85')][_0xe36e('0x101')]||_0xfb015e['User'][_0xe36e('0x43')]:_0xe36e('0xff');break;case'agent_fullname':_0x4727cd=_0xfb015e[_0xe36e('0x86')]?_0xfb015e[_0xe36e('0x85')]['fullname']:_0xe36e('0xff');break;default:_0x4727cd=_0xfb015e[_0xe36e('0x86')]?util[_0xe36e('0xf8')](_0xe36e('0xfa'),_0x2e0f59[_0xe36e('0xfe')],_0xfb015e[_0xe36e('0x86')]):_0xe36e('0xff');}var _0x332cd8=util[_0xe36e('0xf8')](_0xe36e('0x102'),moment(_0xfb015e['createdAt'])[_0xe36e('0xf8')](_0xe36e('0x103')),_0xfb015e['direction']==='in'?_0x3ac919:_0x4727cd,_0xfb015e[_0xe36e('0x3d')]);if(!_0xfb015e['secret']){fs['appendFileSync'](_0x2644c7,_0x332cd8);}}return db['MailAccount'][_0xe36e('0xca')]({'where':{'service':!![]},'include':[{'model':db[_0xe36e('0x104')],'as':_0xe36e('0x105'),'raw':!![]}]});}}})[_0xe36e('0x35')](function(_0x154f52){if(_0x154f52&&_0x154f52['Smtp']&&_0x153b4f[_0xe36e('0x3d')]){var _0x34523d={'tls':{'rejectUnauthorized':![]}};if(_0x154f52['Smtp']['service']){_0x34523d[_0xe36e('0x106')]=_0x154f52[_0xe36e('0x105')][_0xe36e('0x106')];}else{_0x34523d[_0xe36e('0x107')]=_0x154f52['Smtp'][_0xe36e('0x107')];_0x34523d['port']=_0x154f52[_0xe36e('0x105')][_0xe36e('0x108')];_0x34523d[_0xe36e('0x109')]=_0x154f52['Smtp'][_0xe36e('0x109')];}if(_0x154f52['Smtp'][_0xe36e('0x10a')]){_0x34523d[_0xe36e('0x10b')]={'user':_0x154f52[_0xe36e('0x105')][_0xe36e('0xa3')],'pass':_0x154f52[_0xe36e('0x105')][_0xe36e('0x10c')]};}return respondWithRpcPromise(_0xe36e('0x10d'),'sendMail',{'account':_0x34523d,'message':{'from':util[_0xe36e('0xf8')](_0xe36e('0x10e'),_0x154f52['name'],_0x154f52[_0xe36e('0xd1')]||_0x154f52['Smtp'][_0xe36e('0xa3')]),'to':_0x153b4f['body'][_0xe36e('0xf5')],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x153b4f[_0xe36e('0x3d')][_0xe36e('0xf5')]),'attachments':[{'path':_0x2644c7}]}})[_0xe36e('0x35')](function(){return _0xeb0eb3;})[_0xe36e('0x29')](function(_0x65e8ae){console[_0xe36e('0x24')](_0x65e8ae);});}else{return _0xeb0eb3;}})[_0xe36e('0x35')](respondWithStatusCode(_0x5d2afc,0xc8))[_0xe36e('0x29')](handleError(_0x5d2afc,null));};exports[_0xe36e('0x10f')]=function(_0x49225b,_0x214f23,_0x29883e){return db[_0xe36e('0xda')][_0xe36e('0x74')]({'where':{'id':_0x49225b[_0xe36e('0xc3')]['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x214f23,null))[_0xe36e('0x35')](function(_0xeb88eb){if(_0xeb88eb){return _0xeb88eb[_0xe36e('0x10f')](_0x49225b[_0xe36e('0x3d')]['ids'],_[_0xe36e('0x110')](_0x49225b['body'],[_0xe36e('0x111'),'id'])||{});}})[_0xe36e('0x35')](respondWithResult(_0x214f23,null))[_0xe36e('0x29')](handleError(_0x214f23,null));};exports[_0xe36e('0x112')]=function(_0x37282a,_0x5e7360,_0x4b4e4f){var _0x5583d8={'raw':![],'where':{}};var _0x542ae6={};var _0x2291e7={'count':0x0,'rows':[]};return db[_0xe36e('0x4b')]['findOne']({'where':{'id':_0x37282a[_0xe36e('0xc3')]['id']}})['then'](handleEntityNotFound(_0x5e7360,null))['then'](function(_0x12e580){if(_0x12e580){_0x542ae6['model']=_[_0xe36e('0x51')](db[_0xe36e('0xda')]['rawAttributes']);_0x542ae6[_0xe36e('0x50')]=_[_0xe36e('0x51')](_0x37282a['query']);_0x542ae6[_0xe36e('0x52')]=_[_0xe36e('0x53')](_0x542ae6[_0xe36e('0x4f')],_0x542ae6[_0xe36e('0x50')]);_0x5583d8[_0xe36e('0x55')]=_[_0xe36e('0x53')](_0x542ae6[_0xe36e('0x4f')],qs['fields'](_0x37282a[_0xe36e('0x50')][_0xe36e('0x54')]));_0x5583d8['attributes']=_0x5583d8['attributes'][_0xe36e('0x7d')]?_0x5583d8[_0xe36e('0x55')]:_0x542ae6['model'];if(!_0x37282a[_0xe36e('0x50')][_0xe36e('0x56')](_0xe36e('0x57'))){_0x5583d8[_0xe36e('0x2c')]=qs[_0xe36e('0x2c')](_0x37282a[_0xe36e('0x50')]['limit']);_0x5583d8['offset']=qs['offset'](_0x37282a[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x5583d8['order']=qs[_0xe36e('0x59')](_0x37282a['query'][_0xe36e('0x59')]);_0x5583d8[_0xe36e('0x90')]=qs['filters'](_[_0xe36e('0x5a')](_0x37282a[_0xe36e('0x50')],_0x542ae6[_0xe36e('0x52')]));_0x5583d8[_0xe36e('0x90')]['ChatInteractionId']=_0x12e580['id'];if(_0x37282a[_0xe36e('0x50')][_0xe36e('0x94')]){_0x5583d8[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x5583d8[_0xe36e('0x90')],{'$or':_['map'](_0x5583d8['attributes'],function(_0xb40daf){var _0x584f19={};_0x584f19[_0xb40daf]={'$like':'%'+_0x37282a['query'][_0xe36e('0x94')]+'%'};return _0x584f19;})});}if(_0x37282a[_0xe36e('0x50')][_0xe36e('0x8b')]){var _0x2ee22b=_0x37282a[_0xe36e('0x50')][_0xe36e('0x8b')][_0xe36e('0x46')](',');var _0x2cfaee={};_0x2cfaee[_0x2ee22b[0x0]]={'$gte':moment(_0x2ee22b[0x1])[_0xe36e('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5583d8[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x5583d8[_0xe36e('0x90')],_0x2cfaee);}_0x5583d8=_[_0xe36e('0x3c')]({},_0x5583d8,_0x37282a[_0xe36e('0xc5')]);return db[_0xe36e('0xda')][_0xe36e('0x2f')]({'where':_0x5583d8['where']})[_0xe36e('0x35')](function(_0x3f0fd2){_0x2291e7[_0xe36e('0x2f')]=_0x3f0fd2;if(_0x37282a[_0xe36e('0x50')][_0xe36e('0xc4')]){_0x5583d8[_0xe36e('0x113')]=[{'all':!![]}];}return db[_0xe36e('0xda')][_0xe36e('0x114')](_0x5583d8);})[_0xe36e('0x35')](function(_0x2c85c5){_0x2291e7[_0xe36e('0x115')]=_0x2c85c5;return _0x2291e7;});}})[_0xe36e('0x35')](respondWithFilteredResult(_0x5e7360,_0x5583d8))[_0xe36e('0x29')](handleError(_0x5e7360,null));};exports[_0xe36e('0x116')]=function(_0x545f90,_0x2291d1,_0x3ccaa5){var _0x19f952={'where':{}},_0x3e706e={},_0x51cea0={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xe36e('0xca')]({'where':{'id':_0x545f90['params']['id']}})[_0xe36e('0x35')](handleEntityNotFound(_0x2291d1,null))['then'](function(_0x21ffc7){if(_0x21ffc7){_0x3e706e[_0xe36e('0x4f')]=_['keys'](db[_0xe36e('0xda')][_0xe36e('0x4c')]);_0x3e706e[_0xe36e('0x50')]=_['keys'](_0x545f90[_0xe36e('0x50')]);_0x3e706e[_0xe36e('0x52')]=_[_0xe36e('0x53')](_0x3e706e[_0xe36e('0x4f')],_0x3e706e[_0xe36e('0x50')]);_0x19f952['attributes']=_[_0xe36e('0x53')](_0x3e706e[_0xe36e('0x4f')],qs[_0xe36e('0x54')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x54')]));_0x19f952['attributes']=_0x19f952[_0xe36e('0x55')][_0xe36e('0x7d')]?_0x19f952[_0xe36e('0x55')]:_0x3e706e[_0xe36e('0x4f')];if(!_0x545f90[_0xe36e('0x50')]['hasOwnProperty'](_0xe36e('0x57'))){_0x19f952['limit']=qs[_0xe36e('0x2c')](_0x545f90['query'][_0xe36e('0x2c')]);_0x19f952[_0xe36e('0x2e')]=qs[_0xe36e('0x2e')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x2e')]);}_0x19f952[_0xe36e('0x58')]=qs[_0xe36e('0x59')](_0x545f90[_0xe36e('0x50')][_0xe36e('0x59')]);_0x19f952[_0xe36e('0x90')]=qs[_0xe36e('0x52')](_[_0xe36e('0x5a')](_0x545f90[_0xe36e('0x50')],_0x3e706e['filters']));_0x19f952['where'][_0xe36e('0xc0')]=_0x21ffc7['id'];if(_0x545f90[_0xe36e('0x50')][_0xe36e('0x94')]){_0x19f952[_0xe36e('0x90')]=_[_0xe36e('0x3c')](_0x19f952[_0xe36e('0x90')],{'$or':_[_0xe36e('0x4a')](_0x19f952[_0xe36e('0x55')],function(_0x82c1ae){var _0x5f22b7={};_0x5f22b7[_0x82c1ae]={'$like':'%'+_0x545f90[_0xe36e('0x50')][_0xe36e('0x94')]+'%'};return _0x5f22b7;})});}_0x19f952['where']['secret']=![];if(_0x545f90[_0xe36e('0x50')]['id']){_0x19f952[_0xe36e('0x90')]['id']={'$gt':_0x545f90[_0xe36e('0x50')]['id']};}_0x19f952=_[_0xe36e('0x3c')]({},_0x19f952,_0x545f90['options']);return db[_0xe36e('0xda')]['count']({'where':_0x19f952[_0xe36e('0x90')]})[_0xe36e('0x35')](function(_0x150c17){_0x51cea0[_0xe36e('0x2f')]=_0x150c17;_0x19f952[_0xe36e('0x113')]=[];if(_0x545f90[_0xe36e('0x50')][_0xe36e('0x117')]){_0x19f952['include'][_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':'User','attributes':['id',_0xe36e('0x43'),_0xe36e('0x101')]});}if(_0x545f90[_0xe36e('0x50')]['includeAll']){_0x19f952[_0xe36e('0x113')]=[{'all':!![]}];}return db[_0xe36e('0xda')][_0xe36e('0x114')](_0x19f952);})['then'](function(_0x4553ac){_0x51cea0[_0xe36e('0x115')]=_0x4553ac;return _0x51cea0;});}})['then'](respondWithFilteredResult(_0x2291d1,_0x19f952))[_0xe36e('0x29')](handleError(_0x2291d1,null));};exports['addTags']=function(_0x2cba34,_0x1e7118,_0x4b8d01){return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x2cba34['params']['id']}})['then'](handleEntityNotFound(_0x1e7118,null))[_0xe36e('0x35')](function(_0x4284aa){if(_0x4284aa){return _0x4284aa['setTags'](_0x2cba34['body'][_0xe36e('0x111')],_[_0xe36e('0x110')](_0x2cba34[_0xe36e('0x3d')],[_0xe36e('0x111'),'id'])||{})[_0xe36e('0x118')](function(){return db[_0xe36e('0x84')][_0xe36e('0x114')]({'attributes':['id','name',_0xe36e('0x5d')],'where':{'id':_0x2cba34[_0xe36e('0x3d')][_0xe36e('0x111')]}});})[_0xe36e('0x35')](function(_0x464128){socket[_0xe36e('0x119')](_0xe36e('0x11a'),{'id':Number(_0x2cba34[_0xe36e('0xc3')]['id']),'tags':_0x464128||[]});return{'id':Number(_0x2cba34['params']['id']),'tags':_0x464128||[]};});}})['then'](respondWithResult(_0x1e7118,null))[_0xe36e('0x29')](handleError(_0x1e7118,null));};exports[_0xe36e('0x11b')]=function(_0x262797,_0x40f9f1,_0x457c8e){return db[_0xe36e('0x4b')]['find']({'where':{'id':_0x262797[_0xe36e('0xc3')]['id']}})['then'](handleEntityNotFound(_0x40f9f1,null))['then'](function(_0x31fb7a){if(_0x31fb7a){return _0x31fb7a['removeTags'](_0x262797[_0xe36e('0x50')][_0xe36e('0x111')]);}})[_0xe36e('0x35')](respondWithStatusCode(_0x40f9f1,null))[_0xe36e('0x29')](handleError(_0x40f9f1,null));};exports[_0xe36e('0xf3')]=function(_0x20a347,_0x2c1324){var _0xa7ef59=moment()[_0xe36e('0x11c')]()[_0xe36e('0xa8')]();var _0x3a4701=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server',_0xe36e('0x11d'),'tmp');var _0x1cab01=path[_0xe36e('0xf2')](config[_0xe36e('0xef')],'server',_0xe36e('0x11d'),_0xe36e('0x11e'));var _0x6c8c82=path[_0xe36e('0xf2')](_0x3a4701,_0xa7ef59);var _0x71c885=util['format'](_0xe36e('0x11f'),_0x20a347[_0xe36e('0xc3')]['id'],_0xa7ef59);var _0x29393a=path[_0xe36e('0xf2')](_0x3a4701,_0x71c885);var _0x4e7b14=[];_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':_0xe36e('0x85'),'attributes':['id',_0xe36e('0x43')],'raw':!![]});_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0xdd')],'as':_0xe36e('0x79'),'attributes':['id',_0xe36e('0x120'),_0xe36e('0x121')],'raw':!![]});if(_0x20a347[_0xe36e('0x50')]['attachments']){_0x4e7b14[_0xe36e('0x48')]({'model':db[_0xe36e('0xe9')],'as':'Attachment','raw':!![]});}var _0xecb02b=[{'model':db[_0xe36e('0xda')],'as':_0xe36e('0xf7'),'attributes':['id',_0xe36e('0x3d'),_0xe36e('0x122'),_0xe36e('0x123'),_0xe36e('0x124'),_0xe36e('0x125')],'include':_0x4e7b14}];_0xecb02b[_0xe36e('0x48')]({'model':db[_0xe36e('0xcb')],'as':'Account','attributes':['id',_0xe36e('0x39')]});_0xecb02b[_0xe36e('0x48')]({'model':db[_0xe36e('0x85')],'as':_0xe36e('0x126'),'attributes':['id',_0xe36e('0x43')]});return db[_0xe36e('0x4b')][_0xe36e('0x74')]({'where':{'id':_0x20a347[_0xe36e('0xc3')]['id']},'include':_0xecb02b})[_0xe36e('0x35')](handleEntityNotFound(_0x2c1324,null))[_0xe36e('0x35')](function(_0x4197e9){if(_0x4197e9){var _0x35c442=_0x4197e9[_0xe36e('0x127')]({'plain':!![]});fs['mkdirSync'](_0x6c8c82);var _0x343ad8={'channel':'Chat','account':_0x35c442[_0xe36e('0x128')][_0xe36e('0x39')],'agent':_0x35c442[_0xe36e('0x126')]?_0x35c442[_0xe36e('0x126')]['fullname']:_0xe36e('0x129'),'createdAt':moment(_0x35c442[_0xe36e('0x122')])['format'](_0xe36e('0x12a'))[_0xe36e('0xa8')](),'closedAt':_0x35c442[_0xe36e('0xeb')]?moment(_0x35c442[_0xe36e('0x12b')])[_0xe36e('0xf8')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe36e('0xa8')]():'','disposition':_0x35c442[_0xe36e('0x12c')],'chatInfo':{'browser':_0x35c442['browserName'],'os':_0x35c442[_0xe36e('0x12d')],'referer':_0x35c442[_0xe36e('0x12e')],'customerIp':_0x35c442[_0xe36e('0x12f')],'customerPort':_0x35c442['customerPort']?_0x35c442['customerPort']:'N.A.'},'messages':_(_0x35c442[_0xe36e('0xf7')])['tail']()[_0xe36e('0x94')]({'secret':![]})['map'](function(_0x59156b){if(_0x59156b[_0xe36e('0xe9')]){var _0x52719b=path[_0xe36e('0xf2')](_0x1cab01,_0x59156b['Attachment'][_0xe36e('0xe5')]);if(fs['existsSync'](_0x52719b)){fs[_0xe36e('0x130')](_0x52719b)[_0xe36e('0x131')](fs[_0xe36e('0x132')](path[_0xe36e('0xf2')](_0x6c8c82,_0x59156b[_0xe36e('0xe9')][_0xe36e('0xe5')])));}}return{'date':moment(_0x59156b[_0xe36e('0x122')])[_0xe36e('0xf8')](_0xe36e('0x12a'))[_0xe36e('0xa8')](),'sender':_0x59156b[_0xe36e('0x123')]===_0xe36e('0x133')?_0x59156b['User']?_0x59156b[_0xe36e('0x85')][_0xe36e('0x43')]:_0xe36e('0xff'):_0x59156b[_0xe36e('0x79')]['firstName']+(_0x59156b[_0xe36e('0x79')][_0xe36e('0x121')]?'\x20'+_0x59156b[_0xe36e('0x79')]['lastName']:''),'body':_0x59156b['Attachment']?_0x59156b[_0xe36e('0xe9')][_0xe36e('0xe5')]:_0x59156b['body'],'direction':_0x59156b[_0xe36e('0x123')]===_0xe36e('0x133')?'A':'C','secret':_0x59156b['secret'],'read':_0x59156b[_0xe36e('0x125')],'attachment':_0x59156b[_0xe36e('0xe9')]};})['value']()};return ejs['renderFile'](path[_0xe36e('0xf2')](config[_0xe36e('0xef')],_0xe36e('0x134'),_0xe36e('0x135'),_0xe36e('0x136')),{'interaction':_0x343ad8})[_0xe36e('0x35')](function(_0x340915){var _0x5370b9=path['join'](_0x6c8c82,'transcript-'+_0x35c442['id']+'-'+_0xa7ef59+'.pdf');var _0x16b769={'path':_0x5370b9,'channel':'Chat','interactionId':_0x35c442['id']};return pdf['createPdfFromHTML'](_0x340915,_0x16b769);})[_0xe36e('0x35')](function(){return new BPromise(function(_0x36706c,_0x5e7f24){zipdir(_0x6c8c82,{'saveTo':_0x29393a},function(_0x5e19e2,_0x2a89b0){if(_0x5e19e2)return _0x5e7f24(_0x5e19e2);return _0x36706c(_0x2a89b0);});})[_0xe36e('0x35')](function(){return new BPromise(function(_0xf70d66,_0x2c0371){rimraf(_0x6c8c82,function(_0x59de53){if(_0x59de53)_0x2c0371(_0x59de53);return _0xf70d66();});});})[_0xe36e('0x35')](function(){return _0x2c1324['download'](_0x29393a,_0x71c885,function(_0x47e24c){if(_0x47e24c){console[_0xe36e('0x137')](_0xe36e('0x138'),_0x47e24c);}else{fs[_0xe36e('0x139')](_0x29393a);}});});});}else{return _0x2c1324[_0xe36e('0x37')](0xc8);}})[_0xe36e('0x29')](handleError(_0x2c1324,null));}; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 3b12da7..faca05b 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 _0x9765=['ChatMessage','setMaxListeners','save','update','then','setDataValue','map','findAll','unreadMessages','emit','catch','hook','exports','events','../../mysqldb'];(function(_0x19eb42,_0xca1520){var _0x4f78e8=function(_0x5b31dc){while(--_0x5b31dc){_0x19eb42['push'](_0x19eb42['shift']());}};_0x4f78e8(++_0xca1520);}(_0x9765,0x85));var _0x5976=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x9765[_0x413feb];return _0x40ee88;};'use strict';var EventEmitter=require(_0x5976('0x0'));var ChatInteraction=require(_0x5976('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0x5976('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x5976('0x3')](0x0);var events={'afterCreate':_0x5976('0x4'),'afterUpdate':_0x5976('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3a5125){return function(_0xaacd56,_0x4bc222,_0xf37cb3){_0xaacd56['getUsers']({'attributes':['id'],'raw':!![]})[_0x5976('0x6')](function(_0x3fe1f8){_0xaacd56[_0x5976('0x7')]('Users',_0x3fe1f8[_0x5976('0x8')](function(_0x49f42d){return{'id':_0x49f42d['id']};}));return ChatMessage[_0x5976('0x9')]({'where':{'ChatInteractionId':_0xaacd56['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5976('0x6')](function(_0xab6119){_0xaacd56[_0x5976('0x7')](_0x5976('0xa'),_0xab6119['length']);ChatInteractionEvents[_0x5976('0xb')](_0x3a5125+':'+_0xaacd56['id'],_0xaacd56);ChatInteractionEvents[_0x5976('0xb')](_0x3a5125,_0xaacd56);_0xf37cb3(null);})[_0x5976('0xc')](_0xf37cb3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction[_0x5976('0xd')](e,emitEvent(event));}}module[_0x5976('0xe')]=ChatInteractionEvents; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 9a1140c..f54c36a 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 _0x6f16=['changed','closed','closedAt','format','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports','chat_interactions'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x6f16,0x75));var _0x66f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6f16[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x66f1('0x0'));var logger=require(_0x66f1('0x1'))(_0x66f1('0x2'));var moment=require(_0x66f1('0x3'));var BPromise=require(_0x66f1('0x4'));var rp=require(_0x66f1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66f1('0x6'));var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x66f1('0x7')]=function(_0x2b6173,_0x38f5a6){return _0x2b6173['define']('ChatInteraction',attributes,{'tableName':_0x66f1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x15854e,_0x598458,_0x112b56){if(_0x15854e[_0x66f1('0x9')](_0x66f1('0xa'))){_0x15854e[_0x66f1('0xb')]=moment()[_0x66f1('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x112b56(null,_0x15854e);}},'charset':_0x66f1('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index fa54117..8e7415a 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 _0x087d=['addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','ChatInteraction'];(function(_0x3d7e04,_0x2eb376){var _0x2e559c=function(_0x3aea9e){while(--_0x3aea9e){_0x3d7e04['push'](_0x3d7e04['shift']());}};_0x2e559c(++_0x2eb376);}(_0x087d,0x17f));var _0xd087=function(_0x38bd73,_0x20810f){_0x38bd73=_0x38bd73-0x0;var _0x57562f=_0x087d[_0x38bd73];return _0x57562f;};'use strict';var _=require('lodash');var util=require(_0xd087('0x0'));var moment=require(_0xd087('0x1'));var BPromise=require(_0xd087('0x2'));var rs=require(_0xd087('0x3'));var fs=require('fs');var Redis=require(_0xd087('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd087('0x5'))(_0xd087('0x6'));var config=require(_0xd087('0x7'));var jayson=require(_0xd087('0x8'));var client=jayson[_0xd087('0x9')][_0xd087('0xa')]({'port':0x232a});config[_0xd087('0xb')]=_[_0xd087('0xc')](config['redis'],{'host':_0xd087('0xd'),'port':0x18eb});var socket=require(_0xd087('0xe'))(new Redis(config[_0xd087('0xb')]));require(_0xd087('0xf'))[_0xd087('0x10')](socket);function respondWithRpcPromise(_0x1a5187,_0x4f8611,_0x3535c0){return new BPromise(function(_0x52d4ba,_0x4b4e42){return client[_0xd087('0x11')](_0x1a5187,_0x3535c0)[_0xd087('0x12')](function(_0x35144d){logger[_0xd087('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x4f8611,'request\x20sent');logger[_0xd087('0x14')](_0xd087('0x15'),_0x4f8611,_0xd087('0x16'),JSON[_0xd087('0x17')](_0x35144d));if(_0x35144d[_0xd087('0x18')]){if(_0x35144d['error'][_0xd087('0x19')]===0x1f4){logger[_0xd087('0x18')](_0xd087('0x1a'),_0x4f8611,_0x35144d['error'][_0xd087('0x1b')]);return _0x4b4e42(_0x35144d[_0xd087('0x18')]['message']);}logger[_0xd087('0x18')](_0xd087('0x1a'),_0x4f8611,_0x35144d['error']['message']);return _0x52d4ba(_0x35144d['error'][_0xd087('0x1b')]);}else{logger[_0xd087('0x13')](_0xd087('0x1a'),_0x4f8611,_0xd087('0x16'));_0x52d4ba(_0x35144d['result'][_0xd087('0x1b')]);}})[_0xd087('0x1c')](function(_0x29e381){logger[_0xd087('0x18')](_0xd087('0x1a'),_0x4f8611,_0x29e381);_0x4b4e42(_0x29e381);});});}exports[_0xd087('0x1d')]=function(_0x3e853f){var _0x21c498=this;return new Promise(function(_0x57cff4,_0x4242d5){return db['ChatInteraction'][_0xd087('0x1e')](_0x3e853f[_0xd087('0x1f')],{'raw':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')][_0xd087('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')][_0xd087('0x22')]||null:null,'attributes':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')][_0xd087('0x23')]||null:null,'limit':_0x3e853f[_0xd087('0x20')]?_0x3e853f[_0xd087('0x20')]['limit']||null:null})[_0xd087('0x12')](function(_0x433f48){logger[_0xd087('0x13')](_0xd087('0x1d'),_0x3e853f);logger[_0xd087('0x14')](_0xd087('0x1d'),_0x3e853f,JSON['stringify'](_0x433f48));_0x57cff4(_0x433f48);})[_0xd087('0x1c')](function(_0x314647){logger['error'](_0xd087('0x1d'),_0x314647['message'],_0x3e853f);_0x4242d5(_0x21c498[_0xd087('0x18')](0x1f4,_0x314647[_0xd087('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x414707){return new Promise(function(_0x146d20,_0x4de383){return db[_0xd087('0x24')]['find']({'where':_0x414707[_0xd087('0x20')]?_0x414707[_0xd087('0x20')][_0xd087('0x22')]||null:null})[_0xd087('0x12')](function(_0x42d559){if(_0x42d559){return _0x42d559[_0xd087('0x25')](_0x414707[_0xd087('0x1f')][_0xd087('0x26')],_[_0xd087('0x27')](_0x414707['body'],['ids','id'])||{});}})[_0xd087('0x28')](function(_0x14311a){logger[_0xd087('0x13')](_0xd087('0x29'),_0x414707);logger[_0xd087('0x14')](_0xd087('0x29'),_0x414707,JSON['stringify'](_0x14311a));_0x146d20(_0x14311a);})[_0xd087('0x1c')](function(_0x522507){logger[_0xd087('0x18')]('AddTags',_0x522507['message'],_0x414707);_0x4de383(_this[_0xd087('0x18')](0x1f4,_0x522507[_0xd087('0x1b')]));});});}; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index f7d6215..951a18e 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 _0xb16e=['save','remove','update','removeListener','register','./chatInteraction.events'];(function(_0x5e397f,_0x54d25c){var _0x2bec53=function(_0x1f8a4d){while(--_0x1f8a4d){_0x5e397f['push'](_0x5e397f['shift']());}};_0x2bec53(++_0x54d25c);}(_0xb16e,0x101));var _0xeb16=function(_0x3186aa,_0x34c21e){_0x3186aa=_0x3186aa-0x0;var _0x2d8c36=_0xb16e[_0x3186aa];return _0x2d8c36;};'use strict';var ChatInteractionEvents=require(_0xeb16('0x0'));var events=[_0xeb16('0x1'),_0xeb16('0x2'),_0xeb16('0x3')];function createListener(_0x1f26b7,_0x43c9e1){return function(_0x23a124){_0x43c9e1['emit'](_0x1f26b7,_0x23a124);};}function removeListener(_0xb658bb,_0xafb33b){return function(){ChatInteractionEvents[_0xeb16('0x4')](_0xb658bb,_0xafb33b);};}exports[_0xeb16('0x5')]=function(_0x492dc2){for(var _0x426de6=0x0,_0x16add3=events['length'];_0x426de6<_0x16add3;_0x426de6++){var _0x534aa9=events[_0x426de6];var _0x584eec=createListener('chatInteraction:'+_0x534aa9,_0x492dc2);ChatInteractionEvents['on'](_0x534aa9,_0x584eec);}}; \ No newline at end of file +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 diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index e18fd43..22637f8 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 _0x85d8=['attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','root','format','%s-%s','now','replace','/:id/attachment_upload','single','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','chatinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download'];(function(_0x54f419,_0x56a63f){var _0x3e81b5=function(_0x5b6f0f){while(--_0x5b6f0f){_0x54f419['push'](_0x54f419['shift']());}};_0x3e81b5(++_0x56a63f);}(_0x85d8,0x155));var _0x885d=function(_0x553d7e,_0x1c7ff8){_0x553d7e=_0x553d7e-0x0;var _0x498ce7=_0x85d8[_0x553d7e];return _0x498ce7;};'use strict';var multer=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var path=require(_0x885d('0x2'));var timeout=require(_0x885d('0x3'));var express=require(_0x885d('0x4'));var router=express[_0x885d('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x885d('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x885d('0x7'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0x885d('0x8')](),controller[_0x885d('0x9')]);router[_0x885d('0xa')](_0x885d('0xb'),auth[_0x885d('0x8')](),controller[_0x885d('0xc')]);router[_0x885d('0xa')]('/:id',auth[_0x885d('0xd')](),controller[_0x885d('0xe')]);router[_0x885d('0xa')](_0x885d('0xf'),auth['isChatInteractionAuthorized'](),controller[_0x885d('0x10')]);router[_0x885d('0xa')](_0x885d('0x11'),auth[_0x885d('0x8')](),controller[_0x885d('0x12')]);router['get'](_0x885d('0x13'),auth['isChatInteractionAuthorized'](),controller[_0x885d('0x14')]);router['get'](_0x885d('0x15'),auth[_0x885d('0x8')](),controller['download']);router[_0x885d('0x16')]('/',auth[_0x885d('0x8')](),controller[_0x885d('0x17')]);router[_0x885d('0x16')](_0x885d('0x18'),auth[_0x885d('0x8')](),controller[_0x885d('0x19')]);var upload=multer({'storage':multer[_0x885d('0x1a')]({'destination':function(_0x4ce4b2,_0x57da68,_0x50ab86){_0x50ab86(null,path['join'](config[_0x885d('0x1b')],'server/files/attachments/'));},'filename':function(_0x5b0032,_0x3663f7,_0x198568){_0x198568(null,util[_0x885d('0x1c')](_0x885d('0x1d'),Date[_0x885d('0x1e')](),_0x3663f7['originalname'][_0x885d('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x885d('0x16')](_0x885d('0x20'),upload[_0x885d('0x21')]('file'),controller['attachmentUpload']);router[_0x885d('0x16')](_0x885d('0x11'),auth[_0x885d('0xd')](),controller[_0x885d('0x22')]);router['post'](_0x885d('0x23'),auth['isAuthenticated'](),interaction[_0x885d('0x24')](_0x885d('0x25'),_0x885d('0x26')),controller[_0x885d('0x27')]);router[_0x885d('0x28')](_0x885d('0x29'),auth[_0x885d('0x8')](),interaction[_0x885d('0x24')](_0x885d('0x25'),_0x885d('0x2a')),controller[_0x885d('0x2b')]);router[_0x885d('0x28')](_0x885d('0x2c'),controller['customUpdate']);router[_0x885d('0x28')](_0x885d('0x2d'),auth['isChatInteractionAuthorized'](),controller[_0x885d('0x2e')]);router[_0x885d('0x28')](_0x885d('0x2f'),controller['close']);router['delete'](_0x885d('0x29'),auth[_0x885d('0x8')](),interaction[_0x885d('0x24')](_0x885d('0x25'),_0x885d('0x30')),controller[_0x885d('0x31')]);router['delete'](_0x885d('0x23'),auth['isAuthenticated'](),controller[_0x885d('0x32')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index b37307a..ff6447d 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 _0xcd62=['TEXT','medium','BOOLEAN','INTEGER','exports'];(function(_0x43b9a2,_0x3cfbb4){var _0x157744=function(_0x2bfc79){while(--_0x2bfc79){_0x43b9a2['push'](_0x43b9a2['shift']());}};_0x157744(++_0x3cfbb4);}(_0xcd62,0x130));var _0x2cd6=function(_0x280d9e,_0xb4cbfe){_0x280d9e=_0x280d9e-0x0;var _0xc24e98=_0xcd62[_0x280d9e];return _0xc24e98;};'use strict';var Sequelize=require('sequelize');module[_0x2cd6('0x0')]={'body':{'type':Sequelize[_0x2cd6('0x1')](_0x2cd6('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x2cd6('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x2cd6('0x4')]}}; \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index a9e2081..b5eb3c5 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 _0x18e9=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','send','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','ChatInternalMessage','rawAttributes','find','create','body','destroy','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x147c64,_0x3b5a32){var _0x3bcb18=function(_0x2c327e){while(--_0x2c327e){_0x147c64['push'](_0x147c64['shift']());}};_0x3bcb18(++_0x3b5a32);}(_0x18e9,0x1b5));var _0x918e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x18e9[_0x3b0731];return _0x4204d7;};'use strict';var emlformat=require(_0x918e('0x0'));var rimraf=require(_0x918e('0x1'));var zipdir=require(_0x918e('0x2'));var jsonpatch=require(_0x918e('0x3'));var rp=require(_0x918e('0x4'));var moment=require(_0x918e('0x5'));var BPromise=require(_0x918e('0x6'));var Mustache=require(_0x918e('0x7'));var util=require(_0x918e('0x8'));var path=require(_0x918e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x918e('0xa'));var _=require('lodash');var squel=require(_0x918e('0xb'));var crypto=require(_0x918e('0xc'));var jsforce=require(_0x918e('0xd'));var deskjs=require(_0x918e('0xe'));var toCsv=require(_0x918e('0xf'));var querystring=require(_0x918e('0x10'));var Papa=require(_0x918e('0x11'));var Redis=require('ioredis');var authService=require(_0x918e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x918e('0x13'));var hardwareService=require(_0x918e('0x14'));var logger=require(_0x918e('0x15'))(_0x918e('0x16'));var utils=require(_0x918e('0x17'));var config=require(_0x918e('0x18'));var licenseUtil=require(_0x918e('0x19'));var db=require(_0x918e('0x1a'))['db'];config[_0x918e('0x1b')]=_[_0x918e('0x1c')](config['redis'],{'host':_0x918e('0x1d'),'port':0x18eb});var socket=require(_0x918e('0x1e'))(new Redis(config[_0x918e('0x1b')]));require(_0x918e('0x1f'))[_0x918e('0x20')](socket);function respondWithStatusCode(_0x15a188,_0x4f1d4a){_0x4f1d4a=_0x4f1d4a||0xcc;return function(_0x1610bc){if(_0x1610bc){return _0x15a188[_0x918e('0x21')](_0x4f1d4a);}return _0x15a188[_0x918e('0x22')](_0x4f1d4a)[_0x918e('0x23')]();};}function respondWithResult(_0x4cf943,_0x41afa8){_0x41afa8=_0x41afa8||0xc8;return function(_0x101051){if(_0x101051){return _0x4cf943['status'](_0x41afa8)['json'](_0x101051);}};}function respondWithFilteredResult(_0x752aa9,_0x25d3ed){return function(_0x429668){if(_0x429668){var _0xfed1b8=typeof _0x25d3ed[_0x918e('0x24')]===_0x918e('0x25')&&typeof _0x25d3ed[_0x918e('0x26')]===_0x918e('0x25');var _0x27ce16=_0x429668[_0x918e('0x27')];var _0x316277=_0xfed1b8?0x0:_0x25d3ed[_0x918e('0x24')];var _0x1c16fe=_0xfed1b8?_0x429668[_0x918e('0x27')]:_0x25d3ed[_0x918e('0x24')]+_0x25d3ed['limit'];var _0x568921;if(_0x1c16fe>=_0x27ce16){_0x1c16fe=_0x27ce16;_0x568921=0xc8;}else{_0x568921=0xce;}_0x752aa9['status'](_0x568921);return _0x752aa9[_0x918e('0x28')]('Content-Range',_0x316277+'-'+_0x1c16fe+'/'+_0x27ce16)['json'](_0x429668);}return null;};}function patchUpdates(_0x171a71){return function(_0x3b570d){try{jsonpatch[_0x918e('0x29')](_0x3b570d,_0x171a71,!![]);}catch(_0x43895b){return BPromise[_0x918e('0x2a')](_0x43895b);}return _0x3b570d['save']();};}function saveUpdates(_0x336e7b,_0x157144){return function(_0x17c16f){if(_0x17c16f){return _0x17c16f[_0x918e('0x2b')](_0x336e7b)[_0x918e('0x2c')](function(_0xe11e47){return _0xe11e47;});}return null;};}function removeEntity(_0x437497,_0x478181){return function(_0x57a15b){if(_0x57a15b){return _0x57a15b['destroy']()[_0x918e('0x2c')](function(){_0x437497['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5648ae,_0xb6c0f7){return function(_0x2d0ca9){if(!_0x2d0ca9){_0x5648ae[_0x918e('0x21')](0x194);}return _0x2d0ca9;};}function handleError(_0x4576c3,_0x1af58c){_0x1af58c=_0x1af58c||0x1f4;return function(_0x217ee0){logger[_0x918e('0x2d')](_0x217ee0[_0x918e('0x2e')]);if(_0x217ee0['name']){delete _0x217ee0[_0x918e('0x2f')];}_0x4576c3[_0x918e('0x22')](_0x1af58c)[_0x918e('0x30')](_0x217ee0);};}exports['index']=function(_0x37c39f,_0x5e10ae){var _0x43498d={},_0x12ec88={},_0x348002={'count':0x0,'rows':[]};var _0x1e2966=_[_0x918e('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x2a0e42){return{'name':_0x2a0e42[_0x918e('0x32')],'type':_0x2a0e42['type'][_0x918e('0x33')]};});_0x12ec88[_0x918e('0x34')]=_[_0x918e('0x31')](_0x1e2966,_0x918e('0x2f'));_0x12ec88['query']=_[_0x918e('0x35')](_0x37c39f[_0x918e('0x36')]);_0x12ec88[_0x918e('0x37')]=_[_0x918e('0x38')](_0x12ec88['model'],_0x12ec88[_0x918e('0x36')]);_0x43498d[_0x918e('0x39')]=_[_0x918e('0x38')](_0x12ec88[_0x918e('0x34')],qs[_0x918e('0x3a')](_0x37c39f[_0x918e('0x36')][_0x918e('0x3a')]));_0x43498d[_0x918e('0x39')]=_0x43498d['attributes'][_0x918e('0x3b')]?_0x43498d[_0x918e('0x39')]:_0x12ec88[_0x918e('0x34')];if(!_0x37c39f[_0x918e('0x36')][_0x918e('0x3c')](_0x918e('0x3d'))){_0x43498d[_0x918e('0x26')]=qs['limit'](_0x37c39f[_0x918e('0x36')][_0x918e('0x26')]);_0x43498d[_0x918e('0x24')]=qs[_0x918e('0x24')](_0x37c39f[_0x918e('0x36')][_0x918e('0x24')]);}_0x43498d[_0x918e('0x3e')]=qs['sort'](_0x37c39f['query'][_0x918e('0x3f')]);_0x43498d['where']=qs[_0x918e('0x37')](_['pick'](_0x37c39f[_0x918e('0x36')],_0x12ec88[_0x918e('0x37')]),_0x1e2966);if(_0x37c39f[_0x918e('0x36')][_0x918e('0x40')]){_0x43498d['where']=_['merge'](_0x43498d[_0x918e('0x41')],{'$or':_[_0x918e('0x31')](_0x1e2966,function(_0x39eebe){if(_0x39eebe[_0x918e('0x42')]!==_0x918e('0x43')){var _0x160aee={};_0x160aee[_0x39eebe['name']]={'$like':'%'+_0x37c39f[_0x918e('0x36')][_0x918e('0x40')]+'%'};return _0x160aee;}})});}_0x43498d=_[_0x918e('0x44')]({},_0x43498d,_0x37c39f[_0x918e('0x45')]);var _0x3ea3c7={'where':_0x43498d[_0x918e('0x41')]};return db['ChatInternalMessage'][_0x918e('0x27')](_0x3ea3c7)[_0x918e('0x2c')](function(_0x4eb8be){_0x348002[_0x918e('0x27')]=_0x4eb8be;if(_0x37c39f[_0x918e('0x36')][_0x918e('0x46')]){_0x43498d[_0x918e('0x47')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x918e('0x48')](_0x43498d);})['then'](function(_0xf67e08){_0x348002['rows']=_0xf67e08;return _0x348002;})['then'](respondWithFilteredResult(_0x5e10ae,_0x43498d))[_0x918e('0x49')](handleError(_0x5e10ae,null));};exports['show']=function(_0x2d25e2,_0x5ebdd4){var _0x4e9007={'raw':!![],'where':{'id':_0x2d25e2[_0x918e('0x4a')]['id']}},_0x1a0769={};_0x1a0769[_0x918e('0x34')]=_[_0x918e('0x35')](db[_0x918e('0x4b')][_0x918e('0x4c')]);_0x1a0769[_0x918e('0x36')]=_[_0x918e('0x35')](_0x2d25e2[_0x918e('0x36')]);_0x1a0769['filters']=_[_0x918e('0x38')](_0x1a0769[_0x918e('0x34')],_0x1a0769['query']);_0x4e9007[_0x918e('0x39')]=_['intersection'](_0x1a0769[_0x918e('0x34')],qs['fields'](_0x2d25e2[_0x918e('0x36')][_0x918e('0x3a')]));_0x4e9007[_0x918e('0x39')]=_0x4e9007[_0x918e('0x39')][_0x918e('0x3b')]?_0x4e9007[_0x918e('0x39')]:_0x1a0769[_0x918e('0x34')];if(_0x2d25e2['query'][_0x918e('0x46')]){_0x4e9007[_0x918e('0x47')]=[{'all':!![]}];}_0x4e9007=_[_0x918e('0x44')]({},_0x4e9007,_0x2d25e2[_0x918e('0x45')]);return db[_0x918e('0x4b')][_0x918e('0x4d')](_0x4e9007)[_0x918e('0x2c')](handleEntityNotFound(_0x5ebdd4,null))[_0x918e('0x2c')](respondWithResult(_0x5ebdd4,null))[_0x918e('0x49')](handleError(_0x5ebdd4,null));};exports[_0x918e('0x4e')]=function(_0x3a9828,_0x192e63){return db['ChatInternalMessage'][_0x918e('0x4e')](_0x3a9828[_0x918e('0x4f')],{})[_0x918e('0x2c')](respondWithResult(_0x192e63,0xc9))[_0x918e('0x49')](handleError(_0x192e63,null));};exports[_0x918e('0x2b')]=function(_0x456d3b,_0x1ffd0a){if(_0x456d3b['body']['id']){delete _0x456d3b['body']['id'];}return db[_0x918e('0x4b')][_0x918e('0x4d')]({'where':{'id':_0x456d3b[_0x918e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1ffd0a,null))[_0x918e('0x2c')](saveUpdates(_0x456d3b[_0x918e('0x4f')],null))[_0x918e('0x2c')](respondWithResult(_0x1ffd0a,null))[_0x918e('0x49')](handleError(_0x1ffd0a,null));};exports[_0x918e('0x50')]=function(_0x36be42,_0xa04da5){return db['ChatInternalMessage'][_0x918e('0x4d')]({'where':{'id':_0x36be42['params']['id']}})['then'](handleEntityNotFound(_0xa04da5,null))[_0x918e('0x2c')](removeEntity(_0xa04da5,null))[_0x918e('0x49')](handleError(_0xa04da5,null));};exports[_0x918e('0x51')]=function(_0x4b0ce3,_0x394878){return db[_0x918e('0x4b')][_0x918e('0x51')]()[_0x918e('0x2c')](respondWithResult(_0x394878,null))[_0x918e('0x49')](handleError(_0x394878,null));};function wrapUser(_0x5634f1){return function(_0x18abdd){var _0x3d8b20=_0x5634f1['get']({'plain':!![]});_0x3d8b20[_0x918e('0x52')]=[];if(_0x18abdd){_0x3d8b20[_0x918e('0x53')]=_0x18abdd[_0x918e('0x54')];_0x3d8b20[_0x918e('0x55')]=_0x18abdd;}else{_0x3d8b20[_0x918e('0x53')]=moment(0x0)[_0x918e('0x56')](_0x918e('0x57'));_0x3d8b20[_0x918e('0x55')]={};}return _0x3d8b20;};}exports[_0x918e('0x58')]=function(_0x7e2b95,_0x500f73,_0xe5caba){var _0x188e3c=[];return db[_0x918e('0x59')]['findAll']({'where':{'role':[_0x918e('0x5a'),_0x918e('0x5b'),_0x918e('0x5c')]},'attributes':['id','fullname',_0x918e('0x2f'),_0x918e('0x5d'),_0x918e('0x5e'),_0x918e('0x5f'),_0x918e('0x60'),'lastLoginAt',_0x918e('0x61'),_0x918e('0x62')],'order':qs[_0x918e('0x3f')](_0x918e('0x63')),'include':[{'model':db[_0x918e('0x64')],'as':_0x918e('0x65'),'attributes':['id',_0x918e('0x2f'),_0x918e('0x42')],'through':{'attributes':[]}}]})[_0x918e('0x2c')](function(_0x445ab3){if(_0x445ab3){var _0x51b31b=_0x7e2b95[_0x918e('0x5c')][_0x918e('0x66')]({'plain':!![]});if(!_0x51b31b)throw new Error(_0x918e('0x67'));if(_0x51b31b[_0x918e('0x5d')]==='user'){return db[_0x918e('0x68')][_0x918e('0x4d')]({'where':{'name':_0x918e('0x69'),'userProfileId':_0x51b31b[_0x918e('0x6a')]},'raw':!![]})[_0x918e('0x2c')](function(_0x44ad07){if(_0x44ad07){if(_0x44ad07[_0x918e('0x6b')]===0x0){return db[_0x918e('0x6c')][_0x918e('0x48')]({'where':{'sectionId':_0x44ad07['id']},'raw':!![]})[_0x918e('0x2c')](function(_0x1e9fd0){var _0x5745ea=[];if(_[_0x918e('0x6d')](_0x1e9fd0)){_0x5745ea=_[_0x918e('0x40')](_0x445ab3,function(_0x1af41a){if(_0x1af41a[_0x918e('0x5d')]!==_0x918e('0x5a')){return _0x1af41a;}});return _0x5745ea;}else{for(var _0x29971f=0x0;_0x29971f<_0x445ab3['length'];_0x29971f++){var _0x1a18f7=_0x445ab3[_0x29971f];if(_0x1a18f7[_0x918e('0x5d')]==='agent'){var _0x10fa98=_[_0x918e('0x4d')](_0x1e9fd0,function(_0x1e75fc){return _0x1e75fc[_0x918e('0x6e')]===_0x1a18f7['id'];});if(_0x10fa98)_0x5745ea[_0x918e('0x6f')](_0x1a18f7);}else{_0x5745ea['push'](_0x1a18f7);}}return _0x5745ea;}});}else{return _0x445ab3;}}else{var _0x1cef92=_[_0x918e('0x40')](_0x445ab3,function(_0x5be992){if(_0x5be992[_0x918e('0x5d')]!=='agent'){return _0x5be992;}});return _0x1cef92;}});}else{return _0x445ab3;}}})[_0x918e('0x2c')](function(_0x46f75a){var _0x2fdaf8=[];if(_0x46f75a){_0x188e3c=_0x46f75a;for(var _0x3a140b=0x0;_0x3a140b<_0x46f75a[_0x918e('0x3b')];_0x3a140b+=0x1){_0x188e3c[_0x3a140b][_0x918e('0x52')]=[];_0x2fdaf8[_0x918e('0x6f')](db['ChatInternalMessage'][_0x918e('0x4d')]({'where':{'FromId':[_0x7e2b95[_0x918e('0x5c')]['id'],_0x46f75a[_0x3a140b]['id']],'ToId':[_0x7e2b95[_0x918e('0x5c')]['id'],_0x46f75a[_0x3a140b]['id']],'ChatGroupId':null},'attributes':['id',_0x918e('0x54'),'FromId',_0x918e('0x70'),_0x918e('0x71'),'body'],'order':qs[_0x918e('0x3f')](_0x918e('0x72')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x918e('0x2c')](wrapUser(_0x46f75a[_0x3a140b])));}return BPromise['all'](_0x2fdaf8);}return[];})[_0x918e('0x2c')](function(_0x55cc5b){return{'rows':_0x55cc5b,'count':_0x55cc5b[_0x918e('0x3b')]};})[_0x918e('0x2c')](respondWithResult(_0x500f73,null))['catch'](handleError(_0x500f73,null));}; \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index de9dc3c..b8f5553 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 _0x3feb=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage'];(function(_0x1b515f,_0x52aa6b){var _0x66ff73=function(_0x2cc081){while(--_0x2cc081){_0x1b515f['push'](_0x1b515f['shift']());}};_0x66ff73(++_0x52aa6b);}(_0x3feb,0x192));var _0xb3fe=function(_0x209f89,_0x262e13){_0x209f89=_0x209f89-0x0;var _0x2ab03b=_0x3feb[_0x209f89];return _0x2ab03b;};'use strict';var EventEmitter=require(_0xb3fe('0x0'));var ChatInternalMessage=require(_0xb3fe('0x1'))['db'][_0xb3fe('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb3fe('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xb3fe('0x4'),'afterDestroy':_0xb3fe('0x5')};function emitEvent(_0x2081a5){return function(_0x5dcd60,_0x399a43,_0x9e46a7){ChatInternalMessageEvents[_0xb3fe('0x6')](_0x2081a5+':'+_0x5dcd60['id'],_0x5dcd60);ChatInternalMessageEvents[_0xb3fe('0x6')](_0x2081a5,_0x5dcd60);_0x9e46a7(null);};}for(var e in events){if(events[_0xb3fe('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb3fe('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 05ab22d..ed3cd96 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 _0x0776=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x42cf3e,_0x50abbe){var _0x184386=function(_0x35abf4){while(--_0x35abf4){_0x42cf3e['push'](_0x42cf3e['shift']());}};_0x184386(++_0x50abbe);}(_0x0776,0x10f));var _0x6077=function(_0x7ff9d2,_0x24174f){_0x7ff9d2=_0x7ff9d2-0x0;var _0x518d33=_0x0776[_0x7ff9d2];return _0x518d33;};'use strict';var _=require(_0x6077('0x0'));var util=require('util');var logger=require(_0x6077('0x1'))(_0x6077('0x2'));var moment=require(_0x6077('0x3'));var BPromise=require(_0x6077('0x4'));var rp=require(_0x6077('0x5'));var fs=require('fs');var path=require(_0x6077('0x6'));var rimraf=require(_0x6077('0x7'));var config=require(_0x6077('0x8'));var attributes=require('./chatInternalMessage.attributes');module[_0x6077('0x9')]=function(_0x3aeee3,_0x36f3e1){return _0x3aeee3[_0x6077('0xa')](_0x6077('0xb'),attributes,{'tableName':_0x6077('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x6077('0xd')});}; \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index a0c53cc..76cc7a0 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 _0xadb2=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','localhost','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x596565,_0x1258ad){var _0x474b1b=function(_0x2bbf2d){while(--_0x2bbf2d){_0x596565['push'](_0x596565['shift']());}};_0x474b1b(++_0x1258ad);}(_0xadb2,0x80));var _0x2adb=function(_0x11b4e6,_0x124b6c){_0x11b4e6=_0x11b4e6-0x0;var _0x284a2f=_0xadb2[_0x11b4e6];return _0x284a2f;};'use strict';var _=require(_0x2adb('0x0'));var util=require(_0x2adb('0x1'));var moment=require(_0x2adb('0x2'));var BPromise=require(_0x2adb('0x3'));var rs=require(_0x2adb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2adb('0x5'))['db'];var utils=require(_0x2adb('0x6'));var logger=require(_0x2adb('0x7'))(_0x2adb('0x8'));var config=require('../../config/environment');var jayson=require(_0x2adb('0x9'));var client=jayson['client'][_0x2adb('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2adb('0xb')],{'host':_0x2adb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2adb('0xb')]));require(_0x2adb('0xd'))[_0x2adb('0xe')](socket);function respondWithRpcPromise(_0x31097b,_0x426747,_0x434e5a){return new BPromise(function(_0x11565a,_0x30a2b9){return client[_0x2adb('0xf')](_0x31097b,_0x434e5a)['then'](function(_0x24d2fe){logger[_0x2adb('0x10')](_0x2adb('0x11'),_0x426747,_0x2adb('0x12'));logger[_0x2adb('0x13')](_0x2adb('0x14'),_0x426747,_0x2adb('0x12'),JSON[_0x2adb('0x15')](_0x24d2fe));if(_0x24d2fe[_0x2adb('0x16')]){if(_0x24d2fe['error']['code']===0x1f4){logger[_0x2adb('0x16')](_0x2adb('0x11'),_0x426747,_0x24d2fe[_0x2adb('0x16')][_0x2adb('0x17')]);return _0x30a2b9(_0x24d2fe['error'][_0x2adb('0x17')]);}logger[_0x2adb('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x426747,_0x24d2fe['error'][_0x2adb('0x17')]);return _0x11565a(_0x24d2fe['error'][_0x2adb('0x17')]);}else{logger[_0x2adb('0x10')](_0x2adb('0x11'),_0x426747,_0x2adb('0x12'));_0x11565a(_0x24d2fe[_0x2adb('0x18')][_0x2adb('0x17')]);}})[_0x2adb('0x19')](function(_0x5696a4){logger[_0x2adb('0x16')]('ChatInternalMessage,\x20%s,\x20%s',_0x426747,_0x5696a4);_0x30a2b9(_0x5696a4);});});} \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 85a0eb5..fa94ccd 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 _0x9963=['removeListener','register','chatInternalMessage:','./chatInternalMessage.events','save','remove','update','emit'];(function(_0xbd469f,_0x380646){var _0x461b9f=function(_0x2717f7){while(--_0x2717f7){_0xbd469f['push'](_0xbd469f['shift']());}};_0x461b9f(++_0x380646);}(_0x9963,0x83));var _0x3996=function(_0x39479f,_0x822ae4){_0x39479f=_0x39479f-0x0;var _0x4a6d96=_0x9963[_0x39479f];return _0x4a6d96;};'use strict';var ChatInternalMessageEvents=require(_0x3996('0x0'));var events=[_0x3996('0x1'),_0x3996('0x2'),_0x3996('0x3')];function createListener(_0x37e7d1,_0x867633){return function(_0x849576){_0x867633[_0x3996('0x4')](_0x37e7d1,_0x849576);};}function removeListener(_0xbc393d,_0x138404){return function(){ChatInternalMessageEvents[_0x3996('0x5')](_0xbc393d,_0x138404);};}exports[_0x3996('0x6')]=function(_0x1f6f5f){for(var _0x397979=0x0,_0x51224d=events['length'];_0x397979<_0x51224d;_0x397979++){var _0x1cc774=events[_0x397979];var _0x1a1595=createListener(_0x3996('0x7')+_0x1cc774,_0x1f6f5f);ChatInternalMessageEvents['on'](_0x1cc774,_0x1a1595);}}; \ No newline at end of file +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 diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index f3b05d7..2317901 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 _0xfb13=['/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','getUsers','show','create','put'];(function(_0x2b8ead,_0x4ac69b){var _0x2faa50=function(_0x18b467){while(--_0x18b467){_0x2b8ead['push'](_0x2b8ead['shift']());}};_0x2faa50(++_0x4ac69b);}(_0xfb13,0xb8));var _0x3fb1=function(_0x507251,_0x8939b9){_0x507251=_0x507251-0x0;var _0x70df28=_0xfb13[_0x507251];return _0x70df28;};'use strict';var multer=require(_0x3fb1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3fb1('0x1'));var express=require(_0x3fb1('0x2'));var router=express[_0x3fb1('0x3')]();var fs_extra=require(_0x3fb1('0x4'));var auth=require(_0x3fb1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3fb1('0x6'));var controller=require(_0x3fb1('0x7'));router[_0x3fb1('0x8')]('/',auth[_0x3fb1('0x9')](),controller['index']);router[_0x3fb1('0x8')](_0x3fb1('0xa'),auth[_0x3fb1('0x9')](),controller['describe']);router[_0x3fb1('0x8')](_0x3fb1('0xb'),auth['isAuthenticated'](),controller[_0x3fb1('0xc')]);router[_0x3fb1('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x3fb1('0xd')]);router['post']('/',auth[_0x3fb1('0x9')](),controller[_0x3fb1('0xe')]);router[_0x3fb1('0xf')](_0x3fb1('0x10'),controller[_0x3fb1('0x11')]);router[_0x3fb1('0x12')](_0x3fb1('0x10'),auth[_0x3fb1('0x9')](),controller[_0x3fb1('0x13')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 239c6ac..b66f46e 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 _0x2032=['STRING','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x2c842e,_0x53eb06){var _0x1fd985=function(_0x2cf21a){while(--_0x2cf21a){_0x2c842e['push'](_0x2c842e['shift']());}};_0x1fd985(++_0x53eb06);}(_0x2032,0xd9));var _0x2203=function(_0x314889,_0x46fd40){_0x314889=_0x314889-0x0;var _0x29859a=_0x2032[_0x314889];return _0x29859a;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x2203('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2203('0x4')]('in','out'),'defaultValue':_0x2203('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x2203('0x6')]},'providerName':{'type':Sequelize[_0x2203('0x7')]},'providerResponse':{'type':Sequelize[_0x2203('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 9592f60..0b874b8 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 _0x462d=['findAll','rows','show','params','rawAttributes','keys','length','find','create','body','describe','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','ChatInteraction','ChatInteractionId','isNil','interaction','get','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','QueryTypes','interface','rejectmessage','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','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','ChatMessage','fieldName','key','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x462d,0xbc));var _0xd462=function(_0x19e73e,_0x5e6abd){_0x19e73e=_0x19e73e-0x0;var _0x3af71a=_0x462d[_0x19e73e];return _0x3af71a;};'use strict';var emlformat=require(_0xd462('0x0'));var rimraf=require(_0xd462('0x1'));var zipdir=require(_0xd462('0x2'));var jsonpatch=require(_0xd462('0x3'));var rp=require(_0xd462('0x4'));var moment=require(_0xd462('0x5'));var BPromise=require(_0xd462('0x6'));var Mustache=require(_0xd462('0x7'));var util=require(_0xd462('0x8'));var path=require(_0xd462('0x9'));var sox=require(_0xd462('0xa'));var csv=require(_0xd462('0xb'));var ejs=require(_0xd462('0xc'));var fs=require('fs');var fs_extra=require(_0xd462('0xd'));var _=require(_0xd462('0xe'));var squel=require(_0xd462('0xf'));var crypto=require(_0xd462('0x10'));var jsforce=require(_0xd462('0x11'));var deskjs=require(_0xd462('0x12'));var toCsv=require(_0xd462('0xb'));var querystring=require(_0xd462('0x13'));var Papa=require('papaparse');var Redis=require(_0xd462('0x14'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd462('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd462('0x16'))(_0xd462('0x17'));var utils=require(_0xd462('0x18'));var config=require(_0xd462('0x19'));var licenseUtil=require(_0xd462('0x1a'));var db=require('../../mysqldb')['db'];config[_0xd462('0x1b')]=_['defaults'](config[_0xd462('0x1b')],{'host':_0xd462('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd462('0x1b')]));require(_0xd462('0x1d'))[_0xd462('0x1e')](socket);var jayson=require(_0xd462('0x1f'));var client=jayson['client'][_0xd462('0x20')]({'port':0x232c});var client9002=jayson[_0xd462('0x21')][_0xd462('0x20')]({'port':0x232a});function respondWithRpcPromise(_0xecc467,_0x4728fc,_0x4e44e0,_0x289314){return new BPromise(function(_0x1f5b20,_0x342d74){var _0x586c6f=_0x289314||client;return _0x586c6f[_0xd462('0x22')](_0xecc467,_0x4e44e0)[_0xd462('0x23')](function(_0x578e37){logger[_0xd462('0x24')](_0xd462('0x25'),_0x4728fc,_0xd462('0x26'));logger[_0xd462('0x27')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4728fc,_0xd462('0x26'),JSON[_0xd462('0x28')](_0x578e37));if(_0x578e37[_0xd462('0x29')]){if(_0x578e37[_0xd462('0x29')][_0xd462('0x2a')]===0x1f4){logger[_0xd462('0x29')]('ChatMessage,\x20%s,\x20%s',_0x4728fc,_0x578e37[_0xd462('0x29')][_0xd462('0x2b')]);return _0x342d74(_0x578e37[_0xd462('0x29')]['message']);}logger[_0xd462('0x29')](_0xd462('0x25'),_0x4728fc,_0x578e37[_0xd462('0x29')]['message']);return _0x1f5b20(_0x578e37[_0xd462('0x29')][_0xd462('0x2b')]);}else{logger['info'](_0xd462('0x25'),_0x4728fc,_0xd462('0x26'));_0x1f5b20(_0x578e37[_0xd462('0x2c')]['message']);}})[_0xd462('0x2d')](function(_0x4bb145){logger[_0xd462('0x29')](_0xd462('0x25'),_0x4728fc,_0x4bb145);_0x342d74(_0x4bb145);});});}function respondWithStatusCode(_0x54883a,_0x5f456b){_0x5f456b=_0x5f456b||0xcc;return function(_0x3f589a){if(_0x3f589a){return _0x54883a[_0xd462('0x2e')](_0x5f456b);}return _0x54883a['status'](_0x5f456b)[_0xd462('0x2f')]();};}function respondWithResult(_0x4466d7,_0x5485bb){_0x5485bb=_0x5485bb||0xc8;return function(_0x38fe3c){if(_0x38fe3c){return _0x4466d7[_0xd462('0x30')](_0x5485bb)['json'](_0x38fe3c);}};}function respondWithFilteredResult(_0x404e8a,_0x2b21c3){return function(_0x25cc4c){if(_0x25cc4c){var _0x575ee5=typeof _0x2b21c3[_0xd462('0x31')]===_0xd462('0x32')&&typeof _0x2b21c3[_0xd462('0x33')]===_0xd462('0x32');var _0x2ba2a4=_0x25cc4c['count'];var _0x1610cd=_0x575ee5?0x0:_0x2b21c3[_0xd462('0x31')];var _0x4ed251=_0x575ee5?_0x25cc4c[_0xd462('0x34')]:_0x2b21c3['offset']+_0x2b21c3[_0xd462('0x33')];var _0x52cc80;if(_0x4ed251>=_0x2ba2a4){_0x4ed251=_0x2ba2a4;_0x52cc80=0xc8;}else{_0x52cc80=0xce;}_0x404e8a[_0xd462('0x30')](_0x52cc80);return _0x404e8a[_0xd462('0x35')](_0xd462('0x36'),_0x1610cd+'-'+_0x4ed251+'/'+_0x2ba2a4)['json'](_0x25cc4c);}return null;};}function patchUpdates(_0x2b8c0d){return function(_0x5611c3){try{jsonpatch[_0xd462('0x37')](_0x5611c3,_0x2b8c0d,!![]);}catch(_0x65131){return BPromise[_0xd462('0x38')](_0x65131);}return _0x5611c3[_0xd462('0x39')]();};}function saveUpdates(_0x53af71,_0x26c617){return function(_0x1a5a16){if(_0x1a5a16){return _0x1a5a16[_0xd462('0x3a')](_0x53af71)[_0xd462('0x23')](function(_0x4007e2){return _0x4007e2;});}return null;};}function removeEntity(_0x18805a,_0x4649a1){return function(_0x5246e2){if(_0x5246e2){return _0x5246e2[_0xd462('0x3b')]()[_0xd462('0x23')](function(){_0x18805a[_0xd462('0x30')](0xcc)[_0xd462('0x2f')]();});}};}function handleEntityNotFound(_0x4b740f,_0x33e19a){return function(_0x1ee2ba){if(!_0x1ee2ba){_0x4b740f[_0xd462('0x2e')](0x194);}return _0x1ee2ba;};}function handleError(_0x4448bd,_0x2c834a){_0x2c834a=_0x2c834a||0x1f4;return function(_0x418ccb){logger[_0xd462('0x29')](_0x418ccb[_0xd462('0x3c')]);if(_0x418ccb[_0xd462('0x3d')]){delete _0x418ccb['name'];}_0x4448bd[_0xd462('0x30')](_0x2c834a)['send'](_0x418ccb);};}exports[_0xd462('0x3e')]=function(_0x1d9e34,_0x54320d){var _0x328b5b={},_0x2fbaa1={},_0x43ec5f={'count':0x0,'rows':[]};var _0x4c4479=_[_0xd462('0x3f')](db[_0xd462('0x40')]['rawAttributes'],function(_0x4afa36){return{'name':_0x4afa36[_0xd462('0x41')],'type':_0x4afa36['type'][_0xd462('0x42')]};});_0x2fbaa1['model']=_['map'](_0x4c4479,'name');_0x2fbaa1[_0xd462('0x43')]=_['keys'](_0x1d9e34[_0xd462('0x43')]);_0x2fbaa1[_0xd462('0x44')]=_['intersection'](_0x2fbaa1['model'],_0x2fbaa1[_0xd462('0x43')]);_0x328b5b[_0xd462('0x45')]=_[_0xd462('0x46')](_0x2fbaa1[_0xd462('0x47')],qs[_0xd462('0x48')](_0x1d9e34['query'][_0xd462('0x48')]));_0x328b5b[_0xd462('0x45')]=_0x328b5b[_0xd462('0x45')]['length']?_0x328b5b[_0xd462('0x45')]:_0x2fbaa1[_0xd462('0x47')];if(!_0x1d9e34['query'][_0xd462('0x49')](_0xd462('0x4a'))){_0x328b5b[_0xd462('0x33')]=qs[_0xd462('0x33')](_0x1d9e34['query']['limit']);_0x328b5b[_0xd462('0x31')]=qs['offset'](_0x1d9e34[_0xd462('0x43')]['offset']);}_0x328b5b[_0xd462('0x4b')]=qs[_0xd462('0x4c')](_0x1d9e34[_0xd462('0x43')][_0xd462('0x4c')]);_0x328b5b['where']=qs[_0xd462('0x44')](_[_0xd462('0x4d')](_0x1d9e34['query'],_0x2fbaa1[_0xd462('0x44')]),_0x4c4479);if(_0x1d9e34['query'][_0xd462('0x4e')]){_0x328b5b[_0xd462('0x4f')]=_[_0xd462('0x50')](_0x328b5b[_0xd462('0x4f')],{'$or':_[_0xd462('0x3f')](_0x4c4479,function(_0x1d1d7a){if(_0x1d1d7a[_0xd462('0x51')]!==_0xd462('0x52')){var _0x11f8c6={};_0x11f8c6[_0x1d1d7a[_0xd462('0x3d')]]={'$like':'%'+_0x1d9e34['query'][_0xd462('0x4e')]+'%'};return _0x11f8c6;}})});}_0x328b5b=_[_0xd462('0x50')]({},_0x328b5b,_0x1d9e34[_0xd462('0x53')]);var _0x405476={'where':_0x328b5b[_0xd462('0x4f')]};return db['ChatMessage'][_0xd462('0x34')](_0x405476)[_0xd462('0x23')](function(_0x9c8147){_0x43ec5f[_0xd462('0x34')]=_0x9c8147;if(_0x1d9e34['query'][_0xd462('0x54')]){_0x328b5b[_0xd462('0x55')]=[{'all':!![]}];}return db[_0xd462('0x40')][_0xd462('0x56')](_0x328b5b);})[_0xd462('0x23')](function(_0x555b63){_0x43ec5f[_0xd462('0x57')]=_0x555b63;return _0x43ec5f;})['then'](respondWithFilteredResult(_0x54320d,_0x328b5b))[_0xd462('0x2d')](handleError(_0x54320d,null));};exports[_0xd462('0x58')]=function(_0x13edf2,_0x41a519){var _0x5d5830={'raw':!![],'where':{'id':_0x13edf2[_0xd462('0x59')]['id']}},_0x3ca12c={};_0x3ca12c[_0xd462('0x47')]=_['keys'](db[_0xd462('0x40')][_0xd462('0x5a')]);_0x3ca12c[_0xd462('0x43')]=_[_0xd462('0x5b')](_0x13edf2[_0xd462('0x43')]);_0x3ca12c[_0xd462('0x44')]=_[_0xd462('0x46')](_0x3ca12c[_0xd462('0x47')],_0x3ca12c['query']);_0x5d5830[_0xd462('0x45')]=_[_0xd462('0x46')](_0x3ca12c['model'],qs[_0xd462('0x48')](_0x13edf2[_0xd462('0x43')][_0xd462('0x48')]));_0x5d5830[_0xd462('0x45')]=_0x5d5830[_0xd462('0x45')][_0xd462('0x5c')]?_0x5d5830[_0xd462('0x45')]:_0x3ca12c[_0xd462('0x47')];if(_0x13edf2[_0xd462('0x43')][_0xd462('0x54')]){_0x5d5830[_0xd462('0x55')]=[{'all':!![]}];}_0x5d5830=_['merge']({},_0x5d5830,_0x13edf2[_0xd462('0x53')]);return db[_0xd462('0x40')][_0xd462('0x5d')](_0x5d5830)[_0xd462('0x23')](handleEntityNotFound(_0x41a519,null))['then'](respondWithResult(_0x41a519,null))[_0xd462('0x2d')](handleError(_0x41a519,null));};exports[_0xd462('0x5e')]=function(_0x282c50,_0x107e3b){return db[_0xd462('0x40')][_0xd462('0x5e')](_0x282c50[_0xd462('0x5f')],{})[_0xd462('0x23')](respondWithResult(_0x107e3b,0xc9))[_0xd462('0x2d')](handleError(_0x107e3b,null));};exports[_0xd462('0x3a')]=function(_0x54cfd2,_0x1e8b38){if(_0x54cfd2['body']['id']){delete _0x54cfd2[_0xd462('0x5f')]['id'];}return db[_0xd462('0x40')][_0xd462('0x5d')]({'where':{'id':_0x54cfd2[_0xd462('0x59')]['id']}})[_0xd462('0x23')](handleEntityNotFound(_0x1e8b38,null))[_0xd462('0x23')](saveUpdates(_0x54cfd2['body'],null))['then'](respondWithResult(_0x1e8b38,null))[_0xd462('0x2d')](handleError(_0x1e8b38,null));};exports[_0xd462('0x3b')]=function(_0x1db167,_0x2da2b9){return db[_0xd462('0x40')][_0xd462('0x5d')]({'where':{'id':_0x1db167[_0xd462('0x59')]['id']}})[_0xd462('0x23')](handleEntityNotFound(_0x2da2b9,null))['then'](removeEntity(_0x2da2b9,null))['catch'](handleError(_0x2da2b9,null));};exports[_0xd462('0x60')]=function(_0x12bab5,_0x2d25cd){return db[_0xd462('0x40')][_0xd462('0x60')]()[_0xd462('0x23')](respondWithResult(_0x2d25cd,null))['catch'](handleError(_0x2d25cd,null));};var interaction_log=require(_0xd462('0x16'))(_0xd462('0x61'));exports[_0xd462('0x62')]=function(_0x6007c3,_0x486733,_0x7b2171){var _0x5d69a0={'agent':{},'channel':_0xd462('0x63')};if(_0x6007c3['body']['id']){delete _0x6007c3[_0xd462('0x5f')]['id'];}_0x6007c3[_0xd462('0x5f')]['read']=!![];_0x6007c3[_0xd462('0x5f')]['readAt']=moment()[_0xd462('0x64')](_0xd462('0x65'));_0x6007c3[_0xd462('0x5f')][_0xd462('0x66')]=_0x6007c3[_0xd462('0x5f')]['UserId']||_0x6007c3[_0xd462('0x67')]['id'];_0x5d69a0[_0xd462('0x68')]['id']=_0x6007c3[_0xd462('0x5f')][_0xd462('0x66')];return db['ChatMessage'][_0xd462('0x5d')]({'where':{'id':_0x6007c3[_0xd462('0x59')]['id'],'UserId':null}})[_0xd462('0x23')](handleEntityNotFound(_0x486733,null))[_0xd462('0x23')](saveUpdates(_0x6007c3[_0xd462('0x5f')],null))[_0xd462('0x23')](function(_0x22e27e){if(_0x22e27e){_0x5d69a0[_0xd462('0x2b')]=_0x22e27e['get']({'plain':!![]});return db[_0xd462('0x69')][_0xd462('0x5d')]({'where':{'id':_0x22e27e[_0xd462('0x6a')]}});}return null;})[_0xd462('0x23')](handleEntityNotFound(_0x486733,null))[_0xd462('0x23')](function(_0x349173){if(_0x349173){return _0x349173[_0xd462('0x3a')]({'UserId':_0x6007c3[_0xd462('0x5f')][_0xd462('0x66')],'read1stAt':_[_0xd462('0x6b')](_0x349173['read1stAt'])?moment()[_0xd462('0x64')](_0xd462('0x65')):undefined});}return null;})['then'](function(_0x5d3d00){if(_0x5d3d00){_0x5d69a0[_0xd462('0x6c')]=_0x5d3d00[_0xd462('0x6d')]({'plain':!![]});interaction_log['info'](_0xd462('0x6e'),_0x6007c3['user']['id'],_0x6007c3[_0xd462('0x67')]['name'],_0x6007c3[_0xd462('0x67')][_0xd462('0x6f')],_0x5d69a0[_0xd462('0x6c')]['id'],_0x6007c3[_0xd462('0x5f')]?JSON[_0xd462('0x28')](_0x6007c3[_0xd462('0x5f')]):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x5d69a0);}return null;})[_0xd462('0x23')](function(_0x5f7d64){var _0x5650b8=_0xd462('0x70')+_0x5f7d64[_0xd462('0x2b')]['ContactId'];return db[_0xd462('0x71')]['query'](_0x5650b8,{'type':db[_0xd462('0x72')]['QueryTypes'][_0xd462('0x73')],'raw':!![]})[_0xd462('0x23')](function(_0x5c1705){return _0x5c1705;});})[_0xd462('0x23')](function(_0x4b0095){if(_0x4b0095){_0x5d69a0[_0xd462('0x2b')][_0xd462('0x74')]=_0x4b0095[0x0];if(!_0x6007c3[_0xd462('0x5f')]['UserId'])return;return db[_0xd462('0x75')][_0xd462('0x5d')]({'where':{'id':_0x6007c3[_0xd462('0x5f')]['UserId'],'role':_0xd462('0x68')},'attributes':['id','name',_0xd462('0x76'),_0xd462('0x77'),_0xd462('0x78')],'raw':!![]});}return null;})[_0xd462('0x23')](function(_0x54de72){if(!_0x54de72)return null;_0x5d69a0['message'][_0xd462('0x68')]=_0x54de72;return _0x5d69a0;})[_0xd462('0x23')](function(_0x1330b2){if(_0x1330b2){if(_0x6007c3[_0xd462('0x5f')][_0xd462('0x79')]){_0x5d69a0[_0xd462('0x2b')]['interface']=util['format'](_0xd462('0x7a'),_0x6007c3[_0xd462('0x67')][_0xd462('0x3d')]);_0x5d69a0['message'][_0xd462('0x7b')]=_0x5d69a0[_0xd462('0x7b')];_0x5d69a0['message'][_0xd462('0x7c')]=_0x5d69a0[_0xd462('0x7b')];_0x5d69a0['message'][_0xd462('0x7d')]=_0xd462('0x62');return respondWithRpcPromise(_0xd462('0x7e'),_0xd462('0x7e'),{'event':_0xd462('0x7f'),'message':_[_0xd462('0x50')](_0x5d69a0[_0xd462('0x2b')],JSON[_0xd462('0x80')](_0x5d69a0[_0xd462('0x6c')][_0xd462('0x81')]))},client9002)[_0xd462('0x23')](function(){return _0x5d69a0;});}return _0x5d69a0;}return null;})['then'](respondWithResult(_0x486733,null))[_0xd462('0x2d')](handleError(_0x486733,null));};var interaction_log=require(_0xd462('0x16'))(_0xd462('0x61'));exports['reject']=function(_0x4c0370,_0x42994a,_0x1303ee){var _0x10d7fe={'agent':{},'channel':_0xd462('0x63')};if(_0x4c0370[_0xd462('0x5f')]['id']){delete _0x4c0370[_0xd462('0x5f')]['id'];}_0x4c0370['body'][_0xd462('0x66')]=_0x4c0370[_0xd462('0x5f')][_0xd462('0x66')]||_0x4c0370[_0xd462('0x67')]['id'];_0x10d7fe[_0xd462('0x68')]['id']=_0x4c0370[_0xd462('0x5f')][_0xd462('0x66')];return db[_0xd462('0x40')][_0xd462('0x5d')]({'where':{'id':_0x4c0370[_0xd462('0x59')]['id'],'UserId':null}})[_0xd462('0x23')](handleEntityNotFound(_0x42994a,null))[_0xd462('0x23')](function(_0x315a80){if(_0x315a80){_0x10d7fe[_0xd462('0x2b')]=_0x315a80[_0xd462('0x6d')]({'plain':!![]});return db[_0xd462('0x69')]['find']({'where':{'id':_0x315a80['ChatInteractionId']}});}return null;})[_0xd462('0x23')](handleEntityNotFound(_0x42994a,null))['then'](function(_0x253d78){if(_0x253d78){_0x10d7fe[_0xd462('0x6c')]=_0x253d78[_0xd462('0x6d')]({'plain':!![]});interaction_log['info'](_0xd462('0x82'),_0x4c0370['user']['id'],_0x4c0370[_0xd462('0x67')][_0xd462('0x3d')],_0x4c0370[_0xd462('0x67')][_0xd462('0x6f')],_0x10d7fe[_0xd462('0x6c')]['id'],_0x4c0370[_0xd462('0x5f')]?JSON['stringify'](_0x4c0370[_0xd462('0x5f')]):_0xd462('0x83'));return respondWithRpcPromise(_0xd462('0x84'),_0xd462('0x85'),_0x10d7fe);}return null;})[_0xd462('0x23')](function(_0x2f4a9c){var _0x4c4e41=_0xd462('0x70')+_0x2f4a9c[_0xd462('0x2b')]['ContactId'];return db[_0xd462('0x71')][_0xd462('0x43')](_0x4c4e41,{'type':db[_0xd462('0x72')][_0xd462('0x86')][_0xd462('0x73')],'raw':!![]})[_0xd462('0x23')](function(_0x1033cc){return _0x1033cc;});})[_0xd462('0x23')](function(_0x3b040e){if(_0x3b040e){_0x10d7fe[_0xd462('0x2b')][_0xd462('0x74')]=_0x3b040e[0x0];if(!_0x4c0370[_0xd462('0x5f')]['UserId'])return;return db['User'][_0xd462('0x5d')]({'where':{'id':_0x4c0370[_0xd462('0x5f')][_0xd462('0x66')],'role':_0xd462('0x68')},'attributes':['id',_0xd462('0x3d'),_0xd462('0x76'),_0xd462('0x77'),_0xd462('0x78')],'raw':!![]});}return null;})[_0xd462('0x23')](function(_0x3f42b4){if(!_0x3f42b4)return null;_0x10d7fe[_0xd462('0x2b')]['agent']=_0x3f42b4;return _0x10d7fe;})[_0xd462('0x23')](function(_0x284127){if(_0x284127){_0x284127['message'][_0xd462('0x87')]=util[_0xd462('0x64')](_0xd462('0x7a'),_0x4c0370[_0xd462('0x67')]['name']);_0x284127[_0xd462('0x2b')][_0xd462('0x7b')]=_0x10d7fe[_0xd462('0x7b')];_0x284127['message'][_0xd462('0x7c')]=_0x10d7fe[_0xd462('0x7b')];_0x284127['message'][_0xd462('0x7d')]=_0xd462('0x38');respondWithRpcPromise(_0xd462('0x7e'),_0xd462('0x7e'),{'event':_0xd462('0x88'),'message':_['merge'](_0x10d7fe[_0xd462('0x2b')],JSON[_0xd462('0x80')](_0x10d7fe[_0xd462('0x6c')][_0xd462('0x81')]))},client9002);return _0x10d7fe;}return null;})[_0xd462('0x23')](respondWithResult(_0x42994a,null))[_0xd462('0x2d')](handleError(_0x42994a,null));}; \ No newline at end of file +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 diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 902a0b5..74ccdfc 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 _0x8bfd=['ChatMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3fbe23,_0x445f21){var _0x52adf6=function(_0x274f9a){while(--_0x274f9a){_0x3fbe23['push'](_0x3fbe23['shift']());}};_0x52adf6(++_0x445f21);}(_0x8bfd,0xb9));var _0xd8bf=function(_0x4557a4,_0x36f89c){_0x4557a4=_0x4557a4-0x0;var _0x4ceb15=_0x8bfd[_0x4557a4];return _0x4ceb15;};'use strict';var EventEmitter=require(_0xd8bf('0x0'));var ChatMessage=require(_0xd8bf('0x1'))['db'][_0xd8bf('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xd8bf('0x3')](0x0);var events={'afterCreate':_0xd8bf('0x4'),'afterUpdate':_0xd8bf('0x5'),'afterDestroy':_0xd8bf('0x6')};function emitEvent(_0x54d6b6){return function(_0x21465c,_0x500933,_0x139a0b){ChatMessageEvents[_0xd8bf('0x7')](_0x54d6b6+':'+_0x21465c['id'],_0x21465c);ChatMessageEvents[_0xd8bf('0x7')](_0x54d6b6,_0x21465c);_0x139a0b(null);};}for(var e in events){if(events[_0xd8bf('0x8')](e)){var event=events[e];ChatMessage[_0xd8bf('0x9')](e,emitEvent(event));}}module[_0xd8bf('0xa')]=ChatMessageEvents; \ No newline at end of file +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 diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 8ec096b..2305c40 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 _0x7991=['createdAt','toLowerCase','catch','error','utf8mb4_unicode_ci','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','direction','out','secret','isNil','UserId','findOne','ChatInteractionId','then','update'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7991,0x171));var _0x1799=function(_0x70d9b3,_0x33bb56){_0x70d9b3=_0x70d9b3-0x0;var _0x4d6eda=_0x7991[_0x70d9b3];return _0x4d6eda;};'use strict';var _=require('lodash');var util=require(_0x1799('0x0'));var logger=require(_0x1799('0x1'))(_0x1799('0x2'));var moment=require('moment');var BPromise=require(_0x1799('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1799('0x4'));var config=require(_0x1799('0x5'));var attributes=require(_0x1799('0x6'));module[_0x1799('0x7')]=function(_0x5472e8,_0x363b37){return _0x5472e8[_0x1799('0x8')](_0x1799('0x9'),attributes,{'tableName':_0x1799('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x1799('0xb')],'type':_0x1799('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x36bc09,_0x21f500,_0x32d3fe){var _0x2ff4ef=_0x5472e8[_0x1799('0xd')];var _0x36ccdb=_0x36bc09['get']({'plain':!![]});if(_0x36ccdb[_0x1799('0xe')]['toLowerCase']()==='in'||_0x36ccdb[_0x1799('0xe')]['toLowerCase']()===_0x1799('0xf')&&!_0x36ccdb[_0x1799('0x10')]&&!_[_0x1799('0x11')](_0x36ccdb[_0x1799('0x12')])){_0x2ff4ef['ChatInteraction'][_0x1799('0x13')]({'where':{'id':_0x36ccdb[_0x1799('0x14')]}})[_0x1799('0x15')](function(_0x55f3df){if(_0x55f3df){_0x55f3df[_0x1799('0x16')]({'lastMsgAt':_0x36ccdb[_0x1799('0x17')],'lastMsgDirection':_0x36ccdb['direction'][_0x1799('0x18')]()});}})[_0x1799('0x19')](function(_0x14e5fa){console[_0x1799('0x1a')](_0x14e5fa);});}_0x32d3fe();}},'charset':'utf8mb4','collate':_0x1799('0x1b')});}; \ No newline at end of file +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 diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 6eaf602..035a1ee 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 _0xd626=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','register','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatMessage','ChatMessage','create','options','raw','then','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x33d7df,_0x4959cd){var _0x59c9e6=function(_0x358f93){while(--_0x358f93){_0x33d7df['push'](_0x33d7df['shift']());}};_0x59c9e6(++_0x4959cd);}(_0xd626,0x102));var _0x6d62=function(_0x514359,_0xb51f1b){_0x514359=_0x514359-0x0;var _0x31198c=_0xd626[_0x514359];return _0x31198c;};'use strict';var _=require(_0x6d62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d62('0x1'));var fs=require('fs');var Redis=require(_0x6d62('0x2'));var db=require(_0x6d62('0x3'))['db'];var utils=require(_0x6d62('0x4'));var logger=require(_0x6d62('0x5'))(_0x6d62('0x6'));var config=require(_0x6d62('0x7'));var jayson=require(_0x6d62('0x8'));var client=jayson[_0x6d62('0x9')][_0x6d62('0xa')]({'port':0x232a});config[_0x6d62('0xb')]=_[_0x6d62('0xc')](config[_0x6d62('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x6d62('0xd'))(new Redis(config[_0x6d62('0xb')]));require(_0x6d62('0xe'))[_0x6d62('0xf')](socket);function respondWithRpcPromise(_0x2a956d,_0xd873c3,_0x44a3e3){return new BPromise(function(_0x38ed92,_0x289ce9){return client['request'](_0x2a956d,_0x44a3e3)['then'](function(_0x2a07b9){logger[_0x6d62('0x10')](_0x6d62('0x11'),_0xd873c3,_0x6d62('0x12'));logger[_0x6d62('0x13')](_0x6d62('0x14'),_0xd873c3,_0x6d62('0x12'),JSON[_0x6d62('0x15')](_0x2a07b9));if(_0x2a07b9[_0x6d62('0x16')]){if(_0x2a07b9[_0x6d62('0x16')][_0x6d62('0x17')]===0x1f4){logger[_0x6d62('0x16')](_0x6d62('0x11'),_0xd873c3,_0x2a07b9[_0x6d62('0x16')][_0x6d62('0x18')]);return _0x289ce9(_0x2a07b9[_0x6d62('0x16')]['message']);}logger[_0x6d62('0x16')]('ChatMessage,\x20%s,\x20%s',_0xd873c3,_0x2a07b9[_0x6d62('0x16')][_0x6d62('0x18')]);return _0x38ed92(_0x2a07b9[_0x6d62('0x16')]['message']);}else{logger[_0x6d62('0x10')](_0x6d62('0x11'),_0xd873c3,_0x6d62('0x12'));_0x38ed92(_0x2a07b9[_0x6d62('0x19')][_0x6d62('0x18')]);}})[_0x6d62('0x1a')](function(_0x4542a8){logger['error'](_0x6d62('0x11'),_0xd873c3,_0x4542a8);_0x289ce9(_0x4542a8);});});}exports[_0x6d62('0x1b')]=function(_0x53be72){var _0x1933c4=this;return new Promise(function(_0x52a9e8,_0x4fc437){return db[_0x6d62('0x1c')][_0x6d62('0x1d')](_0x53be72['body'],{'raw':_0x53be72[_0x6d62('0x1e')]?_0x53be72['options'][_0x6d62('0x1f')]===undefined?!![]:![]:!![]})[_0x6d62('0x20')](function(_0x30374f){logger[_0x6d62('0x10')](_0x6d62('0x1b'),_0x53be72);logger[_0x6d62('0x13')](_0x6d62('0x1b'),_0x53be72,JSON['stringify'](_0x30374f));_0x52a9e8(_0x30374f);})[_0x6d62('0x1a')](function(_0x19b35b){logger['error']('CreateChatMessage',_0x19b35b[_0x6d62('0x18')],_0x53be72);_0x4fc437(_0x1933c4[_0x6d62('0x16')](0x1f4,_0x19b35b[_0x6d62('0x18')]));});});}; \ No newline at end of file +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 diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index eef90bd..dc1d7fc 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 _0x08d9=['length','chatMessage:','./chatMessage.events','remove','removeListener','register'];(function(_0x103c42,_0x4c4efb){var _0x56ec80=function(_0x38092e){while(--_0x38092e){_0x103c42['push'](_0x103c42['shift']());}};_0x56ec80(++_0x4c4efb);}(_0x08d9,0xc2));var _0x908d=function(_0x1f356c,_0x313364){_0x1f356c=_0x1f356c-0x0;var _0x2674dc=_0x08d9[_0x1f356c];return _0x2674dc;};'use strict';var ChatMessageEvents=require(_0x908d('0x0'));var events=['save',_0x908d('0x1'),'update'];function createListener(_0x1557c3,_0x739218){return function(_0x38a571){_0x739218['emit'](_0x1557c3,_0x38a571);};}function removeListener(_0x53cef4,_0x15dfb3){return function(){ChatMessageEvents[_0x908d('0x2')](_0x53cef4,_0x15dfb3);};}exports[_0x908d('0x3')]=function(_0xe780e0){for(var _0xb63409=0x0,_0x5d67d6=events[_0x908d('0x4')];_0xb63409<_0x5d67d6;_0xb63409++){var _0x12ce59=events[_0xb63409];var _0x388e9c=createListener(_0x908d('0x5')+_0x12ce59,_0xe780e0);ChatMessageEvents['on'](_0x12ce59,_0x388e9c);}}; \ No newline at end of file +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 diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 3e40d1b..54b17d8 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 _0x230a=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','chat','put','update','/:id/accept','/:id/reject','delete','exports','multer','util'];(function(_0xbba35e,_0x5580af){var _0x24f451=function(_0x5e1f4d){while(--_0x5e1f4d){_0xbba35e['push'](_0xbba35e['shift']());}};_0x24f451(++_0x5580af);}(_0x230a,0x124));var _0xa230=function(_0x387820,_0x430012){_0x387820=_0x387820-0x0;var _0x1353e0=_0x230a[_0x387820];return _0x1353e0;};'use strict';var multer=require(_0xa230('0x0'));var util=require(_0xa230('0x1'));var path=require('path');var timeout=require(_0xa230('0x2'));var express=require(_0xa230('0x3'));var router=express['Router']();var fs_extra=require(_0xa230('0x4'));var auth=require(_0xa230('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa230('0x6'));var controller=require(_0xa230('0x7'));router[_0xa230('0x8')]('/',auth[_0xa230('0x9')](),controller[_0xa230('0xa')]);router[_0xa230('0x8')](_0xa230('0xb'),auth['isAuthenticated'](),controller[_0xa230('0xc')]);router[_0xa230('0x8')](_0xa230('0xd'),auth[_0xa230('0x9')](),controller['show']);router['post']('/',auth[_0xa230('0x9')](),interaction['tracked'](_0xa230('0xe'),'chatmessage:create'),controller['create']);router[_0xa230('0xf')](_0xa230('0xd'),controller[_0xa230('0x10')]);router['put'](_0xa230('0x11'),auth[_0xa230('0x9')](),controller['accept']);router[_0xa230('0xf')](_0xa230('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0xa230('0x13')](_0xa230('0xd'),auth[_0xa230('0x9')](),controller['destroy']);module[_0xa230('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index bfa1d29..efbd8f8 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 _0x2abb=['exports','medium'];(function(_0x13d0fc,_0x391eba){var _0x124453=function(_0x956eba){while(--_0x956eba){_0x13d0fc['push'](_0x13d0fc['shift']());}};_0x124453(++_0x391eba);}(_0x2abb,0x194));var _0xb2ab=function(_0x344502,_0x196f55){_0x344502=_0x344502-0x0;var _0x58e840=_0x2abb[_0x344502];return _0x58e840;};'use strict';var Sequelize=require('sequelize');module[_0xb2ab('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb2ab('0x1')),'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index d38d983..81bac30 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x39c753,_0x183f32){var _0x8a925c=function(_0x179ba9){while(--_0x179ba9){_0x39c753['push'](_0x39c753['shift']());}};_0x8a925c(++_0x183f32);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 4c62bc4..694cdfc 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 _0x7ffb=['utf8mb4','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0xce0f2e,_0x43a96d){var _0x584a44=function(_0x332d78){while(--_0x332d78){_0xce0f2e['push'](_0xce0f2e['shift']());}};_0x584a44(++_0x43a96d);}(_0x7ffb,0x151));var _0xb7ff=function(_0x333714,_0x3370ac){_0x333714=_0x333714-0x0;var _0x4c211e=_0x7ffb[_0x333714];return _0x4c211e;};'use strict';var _=require(_0xb7ff('0x0'));var util=require(_0xb7ff('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb7ff('0x2'));var rp=require(_0xb7ff('0x3'));var fs=require('fs');var path=require(_0xb7ff('0x4'));var rimraf=require(_0xb7ff('0x5'));var config=require(_0xb7ff('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0xb7ff('0x7')]=function(_0x37e13c,_0x16ae16){return _0x37e13c[_0xb7ff('0x8')](_0xb7ff('0x9'),attributes,{'tableName':_0xb7ff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb7ff('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +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 diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index ec81658..f93cc55 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 _0x5282=['ChatOfflineMessage,\x20%s,\x20%s','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2f87f4,_0x5c4c){var _0x45284c=function(_0x26f308){while(--_0x26f308){_0x2f87f4['push'](_0x2f87f4['shift']());}};_0x45284c(++_0x5c4c);}(_0x5282,0x111));var _0x2528=function(_0x20fb02,_0x96c029){_0x20fb02=_0x20fb02-0x0;var _0x24a33e=_0x5282[_0x20fb02];return _0x24a33e;};'use strict';var _=require(_0x2528('0x0'));var util=require('util');var moment=require(_0x2528('0x1'));var BPromise=require(_0x2528('0x2'));var rs=require(_0x2528('0x3'));var fs=require('fs');var Redis=require(_0x2528('0x4'));var db=require(_0x2528('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2528('0x6'))(_0x2528('0x7'));var config=require(_0x2528('0x8'));var jayson=require(_0x2528('0x9'));var client=jayson[_0x2528('0xa')][_0x2528('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fb31c,_0x21be35,_0x49f9d6){return new BPromise(function(_0x14fcd2,_0x186a10){return client[_0x2528('0xc')](_0x2fb31c,_0x49f9d6)[_0x2528('0xd')](function(_0x20db97){logger[_0x2528('0xe')](_0x2528('0xf'),_0x21be35,'request\x20sent');logger[_0x2528('0x10')](_0x2528('0x11'),_0x21be35,'request\x20sent',JSON['stringify'](_0x20db97));if(_0x20db97[_0x2528('0x12')]){if(_0x20db97[_0x2528('0x12')][_0x2528('0x13')]===0x1f4){logger[_0x2528('0x12')](_0x2528('0xf'),_0x21be35,_0x20db97[_0x2528('0x12')][_0x2528('0x14')]);return _0x186a10(_0x20db97['error']['message']);}logger[_0x2528('0x12')](_0x2528('0xf'),_0x21be35,_0x20db97[_0x2528('0x12')][_0x2528('0x14')]);return _0x14fcd2(_0x20db97[_0x2528('0x12')]['message']);}else{logger[_0x2528('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x21be35,_0x2528('0x15'));_0x14fcd2(_0x20db97[_0x2528('0x16')][_0x2528('0x14')]);}})[_0x2528('0x17')](function(_0x1076d8){logger[_0x2528('0x12')](_0x2528('0xf'),_0x21be35,_0x1076d8);_0x186a10(_0x1076d8);});});} \ No newline at end of file +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 diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0117d42..8c994a6 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 _0x0f3e=['/:id','update','delete','destroy','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0f3e,0x1f3));var _0xe0f3=function(_0x550e29,_0x4047f){_0x550e29=_0x550e29-0x0;var _0x3515b6=_0x0f3e[_0x550e29];return _0x3515b6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe0f3('0x0'));var express=require('express');var router=express[_0xe0f3('0x1')]();var fs_extra=require(_0xe0f3('0x2'));var auth=require(_0xe0f3('0x3'));var interaction=require(_0xe0f3('0x4'));var config=require(_0xe0f3('0x5'));var controller=require('./chatOfflineMessage.controller');router[_0xe0f3('0x6')]('/',auth['isAuthenticated'](),controller[_0xe0f3('0x7')]);router[_0xe0f3('0x6')]('/describe',auth[_0xe0f3('0x8')](),controller[_0xe0f3('0x9')]);router[_0xe0f3('0x6')]('/:id',auth[_0xe0f3('0x8')](),controller[_0xe0f3('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe0f3('0xb'),auth[_0xe0f3('0x8')](),controller[_0xe0f3('0xc')]);router[_0xe0f3('0xd')](_0xe0f3('0xb'),auth['isAuthenticated'](),controller[_0xe0f3('0xe')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index ff99e7b..12d8a15 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 _0x5240=['exports','STRING','ENUM','mouseOver','INTEGER','sequelize'];(function(_0x6daf53,_0x1bb4b5){var _0x5b944c=function(_0x231d79){while(--_0x231d79){_0x6daf53['push'](_0x6daf53['shift']());}};_0x5b944c(++_0x1bb4b5);}(_0x5240,0x101));var _0x0524=function(_0x2c8f05,_0x3b5b37){_0x2c8f05=_0x2c8f05-0x0;var _0x3a48fd=_0x5240[_0x2c8f05];return _0x3a48fd;};'use strict';var Sequelize=require(_0x0524('0x0'));module[_0x0524('0x1')]={'name':{'type':Sequelize[_0x0524('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0524('0x3')]('mouseOver','timeout'),'defaultValue':_0x0524('0x4')},'selector':{'type':Sequelize[_0x0524('0x2')]},'timeout':{'type':Sequelize[_0x0524('0x5')]}}; \ No newline at end of file +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 diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 29ffb6d..23e51f2 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 _0xad36=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','show','params','model','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','options','find','create','body','catch','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','../../config/license/hardware','../../config/logger'];(function(_0x932a6c,_0x6b9e07){var _0x2252be=function(_0x288d63){while(--_0x288d63){_0x932a6c['push'](_0x932a6c['shift']());}};_0x2252be(++_0x6b9e07);}(_0xad36,0x11c));var _0x6ad3=function(_0x1493d3,_0x57dccc){_0x1493d3=_0x1493d3-0x0;var _0x172951=_0xad36[_0x1493d3];return _0x172951;};'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 hardwareService=require(_0x6ad3('0x13'));var logger=require(_0x6ad3('0x14'))('api');var utils=require(_0x6ad3('0x15'));var config=require(_0x6ad3('0x16'));var licenseUtil=require(_0x6ad3('0x17'));var db=require(_0x6ad3('0x18'))['db'];function respondWithStatusCode(_0x439b9b,_0x27d865){_0x27d865=_0x27d865||0xcc;return function(_0x3132b7){if(_0x3132b7){return _0x439b9b[_0x6ad3('0x19')](_0x27d865);}return _0x439b9b['status'](_0x27d865)[_0x6ad3('0x1a')]();};}function respondWithResult(_0x4883a1,_0x14418f){_0x14418f=_0x14418f||0xc8;return function(_0x2541fa){if(_0x2541fa){return _0x4883a1[_0x6ad3('0x1b')](_0x14418f)[_0x6ad3('0x1c')](_0x2541fa);}};}function respondWithFilteredResult(_0x2e1ba0,_0x52bb9d){return function(_0x2d406b){if(_0x2d406b){var _0x45aa65=typeof _0x52bb9d[_0x6ad3('0x1d')]==='undefined'&&typeof _0x52bb9d['limit']==='undefined';var _0x4ea840=_0x2d406b[_0x6ad3('0x1e')];var _0x4d031b=_0x45aa65?0x0:_0x52bb9d[_0x6ad3('0x1d')];var _0x52d10c=_0x45aa65?_0x2d406b[_0x6ad3('0x1e')]:_0x52bb9d[_0x6ad3('0x1d')]+_0x52bb9d[_0x6ad3('0x1f')];var _0x3f8ce2;if(_0x52d10c>=_0x4ea840){_0x52d10c=_0x4ea840;_0x3f8ce2=0xc8;}else{_0x3f8ce2=0xce;}_0x2e1ba0['status'](_0x3f8ce2);return _0x2e1ba0['set'](_0x6ad3('0x20'),_0x4d031b+'-'+_0x52d10c+'/'+_0x4ea840)[_0x6ad3('0x1c')](_0x2d406b);}return null;};}function patchUpdates(_0x1fad6e){return function(_0x3050aa){try{jsonpatch[_0x6ad3('0x21')](_0x3050aa,_0x1fad6e,!![]);}catch(_0xc75a57){return BPromise[_0x6ad3('0x22')](_0xc75a57);}return _0x3050aa[_0x6ad3('0x23')]();};}function saveUpdates(_0xe5b2ad,_0x4cb79d){return function(_0x33e11b){if(_0x33e11b){return _0x33e11b[_0x6ad3('0x24')](_0xe5b2ad)[_0x6ad3('0x25')](function(_0x1fcdf9){return _0x1fcdf9;});}return null;};}function removeEntity(_0x220887,_0x244064){return function(_0x4887ba){if(_0x4887ba){return _0x4887ba[_0x6ad3('0x26')]()[_0x6ad3('0x25')](function(){_0x220887[_0x6ad3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50dbec,_0xec24c5){return function(_0x13bff5){if(!_0x13bff5){_0x50dbec['sendStatus'](0x194);}return _0x13bff5;};}function handleError(_0x5523d1,_0x28debd){_0x28debd=_0x28debd||0x1f4;return function(_0x1892fd){logger[_0x6ad3('0x27')](_0x1892fd[_0x6ad3('0x28')]);if(_0x1892fd[_0x6ad3('0x29')]){delete _0x1892fd[_0x6ad3('0x29')];}_0x5523d1['status'](_0x28debd)['send'](_0x1892fd);};}exports[_0x6ad3('0x2a')]=function(_0x3e8d2a,_0x3f1351){var _0x2c4dda={'raw':!![],'where':{'id':_0x3e8d2a[_0x6ad3('0x2b')]['id']}},_0x4ee707={};_0x4ee707[_0x6ad3('0x2c')]=_[_0x6ad3('0x2d')](db[_0x6ad3('0x2e')][_0x6ad3('0x2f')]);_0x4ee707[_0x6ad3('0x30')]=_[_0x6ad3('0x2d')](_0x3e8d2a[_0x6ad3('0x30')]);_0x4ee707[_0x6ad3('0x31')]=_['intersection'](_0x4ee707[_0x6ad3('0x2c')],_0x4ee707[_0x6ad3('0x30')]);_0x2c4dda['attributes']=_[_0x6ad3('0x32')](_0x4ee707[_0x6ad3('0x2c')],qs[_0x6ad3('0x33')](_0x3e8d2a[_0x6ad3('0x30')]['fields']));_0x2c4dda[_0x6ad3('0x34')]=_0x2c4dda['attributes'][_0x6ad3('0x35')]?_0x2c4dda[_0x6ad3('0x34')]:_0x4ee707[_0x6ad3('0x2c')];if(_0x3e8d2a[_0x6ad3('0x30')][_0x6ad3('0x36')]){_0x2c4dda[_0x6ad3('0x37')]=[{'all':!![]}];}_0x2c4dda=_['merge']({},_0x2c4dda,_0x3e8d2a[_0x6ad3('0x38')]);return db[_0x6ad3('0x2e')][_0x6ad3('0x39')](_0x2c4dda)[_0x6ad3('0x25')](handleEntityNotFound(_0x3f1351,null))[_0x6ad3('0x25')](respondWithResult(_0x3f1351,null))['catch'](handleError(_0x3f1351,null));};exports[_0x6ad3('0x3a')]=function(_0x5ab890,_0x19b4cb){return db[_0x6ad3('0x2e')][_0x6ad3('0x3a')](_0x5ab890[_0x6ad3('0x3b')],{})[_0x6ad3('0x25')](respondWithResult(_0x19b4cb,0xc9))[_0x6ad3('0x3c')](handleError(_0x19b4cb,null));};exports[_0x6ad3('0x24')]=function(_0x1c3f74,_0x23617f){if(_0x1c3f74['body']['id']){delete _0x1c3f74[_0x6ad3('0x3b')]['id'];}return db[_0x6ad3('0x2e')][_0x6ad3('0x39')]({'where':{'id':_0x1c3f74[_0x6ad3('0x2b')]['id']}})[_0x6ad3('0x25')](handleEntityNotFound(_0x23617f,null))[_0x6ad3('0x25')](saveUpdates(_0x1c3f74[_0x6ad3('0x3b')],null))['then'](respondWithResult(_0x23617f,null))['catch'](handleError(_0x23617f,null));};exports[_0x6ad3('0x26')]=function(_0x3bae8a,_0x37b4c2){return db[_0x6ad3('0x2e')][_0x6ad3('0x39')]({'where':{'id':_0x3bae8a[_0x6ad3('0x2b')]['id']}})[_0x6ad3('0x25')](handleEntityNotFound(_0x37b4c2,null))['then'](removeEntity(_0x37b4c2,null))[_0x6ad3('0x3c')](handleError(_0x37b4c2,null));}; \ No newline at end of file +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 diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index aff0b86..fc19d49 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 _0xc8a9=['../../config/logger','api','moment','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xc8a9,0x149));var _0x9c8a=function(_0x35d035,_0x56f190){_0x35d035=_0x35d035-0x0;var _0x4ef2ab=_0xc8a9[_0x35d035];return _0x4ef2ab;};'use strict';var _=require(_0x9c8a('0x0'));var util=require('util');var logger=require(_0x9c8a('0x1'))(_0x9c8a('0x2'));var moment=require(_0x9c8a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9c8a('0x4'));var rimraf=require(_0x9c8a('0x5'));var config=require('../../config/environment');var attributes=require(_0x9c8a('0x6'));module[_0x9c8a('0x7')]=function(_0x23bc9a,_0x5dc01a){return _0x23bc9a[_0x9c8a('0x8')](_0x9c8a('0x9'),attributes,{'tableName':_0x9c8a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index fb334cc..ebbf623 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 _0x5bb3=['client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x149f79,_0x57be9b){var _0x318abe=function(_0x39c22a){while(--_0x39c22a){_0x149f79['push'](_0x149f79['shift']());}};_0x318abe(++_0x57be9b);}(_0x5bb3,0x116));var _0x35bb=function(_0x18f34c,_0x2a293e){_0x18f34c=_0x18f34c-0x0;var _0x3ef4a8=_0x5bb3[_0x18f34c];return _0x3ef4a8;};'use strict';var _=require(_0x35bb('0x0'));var util=require(_0x35bb('0x1'));var moment=require(_0x35bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x35bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x35bb('0x4'))['db'];var utils=require(_0x35bb('0x5'));var logger=require(_0x35bb('0x6'))(_0x35bb('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x35bb('0x8')][_0x35bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0275,_0x35c023,_0x1d075b){return new BPromise(function(_0x3697ee,_0x56b58f){return client[_0x35bb('0xa')](_0x5e0275,_0x1d075b)[_0x35bb('0xb')](function(_0x257b70){logger[_0x35bb('0xc')](_0x35bb('0xd'),_0x35c023,_0x35bb('0xe'));logger['debug'](_0x35bb('0xf'),_0x35c023,'request\x20sent',JSON[_0x35bb('0x10')](_0x257b70));if(_0x257b70[_0x35bb('0x11')]){if(_0x257b70['error'][_0x35bb('0x12')]===0x1f4){logger[_0x35bb('0x11')](_0x35bb('0xd'),_0x35c023,_0x257b70[_0x35bb('0x11')][_0x35bb('0x13')]);return _0x56b58f(_0x257b70[_0x35bb('0x11')]['message']);}logger[_0x35bb('0x11')](_0x35bb('0xd'),_0x35c023,_0x257b70['error'][_0x35bb('0x13')]);return _0x3697ee(_0x257b70[_0x35bb('0x11')]['message']);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x35c023,_0x35bb('0xe'));_0x3697ee(_0x257b70[_0x35bb('0x14')][_0x35bb('0x13')]);}})[_0x35bb('0x15')](function(_0x3d9383){logger['error'](_0x35bb('0xd'),_0x35c023,_0x3d9383);_0x56b58f(_0x3d9383);});});} \ No newline at end of file +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 diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index f8b5dc3..02e42c5 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 _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0x3d16d2,_0x3c6bd2){var _0x147f21=function(_0x17701f){while(--_0x17701f){_0x3d16d2['push'](_0x3d16d2['shift']());}};_0x147f21(++_0x3c6bd2);}(_0xa630,0xbe));var _0x0a63=function(_0x554a9b,_0x40dba9){_0x554a9b=_0x554a9b-0x0;var _0x2f502d=_0xa630[_0x554a9b];return _0x2f502d;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index d155859..125f723 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 _0xa4db=['STRING','INTEGER','ENUM','rrmemory','roundrobin','sequelize','name'];(function(_0x346a52,_0x30f4f5){var _0x50f30d=function(_0x5417e7){while(--_0x5417e7){_0x346a52['push'](_0x346a52['shift']());}};_0x50f30d(++_0x30f4f5);}(_0xa4db,0xc9));var _0xba4d=function(_0x9b9c94,_0x20b461){_0x9b9c94=_0x9b9c94-0x0;var _0x1dcd36=_0xa4db[_0x9b9c94];return _0x1dcd36;};'use strict';var Sequelize=require(_0xba4d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xba4d('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xba4d('0x2')]},'timeout':{'type':Sequelize[_0xba4d('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xba4d('0x4')](_0xba4d('0x5'),'beepall',_0xba4d('0x6'))}}; \ No newline at end of file +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 diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 87bea6b..55d91d7 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 _0xd0b0=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','keys','length','include','find','create','body','user','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','params','describe','findOne','UserChatQueue','hasOwnProperty','order','ChatQueueId','findAll','User','UserId','agent','updatedAt','createdAt','format','%s/%s','chatPause','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','value','removeTeams','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x27daab,_0x44e180){var _0x37a477=function(_0x4f762a){while(--_0x4f762a){_0x27daab['push'](_0x27daab['shift']());}};_0x37a477(++_0x44e180);}(_0xd0b0,0x12d));var _0x0d0b=function(_0x280c2c,_0x2a589f){_0x280c2c=_0x280c2c-0x0;var _0x41e0ef=_0xd0b0[_0x280c2c];return _0x41e0ef;};'use strict';var emlformat=require(_0x0d0b('0x0'));var rimraf=require(_0x0d0b('0x1'));var zipdir=require(_0x0d0b('0x2'));var jsonpatch=require(_0x0d0b('0x3'));var rp=require('request-promise');var moment=require(_0x0d0b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0d0b('0x5'));var util=require(_0x0d0b('0x6'));var path=require(_0x0d0b('0x7'));var sox=require(_0x0d0b('0x8'));var csv=require(_0x0d0b('0x9'));var ejs=require(_0x0d0b('0xa'));var fs=require('fs');var fs_extra=require(_0x0d0b('0xb'));var _=require(_0x0d0b('0xc'));var squel=require(_0x0d0b('0xd'));var crypto=require(_0x0d0b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0d0b('0xf'));var toCsv=require(_0x0d0b('0x9'));var querystring=require(_0x0d0b('0x10'));var Papa=require(_0x0d0b('0x11'));var Redis=require(_0x0d0b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0d0b('0x13'));var as=require(_0x0d0b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0d0b('0x15'))(_0x0d0b('0x16'));var utils=require(_0x0d0b('0x17'));var config=require(_0x0d0b('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0d0b('0x19')]=_[_0x0d0b('0x1a')](config[_0x0d0b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x0d0b('0x1b'))(new Redis(config[_0x0d0b('0x19')]));require(_0x0d0b('0x1c'))['register'](socket);var jayson=require(_0x0d0b('0x1d'));var client=jayson[_0x0d0b('0x1e')][_0x0d0b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0xf5511f,_0x5c10dc,_0x575ae6,_0x3b2f6e){return new BPromise(function(_0x467e69,_0x1463be){var _0x1df654=_0x3b2f6e||client;return _0x1df654[_0x0d0b('0x20')](_0xf5511f,_0x575ae6)[_0x0d0b('0x21')](function(_0x2a9f78){logger[_0x0d0b('0x22')](_0x0d0b('0x23'),_0x5c10dc,'request\x20sent');logger[_0x0d0b('0x24')](_0x0d0b('0x25'),_0x5c10dc,_0x0d0b('0x26'),JSON['stringify'](_0x2a9f78));if(_0x2a9f78[_0x0d0b('0x27')]){if(_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x28')]===0x1f4){logger[_0x0d0b('0x27')](_0x0d0b('0x23'),_0x5c10dc,_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);return _0x1463be(_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);}logger['error'](_0x0d0b('0x23'),_0x5c10dc,_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);return _0x467e69(_0x2a9f78[_0x0d0b('0x27')][_0x0d0b('0x29')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x5c10dc,_0x0d0b('0x26'));_0x467e69(_0x2a9f78[_0x0d0b('0x2a')][_0x0d0b('0x29')]);}})['catch'](function(_0x340f8f){logger[_0x0d0b('0x27')](_0x0d0b('0x23'),_0x5c10dc,_0x340f8f);_0x1463be(_0x340f8f);});});}function respondWithStatusCode(_0x2fb097,_0x44a1ea){_0x44a1ea=_0x44a1ea||0xcc;return function(_0x303e43){if(_0x303e43){return _0x2fb097[_0x0d0b('0x2b')](_0x44a1ea);}return _0x2fb097[_0x0d0b('0x2c')](_0x44a1ea)[_0x0d0b('0x2d')]();};}function respondWithResult(_0x4712be,_0x38db3f){_0x38db3f=_0x38db3f||0xc8;return function(_0xe7d286){if(_0xe7d286){return _0x4712be[_0x0d0b('0x2c')](_0x38db3f)[_0x0d0b('0x2e')](_0xe7d286);}};}function respondWithFilteredResult(_0xd09306,_0x3f406a){return function(_0x5a306c){if(_0x5a306c){var _0x1dc90c=typeof _0x3f406a[_0x0d0b('0x2f')]===_0x0d0b('0x30')&&typeof _0x3f406a[_0x0d0b('0x31')]===_0x0d0b('0x30');var _0xdefcf4=_0x5a306c[_0x0d0b('0x32')];var _0x59430f=_0x1dc90c?0x0:_0x3f406a[_0x0d0b('0x2f')];var _0x3538d4=_0x1dc90c?_0x5a306c['count']:_0x3f406a['offset']+_0x3f406a[_0x0d0b('0x31')];var _0x55138e;if(_0x3538d4>=_0xdefcf4){_0x3538d4=_0xdefcf4;_0x55138e=0xc8;}else{_0x55138e=0xce;}_0xd09306['status'](_0x55138e);return _0xd09306[_0x0d0b('0x33')](_0x0d0b('0x34'),_0x59430f+'-'+_0x3538d4+'/'+_0xdefcf4)[_0x0d0b('0x2e')](_0x5a306c);}return null;};}function patchUpdates(_0x926606){return function(_0x1b4e9f){try{jsonpatch[_0x0d0b('0x35')](_0x1b4e9f,_0x926606,!![]);}catch(_0x2905a1){return BPromise[_0x0d0b('0x36')](_0x2905a1);}return _0x1b4e9f[_0x0d0b('0x37')]();};}function saveUpdates(_0x259e5c,_0x43fd1e){return function(_0x2ec9ae){if(_0x2ec9ae){return _0x2ec9ae[_0x0d0b('0x38')](_0x259e5c)[_0x0d0b('0x21')](function(_0x21a405){return _0x21a405;});}return null;};}function removeEntity(_0x149d74,_0x165e7c){return function(_0x10c01c){if(_0x10c01c){return _0x10c01c[_0x0d0b('0x39')]()[_0x0d0b('0x21')](function(){var _0x4ec8bd=_0x10c01c[_0x0d0b('0x3a')]({'plain':!![]});var _0x1dc79d='ChatQueues';return db[_0x0d0b('0x3b')][_0x0d0b('0x39')]({'where':{'type':_0x1dc79d,'resourceId':_0x4ec8bd['id']}})[_0x0d0b('0x21')](function(){return _0x10c01c;});})[_0x0d0b('0x21')](function(){_0x149d74[_0x0d0b('0x2c')](0xcc)[_0x0d0b('0x2d')]();});}};}function handleEntityNotFound(_0x2bf90d,_0xb96273){return function(_0x45e468){if(!_0x45e468){_0x2bf90d[_0x0d0b('0x2b')](0x194);}return _0x45e468;};}function handleError(_0x508ee6,_0x2b498c){_0x2b498c=_0x2b498c||0x1f4;return function(_0x4b854a){logger[_0x0d0b('0x27')](_0x4b854a[_0x0d0b('0x3c')]);if(_0x4b854a[_0x0d0b('0x3d')]){delete _0x4b854a[_0x0d0b('0x3d')];}_0x508ee6[_0x0d0b('0x2c')](_0x2b498c)[_0x0d0b('0x3e')](_0x4b854a);};}exports[_0x0d0b('0x3f')]=function(_0x3211d3,_0x522b0c){var _0x1ad146={},_0x3cef12={},_0x49b5e4={'count':0x0,'rows':[]};var _0x189aaa=_[_0x0d0b('0x40')](db[_0x0d0b('0x41')][_0x0d0b('0x42')],function(_0x597426){return{'name':_0x597426[_0x0d0b('0x43')],'type':_0x597426[_0x0d0b('0x44')][_0x0d0b('0x45')]};});_0x3cef12[_0x0d0b('0x46')]=_['map'](_0x189aaa,'name');_0x3cef12[_0x0d0b('0x47')]=_['keys'](_0x3211d3[_0x0d0b('0x47')]);_0x3cef12[_0x0d0b('0x48')]=_[_0x0d0b('0x49')](_0x3cef12['model'],_0x3cef12[_0x0d0b('0x47')]);_0x1ad146[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x3cef12['model'],qs[_0x0d0b('0x4b')](_0x3211d3['query'][_0x0d0b('0x4b')]));_0x1ad146['attributes']=_0x1ad146[_0x0d0b('0x4a')]['length']?_0x1ad146[_0x0d0b('0x4a')]:_0x3cef12[_0x0d0b('0x46')];if(!_0x3211d3['query']['hasOwnProperty'](_0x0d0b('0x4c'))){_0x1ad146['limit']=qs['limit'](_0x3211d3['query'][_0x0d0b('0x31')]);_0x1ad146[_0x0d0b('0x2f')]=qs[_0x0d0b('0x2f')](_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}_0x1ad146['order']=qs[_0x0d0b('0x4d')](_0x3211d3[_0x0d0b('0x47')]['sort']);_0x1ad146[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x3211d3[_0x0d0b('0x47')],_0x3cef12[_0x0d0b('0x48')]),_0x189aaa);if(_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x1ad146[_0x0d0b('0x4e')]=_[_0x0d0b('0x51')](_0x1ad146[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x189aaa,function(_0x25b190){if(_0x25b190[_0x0d0b('0x44')]!==_0x0d0b('0x52')){var _0x2e259d={};_0x2e259d[_0x25b190[_0x0d0b('0x3d')]]={'$like':'%'+_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x2e259d;}})});}_0x1ad146=_[_0x0d0b('0x51')]({},_0x1ad146,_0x3211d3[_0x0d0b('0x53')]);var _0x420338={'where':_0x1ad146[_0x0d0b('0x4e')]};return db['ChatQueue'][_0x0d0b('0x32')](_0x420338)[_0x0d0b('0x21')](function(_0x332100){_0x49b5e4[_0x0d0b('0x32')]=_0x332100;if(_0x3211d3[_0x0d0b('0x47')][_0x0d0b('0x54')]){_0x1ad146['include']=[{'all':!![]}];}return db[_0x0d0b('0x41')]['findAll'](_0x1ad146);})[_0x0d0b('0x21')](function(_0xd1c59d){_0x49b5e4[_0x0d0b('0x55')]=_0xd1c59d;return _0x49b5e4;})[_0x0d0b('0x21')](respondWithFilteredResult(_0x522b0c,_0x1ad146))[_0x0d0b('0x56')](handleError(_0x522b0c,null));};exports[_0x0d0b('0x57')]=function(_0x33ad7f,_0x575eb7){var _0x373d84={'raw':!![],'where':{'id':_0x33ad7f['params']['id']}},_0x484c65={};_0x484c65[_0x0d0b('0x46')]=_['keys'](db[_0x0d0b('0x41')][_0x0d0b('0x42')]);_0x484c65[_0x0d0b('0x47')]=_[_0x0d0b('0x58')](_0x33ad7f[_0x0d0b('0x47')]);_0x484c65[_0x0d0b('0x48')]=_[_0x0d0b('0x49')](_0x484c65[_0x0d0b('0x46')],_0x484c65['query']);_0x373d84[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x484c65[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x33ad7f['query']['fields']));_0x373d84[_0x0d0b('0x4a')]=_0x373d84[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x373d84[_0x0d0b('0x4a')]:_0x484c65[_0x0d0b('0x46')];if(_0x33ad7f['query'][_0x0d0b('0x54')]){_0x373d84[_0x0d0b('0x5a')]=[{'all':!![]}];}_0x373d84=_[_0x0d0b('0x51')]({},_0x373d84,_0x33ad7f[_0x0d0b('0x53')]);return db[_0x0d0b('0x41')][_0x0d0b('0x5b')](_0x373d84)[_0x0d0b('0x21')](handleEntityNotFound(_0x575eb7,null))[_0x0d0b('0x21')](respondWithResult(_0x575eb7,null))[_0x0d0b('0x56')](handleError(_0x575eb7,null));};exports['create']=function(_0x592e44,_0x2614f6){return db['ChatQueue'][_0x0d0b('0x5c')](_0x592e44[_0x0d0b('0x5d')],{})[_0x0d0b('0x21')](function(_0x5255af){var _0x4d7ad9=_0x592e44[_0x0d0b('0x5e')][_0x0d0b('0x3a')]({'plain':!![]});if(!_0x4d7ad9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d7ad9[_0x0d0b('0x5f')]===_0x0d0b('0x5e')){var _0x1b27bf=_0x5255af[_0x0d0b('0x3a')]({'plain':!![]});var _0x3f8b13=_0x0d0b('0x60');return db[_0x0d0b('0x61')][_0x0d0b('0x5b')]({'where':{'name':_0x3f8b13,'userProfileId':_0x4d7ad9[_0x0d0b('0x62')]},'raw':!![]})[_0x0d0b('0x21')](function(_0x4662e9){if(_0x4662e9&&_0x4662e9[_0x0d0b('0x63')]===0x0){return db[_0x0d0b('0x3b')][_0x0d0b('0x5c')]({'name':_0x1b27bf[_0x0d0b('0x3d')],'resourceId':_0x1b27bf['id'],'type':_0x4662e9[_0x0d0b('0x3d')],'sectionId':_0x4662e9['id']},{})[_0x0d0b('0x21')](function(){return _0x5255af;});}else{return _0x5255af;}})[_0x0d0b('0x56')](function(_0x449452){logger[_0x0d0b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x449452);throw _0x449452;});}return _0x5255af;})[_0x0d0b('0x21')](respondWithResult(_0x2614f6,0xc9))[_0x0d0b('0x56')](handleError(_0x2614f6,null));};exports[_0x0d0b('0x38')]=function(_0x364369,_0x5ddf34){if(_0x364369[_0x0d0b('0x5d')]['id']){delete _0x364369[_0x0d0b('0x5d')]['id'];}return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x364369[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](handleEntityNotFound(_0x5ddf34,null))['then'](saveUpdates(_0x364369[_0x0d0b('0x5d')],null))[_0x0d0b('0x21')](respondWithResult(_0x5ddf34,null))[_0x0d0b('0x56')](handleError(_0x5ddf34,null));};exports[_0x0d0b('0x39')]=function(_0x4fae0d,_0xc21141){return db['ChatQueue'][_0x0d0b('0x5b')]({'where':{'id':_0x4fae0d['params']['id']}})['then'](handleEntityNotFound(_0xc21141,null))[_0x0d0b('0x21')](removeEntity(_0xc21141,null))[_0x0d0b('0x56')](handleError(_0xc21141,null));};exports[_0x0d0b('0x65')]=function(_0x2bd355,_0x3c506d){return db[_0x0d0b('0x41')][_0x0d0b('0x65')]()[_0x0d0b('0x21')](respondWithResult(_0x3c506d,null))[_0x0d0b('0x56')](handleError(_0x3c506d,null));};exports['getMembers']=function(_0x10ac51,_0x541776,_0x17764d){var _0x510552={'raw':!![],'where':{}},_0x2b98e9={},_0x31b5e1;return db[_0x0d0b('0x41')][_0x0d0b('0x66')]({'where':{'id':_0x10ac51[_0x0d0b('0x64')]['id']}})['then'](handleEntityNotFound(_0x541776,null))[_0x0d0b('0x21')](function(_0x59cc1c){if(_0x59cc1c){_0x31b5e1=_0x59cc1c[_0x0d0b('0x3a')]({'plain':!![]});_0x2b98e9[_0x0d0b('0x46')]=_[_0x0d0b('0x58')](db[_0x0d0b('0x67')][_0x0d0b('0x42')]);_0x2b98e9[_0x0d0b('0x47')]=_[_0x0d0b('0x58')](_0x10ac51['query']);_0x2b98e9['filters']=_[_0x0d0b('0x49')](_0x2b98e9[_0x0d0b('0x46')],_0x2b98e9[_0x0d0b('0x47')]);_0x510552[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x2b98e9[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x10ac51['query'][_0x0d0b('0x4b')]));_0x510552[_0x0d0b('0x4a')]=_0x510552[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x510552[_0x0d0b('0x4a')]:_0x2b98e9['model'];if(!_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x68')](_0x0d0b('0x4c'))){_0x510552['limit']=qs['limit'](_0x10ac51['query'][_0x0d0b('0x31')]);_0x510552['offset']=qs[_0x0d0b('0x2f')](_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}_0x510552[_0x0d0b('0x69')]=qs[_0x0d0b('0x4d')](_0x10ac51[_0x0d0b('0x47')]['sort']);_0x510552[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x10ac51[_0x0d0b('0x47')],_0x2b98e9[_0x0d0b('0x48')]));_0x510552[_0x0d0b('0x4e')][_0x0d0b('0x6a')]=_0x59cc1c['id'];if(_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x510552[_0x0d0b('0x4e')]=_[_0x0d0b('0x51')](_0x510552[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x510552[_0x0d0b('0x4a')],function(_0x5ef796){var _0x44930a={};_0x44930a[_0x5ef796]={'$like':'%'+_0x10ac51[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x44930a;})});}_0x510552=_[_0x0d0b('0x51')]({},_0x510552,_0x10ac51['options']);return db['UserChatQueue'][_0x0d0b('0x6b')](_0x510552);}})[_0x0d0b('0x21')](function(_0x213f69){if(_0x213f69){return db[_0x0d0b('0x6c')]['findAndCountAll']({'where':{'id':_[_0x0d0b('0x40')](_0x213f69,_0x0d0b('0x6d')),'role':_0x0d0b('0x6e')},'attributes':['id',_0x0d0b('0x3d'),'chatPause',_0x0d0b('0x6f'),_0x0d0b('0x70')]});}})[_0x0d0b('0x21')](function(_0x9aabf0){if(_0x9aabf0){return{'count':_0x9aabf0[_0x0d0b('0x32')],'rows':_['map'](_0x9aabf0[_0x0d0b('0x55')],function(_0x45e36a){return{'membername':_0x45e36a[_0x0d0b('0x3d')],'UserId':_0x45e36a['id'],'queue_name':_0x31b5e1[_0x0d0b('0x3d')],'ChatQueueId':_0x31b5e1['id'],'interface':util[_0x0d0b('0x71')](_0x0d0b('0x72'),'SIP',_0x45e36a[_0x0d0b('0x3d')]),'penalty':0x0,'paused':_0x45e36a[_0x0d0b('0x73')],'createdAt':_0x45e36a[_0x0d0b('0x70')],'updatedAt':_0x45e36a[_0x0d0b('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d0b('0x21')](respondWithFilteredResult(_0x541776,_0x510552))['catch'](handleError(_0x541776,null));};exports[_0x0d0b('0x74')]=function(_0x1fec4f,_0x5ec083,_0x55fb72){var _0x44b51f={};var _0x4ea481={};var _0x6aaedb;var _0x2e6f86;return db[_0x0d0b('0x41')]['findOne']({'where':{'id':_0x1fec4f[_0x0d0b('0x64')]['id']}})['then'](handleEntityNotFound(_0x5ec083,null))[_0x0d0b('0x21')](function(_0x2439e5){if(_0x2439e5){_0x6aaedb=_0x2439e5;_0x4ea481[_0x0d0b('0x46')]=_['keys'](db[_0x0d0b('0x75')]['rawAttributes']);_0x4ea481['query']=_[_0x0d0b('0x58')](_0x1fec4f[_0x0d0b('0x47')]);_0x4ea481[_0x0d0b('0x48')]=_[_0x0d0b('0x49')](_0x4ea481[_0x0d0b('0x46')],_0x4ea481[_0x0d0b('0x47')]);_0x44b51f[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x4ea481[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x4b')]));_0x44b51f[_0x0d0b('0x4a')]=_0x44b51f[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x44b51f[_0x0d0b('0x4a')]:_0x4ea481[_0x0d0b('0x46')];_0x44b51f[_0x0d0b('0x69')]=qs[_0x0d0b('0x4d')](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x4d')]);_0x44b51f[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x1fec4f[_0x0d0b('0x47')],_0x4ea481[_0x0d0b('0x48')]));if(_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x44b51f[_0x0d0b('0x4e')]=_['merge'](_0x44b51f[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x44b51f[_0x0d0b('0x4a')],function(_0x1b5c4b){var _0x45869c={};_0x45869c[_0x1b5c4b]={'$like':'%'+_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x45869c;})});}_0x44b51f=_['merge']({},_0x44b51f,_0x1fec4f[_0x0d0b('0x53')]);return _0x6aaedb[_0x0d0b('0x74')](_0x44b51f);}})[_0x0d0b('0x21')](function(_0x6fa8b0){if(_0x6fa8b0){_0x2e6f86=_0x6fa8b0[_0x0d0b('0x59')];if(!_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x68')]('nolimit')){_0x44b51f[_0x0d0b('0x31')]=qs['limit'](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x31')]);_0x44b51f[_0x0d0b('0x2f')]=qs[_0x0d0b('0x2f')](_0x1fec4f[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}return _0x6aaedb[_0x0d0b('0x74')](_0x44b51f);}})[_0x0d0b('0x21')](function(_0x2a9fe8){if(_0x2a9fe8){return _0x2a9fe8?{'count':_0x2e6f86,'rows':_0x2a9fe8}:null;}})[_0x0d0b('0x21')](respondWithResult(_0x5ec083,null))[_0x0d0b('0x56')](handleError(_0x5ec083,null));};exports[_0x0d0b('0x76')]=function(_0x1f8592,_0x2d4150,_0x13a94e){var _0x1d3ef6=_0x1f8592['body'][_0x0d0b('0x77')];return db[_0x0d0b('0x75')][_0x0d0b('0x6b')]({'where':{'id':_0x1d3ef6},'attributes':['id'],'include':[{'model':db[_0x0d0b('0x6c')],'as':_0x0d0b('0x78'),'attributes':['id','name',_0x0d0b('0x79'),_0x0d0b('0x7a'),_0x0d0b('0x7b')],'raw':!![]}]})[_0x0d0b('0x21')](function(_0x425246){if(_0x425246){var _0x35f9a1=_[_0x0d0b('0x7c')](_0x425246,function(_0x54c434){var _0x579300=_0x54c434[_0x0d0b('0x3a')]({'plain':!![]});return _0x579300[_0x0d0b('0x78')];});return db['ChatQueue'][_0x0d0b('0x5b')]({'where':{'id':_0x1f8592[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](function(_0x22b659){return db[_0x0d0b('0x7d')][_0x0d0b('0x7e')](function(_0x59a21e){return _0x22b659[_0x0d0b('0x76')](_0x1d3ef6,{'transaction':_0x59a21e})['then'](function(){return BPromise[_0x0d0b('0x7f')](_0x35f9a1,function(_0x1928a4){return db[_0x0d0b('0x67')][_0x0d0b('0x80')]({'where':{'UserId':_0x1928a4['id'],'ChatQueueId':_0x1f8592[_0x0d0b('0x64')]['id']},'transaction':_0x59a21e});});})[_0x0d0b('0x21')](function(){_0x35f9a1[_0x0d0b('0x81')](function(_0x510a3d){socket[_0x0d0b('0x82')](_0x0d0b('0x83'),{'UserId':_0x510a3d['id'],'ChatQueueId':_0x22b659['id']});});});});});}})[_0x0d0b('0x21')](respondWithStatusCode(_0x2d4150,null))[_0x0d0b('0x56')](handleError(_0x2d4150,null));};exports['removeTeams']=function(_0x179fd5,_0x2d36c5,_0xf6280e){return db['Team'][_0x0d0b('0x6b')]({'where':{'id':_0x179fd5[_0x0d0b('0x47')][_0x0d0b('0x77')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0d0b('0x78'),'attributes':['id'],'raw':!![]}]})[_0x0d0b('0x21')](handleEntityNotFound(_0x2d36c5,null))[_0x0d0b('0x21')](function(_0x57e6fe){var _0x58f43a=_[_0x0d0b('0x40')](_0x57e6fe,'id');var _0x53b78d=[];var _0x583e67=[];var _0x31ba2d=squel[_0x0d0b('0x84')]();_0x31ba2d[_0x0d0b('0x85')](_0x0d0b('0x86'))['from'](_0x0d0b('0x87'),'tq')[_0x0d0b('0x88')](_0x0d0b('0x89'),'ut',_0x0d0b('0x8a'))[_0x0d0b('0x4e')](_0x0d0b('0x8b'),_0x179fd5[_0x0d0b('0x64')]['id']);for(var _0x777dbf=0x0;_0x777dbf<_0x57e6fe[_0x0d0b('0x59')];_0x777dbf+=0x1){let _0x4260c4=_0x57e6fe[_0x777dbf];for(var _0x17be9e=0x0;_0x17be9e<_0x4260c4[_0x0d0b('0x78')][_0x0d0b('0x59')];_0x17be9e+=0x1){let _0x2ede09=_0x4260c4['Agents'][_0x17be9e];var _0x4936d6=_0x31ba2d[_0x0d0b('0x8c')]();_0x4936d6['where'](_0x0d0b('0x8d'),_0x2ede09['id']);_0x583e67[_0x0d0b('0x8e')](db[_0x0d0b('0x7d')][_0x0d0b('0x47')](_0x4936d6[_0x0d0b('0x8f')](),{'type':db[_0x0d0b('0x7d')][_0x0d0b('0x90')][_0x0d0b('0x91')]})[_0x0d0b('0x21')](function(_0x408dff){if(_0x408dff['length']===0x1){return _0x2ede09['id'];}else{var _0x24f6b9=_[_0x0d0b('0x92')](_[_0x0d0b('0x40')](_0x408dff,_0x0d0b('0x93')),function(_0x201f2e){return _['includes'](_0x58f43a,_0x201f2e);});if(_0x24f6b9){return _0x2ede09['id'];}}}));}}return BPromise[_0x0d0b('0x94')](_0x583e67)['then'](function(_0x56779f){_0x53b78d=_(_0x53b78d)[_0x0d0b('0x95')](_0x56779f)['compact']()[_0x0d0b('0x96')]();return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x179fd5[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](function(_0x8b63c4){return db[_0x0d0b('0x7d')][_0x0d0b('0x7e')](function(_0x52bba9){return _0x8b63c4[_0x0d0b('0x97')](_0x179fd5[_0x0d0b('0x47')][_0x0d0b('0x77')],{'transaction':_0x52bba9})['then'](function(){if(!_['isEmpty'](_0x53b78d)){return _0x8b63c4[_0x0d0b('0x98')](_0x53b78d,{'transaction':_0x52bba9});}})[_0x0d0b('0x21')](function(){_0x53b78d['forEach'](function(_0x2c447c){socket[_0x0d0b('0x82')](_0x0d0b('0x99'),{'UserId':_0x2c447c,'ChatQueueId':_0x8b63c4['id']});});});});});});})[_0x0d0b('0x21')](respondWithStatusCode(_0x2d36c5,null))['catch'](handleError(_0x2d36c5,null));};exports[_0x0d0b('0x9a')]=function(_0x3cee3d,_0x2fedd5,_0x2e18b3){return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x3cee3d[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](handleEntityNotFound(_0x2fedd5,null))[_0x0d0b('0x21')](function(_0x3793ce){if(_0x3793ce){return _0x3793ce[_0x0d0b('0x9a')](_0x3cee3d[_0x0d0b('0x5d')][_0x0d0b('0x77')],_[_0x0d0b('0x9b')](_0x3cee3d[_0x0d0b('0x5d')],['ids','id'])||{})[_0x0d0b('0x9c')](function(_0x1c594e){for(var _0x4ff3d8=0x0;_0x4ff3d8<_0x3cee3d['body'][_0x0d0b('0x77')][_0x0d0b('0x59')];_0x4ff3d8+=0x1){socket[_0x0d0b('0x82')](_0x0d0b('0x83'),{'UserId':Number(_0x3cee3d['body'][_0x0d0b('0x77')][_0x4ff3d8]),'ChatQueueId':Number(_0x3cee3d[_0x0d0b('0x64')]['id'])});}return _0x1c594e;});}})['then'](respondWithResult(_0x2fedd5,null))[_0x0d0b('0x56')](handleError(_0x2fedd5,null));};exports['removeAgents']=function(_0x145c0b,_0x49286d,_0x2e63d1){return db[_0x0d0b('0x41')][_0x0d0b('0x5b')]({'where':{'id':_0x145c0b[_0x0d0b('0x64')]['id']}})[_0x0d0b('0x21')](handleEntityNotFound(_0x49286d,null))['then'](function(_0x15ab80){if(_0x15ab80){return _0x15ab80[_0x0d0b('0x98')](_0x145c0b[_0x0d0b('0x47')]['ids'])['then'](function(){if(_[_0x0d0b('0x9d')](_0x145c0b[_0x0d0b('0x47')][_0x0d0b('0x77')])){for(var _0x6986ed=0x0;_0x6986ed<_0x145c0b['query'][_0x0d0b('0x77')][_0x0d0b('0x59')];_0x6986ed+=0x1){socket['emit'](_0x0d0b('0x99'),{'UserId':Number(_0x145c0b['query'][_0x0d0b('0x77')][_0x6986ed]),'ChatQueueId':Number(_0x145c0b[_0x0d0b('0x64')]['id'])});}}else{socket[_0x0d0b('0x82')](_0x0d0b('0x99'),{'UserId':Number(_0x145c0b[_0x0d0b('0x47')]['ids']),'ChatQueueId':Number(_0x145c0b[_0x0d0b('0x64')]['id'])});}});}})[_0x0d0b('0x21')](respondWithStatusCode(_0x49286d,null))[_0x0d0b('0x56')](handleError(_0x49286d,null));};exports['getAgents']=function(_0x2f0250,_0xe6f5ca,_0x536c6f){var _0x1704ba={};var _0x1a3135={};var _0x5aca9d;var _0x4ae30a;return db['ChatQueue'][_0x0d0b('0x66')]({'where':{'id':_0x2f0250[_0x0d0b('0x64')]['id']}})['then'](handleEntityNotFound(_0xe6f5ca,null))['then'](function(_0x350376){if(_0x350376){_0x5aca9d=_0x350376;_0x1a3135[_0x0d0b('0x46')]=_[_0x0d0b('0x58')](db[_0x0d0b('0x6c')][_0x0d0b('0x42')]);_0x1a3135[_0x0d0b('0x47')]=_[_0x0d0b('0x58')](_0x2f0250[_0x0d0b('0x47')]);_0x1a3135['filters']=_[_0x0d0b('0x49')](_0x1a3135[_0x0d0b('0x46')],_0x1a3135[_0x0d0b('0x47')]);_0x1704ba[_0x0d0b('0x4a')]=_[_0x0d0b('0x49')](_0x1a3135[_0x0d0b('0x46')],qs[_0x0d0b('0x4b')](_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x4b')]));_0x1704ba[_0x0d0b('0x4a')]=_0x1704ba[_0x0d0b('0x4a')][_0x0d0b('0x59')]?_0x1704ba[_0x0d0b('0x4a')]:_0x1a3135[_0x0d0b('0x46')];_0x1704ba[_0x0d0b('0x69')]=qs['sort'](_0x2f0250[_0x0d0b('0x47')]['sort']);_0x1704ba[_0x0d0b('0x4e')]=qs[_0x0d0b('0x48')](_[_0x0d0b('0x4f')](_0x2f0250[_0x0d0b('0x47')],_0x1a3135[_0x0d0b('0x48')]));if(_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x50')]){_0x1704ba[_0x0d0b('0x4e')]=_[_0x0d0b('0x51')](_0x1704ba[_0x0d0b('0x4e')],{'$or':_[_0x0d0b('0x40')](_0x1704ba[_0x0d0b('0x4a')],function(_0x306178){var _0x1d8b35={};_0x1d8b35[_0x306178]={'$like':'%'+_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x50')]+'%'};return _0x1d8b35;})});}_0x1704ba=_['merge']({},_0x1704ba,_0x2f0250[_0x0d0b('0x53')]);return _0x5aca9d[_0x0d0b('0x9e')](_0x1704ba);}})[_0x0d0b('0x21')](function(_0x3bad61){if(_0x3bad61){_0x4ae30a=_0x3bad61[_0x0d0b('0x59')];if(!_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x68')]('nolimit')){_0x1704ba[_0x0d0b('0x31')]=qs['limit'](_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x31')]);_0x1704ba[_0x0d0b('0x2f')]=qs[_0x0d0b('0x2f')](_0x2f0250[_0x0d0b('0x47')][_0x0d0b('0x2f')]);}return _0x5aca9d[_0x0d0b('0x9e')](_0x1704ba);}})[_0x0d0b('0x21')](function(_0x40064e){if(_0x40064e){return _0x40064e?{'count':_0x4ae30a,'rows':_0x40064e}:null;}})[_0x0d0b('0x21')](respondWithResult(_0xe6f5ca,null))[_0x0d0b('0x56')](handleError(_0xe6f5ca,null));}; \ No newline at end of file +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 diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 323ce5a..b76b8ab 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 _0xb1ee=['update','remove','emit','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save'];(function(_0x5e60d4,_0x136e3b){var _0x468399=function(_0x1d99d2){while(--_0x1d99d2){_0x5e60d4['push'](_0x5e60d4['shift']());}};_0x468399(++_0x136e3b);}(_0xb1ee,0x16d));var _0xeb1e=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0xb1ee[_0x43c8b8];return _0x413be3;};'use strict';var EventEmitter=require(_0xeb1e('0x0'));var ChatQueue=require(_0xeb1e('0x1'))['db'][_0xeb1e('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xeb1e('0x3')](0x0);var events={'afterCreate':_0xeb1e('0x4'),'afterUpdate':_0xeb1e('0x5'),'afterDestroy':_0xeb1e('0x6')};function emitEvent(_0x27665b){return function(_0x5cf351,_0x5af22e,_0x1618c9){ChatQueueEvents[_0xeb1e('0x7')](_0x27665b+':'+_0x5cf351['id'],_0x5cf351);ChatQueueEvents[_0xeb1e('0x7')](_0x27665b,_0x5cf351);_0x1618c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0xeb1e('0x8')](e,emitEvent(event));}}module[_0xeb1e('0x9')]=ChatQueueEvents; \ No newline at end of file +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 diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 9808fe3..07fbd39 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 _0x1b3f=['chat_queues','lodash','util','api','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1b3f,0xb5));var _0xf1b3=function(_0x35434d,_0x328955){_0x35434d=_0x35434d-0x0;var _0x208d6c=_0x1b3f[_0x35434d];return _0x208d6c;};'use strict';var _=require(_0xf1b3('0x0'));var util=require(_0xf1b3('0x1'));var logger=require('../../config/logger')(_0xf1b3('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('rimraf');var config=require(_0xf1b3('0x3'));var attributes=require(_0xf1b3('0x4'));module[_0xf1b3('0x5')]=function(_0x13af7b,_0x1c6dfe){return _0x13af7b[_0xf1b3('0x6')](_0xf1b3('0x7'),attributes,{'tableName':_0xf1b3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 95c8de7..5a63ea4 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 _0xe0dd=['info','request\x20sent','debug','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','ChatQueue','findAll','raw','options','where','limit','include','map','model','attributes','GetChatQueue','ShowChatQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','socket.io-emitter','./chatQueue.socket','then'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0xe0dd,0x163));var _0xde0d=function(_0xf48cce,_0x3531e4){_0xf48cce=_0xf48cce-0x0;var _0x2a5c38=_0xe0dd[_0xf48cce];return _0x2a5c38;};'use strict';var _=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var moment=require('moment');var BPromise=require(_0xde0d('0x2'));var rs=require(_0xde0d('0x3'));var fs=require('fs');var Redis=require(_0xde0d('0x4'));var db=require(_0xde0d('0x5'))['db'];var utils=require(_0xde0d('0x6'));var logger=require(_0xde0d('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xde0d('0x8'));var client=jayson[_0xde0d('0x9')]['http']({'port':0x232a});config[_0xde0d('0xa')]=_[_0xde0d('0xb')](config[_0xde0d('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xde0d('0xc'))(new Redis(config['redis']));require(_0xde0d('0xd'))['register'](socket);function respondWithRpcPromise(_0x36d631,_0x29119d,_0x10db06){return new BPromise(function(_0x4eeb64,_0x5cc8ca){return client['request'](_0x36d631,_0x10db06)[_0xde0d('0xe')](function(_0xcd25ec){logger[_0xde0d('0xf')]('ChatQueue,\x20%s,\x20%s',_0x29119d,_0xde0d('0x10'));logger[_0xde0d('0x11')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x29119d,_0xde0d('0x10'),JSON[_0xde0d('0x12')](_0xcd25ec));if(_0xcd25ec[_0xde0d('0x13')]){if(_0xcd25ec[_0xde0d('0x13')][_0xde0d('0x14')]===0x1f4){logger['error'](_0xde0d('0x15'),_0x29119d,_0xcd25ec['error'][_0xde0d('0x16')]);return _0x5cc8ca(_0xcd25ec['error'][_0xde0d('0x16')]);}logger['error'](_0xde0d('0x15'),_0x29119d,_0xcd25ec[_0xde0d('0x13')][_0xde0d('0x16')]);return _0x4eeb64(_0xcd25ec[_0xde0d('0x13')][_0xde0d('0x16')]);}else{logger[_0xde0d('0xf')](_0xde0d('0x15'),_0x29119d,'request\x20sent');_0x4eeb64(_0xcd25ec[_0xde0d('0x17')][_0xde0d('0x16')]);}})[_0xde0d('0x18')](function(_0x5803ae){logger[_0xde0d('0x13')](_0xde0d('0x15'),_0x29119d,_0x5803ae);_0x5cc8ca(_0x5803ae);});});}exports['GetChatQueue']=function(_0x5acec2){var _0x32af88=this;return new Promise(function(_0x16800a,_0x11437e){return db[_0xde0d('0x19')][_0xde0d('0x1a')]({'raw':_0x5acec2['options']?_0x5acec2['options'][_0xde0d('0x1b')]===undefined?!![]:![]:!![],'where':_0x5acec2['options']?_0x5acec2[_0xde0d('0x1c')][_0xde0d('0x1d')]||null:null,'attributes':_0x5acec2[_0xde0d('0x1c')]?_0x5acec2['options']['attributes']||null:null,'limit':_0x5acec2['options']?_0x5acec2[_0xde0d('0x1c')][_0xde0d('0x1e')]||null:null,'include':_0x5acec2['options']?_0x5acec2[_0xde0d('0x1c')][_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x5acec2[_0xde0d('0x1c')]['include'],function(_0x2e1d92){return{'model':db[_0x2e1d92[_0xde0d('0x21')]],'as':_0x2e1d92['as'],'attributes':_0x2e1d92[_0xde0d('0x22')],'include':_0x2e1d92[_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x2e1d92[_0xde0d('0x1f')],function(_0x10f114){return{'model':db[_0x10f114[_0xde0d('0x21')]],'as':_0x10f114['as'],'attributes':_0x10f114[_0xde0d('0x22')],'include':_0x10f114['include']?_[_0xde0d('0x20')](_0x10f114[_0xde0d('0x1f')],function(_0x32f65c){return{'model':db[_0x32f65c[_0xde0d('0x21')]],'as':_0x32f65c['as'],'attributes':_0x32f65c[_0xde0d('0x22')]};}):[]};}):[]};}):[]:[]})[_0xde0d('0xe')](function(_0x24f93b){logger[_0xde0d('0xf')](_0xde0d('0x23'),_0x5acec2);logger['debug']('GetChatQueue',_0x5acec2,JSON['stringify'](_0x24f93b));_0x16800a(_0x24f93b);})['catch'](function(_0x5f3ea3){logger[_0xde0d('0x13')](_0xde0d('0x23'),_0x5f3ea3[_0xde0d('0x16')],_0x5acec2);_0x11437e(_0x32af88[_0xde0d('0x13')](0x1f4,_0x5f3ea3['message']));});});};exports[_0xde0d('0x24')]=function(_0x1a7fe3){var _0x3aa9a6=this;return new Promise(function(_0x5d5cb1,_0x3809f5){return db[_0xde0d('0x19')]['find']({'raw':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3[_0xde0d('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3['options'][_0xde0d('0x1d')]||null:null,'attributes':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3[_0xde0d('0x1c')][_0xde0d('0x22')]||null:null,'include':_0x1a7fe3[_0xde0d('0x1c')]?_0x1a7fe3[_0xde0d('0x1c')][_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x1a7fe3[_0xde0d('0x1c')][_0xde0d('0x1f')],function(_0x5e0f1d){return{'model':db[_0x5e0f1d[_0xde0d('0x21')]],'as':_0x5e0f1d['as'],'attributes':_0x5e0f1d[_0xde0d('0x22')],'include':_0x5e0f1d[_0xde0d('0x1f')]?_[_0xde0d('0x20')](_0x5e0f1d[_0xde0d('0x1f')],function(_0x1652f1){return{'model':db[_0x1652f1[_0xde0d('0x21')]],'as':_0x1652f1['as'],'attributes':_0x1652f1[_0xde0d('0x22')],'include':_0x1652f1['include']?_['map'](_0x1652f1[_0xde0d('0x1f')],function(_0x5c0a52){return{'model':db[_0x5c0a52['model']],'as':_0x5c0a52['as'],'attributes':_0x5c0a52['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xab0df0){logger[_0xde0d('0xf')]('ShowChatQueue',_0x1a7fe3);logger[_0xde0d('0x11')]('ShowChatQueue',_0x1a7fe3,JSON[_0xde0d('0x12')](_0xab0df0));_0x5d5cb1(_0xab0df0);})['catch'](function(_0xa5e09f){logger['error']('ShowChatQueue',_0xa5e09f[_0xde0d('0x16')],_0x1a7fe3);_0x3809f5(_0x3aa9a6['error'](0x1f4,_0xa5e09f[_0xde0d('0x16')]));});});}; \ No newline at end of file +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 diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 3b5861e..d64af46 100644 --- a/server/api/chatQueue/chatQueue.socket.js +++ b/server/api/chatQueue/chatQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b67=['register','length','chatQueue:','./chatQueue.events','save','remove','update','emit','removeListener'];(function(_0x3d07a2,_0x14e189){var _0x209397=function(_0x4a35af){while(--_0x4a35af){_0x3d07a2['push'](_0x3d07a2['shift']());}};_0x209397(++_0x14e189);}(_0x9b67,0xf6));var _0x79b6=function(_0x57b63b,_0x216568){_0x57b63b=_0x57b63b-0x0;var _0x332a97=_0x9b67[_0x57b63b];return _0x332a97;};'use strict';var ChatQueueEvents=require(_0x79b6('0x0'));var events=[_0x79b6('0x1'),_0x79b6('0x2'),_0x79b6('0x3')];function createListener(_0x29728d,_0x5523a1){return function(_0x3ba25a){_0x5523a1[_0x79b6('0x4')](_0x29728d,_0x3ba25a);};}function removeListener(_0x5297d0,_0x4e8794){return function(){ChatQueueEvents[_0x79b6('0x5')](_0x5297d0,_0x4e8794);};}exports[_0x79b6('0x6')]=function(_0x258103){for(var _0xec367e=0x0,_0xfa6a05=events[_0x79b6('0x7')];_0xec367e<_0xfa6a05;_0xec367e++){var _0x34adbe=events[_0xec367e];var _0x58ae2d=createListener(_0x79b6('0x8')+_0x34adbe,_0x258103);ChatQueueEvents['on'](_0x34adbe,_0x58ae2d);}}; \ No newline at end of file +var _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 diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index cacac5c..aab9cc9 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 _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3d61a9,_0x145147){var _0x5b3607=function(_0x5aca29){while(--_0x5aca29){_0x3d61a9['push'](_0x3d61a9['shift']());}};_0x5b3607(++_0x145147);}(_0x814b,0x1a2));var _0xb814=function(_0xa5d9f9,_0x17c6bf){_0xa5d9f9=_0xa5d9f9-0x0;var _0x40e9f6=_0x814b[_0xa5d9f9];return _0x40e9f6;};'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('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index b18377d..96963ad 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 _0x3dc7=['STRING','DATE','moment','sequelize','exports'];(function(_0x182623,_0x510040){var _0x3404d5=function(_0x2ff4b1){while(--_0x2ff4b1){_0x182623['push'](_0x182623['shift']());}};_0x3404d5(++_0x510040);}(_0x3dc7,0x138));var _0x73dc=function(_0x50791c,_0x3466eb){_0x50791c=_0x50791c-0x0;var _0x2d9192=_0x3dc7[_0x50791c];return _0x2d9192;};'use strict';var moment=require(_0x73dc('0x0'));var Sequelize=require(_0x73dc('0x1'));module[_0x73dc('0x2')]={'uniqueid':{'type':Sequelize[_0x73dc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x73dc('0x3')]},'joinAt':{'type':Sequelize[_0x73dc('0x4')]},'leaveAt':{'type':Sequelize[_0x73dc('0x4')]},'acceptAt':{'type':Sequelize[_0x73dc('0x4')]},'exitAt':{'type':Sequelize[_0x73dc('0x4')]},'reason':{'type':Sequelize[_0x73dc('0x3')]}}; \ No newline at end of file +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 diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index c301c37..a99585a 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 _0xbd10=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','name','map','ChatQueueReport','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','show','params','keys','rawAttributes','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis'];(function(_0x3cbbf3,_0x47fa64){var _0x5794db=function(_0x2b1d7d){while(--_0x2b1d7d){_0x3cbbf3['push'](_0x3cbbf3['shift']());}};_0x5794db(++_0x47fa64);}(_0xbd10,0x85));var _0x0bd1=function(_0x2c58ab,_0x2b5755){_0x2c58ab=_0x2c58ab-0x0;var _0x3eff87=_0xbd10[_0x2c58ab];return _0x3eff87;};'use strict';var emlformat=require(_0x0bd1('0x0'));var rimraf=require(_0x0bd1('0x1'));var zipdir=require(_0x0bd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0bd1('0x3'));var moment=require(_0x0bd1('0x4'));var BPromise=require(_0x0bd1('0x5'));var Mustache=require('mustache');var util=require(_0x0bd1('0x6'));var path=require(_0x0bd1('0x7'));var sox=require(_0x0bd1('0x8'));var csv=require(_0x0bd1('0x9'));var ejs=require(_0x0bd1('0xa'));var fs=require('fs');var fs_extra=require(_0x0bd1('0xb'));var _=require('lodash');var squel=require(_0x0bd1('0xc'));var crypto=require('crypto');var jsforce=require(_0x0bd1('0xd'));var deskjs=require(_0x0bd1('0xe'));var toCsv=require(_0x0bd1('0x9'));var querystring=require(_0x0bd1('0xf'));var Papa=require('papaparse');var Redis=require(_0x0bd1('0x10'));var authService=require(_0x0bd1('0x11'));var qs=require(_0x0bd1('0x12'));var as=require(_0x0bd1('0x13'));var hardwareService=require(_0x0bd1('0x14'));var logger=require(_0x0bd1('0x15'))('api');var utils=require(_0x0bd1('0x16'));var config=require(_0x0bd1('0x17'));var licenseUtil=require(_0x0bd1('0x18'));var db=require(_0x0bd1('0x19'))['db'];function respondWithStatusCode(_0x4009e4,_0x1f441f){_0x1f441f=_0x1f441f||0xcc;return function(_0x57fd1d){if(_0x57fd1d){return _0x4009e4[_0x0bd1('0x1a')](_0x1f441f);}return _0x4009e4[_0x0bd1('0x1b')](_0x1f441f)[_0x0bd1('0x1c')]();};}function respondWithResult(_0x5025e1,_0x51f988){_0x51f988=_0x51f988||0xc8;return function(_0x3e2f49){if(_0x3e2f49){return _0x5025e1[_0x0bd1('0x1b')](_0x51f988)[_0x0bd1('0x1d')](_0x3e2f49);}};}function respondWithFilteredResult(_0x56055b,_0x5ab8a5){return function(_0x180809){if(_0x180809){var _0x88e088=typeof _0x5ab8a5[_0x0bd1('0x1e')]==='undefined'&&typeof _0x5ab8a5[_0x0bd1('0x1f')]===_0x0bd1('0x20');var _0x2f2969=_0x180809[_0x0bd1('0x21')];var _0x4790eb=_0x88e088?0x0:_0x5ab8a5[_0x0bd1('0x1e')];var _0x3d1170=_0x88e088?_0x180809['count']:_0x5ab8a5[_0x0bd1('0x1e')]+_0x5ab8a5[_0x0bd1('0x1f')];var _0x59d106;if(_0x3d1170>=_0x2f2969){_0x3d1170=_0x2f2969;_0x59d106=0xc8;}else{_0x59d106=0xce;}_0x56055b['status'](_0x59d106);return _0x56055b[_0x0bd1('0x22')](_0x0bd1('0x23'),_0x4790eb+'-'+_0x3d1170+'/'+_0x2f2969)[_0x0bd1('0x1d')](_0x180809);}return null;};}function patchUpdates(_0x6959b7){return function(_0x1f8536){try{jsonpatch[_0x0bd1('0x24')](_0x1f8536,_0x6959b7,!![]);}catch(_0xc5ece1){return BPromise[_0x0bd1('0x25')](_0xc5ece1);}return _0x1f8536['save']();};}function saveUpdates(_0x2d5861,_0x44095f){return function(_0x31eaf5){if(_0x31eaf5){return _0x31eaf5[_0x0bd1('0x26')](_0x2d5861)[_0x0bd1('0x27')](function(_0x569b09){return _0x569b09;});}return null;};}function removeEntity(_0x35a8ca,_0x4d6828){return function(_0x5f0742){if(_0x5f0742){return _0x5f0742[_0x0bd1('0x28')]()[_0x0bd1('0x27')](function(){_0x35a8ca[_0x0bd1('0x1b')](0xcc)[_0x0bd1('0x1c')]();});}};}function handleEntityNotFound(_0x237f4a,_0x16eb7b){return function(_0x3e0c07){if(!_0x3e0c07){_0x237f4a[_0x0bd1('0x1a')](0x194);}return _0x3e0c07;};}function handleError(_0x2cacfc,_0x58a565){_0x58a565=_0x58a565||0x1f4;return function(_0x5cb236){logger[_0x0bd1('0x29')](_0x5cb236['stack']);if(_0x5cb236[_0x0bd1('0x2a')]){delete _0x5cb236[_0x0bd1('0x2a')];}_0x2cacfc['status'](_0x58a565)['send'](_0x5cb236);};}exports['index']=function(_0x4b64cb,_0x551fcd){var _0x4616b9={},_0x2ac8bb={},_0x38e655={'count':0x0,'rows':[]};var _0x5b07cd=_[_0x0bd1('0x2b')](db[_0x0bd1('0x2c')]['rawAttributes'],function(_0x49debf){return{'name':_0x49debf[_0x0bd1('0x2d')],'type':_0x49debf['type']['key']};});_0x2ac8bb['model']=_[_0x0bd1('0x2b')](_0x5b07cd,_0x0bd1('0x2a'));_0x2ac8bb[_0x0bd1('0x2e')]=_['keys'](_0x4b64cb[_0x0bd1('0x2e')]);_0x2ac8bb[_0x0bd1('0x2f')]=_['intersection'](_0x2ac8bb['model'],_0x2ac8bb[_0x0bd1('0x2e')]);_0x4616b9['attributes']=_[_0x0bd1('0x30')](_0x2ac8bb[_0x0bd1('0x31')],qs['fields'](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x32')]));_0x4616b9[_0x0bd1('0x33')]=_0x4616b9['attributes'][_0x0bd1('0x34')]?_0x4616b9['attributes']:_0x2ac8bb[_0x0bd1('0x31')];if(!_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x35')](_0x0bd1('0x36'))){_0x4616b9['limit']=qs[_0x0bd1('0x1f')](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x1f')]);_0x4616b9[_0x0bd1('0x1e')]=qs[_0x0bd1('0x1e')](_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x1e')]);}_0x4616b9['order']=qs[_0x0bd1('0x37')](_0x4b64cb[_0x0bd1('0x2e')]['sort']);_0x4616b9[_0x0bd1('0x38')]=qs[_0x0bd1('0x2f')](_[_0x0bd1('0x39')](_0x4b64cb[_0x0bd1('0x2e')],_0x2ac8bb[_0x0bd1('0x2f')]),_0x5b07cd);if(_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x3a')]){_0x4616b9[_0x0bd1('0x38')]=_[_0x0bd1('0x3b')](_0x4616b9[_0x0bd1('0x38')],{'$or':_[_0x0bd1('0x2b')](_0x5b07cd,function(_0x3715f6){if(_0x3715f6[_0x0bd1('0x3c')]!==_0x0bd1('0x3d')){var _0x28b835={};_0x28b835[_0x3715f6[_0x0bd1('0x2a')]]={'$like':'%'+_0x4b64cb[_0x0bd1('0x2e')][_0x0bd1('0x3a')]+'%'};return _0x28b835;}})});}_0x4616b9=_['merge']({},_0x4616b9,_0x4b64cb['options']);var _0x2fe9da={'where':_0x4616b9[_0x0bd1('0x38')]};return db[_0x0bd1('0x2c')][_0x0bd1('0x21')](_0x2fe9da)[_0x0bd1('0x27')](function(_0x5fcd17){_0x38e655['count']=_0x5fcd17;if(_0x4b64cb['query'][_0x0bd1('0x3e')]){_0x4616b9[_0x0bd1('0x3f')]=[{'all':!![]}];}return db[_0x0bd1('0x2c')][_0x0bd1('0x40')](_0x4616b9);})['then'](function(_0x12c010){_0x38e655['rows']=_0x12c010;return _0x38e655;})[_0x0bd1('0x27')](respondWithFilteredResult(_0x551fcd,_0x4616b9))['catch'](handleError(_0x551fcd,null));};exports[_0x0bd1('0x41')]=function(_0x3b7677,_0x32cff5){var _0xd4217c={'raw':!![],'where':{'id':_0x3b7677[_0x0bd1('0x42')]['id']}},_0x5894f4={};_0x5894f4[_0x0bd1('0x31')]=_[_0x0bd1('0x43')](db['ChatQueueReport'][_0x0bd1('0x44')]);_0x5894f4[_0x0bd1('0x2e')]=_[_0x0bd1('0x43')](_0x3b7677[_0x0bd1('0x2e')]);_0x5894f4[_0x0bd1('0x2f')]=_[_0x0bd1('0x30')](_0x5894f4[_0x0bd1('0x31')],_0x5894f4[_0x0bd1('0x2e')]);_0xd4217c[_0x0bd1('0x33')]=_[_0x0bd1('0x30')](_0x5894f4[_0x0bd1('0x31')],qs['fields'](_0x3b7677['query'][_0x0bd1('0x32')]));_0xd4217c['attributes']=_0xd4217c[_0x0bd1('0x33')]['length']?_0xd4217c[_0x0bd1('0x33')]:_0x5894f4[_0x0bd1('0x31')];if(_0x3b7677[_0x0bd1('0x2e')][_0x0bd1('0x3e')]){_0xd4217c[_0x0bd1('0x3f')]=[{'all':!![]}];}_0xd4217c=_[_0x0bd1('0x3b')]({},_0xd4217c,_0x3b7677[_0x0bd1('0x45')]);return db[_0x0bd1('0x2c')][_0x0bd1('0x46')](_0xd4217c)[_0x0bd1('0x27')](handleEntityNotFound(_0x32cff5,null))['then'](respondWithResult(_0x32cff5,null))[_0x0bd1('0x47')](handleError(_0x32cff5,null));};exports[_0x0bd1('0x48')]=function(_0x34a20d,_0x1ef213){return db['ChatQueueReport']['create'](_0x34a20d[_0x0bd1('0x49')],{})[_0x0bd1('0x27')](respondWithResult(_0x1ef213,0xc9))[_0x0bd1('0x47')](handleError(_0x1ef213,null));};exports['update']=function(_0x3cc311,_0x2cf6cb){if(_0x3cc311[_0x0bd1('0x49')]['id']){delete _0x3cc311[_0x0bd1('0x49')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0x3cc311[_0x0bd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x2cf6cb,null))[_0x0bd1('0x27')](saveUpdates(_0x3cc311['body'],null))[_0x0bd1('0x27')](respondWithResult(_0x2cf6cb,null))['catch'](handleError(_0x2cf6cb,null));};exports[_0x0bd1('0x28')]=function(_0x43ecb5,_0x53b563){return db['ChatQueueReport'][_0x0bd1('0x46')]({'where':{'id':_0x43ecb5[_0x0bd1('0x42')]['id']}})['then'](handleEntityNotFound(_0x53b563,null))['then'](removeEntity(_0x53b563,null))[_0x0bd1('0x47')](handleError(_0x53b563,null));};exports[_0x0bd1('0x4a')]=function(_0x1adf77,_0x4ca2e8){return db['ChatQueueReport'][_0x0bd1('0x4a')]()[_0x0bd1('0x27')](respondWithResult(_0x4ca2e8,null))[_0x0bd1('0x47')](handleError(_0x4ca2e8,null));}; \ No newline at end of file +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 diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 8dfe834..131c0be 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(_0x3e1a10,_0x6aeaf2){var _0x2fb8ee=function(_0x473aa3){while(--_0x473aa3){_0x3e1a10['push'](_0x3e1a10['shift']());}};_0x2fb8ee(++_0x6aeaf2);}(_0xe706,0xa3));var _0x6e70=function(_0x28ad6c,_0x599a96){_0x28ad6c=_0x28ad6c-0x0;var _0x597de8=_0xe706[_0x28ad6c];return _0x597de8;};'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 _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 diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index fdf902e..20e5488 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 _0xb65b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','attributes','limit','util','moment'];(function(_0x88018c,_0x1d1448){var _0xd21877=function(_0x3183fb){while(--_0x3183fb){_0x88018c['push'](_0x88018c['shift']());}};_0xd21877(++_0x1d1448);}(_0xb65b,0x139));var _0xbb65=function(_0x116633,_0x30ca02){_0x116633=_0x116633-0x0;var _0x3f688e=_0xb65b[_0x116633];return _0x3f688e;};'use strict';var _=require('lodash');var util=require(_0xbb65('0x0'));var moment=require(_0xbb65('0x1'));var BPromise=require(_0xbb65('0x2'));var rs=require(_0xbb65('0x3'));var fs=require('fs');var Redis=require(_0xbb65('0x4'));var db=require(_0xbb65('0x5'))['db'];var utils=require(_0xbb65('0x6'));var logger=require(_0xbb65('0x7'))(_0xbb65('0x8'));var config=require(_0xbb65('0x9'));var jayson=require(_0xbb65('0xa'));var client=jayson[_0xbb65('0xb')][_0xbb65('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x342934,_0x4aec73,_0x32ccd8){return new BPromise(function(_0x13860a,_0xbead3){return client['request'](_0x342934,_0x32ccd8)[_0xbb65('0xd')](function(_0x583aad){logger[_0xbb65('0xe')](_0xbb65('0xf'),_0x4aec73,_0xbb65('0x10'));logger[_0xbb65('0x11')](_0xbb65('0x12'),_0x4aec73,_0xbb65('0x10'),JSON['stringify'](_0x583aad));if(_0x583aad['error']){if(_0x583aad['error'][_0xbb65('0x13')]===0x1f4){logger[_0xbb65('0x14')](_0xbb65('0xf'),_0x4aec73,_0x583aad['error'][_0xbb65('0x15')]);return _0xbead3(_0x583aad['error'][_0xbb65('0x15')]);}logger['error'](_0xbb65('0xf'),_0x4aec73,_0x583aad[_0xbb65('0x14')][_0xbb65('0x15')]);return _0x13860a(_0x583aad[_0xbb65('0x14')][_0xbb65('0x15')]);}else{logger[_0xbb65('0xe')](_0xbb65('0xf'),_0x4aec73,_0xbb65('0x10'));_0x13860a(_0x583aad[_0xbb65('0x16')][_0xbb65('0x15')]);}})[_0xbb65('0x17')](function(_0x3fe5a0){logger[_0xbb65('0x14')](_0xbb65('0xf'),_0x4aec73,_0x3fe5a0);_0xbead3(_0x3fe5a0);});});}exports[_0xbb65('0x18')]=function(_0x56a183){var _0x2ff328=this;return new Promise(function(_0x16f230,_0x5ce84f){return db[_0xbb65('0x19')][_0xbb65('0x1a')](_0x56a183[_0xbb65('0x1b')],{'raw':_0x56a183[_0xbb65('0x1c')]?_0x56a183[_0xbb65('0x1c')][_0xbb65('0x1d')]===undefined?!![]:![]:!![]})[_0xbb65('0xd')](function(_0x2684ad){logger[_0xbb65('0xe')](_0xbb65('0x18'),_0x56a183);logger[_0xbb65('0x11')](_0xbb65('0x18'),_0x56a183,JSON[_0xbb65('0x1e')](_0x2684ad));_0x16f230(_0x2684ad);})['catch'](function(_0x43f9b5){logger[_0xbb65('0x14')](_0xbb65('0x18'),_0x43f9b5[_0xbb65('0x15')],_0x56a183);_0x5ce84f(_0x2ff328[_0xbb65('0x14')](0x1f4,_0x43f9b5['message']));});});};exports[_0xbb65('0x1f')]=function(_0x4563c5){var _0xa05364=this;return new Promise(function(_0x422721,_0x55876f){return db[_0xbb65('0x19')][_0xbb65('0x20')](_0x4563c5[_0xbb65('0x1b')],{'raw':_0x4563c5[_0xbb65('0x1c')]?_0x4563c5['options'][_0xbb65('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4563c5['options']?_0x4563c5['options']['where']||null:null,'attributes':_0x4563c5[_0xbb65('0x1c')]?_0x4563c5[_0xbb65('0x1c')][_0xbb65('0x21')]||null:null,'limit':_0x4563c5[_0xbb65('0x1c')]?_0x4563c5[_0xbb65('0x1c')][_0xbb65('0x22')]||null:null})[_0xbb65('0xd')](function(_0x265e61){logger[_0xbb65('0xe')](_0xbb65('0x1f'),_0x4563c5);logger[_0xbb65('0x11')](_0xbb65('0x1f'),_0x4563c5,JSON[_0xbb65('0x1e')](_0x265e61));_0x422721(_0x265e61);})[_0xbb65('0x17')](function(_0x5f2e59){logger['error'](_0xbb65('0x1f'),_0x5f2e59[_0xbb65('0x15')],_0x4563c5);_0x55876f(_0xa05364['error'](0x1f4,_0x5f2e59[_0xbb65('0x15')]));});});}; \ No newline at end of file +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 diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 5c09a59..acab003 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 _0xca93=['/:id','destroy','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','create','put','update','delete'];(function(_0x1c6cd6,_0x3ecf9e){var _0x104fef=function(_0x23e985){while(--_0x23e985){_0x1c6cd6['push'](_0x1c6cd6['shift']());}};_0x104fef(++_0x3ecf9e);}(_0xca93,0x158));var _0x3ca9=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xca93[_0x47b58b];return _0x46bebe;};'use strict';var multer=require(_0x3ca9('0x0'));var util=require(_0x3ca9('0x1'));var path=require(_0x3ca9('0x2'));var timeout=require('connect-timeout');var express=require(_0x3ca9('0x3'));var router=express[_0x3ca9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3ca9('0x5'));var config=require(_0x3ca9('0x6'));var controller=require(_0x3ca9('0x7'));router[_0x3ca9('0x8')]('/',auth[_0x3ca9('0x9')](),controller['index']);router['get'](_0x3ca9('0xa'),auth[_0x3ca9('0x9')](),controller[_0x3ca9('0xb')]);router[_0x3ca9('0x8')]('/:id',auth[_0x3ca9('0x9')](),controller[_0x3ca9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ca9('0xd')]);router[_0x3ca9('0xe')]('/:id',auth[_0x3ca9('0x9')](),controller[_0x3ca9('0xf')]);router[_0x3ca9('0x10')](_0x3ca9('0x11'),auth[_0x3ca9('0x9')](),controller[_0x3ca9('0x12')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 99f1eb8..24435ef 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(_0xcf8d3a,_0x35575a){var _0x206211=function(_0x5c3bd3){while(--_0x5c3bd3){_0xcf8d3a['push'](_0xcf8d3a['shift']());}};_0x206211(++_0x35575a);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2ac4af,_0x288c53){_0x2ac4af=_0x2ac4af-0x0;var _0x3a36df=_0xcb91[_0x2ac4af];return _0x3a36df;};'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 _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 diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 7059c54..bc37e57 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 _0xbfe1=['crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','reject','save','update','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','ChatTransferReport','rows','catch','show','fields','include','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0xbfe1,0xc9));var _0x1bfe=function(_0x90652c,_0x1f9a91){_0x90652c=_0x90652c-0x0;var _0x37c89c=_0xbfe1[_0x90652c];return _0x37c89c;};'use strict';var emlformat=require(_0x1bfe('0x0'));var rimraf=require(_0x1bfe('0x1'));var zipdir=require(_0x1bfe('0x2'));var jsonpatch=require(_0x1bfe('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1bfe('0x4'));var Mustache=require(_0x1bfe('0x5'));var util=require(_0x1bfe('0x6'));var path=require(_0x1bfe('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1bfe('0x8'));var fs=require('fs');var fs_extra=require(_0x1bfe('0x9'));var _=require(_0x1bfe('0xa'));var squel=require(_0x1bfe('0xb'));var crypto=require(_0x1bfe('0xc'));var jsforce=require(_0x1bfe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1bfe('0xe'));var querystring=require(_0x1bfe('0xf'));var Papa=require(_0x1bfe('0x10'));var Redis=require(_0x1bfe('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1bfe('0x12'));var as=require(_0x1bfe('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1bfe('0x14'));var utils=require(_0x1bfe('0x15'));var config=require(_0x1bfe('0x16'));var licenseUtil=require(_0x1bfe('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x398bf8,_0x236579){_0x236579=_0x236579||0xcc;return function(_0x272cb4){if(_0x272cb4){return _0x398bf8[_0x1bfe('0x18')](_0x236579);}return _0x398bf8[_0x1bfe('0x19')](_0x236579)[_0x1bfe('0x1a')]();};}function respondWithResult(_0xf53c0c,_0x3c292e){_0x3c292e=_0x3c292e||0xc8;return function(_0x44a8b6){if(_0x44a8b6){return _0xf53c0c['status'](_0x3c292e)[_0x1bfe('0x1b')](_0x44a8b6);}};}function respondWithFilteredResult(_0x2bac45,_0x546acc){return function(_0x54ff37){if(_0x54ff37){var _0x3e4ffc=typeof _0x546acc[_0x1bfe('0x1c')]==='undefined'&&typeof _0x546acc['limit']===_0x1bfe('0x1d');var _0x3dd8cb=_0x54ff37[_0x1bfe('0x1e')];var _0x2df974=_0x3e4ffc?0x0:_0x546acc[_0x1bfe('0x1c')];var _0x4d12d0=_0x3e4ffc?_0x54ff37[_0x1bfe('0x1e')]:_0x546acc['offset']+_0x546acc['limit'];var _0x1943e5;if(_0x4d12d0>=_0x3dd8cb){_0x4d12d0=_0x3dd8cb;_0x1943e5=0xc8;}else{_0x1943e5=0xce;}_0x2bac45['status'](_0x1943e5);return _0x2bac45['set'](_0x1bfe('0x1f'),_0x2df974+'-'+_0x4d12d0+'/'+_0x3dd8cb)[_0x1bfe('0x1b')](_0x54ff37);}return null;};}function patchUpdates(_0x3f9d85){return function(_0x3f5311){try{jsonpatch['apply'](_0x3f5311,_0x3f9d85,!![]);}catch(_0xbcb2ee){return BPromise[_0x1bfe('0x20')](_0xbcb2ee);}return _0x3f5311[_0x1bfe('0x21')]();};}function saveUpdates(_0x744112,_0x5bc630){return function(_0x401d92){if(_0x401d92){return _0x401d92[_0x1bfe('0x22')](_0x744112)['then'](function(_0x1f21f2){return _0x1f21f2;});}return null;};}function removeEntity(_0x34f9c5,_0x930c14){return function(_0x26fc55){if(_0x26fc55){return _0x26fc55['destroy']()['then'](function(){_0x34f9c5['status'](0xcc)[_0x1bfe('0x1a')]();});}};}function handleEntityNotFound(_0x508432,_0x453e2d){return function(_0x5d6c29){if(!_0x5d6c29){_0x508432[_0x1bfe('0x18')](0x194);}return _0x5d6c29;};}function handleError(_0x34d5f7,_0x388290){_0x388290=_0x388290||0x1f4;return function(_0x159251){logger['error'](_0x159251[_0x1bfe('0x23')]);if(_0x159251[_0x1bfe('0x24')]){delete _0x159251[_0x1bfe('0x24')];}_0x34d5f7[_0x1bfe('0x19')](_0x388290)[_0x1bfe('0x25')](_0x159251);};}exports[_0x1bfe('0x26')]=function(_0x4295d3,_0x5e77e6){var _0x5c62f2={},_0x599aa8={},_0x8cd4f5={'count':0x0,'rows':[]};var _0x265e94=_[_0x1bfe('0x27')](db['ChatTransferReport'][_0x1bfe('0x28')],function(_0x4ec435){return{'name':_0x4ec435['fieldName'],'type':_0x4ec435[_0x1bfe('0x29')]['key']};});_0x599aa8[_0x1bfe('0x2a')]=_['map'](_0x265e94,_0x1bfe('0x24'));_0x599aa8[_0x1bfe('0x2b')]=_[_0x1bfe('0x2c')](_0x4295d3[_0x1bfe('0x2b')]);_0x599aa8[_0x1bfe('0x2d')]=_[_0x1bfe('0x2e')](_0x599aa8['model'],_0x599aa8['query']);_0x5c62f2[_0x1bfe('0x2f')]=_[_0x1bfe('0x2e')](_0x599aa8[_0x1bfe('0x2a')],qs['fields'](_0x4295d3[_0x1bfe('0x2b')]['fields']));_0x5c62f2[_0x1bfe('0x2f')]=_0x5c62f2[_0x1bfe('0x2f')][_0x1bfe('0x30')]?_0x5c62f2[_0x1bfe('0x2f')]:_0x599aa8[_0x1bfe('0x2a')];if(!_0x4295d3['query']['hasOwnProperty']('nolimit')){_0x5c62f2[_0x1bfe('0x31')]=qs[_0x1bfe('0x31')](_0x4295d3['query'][_0x1bfe('0x31')]);_0x5c62f2[_0x1bfe('0x1c')]=qs[_0x1bfe('0x1c')](_0x4295d3[_0x1bfe('0x2b')]['offset']);}_0x5c62f2[_0x1bfe('0x32')]=qs['sort'](_0x4295d3['query'][_0x1bfe('0x33')]);_0x5c62f2[_0x1bfe('0x34')]=qs['filters'](_[_0x1bfe('0x35')](_0x4295d3['query'],_0x599aa8['filters']),_0x265e94);if(_0x4295d3[_0x1bfe('0x2b')][_0x1bfe('0x36')]){_0x5c62f2[_0x1bfe('0x34')]=_[_0x1bfe('0x37')](_0x5c62f2[_0x1bfe('0x34')],{'$or':_['map'](_0x265e94,function(_0x4ea208){if(_0x4ea208[_0x1bfe('0x29')]!==_0x1bfe('0x38')){var _0xc104fc={};_0xc104fc[_0x4ea208[_0x1bfe('0x24')]]={'$like':'%'+_0x4295d3[_0x1bfe('0x2b')][_0x1bfe('0x36')]+'%'};return _0xc104fc;}})});}_0x5c62f2=_[_0x1bfe('0x37')]({},_0x5c62f2,_0x4295d3[_0x1bfe('0x39')]);var _0x32726f={'where':_0x5c62f2[_0x1bfe('0x34')]};return db['ChatTransferReport']['count'](_0x32726f)[_0x1bfe('0x3a')](function(_0x3888cf){_0x8cd4f5['count']=_0x3888cf;if(_0x4295d3[_0x1bfe('0x2b')][_0x1bfe('0x3b')]){_0x5c62f2['include']=[{'all':!![]}];}return db[_0x1bfe('0x3c')]['findAll'](_0x5c62f2);})[_0x1bfe('0x3a')](function(_0xc7d843){_0x8cd4f5[_0x1bfe('0x3d')]=_0xc7d843;return _0x8cd4f5;})[_0x1bfe('0x3a')](respondWithFilteredResult(_0x5e77e6,_0x5c62f2))[_0x1bfe('0x3e')](handleError(_0x5e77e6,null));};exports[_0x1bfe('0x3f')]=function(_0x1be477,_0x4263bc){var _0x2853ec={'raw':!![],'where':{'id':_0x1be477['params']['id']}},_0x30bbcd={};_0x30bbcd['model']=_[_0x1bfe('0x2c')](db['ChatTransferReport'][_0x1bfe('0x28')]);_0x30bbcd[_0x1bfe('0x2b')]=_[_0x1bfe('0x2c')](_0x1be477[_0x1bfe('0x2b')]);_0x30bbcd[_0x1bfe('0x2d')]=_[_0x1bfe('0x2e')](_0x30bbcd[_0x1bfe('0x2a')],_0x30bbcd['query']);_0x2853ec['attributes']=_[_0x1bfe('0x2e')](_0x30bbcd[_0x1bfe('0x2a')],qs[_0x1bfe('0x40')](_0x1be477['query']['fields']));_0x2853ec[_0x1bfe('0x2f')]=_0x2853ec[_0x1bfe('0x2f')][_0x1bfe('0x30')]?_0x2853ec[_0x1bfe('0x2f')]:_0x30bbcd[_0x1bfe('0x2a')];if(_0x1be477[_0x1bfe('0x2b')][_0x1bfe('0x3b')]){_0x2853ec[_0x1bfe('0x41')]=[{'all':!![]}];}_0x2853ec=_[_0x1bfe('0x37')]({},_0x2853ec,_0x1be477[_0x1bfe('0x39')]);return db[_0x1bfe('0x3c')]['find'](_0x2853ec)['then'](handleEntityNotFound(_0x4263bc,null))['then'](respondWithResult(_0x4263bc,null))[_0x1bfe('0x3e')](handleError(_0x4263bc,null));};exports['create']=function(_0x6e5065,_0x42aca2){return db[_0x1bfe('0x3c')][_0x1bfe('0x42')](_0x6e5065['body'],{})[_0x1bfe('0x3a')](respondWithResult(_0x42aca2,0xc9))[_0x1bfe('0x3e')](handleError(_0x42aca2,null));};exports[_0x1bfe('0x22')]=function(_0x3b7f95,_0x47811c){if(_0x3b7f95['body']['id']){delete _0x3b7f95[_0x1bfe('0x43')]['id'];}return db[_0x1bfe('0x3c')][_0x1bfe('0x44')]({'where':{'id':_0x3b7f95[_0x1bfe('0x45')]['id']}})[_0x1bfe('0x3a')](handleEntityNotFound(_0x47811c,null))[_0x1bfe('0x3a')](saveUpdates(_0x3b7f95['body'],null))['then'](respondWithResult(_0x47811c,null))[_0x1bfe('0x3e')](handleError(_0x47811c,null));};exports['destroy']=function(_0x2a8674,_0x1029e5){return db[_0x1bfe('0x3c')][_0x1bfe('0x44')]({'where':{'id':_0x2a8674[_0x1bfe('0x45')]['id']}})[_0x1bfe('0x3a')](handleEntityNotFound(_0x1029e5,null))['then'](removeEntity(_0x1029e5,null))[_0x1bfe('0x3e')](handleError(_0x1029e5,null));};exports[_0x1bfe('0x46')]=function(_0x2d3d10,_0x47c27a){return db[_0x1bfe('0x3c')]['describe']()[_0x1bfe('0x3a')](respondWithResult(_0x47c27a,null))[_0x1bfe('0x3e')](handleError(_0x47c27a,null));}; \ No newline at end of file +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 diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 4c3bff3..b65ef8f 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 _0xac23=['path','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash','util','api','moment','request-promise'];(function(_0x242460,_0x236a05){var _0x3c5d7a=function(_0x52a030){while(--_0x52a030){_0x242460['push'](_0x242460['shift']());}};_0x3c5d7a(++_0x236a05);}(_0xac23,0x1be));var _0x3ac2=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xac23[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x3ac2('0x0'));var util=require(_0x3ac2('0x1'));var logger=require('../../config/logger')(_0x3ac2('0x2'));var moment=require(_0x3ac2('0x3'));var BPromise=require('bluebird');var rp=require(_0x3ac2('0x4'));var fs=require('fs');var path=require(_0x3ac2('0x5'));var rimraf=require(_0x3ac2('0x6'));var config=require('../../config/environment');var attributes=require(_0x3ac2('0x7'));module[_0x3ac2('0x8')]=function(_0x1ce000,_0x37fa03){return _0x1ce000['define'](_0x3ac2('0x9'),attributes,{'tableName':_0x3ac2('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index b5a6acb..f6b5f75 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 _0x5bf8=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatTransferReport,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x34fb63,_0x37056e){var _0x31dec3=function(_0x5b37f1){while(--_0x5b37f1){_0x34fb63['push'](_0x34fb63['shift']());}};_0x31dec3(++_0x37056e);}(_0x5bf8,0x84));var _0x85bf=function(_0x7eee7,_0x3779a1){_0x7eee7=_0x7eee7-0x0;var _0x469f62=_0x5bf8[_0x7eee7];return _0x469f62;};'use strict';var _=require(_0x85bf('0x0'));var util=require(_0x85bf('0x1'));var moment=require(_0x85bf('0x2'));var BPromise=require(_0x85bf('0x3'));var rs=require(_0x85bf('0x4'));var fs=require('fs');var Redis=require(_0x85bf('0x5'));var db=require(_0x85bf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x85bf('0x7'))(_0x85bf('0x8'));var config=require(_0x85bf('0x9'));var jayson=require(_0x85bf('0xa'));var client=jayson[_0x85bf('0xb')][_0x85bf('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x556347,_0x2d8d60,_0x175d4c){return new BPromise(function(_0x121229,_0x5ec41c){return client[_0x85bf('0xd')](_0x556347,_0x175d4c)[_0x85bf('0xe')](function(_0x1e4d4a){logger[_0x85bf('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2d8d60,_0x85bf('0x10'));logger[_0x85bf('0x11')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2d8d60,'request\x20sent',JSON[_0x85bf('0x12')](_0x1e4d4a));if(_0x1e4d4a[_0x85bf('0x13')]){if(_0x1e4d4a[_0x85bf('0x13')][_0x85bf('0x14')]===0x1f4){logger[_0x85bf('0x13')](_0x85bf('0x15'),_0x2d8d60,_0x1e4d4a['error'][_0x85bf('0x16')]);return _0x5ec41c(_0x1e4d4a['error'][_0x85bf('0x16')]);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x2d8d60,_0x1e4d4a[_0x85bf('0x13')]['message']);return _0x121229(_0x1e4d4a[_0x85bf('0x13')][_0x85bf('0x16')]);}else{logger[_0x85bf('0xf')](_0x85bf('0x15'),_0x2d8d60,'request\x20sent');_0x121229(_0x1e4d4a['result'][_0x85bf('0x16')]);}})['catch'](function(_0x2fbd83){logger[_0x85bf('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x2d8d60,_0x2fbd83);_0x5ec41c(_0x2fbd83);});});} \ No newline at end of file +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 diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 9879727..54d93d8 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 _0x3281=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','update','delete','/:id','exports','multer','util'];(function(_0x35f9dc,_0x20569c){var _0x6502dd=function(_0x5f0740){while(--_0x5f0740){_0x35f9dc['push'](_0x35f9dc['shift']());}};_0x6502dd(++_0x20569c);}(_0x3281,0x185));var _0x1328=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x3281[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x1328('0x0'));var util=require(_0x1328('0x1'));var path=require('path');var timeout=require(_0x1328('0x2'));var express=require(_0x1328('0x3'));var router=express[_0x1328('0x4')]();var fs_extra=require(_0x1328('0x5'));var auth=require(_0x1328('0x6'));var interaction=require(_0x1328('0x7'));var config=require(_0x1328('0x8'));var controller=require(_0x1328('0x9'));router[_0x1328('0xa')]('/',auth['isAuthenticated'](),controller[_0x1328('0xb')]);router[_0x1328('0xa')](_0x1328('0xc'),auth[_0x1328('0xd')](),controller[_0x1328('0xe')]);router[_0x1328('0xa')]('/:id',auth[_0x1328('0xd')](),controller[_0x1328('0xf')]);router[_0x1328('0x10')]('/',auth[_0x1328('0xd')](),controller[_0x1328('0x11')]);router[_0x1328('0x12')]('/:id',auth[_0x1328('0xd')](),controller[_0x1328('0x13')]);router[_0x1328('0x14')](_0x1328('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x1328('0x16')]=router; \ No newline at end of file +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 diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index f7a3dfd..3756e57 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 _0x9fd4=['name','text','getDataValue','onlineForm','parse','setDataValue','stringify','Comments','offlineForm','generate','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','STRING','address','email','Agent','#ffffff','INTEGER','BOOLEAN','rounded','squared','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Skip','Feedback','ENUM','thumb','star','input'];(function(_0x39d980,_0x15c127){var _0x33fcbc=function(_0x32548a){while(--_0x32548a){_0x39d980['push'](_0x39d980['shift']());}};_0x33fcbc(++_0x15c127);}(_0x9fd4,0xd6));var _0x49fd=function(_0x29d34a,_0x3632d9){_0x29d34a=_0x29d34a-0x0;var _0x4baaa8=_0x9fd4[_0x29d34a];return _0x4baaa8;};'use strict';var Sequelize=require(_0x49fd('0x0'));var rs=require(_0x49fd('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'unique':_0x49fd('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x4')},'mapKeyOffline':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x4')},'key':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x5')},'customerAlias':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49fd('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x49fd('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x49fd('0x2')]},'animation':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x49fd('0x9'),_0x49fd('0xa')),'defaultValue':_0x49fd('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x49fd('0xb')},'start_chat_button':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xc')},'offline_chat_button':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xd')},'header_offline':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xe')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x49fd('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x11')},'noteTitle':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x12')},'placeholderMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x13')},'closingMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xd')},'skipMessageButton':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x14')},'conditionAgreement':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x15')},'ratingType':{'type':Sequelize[_0x49fd('0x16')]('star',_0x49fd('0x17')),'defaultValue':_0x49fd('0x18')},'ratingStarsNumber':{'type':Sequelize[_0x49fd('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x49fd('0x19'),'variable':null,'config':{'placeholder':_0x49fd('0x1a'),'type':_0x49fd('0x1b'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x49fd('0x19'),'props':{'title':_0x49fd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x49fd('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x49fd('0x1c')](_0x49fd('0x1d'))?JSON[_0x49fd('0x1e')](this[_0x49fd('0x1c')](_0x49fd('0x1d'))):{};},'set':function(_0x44a808){return this[_0x49fd('0x1f')](_0x49fd('0x1d'),JSON[_0x49fd('0x20')](_0x44a808));}},'offlineForm':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':function(){return JSON[_0x49fd('0x20')]({'items':[{'type':'input','props':{'title':_0x49fd('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x49fd('0x4'),'type':_0x49fd('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':'Comments'},'props':{'title':_0x49fd('0x21'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x49fd('0x1c')]('offlineForm')?JSON[_0x49fd('0x1e')](this[_0x49fd('0x1c')](_0x49fd('0x22'))):{};},'set':function(_0x3853ee){return this[_0x49fd('0x1f')](_0x49fd('0x22'),JSON[_0x49fd('0x20')](_0x3853ee));}},'token':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':function(){return rs[_0x49fd('0x23')]();}},'autoclose':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x49fd('0x2')]},'forwardOffline':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x49fd('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x24')},'offlineMessageBody':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x26')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x49fd('0x14')},'sendUnmanaged':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x49fd('0xf')]},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x49fd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':function(){return _0x49fd('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x49fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x49fd('0x29')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x49fd('0x2')]},'customerAvatar':{'type':Sequelize[_0x49fd('0xf')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x49fd('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x49fd('0x2')],'allowNull':![],'defaultValue':_0x49fd('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x49fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x49fd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':_0x49fd('0x2b')},'systemAvatar':{'type':Sequelize[_0x49fd('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x49fd('0x7')],'comment':_0x49fd('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x49fd('0x8')],'defaultValue':![],'comment':_0x49fd('0x2d'),'set':function(_0x41c35b){if(!_0x41c35b)this[_0x49fd('0x1f')]('mandatoryDispositionPauseId',null);this[_0x49fd('0x1f')](_0x49fd('0x2e'),_0x41c35b);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x49fd('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x49fd('0x2f')},'vidaooNote':{'type':Sequelize[_0x49fd('0x2')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0x49fd('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x49fd('0xf')]}}; \ No newline at end of file +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 diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 8d139c5..593f11e 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 _0x606d=['status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','ChatWebsites','UserProfileResource','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','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','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','addLogo','sitepic','file','addAvatar','agentAvatar','customerAvatar','filename','addSystemAvatar','systemAvatar','join','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','asc','defaults','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','device','vendor','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','Start','startRouting','EventManager','files','send','from\x20is\x20mandatory','mapKeyOffline','includes','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','indexOf','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','push','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','verticalAlignment','textColor','backgroundColor','addApplications','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus'];(function(_0xa0cd21,_0x2be706){var _0x34a84e=function(_0x3cbf1b){while(--_0x3cbf1b){_0xa0cd21['push'](_0xa0cd21['shift']());}};_0x34a84e(++_0x2be706);}(_0x606d,0x107));var _0xd606=function(_0x4f9691,_0x1f484d){_0x4f9691=_0x4f9691-0x0;var _0x57db23=_0x606d[_0x4f9691];return _0x57db23;};'use strict';var emlformat=require(_0xd606('0x0'));var rimraf=require(_0xd606('0x1'));var zipdir=require(_0xd606('0x2'));var jsonpatch=require(_0xd606('0x3'));var rp=require(_0xd606('0x4'));var moment=require('moment');var BPromise=require(_0xd606('0x5'));var Mustache=require('mustache');var util=require(_0xd606('0x6'));var path=require(_0xd606('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd606('0x8'));var fs=require('fs');var fs_extra=require(_0xd606('0x9'));var _=require(_0xd606('0xa'));var squel=require(_0xd606('0xb'));var crypto=require(_0xd606('0xc'));var jsforce=require(_0xd606('0xd'));var deskjs=require(_0xd606('0xe'));var toCsv=require(_0xd606('0xf'));var querystring=require(_0xd606('0x10'));var Papa=require('papaparse');var Redis=require(_0xd606('0x11'));var authService=require(_0xd606('0x12'));var qs=require(_0xd606('0x13'));var as=require(_0xd606('0x14'));var hardwareService=require(_0xd606('0x15'));var logger=require(_0xd606('0x16'))(_0xd606('0x17'));var utils=require(_0xd606('0x18'));var config=require(_0xd606('0x19'));var licenseUtil=require(_0xd606('0x1a'));var db=require(_0xd606('0x1b'))['db'];config[_0xd606('0x1c')]=_['defaults'](config[_0xd606('0x1c')],{'host':_0xd606('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd606('0x1e'))[_0xd606('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd606('0x20')][_0xd606('0x21')]({'port':0x232c});var client9002=jayson[_0xd606('0x20')][_0xd606('0x21')]({'port':0x232a});var client9003=jayson[_0xd606('0x20')]['http']({'port':0x232b});var client9001=jayson['client'][_0xd606('0x21')]({'port':0x2329});function respondWithRpcPromise(_0xe6cde1,_0x5d0634,_0x410340,_0x2432c1){return new BPromise(function(_0x4ed9e3,_0x1a1486){var _0xa93e86=_0x2432c1||client;return _0xa93e86[_0xd606('0x22')](_0xe6cde1,_0x410340)[_0xd606('0x23')](function(_0x16efc4){logger[_0xd606('0x24')](_0xd606('0x25'),_0x5d0634,_0xd606('0x26'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5d0634,_0xd606('0x26'),JSON[_0xd606('0x27')](_0x16efc4));if(_0x16efc4[_0xd606('0x28')]){if(_0x16efc4[_0xd606('0x28')][_0xd606('0x29')]===0x1f4){logger[_0xd606('0x28')](_0xd606('0x25'),_0x5d0634,_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);return _0x1a1486(_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);}logger['error'](_0xd606('0x25'),_0x5d0634,_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);return _0x4ed9e3(_0x16efc4[_0xd606('0x28')][_0xd606('0x2a')]);}else{logger['info'](_0xd606('0x25'),_0x5d0634,'request\x20sent');_0x4ed9e3(_0x16efc4[_0xd606('0x2b')]['message']);}})[_0xd606('0x2c')](function(_0x4ac1e2){logger[_0xd606('0x28')](_0xd606('0x25'),_0x5d0634,_0x4ac1e2);_0x1a1486(_0x4ac1e2);});});}function respondWithStatusCode(_0x40ee07,_0x8bd17f){_0x8bd17f=_0x8bd17f||0xcc;return function(_0x3e5f7d){if(_0x3e5f7d){return _0x40ee07[_0xd606('0x2d')](_0x8bd17f);}return _0x40ee07[_0xd606('0x2e')](_0x8bd17f)[_0xd606('0x2f')]();};}function respondWithResult(_0x3a0c75,_0x293bdb){_0x293bdb=_0x293bdb||0xc8;return function(_0x3321c5){if(_0x3321c5){return _0x3a0c75[_0xd606('0x2e')](_0x293bdb)[_0xd606('0x30')](_0x3321c5);}};}function respondWithFilteredResult(_0x548525,_0x36bc88){return function(_0x4f8081){if(_0x4f8081){var _0x429602=typeof _0x36bc88[_0xd606('0x31')]==='undefined'&&typeof _0x36bc88[_0xd606('0x32')]===_0xd606('0x33');var _0x4c665b=_0x4f8081[_0xd606('0x34')];var _0x3d71ce=_0x429602?0x0:_0x36bc88['offset'];var _0x12ea61=_0x429602?_0x4f8081[_0xd606('0x34')]:_0x36bc88['offset']+_0x36bc88[_0xd606('0x32')];var _0x5440f9;if(_0x12ea61>=_0x4c665b){_0x12ea61=_0x4c665b;_0x5440f9=0xc8;}else{_0x5440f9=0xce;}_0x548525[_0xd606('0x2e')](_0x5440f9);return _0x548525['set'](_0xd606('0x35'),_0x3d71ce+'-'+_0x12ea61+'/'+_0x4c665b)['json'](_0x4f8081);}return null;};}function patchUpdates(_0x4a01a7){return function(_0x4d81f9){try{jsonpatch[_0xd606('0x36')](_0x4d81f9,_0x4a01a7,!![]);}catch(_0x1db1e8){return BPromise[_0xd606('0x37')](_0x1db1e8);}return _0x4d81f9[_0xd606('0x38')]();};}function saveUpdates(_0x229fa7,_0x4daead){return function(_0x5dcdf8){if(_0x5dcdf8){return _0x5dcdf8[_0xd606('0x39')](_0x229fa7)[_0xd606('0x23')](function(_0x1e8c1e){return _0x1e8c1e;});}return null;};}function removeEntity(_0x56ec00,_0x34a97d){return function(_0x377cd6){if(_0x377cd6){return _0x377cd6[_0xd606('0x3a')]()['then'](function(){var _0x386d09=_0x377cd6['get']({'plain':!![]});var _0xa8a808=_0xd606('0x3b');return db[_0xd606('0x3c')][_0xd606('0x3a')]({'where':{'type':_0xa8a808,'resourceId':_0x386d09['id']}})[_0xd606('0x23')](function(){return _0x377cd6;});})['then'](function(){_0x56ec00['status'](0xcc)[_0xd606('0x2f')]();});}};}function handleEntityNotFound(_0xfc807e,_0x39e356){return function(_0x4f89ab){if(!_0x4f89ab){_0xfc807e[_0xd606('0x2d')](0x194);}return _0x4f89ab;};}function handleError(_0x270646,_0x339d65){_0x339d65=_0x339d65||0x1f4;return function(_0x184bfc){logger[_0xd606('0x28')](_0x184bfc['stack']);if(_0x184bfc['name']){delete _0x184bfc[_0xd606('0x3d')];}_0x270646[_0xd606('0x2e')](_0x339d65)['send'](_0x184bfc);};}exports[_0xd606('0x3e')]=function(_0x4800f5,_0x559716){var _0x2e3ecc={'include':[{'model':db[_0xd606('0x3f')],'as':_0xd606('0x40')}]},_0x558148={},_0xfac3b1={'count':0x0,'rows':[]};var _0x903811=_[_0xd606('0x41')](db[_0xd606('0x42')][_0xd606('0x43')],function(_0x3690c3){return{'name':_0x3690c3[_0xd606('0x44')],'type':_0x3690c3[_0xd606('0x45')][_0xd606('0x46')]};});_0x558148['model']=_[_0xd606('0x41')](_0x903811,_0xd606('0x3d'));_0x558148[_0xd606('0x47')]=_[_0xd606('0x48')](_0x4800f5[_0xd606('0x47')]);_0x558148[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x558148['model'],_0x558148[_0xd606('0x47')]);_0x2e3ecc[_0xd606('0x4b')]=_[_0xd606('0x4a')](_0x558148[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x4800f5[_0xd606('0x47')][_0xd606('0x4d')]));_0x2e3ecc['attributes']=_0x2e3ecc[_0xd606('0x4b')][_0xd606('0x4e')]?_0x2e3ecc[_0xd606('0x4b')]:_0x558148[_0xd606('0x4c')];if(!_0x4800f5[_0xd606('0x47')][_0xd606('0x4f')](_0xd606('0x50'))){_0x2e3ecc[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x4800f5['query'][_0xd606('0x32')]);_0x2e3ecc[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x4800f5[_0xd606('0x47')][_0xd606('0x31')]);}_0x2e3ecc[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x4800f5['query']['sort']);_0x2e3ecc[_0xd606('0x53')]=qs[_0xd606('0x49')](_['pick'](_0x4800f5['query'],_0x558148[_0xd606('0x49')]),_0x903811);if(_0x4800f5[_0xd606('0x47')][_0xd606('0x54')]){_0x2e3ecc[_0xd606('0x53')]=_[_0xd606('0x55')](_0x2e3ecc[_0xd606('0x53')],{'$or':_['map'](_0x903811,function(_0x2648c0){if(_0x2648c0['type']!==_0xd606('0x56')){var _0x2efefe={};_0x2efefe[_0x2648c0[_0xd606('0x3d')]]={'$like':'%'+_0x4800f5[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x2efefe;}})});}_0x2e3ecc=_[_0xd606('0x55')]({},_0x2e3ecc,_0x4800f5[_0xd606('0x57')]);var _0x1cf9b4={'where':_0x2e3ecc[_0xd606('0x53')]};return db[_0xd606('0x42')][_0xd606('0x34')](_0x1cf9b4)[_0xd606('0x23')](function(_0x19ef69){_0xfac3b1[_0xd606('0x34')]=_0x19ef69;if(_0x4800f5[_0xd606('0x47')][_0xd606('0x58')]){_0x2e3ecc[_0xd606('0x59')]=[{'all':!![]}];}return db[_0xd606('0x42')][_0xd606('0x5a')](_0x2e3ecc);})['then'](function(_0x1e9654){_0xfac3b1[_0xd606('0x5b')]=_0x1e9654;return _0xfac3b1;})[_0xd606('0x23')](respondWithFilteredResult(_0x559716,_0x2e3ecc))[_0xd606('0x2c')](handleError(_0x559716,null));};exports['show']=function(_0x25ab59,_0x258c7d){var _0x6d1798={'raw':![],'where':{'id':_0x25ab59[_0xd606('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1328fa={};_0x1328fa[_0xd606('0x4c')]=_['keys'](db[_0xd606('0x42')][_0xd606('0x43')]);_0x1328fa[_0xd606('0x47')]=_[_0xd606('0x48')](_0x25ab59['query']);_0x1328fa[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x1328fa['model'],_0x1328fa[_0xd606('0x47')]);_0x6d1798[_0xd606('0x4b')]=_['intersection'](_0x1328fa[_0xd606('0x4c')],qs['fields'](_0x25ab59[_0xd606('0x47')][_0xd606('0x4d')]));_0x6d1798[_0xd606('0x4b')]=_0x6d1798[_0xd606('0x4b')][_0xd606('0x4e')]?_0x6d1798[_0xd606('0x4b')]:_0x1328fa['model'];if(_0x25ab59['query'][_0xd606('0x58')]){_0x6d1798[_0xd606('0x59')]=[{'all':!![]}];}_0x6d1798=_[_0xd606('0x55')]({},_0x6d1798,_0x25ab59[_0xd606('0x57')]);return db[_0xd606('0x42')][_0xd606('0x5d')](_0x6d1798)[_0xd606('0x23')](handleEntityNotFound(_0x258c7d,null))[_0xd606('0x23')](respondWithResult(_0x258c7d,null))[_0xd606('0x2c')](handleError(_0x258c7d,null));};exports[_0xd606('0x5e')]=function(_0x2818f5,_0x1476e6){return db[_0xd606('0x42')][_0xd606('0x5e')](_0x2818f5[_0xd606('0x5f')],{})['then'](function(_0x30a6e7){var _0x33546d=_0x2818f5[_0xd606('0x60')][_0xd606('0x61')]({'plain':!![]});if(!_0x33546d)throw new Error(_0xd606('0x62'));if(_0x33546d[_0xd606('0x63')]===_0xd606('0x60')){var _0x25d72b=_0x30a6e7[_0xd606('0x61')]({'plain':!![]});var _0x129bb1=_0xd606('0x3b');return db[_0xd606('0x64')][_0xd606('0x5d')]({'where':{'name':_0x129bb1,'userProfileId':_0x33546d[_0xd606('0x65')]},'raw':!![]})['then'](function(_0x3549ef){if(_0x3549ef&&_0x3549ef[_0xd606('0x66')]===0x0){return db[_0xd606('0x3c')]['create']({'name':_0x25d72b[_0xd606('0x3d')],'resourceId':_0x25d72b['id'],'type':_0x3549ef[_0xd606('0x3d')],'sectionId':_0x3549ef['id']},{})[_0xd606('0x23')](function(){return _0x30a6e7;});}else{return _0x30a6e7;}})['catch'](function(_0x559802){logger['error'](_0xd606('0x67'),_0x559802);throw _0x559802;});}return _0x30a6e7;})['then'](respondWithResult(_0x1476e6,0xc9))[_0xd606('0x2c')](handleError(_0x1476e6,null));};exports['update']=function(_0x2cc9f8,_0x14ba36){if(_0x2cc9f8[_0xd606('0x5f')]['id']){delete _0x2cc9f8[_0xd606('0x5f')]['id'];}return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x2cc9f8['params']['id']},'include':[{'model':db['Pause'],'as':_0xd606('0x40')}]})[_0xd606('0x23')](handleEntityNotFound(_0x14ba36,null))[_0xd606('0x23')](saveUpdates(_0x2cc9f8[_0xd606('0x5f')],null))[_0xd606('0x23')](respondWithResult(_0x14ba36,null))['catch'](handleError(_0x14ba36,null));};exports[_0xd606('0x3a')]=function(_0x2be070,_0x221283){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x2be070[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x221283,null))[_0xd606('0x23')](removeEntity(_0x221283,null))[_0xd606('0x2c')](handleError(_0x221283,null));};exports['describe']=function(_0x202fe7,_0x5cc24b){return db[_0xd606('0x42')][_0xd606('0x68')]()['then'](respondWithResult(_0x5cc24b,null))['catch'](handleError(_0x5cc24b,null));};exports[_0xd606('0x69')]=function(_0x310343,_0x57b667,_0x20b3e1){if(_0x310343['body']['id']){delete _0x310343['body']['id'];}return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x310343[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x57b667,null))[_0xd606('0x23')](function(_0x5d0b48){if(_0x5d0b48){_0x310343[_0xd606('0x5f')][_0xd606('0x6a')]=_0x5d0b48['id'];return db[_0xd606('0x6b')][_0xd606('0x5e')](_0x310343['body']);}})[_0xd606('0x23')](respondWithResult(_0x57b667,null))[_0xd606('0x2c')](handleError(_0x57b667,null));};exports[_0xd606('0x6c')]=function(_0x43ab3f,_0x4a551e,_0x5d4d34){var _0x38a1f4={'raw':![],'where':{}};var _0x21f355={};var _0x159242={'count':0x0,'rows':[]};return db[_0xd606('0x42')]['findOne']({'where':{'id':_0x43ab3f[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x4a551e,null))['then'](function(_0xcf3d62){if(_0xcf3d62){_0x21f355['model']=_[_0xd606('0x48')](db[_0xd606('0x6b')][_0xd606('0x43')]);_0x21f355[_0xd606('0x47')]=_[_0xd606('0x48')](_0x43ab3f[_0xd606('0x47')]);_0x21f355[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x21f355[_0xd606('0x4c')],_0x21f355[_0xd606('0x47')]);_0x38a1f4['attributes']=_[_0xd606('0x4a')](_0x21f355[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x43ab3f['query'][_0xd606('0x4d')]));_0x38a1f4[_0xd606('0x4b')]=_0x38a1f4[_0xd606('0x4b')][_0xd606('0x4e')]?_0x38a1f4[_0xd606('0x4b')]:_0x21f355[_0xd606('0x4c')];if(!_0x43ab3f['query']['hasOwnProperty'](_0xd606('0x50'))){_0x38a1f4[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x43ab3f[_0xd606('0x47')][_0xd606('0x32')]);_0x38a1f4[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x43ab3f[_0xd606('0x47')][_0xd606('0x31')]);}_0x38a1f4[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x43ab3f[_0xd606('0x47')][_0xd606('0x52')]);_0x38a1f4['where']=qs[_0xd606('0x49')](_[_0xd606('0x6d')](_0x43ab3f['query'],_0x21f355['filters']));_0x38a1f4[_0xd606('0x53')][_0xd606('0x6a')]=_0xcf3d62['id'];if(_0x43ab3f[_0xd606('0x47')][_0xd606('0x54')]){_0x38a1f4[_0xd606('0x53')]=_['merge'](_0x38a1f4[_0xd606('0x53')],{'$or':_[_0xd606('0x41')](_0x38a1f4[_0xd606('0x4b')],function(_0x555f62){var _0x3735e9={};_0x3735e9[_0x555f62]={'$like':'%'+_0x43ab3f[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x3735e9;})});}_0x38a1f4=_[_0xd606('0x55')]({},_0x38a1f4,_0x43ab3f[_0xd606('0x57')]);return db[_0xd606('0x6b')]['count']({'where':_0x38a1f4[_0xd606('0x53')]})[_0xd606('0x23')](function(_0x499a32){_0x159242[_0xd606('0x34')]=_0x499a32;if(_0x43ab3f[_0xd606('0x47')]['includeAll']){_0x38a1f4['include']=[{'all':!![]}];}return db[_0xd606('0x6b')][_0xd606('0x5a')](_0x38a1f4);})[_0xd606('0x23')](function(_0x4017db){_0x159242['rows']=_0x4017db;return _0x159242;});}})['then'](respondWithFilteredResult(_0x4a551e,_0x38a1f4))[_0xd606('0x2c')](handleError(_0x4a551e,null));};exports[_0xd606('0x6e')]=function(_0x42580d,_0x428738,_0x1ae93e){return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x42580d[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x428738,null))[_0xd606('0x23')](function(_0x33203f){if(_0x33203f){return _0x33203f[_0xd606('0x6e')](_0x42580d[_0xd606('0x47')][_0xd606('0x6f')]);}})[_0xd606('0x23')](respondWithStatusCode(_0x428738,null))[_0xd606('0x2c')](handleError(_0x428738,null));};exports[_0xd606('0x70')]=function(_0x61d4d9,_0x56c398,_0x5d9456){if(_0x61d4d9[_0xd606('0x5f')]['id']){delete _0x61d4d9[_0xd606('0x5f')]['id'];}return db[_0xd606('0x42')]['find']({'where':{'id':_0x61d4d9['params']['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x56c398,null))['then'](function(_0x4997f7){if(_0x4997f7){_0x61d4d9[_0xd606('0x5f')]['ChatWebsiteId']=_0x4997f7['id'];return db['CannedAnswer']['create'](_0x61d4d9[_0xd606('0x5f')]);}})[_0xd606('0x23')](respondWithResult(_0x56c398,null))[_0xd606('0x2c')](handleError(_0x56c398,null));};exports[_0xd606('0x71')]=function(_0x322f1a,_0x55e1b2,_0x21e753){var _0x551f2e={'raw':![],'where':{}};var _0x48ecf6={};var _0x2db95b={'count':0x0,'rows':[]};return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x322f1a[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x55e1b2,null))[_0xd606('0x23')](function(_0xd614c5){if(_0xd614c5){_0x48ecf6[_0xd606('0x4c')]=_['keys'](db[_0xd606('0x73')][_0xd606('0x43')]);_0x48ecf6['query']=_[_0xd606('0x48')](_0x322f1a['query']);_0x48ecf6[_0xd606('0x49')]=_['intersection'](_0x48ecf6[_0xd606('0x4c')],_0x48ecf6['query']);_0x551f2e['attributes']=_['intersection'](_0x48ecf6['model'],qs['fields'](_0x322f1a[_0xd606('0x47')][_0xd606('0x4d')]));_0x551f2e[_0xd606('0x4b')]=_0x551f2e['attributes'][_0xd606('0x4e')]?_0x551f2e[_0xd606('0x4b')]:_0x48ecf6[_0xd606('0x4c')];if(!_0x322f1a[_0xd606('0x47')][_0xd606('0x4f')](_0xd606('0x50'))){_0x551f2e[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x322f1a[_0xd606('0x47')][_0xd606('0x32')]);_0x551f2e[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x322f1a[_0xd606('0x47')]['offset']);}_0x551f2e[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x322f1a[_0xd606('0x47')][_0xd606('0x52')]);_0x551f2e[_0xd606('0x53')]=qs['filters'](_[_0xd606('0x6d')](_0x322f1a[_0xd606('0x47')],_0x48ecf6[_0xd606('0x49')]));_0x551f2e[_0xd606('0x53')]['ChatWebsiteId']=_0xd614c5['id'];if(_0x322f1a[_0xd606('0x47')][_0xd606('0x54')]){_0x551f2e[_0xd606('0x53')]=_[_0xd606('0x55')](_0x551f2e[_0xd606('0x53')],{'$or':_[_0xd606('0x41')](_0x551f2e[_0xd606('0x4b')],function(_0x222eca){var _0x3f97a5={};_0x3f97a5[_0x222eca]={'$like':'%'+_0x322f1a[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x3f97a5;})});}_0x551f2e=_[_0xd606('0x55')]({},_0x551f2e,_0x322f1a[_0xd606('0x57')]);return db['CannedAnswer'][_0xd606('0x34')]({'where':_0x551f2e['where']})['then'](function(_0x302916){_0x2db95b['count']=_0x302916;if(_0x322f1a[_0xd606('0x47')][_0xd606('0x58')]){_0x551f2e[_0xd606('0x59')]=[{'all':!![]}];}return db[_0xd606('0x73')][_0xd606('0x5a')](_0x551f2e);})[_0xd606('0x23')](function(_0x17453d){_0x2db95b[_0xd606('0x5b')]=_0x17453d;return _0x2db95b;});}})[_0xd606('0x23')](respondWithFilteredResult(_0x55e1b2,_0x551f2e))[_0xd606('0x2c')](handleError(_0x55e1b2,null));};exports['removeAnswers']=function(_0x49a450,_0x59e360,_0x247d0a){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x49a450[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x59e360,null))[_0xd606('0x23')](function(_0x3366ab){if(_0x3366ab){return _0x3366ab['removeAnswers'](_0x49a450[_0xd606('0x47')][_0xd606('0x6f')]);}})[_0xd606('0x23')](respondWithStatusCode(_0x59e360,null))[_0xd606('0x2c')](handleError(_0x59e360,null));};exports[_0xd606('0x74')]=function(_0x5259d2,_0x3b4313,_0x5bf49b){_0x5259d2['body'][_0xd606('0x75')]=_0x5259d2[_0xd606('0x76')]['filename'];return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x5259d2[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x3b4313,null))[_0xd606('0x23')](saveUpdates(_0x5259d2[_0xd606('0x5f')],null))[_0xd606('0x23')](respondWithResult(_0x3b4313,null))[_0xd606('0x2c')](handleError(_0x3b4313,null));};exports[_0xd606('0x77')]=function(_0x23a263,_0x776466,_0x49060d){_0x23a263[_0xd606('0x5f')][_0xd606('0x78')]=_0x23a263[_0xd606('0x76')]['filename'];return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x23a263[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x776466,null))[_0xd606('0x23')](saveUpdates(_0x23a263['body'],null))[_0xd606('0x23')](respondWithResult(_0x776466,null))[_0xd606('0x2c')](handleError(_0x776466,null));};exports['addCustomerAvatar']=function(_0x56a40b,_0x20db30,_0x4b7938){_0x56a40b['body'][_0xd606('0x79')]=_0x56a40b['file'][_0xd606('0x7a')];return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x56a40b[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x20db30,null))['then'](saveUpdates(_0x56a40b[_0xd606('0x5f')],null))[_0xd606('0x23')](respondWithResult(_0x20db30,null))['catch'](handleError(_0x20db30,null));};exports[_0xd606('0x7b')]=function(_0x5bca0a,_0x2ff16c,_0x3bb213){_0x5bca0a[_0xd606('0x5f')][_0xd606('0x7c')]=_0x5bca0a[_0xd606('0x76')][_0xd606('0x7a')];return db[_0xd606('0x42')]['find']({'where':{'id':_0x5bca0a[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x2ff16c,null))['then'](saveUpdates(_0x5bca0a[_0xd606('0x5f')],null))['then'](respondWithResult(_0x2ff16c,null))[_0xd606('0x2c')](handleError(_0x2ff16c,null));};exports['getLogo']=function(_0x367290,_0x2f4807,_0x49e024){var _0x52a7dc=path[_0xd606('0x7d')](config['root'],_0xd606('0x7e'));var _0x556ccf={'where':{'id':_0x367290['params']['id']},'attributes':['id',_0xd606('0x75')],'raw':!![]};var _0x892a9d=![];return require(_0xd606('0x1a'))[_0xd606('0x7f')]()[_0xd606('0x23')](function(_0x5a4c64){if(_0x5a4c64){_0x892a9d=_0x5a4c64[_0xd606('0x80')];}})['then'](function(){return db[_0xd606('0x42')][_0xd606('0x5d')](_0x556ccf);})[_0xd606('0x23')](handleEntityNotFound(_0x2f4807,null))[_0xd606('0x23')](function(_0x5253a8){if(_0x5253a8){if(!_[_0xd606('0x81')](_0x5253a8[_0xd606('0x75')])){if(fs[_0xd606('0x82')](path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x84'),_0x5253a8[_0xd606('0x75')]))&&_0x892a9d){_0x52a7dc=path['join'](config['root'],_0xd606('0x84'),_0x5253a8[_0xd606('0x75')]);}}return _0x2f4807['download'](_0x52a7dc);}})[_0xd606('0x2c')](handleError(_0x2f4807,null));};exports[_0xd606('0x85')]=function(_0x3547c4,_0x28a30a,_0x107cb5){var _0xecc595=path[_0xd606('0x7d')](config[_0xd606('0x83')],'server/files/images/avatars/default_avatar.png');var _0x349210={'where':{'id':_0x3547c4[_0xd606('0x5c')]['id']},'attributes':['id',_0xd606('0x78')],'raw':!![]};return db[_0xd606('0x42')][_0xd606('0x5d')](_0x349210)[_0xd606('0x23')](handleEntityNotFound(_0x28a30a,null))[_0xd606('0x23')](function(_0x4dc3c4){if(_0x4dc3c4){if(!_[_0xd606('0x81')](_0x4dc3c4[_0xd606('0x78')])){if(fs[_0xd606('0x82')](path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x86'),_0x4dc3c4[_0xd606('0x78')]))){_0xecc595=path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x86'),_0x4dc3c4[_0xd606('0x78')]);}}return _0x28a30a[_0xd606('0x87')](_0xecc595);}})['catch'](handleError(_0x28a30a,null));};exports['getCustomerAvatar']=function(_0x1fdc5e,_0x5d2a74,_0x1e12e5){var _0x2d9bfc=path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x88'));var _0x560328={'where':{'id':_0x1fdc5e['params']['id']},'attributes':['id',_0xd606('0x79'),_0xd606('0x89')],'raw':!![]};return db[_0xd606('0x42')]['find'](_0x560328)[_0xd606('0x23')](handleEntityNotFound(_0x5d2a74,null))[_0xd606('0x23')](function(_0x41f58c){if(_0x41f58c){if(!_[_0xd606('0x81')](_0x41f58c[_0xd606('0x79')])){if(fs['existsSync'](path[_0xd606('0x7d')](config['root'],_0xd606('0x86'),_0x41f58c[_0xd606('0x79')]))&&_0x41f58c[_0xd606('0x89')]){_0x2d9bfc=path[_0xd606('0x7d')](config[_0xd606('0x83')],'server/files/images/avatars/',_0x41f58c[_0xd606('0x79')]);}}return _0x5d2a74['download'](_0x2d9bfc);}})[_0xd606('0x2c')](handleError(_0x5d2a74,null));};exports['getSystemAvatar']=function(_0x4f89a6,_0x220cf0,_0x52d2ce){var _0x324c07=path['join'](config[_0xd606('0x83')],_0xd606('0x8a'));var _0x3fbf88={'where':{'id':_0x4f89a6['params']['id']},'attributes':['id',_0xd606('0x7c')],'raw':!![]};return db[_0xd606('0x42')][_0xd606('0x5d')](_0x3fbf88)['then'](handleEntityNotFound(_0x220cf0,null))['then'](function(_0x1c7f94){if(_0x1c7f94){if(!_[_0xd606('0x81')](_0x1c7f94[_0xd606('0x7c')])){if(fs[_0xd606('0x82')](path['join'](config[_0xd606('0x83')],'server/files/images/avatars/',_0x1c7f94[_0xd606('0x7c')]))){_0x324c07=path['join'](config[_0xd606('0x83')],_0xd606('0x86'),_0x1c7f94[_0xd606('0x7c')]);}}return _0x220cf0[_0xd606('0x87')](_0x324c07);}})[_0xd606('0x2c')](handleError(_0x220cf0,null));};exports[_0xd606('0x8b')]=function(_0x283f05,_0x384683,_0x1b17c3){var _0x4adbd7=require(_0xd606('0x8c'));var _0x16a2dd=new _0x4adbd7();var _0x3547f3=_0x16a2dd[_0xd606('0x8d')](_0x283f05[_0xd606('0x8e')][_0xd606('0x8f')])[_0xd606('0x90')]();var _0x3c2389={'body':_0x283f05[_0xd606('0x5f')],'channel':_0xd606('0x91')};var _0x28117e=[];var _0x379963=[];var _0xc8b4a5={};var _0x567617=![];return db[_0xd606('0x92')][_0xd606('0x68')]()['then'](function(_0x134fee){if(!_0x134fee){throw new db[(_0xd606('0x93'))]['ValidationError'](_0xd606('0x94'));}_0x28117e=_[_0xd606('0x95')](_['keys'](_0x134fee),['createdAt',_0xd606('0x96')]);_0x379963=_[_0xd606('0x95')](_[_0xd606('0x48')](_0x134fee),[_0xd606('0x97'),_0xd606('0x96'),_0xd606('0x98'),_0xd606('0x99')]);if(_0x283f05['body']['id']){delete _0x283f05[_0xd606('0x5f')]['id'];}if(_['isNil'](_0x283f05[_0xd606('0x5f')][_0xd606('0x9a')])){throw new db['Sequelize'][(_0xd606('0x9b'))]('from\x20is\x20mandatory');}if(_[_0xd606('0x81')](_0x283f05[_0xd606('0x5f')]['body'])||_0x283f05[_0xd606('0x5f')][_0xd606('0x5f')]===''){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x9c'));}if(_[_0xd606('0x81')](_0x283f05['body'][_0xd606('0x9d')])){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x9e')+_0x379963);}if(!_['includes'](_0x379963,_0x283f05[_0xd606('0x5f')][_0xd606('0x9d')])){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x379963);}_0xc8b4a5[_0x283f05[_0xd606('0x5f')][_0xd606('0x9d')]]=_0x283f05[_0xd606('0x5f')][_0xd606('0x9a')];})[_0xd606('0x23')](function(){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x283f05[_0xd606('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd606('0x9f'),'include':[{'model':db[_0xd606('0x92')],'as':_0xd606('0xa0'),'where':_0xc8b4a5,'limit':0x1,'order':[['updatedAt',_0xd606('0xa1')]]}]},{'model':db[_0xd606('0xa2')],'as':_0xd606('0xa3')}]});})[_0xd606('0x23')](handleEntityNotFound(_0x384683,null))[_0xd606('0x23')](function(_0x3e628b){if(_0x3e628b&&_0x3e628b[_0xd606('0x9f')]){_0x3c2389[_0xd606('0xa4')]=_0x3e628b;_0x3c2389[_0xd606('0xa5')]=_0x3e628b[_0xd606('0xa3')];_0x3c2389[_0xd606('0xa6')]=_0x3e628b[_0xd606('0x9f')];_0x3c2389['applications']=_['orderBy'](_0x3c2389[_0xd606('0xa5')],['priority'],[_0xd606('0xa7')]);if(_0x3c2389['account'][_0xd606('0xa3')]){delete _0x3c2389[_0xd606('0xa4')][_0xd606('0xa3')];}if(_0x3c2389['account'][_0xd606('0x9f')]&&_0x3c2389[_0xd606('0xa4')][_0xd606('0x9f')][_0xd606('0xa0')]['length']){return _0x3c2389[_0xd606('0xa4')]['List'][_0xd606('0xa0')][0x0];}var _0x58c7e0=_[_0xd606('0xa8')](_0x283f05[_0xd606('0x5f')],{'firstName':_0x283f05[_0xd606('0x5f')][_0xd606('0x9a')],'ListId':_0x3e628b[_0xd606('0x99')]});_0x58c7e0[_0x283f05[_0xd606('0x5f')][_0xd606('0x9d')]]=_0x283f05['body'][_0xd606('0x9a')];return db[_0xd606('0x92')]['create'](_0x58c7e0,{'fields':_0x28117e,'raw':!![]});}})[_0xd606('0x23')](handleEntityNotFound(_0x384683,null))[_0xd606('0x23')](function(_0x4c9437){_0x3c2389[_0xd606('0xa9')]=_0x4c9437;var _0x4fed08=_0x283f05[_0xd606('0x5f')][_0xd606('0xaa')];if(_0x283f05[_0xd606('0x8e')][_0xd606('0xab')]){_0x4fed08=_0x283f05[_0xd606('0x8e')][_0xd606('0xab')];}else if(_0x283f05[_0xd606('0x8e')][_0xd606('0xac')]){_0x4fed08=_[_0xd606('0xad')](_0x283f05[_0xd606('0x8e')][_0xd606('0xac')]['split'](','));}if(_0x4c9437){var _0x3bcca5={'ContactId':_0x4c9437['id'],'ChatWebsiteId':_0x283f05[_0xd606('0x5c')]['id'],'from':(_0x4c9437[_0xd606('0xae')]||'')+'\x20'+(_0x4c9437[_0xd606('0xaf')]||''),'customerIp':_0x4fed08,'customerPort':_0x283f05['headers']['x-real-port']?_0x283f05[_0xd606('0x8e')][_0xd606('0xb0')]:null,'referer':_0x283f05[_0xd606('0x5f')][_0xd606('0xb1')],'browserName':_0x3547f3[_0xd606('0xb2')]['name']&&_0x3547f3[_0xd606('0xb2')]['version']?util[_0xd606('0xb3')](_0xd606('0xb4'),_0x3547f3['browser'][_0xd606('0x3d')],_0x3547f3[_0xd606('0xb2')][_0xd606('0xb5')]):_0xd606('0xb6'),'browserVersion':_0x3547f3[_0xd606('0xb2')]['version']||'unknown','osName':util[_0xd606('0xb3')]('%s\x20%s',_0x3547f3['os']['name'],_0x3547f3['os'][_0xd606('0xb5')]),'osVersion':_0x3547f3['os'][_0xd606('0xb5')],'deviceModel':_0x3547f3[_0xd606('0xb7')]['model']&&_0x3547f3[_0xd606('0xb7')][_0xd606('0xb8')]?util[_0xd606('0xb3')]('%s\x20%s\x20%s',_0x3547f3[_0xd606('0xb7')][_0xd606('0x4c')],_0x3547f3[_0xd606('0xb7')]['vendor'],_0x3547f3[_0xd606('0xb7')]['type']):null,'deviceVendor':_0x3547f3[_0xd606('0xb7')][_0xd606('0xb8')],'deviceType':_0x3547f3[_0xd606('0xb7')][_0xd606('0x45')],'formData':JSON[_0xd606('0x27')](_0x283f05[_0xd606('0x5f')])};var _0x3be120={'ChatWebsiteId':_0x283f05[_0xd606('0x5c')]['id'],'closed':![]};if(_0x283f05['body']['threadId']){_0x3be120[_0xd606('0xb9')]=_0x283f05[_0xd606('0x5f')]['threadId'];return db['ChatInteraction'][_0xd606('0x5d')]({'where':_0x3be120})[_0xd606('0x23')](function(_0x40cdf2){if(_0x40cdf2){return[_0x40cdf2,![]];}_0x3bcca5[_0xd606('0xb9')]=_0x283f05[_0xd606('0x5f')][_0xd606('0xb9')];_0x3bcca5[_0xd606('0xba')]=_0x283f05['body']['externalUrl'];return db[_0xd606('0xbb')]['create'](_0x3bcca5)[_0xd606('0x23')](function(_0x471b14){return[_0x471b14,!![]];});});}_0x3be120[_0xd606('0xbc')]=_0x4c9437['id'];if(_0x283f05[_0xd606('0x5f')][_0xd606('0xbd')]&&_0x283f05[_0xd606('0x5f')][_0xd606('0xbd')]['id']){_0x3be120['id']=_0x283f05['body']['interaction']['id'];return db[_0xd606('0xbb')]['find']({'where':_0x3be120})[_0xd606('0x23')](function(_0x4e78ca){if(_0x4e78ca){return[_0x4e78ca,![]];}return db[_0xd606('0xbb')][_0xd606('0x5e')](_0x3bcca5)[_0xd606('0x23')](function(_0x1b39d1){return[_0x1b39d1,!![]];});});}return db[_0xd606('0xbb')]['create'](_0x3bcca5)[_0xd606('0x23')](function(_0x5146b0){return[_0x5146b0,!![]];});}})[_0xd606('0xbe')](function(_0x3c266e,_0x26f970){if(_0x3c266e){_0x567617=_0x26f970;if(!_0x26f970){var _0x2aa702={'from':(_0x3c2389[_0xd606('0xa9')]['firstName']||'')+'\x20'+(_0x3c2389[_0xd606('0xa9')][_0xd606('0xaf')]||'')};if(_0x283f05[_0xd606('0x5f')][_0xd606('0xb9')]&&_0x283f05[_0xd606('0x5f')]['messageId']&&_0x283f05[_0xd606('0x5f')]['threadId']!=_0x283f05[_0xd606('0x5f')][_0xd606('0xbf')]){_0x2aa702[_0xd606('0xb9')]=_0x283f05['body']['messageId'];}return _0x3c266e['update'](_0x2aa702);}else{return _0x3c266e;}}})[_0xd606('0x23')](function(_0x94bc52){_0x3c2389[_0xd606('0xbd')]=_0x94bc52[_0xd606('0x61')]({'plain':!![]});_0x3c2389['interaction'][_0xd606('0xc0')]=_0x567617;if(_0x3c2389['interaction'][_0xd606('0xc0')]){if(_0x3c2389['account'][_0xd606('0xc1')]){_0x3c2389[_0xd606('0xa5')]['push']({'id':0x0,'priority':_0x3c2389[_0xd606('0xa5')][_0xd606('0x4e')]+0x1,'app':_0xd606('0xc2'),'appdata':_0xd606('0xc3'),'interval':_0xd606('0xc4')});}}return db[_0xd606('0xc5')][_0xd606('0x5e')]({'body':_0x283f05[_0xd606('0x5f')]['body'],'ChatWebsiteId':_0x283f05[_0xd606('0x5c')]['id'],'ChatInteractionId':_0x94bc52['id'],'direction':'in','ContactId':_0x3c2389[_0xd606('0xa9')]['id'],'AttachmentId':_0x283f05[_0xd606('0x5f')][_0xd606('0xc6')]});})[_0xd606('0x23')](function(_0x330e27){_0x3c2389['message']=_0x330e27;if(_0x3c2389[_0xd606('0xbd')][_0xd606('0xc7')]){return db[_0xd606('0xc8')][_0xd606('0x5d')]({'attributes':['id','name'],'where':{'id':_0x3c2389[_0xd606('0xbd')]['UserId']}})[_0xd606('0x23')](function(_0x8b8996){if(_0x8b8996){_0x3c2389[_0xd606('0xa5')][_0xd606('0xc9')]({'id':0x0,'priority':0x0,'app':_0xd606('0xca'),'appdata':_0x8b8996['name']+','+(_0x3c2389[_0xd606('0xa4')]['waitForTheAssignedAgent']||0xa),'interval':_0xd606('0xc4')});_0x3c2389['forcedOwnership']=!![];}return respondWithRpcPromise(_0xd606('0xcb'),_0xd606('0xcc'),_0x3c2389);});}return respondWithRpcPromise('Start',_0xd606('0xcc'),_0x3c2389);})[_0xd606('0x23')](function(_0x3f3ee0){respondWithRpcPromise('EventManager',_0xd606('0xcd'),{'event':'notify','message':_0x3f3ee0},client9002);return _0x3f3ee0;})[_0xd606('0x23')](respondWithResult(_0x384683,null))[_0xd606('0x2c')](handleError(_0x384683,null));};exports['offline']=function(_0x1bfc46,_0x372686,_0xc0fb35){var _0x1cb886,_0x43ae95,_0x148005;var _0xf3505b=[];var _0x40a6fd=[];var _0x270db1={};var _0x5d0813=_0x1bfc46[_0xd606('0xce')]||[];var _0x26e49c=[];var _0x142c79;return db['CmContact'][_0xd606('0x68')]()[_0xd606('0x23')](function(_0x14cde9){if(!_0x14cde9){throw new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x94'));}_0x40a6fd=_['difference'](_[_0xd606('0x48')](_0x14cde9),[_0xd606('0x97'),_0xd606('0x96')]);_0xf3505b=_['difference'](_[_0xd606('0x48')](_0x14cde9),['createdAt',_0xd606('0x96'),'CompanyId',_0xd606('0x99')]);if(_0x1bfc46[_0xd606('0x5f')]['id']){delete _0x1bfc46['body']['id'];}if(_[_0xd606('0x81')](_0x1bfc46['body']['from'])){throw _0x372686[_0xd606('0x2e')](0x1f4)[_0xd606('0xcf')](new db['Sequelize'][(_0xd606('0x9b'))](_0xd606('0xd0')));}if(_['isNil'](_0x1bfc46[_0xd606('0x5f')][_0xd606('0x5f')])||_0x1bfc46[_0xd606('0x5f')][_0xd606('0x5f')]===''){throw _0x372686[_0xd606('0x2e')](0x1f4)['send'](new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0x9c')));}if(_[_0xd606('0x81')](_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')])){throw _0x372686[_0xd606('0x2e')](0x1f4)[_0xd606('0xcf')](new db[(_0xd606('0x93'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xf3505b));}if(!_[_0xd606('0xd2')](_0xf3505b,_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')])){throw _0x372686[_0xd606('0x2e')](0x1f4)[_0xd606('0xcf')](new db[(_0xd606('0x93'))][(_0xd606('0x9b'))](_0xd606('0xd3')+_0xf3505b));}_0x270db1[_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')]]=_0x1bfc46['body'][_0xd606('0x9a')];})[_0xd606('0x23')](function(){return db[_0xd606('0x42')][_0xd606('0x5d')]({'where':{'id':_0x1bfc46[_0xd606('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xd606('0x9f')},{'model':db[_0xd606('0xd4')],'as':_0xd606('0xd4')}]});})[_0xd606('0x23')](handleEntityNotFound(_0x372686,null))[_0xd606('0x23')](function(_0x54ff78){if(_0x54ff78&&_0x54ff78[_0xd606('0x9f')]){_0x43ae95=_0x54ff78;var _0x2664f2=_[_0xd606('0xa8')](_0x1bfc46[_0xd606('0x5f')],{'firstName':_0x1bfc46[_0xd606('0x5f')]['from'],'phone':_0x1bfc46[_0xd606('0x5f')][_0xd606('0x9a')],'ListId':_0x54ff78['ListId']});_0x2664f2[_0x1bfc46[_0xd606('0x5f')][_0xd606('0xd1')]]=_0x1bfc46[_0xd606('0x5f')]['from'];return db[_0xd606('0x92')][_0xd606('0xd5')]({'where':_0x270db1,'defaults':_0x2664f2});}})['spread'](function(_0x175d64){if(_0x175d64){_0x148005=_0x175d64;var _0x2ec6c5=fs[_0xd606('0xd6')](path['join'](config[_0xd606('0x83')],_0xd606('0xd7')),_0xd606('0xd8'));var _0x4b7d80=ejs[_0xd606('0xd9')](_0x2ec6c5,{'body':_[_0xd606('0xda')](_0x1bfc46[_0xd606('0x5f')][_0xd606('0x5f')]),'bodyTitle':_0x43ae95['offlineMessageBody']});return db[_0xd606('0xdb')][_0xd606('0x5e')]({'body':_0x4b7d80,'ContactId':_0x175d64['id'],'ChatWebsiteId':_0x43ae95['id']});}})['then'](function(_0x1ba3f5){_0x142c79=_0x1ba3f5;if(_0x5d0813[_0xd606('0x4e')]){var _0x2be5c0=_0x5d0813['map'](function(_0x12007c){return{'name':_0x12007c[_0xd606('0xdc')],'basename':_0x12007c['filename'],'type':_0x12007c[_0xd606('0xdd')],'ChatOfflineMessageId':_0x1ba3f5['id']};});_0x26e49c=_0x2be5c0['map'](_0x5aa318=>{var _0xbb0a92={'filename':_0x5aa318[_0xd606('0x3d')],'path':path[_0xd606('0x7d')](config[_0xd606('0x83')],'server',_0xd606('0xce'),_0xd606('0xde'),_0xd606('0xdf'),_0x5aa318[_0xd606('0xe0')])};return _0xbb0a92;});if(!_0x43ae95[_0xd606('0xe1')]){return db[_0xd606('0xe2')][_0xd606('0xe3')](function(_0x2f5450){return db[_0xd606('0xe4')][_0xd606('0xe5')](_0x2be5c0,{'transaction':_0x2f5450});});}}})[_0xd606('0x23')](function(){if(_0x142c79){_0x1cb886=_0x142c79;return db[_0xd606('0xd4')]['findOne']({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd606('0xe6'),'raw':!![]}]});}})['then'](function(_0x397fa0){if(_0x397fa0&&_0x397fa0[_0xd606('0xe6')]&&_0x43ae95[_0xd606('0xe7')]&&_0x43ae95[_0xd606('0xe8')]){var _0x6fdf7b={'tls':{'rejectUnauthorized':![]}};if(_0x397fa0[_0xd606('0xe6')][_0xd606('0xe9')]){_0x6fdf7b[_0xd606('0xe9')]=_0x397fa0[_0xd606('0xe6')][_0xd606('0xe9')];}else{_0x6fdf7b[_0xd606('0xea')]=_0x397fa0[_0xd606('0xe6')][_0xd606('0xea')];_0x6fdf7b[_0xd606('0xeb')]=_0x397fa0[_0xd606('0xe6')][_0xd606('0xeb')];_0x6fdf7b[_0xd606('0xec')]=_0x397fa0[_0xd606('0xe6')]['secure'];}if(_0x397fa0[_0xd606('0xe6')]['authentication']){_0x6fdf7b['auth']={'user':_0x397fa0[_0xd606('0xe6')][_0xd606('0x60')],'pass':_0x397fa0['Smtp'][_0xd606('0xed')]};}return respondWithRpcPromise('SendMail',_0xd606('0xee'),{'account':_0x6fdf7b,'message':{'from':util[_0xd606('0xb3')](_0xd606('0xef'),_0x397fa0[_0xd606('0x3d')],_0x397fa0[_0xd606('0xf0')]||_0x397fa0['Smtp']['user']),'to':_0x43ae95[_0xd606('0xe8')],'subject':_0x43ae95[_0xd606('0xf1')],'html':_0x1cb886[_0xd606('0x5f')],'attachments':_0x26e49c}},client9003)['then'](function(){return _0x1cb886;})['catch'](function(_0x1b7743){console[_0xd606('0x28')](_0x1b7743);});}})[_0xd606('0x23')](function(){if(_0x43ae95&&_0x43ae95[_0xd606('0xe1')]&&_0x43ae95[_0xd606('0xf2')]){var _0x1b352a=[];if(_0x5d0813[_0xd606('0x4e')]){_0x1b352a=_0x5d0813[_0xd606('0x41')](function(_0x54f700){return{'name':_0x54f700[_0xd606('0xdc')],'basename':_0x54f700[_0xd606('0x7a')],'type':_0x54f700['mimetype'],'ChatOfflineMessageId':_0x142c79['id']};});}var _0x3ecba1;if(!_[_0xd606('0x81')](_0x43ae95[_0xd606('0xf3')])){var _0x42fe4a=_[_0xd606('0x41')](_0x1bfc46[_0xd606('0x5f')],function(_0x5b2fe0){return _0x5b2fe0;});var _0x1a256a=_['toPairsIn'](_0x42fe4a)[0x0];var _0x11dbb3=_[_0xd606('0xf4')](_0x1a256a,function(_0x355cb0){return _0x355cb0;});_0x3ecba1=_0x11dbb3[0x1][_0x43ae95['subjectOffline']];}var _0x31e818={'from':_0x148005[_0xd606('0xf0')],'firstName':_0x148005[_0xd606('0xae')],'lastName':_0x148005[_0xd606('0xaf')],'mapKey':_0xd606('0xf0'),'message':{'from':_0x148005[_0xd606('0xf0')],'to':_0x43ae95[_0xd606('0xd4')]['email'],'cc':'','subject':_[_0xd606('0x81')](_0x3ecba1)?_0x43ae95[_0xd606('0xf1')]:_0x3ecba1,'messageId':'','sentAt':new Date(),'attach':_0x1b352a['length'],'attachments':_0x1b352a,'originChannel':_0xd606('0xf5'),'ChatWebsiteId':_0x43ae95['id'],'ChatOfflineMessageId':_0x1cb886['id'],'originTo':_0x43ae95[_0xd606('0xd4')][_0xd606('0xf0')]},'body':_0x1cb886[_0xd606('0x5f')]};var _0x1caf17={'account':{'id':_0x43ae95[_0xd606('0xf2')]},'body':_0x31e818,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xd606('0xf6'),_0xd606('0xf7'),_0x1caf17,client9001)[_0xd606('0x23')](function(){return _0x1cb886;})[_0xd606('0x2c')](function(_0x3fee9b){console['error'](_0x3fee9b);});}return;})[_0xd606('0x23')](function(){if(_0x1cb886){return _0x1cb886;}})[_0xd606('0x23')](respondWithResult(_0x372686,null))[_0xd606('0x2c')](function(_0x1e4e79){console[_0xd606('0x28')](_0xd606('0x2c'),_0x1e4e79);for(var _0x59ab87 of _0x5d0813){var _0x22dcc7=path['join'](config['root'],_0xd606('0xf8'),'files',_0xd606('0xde'),_0xd606('0xdf'),_0x59ab87[_0xd606('0x7a')]);fs_extra[_0xd606('0xf9')](_0x22dcc7)[_0xd606('0x2c')](function(_0x1e23e1){console[_0xd606('0x28')](_0xd606('0xfa'),_0x22dcc7,_0x1e23e1);});}});};exports[_0xd606('0xfb')]=function(_0x2a28e0,_0x2b3a60,_0x1316f3){return db[_0xd606('0xbb')][_0xd606('0x5d')]({'where':{'id':_0x2a28e0[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x2b3a60,null))['then'](function(_0x353adf){if(_0x353adf){return _0x353adf[_0xd606('0xfb')](_0x2a28e0['body'][_0xd606('0x6f')],_['omit'](_0x2a28e0[_0xd606('0x5f')],[_0xd606('0x6f'),'id'])||{});}})[_0xd606('0x23')](respondWithResult(_0x2b3a60,null))[_0xd606('0x2c')](handleError(_0x2b3a60,null));};exports['getInteractions']=function(_0x410a02,_0x3306fe,_0x334d07){var _0x88a7e7={'raw':![],'where':{}};var _0x5aa3a3={};var _0x3c2940={'count':0x0,'rows':[]};return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x410a02['params']['id']}})['then'](handleEntityNotFound(_0x3306fe,null))[_0xd606('0x23')](function(_0x3622af){if(_0x3622af){_0x5aa3a3[_0xd606('0x4c')]=_[_0xd606('0x48')](db[_0xd606('0xbb')][_0xd606('0x43')]);_0x5aa3a3[_0xd606('0x47')]=_[_0xd606('0x48')](_0x410a02['query']);_0x5aa3a3[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x5aa3a3[_0xd606('0x4c')],_0x5aa3a3[_0xd606('0x47')]);_0x88a7e7[_0xd606('0x4b')]=_[_0xd606('0x4a')](_0x5aa3a3['model'],qs['fields'](_0x410a02[_0xd606('0x47')][_0xd606('0x4d')]));_0x88a7e7['attributes']=_0x88a7e7[_0xd606('0x4b')][_0xd606('0x4e')]?_0x88a7e7[_0xd606('0x4b')]:_0x5aa3a3['model'];if(!_0x410a02[_0xd606('0x47')][_0xd606('0x4f')](_0xd606('0x50'))){_0x88a7e7[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x410a02[_0xd606('0x47')][_0xd606('0x32')]);_0x88a7e7[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x410a02[_0xd606('0x47')][_0xd606('0x31')]);}_0x88a7e7[_0xd606('0x51')]=qs['sort'](_0x410a02[_0xd606('0x47')][_0xd606('0x52')]);_0x88a7e7[_0xd606('0x53')]=qs['filters'](_[_0xd606('0x6d')](_0x410a02[_0xd606('0x47')],_0x5aa3a3[_0xd606('0x49')]));_0x88a7e7[_0xd606('0x53')][_0xd606('0x6a')]=_0x3622af['id'];if(_0x410a02[_0xd606('0x47')][_0xd606('0x54')]){_0x88a7e7[_0xd606('0x53')]=_[_0xd606('0x55')](_0x88a7e7['where'],{'$or':_[_0xd606('0x41')](_0x88a7e7[_0xd606('0x4b')],function(_0x217bea){var _0x2ba7de={};_0x2ba7de[_0x217bea]={'$like':'%'+_0x410a02[_0xd606('0x47')]['filter']+'%'};return _0x2ba7de;})});}_0x88a7e7=_[_0xd606('0x55')]({},_0x88a7e7,_0x410a02[_0xd606('0x57')]);return db[_0xd606('0xbb')][_0xd606('0x34')]({'where':_0x88a7e7[_0xd606('0x53')]})['then'](function(_0x6d97d4){_0x3c2940[_0xd606('0x34')]=_0x6d97d4;if(_0x410a02[_0xd606('0x47')]['includeAll']){_0x88a7e7[_0xd606('0x59')]=[{'model':db[_0xd606('0x92')],'as':'Contact','required':![]},{'model':db[_0xd606('0xc8')],'as':_0xd606('0xfc'),'attributes':[_0xd606('0x3d'),_0xd606('0xfd'),'internal'],'required':![]},{'model':db[_0xd606('0xfe')],'as':_0xd606('0xff'),'attributes':['id','name',_0xd606('0x100')],'where':_0x410a02['query'][_0xd606('0x101')]?{'id':_0x410a02[_0xd606('0x47')][_0xd606('0x101')]}:undefined,'required':_0x410a02[_0xd606('0x47')]['tag']?!![]:![]}];}return db[_0xd606('0xbb')]['findAll'](_0x88a7e7);})['then'](function(_0x38cb4a){_0x3c2940[_0xd606('0x5b')]=_0x38cb4a;return _0x3c2940;});}})['then'](respondWithFilteredResult(_0x3306fe,_0x88a7e7))[_0xd606('0x2c')](handleError(_0x3306fe,null));};function iftimePromise(_0x60bed4,_0x4541c3){return respondWithRpcPromise(_0xd606('0x102'),_0xd606('0x103'),{'command':_0x4541c3[_0xd606('0x104')]?util[_0xd606('0xb3')](_0xd606('0x105'),_0x60bed4[_0xd606('0x106')],_0x4541c3[_0xd606('0x104')]):util[_0xd606('0xb3')]('iftime\x20%s',_0x60bed4[_0xd606('0x106')])},client9002)[_0xd606('0x23')](function(_0x1372d4){var _0x15fa66=_0x1372d4&&_0x1372d4[_0xd606('0x107')](_0xd606('0x108'))>=0x0?!![]:![];logger[_0xd606('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x4541c3['id'],_0x60bed4['id'],_0x60bed4[_0xd606('0x106')],_0x15fa66?_0xd606('0x109'):'OFFLINE',_0x4541c3[_0xd606('0x104')]?_0x4541c3[_0xd606('0x104')]:'No\x20timezone');return _0x15fa66;})[_0xd606('0x2c')](function(_0x546549){logger[_0xd606('0x28')](_0xd606('0x10a'),_0x4541c3['id'],_0x60bed4['id'],_0x60bed4['interval'],util[_0xd606('0x10b')](_0x546549,{'showHidden':![],'depth':null}),_0x4541c3[_0xd606('0x104')]?_0x4541c3[_0xd606('0x104')]:_0xd606('0x10c'));return![];});}exports[_0xd606('0x103')]=function(_0x233486,_0x23bc7a,_0x2eda4e){var _0x5cded1=0x0;var _0x280102=0x0;var _0x457a38=![];var _0x2c79fc;var _0x273fea;return db[_0xd606('0x42')]['find']({'where':{'id':_0x233486[_0xd606('0x5c')]['id']},'include':[{'model':db[_0xd606('0x10d')],'as':_0xd606('0x10d'),'include':[{'model':db[_0xd606('0x10d')],'as':_0xd606('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})[_0xd606('0x23')](handleEntityNotFound(_0x23bc7a,null))[_0xd606('0x23')](function(_0x55c18a){if(_0x55c18a){_0x2c79fc=_0x55c18a;return _0x55c18a['getProactiveActions']({'raw':!![]});}})[_0xd606('0x23')](function(_0x2d0fb9){if(_0x2c79fc){if(_0x2d0fb9){_0x273fea=_0x2d0fb9;}}return require(_0xd606('0x1a'))[_0xd606('0x7f')]();})[_0xd606('0x23')](function(_0x33205a){if(_0x33205a){_0x280102=_0x33205a[_0xd606('0x10f')];_0x457a38=_0x33205a['custom'];}})[_0xd606('0x23')](function(){return db['ChatInteraction'][_0xd606('0x34')]({'where':{'closed':![]}});})['then'](function(_0x22a244){_0x5cded1=_0x22a244;if(_0x280102&&_0x22a244>_0x280102){return db[_0xd606('0x110')][_0xd606('0x72')]({'where':{'id':0x1}})[_0xd606('0x23')](function(_0x1f24bf){if(_0x1f24bf){_0x1f24bf[_0xd606('0x111')](_0xd606('0x112'));}});}})[_0xd606('0x23')](function(){if(_0x2c79fc['Interval']&&_0x2c79fc[_0xd606('0x10d')][_0xd606('0x10e')]){var _0x3f13be=[];for(var _0x6a41a8=0x0;_0x6a41a8<_0x2c79fc[_0xd606('0x10d')][_0xd606('0x10e')][_0xd606('0x4e')];_0x6a41a8++){var _0x4b2b09=_0x2c79fc['Interval']['Intervals'][_0x6a41a8][_0xd606('0x61')]({'plain':!![]});_0x3f13be[_0xd606('0x113')](iftimePromise(_0x4b2b09,_0x2c79fc));}return BPromise[_0xd606('0x114')](_0x3f13be)[_0xd606('0x23')](function(_0xb380d6){return _[_0xd606('0x115')](_0xb380d6);});}else{return!![];}})['then'](function(_0x54dbb7){var _0x2a2efa=fs['readFileSync'](path[_0xd606('0x7d')](config[_0xd606('0x83')],_0xd606('0x116')),_0xd606('0xd8'));var _0xd6c356={'remote':_0x2c79fc[_0xd606('0x117')],'query':querystring[_0xd606('0x27')](_[_0xd606('0x55')](_0x2c79fc['get']({'plain':!![]}),{'customerIp':_0x233486[_0xd606('0x8e')][_0xd606('0xac')]||_0x233486[_0xd606('0x8e')][_0xd606('0x118')]||_0x233486[_0xd606('0x119')][_0xd606('0x11a')]||_0x233486['ip'],'referer':_0x233486[_0xd606('0x8e')][_0xd606('0xb1')],'openedInteractions':_0x5cded1,'maxInteractions':_0x280102,'virtual':_0x457a38[_0xd606('0x10f')],'online':_0x54dbb7,'custom':_0x457a38}))[_0xd606('0x11b')](/'/g,'\x5c\x27')};_0x23bc7a['send'](ejs['render'](Mustache[_0xd606('0xd9')](_0x2a2efa,_0xd6c356),{'proactiveActions':_0x273fea,'alignment':_0x2c79fc['alignment'],'verticalAlignment':_0x2c79fc[_0xd606('0x11c')],'div_color':_0x2c79fc[_0xd606('0x100')],'text_color':_0x2c79fc[_0xd606('0x11d')],'button_color':_0x2c79fc['color_button'],'background_color':_0x2c79fc[_0xd606('0x11e')]}));})[_0xd606('0x2c')](handleError(_0x23bc7a,null));};exports[_0xd606('0x11f')]=function(_0x28c124,_0x86f910,_0x750986){return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x28c124[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x86f910,null))['then'](function(_0x3eed95){if(_0x3eed95){return db[_0xd606('0xe2')][_0xd606('0xe3')](function(_0x197a4b){return db[_0xd606('0xa2')][_0xd606('0x3a')]({'where':{'ChatWebsiteId':_0x28c124[_0xd606('0x5c')]['id']},'transaction':_0x197a4b})[_0xd606('0x23')](function(_0x29a810){var _0x4168b4=_[_0xd606('0x41')](_0x28c124[_0xd606('0x5f')],function(_0x3306ea){_0x3306ea['ChatWebsiteId']=_0x28c124[_0xd606('0x5c')]['id'];return _0x3306ea;});return db[_0xd606('0xa2')][_0xd606('0xe5')](_0x4168b4,{'transaction':_0x197a4b});});})[_0xd606('0x23')](function(){return db[_0xd606('0xa2')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x28c124[_0xd606('0x5c')]['id']},'order':'priority'});});}})[_0xd606('0x23')](respondWithResult(_0x86f910,null))[_0xd606('0x2c')](handleError(_0x86f910,null));};exports['getApplications']=function(_0x186c61,_0x5f1599,_0x4320c0){var _0x692e54={};var _0x1eecc0={};var _0x413251;var _0x22f5c6;return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x186c61[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x5f1599,null))[_0xd606('0x23')](function(_0xb06042){if(_0xb06042){_0x413251=_0xb06042;_0x1eecc0[_0xd606('0x4c')]=_[_0xd606('0x48')](db[_0xd606('0xa2')]['rawAttributes']);_0x1eecc0[_0xd606('0x47')]=_[_0xd606('0x48')](_0x186c61['query']);_0x1eecc0[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x1eecc0[_0xd606('0x4c')],_0x1eecc0['query']);_0x692e54[_0xd606('0x4b')]=_['intersection'](_0x1eecc0[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x186c61[_0xd606('0x47')][_0xd606('0x4d')]));_0x692e54[_0xd606('0x4b')]=_0x692e54['attributes'][_0xd606('0x4e')]?_0x692e54[_0xd606('0x4b')]:_0x1eecc0[_0xd606('0x4c')];_0x692e54[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x186c61[_0xd606('0x47')][_0xd606('0x52')]);_0x692e54[_0xd606('0x53')]=qs[_0xd606('0x49')](_['pick'](_0x186c61[_0xd606('0x47')],_0x1eecc0['filters']));if(_0x186c61[_0xd606('0x47')][_0xd606('0x54')]){_0x692e54['where']=_[_0xd606('0x55')](_0x692e54['where'],{'$or':_[_0xd606('0x41')](_0x692e54[_0xd606('0x4b')],function(_0x362122){var _0x406322={};_0x406322[_0x362122]={'$like':'%'+_0x186c61[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x406322;})});}_0x692e54=_['merge']({},_0x692e54,_0x186c61['options']);return _0x413251['getApplications'](_0x692e54);}})[_0xd606('0x23')](function(_0x4cdac0){if(_0x4cdac0){_0x22f5c6=_0x4cdac0[_0xd606('0x4e')];if(!_0x186c61[_0xd606('0x47')]['hasOwnProperty'](_0xd606('0x50'))){_0x692e54[_0xd606('0x32')]=qs['limit'](_0x186c61[_0xd606('0x47')]['limit']);_0x692e54['offset']=qs[_0xd606('0x31')](_0x186c61[_0xd606('0x47')][_0xd606('0x31')]);}return _0x413251[_0xd606('0x120')](_0x692e54);}})[_0xd606('0x23')](function(_0xdabebc){if(_0xdabebc){return _0xdabebc?{'count':_0x22f5c6,'rows':_0xdabebc}:null;}})[_0xd606('0x23')](respondWithResult(_0x5f1599,null))[_0xd606('0x2c')](handleError(_0x5f1599,null));};exports[_0xd606('0x121')]=function(_0x156e75,_0x27e2f4,_0x12ed7c){return db[_0xd606('0x122')]['find']({'where':{'id':_0x156e75[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x27e2f4,null))[_0xd606('0x23')](function(_0x366500){if(_0x366500){return _0x366500[_0xd606('0x121')](_0x156e75[_0xd606('0x5f')]['ids'],_['omit'](_0x156e75[_0xd606('0x5f')],['ids','id'])||{});}})['then'](respondWithResult(_0x27e2f4,null))[_0xd606('0x2c')](handleError(_0x27e2f4,null));};exports['getProactiveActions']=function(_0x20f572,_0x40ae24,_0xbb2b6e){var _0x4209be={};var _0x2ef6e8={};var _0x27374b;var _0x3331ab;return db[_0xd606('0x42')]['findOne']({'where':{'id':_0x20f572[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x40ae24,null))[_0xd606('0x23')](function(_0x463da8){if(_0x463da8){_0x27374b=_0x463da8;_0x2ef6e8['model']=_[_0xd606('0x48')](db[_0xd606('0x123')][_0xd606('0x43')]);_0x2ef6e8[_0xd606('0x47')]=_[_0xd606('0x48')](_0x20f572[_0xd606('0x47')]);_0x2ef6e8[_0xd606('0x49')]=_[_0xd606('0x4a')](_0x2ef6e8[_0xd606('0x4c')],_0x2ef6e8[_0xd606('0x47')]);_0x4209be['attributes']=_['intersection'](_0x2ef6e8['model'],qs[_0xd606('0x4d')](_0x20f572[_0xd606('0x47')][_0xd606('0x4d')]));_0x4209be[_0xd606('0x4b')]=_0x4209be[_0xd606('0x4b')][_0xd606('0x4e')]?_0x4209be[_0xd606('0x4b')]:_0x2ef6e8[_0xd606('0x4c')];_0x4209be[_0xd606('0x51')]=qs[_0xd606('0x52')](_0x20f572[_0xd606('0x47')][_0xd606('0x52')]);_0x4209be['where']=qs['filters'](_[_0xd606('0x6d')](_0x20f572[_0xd606('0x47')],_0x2ef6e8[_0xd606('0x49')]));if(_0x20f572[_0xd606('0x47')][_0xd606('0x54')]){_0x4209be[_0xd606('0x53')]=_[_0xd606('0x55')](_0x4209be[_0xd606('0x53')],{'$or':_['map'](_0x4209be[_0xd606('0x4b')],function(_0x3a147f){var _0x5047fd={};_0x5047fd[_0x3a147f]={'$like':'%'+_0x20f572[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0x5047fd;})});}_0x4209be=_[_0xd606('0x55')]({},_0x4209be,_0x20f572[_0xd606('0x57')]);return _0x27374b[_0xd606('0x124')](_0x4209be);}})[_0xd606('0x23')](function(_0x5f56ee){if(_0x5f56ee){_0x3331ab=_0x5f56ee[_0xd606('0x4e')];if(!_0x20f572['query'][_0xd606('0x4f')](_0xd606('0x50'))){_0x4209be[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x20f572[_0xd606('0x47')][_0xd606('0x32')]);_0x4209be[_0xd606('0x31')]=qs['offset'](_0x20f572[_0xd606('0x47')][_0xd606('0x31')]);}return _0x27374b[_0xd606('0x124')](_0x4209be);}})[_0xd606('0x23')](function(_0x584ef5){if(_0x584ef5){return _0x584ef5?{'count':_0x3331ab,'rows':_0x584ef5}:null;}})['then'](respondWithResult(_0x40ae24,null))[_0xd606('0x2c')](handleError(_0x40ae24,null));};exports[_0xd606('0x125')]=function(_0x556597,_0xa17a57,_0x254ef5){var _0x12b239=_0x556597['query'][_0xd606('0x126')]===_0xd606('0x127')?_0xd606('0x128'):_0xd606('0x129');return db['ChatWebsite'][_0xd606('0x5d')]({'attributes':['id',_0x12b239],'where':{'id':_0x556597[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0xa17a57,null))[_0xd606('0x23')](function(_0x3a0120){if(_0x3a0120){var _0x4db45d=_0x3a0120[_0x12b239];var _0x593551=_0x4db45d&&_0x4db45d[_0xd606('0x12a')]?_0x4db45d[_0xd606('0x12a')]:[];_0xa17a57['send']({'fromKey':_[_0xd606('0x81')](_0x4db45d['fromKey'])?undefined:_0x4db45d[_0xd606('0x12b')],'count':_0x593551[_0xd606('0x4e')],'rows':_0x593551});}})['catch'](handleError(_0xa17a57,null));};exports[_0xd606('0x12c')]=function(_0x4e1929,_0x232210,_0xe7b1cb){var _0x53f8da={'raw':![],'where':{}};var _0xb6945c={};var _0x1140cc={'count':0x0,'rows':[]};return db[_0xd606('0x42')]['findOne']({'where':{'id':_0x4e1929[_0xd606('0x5c')]['id']}})['then'](handleEntityNotFound(_0x232210,null))[_0xd606('0x23')](function(_0x42948f){if(_0x42948f){_0xb6945c[_0xd606('0x4c')]=_[_0xd606('0x48')](db['ChatOfflineMessage'][_0xd606('0x43')]);_0xb6945c['query']=_[_0xd606('0x48')](_0x4e1929[_0xd606('0x47')]);_0xb6945c[_0xd606('0x49')]=_['intersection'](_0xb6945c[_0xd606('0x4c')],_0xb6945c[_0xd606('0x47')]);_0x53f8da[_0xd606('0x4b')]=_[_0xd606('0x4a')](_0xb6945c['model'],qs[_0xd606('0x4d')](_0x4e1929['query'][_0xd606('0x4d')]));_0x53f8da[_0xd606('0x4b')]=_0x53f8da[_0xd606('0x4b')][_0xd606('0x4e')]?_0x53f8da['attributes']:_0xb6945c[_0xd606('0x4c')];if(!_0x4e1929[_0xd606('0x47')]['hasOwnProperty'](_0xd606('0x50'))){_0x53f8da[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x4e1929[_0xd606('0x47')][_0xd606('0x32')]);_0x53f8da['offset']=qs[_0xd606('0x31')](_0x4e1929[_0xd606('0x47')][_0xd606('0x31')]);}_0x53f8da[_0xd606('0x51')]=qs['sort'](_0x4e1929['query'][_0xd606('0x52')]);_0x53f8da[_0xd606('0x53')]=qs[_0xd606('0x49')](_[_0xd606('0x6d')](_0x4e1929[_0xd606('0x47')],_0xb6945c[_0xd606('0x49')]));_0x53f8da[_0xd606('0x53')][_0xd606('0x6a')]=_0x42948f['id'];if(_0x4e1929['query']['filter']){_0x53f8da['where']=_[_0xd606('0x55')](_0x53f8da[_0xd606('0x53')],{'$or':_['map'](_0x53f8da[_0xd606('0x4b')],function(_0x3318d5){var _0xca43ea={};_0xca43ea[_0x3318d5]={'$like':'%'+_0x4e1929[_0xd606('0x47')][_0xd606('0x54')]+'%'};return _0xca43ea;})});}_0x53f8da=_[_0xd606('0x55')]({},_0x53f8da,_0x4e1929['options']);return db[_0xd606('0xdb')][_0xd606('0x34')]({'where':_0x53f8da[_0xd606('0x53')]})[_0xd606('0x23')](function(_0xffeebc){_0x1140cc['count']=_0xffeebc;if(_0x4e1929[_0xd606('0x47')][_0xd606('0x58')]){_0x53f8da['include']=[{'all':!![]}];}else{_0x53f8da[_0xd606('0x59')]=[{'model':db['CmContact'],'as':_0xd606('0x12d'),'required':![]},{'model':db['Attachment'],'as':'Attachments','required':![]}];}return db[_0xd606('0xdb')][_0xd606('0x5a')](_0x53f8da);})[_0xd606('0x23')](function(_0x26701a){_0x1140cc[_0xd606('0x5b')]=_0x26701a;return _0x1140cc;});}})['then'](respondWithFilteredResult(_0x232210,_0x53f8da))['catch'](handleError(_0x232210,null));};exports['addAgents']=function(_0x36c2ce,_0x411966,_0x252ddf){return db['ChatWebsite']['find']({'where':{'id':_0x36c2ce['params']['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x411966,null))[_0xd606('0x23')](function(_0x10f1c9){if(_0x10f1c9){return _0x10f1c9[_0xd606('0x12e')](_0x36c2ce[_0xd606('0x5f')][_0xd606('0x6f')],_['omit'](_0x36c2ce['body'],['ids','id'])||{})[_0xd606('0xbe')](function(_0x1dace7){for(var _0x3c2fc4=0x0;_0x3c2fc4<_0x36c2ce['body'][_0xd606('0x6f')][_0xd606('0x4e')];_0x3c2fc4+=0x1){socket[_0xd606('0x12f')](_0xd606('0x130'),{'UserId':Number(_0x36c2ce[_0xd606('0x5f')][_0xd606('0x6f')][_0x3c2fc4]),'ChatWebsiteId':Number(_0x36c2ce[_0xd606('0x5c')]['id'])});}return _0x1dace7;});}})['then'](respondWithResult(_0x411966,null))['catch'](handleError(_0x411966,null));};exports[_0xd606('0x131')]=function(_0x14b257,_0x31c9c2,_0x1c0580){return db['ChatWebsite'][_0xd606('0x5d')]({'where':{'id':_0x14b257[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x31c9c2,null))[_0xd606('0x23')](function(_0x2d0831){if(_0x2d0831){return _0x2d0831[_0xd606('0x131')](_0x14b257[_0xd606('0x47')][_0xd606('0x6f')])[_0xd606('0x23')](function(){if(_[_0xd606('0x132')](_0x14b257[_0xd606('0x47')][_0xd606('0x6f')])){for(var _0x590c2f=0x0;_0x590c2f<_0x14b257['query'][_0xd606('0x6f')]['length'];_0x590c2f+=0x1){socket[_0xd606('0x12f')](_0xd606('0x133'),{'UserId':Number(_0x14b257['query'][_0xd606('0x6f')][_0x590c2f]),'ChatWebsiteId':Number(_0x14b257['params']['id'])});}}else{socket[_0xd606('0x12f')](_0xd606('0x133'),{'UserId':Number(_0x14b257['query'][_0xd606('0x6f')]),'ChatWebsiteId':Number(_0x14b257[_0xd606('0x5c')]['id'])});}});}})[_0xd606('0x23')](respondWithStatusCode(_0x31c9c2,null))[_0xd606('0x2c')](handleError(_0x31c9c2,null));};exports[_0xd606('0x134')]=function(_0x3d5415,_0x4ff46e,_0x590615){var _0x44cc88={};var _0x5041fb={};var _0x5b2c3f;var _0x4cd634;return db[_0xd606('0x42')][_0xd606('0x72')]({'where':{'id':_0x3d5415[_0xd606('0x5c')]['id']}})[_0xd606('0x23')](handleEntityNotFound(_0x4ff46e,null))[_0xd606('0x23')](function(_0x1deccc){if(_0x1deccc){_0x5b2c3f=_0x1deccc;_0x5041fb[_0xd606('0x4c')]=_[_0xd606('0x48')](db[_0xd606('0xc8')]['rawAttributes']);_0x5041fb['query']=_['keys'](_0x3d5415[_0xd606('0x47')]);_0x5041fb['filters']=_[_0xd606('0x4a')](_0x5041fb['model'],_0x5041fb['query']);_0x44cc88[_0xd606('0x4b')]=_['intersection'](_0x5041fb[_0xd606('0x4c')],qs[_0xd606('0x4d')](_0x3d5415['query']['fields']));_0x44cc88[_0xd606('0x4b')]=_0x44cc88[_0xd606('0x4b')][_0xd606('0x4e')]?_0x44cc88['attributes']:_0x5041fb[_0xd606('0x4c')];_0x44cc88['order']=qs['sort'](_0x3d5415[_0xd606('0x47')][_0xd606('0x52')]);_0x44cc88[_0xd606('0x53')]=qs[_0xd606('0x49')](_[_0xd606('0x6d')](_0x3d5415['query'],_0x5041fb[_0xd606('0x49')]));if(_0x3d5415[_0xd606('0x47')][_0xd606('0x54')]){_0x44cc88['where']=_['merge'](_0x44cc88[_0xd606('0x53')],{'$or':_[_0xd606('0x41')](_0x44cc88[_0xd606('0x4b')],function(_0x354432){var _0x3dfd25={};_0x3dfd25[_0x354432]={'$like':'%'+_0x3d5415[_0xd606('0x47')]['filter']+'%'};return _0x3dfd25;})});}_0x44cc88=_[_0xd606('0x55')]({},_0x44cc88,_0x3d5415[_0xd606('0x57')]);return _0x5b2c3f[_0xd606('0x134')](_0x44cc88);}})['then'](function(_0x5394e1){if(_0x5394e1){_0x4cd634=_0x5394e1[_0xd606('0x4e')];if(!_0x3d5415['query']['hasOwnProperty']('nolimit')){_0x44cc88[_0xd606('0x32')]=qs[_0xd606('0x32')](_0x3d5415[_0xd606('0x47')][_0xd606('0x32')]);_0x44cc88[_0xd606('0x31')]=qs[_0xd606('0x31')](_0x3d5415[_0xd606('0x47')]['offset']);}return _0x5b2c3f[_0xd606('0x134')](_0x44cc88);}})[_0xd606('0x23')](function(_0x5f0221){if(_0x5f0221){return _0x5f0221?{'count':_0x4cd634,'rows':_0x5f0221}:null;}})[_0xd606('0x23')](respondWithResult(_0x4ff46e,null))[_0xd606('0x2c')](handleError(_0x4ff46e,null));}; \ No newline at end of file +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 diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index d998e71..9c565d4 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 _0xc4f5=['hasOwnProperty','hook','exports','../../mysqldb','ChatWebsite','setMaxListeners','update','remove','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4f5,0xa5));var _0x5c4f=function(_0x9d679d,_0x4dd38a){_0x9d679d=_0x9d679d-0x0;var _0x3ce1dc=_0xc4f5[_0x9d679d];return _0x3ce1dc;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x5c4f('0x0'))['db'][_0x5c4f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x5c4f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5c4f('0x3'),'afterDestroy':_0x5c4f('0x4')};function emitEvent(_0x24c5b6){return function(_0xfd69b2,_0x2676f7,_0x56e601){ChatWebsiteEvents[_0x5c4f('0x5')](_0x24c5b6+':'+_0xfd69b2['id'],_0xfd69b2);ChatWebsiteEvents[_0x5c4f('0x5')](_0x24c5b6,_0xfd69b2);_0x56e601(null);};}for(var e in events){if(events[_0x5c4f('0x6')](e)){var event=events[e];ChatWebsite[_0x5c4f('0x7')](e,emitEvent(event));}}module[_0x5c4f('0x8')]=ChatWebsiteEvents; \ No newline at end of file +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 diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 5403d60..159481e 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 _0x8326=['define','ChatWebsite','lodash','api','bluebird','path','../../config/environment','./chatWebsite.attributes','exports'];(function(_0x4daa89,_0xa8f6c1){var _0x725a84=function(_0x538d15){while(--_0x538d15){_0x4daa89['push'](_0x4daa89['shift']());}};_0x725a84(++_0xa8f6c1);}(_0x8326,0xf5));var _0x6832=function(_0x20a590,_0x1e8a6d){_0x20a590=_0x20a590-0x0;var _0x2e1b41=_0x8326[_0x20a590];return _0x2e1b41;};'use strict';var _=require(_0x6832('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6832('0x1'));var moment=require('moment');var BPromise=require(_0x6832('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6832('0x3'));var rimraf=require('rimraf');var config=require(_0x6832('0x4'));var attributes=require(_0x6832('0x5'));module[_0x6832('0x6')]=function(_0x36d9c9,_0x39a9a7){return _0x36d9c9[_0x6832('0x7')](_0x6832('0x8'),attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index ab56c5d..d387646 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 _0xb87f=['redis','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','rpc','client','http'];(function(_0x4831d7,_0x6964bc){var _0x4c7816=function(_0x5c3202){while(--_0x5c3202){_0x4831d7['push'](_0x4831d7['shift']());}};_0x4c7816(++_0x6964bc);}(_0xb87f,0x1f2));var _0xfb87=function(_0x104354,_0x1d5cdc){_0x104354=_0x104354-0x0;var _0x5ce198=_0xb87f[_0x104354];return _0x5ce198;};'use strict';var _=require(_0xfb87('0x0'));var util=require(_0xfb87('0x1'));var moment=require(_0xfb87('0x2'));var BPromise=require(_0xfb87('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfb87('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfb87('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xfb87('0x6')][_0xfb87('0x7')]({'port':0x232a});config[_0xfb87('0x8')]=_['defaults'](config[_0xfb87('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb87('0x9'))(new Redis(config[_0xfb87('0x8')]));require(_0xfb87('0xa'))[_0xfb87('0xb')](socket);function respondWithRpcPromise(_0x5b7d67,_0x2109ee,_0x408019){return new BPromise(function(_0x129843,_0x32d027){return client[_0xfb87('0xc')](_0x5b7d67,_0x408019)['then'](function(_0x5cbaed){logger[_0xfb87('0xd')](_0xfb87('0xe'),_0x2109ee,_0xfb87('0xf'));logger[_0xfb87('0x10')](_0xfb87('0x11'),_0x2109ee,_0xfb87('0xf'),JSON[_0xfb87('0x12')](_0x5cbaed));if(_0x5cbaed[_0xfb87('0x13')]){if(_0x5cbaed[_0xfb87('0x13')][_0xfb87('0x14')]===0x1f4){logger[_0xfb87('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2109ee,_0x5cbaed[_0xfb87('0x13')]['message']);return _0x32d027(_0x5cbaed['error']['message']);}logger[_0xfb87('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2109ee,_0x5cbaed[_0xfb87('0x13')]['message']);return _0x129843(_0x5cbaed[_0xfb87('0x13')][_0xfb87('0x15')]);}else{logger['info'](_0xfb87('0xe'),_0x2109ee,_0xfb87('0xf'));_0x129843(_0x5cbaed['result'][_0xfb87('0x15')]);}})[_0xfb87('0x16')](function(_0x11ae04){logger[_0xfb87('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x2109ee,_0x11ae04);_0x32d027(_0x11ae04);});});} \ No newline at end of file +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 diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8adc5eb..f6ec9e3 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 _0x0a04=['length','chatWebsite:','./chatWebsite.events','save','remove','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0a04,0x1d2));var _0x40a0=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x0a04[_0xaa0309];return _0x5de7ce;};'use strict';var ChatWebsiteEvents=require(_0x40a0('0x0'));var events=[_0x40a0('0x1'),_0x40a0('0x2'),'update'];function createListener(_0x302002,_0x8495a6){return function(_0x23a3e8){_0x8495a6[_0x40a0('0x3')](_0x302002,_0x23a3e8);};}function removeListener(_0x2582c4,_0x49667b){return function(){ChatWebsiteEvents[_0x40a0('0x4')](_0x2582c4,_0x49667b);};}exports[_0x40a0('0x5')]=function(_0x57a3b0){for(var _0x1442a7=0x0,_0x265c8e=events[_0x40a0('0x6')];_0x1442a7<_0x265c8e;_0x1442a7++){var _0x2e9007=events[_0x1442a7];var _0x3ae0c4=createListener(_0x40a0('0x7')+_0x2e9007,_0x57a3b0);ChatWebsiteEvents['on'](_0x2e9007,_0x3ae0c4);}}; \ No newline at end of file +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 diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 8ecde8e..d85f4a6 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 _0xcee7=['attachments','offline-chat','ensureDir','replace','any','offline','addInteraction','/:id/applications','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','express','Router','fs-extra','../../config/environment','./chatWebsite.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','getAvatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','post','addAnswer','diskStorage','join','server/files/images/logos/','originalname','single','file','addLogo','root','format','%s-%s','now','/:id/avatar','addAvatar','server/files/images/avatars/','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files'];(function(_0x314bb5,_0x476e6a){var _0x32c85e=function(_0x52673d){while(--_0x52673d){_0x314bb5['push'](_0x314bb5['shift']());}};_0x32c85e(++_0x476e6a);}(_0xcee7,0x1bd));var _0x7cee=function(_0xdbad07,_0x22af65){_0xdbad07=_0xdbad07-0x0;var _0x4109f8=_0xcee7[_0xdbad07];return _0x4109f8;};'use strict';var multer=require(_0x7cee('0x0'));var util=require(_0x7cee('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7cee('0x2'));var router=express[_0x7cee('0x3')]();var fs_extra=require(_0x7cee('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7cee('0x5'));var controller=require(_0x7cee('0x6'));router[_0x7cee('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7cee('0x7')](_0x7cee('0x8'),auth['isAuthenticated'](),controller[_0x7cee('0x9')]);router[_0x7cee('0x7')](_0x7cee('0xa'),auth[_0x7cee('0xb')](),controller[_0x7cee('0xc')]);router['get'](_0x7cee('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x7cee('0x7')](_0x7cee('0xe'),auth['isAuthenticated'](),controller[_0x7cee('0xf')]);router[_0x7cee('0x7')](_0x7cee('0x10'),controller[_0x7cee('0x11')]);router['get']('/:id/avatar',controller[_0x7cee('0x12')]);router[_0x7cee('0x7')]('/:id/customer_avatar',controller[_0x7cee('0x13')]);router['get']('/:id/system_avatar',controller[_0x7cee('0x14')]);router['get'](_0x7cee('0x15'),auth['isAuthenticated'](),controller[_0x7cee('0x16')]);router[_0x7cee('0x7')](_0x7cee('0x17'),controller[_0x7cee('0x18')]);router[_0x7cee('0x7')]('/:id/applications',auth[_0x7cee('0xb')](),controller[_0x7cee('0x19')]);router[_0x7cee('0x7')](_0x7cee('0x1a'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x1b')]);router[_0x7cee('0x7')](_0x7cee('0x1c'),controller['getFields']);router['get'](_0x7cee('0x1d'),auth['isAuthenticated'](),controller[_0x7cee('0x1e')]);router['get']('/:id/users',auth[_0x7cee('0xb')](),controller['getAgents']);router[_0x7cee('0x1f')]('/',auth[_0x7cee('0xb')](),controller['create']);router[_0x7cee('0x1f')](_0x7cee('0xd'),auth['isAuthenticated'](),controller['addDisposition']);router[_0x7cee('0x1f')]('/:id/canned_answers',auth[_0x7cee('0xb')](),controller[_0x7cee('0x20')]);var upload=multer({'storage':multer[_0x7cee('0x21')]({'destination':function(_0x103141,_0x504a1d,_0x2f098b){_0x2f098b(null,path[_0x7cee('0x22')](config['root'],_0x7cee('0x23')));},'filename':function(_0x2fefe6,_0x11a9e0,_0x2a7cb4){_0x2a7cb4(null,util['format']('%s-%s',Date['now'](),_0x11a9e0[_0x7cee('0x24')]));}})});router['post'](_0x7cee('0x10'),upload[_0x7cee('0x25')](_0x7cee('0x26')),controller[_0x7cee('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x22a28d,_0x20717a,_0x3f306a){_0x3f306a(null,path['join'](config[_0x7cee('0x28')],'server/files/images/avatars/'));},'filename':function(_0x4f0704,_0x5a818c,_0x550fbe){_0x550fbe(null,util[_0x7cee('0x29')](_0x7cee('0x2a'),Date[_0x7cee('0x2b')](),_0x5a818c[_0x7cee('0x24')]));}})});router['post'](_0x7cee('0x2c'),upload[_0x7cee('0x25')](_0x7cee('0x26')),controller[_0x7cee('0x2d')]);var upload=multer({'storage':multer[_0x7cee('0x21')]({'destination':function(_0x3d70ca,_0x4fa76c,_0x4e868e){_0x4e868e(null,path[_0x7cee('0x22')](config[_0x7cee('0x28')],_0x7cee('0x2e')));},'filename':function(_0x458e02,_0x39394d,_0x2e3753){_0x2e3753(null,util[_0x7cee('0x29')](_0x7cee('0x2a'),Date[_0x7cee('0x2b')](),_0x39394d[_0x7cee('0x24')]));}})});router[_0x7cee('0x1f')](_0x7cee('0x2f'),upload[_0x7cee('0x25')](_0x7cee('0x26')),controller[_0x7cee('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5382d1,_0x434c6e,_0x3141c8){_0x3141c8(null,path[_0x7cee('0x22')](config[_0x7cee('0x28')],_0x7cee('0x2e')));},'filename':function(_0x5d3553,_0x15066e,_0x3199fe){_0x3199fe(null,util[_0x7cee('0x29')]('%s-%s',Date[_0x7cee('0x2b')](),_0x15066e['originalname']));}})});router[_0x7cee('0x1f')]('/:id/system_avatar',upload['single'](_0x7cee('0x26')),controller[_0x7cee('0x31')]);router['post'](_0x7cee('0x32'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x7cee('0x21')]({'destination':function(_0x10b05b,_0x2049d3,_0x332c8f){const _0xedbfbd=path['join'](config[_0x7cee('0x28')],_0x7cee('0x33'),_0x7cee('0x34'),_0x7cee('0x35'));fs_extra[_0x7cee('0x36')](_0xedbfbd,function(){_0x332c8f(null,_0xedbfbd);});},'filename':function(_0x16c5be,_0x595912,_0x3b2d5f){const _0xe2c9b2=_0x595912[_0x7cee('0x24')][_0x7cee('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4a8095=path['extname'](_0xe2c9b2);const _0x468772=Date[_0x7cee('0x2b')]()+'-'+_0xe2c9b2['replace'](_0x4a8095,'')+_0x4a8095;_0x3b2d5f(null,_0x468772);}})});router[_0x7cee('0x1f')]('/:id/offline',offlineUploadMulter[_0x7cee('0x38')](),controller[_0x7cee('0x39')]);router[_0x7cee('0x1f')](_0x7cee('0x15'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x3a')]);router[_0x7cee('0x1f')](_0x7cee('0x3b'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x3c')]);router[_0x7cee('0x1f')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x7cee('0x3d')]);router[_0x7cee('0x1f')](_0x7cee('0x3e'),auth['isAuthenticated'](),controller[_0x7cee('0x3f')]);router[_0x7cee('0x40')]('/:id',auth[_0x7cee('0xb')](),controller[_0x7cee('0x41')]);router[_0x7cee('0x42')](_0x7cee('0xa'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x43')]);router[_0x7cee('0x42')](_0x7cee('0xd'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x44')]);router[_0x7cee('0x42')](_0x7cee('0xe'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x45')]);router['delete'](_0x7cee('0x3e'),auth[_0x7cee('0xb')](),controller[_0x7cee('0x46')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index e7070b1..ce5657c 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 _0xecb2=['sequelize','ENUM','STRING'];(function(_0x402085,_0x143dba){var _0x42992e=function(_0x33861f){while(--_0x33861f){_0x402085['push'](_0x402085['shift']());}};_0x42992e(++_0x143dba);}(_0xecb2,0xf6));var _0x2ecb=function(_0x2b326b,_0x1156dd){_0x2b326b=_0x2b326b-0x0;var _0x1e3509=_0xecb2[_0x2b326b];return _0x1e3509;};'use strict';var Sequelize=require(_0x2ecb('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x2ecb('0x1')]('AmazonAWS','Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x2ecb('0x2')]},'data2':{'type':Sequelize[_0x2ecb('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 845ddd4..6fcb023 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 _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x10e19a,_0x2915c4){var _0x50b26d=function(_0x1278a8){while(--_0x1278a8){_0x10e19a['push'](_0x10e19a['shift']());}};_0x50b26d(++_0x2915c4);}(_0x2ef3,0xba));var _0x32ef=function(_0x4eae98,_0x239918){_0x4eae98=_0x4eae98-0x0;var _0x1bce9d=_0x2ef3[_0x4eae98];return _0x1bce9d;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file +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 diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 73242d7..c638353 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 _0x4ce6=['request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','cloud_providers','lodash','util','../../config/logger','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ce6,0xbb));var _0x64ce=function(_0x4b6830,_0x2bf6fb){_0x4b6830=_0x4b6830-0x0;var _0x239e4a=_0x4ce6[_0x4b6830];return _0x239e4a;};'use strict';var _=require(_0x64ce('0x0'));var util=require(_0x64ce('0x1'));var logger=require(_0x64ce('0x2'))('api');var moment=require(_0x64ce('0x3'));var BPromise=require(_0x64ce('0x4'));var rp=require(_0x64ce('0x5'));var fs=require('fs');var path=require(_0x64ce('0x6'));var rimraf=require(_0x64ce('0x7'));var config=require(_0x64ce('0x8'));var attributes=require(_0x64ce('0x9'));module['exports']=function(_0x4e139c,_0xc5a802){return _0x4e139c[_0x64ce('0xa')]('CloudProvider',attributes,{'tableName':_0x64ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 7f1deb4..ec64b2b 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 _0x7334=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','util','moment'];(function(_0x2189e9,_0x2ca219){var _0x32fe6a=function(_0x4951b1){while(--_0x4951b1){_0x2189e9['push'](_0x2189e9['shift']());}};_0x32fe6a(++_0x2ca219);}(_0x7334,0x184));var _0x4733=function(_0x3deb86,_0x1ad6f3){_0x3deb86=_0x3deb86-0x0;var _0x1d3c40=_0x7334[_0x3deb86];return _0x1d3c40;};'use strict';var _=require(_0x4733('0x0'));var util=require(_0x4733('0x1'));var moment=require(_0x4733('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4733('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4733('0x4'));var logger=require(_0x4733('0x5'))(_0x4733('0x6'));var config=require(_0x4733('0x7'));var jayson=require(_0x4733('0x8'));var client=jayson[_0x4733('0x9')][_0x4733('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x283754,_0x12cafa,_0x43d95c){return new BPromise(function(_0x8257cf,_0x3562b7){return client[_0x4733('0xb')](_0x283754,_0x43d95c)[_0x4733('0xc')](function(_0x2d5fde){logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,'request\x20sent');logger[_0x4733('0xf')](_0x4733('0x10'),_0x12cafa,'request\x20sent',JSON[_0x4733('0x11')](_0x2d5fde));if(_0x2d5fde['error']){if(_0x2d5fde[_0x4733('0x12')][_0x4733('0x13')]===0x1f4){logger[_0x4733('0x12')](_0x4733('0xe'),_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x3562b7(_0x2d5fde[_0x4733('0x12')]['message']);}logger[_0x4733('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12cafa,_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);return _0x8257cf(_0x2d5fde[_0x4733('0x12')][_0x4733('0x14')]);}else{logger[_0x4733('0xd')](_0x4733('0xe'),_0x12cafa,_0x4733('0x15'));_0x8257cf(_0x2d5fde[_0x4733('0x16')][_0x4733('0x14')]);}})['catch'](function(_0x2c0031){logger[_0x4733('0x12')]('CloudProvider,\x20%s,\x20%s',_0x12cafa,_0x2c0031);_0x3562b7(_0x2c0031);});});} \ No newline at end of file +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 diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5b9ae91..22225a6 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 _0x8475=['path','Router','../../components/auth/service','../../components/interaction/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','exports','multer','util'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x8475,0x64));var _0x5847=function(_0x446677,_0x3fa33b){_0x446677=_0x446677-0x0;var _0x3295c8=_0x8475[_0x446677];return _0x3295c8;};'use strict';var multer=require(_0x5847('0x0'));var util=require(_0x5847('0x1'));var path=require(_0x5847('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5847('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5847('0x4'));var interaction=require(_0x5847('0x5'));var config=require('../../config/environment');var controller=require(_0x5847('0x6'));router[_0x5847('0x7')]('/',auth[_0x5847('0x8')](),controller[_0x5847('0x9')]);router[_0x5847('0x7')](_0x5847('0xa'),auth[_0x5847('0x8')](),controller[_0x5847('0xb')]);router[_0x5847('0xc')]('/',auth[_0x5847('0x8')](),controller[_0x5847('0xd')]);router['put'](_0x5847('0xa'),auth['isAuthenticated'](),controller[_0x5847('0xe')]);router[_0x5847('0xf')](_0x5847('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x5847('0x10')]=router; \ No newline at end of file +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 diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 4317982..c2128f4 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 _0x68fc=['sequelize','exports','STRING'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x68fc,0xa5));var _0xc68f=function(_0x327755,_0x5f4fcb){_0x327755=_0x327755-0x0;var _0x4a2edb=_0x68fc[_0x327755];return _0x4a2edb;};'use strict';var Sequelize=require(_0xc68f('0x0'));module[_0xc68f('0x1')]={'name':{'type':Sequelize[_0xc68f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xc68f('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xc68f('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xc68f('0x2')]},'postalCode':{'type':Sequelize[_0xc68f('0x2')]},'city':{'type':Sequelize[_0xc68f('0x2')]},'country':{'type':Sequelize[_0xc68f('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xc68f('0x2')]},'sPostalCode':{'type':Sequelize[_0xc68f('0x2')]},'sCity':{'type':Sequelize[_0xc68f('0x2')]},'sCountry':{'type':Sequelize[_0xc68f('0x2')]},'description':{'type':Sequelize[_0xc68f('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 010e970..d7b07d0 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 _0x48fa=['hasOwnProperty','order','sort','filters','pick','filter','where','merge','map','options','includeAll','findAll','catch','show','params','rawAttributes','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','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/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Companies','UserProfileResource','stack','name','send','index','CmCompany','describe','model','keys','query','intersection','attributes','fields'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x48fa,0x127));var _0xa48f=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x48fa[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0xa48f('0x0'));var rimraf=require(_0xa48f('0x1'));var zipdir=require(_0xa48f('0x2'));var jsonpatch=require(_0xa48f('0x3'));var rp=require(_0xa48f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa48f('0x5'));var path=require(_0xa48f('0x6'));var sox=require(_0xa48f('0x7'));var csv=require('to-csv');var ejs=require(_0xa48f('0x8'));var fs=require('fs');var fs_extra=require(_0xa48f('0x9'));var _=require(_0xa48f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa48f('0xb'));var deskjs=require(_0xa48f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa48f('0xd'));var Papa=require(_0xa48f('0xe'));var Redis=require(_0xa48f('0xf'));var authService=require(_0xa48f('0x10'));var qs=require(_0xa48f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa48f('0x12'));var logger=require(_0xa48f('0x13'))(_0xa48f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa48f('0x15'));var db=require(_0xa48f('0x16'))['db'];function respondWithStatusCode(_0x196153,_0xe15e6c){_0xe15e6c=_0xe15e6c||0xcc;return function(_0x286686){if(_0x286686){return _0x196153[_0xa48f('0x17')](_0xe15e6c);}return _0x196153[_0xa48f('0x18')](_0xe15e6c)[_0xa48f('0x19')]();};}function respondWithResult(_0x1e9f8f,_0x58c52f){_0x58c52f=_0x58c52f||0xc8;return function(_0x226e4a){if(_0x226e4a){return _0x1e9f8f[_0xa48f('0x18')](_0x58c52f)[_0xa48f('0x1a')](_0x226e4a);}};}function respondWithFilteredResult(_0x49e7a8,_0x478edc){return function(_0x8d838b){if(_0x8d838b){var _0x1bc047=typeof _0x478edc[_0xa48f('0x1b')]==='undefined'&&typeof _0x478edc[_0xa48f('0x1c')]===_0xa48f('0x1d');var _0x25595d=_0x8d838b[_0xa48f('0x1e')];var _0x5c3bc6=_0x1bc047?0x0:_0x478edc[_0xa48f('0x1b')];var _0x173ed2=_0x1bc047?_0x8d838b['count']:_0x478edc['offset']+_0x478edc[_0xa48f('0x1c')];var _0x1a2ae5;if(_0x173ed2>=_0x25595d){_0x173ed2=_0x25595d;_0x1a2ae5=0xc8;}else{_0x1a2ae5=0xce;}_0x49e7a8['status'](_0x1a2ae5);return _0x49e7a8[_0xa48f('0x1f')](_0xa48f('0x20'),_0x5c3bc6+'-'+_0x173ed2+'/'+_0x25595d)[_0xa48f('0x1a')](_0x8d838b);}return null;};}function patchUpdates(_0x2e5626){return function(_0x924f13){try{jsonpatch[_0xa48f('0x21')](_0x924f13,_0x2e5626,!![]);}catch(_0x1ad180){return BPromise['reject'](_0x1ad180);}return _0x924f13[_0xa48f('0x22')]();};}function saveUpdates(_0x243595,_0x21743c){return function(_0x5b825e){if(_0x5b825e){return _0x5b825e[_0xa48f('0x23')](_0x243595)[_0xa48f('0x24')](function(_0x3a298a){return _0x3a298a;});}return null;};}function removeEntity(_0x1d65b6,_0x9aba62){return function(_0x318fb9){if(_0x318fb9){return _0x318fb9[_0xa48f('0x25')]()[_0xa48f('0x24')](function(){var _0x5d9275=_0x318fb9[_0xa48f('0x26')]({'plain':!![]});var _0x914590=_0xa48f('0x27');return db[_0xa48f('0x28')][_0xa48f('0x25')]({'where':{'type':_0x914590,'resourceId':_0x5d9275['id']}})[_0xa48f('0x24')](function(){return _0x318fb9;});})[_0xa48f('0x24')](function(){_0x1d65b6['status'](0xcc)[_0xa48f('0x19')]();});}};}function handleEntityNotFound(_0x46a98e,_0x525bae){return function(_0xa70c4b){if(!_0xa70c4b){_0x46a98e[_0xa48f('0x17')](0x194);}return _0xa70c4b;};}function handleError(_0x58b264,_0x370906){_0x370906=_0x370906||0x1f4;return function(_0x3377ff){logger['error'](_0x3377ff[_0xa48f('0x29')]);if(_0x3377ff[_0xa48f('0x2a')]){delete _0x3377ff[_0xa48f('0x2a')];}_0x58b264['status'](_0x370906)[_0xa48f('0x2b')](_0x3377ff);};}exports[_0xa48f('0x2c')]=function(_0x506e31,_0x5be2bb){var _0x578735={},_0x1486d8={},_0x5ecef8={'count':0x0,'rows':[]};return db[_0xa48f('0x2d')][_0xa48f('0x2e')]()['then'](function(_0x506a7d){_0x1486d8[_0xa48f('0x2f')]=_[_0xa48f('0x30')](_0x506a7d);_0x1486d8[_0xa48f('0x31')]=_[_0xa48f('0x30')](_0x506e31[_0xa48f('0x31')]);_0x1486d8['filters']=_[_0xa48f('0x32')](_0x1486d8[_0xa48f('0x2f')],_0x1486d8['query']);_0x578735[_0xa48f('0x33')]=_[_0xa48f('0x32')](_0x1486d8['model'],qs[_0xa48f('0x34')](_0x506e31[_0xa48f('0x31')]['fields']));_0x578735[_0xa48f('0x33')]=_0x578735[_0xa48f('0x33')]['length']?_0x578735[_0xa48f('0x33')]:_0x1486d8[_0xa48f('0x2f')];if(!_0x506e31['query'][_0xa48f('0x35')]('nolimit')){_0x578735[_0xa48f('0x1c')]=qs[_0xa48f('0x1c')](_0x506e31[_0xa48f('0x31')][_0xa48f('0x1c')]);_0x578735[_0xa48f('0x1b')]=qs[_0xa48f('0x1b')](_0x506e31['query'][_0xa48f('0x1b')]);}_0x578735[_0xa48f('0x36')]=qs['sort'](_0x506e31[_0xa48f('0x31')][_0xa48f('0x37')]);_0x578735['where']=qs[_0xa48f('0x38')](_[_0xa48f('0x39')](_0x506e31[_0xa48f('0x31')],_0x1486d8[_0xa48f('0x38')]),_0x506a7d);if(_0x506e31[_0xa48f('0x31')][_0xa48f('0x3a')]){_0x578735[_0xa48f('0x3b')]=_[_0xa48f('0x3c')](_0x578735[_0xa48f('0x3b')],{'$or':_[_0xa48f('0x3d')](_0x578735[_0xa48f('0x33')],function(_0x3cce53){var _0x25c82c={};_0x25c82c[_0x3cce53]={'$like':'%'+_0x506e31['query'][_0xa48f('0x3a')]+'%'};return _0x25c82c;})});}_0x578735=_['merge']({},_0x578735,_0x506e31[_0xa48f('0x3e')]);var _0x123fde={'where':_0x578735[_0xa48f('0x3b')]};return db[_0xa48f('0x2d')][_0xa48f('0x1e')](_0x123fde)[_0xa48f('0x24')](function(_0x57ee16){_0x5ecef8[_0xa48f('0x1e')]=_0x57ee16;if(_0x506e31['query'][_0xa48f('0x3f')]){_0x578735['include']=[{'all':!![]}];}return db[_0xa48f('0x2d')][_0xa48f('0x40')](_0x578735);})[_0xa48f('0x24')](function(_0x3c1c1f){_0x5ecef8['rows']=_0x3c1c1f;return _0x5ecef8;})[_0xa48f('0x24')](respondWithFilteredResult(_0x5be2bb,_0x578735))['catch'](handleError(_0x5be2bb,null));})[_0xa48f('0x41')](handleError(_0x5be2bb,null));};exports[_0xa48f('0x42')]=function(_0x47eb3b,_0x421081){var _0x5104cc={'raw':![],'where':{'id':_0x47eb3b[_0xa48f('0x43')]['id']}},_0xace2a1={};_0xace2a1['model']=_[_0xa48f('0x30')](db['CmCompany'][_0xa48f('0x44')]);_0xace2a1[_0xa48f('0x31')]=_[_0xa48f('0x30')](_0x47eb3b[_0xa48f('0x31')]);_0xace2a1['filters']=_[_0xa48f('0x32')](_0xace2a1[_0xa48f('0x2f')],_0xace2a1[_0xa48f('0x31')]);_0x5104cc[_0xa48f('0x33')]=_['intersection'](_0xace2a1['model'],qs[_0xa48f('0x34')](_0x47eb3b[_0xa48f('0x31')]['fields']));_0x5104cc[_0xa48f('0x33')]=_0x5104cc['attributes'][_0xa48f('0x45')]?_0x5104cc[_0xa48f('0x33')]:_0xace2a1['model'];if(_0x47eb3b['query']['includeAll']){_0x5104cc['include']=[{'all':!![]}];}_0x5104cc=_[_0xa48f('0x3c')]({},_0x5104cc,_0x47eb3b['options']);return db['CmCompany'][_0xa48f('0x46')](_0x5104cc)[_0xa48f('0x24')](handleEntityNotFound(_0x421081,null))['then'](respondWithResult(_0x421081,null))['catch'](handleError(_0x421081,null));};exports[_0xa48f('0x47')]=function(_0x23ab79,_0x2b45b3){return db['CmCompany'][_0xa48f('0x47')](_0x23ab79[_0xa48f('0x48')],{})['then'](function(_0xa418e0){var _0x2c1b3b=_0x23ab79['user'][_0xa48f('0x26')]({'plain':!![]});if(!_0x2c1b3b)throw new Error(_0xa48f('0x49'));if(_0x2c1b3b[_0xa48f('0x4a')]===_0xa48f('0x4b')){var _0x314dbb=_0xa418e0[_0xa48f('0x26')]({'plain':!![]});var _0xe881d0=_0xa48f('0x27');return db[_0xa48f('0x4c')]['find']({'where':{'name':_0xe881d0,'userProfileId':_0x2c1b3b[_0xa48f('0x4d')]},'raw':!![]})['then'](function(_0x58166a){if(_0x58166a&&_0x58166a['autoAssociation']===0x0){return db[_0xa48f('0x28')]['create']({'name':_0x314dbb[_0xa48f('0x2a')],'resourceId':_0x314dbb['id'],'type':_0x58166a[_0xa48f('0x2a')],'sectionId':_0x58166a['id']},{})[_0xa48f('0x24')](function(){return _0xa418e0;});}else{return _0xa418e0;}})[_0xa48f('0x41')](function(_0x138c9a){logger[_0xa48f('0x4e')](_0xa48f('0x4f'),_0x138c9a);throw _0x138c9a;});}return _0xa418e0;})['then'](respondWithResult(_0x2b45b3,0xc9))['catch'](handleError(_0x2b45b3,null));};exports[_0xa48f('0x23')]=function(_0x4f031e,_0x573e4f){if(_0x4f031e['body']['id']){delete _0x4f031e['body']['id'];}return db[_0xa48f('0x2d')][_0xa48f('0x46')]({'where':{'id':_0x4f031e[_0xa48f('0x43')]['id']}})['then'](handleEntityNotFound(_0x573e4f,null))[_0xa48f('0x24')](saveUpdates(_0x4f031e[_0xa48f('0x48')],null))[_0xa48f('0x24')](respondWithResult(_0x573e4f,null))['catch'](handleError(_0x573e4f,null));};exports[_0xa48f('0x25')]=function(_0x21793a,_0x57fcb0){return db[_0xa48f('0x2d')]['find']({'where':{'id':_0x21793a[_0xa48f('0x43')]['id']}})[_0xa48f('0x24')](handleEntityNotFound(_0x57fcb0,null))[_0xa48f('0x24')](removeEntity(_0x57fcb0,null))[_0xa48f('0x41')](handleError(_0x57fcb0,null));};exports[_0xa48f('0x2e')]=function(_0x1e523f,_0x28bdba){return db[_0xa48f('0x2d')]['describe']()['then'](respondWithResult(_0x28bdba,null))[_0xa48f('0x41')](handleError(_0x28bdba,null));};exports[_0xa48f('0x50')]=function(_0x5b26ef,_0x41a54a,_0x3480c2){return db[_0xa48f('0x51')][_0xa48f('0x46')]({'where':{'id':_0x5b26ef[_0xa48f('0x43')]['id']}})['then'](handleEntityNotFound(_0x41a54a,null))[_0xa48f('0x24')](function(_0x49d438){if(_0x49d438){return _0x49d438[_0xa48f('0x50')](_0x5b26ef[_0xa48f('0x48')][_0xa48f('0x52')],_[_0xa48f('0x53')](_0x5b26ef[_0xa48f('0x48')],[_0xa48f('0x52'),'id'])||{});}})[_0xa48f('0x24')](respondWithResult(_0x41a54a,null))[_0xa48f('0x41')](handleError(_0x41a54a,null));};exports[_0xa48f('0x54')]=function(_0x42a3ee,_0x594249,_0x3cf829){var _0x13eb0f={};var _0x1490dd={};var _0x509880;var _0x5e5182;return db['CmCompany'][_0xa48f('0x55')]({'where':{'id':_0x42a3ee[_0xa48f('0x43')]['id']}})[_0xa48f('0x24')](handleEntityNotFound(_0x594249,null))[_0xa48f('0x24')](function(_0xfbf607){if(_0xfbf607){_0x509880=_0xfbf607;_0x1490dd[_0xa48f('0x2f')]=_['keys'](db[_0xa48f('0x51')][_0xa48f('0x44')]);_0x1490dd['query']=_[_0xa48f('0x30')](_0x42a3ee[_0xa48f('0x31')]);_0x1490dd[_0xa48f('0x38')]=_[_0xa48f('0x32')](_0x1490dd[_0xa48f('0x2f')],_0x1490dd['query']);_0x13eb0f[_0xa48f('0x33')]=_[_0xa48f('0x32')](_0x1490dd[_0xa48f('0x2f')],qs[_0xa48f('0x34')](_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x34')]));_0x13eb0f[_0xa48f('0x33')]=_0x13eb0f[_0xa48f('0x33')]['length']?_0x13eb0f['attributes']:_0x1490dd[_0xa48f('0x2f')];_0x13eb0f[_0xa48f('0x36')]=qs[_0xa48f('0x37')](_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x37')]);_0x13eb0f[_0xa48f('0x3b')]=qs['filters'](_[_0xa48f('0x39')](_0x42a3ee[_0xa48f('0x31')],_0x1490dd[_0xa48f('0x38')]));if(_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x3a')]){_0x13eb0f[_0xa48f('0x3b')]=_['merge'](_0x13eb0f[_0xa48f('0x3b')],{'$or':_[_0xa48f('0x3d')](_0x13eb0f[_0xa48f('0x33')],function(_0x44a810){var _0x5acbe1={};_0x5acbe1[_0x44a810]={'$like':'%'+_0x42a3ee[_0xa48f('0x31')]['filter']+'%'};return _0x5acbe1;})});}_0x13eb0f=_[_0xa48f('0x3c')]({},_0x13eb0f,_0x42a3ee[_0xa48f('0x3e')]);return _0x509880[_0xa48f('0x54')](_0x13eb0f);}})[_0xa48f('0x24')](function(_0x575545){if(_0x575545){_0x5e5182=_0x575545['length'];if(!_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x35')](_0xa48f('0x56'))){_0x13eb0f[_0xa48f('0x1c')]=qs[_0xa48f('0x1c')](_0x42a3ee[_0xa48f('0x31')][_0xa48f('0x1c')]);_0x13eb0f[_0xa48f('0x1b')]=qs[_0xa48f('0x1b')](_0x42a3ee['query']['offset']);}return _0x509880[_0xa48f('0x54')](_0x13eb0f);}})[_0xa48f('0x24')](function(_0x163eaf){if(_0x163eaf){return _0x163eaf?{'count':_0x5e5182,'rows':_0x163eaf}:null;}})[_0xa48f('0x24')](respondWithResult(_0x594249,null))[_0xa48f('0x41')](handleError(_0x594249,null));}; \ No newline at end of file +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 diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 12d4ff2..cbc6cb4 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 _0x2e88=['define','CmCompany','cm_companies','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x5a6961,_0xd41ca6){var _0x4af0a6=function(_0x1201fe){while(--_0x1201fe){_0x5a6961['push'](_0x5a6961['shift']());}};_0x4af0a6(++_0xd41ca6);}(_0x2e88,0xdf));var _0x82e8=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x2e88[_0x213518];return _0x1baf75;};'use strict';var _=require(_0x82e8('0x0'));var util=require('util');var logger=require(_0x82e8('0x1'))(_0x82e8('0x2'));var moment=require('moment');var BPromise=require(_0x82e8('0x3'));var rp=require(_0x82e8('0x4'));var fs=require('fs');var path=require(_0x82e8('0x5'));var rimraf=require('rimraf');var config=require(_0x82e8('0x6'));var attributes=require('./cmCompany.attributes');module[_0x82e8('0x7')]=function(_0xab2455,_0x2210d8){return _0xab2455[_0x82e8('0x8')](_0x82e8('0x9'),attributes,{'tableName':_0x82e8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 51c7e7b..05eb7c5 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 _0xdc99=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xdc99,0x1d4));var _0x9dc9=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xdc99[_0x279d37];return _0x530173;};'use strict';var _=require(_0x9dc9('0x0'));var util=require(_0x9dc9('0x1'));var moment=require(_0x9dc9('0x2'));var BPromise=require(_0x9dc9('0x3'));var rs=require(_0x9dc9('0x4'));var fs=require('fs');var Redis=require(_0x9dc9('0x5'));var db=require(_0x9dc9('0x6'))['db'];var utils=require(_0x9dc9('0x7'));var logger=require(_0x9dc9('0x8'))(_0x9dc9('0x9'));var config=require(_0x9dc9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x9dc9('0xb')][_0x9dc9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x199d80,_0x90ffa1,_0x3f8fd1){return new BPromise(function(_0x33da5a,_0x5cd875){return client[_0x9dc9('0xd')](_0x199d80,_0x3f8fd1)[_0x9dc9('0xe')](function(_0x46a0be){logger['info'](_0x9dc9('0xf'),_0x90ffa1,_0x9dc9('0x10'));logger[_0x9dc9('0x11')](_0x9dc9('0x12'),_0x90ffa1,_0x9dc9('0x10'),JSON[_0x9dc9('0x13')](_0x46a0be));if(_0x46a0be[_0x9dc9('0x14')]){if(_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x15')]===0x1f4){logger['error'](_0x9dc9('0xf'),_0x90ffa1,_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x16')]);return _0x5cd875(_0x46a0be['error']['message']);}logger['error'](_0x9dc9('0xf'),_0x90ffa1,_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x16')]);return _0x33da5a(_0x46a0be[_0x9dc9('0x14')][_0x9dc9('0x16')]);}else{logger[_0x9dc9('0x17')](_0x9dc9('0xf'),_0x90ffa1,_0x9dc9('0x10'));_0x33da5a(_0x46a0be['result'][_0x9dc9('0x16')]);}})[_0x9dc9('0x18')](function(_0x2e01cd){logger['error']('CmCompany,\x20%s,\x20%s',_0x90ffa1,_0x2e01cd);_0x5cd875(_0x2e01cd);});});} \ No newline at end of file +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 diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 95203c1..75b52ba 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 _0xc5f8=['destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','put'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0xc5f8,0x109));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x8c5f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8c5f('0x1'));var express=require(_0x8c5f('0x2'));var router=express['Router']();var fs_extra=require(_0x8c5f('0x3'));var auth=require(_0x8c5f('0x4'));var interaction=require(_0x8c5f('0x5'));var config=require(_0x8c5f('0x6'));var controller=require(_0x8c5f('0x7'));router['get']('/',auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x9')]);router[_0x8c5f('0xa')](_0x8c5f('0xb'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0xc')]);router['get'](_0x8c5f('0xd'),auth['isAuthenticated'](),controller[_0x8c5f('0xe')]);router[_0x8c5f('0xa')](_0x8c5f('0xf'),auth['isAuthenticated'](),controller[_0x8c5f('0x10')]);router[_0x8c5f('0x11')]('/',auth['isAuthenticated'](),controller[_0x8c5f('0x12')]);router['post'](_0x8c5f('0xf'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x13')]);router[_0x8c5f('0x14')](_0x8c5f('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x8c5f('0xd'),auth[_0x8c5f('0x8')](),controller[_0x8c5f('0x15')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index b6ec87a..2d9d11f 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 _0x0e24=['UNSIGNED','NOW','lodash','exports','STRING','TEXT','INTEGER'];(function(_0x333349,_0x15b189){var _0x135978=function(_0x2cc6ce){while(--_0x2cc6ce){_0x333349['push'](_0x333349['shift']());}};_0x135978(++_0x15b189);}(_0x0e24,0xc6));var _0x40e2=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x0e24[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0x40e2('0x0'));var Sequelize=require('sequelize');module[_0x40e2('0x1')]={'firstName':{'type':Sequelize[_0x40e2('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x40e2('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x40e2('0x2')]},'city':{'type':Sequelize[_0x40e2('0x2')]},'country':{'type':Sequelize[_0x40e2('0x2')]},'dateOfBirth':{'type':Sequelize[_0x40e2('0x2')]},'description':{'type':Sequelize[_0x40e2('0x3')]},'phone':{'type':Sequelize[_0x40e2('0x2')]},'mobile':{'type':Sequelize[_0x40e2('0x2')]},'fax':{'type':Sequelize[_0x40e2('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x40e2('0x2')]},'facebook':{'type':Sequelize[_0x40e2('0x2')]},'fb_data':{'type':Sequelize[_0x40e2('0x2')]},'twitter':{'type':Sequelize[_0x40e2('0x2')]},'skype':{'type':Sequelize[_0x40e2('0x2')]},'teams':{'type':Sequelize[_0x40e2('0x2')]},'viber':{'type':Sequelize[_0x40e2('0x2')]},'line':{'type':Sequelize[_0x40e2('0x2')]},'wechat':{'type':Sequelize[_0x40e2('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x40e2('0x4')]},'priority':{'type':Sequelize[_0x40e2('0x4')](0x2)[_0x40e2('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x40e2('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index a5a3668..d7395b5 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 _0x1722=['getJourney','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','channel','includes','toLowerCase','Invalid\x20channel','parse','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','destination','callerid','starttime','endtime','note','userDisposition','userThirdDisposition','UserId','alias','createdAt','DESC','findAndCountAll','fullname','startCase','Website','Account','closed','closedAt','disposition','thirdDisposition','Owner','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','mail','subject','substatus','externalUrl','Interaction','all','flatten','sortBy','slice','moment','bluebird','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','status','json','undefined','limit','offset','set','update','destroy','then','end','sendStatus','stack','name','send','index','CmContact','describe','keys','length','cf_','push','CmCustomField','findOne','fieldType','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','value','buildExpression','start','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','isArray','tag','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','resolve','user','role','agent','some','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','count','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.email','c.ListId','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','startsWith','displayName','findAll','columnName','custom','values','merge','body','get','mergeWith','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','Tag','omit','format','cf_%d','$and','pickBy','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','filters','setTags','ids','getHoppers','CmHopper','options','include','ContactId','includeAll','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','No\x20phone\x20column\x20specified','firstName','root','filename','chmodSync','0777','fork','pid','upload','createReadStream','file','meta','import','binding','No\x20firstName\x20column\x20specified','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1722,0x152));var _0x2172=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1722[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x2172('0x0'));var BPromise=require(_0x2172('0x1'));var util=require('util');var path=require(_0x2172('0x2'));var fs=require('fs');var _=require(_0x2172('0x3'));var squel=require(_0x2172('0x4'));var Papa=require(_0x2172('0x5'));var Redis=require(_0x2172('0x6'));var qs=require(_0x2172('0x7'));var as=require(_0x2172('0x8'));var logger=require(_0x2172('0x9'))(_0x2172('0xa'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x2172('0xb')]=_[_0x2172('0xc')](config['redis'],{'host':_0x2172('0xd'),'port':0x18eb});var socket=require(_0x2172('0xe'))(new Redis(config[_0x2172('0xb')]));require('./cmContact.socket')['register'](socket);function respondWithResult(_0x152ed2,_0x162e6d){_0x162e6d=_0x162e6d||0xc8;return function(_0x2c89d2){if(_0x2c89d2){return _0x152ed2[_0x2172('0xf')](_0x162e6d)[_0x2172('0x10')](_0x2c89d2);}};}function respondWithFilteredResult(_0xc9cac0,_0x2f314c){return function(_0x198431){if(_0x198431){var _0x4cf9f6=typeof _0x2f314c['offset']===_0x2172('0x11')&&typeof _0x2f314c[_0x2172('0x12')]===_0x2172('0x11');var _0x59962d=_0x198431['count'];var _0x27f6cd=_0x4cf9f6?0x0:_0x2f314c[_0x2172('0x13')];var _0x5884b5=_0x4cf9f6?_0x198431['count']:_0x2f314c[_0x2172('0x13')]+_0x2f314c[_0x2172('0x12')];var _0x309532;if(_0x5884b5>=_0x59962d){_0x5884b5=_0x59962d;_0x309532=0xc8;}else{_0x309532=0xce;}_0xc9cac0[_0x2172('0xf')](_0x309532);return _0xc9cac0[_0x2172('0x14')]('Content-Range',_0x27f6cd+'-'+_0x5884b5+'/'+_0x59962d)[_0x2172('0x10')](_0x198431);}return null;};}function saveUpdates(_0xa897fc){return function(_0x13bce3){if(_0x13bce3){return _0x13bce3[_0x2172('0x15')](_0xa897fc)['then'](function(_0x20c71d){return _0x20c71d;});}return null;};}function removeEntity(_0x583125){return function(_0x2c4d02){if(_0x2c4d02){return _0x2c4d02[_0x2172('0x16')]()[_0x2172('0x17')](function(){_0x583125['status'](0xcc)[_0x2172('0x18')]();});}};}function handleEntityNotFound(_0x55e42f){return function(_0x2e368a){if(!_0x2e368a){_0x55e42f[_0x2172('0x19')](0x194);}return _0x2e368a;};}function handleError(_0x24644b,_0x1ff79b){_0x1ff79b=_0x1ff79b||0x1f4;return function(_0x41e612){logger['error'](_0x41e612[_0x2172('0x1a')]);if(_0x41e612[_0x2172('0x1b')]){delete _0x41e612[_0x2172('0x1b')];}_0x24644b['status'](_0x1ff79b)[_0x2172('0x1c')](_0x41e612);};}exports[_0x2172('0x1d')]=function(_0x387632,_0x3feda3){var _0x1e1615={},_0x3ac581={},_0x3d0888={'count':0x0,'rows':[]};return db[_0x2172('0x1e')][_0x2172('0x1f')]()[_0x2172('0x17')](function(_0x2979b7){var _0x6e27c=[];for(var _0x36a535=0x0;_0x36a5350x1){_0x9d80fe['or'](_0x2172('0x59'),qs[_0x2172('0x5a')](_0x2d2fd5),null);}else{if(qs['isNumeric'](_0x2d2fd5)){_0x9d80fe['or'](_0x2172('0x5b'),_0x2d2fd5+'%');_0x9d80fe['or'](_0x2172('0x5c'),_0x2d2fd5+'%');_0x9d80fe['or']('c.mobile\x20LIKE\x20?',_0x2d2fd5+'%');_0x9d80fe['or'](_0x2172('0x5d'),_0x2d2fd5+'%');}else if(qs[_0x2172('0x5e')](_0x2d2fd5)){_0x9d80fe['or'](_0x2172('0x5f'),_0x2d2fd5+'%');}else{_0x9d80fe['or']('c.firstName\x20LIKE\x20?','%'+_0x2d2fd5+'%');_0x9d80fe['or'](_0x2172('0x60'),'%'+_0x2d2fd5+'%');_0x9d80fe['or'](_0x2172('0x5f'),'%'+_0x2d2fd5+'%');}}}}_0x5e0aba[_0x2172('0x31')](_0x9d80fe);_0x5e0aba[_0x2172('0x61')](_0x2172('0x62'));var _0x5c608f={'type':db[_0x2172('0x63')][_0x2172('0x64')][_0x2172('0x65')],'raw':!![]};var _0x2a4ae1=_0x5e0aba[_0x2172('0x66')]()[_0x2172('0x34')](_0x2172('0x62'));if(_0x1e1615[_0x2172('0x2f')]){_0x1e1615['order'][_0x2172('0x44')](function(_0x4c0043){_0x5e0aba[_0x2172('0x2f')]('c.'+_0x4c0043[0x0],_0x4c0043[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2172('0x50')](_0x39d233)){_0x5e0aba[_0x2172('0x67')](_0x5c1e93);_0x2a4ae1[_0x2172('0x31')](_0x2172('0x68'),_0x39d233);}BPromise[_0x2172('0x69')]()[_0x2172('0x17')](function(){if(!_0x13ec1b)return;if(_0x387632[_0x2172('0x6a')][_0x2172('0x6b')]!==_0x2172('0x6c'))return;if(!_[_0x2172('0x6d')](_0x13ec1b[_0x2172('0x40')],['field',_0x2172('0x47')])){return _0x387632[_0x2172('0x6a')][_0x2172('0x6e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3eea4d){if(_[_0x2172('0x50')](_0x3eea4d)){_0x2a4ae1[_0x2172('0x31')]('c.ListId\x20IS\x20NULL');_0x5e0aba[_0x2172('0x31')](_0x2172('0x6f'));}else{_0x2a4ae1[_0x2172('0x31')]('c.ListId\x20IN\x20?',_['map'](_0x3eea4d,'id'));_0x5e0aba[_0x2172('0x31')](_0x2172('0x52'),_[_0x2172('0x43')](_0x3eea4d,'id'));}});}})[_0x2172('0x17')](function(){if(_0x387632['user'][_0x2172('0x6b')]===_0x2172('0x6c')&&!_0x13ec1b&&!_0x387632[_0x2172('0x29')][_0x2172('0x51')])return[];return db[_0x2172('0x70')][_0x2172('0x29')](_0x2a4ae1[_0x2172('0x71')](),_0x5c608f);})['then'](function(_0x3c506e){_0x3d0888[_0x2172('0x72')]=_0x3c506e[_0x2172('0x21')];if(_0x3d0888[_0x2172('0x72')]===0x0)return[];return db[_0x2172('0x70')][_0x2172('0x29')](_0x277854[_0x2172('0x71')](),_0x5c608f)[_0x2172('0x17')](function(_0x3db31f){_0x83b755=_['keyBy'](_0x3db31f,'id');_0x5c608f=_['merge'](_0x5c608f,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x387632[_0x2172('0x29')]['fields']){_0x1e1615[_0x2172('0x2b')][_0x2172('0x44')](function(_0xc17460){_0x5e0aba[_0x2172('0x34')]('c.'+_0xc17460);});}else{_0x5e0aba[_0x2172('0x34')](_0x2172('0x62'));_0x5e0aba[_0x2172('0x34')](_0x2172('0x73'));_0x5e0aba[_0x2172('0x34')](_0x2172('0x74'));_0x5e0aba['field'](_0x2172('0x75'));_0x5e0aba[_0x2172('0x34')](_0x2172('0x76'));_0x5e0aba[_0x2172('0x34')](_0x2172('0x77'));_0x5e0aba[_0x2172('0x34')](_0x2172('0x78'));_0x5e0aba['field'](_0x2172('0x79'));_0x5e0aba['field']('c.createdAt');_0x5e0aba['field']('c.deletedAt');_0x5e0aba[_0x2172('0x34')](_0x2172('0x7a'));_0x5e0aba['field'](_0x2172('0x7b'),_0x2172('0x7c'));}if(_0x1e1615[_0x2172('0x12')])_0x5e0aba[_0x2172('0x12')](_0x1e1615[_0x2172('0x12')]);if(_0x1e1615[_0x2172('0x13')])_0x5e0aba[_0x2172('0x13')](_0x1e1615[_0x2172('0x13')]);return db[_0x2172('0x70')][_0x2172('0x29')](_0x5e0aba[_0x2172('0x71')](),_0x5c608f);});})[_0x2172('0x17')](function(_0x372116){_0x372116[_0x2172('0x44')](function(_0x4ab7bf){if(_0x4ab7bf[_0x2172('0x7c')]){_0x4ab7bf[_0x2172('0x7d')]=[];_0x4ab7bf['TagIds']['split'](',')[_0x2172('0x44')](function(_0x198785){_0x4ab7bf['Tags'][_0x2172('0x23')](_0x83b755[_0x198785]);});}delete _0x4ab7bf[_0x2172('0x7c')];});_0x3d0888[_0x2172('0x7e')]=_0x372116;return _0x3d0888;})['then'](respondWithFilteredResult(_0x3feda3,_0x1e1615));})[_0x2172('0x7f')](handleError(_0x3feda3,null));};exports['destroy']=function(_0x457bdb,_0x477063){return db[_0x2172('0x1e')][_0x2172('0x41')]({'where':{'id':_0x457bdb[_0x2172('0x80')]['id']}})[_0x2172('0x17')](handleEntityNotFound(_0x477063,null))[_0x2172('0x17')](removeEntity(_0x477063,null))['catch'](handleError(_0x477063,null));};exports[_0x2172('0x1f')]=function(_0xac51d6,_0x54beaa){return db[_0x2172('0x1e')]['describe']()['then'](function(_0x50a1d4){delete _0x50a1d4[_0x2172('0x81')];for(var _0x139c8f=0x0;_0x139c8f=_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{}\s\\|]/g,'-');_0x120114(null,util[_0x212b('0x20')](_0x212b('0x21'),path[_0x212b('0x22')](_0x33cd9f[_0x212b('0x1f')],path[_0x212b('0x23')](_0x33cd9f[_0x212b('0x1f')])),Date[_0x212b('0x24')](),path[_0x212b('0x23')](_0x33cd9f[_0x212b('0x1f')])));}})});router[_0x212b('0x15')]('/csv',upload[_0x212b('0x25')](_0x212b('0x26')),controller[_0x212b('0x27')]);var upload=multer({'storage':multer[_0x212b('0x1b')]({'destination':function(_0x5a8ad9,_0x470f9b,_0x494ca6){_0x494ca6(null,path[_0x212b('0x1c')](config['root'],_0x212b('0x1e')));},'filename':function(_0x5b2624,_0x130264,_0x37718c){_0x130264[_0x212b('0x1f')]=_0x130264[_0x212b('0x1f')][_0x212b('0x28')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37718c(null,util['format'](_0x212b('0x21'),path[_0x212b('0x22')](_0x130264[_0x212b('0x1f')],path['extname'](_0x130264[_0x212b('0x1f')])),Date[_0x212b('0x24')](),path['extname'](_0x130264[_0x212b('0x1f')])));}})});router[_0x212b('0x15')](_0x212b('0x29'),upload[_0x212b('0x25')](_0x212b('0x26')),controller[_0x212b('0x2a')]);router[_0x212b('0x15')]('/upload/:id',auth[_0x212b('0x9')](),controller[_0x212b('0x2b')]);router[_0x212b('0x2c')](_0x212b('0xc'),auth[_0x212b('0x9')](),controller['update']);router[_0x212b('0x2d')](_0x212b('0xc'),auth[_0x212b('0x9')](),controller[_0x212b('0x2e')]);module[_0x212b('0x2f')]=router; \ No newline at end of file +var _0x3117=['index','/describe','get','/:id','/:id/tags','getTags','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','getJourney','post','/merge','merge','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','format','%s-%s%s','extname','/csv','file','uploadCsv','basename','now','/upload','upload','/upload/:id','import','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3117,0x129));var _0x7311=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0x3117[_0x510b98];return _0x45e775;};'use strict';var multer=require(_0x7311('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7311('0x1'));var express=require(_0x7311('0x2'));var router=express[_0x7311('0x3')]();var fs_extra=require(_0x7311('0x4'));var auth=require(_0x7311('0x5'));var interaction=require(_0x7311('0x6'));var config=require(_0x7311('0x7'));var controller=require('./cmContact.controller');router['get']('/',auth[_0x7311('0x8')](),controller[_0x7311('0x9')]);router['get'](_0x7311('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x7311('0xb')](_0x7311('0xc'),auth[_0x7311('0x8')](),controller['show']);router[_0x7311('0xb')](_0x7311('0xd'),auth['isAuthenticated'](),controller[_0x7311('0xe')]);router[_0x7311('0xb')](_0x7311('0xf'),auth[_0x7311('0x8')](),controller[_0x7311('0x10')]);router[_0x7311('0xb')]('/:id/hopper_histories',auth[_0x7311('0x8')](),controller[_0x7311('0x11')]);router[_0x7311('0xb')](_0x7311('0x12'),auth[_0x7311('0x8')](),controller[_0x7311('0x13')]);router['get']('/:id/jscripty_sessions',auth[_0x7311('0x8')](),controller[_0x7311('0x14')]);router[_0x7311('0xb')]('/:id/journey',auth[_0x7311('0x8')](),controller[_0x7311('0x15')]);router[_0x7311('0x16')](_0x7311('0x17'),auth['isAuthenticated'](),controller[_0x7311('0x18')]);router['post']('/',auth[_0x7311('0x8')](),controller['create']);router[_0x7311('0x16')](_0x7311('0x19'),auth['isAuthenticated'](),controller[_0x7311('0x1a')]);router[_0x7311('0x16')](_0x7311('0xd'),auth[_0x7311('0x8')](),controller[_0x7311('0x1b')]);var upload=multer({'storage':multer[_0x7311('0x1c')]({'destination':function(_0x238ba9,_0x49a9a9,_0x499dc4){_0x499dc4(null,path[_0x7311('0x1d')](config[_0x7311('0x1e')],_0x7311('0x1f')));},'filename':function(_0x49829a,_0x45dbd1,_0x187d93){_0x45dbd1[_0x7311('0x20')]=_0x45dbd1[_0x7311('0x20')][_0x7311('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\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 diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 7016060..97559de 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 _0x8af1=['values','BOOLEAN','ENUM','voice','sequelize','exports','VIRTUAL','alias','STRING','setDataValue','getDataValue','name','TEXT','long','select'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8af1,0x1f3));var _0x18af=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x8af1[_0xd73d53];return _0x560148;};'use strict';var Sequelize=require(_0x18af('0x0'));var _=require('lodash');module[_0x18af('0x1')]={'name':{'type':Sequelize[_0x18af('0x2')],'get':function(_0x3f2422){return this['getDataValue'](_0x18af('0x3'));}},'alias':{'type':Sequelize[_0x18af('0x4')],'allowNull':![],'set':function(_0x557e23){this[_0x18af('0x5')]('alias',_0x557e23?_0x557e23:this[_0x18af('0x6')](_0x18af('0x7')));}},'type':{'type':Sequelize[_0x18af('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x18af('0x8')](_0x18af('0x9')),'get':function(){if(this['getDataValue']('type')===_0x18af('0xa')){return JSON['parse'](this[_0x18af('0x6')](_0x18af('0xb')));}else{return this['getDataValue']('values');}},'set':function(_0x34ec4b){if(Array['isArray'](_0x34ec4b)){this['setDataValue'](_0x18af('0xb'),JSON['stringify'](_0x34ec4b));}else{this['setDataValue']('values',_0x34ec4b);}}},'required':{'type':Sequelize[_0x18af('0xc')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x18af('0xd')](_0x18af('0xe'))}}; \ No newline at end of file +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 diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index d088879..4239cf2 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 _0x1268=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save','then','error','name','send','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','destroy','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv'];(function(_0x51f4cd,_0x2632cb){var _0x110f98=function(_0x316235){while(--_0x316235){_0x51f4cd['push'](_0x51f4cd['shift']());}};_0x110f98(++_0x2632cb);}(_0x1268,0x102));var _0x8126=function(_0xa4a1a5,_0xee69c8){_0xa4a1a5=_0xa4a1a5-0x0;var _0x5ba5f9=_0x1268[_0xa4a1a5];return _0x5ba5f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8126('0x0'));var zipdir=require(_0x8126('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8126('0x2'));var moment=require(_0x8126('0x3'));var BPromise=require(_0x8126('0x4'));var Mustache=require(_0x8126('0x5'));var util=require('util');var path=require(_0x8126('0x6'));var sox=require(_0x8126('0x7'));var csv=require(_0x8126('0x8'));var ejs=require(_0x8126('0x9'));var fs=require('fs');var fs_extra=require(_0x8126('0xa'));var _=require('lodash');var squel=require(_0x8126('0xb'));var crypto=require(_0x8126('0xc'));var jsforce=require(_0x8126('0xd'));var deskjs=require(_0x8126('0xe'));var toCsv=require(_0x8126('0x8'));var querystring=require(_0x8126('0xf'));var Papa=require(_0x8126('0x10'));var Redis=require('ioredis');var authService=require(_0x8126('0x11'));var qs=require(_0x8126('0x12'));var as=require(_0x8126('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8126('0x14'))('api');var utils=require(_0x8126('0x15'));var config=require(_0x8126('0x16'));var licenseUtil=require(_0x8126('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x25cc9f,_0x3530e2){_0x3530e2=_0x3530e2||0xcc;return function(_0x4482f5){if(_0x4482f5){return _0x25cc9f[_0x8126('0x18')](_0x3530e2);}return _0x25cc9f['status'](_0x3530e2)[_0x8126('0x19')]();};}function respondWithResult(_0xa973d0,_0x22a2c6){_0x22a2c6=_0x22a2c6||0xc8;return function(_0x1de6e1){if(_0x1de6e1){return _0xa973d0['status'](_0x22a2c6)[_0x8126('0x1a')](_0x1de6e1);}};}function respondWithFilteredResult(_0x38e07b,_0x4ea459){return function(_0x4e0a44){if(_0x4e0a44){var _0x4547cf=typeof _0x4ea459[_0x8126('0x1b')]===_0x8126('0x1c')&&typeof _0x4ea459[_0x8126('0x1d')]==='undefined';var _0x3210b7=_0x4e0a44[_0x8126('0x1e')];var _0x285b21=_0x4547cf?0x0:_0x4ea459[_0x8126('0x1b')];var _0x1f7507=_0x4547cf?_0x4e0a44[_0x8126('0x1e')]:_0x4ea459['offset']+_0x4ea459[_0x8126('0x1d')];var _0x189d8d;if(_0x1f7507>=_0x3210b7){_0x1f7507=_0x3210b7;_0x189d8d=0xc8;}else{_0x189d8d=0xce;}_0x38e07b[_0x8126('0x1f')](_0x189d8d);return _0x38e07b[_0x8126('0x20')](_0x8126('0x21'),_0x285b21+'-'+_0x1f7507+'/'+_0x3210b7)['json'](_0x4e0a44);}return null;};}function patchUpdates(_0x27eba1){return function(_0x362c9f){try{jsonpatch[_0x8126('0x22')](_0x362c9f,_0x27eba1,!![]);}catch(_0x34a616){return BPromise['reject'](_0x34a616);}return _0x362c9f[_0x8126('0x23')]();};}function saveUpdates(_0x409d85,_0x4ab8b9){return function(_0x277c2e){if(_0x277c2e){return _0x277c2e['update'](_0x409d85)[_0x8126('0x24')](function(_0x44d145){return _0x44d145;});}return null;};}function removeEntity(_0x37aac1,_0x1826fb){return function(_0x37ae97){if(_0x37ae97){return _0x37ae97['destroy']()[_0x8126('0x24')](function(){_0x37aac1[_0x8126('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x872c40,_0x412ef4){return function(_0xafe6ce){if(!_0xafe6ce){_0x872c40[_0x8126('0x18')](0x194);}return _0xafe6ce;};}function handleError(_0x2ce29d,_0x2f84da){_0x2f84da=_0x2f84da||0x1f4;return function(_0x36fb4b){logger[_0x8126('0x25')](_0x36fb4b['stack']);if(_0x36fb4b['name']){delete _0x36fb4b[_0x8126('0x26')];}_0x2ce29d['status'](_0x2f84da)[_0x8126('0x27')](_0x36fb4b);};}exports[_0x8126('0x28')]=function(_0x57d02f,_0x2cb3a7){var _0x4e0a19={},_0x188c07={},_0x3d62b2={'count':0x0,'rows':[]};var _0x262160=_[_0x8126('0x29')](db[_0x8126('0x2a')][_0x8126('0x2b')],function(_0x38f53b){return{'name':_0x38f53b['fieldName'],'type':_0x38f53b[_0x8126('0x2c')][_0x8126('0x2d')]};});_0x188c07[_0x8126('0x2e')]=_[_0x8126('0x2f')](_[_0x8126('0x29')](_0x262160,_0x8126('0x26')),['name']);_0x188c07[_0x8126('0x30')]=_[_0x8126('0x31')](_0x57d02f[_0x8126('0x30')]);_0x188c07[_0x8126('0x32')]=_[_0x8126('0x33')](_0x188c07[_0x8126('0x2e')],_0x188c07[_0x8126('0x30')]);_0x4e0a19[_0x8126('0x34')]=_[_0x8126('0x33')](_0x188c07[_0x8126('0x2e')],qs[_0x8126('0x35')](_0x57d02f['query'][_0x8126('0x35')]));_0x4e0a19['attributes']=_0x4e0a19[_0x8126('0x34')][_0x8126('0x36')]?_0x4e0a19[_0x8126('0x34')]:_0x188c07[_0x8126('0x2e')];if(!_0x57d02f['query'][_0x8126('0x37')](_0x8126('0x38'))){_0x4e0a19[_0x8126('0x1d')]=qs[_0x8126('0x1d')](_0x57d02f[_0x8126('0x30')][_0x8126('0x1d')]);_0x4e0a19[_0x8126('0x1b')]=qs['offset'](_0x57d02f[_0x8126('0x30')][_0x8126('0x1b')]);}_0x4e0a19[_0x8126('0x39')]=qs[_0x8126('0x3a')](_0x57d02f[_0x8126('0x30')][_0x8126('0x3a')]);_0x4e0a19[_0x8126('0x3b')]=qs[_0x8126('0x32')](_[_0x8126('0x3c')](_0x57d02f[_0x8126('0x30')],_0x188c07[_0x8126('0x32')]),_0x262160);if(_0x57d02f[_0x8126('0x30')][_0x8126('0x3d')]){_0x4e0a19[_0x8126('0x3b')]=_[_0x8126('0x3e')](_0x4e0a19[_0x8126('0x3b')],{'$or':_['map'](_0x262160,function(_0xecef4a){if(_0xecef4a[_0x8126('0x2c')]!==_0x8126('0x3f')){var _0x2ba2fa={};_0x2ba2fa[_0xecef4a[_0x8126('0x26')]]={'$like':'%'+_0x57d02f[_0x8126('0x30')][_0x8126('0x3d')]+'%'};return _0x2ba2fa;}})});}_0x4e0a19=_[_0x8126('0x3e')]({},_0x4e0a19,_0x57d02f[_0x8126('0x40')]);var _0x3c8e0e={'where':_0x4e0a19[_0x8126('0x3b')]};return db[_0x8126('0x2a')][_0x8126('0x1e')](_0x3c8e0e)['then'](function(_0x1942b6){_0x3d62b2[_0x8126('0x1e')]=_0x1942b6;if(_0x57d02f['query'][_0x8126('0x41')]){_0x4e0a19[_0x8126('0x42')]=[{'all':!![]}];}return db[_0x8126('0x2a')][_0x8126('0x43')](_0x4e0a19);})[_0x8126('0x24')](function(_0x8e300e){_0x3d62b2[_0x8126('0x44')]=_0x8e300e;return _0x3d62b2;})[_0x8126('0x24')](respondWithFilteredResult(_0x2cb3a7,_0x4e0a19))[_0x8126('0x45')](handleError(_0x2cb3a7,null));};exports['show']=function(_0x1d5a1e,_0x470492){var _0x378be3={'raw':!![],'where':{'id':_0x1d5a1e[_0x8126('0x46')]['id']}},_0x483fd0={};_0x483fd0[_0x8126('0x2e')]=_[_0x8126('0x31')](db[_0x8126('0x2a')][_0x8126('0x2b')]);_0x483fd0['query']=_['keys'](_0x1d5a1e['query']);_0x483fd0[_0x8126('0x32')]=_['intersection'](_0x483fd0[_0x8126('0x2e')],_0x483fd0[_0x8126('0x30')]);_0x378be3[_0x8126('0x34')]=_[_0x8126('0x33')](_0x483fd0[_0x8126('0x2e')],qs['fields'](_0x1d5a1e[_0x8126('0x30')][_0x8126('0x35')]));_0x378be3[_0x8126('0x34')]=_0x378be3[_0x8126('0x34')][_0x8126('0x36')]?_0x378be3['attributes']:_0x483fd0[_0x8126('0x2e')];if(_0x1d5a1e[_0x8126('0x30')][_0x8126('0x41')]){_0x378be3[_0x8126('0x42')]=[{'all':!![]}];}_0x378be3=_['merge']({},_0x378be3,_0x1d5a1e[_0x8126('0x40')]);return db[_0x8126('0x2a')][_0x8126('0x47')](_0x378be3)[_0x8126('0x24')](handleEntityNotFound(_0x470492,null))[_0x8126('0x24')](respondWithResult(_0x470492,null))['catch'](handleError(_0x470492,null));};exports['update']=function(_0x180330,_0x39599a){if(_0x180330['body']['id']){delete _0x180330[_0x8126('0x48')]['id'];}return db[_0x8126('0x2a')][_0x8126('0x47')]({'where':{'id':_0x180330['params']['id']}})[_0x8126('0x24')](handleEntityNotFound(_0x39599a,null))[_0x8126('0x24')](saveUpdates(_0x180330[_0x8126('0x48')],null))[_0x8126('0x24')](respondWithResult(_0x39599a,null))[_0x8126('0x45')](handleError(_0x39599a,null));};exports[_0x8126('0x49')]=function(_0xeff040,_0x37297d){return db[_0x8126('0x2a')][_0x8126('0x47')]({'where':{'id':_0xeff040['params']['id']}})['then'](handleEntityNotFound(_0x37297d,null))[_0x8126('0x24')](removeEntity(_0x37297d,null))[_0x8126('0x45')](handleError(_0x37297d,null));};exports[_0x8126('0x4a')]=function(_0x1dd0c9,_0x4d9656){var _0x2ac4c6;return db[_0x8126('0x4b')][_0x8126('0x4c')](function(_0x5217f7){return db[_0x8126('0x2a')]['create'](_0x1dd0c9[_0x8126('0x48')],{'transaction':_0x5217f7})[_0x8126('0x24')](function(_0x1ee589){_0x2ac4c6=_0x1ee589;var _0x3b2e18={'type':db[_0x8126('0x4d')][_0x8126('0x4e')],'transaction':_0x5217f7};switch(_0x1dd0c9[_0x8126('0x48')][_0x8126('0x2c')]){case _0x8126('0x4f'):_0x3b2e18[_0x8126('0x2c')]=db[_0x8126('0x4d')][_0x8126('0x4e')];break;case _0x8126('0x50'):_0x3b2e18[_0x8126('0x2c')]=db[_0x8126('0x4d')][_0x8126('0x51')];break;case _0x8126('0x52'):_0x3b2e18[_0x8126('0x2c')]=db[_0x8126('0x4d')]['BOOLEAN'];_0x3b2e18[_0x8126('0x53')]=![];break;default:}return db[_0x8126('0x4b')][_0x8126('0x54')][_0x8126('0x55')](_0x8126('0x56'),util[_0x8126('0x57')](_0x8126('0x58'),_0x2ac4c6['id']),_0x3b2e18);})['then'](function(){return _0x2ac4c6;});})['then'](respondWithResult(_0x4d9656,0xc9))['catch'](handleError(_0x4d9656,null));}; \ No newline at end of file +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 diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 289769a..7b3a2db 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 _0x5a65=['api','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger'];(function(_0x145621,_0x1c4ec0){var _0x4cee99=function(_0x2c9bb0){while(--_0x2c9bb0){_0x145621['push'](_0x145621['shift']());}};_0x4cee99(++_0x1c4ec0);}(_0x5a65,0x129));var _0x55a6=function(_0x3bc1d0,_0x1c5bbd){_0x3bc1d0=_0x3bc1d0-0x0;var _0x474d68=_0x5a65[_0x3bc1d0];return _0x474d68;};'use strict';var _=require(_0x55a6('0x0'));var util=require(_0x55a6('0x1'));var logger=require(_0x55a6('0x2'))(_0x55a6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x55a6('0x4'));var fs=require('fs');var path=require(_0x55a6('0x5'));var rimraf=require(_0x55a6('0x6'));var config=require(_0x55a6('0x7'));var attributes=require(_0x55a6('0x8'));module['exports']=function(_0x18fca9,_0x4dbfb8){return _0x18fca9[_0x55a6('0x9')](_0x55a6('0xa'),attributes,{'tableName':_0x55a6('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 6f132c9..bd2dda3 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 _0x59a8=['../../config/environment','jayson/promise','client','http','then','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','code','error','CmCustomField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0xd2ec4a,_0x1dca74){var _0x4afc34=function(_0x210dcd){while(--_0x210dcd){_0xd2ec4a['push'](_0xd2ec4a['shift']());}};_0x4afc34(++_0x1dca74);}(_0x59a8,0x101));var _0x859a=function(_0x2a8ad3,_0x43bebd){_0x2a8ad3=_0x2a8ad3-0x0;var _0x42fae8=_0x59a8[_0x2a8ad3];return _0x42fae8;};'use strict';var _=require(_0x859a('0x0'));var util=require(_0x859a('0x1'));var moment=require('moment');var BPromise=require(_0x859a('0x2'));var rs=require(_0x859a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x859a('0x4'));var logger=require(_0x859a('0x5'))(_0x859a('0x6'));var config=require(_0x859a('0x7'));var jayson=require(_0x859a('0x8'));var client=jayson[_0x859a('0x9')][_0x859a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x652225,_0x7b50b0,_0x269b6f){return new BPromise(function(_0x4739a7,_0xa27fc6){return client['request'](_0x652225,_0x269b6f)[_0x859a('0xb')](function(_0x5def73){logger['info']('CmCustomField,\x20%s,\x20%s',_0x7b50b0,_0x859a('0xc'));logger['debug'](_0x859a('0xd'),_0x7b50b0,'request\x20sent',JSON[_0x859a('0xe')](_0x5def73));if(_0x5def73['error']){if(_0x5def73['error'][_0x859a('0xf')]===0x1f4){logger[_0x859a('0x10')](_0x859a('0x11'),_0x7b50b0,_0x5def73[_0x859a('0x10')][_0x859a('0x12')]);return _0xa27fc6(_0x5def73[_0x859a('0x10')][_0x859a('0x12')]);}logger[_0x859a('0x10')](_0x859a('0x11'),_0x7b50b0,_0x5def73[_0x859a('0x10')]['message']);return _0x4739a7(_0x5def73[_0x859a('0x10')][_0x859a('0x12')]);}else{logger[_0x859a('0x13')]('CmCustomField,\x20%s,\x20%s',_0x7b50b0,'request\x20sent');_0x4739a7(_0x5def73[_0x859a('0x14')][_0x859a('0x12')]);}})[_0x859a('0x15')](function(_0x4fefd5){logger[_0x859a('0x10')](_0x859a('0x11'),_0x7b50b0,_0x4fefd5);_0xa27fc6(_0x4fefd5);});});} \ No newline at end of file +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 diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 4bc0a36..d0cab9c 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 _0x8d0e=['./cmCustomField.controller','index','get','/:id','isAuthenticated','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4e2fc8,_0x4bbcf7){var _0x48cb17=function(_0x5d656b){while(--_0x5d656b){_0x4e2fc8['push'](_0x4e2fc8['shift']());}};_0x48cb17(++_0x4bbcf7);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x1fc726,_0x1b5fa2){_0x1fc726=_0x1fc726-0x0;var _0x4fbc36=_0x8d0e[_0x1fc726];return _0x4fbc36;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0xe')]);router[_0xe8d0('0xf')]('/',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x10')]);router['put'](_0xe8d0('0xc'),auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x11')]);router['delete']('/:id',auth[_0xe8d0('0xd')](),controller[_0xe8d0('0x12')]);module[_0xe8d0('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 30598b5..8a66dbe 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 _0xfbc6=['sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','contactListQueue'];(function(_0xce4840,_0x1f5c04){var _0x3133d3=function(_0x48a5ce){while(--_0x48a5ce){_0xce4840['push'](_0xce4840['shift']());}};_0x3133d3(++_0x1f5c04);}(_0xfbc6,0xe1));var _0x6fbc=function(_0x4486ee,_0x85b039){_0x4486ee=_0x4486ee-0x0;var _0x2713cb=_0xfbc6[_0x4486ee];return _0x2713cb;};'use strict';var moment=require('moment');var Sequelize=require(_0x6fbc('0x0'));module[_0x6fbc('0x1')]={'phone':{'type':Sequelize[_0x6fbc('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x6fbc('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x6fbc('0x4')](_0x6fbc('0x5'))},'countbusyretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6fbc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6fbc('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6fbc('0x7')]},'priority':{'type':Sequelize[_0x6fbc('0x6')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x6fbc('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6fbc('0x6')],'unique':_0x6fbc('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6fbc('0x8')},'UserId':{'type':Sequelize[_0x6fbc('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x6fbc('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x6fbc('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6fbc('0x6')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index d6ae9dc..230cf72 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 _0x5ff3=['$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','keys','rawAttributes','intersection','find','create','body','catch','params','describe','destroy','VoiceQueueId','CampaignId','omit','dataValues','statedesc','campaign','membername','user','UserId','deleted','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','calleridname','lastName','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','dialPreviewAutoRecallMe','value','prev','isEmpty','hopperIds','priority','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','sendStatus','error','name','index','map','CmHopper','type','key','model','query','filters','$and','$gt','$gte'];(function(_0x5bfdb1,_0x100531){var _0x13db69=function(_0x35a33e){while(--_0x35a33e){_0x5bfdb1['push'](_0x5bfdb1['shift']());}};_0x13db69(++_0x100531);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2ba739,_0x1d7fab){_0x2ba739=_0x2ba739-0x0;var _0x5bad31=_0x5ff3[_0x2ba739];return _0x5bad31;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x35ff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35ff('0x1'));var rp=require('request-promise');var moment=require(_0x35ff('0x2'));var BPromise=require(_0x35ff('0x3'));var Mustache=require(_0x35ff('0x4'));var util=require(_0x35ff('0x5'));var path=require('path');var sox=require(_0x35ff('0x6'));var csv=require(_0x35ff('0x7'));var ejs=require(_0x35ff('0x8'));var fs=require('fs');var fs_extra=require(_0x35ff('0x9'));var _=require(_0x35ff('0xa'));var squel=require('squel');var crypto=require(_0x35ff('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x35ff('0xc'));var toCsv=require(_0x35ff('0x7'));var querystring=require(_0x35ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x35ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x35ff('0xf'));var as=require(_0x35ff('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x35ff('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x35ff('0x12'))['db'];function respondWithStatusCode(_0x3c5f4b,_0x5bda40){_0x5bda40=_0x5bda40||0xcc;return function(_0x842930){if(_0x842930){return _0x3c5f4b['sendStatus'](_0x5bda40);}return _0x3c5f4b[_0x35ff('0x13')](_0x5bda40)[_0x35ff('0x14')]();};}function respondWithResult(_0x3db454,_0x4d1d41){_0x4d1d41=_0x4d1d41||0xc8;return function(_0xff8ac){if(_0xff8ac){return _0x3db454[_0x35ff('0x13')](_0x4d1d41)[_0x35ff('0x15')](_0xff8ac);}};}function respondWithFilteredResult(_0x3e24dd,_0x438199){return function(_0x3dff65){if(_0x3dff65){var _0x2d4a88=typeof _0x438199[_0x35ff('0x16')]===_0x35ff('0x17')&&typeof _0x438199[_0x35ff('0x18')]===_0x35ff('0x17');var _0x3430e2=_0x3dff65[_0x35ff('0x19')];var _0x16c803=_0x2d4a88?0x0:_0x438199[_0x35ff('0x16')];var _0x5f470e=_0x2d4a88?_0x3dff65[_0x35ff('0x19')]:_0x438199[_0x35ff('0x16')]+_0x438199[_0x35ff('0x18')];var _0x1c0d8c;if(_0x5f470e>=_0x3430e2){_0x5f470e=_0x3430e2;_0x1c0d8c=0xc8;}else{_0x1c0d8c=0xce;}_0x3e24dd['status'](_0x1c0d8c);return _0x3e24dd['set'](_0x35ff('0x1a'),_0x16c803+'-'+_0x5f470e+'/'+_0x3430e2)[_0x35ff('0x15')](_0x3dff65);}return null;};}function patchUpdates(_0x4c8dd4){return function(_0x238f65){try{jsonpatch[_0x35ff('0x1b')](_0x238f65,_0x4c8dd4,!![]);}catch(_0x3a87bc){return BPromise[_0x35ff('0x1c')](_0x3a87bc);}return _0x238f65['save']();};}function saveUpdates(_0x3d60b4,_0x55274b){return function(_0x7cc20a){if(_0x7cc20a){return _0x7cc20a[_0x35ff('0x1d')](_0x3d60b4)[_0x35ff('0x1e')](function(_0x16a5a0){return _0x16a5a0;});}return null;};}function removeEntity(_0x396cc2,_0x2b3782){return function(_0x347cec){if(_0x347cec){return _0x347cec['destroy']()[_0x35ff('0x1e')](function(){_0x396cc2[_0x35ff('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x426e4e,_0x5ad0c6){return function(_0x4c46b7){if(!_0x4c46b7){_0x426e4e[_0x35ff('0x1f')](0x194);}return _0x4c46b7;};}function handleError(_0x9e2789,_0x95b9e2){_0x95b9e2=_0x95b9e2||0x1f4;return function(_0x11a5eb){logger[_0x35ff('0x20')](_0x11a5eb['stack']);if(_0x11a5eb[_0x35ff('0x21')]){delete _0x11a5eb[_0x35ff('0x21')];}_0x9e2789[_0x35ff('0x13')](_0x95b9e2)['send'](_0x11a5eb);};}exports[_0x35ff('0x22')]=function(_0x1f51c5,_0x3b4331){var _0x6d5407={},_0x47fcb5={},_0x61b554={'count':0x0,'rows':[]};var _0x1afc98=_[_0x35ff('0x23')](db[_0x35ff('0x24')]['rawAttributes'],function(_0x3f9440){return{'name':_0x3f9440['fieldName'],'type':_0x3f9440[_0x35ff('0x25')][_0x35ff('0x26')]};});_0x47fcb5[_0x35ff('0x27')]=_[_0x35ff('0x23')](_0x1afc98,'name');_0x47fcb5[_0x35ff('0x28')]=_['keys'](_0x1f51c5[_0x35ff('0x28')]);_0x47fcb5[_0x35ff('0x29')]=_['intersection'](_0x47fcb5['model'],_0x47fcb5[_0x35ff('0x28')]);_0x47fcb5[_0x35ff('0x29')]=_['concat'](_0x47fcb5[_0x35ff('0x29')],[_0x35ff('0x2a'),'$or',_0x35ff('0x2b'),_0x35ff('0x2c'),_0x35ff('0x2d'),_0x35ff('0x2e'),_0x35ff('0x2f'),_0x35ff('0x30'),_0x35ff('0x31'),_0x35ff('0x32'),_0x35ff('0x33'),_0x35ff('0x34'),_0x35ff('0x35'),_0x35ff('0x36'),_0x35ff('0x37'),'$iLike',_0x35ff('0x38'),'$like',_0x35ff('0x39'),_0x35ff('0x3a'),_0x35ff('0x3b'),_0x35ff('0x3c')]);_0x6d5407[_0x35ff('0x3d')]=_['intersection'](_0x47fcb5[_0x35ff('0x27')],qs[_0x35ff('0x3e')](_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x3e')]));_0x6d5407[_0x35ff('0x3d')]=_0x6d5407['attributes'][_0x35ff('0x3f')]?_0x6d5407[_0x35ff('0x3d')]:_0x47fcb5[_0x35ff('0x27')];if(!_0x1f51c5['query']['hasOwnProperty'](_0x35ff('0x40'))){_0x6d5407[_0x35ff('0x18')]=qs[_0x35ff('0x18')](_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x18')]);_0x6d5407[_0x35ff('0x16')]=qs[_0x35ff('0x16')](_0x1f51c5[_0x35ff('0x28')]['offset']);}_0x6d5407['order']=qs['sort'](_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x41')]);_0x6d5407[_0x35ff('0x42')]=qs[_0x35ff('0x29')](_[_0x35ff('0x43')](_0x1f51c5['query'],_0x47fcb5[_0x35ff('0x29')]),_0x1afc98);if(_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x44')]){_0x6d5407[_0x35ff('0x42')]=_[_0x35ff('0x45')](_0x6d5407[_0x35ff('0x42')],{'$or':_['map'](_0x1afc98,function(_0x5e4360){if(_0x5e4360[_0x35ff('0x25')]!==_0x35ff('0x46')){var _0x14d741={};_0x14d741[_0x5e4360[_0x35ff('0x21')]]={'$like':'%'+_0x1f51c5['query']['filter']+'%'};return _0x14d741;}})});}_0x6d5407=_[_0x35ff('0x45')]({},_0x6d5407,_0x1f51c5[_0x35ff('0x47')]);var _0x3653da={'where':_0x6d5407[_0x35ff('0x42')]};return db[_0x35ff('0x24')][_0x35ff('0x19')](_0x3653da)[_0x35ff('0x1e')](function(_0x51f7cd){_0x61b554['count']=_0x51f7cd;if(_0x1f51c5[_0x35ff('0x28')][_0x35ff('0x48')]){_0x6d5407[_0x35ff('0x49')]=[{'all':!![]}];}return db['CmHopper'][_0x35ff('0x4a')](_0x6d5407);})[_0x35ff('0x1e')](function(_0x58ea90){_0x61b554['rows']=_0x58ea90;return _0x61b554;})[_0x35ff('0x1e')](respondWithFilteredResult(_0x3b4331,_0x6d5407))['catch'](handleError(_0x3b4331,null));};exports[_0x35ff('0x4b')]=function(_0x20806d,_0x5e95ad){var _0x2ecbb8={'raw':!![],'where':{'id':_0x20806d['params']['id']}},_0x4b1b86={};_0x4b1b86[_0x35ff('0x27')]=_[_0x35ff('0x4c')](db[_0x35ff('0x24')][_0x35ff('0x4d')]);_0x4b1b86[_0x35ff('0x28')]=_[_0x35ff('0x4c')](_0x20806d[_0x35ff('0x28')]);_0x4b1b86[_0x35ff('0x29')]=_[_0x35ff('0x4e')](_0x4b1b86[_0x35ff('0x27')],_0x4b1b86[_0x35ff('0x28')]);_0x2ecbb8[_0x35ff('0x3d')]=_['intersection'](_0x4b1b86[_0x35ff('0x27')],qs[_0x35ff('0x3e')](_0x20806d[_0x35ff('0x28')][_0x35ff('0x3e')]));_0x2ecbb8['attributes']=_0x2ecbb8['attributes'][_0x35ff('0x3f')]?_0x2ecbb8['attributes']:_0x4b1b86[_0x35ff('0x27')];if(_0x20806d[_0x35ff('0x28')][_0x35ff('0x48')]){_0x2ecbb8[_0x35ff('0x49')]=[{'all':!![]}];}_0x2ecbb8=_[_0x35ff('0x45')]({},_0x2ecbb8,_0x20806d[_0x35ff('0x47')]);return db[_0x35ff('0x24')][_0x35ff('0x4f')](_0x2ecbb8)[_0x35ff('0x1e')](handleEntityNotFound(_0x5e95ad,null))['then'](respondWithResult(_0x5e95ad,null))['catch'](handleError(_0x5e95ad,null));};exports[_0x35ff('0x50')]=function(_0x5773aa,_0x309fe1){return db[_0x35ff('0x24')][_0x35ff('0x50')](_0x5773aa[_0x35ff('0x51')],{})[_0x35ff('0x1e')](respondWithResult(_0x309fe1,0xc9))[_0x35ff('0x52')](handleError(_0x309fe1,null));};exports[_0x35ff('0x1d')]=function(_0x1abfe6,_0xc93bcf){if(_0x1abfe6['body']['id']){delete _0x1abfe6[_0x35ff('0x51')]['id'];}return db[_0x35ff('0x24')][_0x35ff('0x4f')]({'where':{'id':_0x1abfe6[_0x35ff('0x53')]['id']}})['then'](handleEntityNotFound(_0xc93bcf,null))['then'](saveUpdates(_0x1abfe6['body'],null))[_0x35ff('0x1e')](respondWithResult(_0xc93bcf,null))[_0x35ff('0x52')](handleError(_0xc93bcf,null));};exports[_0x35ff('0x54')]=function(_0x4df16f,_0x76a613){return db['CmHopper'][_0x35ff('0x54')]()['then'](respondWithResult(_0x76a613,null))[_0x35ff('0x52')](handleError(_0x76a613,null));};exports[_0x35ff('0x55')]=function(_0x681d2b,_0x3a7261){var _0x50f820;return db['CmHopper'][_0x35ff('0x4f')]({'where':{'id':_0x681d2b['params']['id']}})[_0x35ff('0x1e')](handleEntityNotFound(_0x3a7261,null))[_0x35ff('0x1e')](function(_0x52802a){if(_0x52802a){return _0x52802a[_0x35ff('0x55')]()['then'](function(_0x2d07b2){return _0x2d07b2;});}})[_0x35ff('0x1e')](function(_0x424586){_0x50f820=_0x424586;if(_0x424586){if(_0x424586[_0x35ff('0x56')]||_0x424586[_0x35ff('0x57')]){return db[_0x424586[_0x35ff('0x56')]?'VoiceQueue':'Campaign'][_0x35ff('0x4f')]({'where':{'id':_0x424586[_0x35ff('0x56')]?_0x424586['VoiceQueueId']:_0x424586[_0x35ff('0x57')]},'attributes':['id',_0x35ff('0x21')],'raw':!![]});}}})['then'](function(_0x44f6fe){var _0x42de6c={};if(_0x44f6fe){_[_0x35ff('0x45')](_0x42de6c,_[_0x35ff('0x58')](_0x50f820[_0x35ff('0x59')],['createdAt','updatedAt','id']));_0x42de6c['state']=0x15;_0x42de6c[_0x35ff('0x5a')]='deleted';_0x42de6c[_0x35ff('0x5b')]=_0x44f6fe['name'];_0x42de6c[_0x35ff('0x5c')]=_0x681d2b[_0x35ff('0x5d')][_0x35ff('0x21')];_0x42de6c[_0x35ff('0x5e')]=_0x681d2b[_0x35ff('0x5d')]['id'];_0x42de6c[_0x35ff('0x5f')]=!![];_0x42de6c['deletedat']=moment()[_0x35ff('0x60')](_0x35ff('0x61'));_0x42de6c['calleridnum']=_0x50f820[_0x35ff('0x62')];_0x42de6c[_0x35ff('0x63')]=_0x50f820[_0x35ff('0x56')]?_0x35ff('0x64'):_0x35ff('0x65');return db[_0x35ff('0x66')][_0x35ff('0x4f')]({'where':{'id':_0x42de6c[_0x35ff('0x67')]},'attributes':[_0x35ff('0x68'),'lastName']})[_0x35ff('0x1e')](function(_0x33f8e7){if(!_[_0x35ff('0x69')](_0x3a7261)&&!_[_0x35ff('0x69')](_0x33f8e7[_0x35ff('0x68')])){_0x42de6c[_0x35ff('0x6a')]=_0x33f8e7['firstName'];if(!_[_0x35ff('0x69')](_0x33f8e7[_0x35ff('0x6b')])){_0x42de6c[_0x35ff('0x6a')]+='\x20'+_0x33f8e7['lastName'];}}})[_0x35ff('0x6c')](function(){return db['CmHopperFinal']['create'](_0x42de6c);});}})[_0x35ff('0x1e')](function(){return _0x3a7261[_0x35ff('0x13')](0xcc)['end']();})[_0x35ff('0x52')](handleError(_0x3a7261,null));};exports[_0x35ff('0x6d')]=function(_0x36e334,_0x974edb,_0x3a8026){var _0x2b0064=[];return db[_0x35ff('0x66')][_0x35ff('0x54')]()[_0x35ff('0x1e')](function(_0x12257c){_0x2b0064=_[_0x35ff('0x4c')](_0x12257c);return _0x36e334[_0x35ff('0x5d')][_0x35ff('0x6e')]({'where':{'type':_0x35ff('0x6f'),'dialActive':!![],'dialMethod':_0x35ff('0x70')},'attributes':['id',_0x35ff('0x71'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x35ff('0x1e')](function(_0x229ca2){if(_0x229ca2&&_0x229ca2['length']){return db[_0x35ff('0x72')][_0x35ff('0x73')](function(_0x4ab942){var _0x5d96ea={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x35ff('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x35ff('0x23')](_0x229ca2,'id')},'$or':[{'UserId':null},{'UserId':_0x36e334[_0x35ff('0x5d')]['id']}]};var _0x256db1={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x229ca2)[_0x35ff('0x44')]([_0x35ff('0x74'),0x0])[_0x35ff('0x23')]('id')[_0x35ff('0x75')]()},'$or':[{'UserId':null},{'UserId':_0x36e334[_0x35ff('0x5d')]['id']}]};var _0x7ea9b0={'$or':[_0x5d96ea,_0x256db1]};var _0x4de9f0=[];if(_0x36e334[_0x35ff('0x51')]['direction']&&_0x36e334[_0x35ff('0x51')]['direction']===_0x35ff('0x76')){if(!_[_0x35ff('0x77')](_0x36e334[_0x35ff('0x51')][_0x35ff('0x78')])){_0x7ea9b0['id']={'$in':_0x36e334[_0x35ff('0x51')]['hopperIds']};}_0x4de9f0=[[_0x35ff('0x79'),_0x35ff('0x7a')],['scheduledAt',_0x229ca2[0x0]['dialOrderByScheduledAt']===_0x35ff('0x7a')?_0x35ff('0x7b'):'ASC'],db[_0x35ff('0x72')][_0x35ff('0x7c')](_0x35ff('0x7d')),['id','DESC']];}else{if(!_[_0x35ff('0x77')](_0x36e334[_0x35ff('0x51')][_0x35ff('0x78')])){_0x7ea9b0['id']={'$notIn':_0x36e334['body'][_0x35ff('0x78')]};}_0x4de9f0=[[_0x35ff('0x79'),_0x35ff('0x7b')],[_0x35ff('0x7e'),_0x229ca2[0x0][_0x35ff('0x71')]],db['sequelize'][_0x35ff('0x7c')](_0x35ff('0x7f')),['id',_0x35ff('0x7a')]];}return db[_0x35ff('0x24')][_0x35ff('0x80')]({'attributes':['id',_0x35ff('0x81'),_0x35ff('0x82')],'where':_0x7ea9b0,'order':_0x4de9f0,'transaction':_0x4ab942,'lock':_0x4ab942['LOCK'][_0x35ff('0x83')],'include':[{'model':db[_0x35ff('0x66')],'as':_0x35ff('0x84'),'attributes':_0x2b0064,'include':[{'model':db[_0x35ff('0x85')],'as':_0x35ff('0x86'),'attributes':['id',_0x35ff('0x21')]}]},{'model':db[_0x35ff('0x87')],'as':'List','attributes':['id',_0x35ff('0x21')]},{'model':db['VoiceQueue'],'as':_0x35ff('0x88'),'attributes':['id',_0x35ff('0x21'),_0x35ff('0x89')]}]})[_0x35ff('0x1e')](function(_0x1d5df8){if(_0x1d5df8){return _0x1d5df8['update']({'UserId':_0x36e334['user']['id']},{'transaction':_0x4ab942});}});});}})[_0x35ff('0x1e')](handleEntityNotFound(_0x974edb,null))['then'](respondWithResult(_0x974edb,null))[_0x35ff('0x52')](handleError(_0x974edb,null));};exports[_0x35ff('0x8a')]=function(_0x1b3feb,_0x24b043,_0x2b9867){return _0x1b3feb[_0x35ff('0x5d')][_0x35ff('0x6e')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x35ff('0x70')},'attributes':['id'],'raw':!![]})['then'](function(_0x14a477){if(_0x14a477&&_0x14a477['length']){return db[_0x35ff('0x24')][_0x35ff('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x35ff('0x60')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_['map'](_0x14a477,'id')},'$or':[{'UserId':null},{'UserId':_0x1b3feb[_0x35ff('0x5d')]['id']}]}});}return 0x0;})[_0x35ff('0x1e')](function(_0x4aa6c7){if(!_[_0x35ff('0x69')](_0x4aa6c7)&&_[_0x35ff('0x8b')](_0x4aa6c7)){return _0x24b043['status'](0xc8)[_0x35ff('0x15')]({'contacts':_0x4aa6c7});}else{logger[_0x35ff('0x20')](_0x35ff('0x8c'),_0x35ff('0x8a'),0x194,_0x35ff('0x8d'));_0x24b043[_0x35ff('0x1f')](0x194);}})[_0x35ff('0x52')](handleError(_0x24b043,null));}; \ No newline at end of file +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 diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index a06b982..43172b2 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 _0x0295=['define','scheduledat','phone','priority','lodash','api','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x0295,0x1f0));var _0x5029=function(_0x2405bc,_0x2f28a1){_0x2405bc=_0x2405bc-0x0;var _0x5272d4=_0x0295[_0x2405bc];return _0x5272d4;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x5029('0x9')]},{'name':'phone','fields':[_0x5029('0xa')]},{'name':'priority','fields':[_0x5029('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 9c87791..9c4727f 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 _0xd787=['order','GetCmHopperPreview','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','CmHopper,\x20%s,\x20%s','message','result','catch','CmHopper','options','raw','where','attributes','map','model','include','GetCmHopper','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','limit','LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','push','includes','CmHopperFinal','MoveContactManagedDialer','CountReScheduled','findAll','sequelize','COUNT','literal','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','transaction'];(function(_0x3ee949,_0x391b9e){var _0x106210=function(_0x339b4c){while(--_0x339b4c){_0x3ee949['push'](_0x3ee949['shift']());}};_0x106210(++_0x391b9e);}(_0xd787,0xd7));var _0x7d78=function(_0x5e9edf,_0x586dc6){_0x5e9edf=_0x5e9edf-0x0;var _0x5b8b14=_0xd787[_0x5e9edf];return _0x5b8b14;};'use strict';var _=require('lodash');var util=require(_0x7d78('0x0'));var moment=require('moment');var BPromise=require(_0x7d78('0x1'));var rs=require(_0x7d78('0x2'));var fs=require('fs');var Redis=require(_0x7d78('0x3'));var db=require(_0x7d78('0x4'))['db'];var utils=require(_0x7d78('0x5'));var logger=require(_0x7d78('0x6'))(_0x7d78('0x7'));var config=require(_0x7d78('0x8'));var jayson=require(_0x7d78('0x9'));var client=jayson[_0x7d78('0xa')][_0x7d78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7b9f3e,_0x30e7a1,_0x50a1c5){return new BPromise(function(_0x11a72e,_0x2c10ee){return client[_0x7d78('0xc')](_0x7b9f3e,_0x50a1c5)[_0x7d78('0xd')](function(_0x5b8fc0){logger[_0x7d78('0xe')]('CmHopper,\x20%s,\x20%s',_0x30e7a1,'request\x20sent');logger[_0x7d78('0xf')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x30e7a1,_0x7d78('0x10'),JSON[_0x7d78('0x11')](_0x5b8fc0));if(_0x5b8fc0[_0x7d78('0x12')]){if(_0x5b8fc0[_0x7d78('0x12')]['code']===0x1f4){logger[_0x7d78('0x12')](_0x7d78('0x13'),_0x30e7a1,_0x5b8fc0[_0x7d78('0x12')][_0x7d78('0x14')]);return _0x2c10ee(_0x5b8fc0[_0x7d78('0x12')][_0x7d78('0x14')]);}logger[_0x7d78('0x12')]('CmHopper,\x20%s,\x20%s',_0x30e7a1,_0x5b8fc0['error'][_0x7d78('0x14')]);return _0x11a72e(_0x5b8fc0[_0x7d78('0x12')][_0x7d78('0x14')]);}else{logger[_0x7d78('0xe')]('CmHopper,\x20%s,\x20%s',_0x30e7a1,_0x7d78('0x10'));_0x11a72e(_0x5b8fc0[_0x7d78('0x15')]['message']);}})[_0x7d78('0x16')](function(_0x2f051e){logger[_0x7d78('0x12')]('CmHopper,\x20%s,\x20%s',_0x30e7a1,_0x2f051e);_0x2c10ee(_0x2f051e);});});}exports['GetCmHopper']=function(_0x128732){var _0x2b6b60=this;return new Promise(function(_0xd82cf8,_0x21ad2e){return db[_0x7d78('0x17')]['findAll']({'raw':_0x128732[_0x7d78('0x18')]?_0x128732['options'][_0x7d78('0x19')]===undefined?!![]:![]:!![],'where':_0x128732[_0x7d78('0x18')]?_0x128732['options'][_0x7d78('0x1a')]||null:null,'attributes':_0x128732[_0x7d78('0x18')]?_0x128732[_0x7d78('0x18')][_0x7d78('0x1b')]||null:null,'limit':_0x128732[_0x7d78('0x18')]?_0x128732['options']['limit']||null:null,'include':_0x128732['options']?_0x128732[_0x7d78('0x18')]['include']?_[_0x7d78('0x1c')](_0x128732[_0x7d78('0x18')]['include'],function(_0x2d5736){return{'model':db[_0x2d5736[_0x7d78('0x1d')]],'as':_0x2d5736['as'],'attributes':_0x2d5736[_0x7d78('0x1b')],'include':_0x2d5736[_0x7d78('0x1e')]?_[_0x7d78('0x1c')](_0x2d5736[_0x7d78('0x1e')],function(_0x60929d){return{'model':db[_0x60929d[_0x7d78('0x1d')]],'as':_0x60929d['as'],'attributes':_0x60929d['attributes'],'include':_0x60929d[_0x7d78('0x1e')]?_[_0x7d78('0x1c')](_0x60929d[_0x7d78('0x1e')],function(_0xa5fada){return{'model':db[_0xa5fada['model']],'as':_0xa5fada['as'],'attributes':_0xa5fada[_0x7d78('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7d78('0xd')](function(_0x25239b){logger[_0x7d78('0xe')](_0x7d78('0x1f'),_0x128732);logger[_0x7d78('0xf')](_0x7d78('0x1f'),_0x128732,JSON[_0x7d78('0x11')](_0x25239b));_0xd82cf8(_0x25239b);})[_0x7d78('0x16')](function(_0x48bac5){logger[_0x7d78('0x12')](_0x7d78('0x1f'),_0x48bac5['message'],_0x128732);_0x21ad2e(_0x2b6b60[_0x7d78('0x12')](0x1f4,_0x48bac5[_0x7d78('0x14')]));});});};exports['ShowCmHopper']=function(_0x43fa51){var _0x5c18c9=this;return new Promise(function(_0xb155a0,_0x1cb31a){return db[_0x7d78('0x17')][_0x7d78('0x20')]({'raw':_0x43fa51[_0x7d78('0x18')]?_0x43fa51[_0x7d78('0x18')][_0x7d78('0x19')]===undefined?!![]:![]:!![],'where':_0x43fa51[_0x7d78('0x18')]?_0x43fa51[_0x7d78('0x18')][_0x7d78('0x1a')]||null:null,'attributes':_0x43fa51[_0x7d78('0x18')]?_0x43fa51[_0x7d78('0x18')][_0x7d78('0x1b')]||null:null,'include':_0x43fa51[_0x7d78('0x18')]?_0x43fa51[_0x7d78('0x18')]['include']?_[_0x7d78('0x1c')](_0x43fa51[_0x7d78('0x18')]['include'],function(_0x12a843){return{'model':db[_0x12a843[_0x7d78('0x1d')]],'as':_0x12a843['as'],'attributes':_0x12a843[_0x7d78('0x1b')],'include':_0x12a843[_0x7d78('0x1e')]?_[_0x7d78('0x1c')](_0x12a843[_0x7d78('0x1e')],function(_0x1cade8){return{'model':db[_0x1cade8[_0x7d78('0x1d')]],'as':_0x1cade8['as'],'attributes':_0x1cade8[_0x7d78('0x1b')],'include':_0x1cade8['include']?_[_0x7d78('0x1c')](_0x1cade8[_0x7d78('0x1e')],function(_0x1918ec){return{'model':db[_0x1918ec[_0x7d78('0x1d')]],'as':_0x1918ec['as'],'attributes':_0x1918ec[_0x7d78('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7d78('0xd')](function(_0xbb7762){logger[_0x7d78('0xe')](_0x7d78('0x21'),_0x43fa51);logger[_0x7d78('0xf')](_0x7d78('0x21'),_0x43fa51,JSON[_0x7d78('0x11')](_0xbb7762));_0xb155a0(_0xbb7762);})[_0x7d78('0x16')](function(_0xd088c){logger[_0x7d78('0x12')]('ShowCmHopper',_0xd088c[_0x7d78('0x14')],_0x43fa51);_0x1cb31a(_0x5c18c9['error'](0x1f4,_0xd088c[_0x7d78('0x14')]));});});};exports[_0x7d78('0x22')]=function(_0x48f8f8){var _0x493651=this;return new Promise(function(_0x4a1a2c,_0x240235){return db[_0x7d78('0x17')][_0x7d78('0x23')](_0x48f8f8[_0x7d78('0x24')],{'raw':_0x48f8f8[_0x7d78('0x18')]?_0x48f8f8[_0x7d78('0x18')][_0x7d78('0x19')]===undefined?!![]:![]:!![]})[_0x7d78('0xd')](function(_0x385b41){logger['info'](_0x7d78('0x22'),_0x48f8f8);logger[_0x7d78('0xf')]('CreateCmHopper',_0x48f8f8,JSON[_0x7d78('0x11')](_0x385b41));_0x4a1a2c(_0x385b41);})[_0x7d78('0x16')](function(_0x3b23c9){logger[_0x7d78('0x12')]('CreateCmHopper',_0x3b23c9['message'],_0x48f8f8);_0x240235(_0x493651[_0x7d78('0x12')](0x1f4,_0x3b23c9[_0x7d78('0x14')]));});});};exports[_0x7d78('0x25')]=function(_0x4aa6f3){var _0x4efa0f=this;return new Promise(function(_0x4cbb9d,_0x24ec51){return db['CmHopper'][_0x7d78('0x26')](_0x4aa6f3[_0x7d78('0x24')],{'raw':_0x4aa6f3[_0x7d78('0x18')]?_0x4aa6f3[_0x7d78('0x18')][_0x7d78('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aa6f3[_0x7d78('0x18')]?_0x4aa6f3['options'][_0x7d78('0x1a')]||null:null,'attributes':_0x4aa6f3[_0x7d78('0x18')]?_0x4aa6f3[_0x7d78('0x18')][_0x7d78('0x1b')]||null:null,'limit':_0x4aa6f3[_0x7d78('0x18')]?_0x4aa6f3[_0x7d78('0x18')]['limit']||null:null})[_0x7d78('0xd')](function(_0x25e9ea){logger[_0x7d78('0xe')]('UpdateCmHopper',_0x4aa6f3);logger['debug']('UpdateCmHopper',_0x4aa6f3,JSON[_0x7d78('0x11')](_0x25e9ea));_0x4cbb9d(_0x25e9ea);})[_0x7d78('0x16')](function(_0x54fd54){logger[_0x7d78('0x12')]('UpdateCmHopper',_0x54fd54[_0x7d78('0x14')],_0x4aa6f3);_0x24ec51(_0x4efa0f[_0x7d78('0x12')](0x1f4,_0x54fd54[_0x7d78('0x14')]));});});};exports[_0x7d78('0x27')]=function(_0x31226e){var _0x162e96=this;return new Promise(function(_0x2a4e37,_0x4dbd20){return db[_0x7d78('0x17')][_0x7d78('0x28')]({'where':_0x31226e['options']?_0x31226e[_0x7d78('0x18')]['where']||null:null})[_0x7d78('0xd')](function(_0x171e89){logger[_0x7d78('0xe')]('DestroyCmHopper',_0x31226e);logger[_0x7d78('0xf')](_0x7d78('0x27'),_0x31226e,JSON[_0x7d78('0x11')](_0x171e89));_0x2a4e37(_0x171e89);})[_0x7d78('0x16')](function(_0x902b6b){logger[_0x7d78('0x12')](_0x7d78('0x27'),_0x902b6b[_0x7d78('0x14')],_0x31226e);_0x4dbd20(_0x162e96['error'](0x1f4,_0x902b6b['message']));});});};exports[_0x7d78('0x29')]=function(_0x2edd06){var _0x325404=this;return new Promise(function(_0x3105b9,_0x4853ae){return db[_0x7d78('0x2a')]['describe']()[_0x7d78('0xd')](function(_0x12344b){return db['sequelize']['transaction'](function(_0x2f782c){return db[_0x7d78('0x17')]['findAll']({'where':_0x2edd06[_0x7d78('0x18')]?_0x2edd06[_0x7d78('0x18')][_0x7d78('0x1a')]||null:null,'attributes':_0x2edd06[_0x7d78('0x18')]?_0x2edd06[_0x7d78('0x18')][_0x7d78('0x1b')]||null:null,'limit':_0x2edd06[_0x7d78('0x18')]?_0x2edd06[_0x7d78('0x18')][_0x7d78('0x2b')]||null:null,'order':_0x2edd06[_0x7d78('0x18')]?_0x2edd06[_0x7d78('0x18')]['order']||null:null,'transaction':_0x2f782c,'lock':_0x2f782c[_0x7d78('0x2c')][_0x7d78('0x2d')],'include':[{'model':db[_0x7d78('0x2a')],'as':_0x7d78('0x2e'),'attributes':_['keys'](_0x12344b)},{'model':db[_0x7d78('0x2f')],'as':_0x7d78('0x30'),'attributes':['id',_0x7d78('0x31'),_0x7d78('0x32')]}]})[_0x7d78('0xd')](function(_0x3cb57a){var _0xeee9b7=[];var _0x16de57=[];for(var _0x440166=0x0;_0x440166<_0x3cb57a[_0x7d78('0x33')];_0x440166+=0x1){var _0x4dee2e=_0x3cb57a[_0x440166][_0x7d78('0x34')];if(_0x4dee2e===null){_0xeee9b7[_0x7d78('0x35')](_0x3cb57a[_0x440166]['update'](_0x2edd06[_0x7d78('0x24')],{'transaction':_0x2f782c}));}else if(!_0x16de57[_0x7d78('0x36')](_0x4dee2e)){_0x16de57[_0x7d78('0x35')](_0x4dee2e);_0xeee9b7[_0x7d78('0x35')](_0x3cb57a[_0x440166][_0x7d78('0x26')](_0x2edd06[_0x7d78('0x24')],{'transaction':_0x2f782c}));}}return BPromise['all'](_0xeee9b7);});})['then'](function(_0x5d38b7){logger[_0x7d78('0xe')](_0x7d78('0x29'),_0x2edd06);logger[_0x7d78('0xf')](_0x7d78('0x29'),_0x2edd06,JSON[_0x7d78('0x11')](_0x5d38b7));_0x3105b9(_0x5d38b7);})[_0x7d78('0x16')](function(_0x3d5e35){logger[_0x7d78('0x12')]('GetContactDialer',_0x3d5e35[_0x7d78('0x14')],_0x2edd06);_0x4853ae(_0x325404['error'](0x1f4,_0x3d5e35[_0x7d78('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x1f7e10){var _0x984dca=this;return new Promise(function(_0x5d7a92,_0x52ec79){return db['sequelize']['transaction'](function(_0x8078d6){return db[_0x7d78('0x37')]['create'](_0x1f7e10[_0x7d78('0x24')],{'raw':_0x1f7e10[_0x7d78('0x18')]?_0x1f7e10[_0x7d78('0x18')][_0x7d78('0x19')]===undefined?!![]:![]:!![],'transaction':_0x8078d6})['then'](function(){return db[_0x7d78('0x17')][_0x7d78('0x28')]({'where':_0x1f7e10[_0x7d78('0x18')]?_0x1f7e10[_0x7d78('0x18')][_0x7d78('0x1a')]||null:null,'transaction':_0x8078d6});});})[_0x7d78('0xd')](function(_0xd0db9a){logger[_0x7d78('0xe')](_0x7d78('0x38'),_0x1f7e10);logger['debug'](_0x7d78('0x38'),_0x1f7e10,JSON['stringify'](_0xd0db9a));_0x5d7a92(_0xd0db9a);})[_0x7d78('0x16')](function(_0xbae989){logger[_0x7d78('0x12')](_0x7d78('0x38'),_0xbae989[_0x7d78('0x14')],_0x1f7e10);_0x52ec79(_0x984dca['error'](0x1f4,_0xbae989[_0x7d78('0x14')]));});});};exports[_0x7d78('0x39')]=function(_0x18cd8c){var _0x56012e=this;return new Promise(function(_0x1e43c4,_0x1ddb64){return db['CmHopper'][_0x7d78('0x3a')]({'raw':_0x18cd8c[_0x7d78('0x18')]?_0x18cd8c[_0x7d78('0x18')][_0x7d78('0x19')]===undefined?!![]:![]:!![],'where':_0x18cd8c['options']?_0x18cd8c[_0x7d78('0x18')][_0x7d78('0x1a')]||null:null,'attributes':[[db[_0x7d78('0x3b')]['fn'](_0x7d78('0x3c'),db[_0x7d78('0x3b')]['fn']('IF',db[_0x7d78('0x3b')][_0x7d78('0x3d')]('`scheduledat`\x20>=\x20'+util['format'](_0x7d78('0x3e'),moment()[_0x7d78('0x3f')](_0x7d78('0x40')))+_0x7d78('0x41')))),_0x7d78('0x42')]]})[_0x7d78('0xd')](function(_0x5dd8be){logger[_0x7d78('0xe')](_0x7d78('0x39'),_0x18cd8c);logger[_0x7d78('0xf')]('CountReScheduled',_0x18cd8c,JSON[_0x7d78('0x11')](_0x5dd8be));_0x1e43c4(_0x5dd8be);})['catch'](function(_0x4fd874){logger[_0x7d78('0x12')](_0x7d78('0x39'),_0x4fd874[_0x7d78('0x14')],_0x18cd8c);_0x1ddb64(_0x56012e[_0x7d78('0x12')](0x1f4,_0x4fd874['message']));});});};exports[_0x7d78('0x43')]=function(_0x58b77e){var _0x3f6b6a=this;return new Promise(function(_0x2e4157,_0x2ac760){return db[_0x7d78('0x2a')]['describe']()['then'](function(_0x4739ed){return db[_0x7d78('0x3b')][_0x7d78('0x44')](function(_0x3bd1fa){return db[_0x7d78('0x17')][_0x7d78('0x3a')]({'where':_0x58b77e[_0x7d78('0x18')]?_0x58b77e[_0x7d78('0x18')][_0x7d78('0x1a')]||null:null,'attributes':_0x58b77e[_0x7d78('0x18')]?_0x58b77e['options']['attributes']||null:null,'limit':0x1,'order':_0x58b77e['options']?_0x58b77e[_0x7d78('0x18')][_0x7d78('0x45')]||null:null,'group':db['CmHopper'][_0x7d78('0x34')],'transaction':_0x3bd1fa,'lock':_0x3bd1fa[_0x7d78('0x2c')][_0x7d78('0x2d')],'include':_0x58b77e[_0x7d78('0x18')]?_0x58b77e[_0x7d78('0x18')][_0x7d78('0x1e')]?_[_0x7d78('0x1c')](_0x58b77e['options'][_0x7d78('0x1e')],function(_0x240140){return{'model':db[_0x240140[_0x7d78('0x1d')]],'as':_0x240140['as'],'attributes':_0x240140[_0x7d78('0x1b')],'include':_0x240140[_0x7d78('0x1e')]?_[_0x7d78('0x1c')](_0x240140['include'],function(_0x1cb509){return{'model':db[_0x1cb509[_0x7d78('0x1d')]],'as':_0x1cb509['as'],'attributes':_0x1cb509['attributes'],'include':_0x1cb509[_0x7d78('0x1e')]?_['map'](_0x1cb509[_0x7d78('0x1e')],function(_0x354486){return{'model':db[_0x354486[_0x7d78('0x1d')]],'as':_0x354486['as'],'attributes':_0x354486['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d78('0xd')](function(_0x480332){var _0x294627=[];for(var _0x51d0fa=0x0;_0x51d0fa<_0x480332['length'];_0x51d0fa+=0x1){_0x294627[_0x7d78('0x35')](_0x480332[_0x51d0fa][_0x7d78('0x26')](_0x58b77e[_0x7d78('0x24')],{'transaction':_0x3bd1fa}));}return BPromise['all'](_0x294627);});})[_0x7d78('0xd')](function(_0x55c2ea){logger[_0x7d78('0xe')](_0x7d78('0x43'),_0x58b77e);logger['debug'](_0x7d78('0x43'),_0x58b77e,JSON[_0x7d78('0x11')](_0x55c2ea));_0x2e4157(_0x55c2ea);})[_0x7d78('0x16')](function(_0x3af957){logger[_0x7d78('0x12')](_0x7d78('0x43'),_0x3af957[_0x7d78('0x14')],_0x58b77e);_0x2ac760(_0x3f6b6a['error'](0x1f4,_0x3af957['message']));});});});};exports[_0x7d78('0x46')]=function(_0x8aae0f){var _0x257762=this;return new Promise(function(_0x3e16d4,_0x38f1cc){db[_0x7d78('0x2a')]['describe']()['then'](function(_0x187097){return db[_0x7d78('0x17')][_0x7d78('0x3a')]({'raw':_0x8aae0f[_0x7d78('0x18')]?_0x8aae0f['options'][_0x7d78('0x19')]===undefined?!![]:![]:!![],'where':_0x8aae0f['options']?_0x8aae0f[_0x7d78('0x18')]['where']||null:null,'attributes':_0x8aae0f[_0x7d78('0x18')]?_0x8aae0f[_0x7d78('0x18')][_0x7d78('0x1b')]||null:null,'limit':_0x8aae0f['options']?_0x8aae0f['options'][_0x7d78('0x2b')]||null:null,'include':_0x8aae0f[_0x7d78('0x18')]?_0x8aae0f[_0x7d78('0x18')][_0x7d78('0x1e')]?_['map'](_0x8aae0f[_0x7d78('0x18')]['include'],function(_0x388a77){return{'model':db[_0x388a77[_0x7d78('0x1d')]],'as':_0x388a77['as'],'attributes':_0x388a77['as']===_0x7d78('0x2e')?_['keys'](_0x187097):_0x388a77[_0x7d78('0x1b')],'include':_0x388a77[_0x7d78('0x1e')]?_['map'](_0x388a77[_0x7d78('0x1e')],function(_0x5cf968){return{'model':db[_0x5cf968['model']],'as':_0x5cf968['as'],'attributes':_0x5cf968[_0x7d78('0x1b')],'include':_0x5cf968['include']?_[_0x7d78('0x1c')](_0x5cf968['include'],function(_0x2d109){return{'model':db[_0x2d109[_0x7d78('0x1d')]],'as':_0x2d109['as'],'attributes':_0x2d109[_0x7d78('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7d78('0xd')](function(_0x317f6a){logger[_0x7d78('0xe')](_0x7d78('0x1f'),_0x8aae0f);logger['debug'](_0x7d78('0x1f'),_0x8aae0f,JSON[_0x7d78('0x11')](_0x317f6a));_0x3e16d4(_0x317f6a);})[_0x7d78('0x16')](function(_0x5b700f){logger['error']('GetCmHopper',_0x5b700f[_0x7d78('0x14')],_0x8aae0f);_0x38f1cc(_0x257762[_0x7d78('0x12')](0x1f4,_0x5b700f[_0x7d78('0x14')]));});});});}; \ No newline at end of file +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 diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index ad355ca..675f1c6 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 _0xaa15=['getPreview','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','/:id','show','post','create','/preview'];(function(_0x63c40b,_0x446e60){var _0x42ce16=function(_0x186ceb){while(--_0x186ceb){_0x63c40b['push'](_0x63c40b['shift']());}};_0x42ce16(++_0x446e60);}(_0xaa15,0x14b));var _0x5aa1=function(_0x3b38a2,_0x625ee0){_0x3b38a2=_0x3b38a2-0x0;var _0x4149aa=_0xaa15[_0x3b38a2];return _0x4149aa;};'use strict';var multer=require(_0x5aa1('0x0'));var util=require(_0x5aa1('0x1'));var path=require('path');var timeout=require(_0x5aa1('0x2'));var express=require('express');var router=express[_0x5aa1('0x3')]();var fs_extra=require(_0x5aa1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5aa1('0x5'));var config=require(_0x5aa1('0x6'));var controller=require(_0x5aa1('0x7'));router[_0x5aa1('0x8')]('/',auth[_0x5aa1('0x9')](),controller[_0x5aa1('0xa')]);router[_0x5aa1('0x8')](_0x5aa1('0xb'),auth[_0x5aa1('0x9')](),controller['describe']);router[_0x5aa1('0x8')](_0x5aa1('0xc'),auth[_0x5aa1('0x9')](),controller[_0x5aa1('0xd')]);router[_0x5aa1('0x8')](_0x5aa1('0xe'),auth[_0x5aa1('0x9')](),controller[_0x5aa1('0xf')]);router[_0x5aa1('0x10')]('/',auth['isAuthenticated'](),controller[_0x5aa1('0x11')]);router[_0x5aa1('0x10')](_0x5aa1('0x12'),auth['isAuthenticated'](),controller[_0x5aa1('0x13')]);router[_0x5aa1('0x14')](_0x5aa1('0xe'),auth[_0x5aa1('0x9')](),controller[_0x5aa1('0x15')]);router[_0x5aa1('0x16')](_0x5aa1('0xe'),auth['isAuthenticated'](),controller[_0x5aa1('0x17')]);module[_0x5aa1('0x18')]=router; \ No newline at end of file +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 diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 58667e3..7c9785a 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 _0x7dee=['moment','exports','INTEGER','contactListQueue'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7dee,0xb0));var _0xe7de=function(_0x5a2040,_0x1bdcd8){_0x5a2040=_0x5a2040-0x0;var _0x3509b5=_0x7dee[_0x5a2040];return _0x3509b5;};'use strict';var moment=require(_0xe7de('0x0'));var Sequelize=require('sequelize');module[_0xe7de('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0xe7de('0x2')],'unique':_0xe7de('0x3')},'ListId':{'type':Sequelize[_0xe7de('0x2')],'unique':_0xe7de('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xe7de('0x3')}}; \ No newline at end of file +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 diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 65b6419..fe043ba 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 _0xc713=['merge','VIRTUAL','options','CmHopperBlack','includeAll','include','rows','catch','show','params','rawAttributes','find','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','undefined','count','limit','status','Content-Range','apply','save','update','then','destroy','error','name','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x9fdca,_0x364493){var _0x4037a3=function(_0x241c66){while(--_0x241c66){_0x9fdca['push'](_0x9fdca['shift']());}};_0x4037a3(++_0x364493);}(_0xc713,0xec));var _0x3c71=function(_0x17347d,_0x546f88){_0x17347d=_0x17347d-0x0;var _0xb6e42f=_0xc713[_0x17347d];return _0xb6e42f;};'use strict';var emlformat=require(_0x3c71('0x0'));var rimraf=require(_0x3c71('0x1'));var zipdir=require(_0x3c71('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3c71('0x3'));var moment=require(_0x3c71('0x4'));var BPromise=require(_0x3c71('0x5'));var Mustache=require(_0x3c71('0x6'));var util=require(_0x3c71('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3c71('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3c71('0x9'));var squel=require('squel');var crypto=require(_0x3c71('0xa'));var jsforce=require(_0x3c71('0xb'));var deskjs=require(_0x3c71('0xc'));var toCsv=require(_0x3c71('0xd'));var querystring=require(_0x3c71('0xe'));var Papa=require(_0x3c71('0xf'));var Redis=require('ioredis');var authService=require(_0x3c71('0x10'));var qs=require(_0x3c71('0x11'));var as=require(_0x3c71('0x12'));var hardwareService=require(_0x3c71('0x13'));var logger=require(_0x3c71('0x14'))(_0x3c71('0x15'));var utils=require(_0x3c71('0x16'));var config=require(_0x3c71('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3c71('0x18'))['db'];function respondWithStatusCode(_0x55a165,_0x54ace2){_0x54ace2=_0x54ace2||0xcc;return function(_0x54e66a){if(_0x54e66a){return _0x55a165[_0x3c71('0x19')](_0x54ace2);}return _0x55a165['status'](_0x54ace2)[_0x3c71('0x1a')]();};}function respondWithResult(_0x145e65,_0x3d5c35){_0x3d5c35=_0x3d5c35||0xc8;return function(_0x20a831){if(_0x20a831){return _0x145e65['status'](_0x3d5c35)[_0x3c71('0x1b')](_0x20a831);}};}function respondWithFilteredResult(_0xe350ba,_0x558364){return function(_0xa67049){if(_0xa67049){var _0x5620e2=typeof _0x558364[_0x3c71('0x1c')]===_0x3c71('0x1d')&&typeof _0x558364['limit']===_0x3c71('0x1d');var _0x1473ec=_0xa67049['count'];var _0x50256f=_0x5620e2?0x0:_0x558364[_0x3c71('0x1c')];var _0x313360=_0x5620e2?_0xa67049[_0x3c71('0x1e')]:_0x558364[_0x3c71('0x1c')]+_0x558364[_0x3c71('0x1f')];var _0x2ee46f;if(_0x313360>=_0x1473ec){_0x313360=_0x1473ec;_0x2ee46f=0xc8;}else{_0x2ee46f=0xce;}_0xe350ba[_0x3c71('0x20')](_0x2ee46f);return _0xe350ba['set'](_0x3c71('0x21'),_0x50256f+'-'+_0x313360+'/'+_0x1473ec)['json'](_0xa67049);}return null;};}function patchUpdates(_0x5471cc){return function(_0x580e28){try{jsonpatch[_0x3c71('0x22')](_0x580e28,_0x5471cc,!![]);}catch(_0x2a4419){return BPromise['reject'](_0x2a4419);}return _0x580e28[_0x3c71('0x23')]();};}function saveUpdates(_0x5a0a70,_0x22aa8c){return function(_0x4ac44d){if(_0x4ac44d){return _0x4ac44d[_0x3c71('0x24')](_0x5a0a70)[_0x3c71('0x25')](function(_0x394ca7){return _0x394ca7;});}return null;};}function removeEntity(_0x32bf70,_0x513575){return function(_0x4048ee){if(_0x4048ee){return _0x4048ee[_0x3c71('0x26')]()[_0x3c71('0x25')](function(){_0x32bf70[_0x3c71('0x20')](0xcc)[_0x3c71('0x1a')]();});}};}function handleEntityNotFound(_0x434264,_0x3e2cee){return function(_0x484fc0){if(!_0x484fc0){_0x434264[_0x3c71('0x19')](0x194);}return _0x484fc0;};}function handleError(_0x4907cc,_0x2978f2){_0x2978f2=_0x2978f2||0x1f4;return function(_0x4f60f0){logger[_0x3c71('0x27')](_0x4f60f0['stack']);if(_0x4f60f0[_0x3c71('0x28')]){delete _0x4f60f0['name'];}_0x4907cc[_0x3c71('0x20')](_0x2978f2)['send'](_0x4f60f0);};}exports['index']=function(_0x120093,_0x118370){var _0x1642ab={},_0x24c9ff={},_0x103b65={'count':0x0,'rows':[]};var _0x4cf051=_[_0x3c71('0x29')](db['CmHopperBlack']['rawAttributes'],function(_0x58c9cf){return{'name':_0x58c9cf[_0x3c71('0x2a')],'type':_0x58c9cf[_0x3c71('0x2b')][_0x3c71('0x2c')]};});_0x24c9ff[_0x3c71('0x2d')]=_[_0x3c71('0x29')](_0x4cf051,_0x3c71('0x28'));_0x24c9ff[_0x3c71('0x2e')]=_[_0x3c71('0x2f')](_0x120093[_0x3c71('0x2e')]);_0x24c9ff[_0x3c71('0x30')]=_[_0x3c71('0x31')](_0x24c9ff[_0x3c71('0x2d')],_0x24c9ff[_0x3c71('0x2e')]);_0x1642ab[_0x3c71('0x32')]=_[_0x3c71('0x31')](_0x24c9ff[_0x3c71('0x2d')],qs[_0x3c71('0x33')](_0x120093[_0x3c71('0x2e')][_0x3c71('0x33')]));_0x1642ab['attributes']=_0x1642ab[_0x3c71('0x32')][_0x3c71('0x34')]?_0x1642ab[_0x3c71('0x32')]:_0x24c9ff[_0x3c71('0x2d')];if(!_0x120093['query'][_0x3c71('0x35')](_0x3c71('0x36'))){_0x1642ab[_0x3c71('0x1f')]=qs[_0x3c71('0x1f')](_0x120093[_0x3c71('0x2e')][_0x3c71('0x1f')]);_0x1642ab[_0x3c71('0x1c')]=qs[_0x3c71('0x1c')](_0x120093[_0x3c71('0x2e')]['offset']);}_0x1642ab[_0x3c71('0x37')]=qs[_0x3c71('0x38')](_0x120093['query'][_0x3c71('0x38')]);_0x1642ab['where']=qs[_0x3c71('0x30')](_[_0x3c71('0x39')](_0x120093[_0x3c71('0x2e')],_0x24c9ff[_0x3c71('0x30')]),_0x4cf051);if(_0x120093[_0x3c71('0x2e')][_0x3c71('0x3a')]){_0x1642ab[_0x3c71('0x3b')]=_[_0x3c71('0x3c')](_0x1642ab[_0x3c71('0x3b')],{'$or':_['map'](_0x4cf051,function(_0x1674fc){if(_0x1674fc[_0x3c71('0x2b')]!==_0x3c71('0x3d')){var _0x5363ff={};_0x5363ff[_0x1674fc[_0x3c71('0x28')]]={'$like':'%'+_0x120093['query'][_0x3c71('0x3a')]+'%'};return _0x5363ff;}})});}_0x1642ab=_[_0x3c71('0x3c')]({},_0x1642ab,_0x120093[_0x3c71('0x3e')]);var _0x4a7860={'where':_0x1642ab[_0x3c71('0x3b')]};return db[_0x3c71('0x3f')][_0x3c71('0x1e')](_0x4a7860)[_0x3c71('0x25')](function(_0x25fd97){_0x103b65[_0x3c71('0x1e')]=_0x25fd97;if(_0x120093[_0x3c71('0x2e')][_0x3c71('0x40')]){_0x1642ab[_0x3c71('0x41')]=[{'all':!![]}];}return db[_0x3c71('0x3f')]['findAll'](_0x1642ab);})[_0x3c71('0x25')](function(_0x1ec57d){_0x103b65[_0x3c71('0x42')]=_0x1ec57d;return _0x103b65;})[_0x3c71('0x25')](respondWithFilteredResult(_0x118370,_0x1642ab))[_0x3c71('0x43')](handleError(_0x118370,null));};exports[_0x3c71('0x44')]=function(_0x4bc203,_0x24119a){var _0x5a8ba7={'raw':!![],'where':{'id':_0x4bc203[_0x3c71('0x45')]['id']}},_0x298101={};_0x298101[_0x3c71('0x2d')]=_[_0x3c71('0x2f')](db['CmHopperBlack'][_0x3c71('0x46')]);_0x298101[_0x3c71('0x2e')]=_[_0x3c71('0x2f')](_0x4bc203[_0x3c71('0x2e')]);_0x298101[_0x3c71('0x30')]=_[_0x3c71('0x31')](_0x298101[_0x3c71('0x2d')],_0x298101['query']);_0x5a8ba7['attributes']=_[_0x3c71('0x31')](_0x298101[_0x3c71('0x2d')],qs[_0x3c71('0x33')](_0x4bc203[_0x3c71('0x2e')][_0x3c71('0x33')]));_0x5a8ba7[_0x3c71('0x32')]=_0x5a8ba7[_0x3c71('0x32')][_0x3c71('0x34')]?_0x5a8ba7['attributes']:_0x298101[_0x3c71('0x2d')];if(_0x4bc203['query']['includeAll']){_0x5a8ba7[_0x3c71('0x41')]=[{'all':!![]}];}_0x5a8ba7=_[_0x3c71('0x3c')]({},_0x5a8ba7,_0x4bc203[_0x3c71('0x3e')]);return db[_0x3c71('0x3f')][_0x3c71('0x47')](_0x5a8ba7)['then'](handleEntityNotFound(_0x24119a,null))[_0x3c71('0x25')](respondWithResult(_0x24119a,null))[_0x3c71('0x43')](handleError(_0x24119a,null));};exports[_0x3c71('0x24')]=function(_0xf1756a,_0x1f457d){if(_0xf1756a[_0x3c71('0x48')]['id']){delete _0xf1756a[_0x3c71('0x48')]['id'];}return db['CmHopperBlack'][_0x3c71('0x47')]({'where':{'id':_0xf1756a[_0x3c71('0x45')]['id']}})[_0x3c71('0x25')](handleEntityNotFound(_0x1f457d,null))[_0x3c71('0x25')](saveUpdates(_0xf1756a[_0x3c71('0x48')],null))[_0x3c71('0x25')](respondWithResult(_0x1f457d,null))[_0x3c71('0x43')](handleError(_0x1f457d,null));};exports[_0x3c71('0x26')]=function(_0x4d747e,_0x51b593){return db[_0x3c71('0x3f')][_0x3c71('0x47')]({'where':{'id':_0x4d747e[_0x3c71('0x45')]['id']}})[_0x3c71('0x25')](handleEntityNotFound(_0x51b593,null))[_0x3c71('0x25')](removeEntity(_0x51b593,null))[_0x3c71('0x43')](handleError(_0x51b593,null));};exports[_0x3c71('0x49')]=function(_0x44a0d9,_0x386e21){return db[_0x3c71('0x3f')]['describe']()[_0x3c71('0x25')](respondWithResult(_0x386e21,null))['catch'](handleError(_0x386e21,null));}; \ No newline at end of file +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 diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 0b31b7c..7832506 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 _0x650a=['rimraf','../../config/environment','./cmHopperBlack.attributes','exports','CmHopperBlack','cm_hopper_black','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x34048f,_0x5487d3){var _0x4afc2e=function(_0x987980){while(--_0x987980){_0x34048f['push'](_0x34048f['shift']());}};_0x4afc2e(++_0x5487d3);}(_0x650a,0x150));var _0xa650=function(_0x3f05b0,_0x393861){_0x3f05b0=_0x3f05b0-0x0;var _0x15dfe1=_0x650a[_0x3f05b0];return _0x15dfe1;};'use strict';var _=require(_0xa650('0x0'));var util=require('util');var logger=require(_0xa650('0x1'))(_0xa650('0x2'));var moment=require('moment');var BPromise=require(_0xa650('0x3'));var rp=require(_0xa650('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa650('0x5'));var config=require(_0xa650('0x6'));var attributes=require(_0xa650('0x7'));module[_0xa650('0x8')]=function(_0x87168,_0x18f600){return _0x87168['define'](_0xa650('0x9'),attributes,{'tableName':_0xa650('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 146587a..23bdd1d 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 _0x79d3=['request\x20sent','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','options','limit','include','map','model','attributes','debug','UpdateCmHopperBlack','body','DestroyCmHopperBlack','destroy','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','then','info','CmHopperBlack,\x20%s,\x20%s'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x79d3,0x1e3));var _0x379d=function(_0x1f1bbc,_0x40ca9b){_0x1f1bbc=_0x1f1bbc-0x0;var _0x3f9d0d=_0x79d3[_0x1f1bbc];return _0x3f9d0d;};'use strict';var _=require('lodash');var util=require(_0x379d('0x0'));var moment=require(_0x379d('0x1'));var BPromise=require(_0x379d('0x2'));var rs=require(_0x379d('0x3'));var fs=require('fs');var Redis=require(_0x379d('0x4'));var db=require(_0x379d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x379d('0x6'))(_0x379d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x379d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5dba0c,_0x1deeb6,_0x413aa3){return new BPromise(function(_0x565e42,_0x4b9c73){return client['request'](_0x5dba0c,_0x413aa3)[_0x379d('0x9')](function(_0x17158d){logger[_0x379d('0xa')](_0x379d('0xb'),_0x1deeb6,_0x379d('0xc'));logger['debug']('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1deeb6,'request\x20sent',JSON[_0x379d('0xd')](_0x17158d));if(_0x17158d[_0x379d('0xe')]){if(_0x17158d[_0x379d('0xe')][_0x379d('0xf')]===0x1f4){logger[_0x379d('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x1deeb6,_0x17158d[_0x379d('0xe')][_0x379d('0x10')]);return _0x4b9c73(_0x17158d[_0x379d('0xe')][_0x379d('0x10')]);}logger[_0x379d('0xe')](_0x379d('0xb'),_0x1deeb6,_0x17158d['error']['message']);return _0x565e42(_0x17158d[_0x379d('0xe')]['message']);}else{logger[_0x379d('0xa')]('CmHopperBlack,\x20%s,\x20%s',_0x1deeb6,_0x379d('0xc'));_0x565e42(_0x17158d[_0x379d('0x11')][_0x379d('0x10')]);}})[_0x379d('0x12')](function(_0x306045){logger['error'](_0x379d('0xb'),_0x1deeb6,_0x306045);_0x4b9c73(_0x306045);});});}exports[_0x379d('0x13')]=function(_0x5348c6){var _0x1b566b=this;return new Promise(function(_0xe2ea27,_0x1249bb){return db[_0x379d('0x14')]['findAll']({'raw':_0x5348c6[_0x379d('0x15')]?_0x5348c6[_0x379d('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x5348c6[_0x379d('0x15')]?_0x5348c6[_0x379d('0x15')]['where']||null:null,'attributes':_0x5348c6[_0x379d('0x15')]?_0x5348c6[_0x379d('0x15')]['attributes']||null:null,'limit':_0x5348c6[_0x379d('0x15')]?_0x5348c6[_0x379d('0x15')][_0x379d('0x16')]||null:null,'include':_0x5348c6[_0x379d('0x15')]?_0x5348c6[_0x379d('0x15')][_0x379d('0x17')]?_[_0x379d('0x18')](_0x5348c6['options'][_0x379d('0x17')],function(_0x3e7302){return{'model':db[_0x3e7302[_0x379d('0x19')]],'as':_0x3e7302['as'],'attributes':_0x3e7302['attributes'],'include':_0x3e7302['include']?_['map'](_0x3e7302[_0x379d('0x17')],function(_0x1479f0){return{'model':db[_0x1479f0['model']],'as':_0x1479f0['as'],'attributes':_0x1479f0[_0x379d('0x1a')],'include':_0x1479f0[_0x379d('0x17')]?_[_0x379d('0x18')](_0x1479f0[_0x379d('0x17')],function(_0x15c177){return{'model':db[_0x15c177[_0x379d('0x19')]],'as':_0x15c177['as'],'attributes':_0x15c177['attributes']};}):[]};}):[]};}):[]:[]})[_0x379d('0x9')](function(_0x299d4b){logger[_0x379d('0xa')](_0x379d('0x13'),_0x5348c6);logger[_0x379d('0x1b')]('GetCmHopperBlack',_0x5348c6,JSON['stringify'](_0x299d4b));_0xe2ea27(_0x299d4b);})[_0x379d('0x12')](function(_0x1d9ec0){logger['error'](_0x379d('0x13'),_0x1d9ec0[_0x379d('0x10')],_0x5348c6);_0x1249bb(_0x1b566b[_0x379d('0xe')](0x1f4,_0x1d9ec0['message']));});});};exports[_0x379d('0x1c')]=function(_0x4aa3aa){var _0x2979e8=this;return new Promise(function(_0x4f7756,_0x4c986b){return db[_0x379d('0x14')]['update'](_0x4aa3aa[_0x379d('0x1d')],{'raw':_0x4aa3aa[_0x379d('0x15')]?_0x4aa3aa[_0x379d('0x15')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4aa3aa[_0x379d('0x15')]?_0x4aa3aa[_0x379d('0x15')]['where']||null:null,'attributes':_0x4aa3aa[_0x379d('0x15')]?_0x4aa3aa[_0x379d('0x15')][_0x379d('0x1a')]||null:null,'limit':_0x4aa3aa[_0x379d('0x15')]?_0x4aa3aa[_0x379d('0x15')][_0x379d('0x16')]||null:null})[_0x379d('0x9')](function(_0x3933dd){logger['info']('UpdateCmHopperBlack',_0x4aa3aa);logger[_0x379d('0x1b')](_0x379d('0x1c'),_0x4aa3aa,JSON[_0x379d('0xd')](_0x3933dd));_0x4f7756(_0x3933dd);})[_0x379d('0x12')](function(_0x6cd34){logger[_0x379d('0xe')](_0x379d('0x1c'),_0x6cd34[_0x379d('0x10')],_0x4aa3aa);_0x4c986b(_0x2979e8[_0x379d('0xe')](0x1f4,_0x6cd34[_0x379d('0x10')]));});});};exports[_0x379d('0x1e')]=function(_0x55e91c){var _0x3659a7=this;return new Promise(function(_0x521d42,_0x2fad3f){return db[_0x379d('0x14')][_0x379d('0x1f')]({'where':_0x55e91c[_0x379d('0x15')]?_0x55e91c[_0x379d('0x15')][_0x379d('0x20')]||null:null})[_0x379d('0x9')](function(_0x38d562){logger[_0x379d('0xa')]('DestroyCmHopperBlack',_0x55e91c);logger['debug'](_0x379d('0x1e'),_0x55e91c,JSON[_0x379d('0xd')](_0x38d562));_0x521d42(_0x38d562);})[_0x379d('0x12')](function(_0x64b8cc){logger[_0x379d('0xe')](_0x379d('0x1e'),_0x64b8cc[_0x379d('0x10')],_0x55e91c);_0x2fad3f(_0x3659a7['error'](0x1f4,_0x64b8cc['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 8768955..1c768b2 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 _0xc4aa=['isAuthenticated','index','/describe','/:id','show','update','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./cmHopperBlack.controller','get'];(function(_0x8352c9,_0xd5adc8){var _0x376b76=function(_0x2bf937){while(--_0x2bf937){_0x8352c9['push'](_0x8352c9['shift']());}};_0x376b76(++_0xd5adc8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xc4aa[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['put'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xe')]);router['delete'](_0xac4a('0xc'),auth['isAuthenticated'](),controller[_0xac4a('0xf')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index e88dbb1..7fb7ef7 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 _0x7323=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','BOOLEAN'];(function(_0x1da32c,_0x4704b8){var _0x563673=function(_0x4e64a2){while(--_0x4e64a2){_0x1da32c['push'](_0x1da32c['shift']());}};_0x563673(++_0x4704b8);}(_0x7323,0xd8));var _0x3732=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x7323[_0xbb9dbf];return _0x30223c;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3732('0x0'));module[_0x3732('0x1')]={'state':{'type':Sequelize[_0x3732('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3732('0x3')]},'scheduledat':{'type':Sequelize[_0x3732('0x4')]},'countbusyretry':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x3732('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x3732('0x3')]},'calleridnum':{'type':Sequelize[_0x3732('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x3732('0x4')]},'answertime':{'type':Sequelize[_0x3732('0x4')]},'droptime':{'type':Sequelize[_0x3732('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3732('0x3')]},'campaign':{'type':Sequelize[_0x3732('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3732('0x3')]},'reason':{'type':Sequelize[_0x3732('0x3')]},'disposition':{'type':Sequelize[_0x3732('0x3')]},'secondDisposition':{'type':Sequelize[_0x3732('0x3')]},'thirdDisposition':{'type':Sequelize[_0x3732('0x3')]},'dispositionat':{'type':Sequelize[_0x3732('0x4')],'set':function(_0x415768){var _0x77d01e=this[_0x3732('0x5')](_0x3732('0x6'));if(_0x77d01e&&_0x415768){this[_0x3732('0x7')](_0x3732('0x8'),moment(_0x415768)[_0x3732('0x9')](moment(_0x77d01e),_0x3732('0xa')));}return this[_0x3732('0x7')]('dispositionat',_0x415768);}},'amd':{'type':Sequelize[_0x3732('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3732('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x3732('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x3732('0xb')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x3732('0x4')]},'callback':{'type':Sequelize[_0x3732('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3732('0x4')]},'deleted':{'type':Sequelize[_0x3732('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3732('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3732('0x4')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3732('0x2')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index da30b02..86f3af4 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 _0x9536=['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','CmHopperFinal','fieldName','model','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','rawAttributes','intersection','length','options','find','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','noSuchContacts','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ListId','NOW()','from','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ListId)','CampaignId\x20=\x20?','cm_hopper_final','group','checkContactHopper','CmHopper','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x2d03be,_0x56118d){var _0xf54e87=function(_0x2f2cfb){while(--_0x2f2cfb){_0x2d03be['push'](_0x2d03be['shift']());}};_0xf54e87(++_0x56118d);}(_0x9536,0x179));var _0x6953=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0x9536[_0x5d0609];return _0xaa3fd1;};'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['CmHopperFinal'][_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['describe']=function(_0x15c142,_0x1d5979){return db[_0x6953('0x2b')]['describe']()[_0x6953('0x3c')](respondWithResult(_0x1d5979,null))[_0x6953('0x41')](handleError(_0x1d5979,null));};exports['update']=function(_0x525145,_0xbf5b61){if(_0x525145[_0x6953('0x48')][_0x6953('0x49')]){delete _0x525145[_0x6953('0x48')][_0x6953('0x49')];}return db[_0x6953('0x2b')][_0x6953('0x47')]({'where':{'uniqueid':_0x525145[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xbf5b61,null))[_0x6953('0x3c')](saveUpdates(_0x525145[_0x6953('0x48')],null))['then'](respondWithResult(_0xbf5b61,null))['catch'](handleError(_0xbf5b61,null));};exports[_0x6953('0x4a')]=function(_0x38e3e8,_0x68ab5d,_0x7bcd92){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'VoiceQueueId':_0x38e3e8[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db['sequelize']['fn']('COUNT',db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db['sequelize']['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db['sequelize']['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6953('0x4e')](_0x6953('0x57')))),'reCallContacts'],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x58')))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x68ab5d,null))['then'](respondWithResult(_0x68ab5d,null))[_0x6953('0x41')](handleError(_0x68ab5d,null));};exports[_0x6953('0x5a')]=function(_0x35ac0e,_0x57ffab,_0x479ab4){return db[_0x6953('0x2b')][_0x6953('0x3f')]({'raw':![],'where':{'CampaignId':_0x35ac0e[_0x6953('0x42')]['id']},'attributes':[[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5b')))),_0x6953('0x4d')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x4f')))),_0x6953('0x50')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5c')))),_0x6953('0x51')],[db[_0x6953('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x52')))),_0x6953('0x53')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db['sequelize']['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x54')))),_0x6953('0x55')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')](_0x6953('0x5d')))),_0x6953('0x56')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')]['literal'](_0x6953('0x57')))),_0x6953('0x5e')],[db[_0x6953('0x4b')]['fn'](_0x6953('0x4c'),db[_0x6953('0x4b')]['fn']('IF',db[_0x6953('0x4b')][_0x6953('0x4e')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6953('0x59')]]})[_0x6953('0x3c')](handleEntityNotFound(_0x57ffab,null))['then'](respondWithResult(_0x57ffab,null))[_0x6953('0x41')](handleError(_0x57ffab,null));};exports[_0x6953('0x5f')]=function(_0x41d74d,_0x5063ac,_0x4cb8a4){return db[_0x6953('0x60')][_0x6953('0x47')]({'where':{'id':_0x41d74d[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0x5063ac,null))[_0x6953('0x3c')](function(_0x43a39f){var _0x3cf1c0;if(_0x43a39f){_0x3cf1c0=squel[_0x6953('0x61')]()[_0x6953('0x62')]('cm_hopper')[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),_0x6953('0x66'),'ListId',_0x6953('0x67'),_0x6953('0x68'),_0x6953('0x69')],squel['select']()[_0x6953('0x6a')](_0x6953('0x6b'),_0x6953('0x64'))[_0x6953('0x6a')]('NOW()',_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field']('ANY_VALUE(ListId)',_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(VoiceQueueId)','VoiceQueueId')[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x68'))[_0x6953('0x6a')]('NOW()',_0x6953('0x69'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id']['toString']())['where'](_0x6953('0x71'),_0x41d74d[_0x6953('0x48')][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x64'))[_0x6953('0x6f')](_0x6953('0x76'))[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d['params']['id'][_0x6953('0x73')]()))['where'](_0x6953('0x75'),squel['select']()[_0x6953('0x6a')](_0x6953('0x77'))[_0x6953('0x6f')]('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x70'),_0x41d74d[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))['group'](_0x6953('0x66')))[_0x6953('0x73')]();return db[_0x6953('0x4b')][_0x6953('0x2e')](_0x3cf1c0);}return[];})[_0x6953('0x3c')](respondWithResult(_0x5063ac,null))[_0x6953('0x41')](handleError(_0x5063ac,null));};exports[_0x6953('0x79')]=function(_0xa26241,_0xefb593,_0x216b92){return db[_0x6953('0x7a')]['find']({'where':{'id':_0xa26241[_0x6953('0x42')]['id']}})[_0x6953('0x3c')](handleEntityNotFound(_0xefb593,null))[_0x6953('0x3c')](function(_0x396a9f){var _0x92c0bc;if(_0x396a9f){_0x92c0bc=squel[_0x6953('0x61')]()[_0x6953('0x62')](_0x6953('0x76'))[_0x6953('0x63')]([_0x6953('0x64'),_0x6953('0x65'),'ContactId',_0x6953('0x6d'),_0x6953('0x7b'),_0x6953('0x68'),'updatedAt'],squel[_0x6953('0x7c')]()['field']('ANY_VALUE(calleridnum)',_0x6953('0x64'))[_0x6953('0x6a')](_0x6953('0x6e'),_0x6953('0x65'))[_0x6953('0x6a')](_0x6953('0x6c'),_0x6953('0x66'))['field'](_0x6953('0x7d'),_0x6953('0x6d'))[_0x6953('0x6a')]('ANY_VALUE(CampaignId)',_0x6953('0x7b'))[_0x6953('0x6a')]('NOW()',_0x6953('0x68'))['field']('NOW()',_0x6953('0x69'))['from']('cm_hopper_final')[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id']['toString']())[_0x6953('0x39')](_0x6953('0x71'),_0xa26241['body'][_0x6953('0x72')][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x74'))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x64'))['from'](_0x6953('0x76'))[_0x6953('0x39')]('CampaignId\x20=\x20?',_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]()))[_0x6953('0x39')](_0x6953('0x75'),squel[_0x6953('0x7c')]()[_0x6953('0x6a')](_0x6953('0x77'))['from'](_0x6953('0x7f'))[_0x6953('0x39')](_0x6953('0x7e'),_0xa26241[_0x6953('0x42')]['id'][_0x6953('0x73')]())[_0x6953('0x39')](_0x6953('0x78')))[_0x6953('0x80')](_0x6953('0x66')))['toString']();return db[_0x6953('0x4b')]['query'](_0x92c0bc);}return[];})[_0x6953('0x3c')](respondWithResult(_0xefb593,null))['catch'](handleError(_0xefb593,null));};exports[_0x6953('0x81')]=function(_0x7215ed,_0x3cb96a,_0x46bcec){return db[_0x6953('0x82')]['findOne']({'where':{'VoiceQueueId':_0x7215ed[_0x6953('0x48')]['VoiceQueueId'],'CampaignId':_0x7215ed[_0x6953('0x48')][_0x6953('0x7b')],'ContactId':_0x7215ed[_0x6953('0x48')][_0x6953('0x66')]}})['then'](handleEntityNotFound(_0x3cb96a,null))[_0x6953('0x3c')](function(_0x50f019){if(_0x50f019){return _0x50f019;}return null;})[_0x6953('0x3c')](respondWithResult(_0x3cb96a,null))[_0x6953('0x41')](handleError(_0x3cb96a,null));}; \ No newline at end of file +var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 78201e4..3bf4cc1 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 _0x0168=['../../config/logger','api','moment','bluebird','request-promise','exports','define','calleridnum','uniqueid','util'];(function(_0x3cd752,_0x6a6d9d){var _0x43abf8=function(_0x15a840){while(--_0x15a840){_0x3cd752['push'](_0x3cd752['shift']());}};_0x43abf8(++_0x6a6d9d);}(_0x0168,0x9f));var _0x8016=function(_0x380b8e,_0x229daa){_0x380b8e=_0x380b8e-0x0;var _0x1d78f7=_0x0168[_0x380b8e];return _0x1d78f7;};'use strict';var _=require('lodash');var util=require(_0x8016('0x0'));var logger=require(_0x8016('0x1'))(_0x8016('0x2'));var moment=require(_0x8016('0x3'));var BPromise=require(_0x8016('0x4'));var rp=require(_0x8016('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0x8016('0x6')]=function(_0x21295b,_0x39e3bf){return _0x21295b[_0x8016('0x7')]('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x8016('0x8'),'fields':['calleridnum']},{'name':_0x8016('0x9'),'fields':[_0x8016('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index f240f6e..000ba39 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x10eb6a,_0x176cce){var _0x27c730=function(_0x3d2c27){while(--_0x3d2c27){_0x10eb6a['push'](_0x10eb6a['shift']());}};_0x27c730(++_0x176cce);}(_0x7a54,0x106));var _0x47a5=function(_0x47842c,_0x38dcbf){_0x47842c=_0x47842c-0x0;var _0x16e419=_0x7a54[_0x47842c];return _0x16e419;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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 diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index db4ffd3..0bf2efa 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 _0x0ffc=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','checkContactHopper','put','update','exports','util','path','express'];(function(_0x3aaf0a,_0x450970){var _0x33e6bc=function(_0x1db54d){while(--_0x1db54d){_0x3aaf0a['push'](_0x3aaf0a['shift']());}};_0x33e6bc(++_0x450970);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x550155,_0x21054e){_0x550155=_0x550155-0x0;var _0x38c781=_0x0ffc[_0x550155];return _0x38c781;};'use strict';var multer=require('multer');var util=require(_0xc0ff('0x0'));var path=require(_0xc0ff('0x1'));var timeout=require('connect-timeout');var express=require(_0xc0ff('0x2'));var router=express['Router']();var fs_extra=require(_0xc0ff('0x3'));var auth=require(_0xc0ff('0x4'));var interaction=require(_0xc0ff('0x5'));var config=require(_0xc0ff('0x6'));var controller=require(_0xc0ff('0x7'));router[_0xc0ff('0x8')]('/',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xa')]);router[_0xc0ff('0x8')]('/describe',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xb')]);router[_0xc0ff('0x8')](_0xc0ff('0xc'),auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xd')]);router[_0xc0ff('0x8')](_0xc0ff('0xe'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0xc0ff('0x8')]('/campaign/countAttributes/:id',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0xf')]);router[_0xc0ff('0x10')](_0xc0ff('0x11'),auth['isAuthenticated'](),controller[_0xc0ff('0x12')]);router[_0xc0ff('0x10')]('/voice/campaign/moveContacts/:id',auth[_0xc0ff('0x9')](),controller['moveContactsIvrCampaignHopperFinal']);router['post']('/checkContactHopper',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0x13')]);router[_0xc0ff('0x14')]('/:id',auth[_0xc0ff('0x9')](),controller[_0xc0ff('0x15')]);module[_0xc0ff('0x16')]=router; \ No newline at end of file +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 diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 0b7d33d..12cad4f 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 _0x97f0=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x595249,_0x368def){var _0x979ea6=function(_0x4227a6){while(--_0x4227a6){_0x595249['push'](_0x595249['shift']());}};_0x979ea6(++_0x368def);}(_0x97f0,0x194));var _0x097f=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x97f0[_0x5a19fc];return _0x34b413;};'use strict';var Sequelize=require(_0x097f('0x0'));module[_0x097f('0x1')]={'state':{'type':Sequelize[_0x097f('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x097f('0x3')]},'scheduledat':{'type':Sequelize[_0x097f('0x4')]},'countbusyretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x097f('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x097f('0x3')]},'calleridnum':{'type':Sequelize[_0x097f('0x3')]},'calleridname':{'type':Sequelize[_0x097f('0x3')]},'starttime':{'type':Sequelize[_0x097f('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x097f('0x4')]},'droptime':{'type':Sequelize[_0x097f('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x097f('0x3')]},'campaign':{'type':Sequelize[_0x097f('0x3')]},'campaigntype':{'type':Sequelize[_0x097f('0x3')]},'membername':{'type':Sequelize[_0x097f('0x3')]},'reason':{'type':Sequelize[_0x097f('0x3')]},'amd':{'type':Sequelize[_0x097f('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x097f('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x097f('0x4')]},'recallme':{'type':Sequelize[_0x097f('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x097f('0x4')]},'edited':{'type':Sequelize[_0x097f('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x097f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 88ffae3..d0b3452 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 _0xcba4=['merge','options','includeAll','findAll','show','params','catch','create','body','describe','update','uniqueid','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','then','destroy','error','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter'];(function(_0x3ca7c9,_0x3a94b8){var _0x424eb8=function(_0x4a40c8){while(--_0x4a40c8){_0x3ca7c9['push'](_0x3ca7c9['shift']());}};_0x424eb8(++_0x3a94b8);}(_0xcba4,0xa3));var _0x4cba=function(_0x4330cf,_0x296bd9){_0x4330cf=_0x4330cf-0x0;var _0x5c545c=_0xcba4[_0x4330cf];return _0x5c545c;};'use strict';var emlformat=require(_0x4cba('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4cba('0x1'));var jsonpatch=require(_0x4cba('0x2'));var rp=require(_0x4cba('0x3'));var moment=require(_0x4cba('0x4'));var BPromise=require(_0x4cba('0x5'));var Mustache=require(_0x4cba('0x6'));var util=require(_0x4cba('0x7'));var path=require(_0x4cba('0x8'));var sox=require(_0x4cba('0x9'));var csv=require(_0x4cba('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4cba('0xb'));var _=require(_0x4cba('0xc'));var squel=require(_0x4cba('0xd'));var crypto=require(_0x4cba('0xe'));var jsforce=require(_0x4cba('0xf'));var deskjs=require(_0x4cba('0x10'));var toCsv=require(_0x4cba('0xa'));var querystring=require(_0x4cba('0x11'));var Papa=require('papaparse');var Redis=require(_0x4cba('0x12'));var authService=require(_0x4cba('0x13'));var qs=require(_0x4cba('0x14'));var as=require(_0x4cba('0x15'));var hardwareService=require(_0x4cba('0x16'));var logger=require(_0x4cba('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4cba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x165e59,_0x42b335){_0x42b335=_0x42b335||0xcc;return function(_0x43d649){if(_0x43d649){return _0x165e59[_0x4cba('0x19')](_0x42b335);}return _0x165e59[_0x4cba('0x1a')](_0x42b335)[_0x4cba('0x1b')]();};}function respondWithResult(_0x11d487,_0x183d4e){_0x183d4e=_0x183d4e||0xc8;return function(_0x555807){if(_0x555807){return _0x11d487[_0x4cba('0x1a')](_0x183d4e)[_0x4cba('0x1c')](_0x555807);}};}function respondWithFilteredResult(_0x104c12,_0x260adf){return function(_0xe7d2e0){if(_0xe7d2e0){var _0x11fbcc=typeof _0x260adf[_0x4cba('0x1d')]===_0x4cba('0x1e')&&typeof _0x260adf['limit']===_0x4cba('0x1e');var _0x4ee164=_0xe7d2e0[_0x4cba('0x1f')];var _0x3ee1ad=_0x11fbcc?0x0:_0x260adf[_0x4cba('0x1d')];var _0x2eda98=_0x11fbcc?_0xe7d2e0[_0x4cba('0x1f')]:_0x260adf[_0x4cba('0x1d')]+_0x260adf[_0x4cba('0x20')];var _0x409aee;if(_0x2eda98>=_0x4ee164){_0x2eda98=_0x4ee164;_0x409aee=0xc8;}else{_0x409aee=0xce;}_0x104c12[_0x4cba('0x1a')](_0x409aee);return _0x104c12[_0x4cba('0x21')](_0x4cba('0x22'),_0x3ee1ad+'-'+_0x2eda98+'/'+_0x4ee164)['json'](_0xe7d2e0);}return null;};}function patchUpdates(_0x34ad0){return function(_0x3cff20){try{jsonpatch['apply'](_0x3cff20,_0x34ad0,!![]);}catch(_0x1f9ae7){return BPromise[_0x4cba('0x23')](_0x1f9ae7);}return _0x3cff20['save']();};}function saveUpdates(_0x45b5be,_0x2ea383){return function(_0x223a15){if(_0x223a15){return _0x223a15['update'](_0x45b5be)[_0x4cba('0x24')](function(_0x653031){return _0x653031;});}return null;};}function removeEntity(_0x14b788,_0x1dccac){return function(_0x4b1542){if(_0x4b1542){return _0x4b1542[_0x4cba('0x25')]()[_0x4cba('0x24')](function(){_0x14b788[_0x4cba('0x1a')](0xcc)[_0x4cba('0x1b')]();});}};}function handleEntityNotFound(_0x12fa2a,_0x4ab4dd){return function(_0x319be9){if(!_0x319be9){_0x12fa2a['sendStatus'](0x194);}return _0x319be9;};}function handleError(_0x16bad5,_0xc5c573){_0xc5c573=_0xc5c573||0x1f4;return function(_0x2b7c1a){logger[_0x4cba('0x26')](_0x2b7c1a['stack']);if(_0x2b7c1a[_0x4cba('0x27')]){delete _0x2b7c1a['name'];}_0x16bad5[_0x4cba('0x1a')](_0xc5c573)[_0x4cba('0x28')](_0x2b7c1a);};}exports[_0x4cba('0x29')]=function(_0x447efb,_0x60acd6){var _0x27fe9a={},_0x4bcb05={},_0x1bb96a={'count':0x0,'rows':[]};var _0x54de02=_[_0x4cba('0x2a')](db[_0x4cba('0x2b')][_0x4cba('0x2c')],function(_0x28d461){return{'name':_0x28d461[_0x4cba('0x2d')],'type':_0x28d461[_0x4cba('0x2e')][_0x4cba('0x2f')]};});_0x4bcb05[_0x4cba('0x30')]=_[_0x4cba('0x2a')](_0x54de02,'name');_0x4bcb05['query']=_[_0x4cba('0x31')](_0x447efb[_0x4cba('0x32')]);_0x4bcb05['filters']=_[_0x4cba('0x33')](_0x4bcb05['model'],_0x4bcb05['query']);_0x27fe9a['attributes']=_[_0x4cba('0x33')](_0x4bcb05[_0x4cba('0x30')],qs['fields'](_0x447efb[_0x4cba('0x32')][_0x4cba('0x34')]));_0x27fe9a['attributes']=_0x27fe9a[_0x4cba('0x35')][_0x4cba('0x36')]?_0x27fe9a[_0x4cba('0x35')]:_0x4bcb05['model'];if(!_0x447efb[_0x4cba('0x32')][_0x4cba('0x37')](_0x4cba('0x38'))){_0x27fe9a[_0x4cba('0x20')]=qs[_0x4cba('0x20')](_0x447efb[_0x4cba('0x32')][_0x4cba('0x20')]);_0x27fe9a[_0x4cba('0x1d')]=qs[_0x4cba('0x1d')](_0x447efb[_0x4cba('0x32')][_0x4cba('0x1d')]);}_0x27fe9a['order']=qs[_0x4cba('0x39')](_0x447efb[_0x4cba('0x32')]['sort']);_0x27fe9a[_0x4cba('0x3a')]=qs[_0x4cba('0x3b')](_[_0x4cba('0x3c')](_0x447efb['query'],_0x4bcb05[_0x4cba('0x3b')]),_0x54de02);if(_0x447efb['query'][_0x4cba('0x3d')]){_0x27fe9a['where']=_[_0x4cba('0x3e')](_0x27fe9a[_0x4cba('0x3a')],{'$or':_[_0x4cba('0x2a')](_0x54de02,function(_0x2e167a){if(_0x2e167a[_0x4cba('0x2e')]!=='VIRTUAL'){var _0x147c09={};_0x147c09[_0x2e167a[_0x4cba('0x27')]]={'$like':'%'+_0x447efb[_0x4cba('0x32')][_0x4cba('0x3d')]+'%'};return _0x147c09;}})});}_0x27fe9a=_[_0x4cba('0x3e')]({},_0x27fe9a,_0x447efb[_0x4cba('0x3f')]);var _0x4dd560={'where':_0x27fe9a['where']};return db[_0x4cba('0x2b')][_0x4cba('0x1f')](_0x4dd560)[_0x4cba('0x24')](function(_0x214532){_0x1bb96a['count']=_0x214532;if(_0x447efb['query'][_0x4cba('0x40')]){_0x27fe9a['include']=[{'all':!![]}];}return db[_0x4cba('0x2b')][_0x4cba('0x41')](_0x27fe9a);})[_0x4cba('0x24')](function(_0x238ed6){_0x1bb96a['rows']=_0x238ed6;return _0x1bb96a;})[_0x4cba('0x24')](respondWithFilteredResult(_0x60acd6,_0x27fe9a))['catch'](handleError(_0x60acd6,null));};exports[_0x4cba('0x42')]=function(_0x7aec21,_0x197ecd){var _0x4c9756={'raw':!![],'where':{'id':_0x7aec21[_0x4cba('0x43')]['id']}},_0x4f2b77={};_0x4f2b77[_0x4cba('0x30')]=_[_0x4cba('0x31')](db['CmHopperHistory']['rawAttributes']);_0x4f2b77['query']=_[_0x4cba('0x31')](_0x7aec21[_0x4cba('0x32')]);_0x4f2b77[_0x4cba('0x3b')]=_[_0x4cba('0x33')](_0x4f2b77[_0x4cba('0x30')],_0x4f2b77[_0x4cba('0x32')]);_0x4c9756[_0x4cba('0x35')]=_[_0x4cba('0x33')](_0x4f2b77[_0x4cba('0x30')],qs[_0x4cba('0x34')](_0x7aec21['query'][_0x4cba('0x34')]));_0x4c9756[_0x4cba('0x35')]=_0x4c9756[_0x4cba('0x35')]['length']?_0x4c9756[_0x4cba('0x35')]:_0x4f2b77[_0x4cba('0x30')];if(_0x7aec21[_0x4cba('0x32')][_0x4cba('0x40')]){_0x4c9756['include']=[{'all':!![]}];}_0x4c9756=_[_0x4cba('0x3e')]({},_0x4c9756,_0x7aec21[_0x4cba('0x3f')]);return db['CmHopperHistory']['find'](_0x4c9756)[_0x4cba('0x24')](handleEntityNotFound(_0x197ecd,null))[_0x4cba('0x24')](respondWithResult(_0x197ecd,null))[_0x4cba('0x44')](handleError(_0x197ecd,null));};exports[_0x4cba('0x45')]=function(_0x5bd098,_0x1b2d09){return db[_0x4cba('0x2b')][_0x4cba('0x45')](_0x5bd098[_0x4cba('0x46')],{})[_0x4cba('0x24')](respondWithResult(_0x1b2d09,0xc9))[_0x4cba('0x44')](handleError(_0x1b2d09,null));};exports[_0x4cba('0x47')]=function(_0x16e659,_0x43c7fa){return db[_0x4cba('0x2b')]['describe']()['then'](respondWithResult(_0x43c7fa,null))['catch'](handleError(_0x43c7fa,null));};exports[_0x4cba('0x48')]=function(_0x186052,_0x57852d){if(_0x186052[_0x4cba('0x46')][_0x4cba('0x49')]){delete _0x186052[_0x4cba('0x46')][_0x4cba('0x49')];}return db['CmHopperHistory'][_0x4cba('0x4a')]({'where':{'uniqueid':_0x186052[_0x4cba('0x43')]['id']}})[_0x4cba('0x24')](handleEntityNotFound(_0x57852d,null))['then'](saveUpdates(_0x186052[_0x4cba('0x46')],null))[_0x4cba('0x24')](respondWithResult(_0x57852d,null))['catch'](handleError(_0x57852d,null));}; \ No newline at end of file +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 diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index c720fad..d13b419 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 _0xeca8=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xeca8,0x1f2));var _0x8eca=function(_0x11bc26,_0x5bd22c){_0x11bc26=_0x11bc26-0x0;var _0xff15a4=_0xeca8[_0x11bc26];return _0xff15a4;};'use strict';var _=require(_0x8eca('0x0'));var util=require(_0x8eca('0x1'));var logger=require(_0x8eca('0x2'))(_0x8eca('0x3'));var moment=require(_0x8eca('0x4'));var BPromise=require(_0x8eca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eca('0x6'));var rimraf=require('rimraf');var config=require(_0x8eca('0x7'));var attributes=require(_0x8eca('0x8'));module[_0x8eca('0x9')]=function(_0x599a26,_0x46f257){return _0x599a26[_0x8eca('0xa')](_0x8eca('0xb'),attributes,{'tableName':_0x8eca('0xc'),'paranoid':![],'indexes':[{'name':_0x8eca('0xd'),'fields':[_0x8eca('0xd')]},{'name':'uniqueid','fields':[_0x8eca('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 219ef2b..d978a2a 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 _0xfa7c=['rpc','jayson/promise','client','http','request','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','info','result','CreateCmHopperHistory','create','body','options','raw','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','literal','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgTalktime','stringify','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5550b3,_0x2d0ee0){var _0x4b8fc4=function(_0x22393a){while(--_0x22393a){_0x5550b3['push'](_0x5550b3['shift']());}};_0x4b8fc4(++_0x2d0ee0);}(_0xfa7c,0x15b));var _0xcfa7=function(_0x5e6285,_0x197dea){_0x5e6285=_0x5e6285-0x0;var _0x342cff=_0xfa7c[_0x5e6285];return _0x342cff;};'use strict';var _=require(_0xcfa7('0x0'));var util=require('util');var moment=require(_0xcfa7('0x1'));var BPromise=require(_0xcfa7('0x2'));var rs=require(_0xcfa7('0x3'));var fs=require('fs');var Redis=require(_0xcfa7('0x4'));var db=require(_0xcfa7('0x5'))['db'];var utils=require(_0xcfa7('0x6'));var logger=require(_0xcfa7('0x7'))(_0xcfa7('0x8'));var config=require('../../config/environment');var jayson=require(_0xcfa7('0x9'));var client=jayson[_0xcfa7('0xa')][_0xcfa7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1d5f85,_0x4b2669,_0x816590){return new BPromise(function(_0x573432,_0x376c4e){return client[_0xcfa7('0xc')](_0x1d5f85,_0x816590)[_0xcfa7('0xd')](function(_0x14e62a){logger['info'](_0xcfa7('0xe'),_0x4b2669,_0xcfa7('0xf'));logger[_0xcfa7('0x10')](_0xcfa7('0x11'),_0x4b2669,_0xcfa7('0xf'),JSON['stringify'](_0x14e62a));if(_0x14e62a['error']){if(_0x14e62a[_0xcfa7('0x12')]['code']===0x1f4){logger[_0xcfa7('0x12')](_0xcfa7('0xe'),_0x4b2669,_0x14e62a[_0xcfa7('0x12')][_0xcfa7('0x13')]);return _0x376c4e(_0x14e62a[_0xcfa7('0x12')][_0xcfa7('0x13')]);}logger[_0xcfa7('0x12')](_0xcfa7('0xe'),_0x4b2669,_0x14e62a['error'][_0xcfa7('0x13')]);return _0x573432(_0x14e62a['error']['message']);}else{logger[_0xcfa7('0x14')](_0xcfa7('0xe'),_0x4b2669,_0xcfa7('0xf'));_0x573432(_0x14e62a[_0xcfa7('0x15')][_0xcfa7('0x13')]);}})['catch'](function(_0x11d8bf){logger[_0xcfa7('0x12')](_0xcfa7('0xe'),_0x4b2669,_0x11d8bf);_0x376c4e(_0x11d8bf);});});}exports[_0xcfa7('0x16')]=function(_0x4e2a46){var _0x21f73c=this;return new Promise(function(_0x34f829,_0x558a21){return db['CmHopperHistory'][_0xcfa7('0x17')](_0x4e2a46[_0xcfa7('0x18')],{'raw':_0x4e2a46[_0xcfa7('0x19')]?_0x4e2a46[_0xcfa7('0x19')][_0xcfa7('0x1a')]===undefined?!![]:![]:!![]})[_0xcfa7('0xd')](function(_0x2312fd){logger[_0xcfa7('0x14')]('CreateCmHopperHistory',_0x4e2a46);logger[_0xcfa7('0x10')]('CreateCmHopperHistory',_0x4e2a46,JSON['stringify'](_0x2312fd));_0x34f829(_0x2312fd);})['catch'](function(_0xdf35fa){logger['error'](_0xcfa7('0x16'),_0xdf35fa[_0xcfa7('0x13')],_0x4e2a46);_0x558a21(_0x21f73c[_0xcfa7('0x12')](0x1f4,_0xdf35fa[_0xcfa7('0x13')]));});});};exports[_0xcfa7('0x1b')]=function(_0x2d00e1){var _0x1562c8=this;return new Promise(function(_0x311f9f,_0x5bff8b){return db[_0xcfa7('0x1c')][_0xcfa7('0x1d')]({'raw':_0x2d00e1[_0xcfa7('0x19')]?_0x2d00e1[_0xcfa7('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2d00e1[_0xcfa7('0x19')]?_0x2d00e1[_0xcfa7('0x19')][_0xcfa7('0x1e')]||null:null,'attributes':[[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db['sequelize'][_0xcfa7('0x21')]('id')),_0xcfa7('0x22')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0xcfa7('0x23')))),_0xcfa7('0x24')],[db[_0xcfa7('0x1f')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xcfa7('0x1f')]['literal']('`state`\x20=\x2010,\x201,\x20null'))),_0xcfa7('0x25')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')](_0xcfa7('0x27')))),_0xcfa7('0x28')],[db['sequelize']['fn']('AVG',db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),'predictiveIntervalAvgHoldtime'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x29'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0xcfa7('0x2a')]]})['then'](function(_0x1b9e07){logger[_0xcfa7('0x14')](_0xcfa7('0x1b'),_0x2d00e1);logger[_0xcfa7('0x10')](_0xcfa7('0x1b'),_0x2d00e1,JSON[_0xcfa7('0x2b')](_0x1b9e07));_0x311f9f(_0x1b9e07);})[_0xcfa7('0x2c')](function(_0x5a9c5a){logger[_0xcfa7('0x12')](_0xcfa7('0x1b'),_0x5a9c5a[_0xcfa7('0x13')],_0x2d00e1);_0x5bff8b(_0x1562c8[_0xcfa7('0x12')](0x1f4,_0x5a9c5a[_0xcfa7('0x13')]));});});};exports[_0xcfa7('0x2d')]=function(_0x1be019){var _0x2926f1=this;return new Promise(function(_0x5c04f3,_0x42a16a){return db['CmHopperHistory']['findAll']({'raw':_0x1be019[_0xcfa7('0x19')]?_0x1be019['options'][_0xcfa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x1be019[_0xcfa7('0x19')]?_0x1be019[_0xcfa7('0x19')]['where']||null:null,'attributes':[[_0xcfa7('0x2e'),_0xcfa7('0x2f')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x30')))),_0xcfa7('0x31')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x32')))),'outboundNoAnswerCallsDay'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db['sequelize']['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0xcfa7('0x33')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')](_0xcfa7('0x34')))),_0xcfa7('0x35')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x208,\x201,\x20null'))),_0xcfa7('0x36')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x37')))),'outboundDropCallsDayTimeout'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')](_0xcfa7('0x38')))),_0xcfa7('0x39')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db['sequelize'][_0xcfa7('0x26')](_0xcfa7('0x3a')))),_0xcfa7('0x3b')],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')](_0xcfa7('0x3c')))),'outboundBlacklistCallsDay'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')](_0xcfa7('0x3d')))),_0xcfa7('0x3e')],[db['sequelize']['fn']('COUNT',db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x3f')))),_0xcfa7('0x40')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x41')))),_0xcfa7('0x42')],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x2020,\x201,\x20null'))),_0xcfa7('0x40')],[db[_0xcfa7('0x1f')]['fn']('COUNT',db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')]['literal'](_0xcfa7('0x43')))),_0xcfa7('0x44')]],'group':[_0xcfa7('0x2e')]})['then'](function(_0x403f51){logger[_0xcfa7('0x14')](_0xcfa7('0x2d'),_0x1be019);logger[_0xcfa7('0x10')]('GetVoiceQueueHopperHistory',_0x1be019,JSON[_0xcfa7('0x2b')](_0x403f51));_0x5c04f3(_0x403f51);})['catch'](function(_0x360d4d){logger[_0xcfa7('0x12')](_0xcfa7('0x2d'),_0x360d4d[_0xcfa7('0x13')],_0x1be019);_0x42a16a(_0x2926f1[_0xcfa7('0x12')](0x1f4,_0x360d4d[_0xcfa7('0x13')]));});});};exports[_0xcfa7('0x45')]=function(_0x25fe73){var _0x2dd57d=this;return new Promise(function(_0x33b159,_0x4fdf09){return db['CmHopperHistory']['findAll']({'raw':_0x25fe73[_0xcfa7('0x19')]?_0x25fe73[_0xcfa7('0x19')][_0xcfa7('0x1a')]===undefined?!![]:![]:!![],'where':_0x25fe73[_0xcfa7('0x19')]?_0x25fe73[_0xcfa7('0x19')][_0xcfa7('0x1e')]||null:null,'attributes':[[_0xcfa7('0x2e'),'name'],[db[_0xcfa7('0x1f')]['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')][_0xcfa7('0x21')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0xcfa7('0x20'),db[_0xcfa7('0x1f')]['fn']('IF',db[_0xcfa7('0x1f')][_0xcfa7('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0xcfa7('0x46')]],'group':[_0xcfa7('0x2e')]})[_0xcfa7('0xd')](function(_0x40d232){logger[_0xcfa7('0x14')]('GetCampaignHopperHistory',_0x25fe73);logger[_0xcfa7('0x10')](_0xcfa7('0x45'),_0x25fe73,JSON['stringify'](_0x40d232));_0x33b159(_0x40d232);})[_0xcfa7('0x2c')](function(_0x25074d){logger[_0xcfa7('0x12')]('GetCampaignHopperHistory',_0x25074d[_0xcfa7('0x13')],_0x25fe73);_0x4fdf09(_0x2dd57d['error'](0x1f4,_0x25074d['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 5eb7f17..fc01698 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 _0xc45c=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','/:id','show','post','create','update','multer'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc45c,0x1c1));var _0xcc45=function(_0x26617a,_0x13cd8f){_0x26617a=_0x26617a-0x0;var _0x48b807=_0xc45c[_0x26617a];return _0x48b807;};'use strict';var multer=require(_0xcc45('0x0'));var util=require(_0xcc45('0x1'));var path=require(_0xcc45('0x2'));var timeout=require(_0xcc45('0x3'));var express=require(_0xcc45('0x4'));var router=express['Router']();var fs_extra=require(_0xcc45('0x5'));var auth=require(_0xcc45('0x6'));var interaction=require(_0xcc45('0x7'));var config=require(_0xcc45('0x8'));var controller=require(_0xcc45('0x9'));router[_0xcc45('0xa')]('/',auth[_0xcc45('0xb')](),controller[_0xcc45('0xc')]);router[_0xcc45('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xcc45('0xa')](_0xcc45('0xd'),auth[_0xcc45('0xb')](),controller[_0xcc45('0xe')]);router[_0xcc45('0xf')]('/',auth[_0xcc45('0xb')](),controller[_0xcc45('0x10')]);router['put'](_0xcc45('0xd'),auth[_0xcc45('0xb')](),controller[_0xcc45('0x11')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 7abddcb..3c301bd 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 _0x72b1=['sequelize','STRING','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72b1,0x16e));var _0x172b=function(_0x13d0c0,_0x2596e9){_0x13d0c0=_0x13d0c0-0x0;var _0x193132=_0x72b1[_0x13d0c0];return _0x193132;};'use strict';var Sequelize=require(_0x172b('0x0'));module['exports']={'name':{'type':Sequelize[_0x172b('0x1')],'unique':_0x172b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x172b('0x1')]},'dialPrefix':{'type':Sequelize[_0x172b('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index c2e1cd0..ac24249 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 _0xf567=['ids','tags','isArray','push','CmContact','omit','success','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','raw','getContactsCsv','concat','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','then','destroy','get','Lists','error','name','send','index','map','CmList','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','show','params','keys','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','body','describe','addDisposition','ListId','findOne','Disposition','findAll','rows','removeDispositions'];(function(_0x112ff4,_0x443568){var _0x273cd2=function(_0x4e2291){while(--_0x4e2291){_0x112ff4['push'](_0x112ff4['shift']());}};_0x273cd2(++_0x443568);}(_0xf567,0xbc));var _0x7f56=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xf567[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0x7f56('0x0'));var rimraf=require(_0x7f56('0x1'));var zipdir=require(_0x7f56('0x2'));var jsonpatch=require(_0x7f56('0x3'));var rp=require(_0x7f56('0x4'));var moment=require(_0x7f56('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7f56('0x6'));var util=require(_0x7f56('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7f56('0x8'));var squel=require(_0x7f56('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7f56('0xa'));var querystring=require(_0x7f56('0xb'));var Papa=require(_0x7f56('0xc'));var Redis=require(_0x7f56('0xd'));var authService=require(_0x7f56('0xe'));var qs=require(_0x7f56('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7f56('0x10'))('api');var utils=require(_0x7f56('0x11'));var config=require(_0x7f56('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f56('0x13'))['db'];config[_0x7f56('0x14')]=_[_0x7f56('0x15')](config['redis'],{'host':_0x7f56('0x16'),'port':0x18eb});var socket=require(_0x7f56('0x17'))(new Redis(config['redis']));require('./cmList.socket')[_0x7f56('0x18')](socket);function respondWithStatusCode(_0x3127ba,_0x367901){_0x367901=_0x367901||0xcc;return function(_0x58c584){if(_0x58c584){return _0x3127ba[_0x7f56('0x19')](_0x367901);}return _0x3127ba[_0x7f56('0x1a')](_0x367901)[_0x7f56('0x1b')]();};}function respondWithResult(_0x3ff444,_0x30d0eb){_0x30d0eb=_0x30d0eb||0xc8;return function(_0x2f6ddb){if(_0x2f6ddb){return _0x3ff444[_0x7f56('0x1a')](_0x30d0eb)[_0x7f56('0x1c')](_0x2f6ddb);}};}function respondWithFilteredResult(_0x44617e,_0x32bb6f){return function(_0x25986d){if(_0x25986d){var _0x25bbfc=typeof _0x32bb6f[_0x7f56('0x1d')]==='undefined'&&typeof _0x32bb6f[_0x7f56('0x1e')]===_0x7f56('0x1f');var _0x1551f5=_0x25986d[_0x7f56('0x20')];var _0x4ca37d=_0x25bbfc?0x0:_0x32bb6f[_0x7f56('0x1d')];var _0x555fc3=_0x25bbfc?_0x25986d[_0x7f56('0x20')]:_0x32bb6f[_0x7f56('0x1d')]+_0x32bb6f[_0x7f56('0x1e')];var _0x30f020;if(_0x555fc3>=_0x1551f5){_0x555fc3=_0x1551f5;_0x30f020=0xc8;}else{_0x30f020=0xce;}_0x44617e[_0x7f56('0x1a')](_0x30f020);return _0x44617e[_0x7f56('0x21')](_0x7f56('0x22'),_0x4ca37d+'-'+_0x555fc3+'/'+_0x1551f5)[_0x7f56('0x1c')](_0x25986d);}return null;};}function patchUpdates(_0x73f368){return function(_0x571cb4){try{jsonpatch['apply'](_0x571cb4,_0x73f368,!![]);}catch(_0x11cbe0){return BPromise[_0x7f56('0x23')](_0x11cbe0);}return _0x571cb4[_0x7f56('0x24')]();};}function saveUpdates(_0x58139a,_0x352c4a){return function(_0x6d442b){if(_0x6d442b){return _0x6d442b['update'](_0x58139a)[_0x7f56('0x25')](function(_0x842bc7){return _0x842bc7;});}return null;};}function removeEntity(_0x5d3b17,_0x227136){return function(_0xeda29d){if(_0xeda29d){return _0xeda29d[_0x7f56('0x26')]()[_0x7f56('0x25')](function(){var _0x136e08=_0xeda29d[_0x7f56('0x27')]({'plain':!![]});var _0x51a5c0=_0x7f56('0x28');return db['UserProfileResource'][_0x7f56('0x26')]({'where':{'type':_0x51a5c0,'resourceId':_0x136e08['id']}})[_0x7f56('0x25')](function(){return _0xeda29d;});})[_0x7f56('0x25')](function(){_0x5d3b17[_0x7f56('0x1a')](0xcc)[_0x7f56('0x1b')]();});}};}function handleEntityNotFound(_0x3c4ea9,_0x2fc8ff){return function(_0x3689f1){if(!_0x3689f1){_0x3c4ea9[_0x7f56('0x19')](0x194);}return _0x3689f1;};}function handleError(_0x2f14c7,_0x19d8b6){_0x19d8b6=_0x19d8b6||0x1f4;return function(_0x570a3b){logger[_0x7f56('0x29')](_0x570a3b['stack']);if(_0x570a3b[_0x7f56('0x2a')]){delete _0x570a3b[_0x7f56('0x2a')];}_0x2f14c7[_0x7f56('0x1a')](_0x19d8b6)[_0x7f56('0x2b')](_0x570a3b);};}exports[_0x7f56('0x2c')]=function(_0x15cdb5,_0x1e0c8e){var _0x1c1bec={},_0x18cf68={},_0x54ca3f={'count':0x0,'rows':[]};var _0xe8ca84=_[_0x7f56('0x2d')](db[_0x7f56('0x2e')][_0x7f56('0x2f')],function(_0x3e225b){return{'name':_0x3e225b[_0x7f56('0x30')],'type':_0x3e225b[_0x7f56('0x31')][_0x7f56('0x32')]};});_0x18cf68[_0x7f56('0x33')]=_[_0x7f56('0x2d')](_0xe8ca84,_0x7f56('0x2a'));_0x18cf68['query']=_['keys'](_0x15cdb5[_0x7f56('0x34')]);_0x18cf68[_0x7f56('0x35')]=_[_0x7f56('0x36')](_0x18cf68[_0x7f56('0x33')],_0x18cf68['query']);_0x1c1bec[_0x7f56('0x37')]=_[_0x7f56('0x36')](_0x18cf68[_0x7f56('0x33')],qs[_0x7f56('0x38')](_0x15cdb5[_0x7f56('0x34')][_0x7f56('0x38')]));_0x1c1bec[_0x7f56('0x37')]=_0x1c1bec[_0x7f56('0x37')]['length']?_0x1c1bec[_0x7f56('0x37')]:_0x18cf68[_0x7f56('0x33')];if(!_0x15cdb5[_0x7f56('0x34')][_0x7f56('0x39')](_0x7f56('0x3a'))){_0x1c1bec[_0x7f56('0x1e')]=qs[_0x7f56('0x1e')](_0x15cdb5[_0x7f56('0x34')]['limit']);_0x1c1bec[_0x7f56('0x1d')]=qs[_0x7f56('0x1d')](_0x15cdb5['query'][_0x7f56('0x1d')]);}_0x1c1bec[_0x7f56('0x3b')]=qs[_0x7f56('0x3c')](_0x15cdb5['query'][_0x7f56('0x3c')]);_0x1c1bec['where']=qs[_0x7f56('0x35')](_[_0x7f56('0x3d')](_0x15cdb5[_0x7f56('0x34')],_0x18cf68['filters']),_0xe8ca84);if(_0x15cdb5[_0x7f56('0x34')][_0x7f56('0x3e')]){_0x1c1bec[_0x7f56('0x3f')]=_[_0x7f56('0x40')](_0x1c1bec[_0x7f56('0x3f')],{'$or':_[_0x7f56('0x2d')](_0xe8ca84,function(_0x1272c2){if(_0x1272c2[_0x7f56('0x31')]!==_0x7f56('0x41')){var _0x5826df={};_0x5826df[_0x1272c2[_0x7f56('0x2a')]]={'$like':'%'+_0x15cdb5[_0x7f56('0x34')]['filter']+'%'};return _0x5826df;}})});}_0x1c1bec=_[_0x7f56('0x40')]({},_0x1c1bec,_0x15cdb5[_0x7f56('0x42')]);var _0x52ef04={'where':_0x1c1bec[_0x7f56('0x3f')]};return db[_0x7f56('0x2e')]['count'](_0x52ef04)['then'](function(_0x4aa245){_0x54ca3f['count']=_0x4aa245;if(_0x15cdb5['query'][_0x7f56('0x43')]){_0x1c1bec[_0x7f56('0x44')]=[{'all':!![]}];}return db[_0x7f56('0x2e')]['findAll'](_0x1c1bec);})['then'](function(_0x258cde){_0x54ca3f['rows']=_0x258cde;return _0x54ca3f;})[_0x7f56('0x25')](respondWithFilteredResult(_0x1e0c8e,_0x1c1bec))['catch'](handleError(_0x1e0c8e,null));};exports[_0x7f56('0x45')]=function(_0x1f4baf,_0x2ac58a){var _0x4064e5={'raw':![],'where':{'id':_0x1f4baf[_0x7f56('0x46')]['id']}},_0x42618b={};_0x42618b[_0x7f56('0x33')]=_[_0x7f56('0x47')](db[_0x7f56('0x2e')]['rawAttributes']);_0x42618b[_0x7f56('0x34')]=_[_0x7f56('0x47')](_0x1f4baf[_0x7f56('0x34')]);_0x42618b['filters']=_['intersection'](_0x42618b['model'],_0x42618b[_0x7f56('0x34')]);_0x4064e5[_0x7f56('0x37')]=_[_0x7f56('0x36')](_0x42618b[_0x7f56('0x33')],qs[_0x7f56('0x38')](_0x1f4baf[_0x7f56('0x34')][_0x7f56('0x38')]));_0x4064e5[_0x7f56('0x37')]=_0x4064e5[_0x7f56('0x37')][_0x7f56('0x48')]?_0x4064e5[_0x7f56('0x37')]:_0x42618b[_0x7f56('0x33')];if(_0x1f4baf['query']['includeAll']){_0x4064e5[_0x7f56('0x44')]=[{'all':!![]}];}_0x4064e5=_[_0x7f56('0x40')]({},_0x4064e5,_0x1f4baf[_0x7f56('0x42')]);return db['CmList'][_0x7f56('0x49')](_0x4064e5)[_0x7f56('0x25')](handleEntityNotFound(_0x2ac58a,null))[_0x7f56('0x25')](respondWithResult(_0x2ac58a,null))[_0x7f56('0x4a')](handleError(_0x2ac58a,null));};exports[_0x7f56('0x4b')]=function(_0x2f47cf,_0xbbf7f9){return db[_0x7f56('0x2e')]['create'](_0x2f47cf['body'],{})[_0x7f56('0x25')](function(_0x4d59a1){var _0x124101=_0x2f47cf[_0x7f56('0x4c')][_0x7f56('0x27')]({'plain':!![]});if(!_0x124101)throw new Error(_0x7f56('0x4d'));if(_0x124101[_0x7f56('0x4e')]===_0x7f56('0x4c')){var _0x296475=_0x4d59a1[_0x7f56('0x27')]({'plain':!![]});var _0x5e8757=_0x7f56('0x28');return db['UserProfileSection'][_0x7f56('0x49')]({'where':{'name':_0x5e8757,'userProfileId':_0x124101['userProfileId']},'raw':!![]})['then'](function(_0x2b5dee){if(_0x2b5dee&&_0x2b5dee[_0x7f56('0x4f')]===0x0){return db[_0x7f56('0x50')][_0x7f56('0x4b')]({'name':_0x296475[_0x7f56('0x2a')],'resourceId':_0x296475['id'],'type':_0x2b5dee[_0x7f56('0x2a')],'sectionId':_0x2b5dee['id']},{})[_0x7f56('0x25')](function(){return _0x4d59a1;});}else{return _0x4d59a1;}})[_0x7f56('0x4a')](function(_0x11ede4){logger[_0x7f56('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11ede4);throw _0x11ede4;});}return _0x4d59a1;})[_0x7f56('0x25')](respondWithResult(_0xbbf7f9,0xc9))[_0x7f56('0x4a')](handleError(_0xbbf7f9,null));};exports['update']=function(_0x55f275,_0xb1be4f){if(_0x55f275[_0x7f56('0x51')]['id']){delete _0x55f275[_0x7f56('0x51')]['id'];}return db[_0x7f56('0x2e')][_0x7f56('0x49')]({'where':{'id':_0x55f275['params']['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0xb1be4f,null))[_0x7f56('0x25')](saveUpdates(_0x55f275['body'],null))[_0x7f56('0x25')](respondWithResult(_0xb1be4f,null))[_0x7f56('0x4a')](handleError(_0xb1be4f,null));};exports[_0x7f56('0x26')]=function(_0x550b89,_0x3622d0){return db[_0x7f56('0x2e')]['find']({'where':{'id':_0x550b89[_0x7f56('0x46')]['id']}})['then'](handleEntityNotFound(_0x3622d0,null))[_0x7f56('0x25')](removeEntity(_0x3622d0,null))[_0x7f56('0x4a')](handleError(_0x3622d0,null));};exports[_0x7f56('0x52')]=function(_0x58342b,_0x56df6a){return db[_0x7f56('0x2e')][_0x7f56('0x52')]()[_0x7f56('0x25')](respondWithResult(_0x56df6a,null))['catch'](handleError(_0x56df6a,null));};exports[_0x7f56('0x53')]=function(_0x2c4e7a,_0x4f9498,_0x4c0f50){if(_0x2c4e7a[_0x7f56('0x51')]['id']){delete _0x2c4e7a[_0x7f56('0x51')]['id'];}return db[_0x7f56('0x2e')]['find']({'where':{'id':_0x2c4e7a[_0x7f56('0x46')]['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0x4f9498,null))[_0x7f56('0x25')](function(_0x2ff61e){if(_0x2ff61e){_0x2c4e7a[_0x7f56('0x51')][_0x7f56('0x54')]=_0x2ff61e['id'];return db['Disposition'][_0x7f56('0x4b')](_0x2c4e7a[_0x7f56('0x51')]);}})['then'](respondWithResult(_0x4f9498,null))['catch'](handleError(_0x4f9498,null));};exports['getDispositions']=function(_0xa3df95,_0x3b2ba7,_0x1cd416){var _0x57a8c4={'raw':![],'where':{}};var _0x5f4760={};var _0x3bcc9f={'count':0x0,'rows':[]};return db[_0x7f56('0x2e')][_0x7f56('0x55')]({'where':{'id':_0xa3df95[_0x7f56('0x46')]['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0x3b2ba7,null))[_0x7f56('0x25')](function(_0x116b94){if(_0x116b94){_0x5f4760[_0x7f56('0x33')]=_[_0x7f56('0x47')](db[_0x7f56('0x56')][_0x7f56('0x2f')]);_0x5f4760[_0x7f56('0x34')]=_['keys'](_0xa3df95['query']);_0x5f4760[_0x7f56('0x35')]=_[_0x7f56('0x36')](_0x5f4760[_0x7f56('0x33')],_0x5f4760[_0x7f56('0x34')]);_0x57a8c4[_0x7f56('0x37')]=_['intersection'](_0x5f4760[_0x7f56('0x33')],qs['fields'](_0xa3df95[_0x7f56('0x34')][_0x7f56('0x38')]));_0x57a8c4[_0x7f56('0x37')]=_0x57a8c4[_0x7f56('0x37')][_0x7f56('0x48')]?_0x57a8c4[_0x7f56('0x37')]:_0x5f4760[_0x7f56('0x33')];if(!_0xa3df95[_0x7f56('0x34')][_0x7f56('0x39')](_0x7f56('0x3a'))){_0x57a8c4['limit']=qs[_0x7f56('0x1e')](_0xa3df95[_0x7f56('0x34')][_0x7f56('0x1e')]);_0x57a8c4[_0x7f56('0x1d')]=qs[_0x7f56('0x1d')](_0xa3df95[_0x7f56('0x34')][_0x7f56('0x1d')]);}_0x57a8c4[_0x7f56('0x3b')]=qs[_0x7f56('0x3c')](_0xa3df95[_0x7f56('0x34')][_0x7f56('0x3c')]);_0x57a8c4[_0x7f56('0x3f')]=qs[_0x7f56('0x35')](_[_0x7f56('0x3d')](_0xa3df95[_0x7f56('0x34')],_0x5f4760[_0x7f56('0x35')]));_0x57a8c4[_0x7f56('0x3f')]['ListId']=_0x116b94['id'];if(_0xa3df95['query'][_0x7f56('0x3e')]){_0x57a8c4[_0x7f56('0x3f')]=_['merge'](_0x57a8c4[_0x7f56('0x3f')],{'$or':_[_0x7f56('0x2d')](_0x57a8c4[_0x7f56('0x37')],function(_0xca9ed7){var _0x50886a={};_0x50886a[_0xca9ed7]={'$like':'%'+_0xa3df95[_0x7f56('0x34')]['filter']+'%'};return _0x50886a;})});}_0x57a8c4=_[_0x7f56('0x40')]({},_0x57a8c4,_0xa3df95['options']);return db['Disposition'][_0x7f56('0x20')]({'where':_0x57a8c4[_0x7f56('0x3f')]})[_0x7f56('0x25')](function(_0x544b94){_0x3bcc9f[_0x7f56('0x20')]=_0x544b94;if(_0xa3df95[_0x7f56('0x34')][_0x7f56('0x43')]){_0x57a8c4[_0x7f56('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x7f56('0x57')](_0x57a8c4);})[_0x7f56('0x25')](function(_0x2d3ffd){_0x3bcc9f[_0x7f56('0x58')]=_0x2d3ffd;return _0x3bcc9f;});}})[_0x7f56('0x25')](respondWithFilteredResult(_0x3b2ba7,_0x57a8c4))[_0x7f56('0x4a')](handleError(_0x3b2ba7,null));};exports[_0x7f56('0x59')]=function(_0xe09339,_0xcb24bf,_0x531d5f){return db[_0x7f56('0x2e')][_0x7f56('0x49')]({'where':{'id':_0xe09339[_0x7f56('0x46')]['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0xcb24bf,null))[_0x7f56('0x25')](function(_0x347c84){if(_0x347c84){return _0x347c84[_0x7f56('0x59')](_0xe09339[_0x7f56('0x34')][_0x7f56('0x5a')]);}})[_0x7f56('0x25')](respondWithStatusCode(_0xcb24bf,null))[_0x7f56('0x4a')](handleError(_0xcb24bf,null));};exports['addContacts']=function(_0x58f71b,_0x4abd6c,_0x1d38f7){return db[_0x7f56('0x2e')][_0x7f56('0x49')]({'where':{'id':_0x58f71b[_0x7f56('0x46')]['id']}})['then'](handleEntityNotFound(_0x4abd6c,null))[_0x7f56('0x25')](function(_0x3773be){if(_0x3773be){var _0x3134f8=[];var _0x11f5c4={'success':[],'errors':[]};return db['CmContact'][_0x7f56('0x52')]()[_0x7f56('0x25')](function(_0x18d4bc){if(_0x58f71b[_0x7f56('0x51')][_0x7f56('0x5b')]&&_[_0x7f56('0x5c')](_0x58f71b[_0x7f56('0x51')][_0x7f56('0x5b')])){if(_0x58f71b[_0x7f56('0x51')]['tags'][_0x7f56('0x48')]){_0x58f71b[_0x7f56('0x51')][_0x7f56('0x5b')]=_0x58f71b[_0x7f56('0x51')][_0x7f56('0x5b')]['join'](';')+';';}else{_0x58f71b['body'][_0x7f56('0x5b')]=null;}}else{_0x58f71b[_0x7f56('0x51')][_0x7f56('0x5b')]=null;}if(_0x58f71b[_0x7f56('0x51')]&&_[_0x7f56('0x5c')](_0x58f71b[_0x7f56('0x51')])){for(var _0x32defc=0x0;_0x32defc<_0x58f71b[_0x7f56('0x51')][_0x7f56('0x48')];_0x32defc+=0x1){_0x58f71b[_0x7f56('0x51')][_0x32defc][_0x7f56('0x54')]=_0x58f71b[_0x7f56('0x46')]['id'];_0x3134f8[_0x7f56('0x5d')](_0x58f71b[_0x7f56('0x51')][_0x32defc]);}return BPromise['each'](_0x3134f8,function(_0x5994b8){return db[_0x7f56('0x5e')][_0x7f56('0x4b')](_[_0x7f56('0x5f')](_0x5994b8,[_0x7f56('0x5a'),'id'])||{},{'fields':_[_0x7f56('0x47')](_0x18d4bc),'raw':!![]})[_0x7f56('0x25')](function(_0x16fbd9){_0x11f5c4[_0x7f56('0x60')][_0x7f56('0x5d')](_0x16fbd9['dataValues']);})[_0x7f56('0x4a')](function(_0x176131){_0x11f5c4[_0x7f56('0x61')][_0x7f56('0x5d')]({'data':_0x5994b8,'error':_0x176131[_0x7f56('0x62')]});});})[_0x7f56('0x25')](function(_0x28d9fd){return _0x11f5c4;})[_0x7f56('0x4a')](function(_0x4fb642){return _0x4fb642;});}else{_0x4abd6c[_0x7f56('0x1a')](0x190)[_0x7f56('0x1c')]({'message':_0x7f56('0x63')});}});}})[_0x7f56('0x25')](respondWithResult(_0x4abd6c,null))[_0x7f56('0x4a')](handleError(_0x4abd6c,null));};exports[_0x7f56('0x64')]=function(_0x99ef36,_0x44eb39,_0x2091c6){var _0xc72cec;return db['CmList'][_0x7f56('0x49')]({'where':{'id':_0x99ef36['params']['id']},'include':[{'model':db[_0x7f56('0x65')],'as':_0x7f56('0x66')}]})['then'](handleEntityNotFound(_0x44eb39,null))[_0x7f56('0x25')](function(_0x3c9a25){if(_0x3c9a25){_0xc72cec=_0x3c9a25;return db[_0x7f56('0x5e')][_0x7f56('0x2f')];}})[_0x7f56('0x25')](function(_0x55f52e){if(_0x55f52e){var _0x114a3b={};var _0x238f08={};_0x238f08[_0x7f56('0x33')]=_['concat'](_[_0x7f56('0x47')](_0x55f52e),_[_0x7f56('0x2d')](_0xc72cec['CustomFields'],function(_0x49de8c){return util[_0x7f56('0x67')]('cf_%d',_0x49de8c['id']);}));_0x238f08[_0x7f56('0x34')]=_['keys'](_0x99ef36[_0x7f56('0x34')]);_0x238f08[_0x7f56('0x35')]=_[_0x7f56('0x36')](_0x238f08[_0x7f56('0x33')],_0x238f08['query']);_0x114a3b['attributes']=_['intersection'](_0x238f08[_0x7f56('0x33')],qs[_0x7f56('0x38')](_0x99ef36[_0x7f56('0x34')]['fields']));_0x114a3b[_0x7f56('0x37')]=_0x114a3b['attributes'][_0x7f56('0x48')]?_0x114a3b[_0x7f56('0x37')]:_0x238f08[_0x7f56('0x33')];if(!_0x99ef36[_0x7f56('0x34')][_0x7f56('0x39')]('nolimit')){_0x114a3b[_0x7f56('0x1e')]=qs['limit'](_0x99ef36['query'][_0x7f56('0x1e')]);_0x114a3b[_0x7f56('0x1d')]=qs[_0x7f56('0x1d')](_0x99ef36[_0x7f56('0x34')][_0x7f56('0x1d')]);}_0x114a3b[_0x7f56('0x3b')]=qs['sort'](_0x99ef36[_0x7f56('0x34')][_0x7f56('0x3c')]);_0x114a3b[_0x7f56('0x3f')]=qs[_0x7f56('0x35')](_[_0x7f56('0x3d')](_0x99ef36[_0x7f56('0x34')],_0x238f08['filters']));_0x114a3b[_0x7f56('0x68')]=!![];if(_0x99ef36[_0x7f56('0x34')][_0x7f56('0x3e')]){_0x114a3b[_0x7f56('0x3f')]=_[_0x7f56('0x40')](_0x114a3b[_0x7f56('0x3f')],{'$or':_[_0x7f56('0x2d')](_0x114a3b[_0x7f56('0x37')],function(_0x47e002){var _0x5796fe={};_0x5796fe[_0x47e002]={'$like':'%'+_0x99ef36[_0x7f56('0x34')][_0x7f56('0x3e')]+'%'};return _0x5796fe;})});}_0x114a3b=_[_0x7f56('0x40')]({},_0x114a3b,_0x99ef36[_0x7f56('0x42')]);return _0xc72cec[_0x7f56('0x64')](_0x114a3b);}})['then'](respondWithResult(_0x44eb39,null))['catch'](handleError(_0x44eb39,null));};exports[_0x7f56('0x69')]=function(_0x14338e,_0x1352b8,_0x452b1d){var _0x4f2d93;return db[_0x7f56('0x2e')]['find']({'where':{'id':_0x14338e[_0x7f56('0x46')]['id']},'include':[{'model':db[_0x7f56('0x65')],'as':_0x7f56('0x66')}]})['then'](handleEntityNotFound(_0x1352b8,null))[_0x7f56('0x25')](function(_0x5d842b){if(_0x5d842b){_0x4f2d93=_0x5d842b;return db[_0x7f56('0x5e')][_0x7f56('0x2f')];}})[_0x7f56('0x25')](function(_0x212c50){if(_0x212c50){var _0x392974={};var _0x4bd05a={};_0x4bd05a[_0x7f56('0x33')]=_[_0x7f56('0x6a')](_[_0x7f56('0x47')](_0x212c50),_[_0x7f56('0x2d')](_0x4f2d93['CustomFields'],function(_0x44002a){return util[_0x7f56('0x67')]('cf_%d',_0x44002a['id']);}));_0x4bd05a[_0x7f56('0x34')]=_[_0x7f56('0x47')](_0x14338e[_0x7f56('0x34')]);_0x4bd05a['filters']=_['intersection'](_0x4bd05a[_0x7f56('0x33')],_0x4bd05a['query']);_0x392974[_0x7f56('0x37')]=_[_0x7f56('0x36')](_0x4bd05a[_0x7f56('0x33')],qs[_0x7f56('0x38')](_0x14338e[_0x7f56('0x34')][_0x7f56('0x38')]));_0x392974['attributes']=_0x392974[_0x7f56('0x37')]['length']?_0x392974['attributes']:_0x4bd05a[_0x7f56('0x33')];if(!_0x14338e[_0x7f56('0x34')][_0x7f56('0x39')](_0x7f56('0x3a'))){_0x392974['limit']=qs['limit'](_0x14338e[_0x7f56('0x34')][_0x7f56('0x1e')]);_0x392974[_0x7f56('0x1d')]=qs[_0x7f56('0x1d')](_0x14338e[_0x7f56('0x34')]['offset']);}_0x392974['order']=qs[_0x7f56('0x3c')](_0x14338e[_0x7f56('0x34')][_0x7f56('0x3c')]);_0x392974[_0x7f56('0x3f')]=qs[_0x7f56('0x35')](_['pick'](_0x14338e['query'],_0x4bd05a[_0x7f56('0x35')]));_0x392974[_0x7f56('0x68')]=!![];if(_0x14338e[_0x7f56('0x34')][_0x7f56('0x3e')]){_0x392974['where']=_[_0x7f56('0x40')](_0x392974[_0x7f56('0x3f')],{'$or':_[_0x7f56('0x2d')](_0x392974[_0x7f56('0x37')],function(_0x4fdf2c){var _0x387cc={};_0x387cc[_0x4fdf2c]={'$like':'%'+_0x14338e['query'][_0x7f56('0x3e')]+'%'};return _0x387cc;})});}_0x392974=_[_0x7f56('0x40')]({},_0x392974,_0x14338e['options']);return _0x4f2d93[_0x7f56('0x64')](_0x392974);}})[_0x7f56('0x25')](function(_0x38e390){if(!_[_0x7f56('0x6b')](_0x38e390)){var _0x28e37c=toCsv(_0x38e390);var _0x7b49b7=Date['now']();fs[_0x7f56('0x6c')](util[_0x7f56('0x67')](_0x7f56('0x6d'),_0x4f2d93['id'],_0x7b49b7),_0x28e37c);_0x1352b8[_0x7f56('0x6e')](_0x7f56('0x6f'),_0x7f56('0x70')+util[_0x7f56('0x67')](_0x7f56('0x71'),_0x4f2d93['id'],_0x7b49b7));_0x1352b8[_0x7f56('0x6e')](_0x7f56('0x72'),_0x7f56('0x73'));return _0x1352b8[_0x7f56('0x74')](util[_0x7f56('0x67')]('/tmp/list_%d_%s.csv',_0x4f2d93['id'],_0x7b49b7));}else{return _0x1352b8[_0x7f56('0x19')](0xcc);}})['catch'](handleError(_0x1352b8,null));};exports[_0x7f56('0x75')]=function(_0x1124f0,_0x10fc67,_0x1de7f5){var _0x5e9474;delete _0x1124f0[_0x7f56('0x51')]['id'];return db[_0x7f56('0x2e')][_0x7f56('0x55')]({'where':{'id':_0x1124f0[_0x7f56('0x46')]['id']}})['then'](handleEntityNotFound(_0x10fc67,null))[_0x7f56('0x25')](function(_0x66c321){if(_0x66c321){return db[_0x7f56('0x76')][_0x7f56('0x77')](function(_0x4308a0){return db['CmCustomField']['create'](_0x1124f0[_0x7f56('0x51')],{'transaction':_0x4308a0})[_0x7f56('0x25')](function(_0x49983b){_0x5e9474=_0x49983b;return _0x66c321[_0x7f56('0x78')](_0x49983b,{'transaction':_0x4308a0});})[_0x7f56('0x25')](function(){var _0x574df6={'type':db[_0x7f56('0x79')][_0x7f56('0x7a')],'transaction':_0x4308a0};switch(_0x1124f0['body']['type']){case'text':_0x574df6[_0x7f56('0x31')]=db['Sequelize'][_0x7f56('0x7a')];break;case'number':_0x574df6[_0x7f56('0x31')]=db[_0x7f56('0x79')][_0x7f56('0x7b')];break;case _0x7f56('0x7c'):_0x574df6['type']=db[_0x7f56('0x79')][_0x7f56('0x7d')];_0x574df6[_0x7f56('0x7e')]=![];break;default:}return db[_0x7f56('0x76')][_0x7f56('0x7f')]['addColumn']('cm_contacts',util['format'](_0x7f56('0x80'),_0x5e9474['id']),_0x574df6);})[_0x7f56('0x25')](function(){return _0x5e9474;});});}})[_0x7f56('0x25')](respondWithResult(_0x10fc67,null))[_0x7f56('0x4a')](handleError(_0x10fc67,null));};exports[_0x7f56('0x81')]=function(_0x58bbec,_0x353498,_0x20fd6b){var _0x53f38b={};var _0x42970c={};var _0x260b87;var _0x58cba7;return db[_0x7f56('0x2e')][_0x7f56('0x55')]({'where':{'id':_0x58bbec[_0x7f56('0x46')]['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0x353498,null))[_0x7f56('0x25')](function(_0x1a6f31){if(_0x1a6f31){_0x260b87=_0x1a6f31;_0x42970c[_0x7f56('0x33')]=_['keys'](db['CmCustomField'][_0x7f56('0x2f')]);_0x42970c[_0x7f56('0x34')]=_[_0x7f56('0x47')](_0x58bbec['query']);_0x42970c['filters']=_[_0x7f56('0x36')](_0x42970c['model'],_0x42970c[_0x7f56('0x34')]);_0x53f38b['attributes']=_[_0x7f56('0x36')](_0x42970c[_0x7f56('0x33')],qs[_0x7f56('0x38')](_0x58bbec['query'][_0x7f56('0x38')]));_0x53f38b[_0x7f56('0x37')]=_0x53f38b[_0x7f56('0x37')][_0x7f56('0x48')]?_0x53f38b[_0x7f56('0x37')]:_0x42970c['model'];_0x53f38b['order']=qs['sort'](_0x58bbec[_0x7f56('0x34')]['sort']);_0x53f38b[_0x7f56('0x3f')]=qs[_0x7f56('0x35')](_[_0x7f56('0x3d')](_0x58bbec[_0x7f56('0x34')],_0x42970c[_0x7f56('0x35')]));_0x53f38b[_0x7f56('0x3f')]=_[_0x7f56('0x40')](_0x53f38b['where'],{'$or':[{'ListId':_0x1a6f31['id']},{'ListId':null}]});if(_0x58bbec[_0x7f56('0x34')]['filter']){_0x53f38b['where']=_['merge'](_0x53f38b[_0x7f56('0x3f')],{'$or':_[_0x7f56('0x2d')](_0x53f38b['attributes'],function(_0x4414b1){var _0x26ebf9={};_0x26ebf9[_0x4414b1]={'$like':'%'+_0x58bbec[_0x7f56('0x34')]['filter']+'%'};return _0x26ebf9;})});}_0x53f38b=_[_0x7f56('0x40')]({},_0x53f38b,_0x58bbec['options']);return db['CmCustomField'][_0x7f56('0x82')](_0x53f38b);}})[_0x7f56('0x25')](respondWithResult(_0x353498,null))[_0x7f56('0x4a')](handleError(_0x353498,null));};exports[_0x7f56('0x83')]=function(_0x2d2f12,_0x3fa817,_0x16403f){return db['CmList']['find']({'where':{'id':_0x2d2f12[_0x7f56('0x46')]['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0x3fa817,null))[_0x7f56('0x25')](function(_0x204a7d){if(_0x204a7d){return _0x204a7d['addAgents'](_0x2d2f12['body'][_0x7f56('0x5a')],_[_0x7f56('0x5f')](_0x2d2f12['body'],[_0x7f56('0x5a'),'id'])||{})[_0x7f56('0x84')](function(_0x52c837){for(var _0x8a14bc=0x0;_0x8a14bc<_0x2d2f12['body'][_0x7f56('0x5a')][_0x7f56('0x48')];_0x8a14bc+=0x1){socket[_0x7f56('0x85')](_0x7f56('0x86'),{'UserId':Number(_0x2d2f12['body']['ids'][_0x8a14bc]),'CmListId':Number(_0x2d2f12[_0x7f56('0x46')]['id'])});}return _0x52c837;});}})[_0x7f56('0x25')](respondWithResult(_0x3fa817,null))[_0x7f56('0x4a')](handleError(_0x3fa817,null));};exports[_0x7f56('0x87')]=function(_0x167c30,_0x183866,_0x2cc68b){return db['CmList'][_0x7f56('0x49')]({'where':{'id':_0x167c30[_0x7f56('0x46')]['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0x183866,null))['then'](function(_0x1ad6e0){if(_0x1ad6e0){return _0x1ad6e0[_0x7f56('0x87')](_0x167c30['query'][_0x7f56('0x5a')])['then'](function(){if(_[_0x7f56('0x5c')](_0x167c30[_0x7f56('0x34')]['ids'])){for(var _0x593a0a=0x0;_0x593a0a<_0x167c30[_0x7f56('0x34')][_0x7f56('0x5a')][_0x7f56('0x48')];_0x593a0a+=0x1){socket[_0x7f56('0x85')](_0x7f56('0x88'),{'UserId':Number(_0x167c30[_0x7f56('0x34')][_0x7f56('0x5a')][_0x593a0a]),'CmListId':Number(_0x167c30[_0x7f56('0x46')]['id'])});}}else{socket[_0x7f56('0x85')]('userCmList:remove',{'UserId':Number(_0x167c30[_0x7f56('0x34')][_0x7f56('0x5a')]),'CmListId':Number(_0x167c30[_0x7f56('0x46')]['id'])});}});}})[_0x7f56('0x25')](respondWithStatusCode(_0x183866,null))[_0x7f56('0x4a')](handleError(_0x183866,null));};exports[_0x7f56('0x89')]=function(_0x20fad7,_0x48ccb4,_0x1d11d1){var _0x364b87={};var _0x1bc4df={};var _0x1cbdc8;var _0x103a8e;return db[_0x7f56('0x2e')]['findOne']({'where':{'id':_0x20fad7['params']['id']}})[_0x7f56('0x25')](handleEntityNotFound(_0x48ccb4,null))['then'](function(_0x15880b){if(_0x15880b){_0x1cbdc8=_0x15880b;_0x1bc4df['model']=_[_0x7f56('0x47')](db[_0x7f56('0x8a')][_0x7f56('0x2f')]);_0x1bc4df[_0x7f56('0x34')]=_[_0x7f56('0x47')](_0x20fad7[_0x7f56('0x34')]);_0x1bc4df[_0x7f56('0x35')]=_[_0x7f56('0x36')](_0x1bc4df['model'],_0x1bc4df['query']);_0x364b87[_0x7f56('0x37')]=_[_0x7f56('0x36')](_0x1bc4df[_0x7f56('0x33')],qs[_0x7f56('0x38')](_0x20fad7['query'][_0x7f56('0x38')]));_0x364b87[_0x7f56('0x37')]=_0x364b87[_0x7f56('0x37')][_0x7f56('0x48')]?_0x364b87[_0x7f56('0x37')]:_0x1bc4df[_0x7f56('0x33')];_0x364b87[_0x7f56('0x3b')]=qs[_0x7f56('0x3c')](_0x20fad7[_0x7f56('0x34')][_0x7f56('0x3c')]);_0x364b87[_0x7f56('0x3f')]=qs[_0x7f56('0x35')](_[_0x7f56('0x3d')](_0x20fad7[_0x7f56('0x34')],_0x1bc4df[_0x7f56('0x35')]));if(_0x20fad7['query'][_0x7f56('0x3e')]){_0x364b87[_0x7f56('0x3f')]=_['merge'](_0x364b87[_0x7f56('0x3f')],{'$or':_['map'](_0x364b87['attributes'],function(_0xe296fe){var _0xfc6cac={};_0xfc6cac[_0xe296fe]={'$like':'%'+_0x20fad7[_0x7f56('0x34')][_0x7f56('0x3e')]+'%'};return _0xfc6cac;})});}_0x364b87=_[_0x7f56('0x40')]({},_0x364b87,_0x20fad7[_0x7f56('0x42')]);return _0x1cbdc8[_0x7f56('0x89')](_0x364b87);}})[_0x7f56('0x25')](function(_0x2ccf22){if(_0x2ccf22){_0x103a8e=_0x2ccf22[_0x7f56('0x48')];if(!_0x20fad7[_0x7f56('0x34')][_0x7f56('0x39')](_0x7f56('0x3a'))){_0x364b87[_0x7f56('0x1e')]=qs[_0x7f56('0x1e')](_0x20fad7[_0x7f56('0x34')][_0x7f56('0x1e')]);_0x364b87[_0x7f56('0x1d')]=qs[_0x7f56('0x1d')](_0x20fad7[_0x7f56('0x34')][_0x7f56('0x1d')]);}return _0x1cbdc8[_0x7f56('0x89')](_0x364b87);}})[_0x7f56('0x25')](function(_0x17fd07){if(_0x17fd07){return _0x17fd07?{'count':_0x103a8e,'rows':_0x17fd07}:null;}})[_0x7f56('0x25')](respondWithResult(_0x48ccb4,null))['catch'](handleError(_0x48ccb4,null));}; \ No newline at end of file +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 diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 3bacf38..05751aa 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x33f5c8,_0x5202bb){var _0x4ea43f=function(_0x16be2b){while(--_0x16be2b){_0x33f5c8['push'](_0x33f5c8['shift']());}};_0x4ea43f(++_0x5202bb);}(_0x814b,0x1a2));var _0xb814=function(_0x32e758,_0x13c271){_0x32e758=_0x32e758-0x0;var _0x349316=_0x814b[_0x32e758];return _0x349316;};'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 +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 diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 5ace570..8f9b618 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 _0xe5b5=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','lodash'];(function(_0x274f14,_0x27dd7f){var _0x13b97e=function(_0x7d9432){while(--_0x7d9432){_0x274f14['push'](_0x274f14['shift']());}};_0x13b97e(++_0x27dd7f);}(_0xe5b5,0x12b));var _0x5e5b=function(_0xea343d,_0x311197){_0xea343d=_0xea343d-0x0;var _0x2c6e9c=_0xe5b5[_0xea343d];return _0x2c6e9c;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var logger=require(_0x5e5b('0x2'))(_0x5e5b('0x3'));var moment=require(_0x5e5b('0x4'));var BPromise=require(_0x5e5b('0x5'));var rp=require(_0x5e5b('0x6'));var fs=require('fs');var path=require(_0x5e5b('0x7'));var rimraf=require(_0x5e5b('0x8'));var config=require(_0x5e5b('0x9'));var attributes=require(_0x5e5b('0xa'));module[_0x5e5b('0xb')]=function(_0xf1fbe2,_0x11e0e0){return _0xf1fbe2[_0x5e5b('0xc')](_0x5e5b('0xd'),attributes,{'tableName':_0x5e5b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 77c4696..4b774a5 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 _0x9fad=['request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s'];(function(_0x58c20f,_0x4cdb1b){var _0x3b0318=function(_0x36fa84){while(--_0x36fa84){_0x58c20f['push'](_0x58c20f['shift']());}};_0x3b0318(++_0x4cdb1b);}(_0x9fad,0xc2));var _0xd9fa=function(_0x284b9a,_0x34e045){_0x284b9a=_0x284b9a-0x0;var _0x240bac=_0x9fad[_0x284b9a];return _0x240bac;};'use strict';var _=require(_0xd9fa('0x0'));var util=require(_0xd9fa('0x1'));var moment=require(_0xd9fa('0x2'));var BPromise=require(_0xd9fa('0x3'));var rs=require(_0xd9fa('0x4'));var fs=require('fs');var Redis=require(_0xd9fa('0x5'));var db=require(_0xd9fa('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9fa('0x7'))('rpc');var config=require(_0xd9fa('0x8'));var jayson=require(_0xd9fa('0x9'));var client=jayson[_0xd9fa('0xa')][_0xd9fa('0xb')]({'port':0x232a});config[_0xd9fa('0xc')]=_[_0xd9fa('0xd')](config[_0xd9fa('0xc')],{'host':_0xd9fa('0xe'),'port':0x18eb});var socket=require(_0xd9fa('0xf'))(new Redis(config[_0xd9fa('0xc')]));require(_0xd9fa('0x10'))[_0xd9fa('0x11')](socket);function respondWithRpcPromise(_0x33d1ab,_0x48790c,_0x3d7156){return new BPromise(function(_0x247db3,_0x3b1a99){return client[_0xd9fa('0x12')](_0x33d1ab,_0x3d7156)['then'](function(_0x2c233f){logger[_0xd9fa('0x13')](_0xd9fa('0x14'),_0x48790c,'request\x20sent');logger['debug'](_0xd9fa('0x15'),_0x48790c,_0xd9fa('0x16'),JSON[_0xd9fa('0x17')](_0x2c233f));if(_0x2c233f[_0xd9fa('0x18')]){if(_0x2c233f[_0xd9fa('0x18')][_0xd9fa('0x19')]===0x1f4){logger[_0xd9fa('0x18')](_0xd9fa('0x14'),_0x48790c,_0x2c233f['error'][_0xd9fa('0x1a')]);return _0x3b1a99(_0x2c233f['error'][_0xd9fa('0x1a')]);}logger[_0xd9fa('0x18')]('CmList,\x20%s,\x20%s',_0x48790c,_0x2c233f[_0xd9fa('0x18')]['message']);return _0x247db3(_0x2c233f['error']['message']);}else{logger[_0xd9fa('0x13')](_0xd9fa('0x14'),_0x48790c,_0xd9fa('0x16'));_0x247db3(_0x2c233f['result'][_0xd9fa('0x1a')]);}})['catch'](function(_0x1619d1){logger['error']('CmList,\x20%s,\x20%s',_0x48790c,_0x1619d1);_0x3b1a99(_0x1619d1);});});} \ No newline at end of file +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 diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 120702d..3f208a1 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 _0x7628=['remove','update','emit','removeListener','register','length','cmList:','./cmList.events','save'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x7628,0xf1));var _0x8762=function(_0x573956,_0x1ac3ac){_0x573956=_0x573956-0x0;var _0x4b50c0=_0x7628[_0x573956];return _0x4b50c0;};'use strict';var CmListEvents=require(_0x8762('0x0'));var events=[_0x8762('0x1'),_0x8762('0x2'),_0x8762('0x3')];function createListener(_0x5aa479,_0x4079fa){return function(_0x2d4b72){_0x4079fa[_0x8762('0x4')](_0x5aa479,_0x2d4b72);};}function removeListener(_0x238609,_0x58ec1b){return function(){CmListEvents[_0x8762('0x5')](_0x238609,_0x58ec1b);};}exports[_0x8762('0x6')]=function(_0x292240){for(var _0xfefb4f=0x0,_0x52a613=events[_0x8762('0x7')];_0xfefb4f<_0x52a613;_0xfefb4f++){var _0x28bb6a=events[_0xfefb4f];var _0x11f4c6=createListener(_0x8762('0x8')+_0x28bb6a,_0x292240);CmListEvents['on'](_0x28bb6a,_0x11f4c6);}}; \ No newline at end of file +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 diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 27b19c4..0fd80aa 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 _0x4205=['/:id/contacts/csv','getContactsCsv','getCustomFields','/:id/users','getAgents','post','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','put','update','delete','destroy','exports','multer','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','/:id/contacts','getContacts'];(function(_0xb96c11,_0x5db2bc){var _0x1c79c8=function(_0x5d3a3c){while(--_0x5d3a3c){_0xb96c11['push'](_0xb96c11['shift']());}};_0x1c79c8(++_0x5db2bc);}(_0x4205,0x1f0));var _0x5420=function(_0x12c23d,_0x7c7687){_0x12c23d=_0x12c23d-0x0;var _0x1970f9=_0x4205[_0x12c23d];return _0x1970f9;};'use strict';var multer=require(_0x5420('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5420('0x1')]();var fs_extra=require(_0x5420('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5420('0x3'));var config=require(_0x5420('0x4'));var controller=require(_0x5420('0x5'));router[_0x5420('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x5420('0x7'),auth[_0x5420('0x8')](),controller['describe']);router['get'](_0x5420('0x9'),auth[_0x5420('0x8')](),controller[_0x5420('0xa')]);router[_0x5420('0x6')](_0x5420('0xb'),auth[_0x5420('0x8')](),controller['getDispositions']);router[_0x5420('0x6')](_0x5420('0xc'),auth[_0x5420('0x8')](),controller[_0x5420('0xd')]);router[_0x5420('0x6')](_0x5420('0xe'),auth[_0x5420('0x8')](),controller[_0x5420('0xf')]);router[_0x5420('0x6')]('/:id/fields',auth[_0x5420('0x8')](),controller[_0x5420('0x10')]);router['get'](_0x5420('0x11'),auth['isAuthenticated'](),controller[_0x5420('0x12')]);router[_0x5420('0x13')]('/',auth[_0x5420('0x8')](),controller['create']);router['post'](_0x5420('0xb'),auth['isAuthenticated'](),controller[_0x5420('0x14')]);router[_0x5420('0x13')]('/:id/contacts',auth[_0x5420('0x8')](),controller[_0x5420('0x15')]);router[_0x5420('0x13')](_0x5420('0x16'),auth[_0x5420('0x8')](),controller[_0x5420('0x17')]);router[_0x5420('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x5420('0x18')]);router[_0x5420('0x19')]('/:id',auth[_0x5420('0x8')](),controller[_0x5420('0x1a')]);router[_0x5420('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x5420('0x1c')]);router['delete'](_0x5420('0xb'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x5420('0x1b')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x5420('0x1d')]=router; \ No newline at end of file +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 diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 6bd3013..09261cc 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 _0xad3e=['field','STRING','exports','VIRTUAL'];(function(_0x25dadb,_0x579d75){var _0x415a2a=function(_0x2adb24){while(--_0x2adb24){_0x25dadb['push'](_0x25dadb['shift']());}};_0x415a2a(++_0x579d75);}(_0xad3e,0x8e));var _0xead3=function(_0x505da1,_0x4d2655){_0x505da1=_0x505da1-0x0;var _0x4a6da2=_0xad3e[_0x505da1];return _0x4a6da2;};'use strict';var Sequelize=require('sequelize');module[_0xead3('0x0')]={'name':{'type':Sequelize[_0xead3('0x1')],'get':function(_0x31ecb7){return this['getDataValue'](_0xead3('0x2'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0xead3('0x3')],'allowNull':![]},'value':{'type':Sequelize[_0xead3('0x3')],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 8905459..aff423e 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(_0x27f942,_0xde5b03){var _0x337a6e=function(_0xd3639c){while(--_0xd3639c){_0x27f942['push'](_0x27f942['shift']());}};_0x337a6e(++_0xde5b03);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_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 diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index f8abbeb..4cdc716 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 _0xdbca=['path','./condition.attributes','exports','define','lodash','util','moment','bluebird','request-promise'];(function(_0x5e1489,_0x27ee4b){var _0x423997=function(_0x1b5b37){while(--_0x1b5b37){_0x5e1489['push'](_0x5e1489['shift']());}};_0x423997(++_0x27ee4b);}(_0xdbca,0xdc));var _0xadbc=function(_0x16cfae,_0x3c3596){_0x16cfae=_0x16cfae-0x0;var _0x5a04cf=_0xdbca[_0x16cfae];return _0x5a04cf;};'use strict';var _=require(_0xadbc('0x0'));var util=require(_0xadbc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xadbc('0x2'));var BPromise=require(_0xadbc('0x3'));var rp=require(_0xadbc('0x4'));var fs=require('fs');var path=require(_0xadbc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xadbc('0x6'));module[_0xadbc('0x7')]=function(_0x53ead6,_0x23337c){return _0x53ead6[_0xadbc('0x8')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 94f6e60..a45a149 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 _0x883e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x5cec0f,_0xf70faa){var _0x2ad1b4=function(_0x17c638){while(--_0x17c638){_0x5cec0f['push'](_0x5cec0f['shift']());}};_0x2ad1b4(++_0xf70faa);}(_0x883e,0x16d));var _0xe883=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x883e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe883('0x0'));var util=require('util');var moment=require(_0xe883('0x1'));var BPromise=require(_0xe883('0x2'));var rs=require(_0xe883('0x3'));var fs=require('fs');var Redis=require(_0xe883('0x4'));var db=require(_0xe883('0x5'))['db'];var utils=require(_0xe883('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xe883('0x7'));var jayson=require(_0xe883('0x8'));var client=jayson[_0xe883('0x9')][_0xe883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b86d9,_0x10a377,_0x524364){return new BPromise(function(_0x226aa7,_0x222563){return client['request'](_0x1b86d9,_0x524364)[_0xe883('0xb')](function(_0x46f1b0){logger[_0xe883('0xc')]('Condition,\x20%s,\x20%s',_0x10a377,_0xe883('0xd'));logger[_0xe883('0xe')](_0xe883('0xf'),_0x10a377,_0xe883('0xd'),JSON[_0xe883('0x10')](_0x46f1b0));if(_0x46f1b0[_0xe883('0x11')]){if(_0x46f1b0[_0xe883('0x11')][_0xe883('0x12')]===0x1f4){logger[_0xe883('0x11')](_0xe883('0x13'),_0x10a377,_0x46f1b0[_0xe883('0x11')][_0xe883('0x14')]);return _0x222563(_0x46f1b0['error'][_0xe883('0x14')]);}logger['error'](_0xe883('0x13'),_0x10a377,_0x46f1b0[_0xe883('0x11')][_0xe883('0x14')]);return _0x226aa7(_0x46f1b0['error'][_0xe883('0x14')]);}else{logger[_0xe883('0xc')](_0xe883('0x13'),_0x10a377,_0xe883('0xd'));_0x226aa7(_0x46f1b0[_0xe883('0x15')][_0xe883('0x14')]);}})[_0xe883('0x16')](function(_0x545395){logger[_0xe883('0x11')]('Condition,\x20%s,\x20%s',_0x10a377,_0x545395);_0x222563(_0x545395);});});} \ No newline at end of file +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 diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 9cecc2a..e13fdd1 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 _0xfe20=['Router','../../config/environment','./condition.controller','put','/:id','isAuthenticated','destroy','multer','path','express'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xfe20,0x11f));var _0x0fe2=function(_0x47be34,_0x1730f7){_0x47be34=_0x47be34-0x0;var _0x304194=_0xfe20[_0x47be34];return _0x304194;};'use strict';var multer=require(_0x0fe2('0x0'));var util=require('util');var path=require(_0x0fe2('0x1'));var timeout=require('connect-timeout');var express=require(_0x0fe2('0x2'));var router=express[_0x0fe2('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0fe2('0x4'));var controller=require(_0x0fe2('0x5'));router[_0x0fe2('0x6')](_0x0fe2('0x7'),auth[_0x0fe2('0x8')](),controller['update']);router['delete'](_0x0fe2('0x7'),auth['isAuthenticated'](),controller[_0x0fe2('0x9')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 7c3ee13..a90e1ed 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 _0xbaf0=['name','exports','STRING'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'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 +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 diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index b954648..626fdaa 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 _0xd211=['send','index','Dashboard','rawAttributes','key','map','query','keys','filters','attributes','intersection','model','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','clone','params','updatedAt','omit','createdAt','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','findOne','DashboardItem','pick','getItems','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name'];(function(_0x222360,_0x1e0f0c){var _0x41fe1d=function(_0x3b4f91){while(--_0x3b4f91){_0x222360['push'](_0x222360['shift']());}};_0x41fe1d(++_0x1e0f0c);}(_0xd211,0x140));var _0x1d21=function(_0x10f624,_0x592226){_0x10f624=_0x10f624-0x0;var _0x34951e=_0xd211[_0x10f624];return _0x34951e;};'use strict';var emlformat=require(_0x1d21('0x0'));var rimraf=require(_0x1d21('0x1'));var zipdir=require(_0x1d21('0x2'));var jsonpatch=require(_0x1d21('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1d21('0x4'));var util=require(_0x1d21('0x5'));var path=require('path');var sox=require(_0x1d21('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d21('0x7'));var _=require(_0x1d21('0x8'));var squel=require(_0x1d21('0x9'));var crypto=require(_0x1d21('0xa'));var jsforce=require(_0x1d21('0xb'));var deskjs=require(_0x1d21('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1d21('0xd'));var Papa=require(_0x1d21('0xe'));var Redis=require(_0x1d21('0xf'));var authService=require(_0x1d21('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1d21('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d21('0x12'))('api');var utils=require(_0x1d21('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x1d21('0x14'));var db=require('../../mysqldb')['db'];config[_0x1d21('0x15')]=_[_0x1d21('0x16')](config[_0x1d21('0x15')],{'host':_0x1d21('0x17'),'port':0x18eb});var socket=require(_0x1d21('0x18'))(new Redis(config[_0x1d21('0x15')]));require(_0x1d21('0x19'))['register'](socket);function respondWithStatusCode(_0x47bf32,_0x47c9d6){_0x47c9d6=_0x47c9d6||0xcc;return function(_0x3a6820){if(_0x3a6820){return _0x47bf32[_0x1d21('0x1a')](_0x47c9d6);}return _0x47bf32[_0x1d21('0x1b')](_0x47c9d6)['end']();};}function respondWithResult(_0x2b7ebb,_0xb22145){_0xb22145=_0xb22145||0xc8;return function(_0x27b45a){if(_0x27b45a){return _0x2b7ebb[_0x1d21('0x1b')](_0xb22145)[_0x1d21('0x1c')](_0x27b45a);}};}function respondWithFilteredResult(_0xef7866,_0x223710){return function(_0x470394){if(_0x470394){var _0x126ef7=typeof _0x223710[_0x1d21('0x1d')]===_0x1d21('0x1e')&&typeof _0x223710[_0x1d21('0x1f')]===_0x1d21('0x1e');var _0xf10db=_0x470394[_0x1d21('0x20')];var _0x1a2a03=_0x126ef7?0x0:_0x223710[_0x1d21('0x1d')];var _0x5c1c11=_0x126ef7?_0x470394[_0x1d21('0x20')]:_0x223710[_0x1d21('0x1d')]+_0x223710[_0x1d21('0x1f')];var _0x3bd1bf;if(_0x5c1c11>=_0xf10db){_0x5c1c11=_0xf10db;_0x3bd1bf=0xc8;}else{_0x3bd1bf=0xce;}_0xef7866[_0x1d21('0x1b')](_0x3bd1bf);return _0xef7866['set'](_0x1d21('0x21'),_0x1a2a03+'-'+_0x5c1c11+'/'+_0xf10db)[_0x1d21('0x1c')](_0x470394);}return null;};}function patchUpdates(_0x14b6f6){return function(_0x44fc74){try{jsonpatch[_0x1d21('0x22')](_0x44fc74,_0x14b6f6,!![]);}catch(_0x53bda0){return BPromise['reject'](_0x53bda0);}return _0x44fc74[_0x1d21('0x23')]();};}function saveUpdates(_0x448253,_0x440f6e){return function(_0x4d1c31){if(_0x4d1c31){return _0x4d1c31[_0x1d21('0x24')](_0x448253)[_0x1d21('0x25')](function(_0xcc2323){return _0xcc2323;});}return null;};}function removeEntity(_0x63d30a,_0x4b3433){return function(_0x1bf5b3){if(_0x1bf5b3){return _0x1bf5b3[_0x1d21('0x26')]()[_0x1d21('0x25')](function(){var _0x15918b=_0x1bf5b3[_0x1d21('0x27')]({'plain':!![]});var _0x5eada7=_0x1d21('0x28');return db[_0x1d21('0x29')][_0x1d21('0x26')]({'where':{'type':_0x5eada7,'resourceId':_0x15918b['id']}})[_0x1d21('0x25')](function(){return _0x1bf5b3;});})[_0x1d21('0x25')](function(){_0x63d30a[_0x1d21('0x1b')](0xcc)[_0x1d21('0x2a')]();});}};}function handleEntityNotFound(_0x149db6,_0x8e15f4){return function(_0x44b6b0){if(!_0x44b6b0){_0x149db6[_0x1d21('0x1a')](0x194);}return _0x44b6b0;};}function handleError(_0x5344fb,_0x2a7a89){_0x2a7a89=_0x2a7a89||0x1f4;return function(_0x930e87){logger[_0x1d21('0x2b')](_0x930e87[_0x1d21('0x2c')]);if(_0x930e87[_0x1d21('0x2d')]){delete _0x930e87[_0x1d21('0x2d')];}_0x5344fb[_0x1d21('0x1b')](_0x2a7a89)[_0x1d21('0x2e')](_0x930e87);};}exports[_0x1d21('0x2f')]=function(_0xc36a50,_0x5deef5){var _0x33fbcb={},_0x2d8616={},_0x17cc52={'count':0x0,'rows':[]};var _0x426a38=_['map'](db[_0x1d21('0x30')][_0x1d21('0x31')],function(_0x47af29){return{'name':_0x47af29['fieldName'],'type':_0x47af29['type'][_0x1d21('0x32')]};});_0x2d8616['model']=_[_0x1d21('0x33')](_0x426a38,_0x1d21('0x2d'));_0x2d8616[_0x1d21('0x34')]=_[_0x1d21('0x35')](_0xc36a50[_0x1d21('0x34')]);_0x2d8616[_0x1d21('0x36')]=_['intersection'](_0x2d8616['model'],_0x2d8616['query']);_0x33fbcb[_0x1d21('0x37')]=_[_0x1d21('0x38')](_0x2d8616[_0x1d21('0x39')],qs['fields'](_0xc36a50[_0x1d21('0x34')]['fields']));_0x33fbcb['attributes']=_0x33fbcb['attributes'][_0x1d21('0x3a')]?_0x33fbcb[_0x1d21('0x37')]:_0x2d8616[_0x1d21('0x39')];if(!_0xc36a50['query'][_0x1d21('0x3b')](_0x1d21('0x3c'))){_0x33fbcb[_0x1d21('0x1f')]=qs[_0x1d21('0x1f')](_0xc36a50[_0x1d21('0x34')][_0x1d21('0x1f')]);_0x33fbcb[_0x1d21('0x1d')]=qs[_0x1d21('0x1d')](_0xc36a50['query']['offset']);}_0x33fbcb[_0x1d21('0x3d')]=qs[_0x1d21('0x3e')](_0xc36a50[_0x1d21('0x34')][_0x1d21('0x3e')]);_0x33fbcb[_0x1d21('0x3f')]=qs['filters'](_['pick'](_0xc36a50[_0x1d21('0x34')],_0x2d8616['filters']),_0x426a38);if(_0xc36a50[_0x1d21('0x34')][_0x1d21('0x40')]){_0x33fbcb[_0x1d21('0x3f')]=_[_0x1d21('0x41')](_0x33fbcb[_0x1d21('0x3f')],{'$or':_['map'](_0x426a38,function(_0x5ccf06){if(_0x5ccf06[_0x1d21('0x42')]!==_0x1d21('0x43')){var _0x2ef768={};_0x2ef768[_0x5ccf06[_0x1d21('0x2d')]]={'$like':'%'+_0xc36a50[_0x1d21('0x34')][_0x1d21('0x40')]+'%'};return _0x2ef768;}})});}_0x33fbcb=_[_0x1d21('0x41')]({},_0x33fbcb,_0xc36a50[_0x1d21('0x44')]);var _0x379300={'where':_0x33fbcb[_0x1d21('0x3f')]};return db[_0x1d21('0x30')][_0x1d21('0x20')](_0x379300)[_0x1d21('0x25')](function(_0xa65790){_0x17cc52['count']=_0xa65790;if(_0xc36a50[_0x1d21('0x34')][_0x1d21('0x45')]){_0x33fbcb[_0x1d21('0x46')]=[{'all':!![]}];}return db['Dashboard'][_0x1d21('0x47')](_0x33fbcb);})[_0x1d21('0x25')](function(_0x4be2ab){_0x17cc52[_0x1d21('0x48')]=_0x4be2ab;return _0x17cc52;})['then'](respondWithFilteredResult(_0x5deef5,_0x33fbcb))[_0x1d21('0x49')](handleError(_0x5deef5,null));};exports[_0x1d21('0x4a')]=function(_0x5bec61,_0x17e908){var _0x4bc19d={'raw':![],'where':{'id':_0x5bec61['params']['id']}},_0x15fe69={};_0x15fe69[_0x1d21('0x39')]=_['keys'](db[_0x1d21('0x30')][_0x1d21('0x31')]);_0x15fe69[_0x1d21('0x34')]=_['keys'](_0x5bec61['query']);_0x15fe69[_0x1d21('0x36')]=_[_0x1d21('0x38')](_0x15fe69['model'],_0x15fe69[_0x1d21('0x34')]);_0x4bc19d['attributes']=_[_0x1d21('0x38')](_0x15fe69['model'],qs[_0x1d21('0x4b')](_0x5bec61['query']['fields']));_0x4bc19d['attributes']=_0x4bc19d[_0x1d21('0x37')][_0x1d21('0x3a')]?_0x4bc19d['attributes']:_0x15fe69[_0x1d21('0x39')];if(_0x5bec61[_0x1d21('0x34')]['includeAll']){_0x4bc19d[_0x1d21('0x46')]=[{'all':!![]}];}_0x4bc19d=_[_0x1d21('0x41')]({},_0x4bc19d,_0x5bec61[_0x1d21('0x44')]);return db['Dashboard'][_0x1d21('0x4c')](_0x4bc19d)['then'](handleEntityNotFound(_0x17e908,null))[_0x1d21('0x25')](respondWithResult(_0x17e908,null))[_0x1d21('0x49')](handleError(_0x17e908,null));};exports[_0x1d21('0x4d')]=function(_0x236f44,_0x315ad1){return db[_0x1d21('0x30')][_0x1d21('0x4d')](_0x236f44[_0x1d21('0x4e')],{})[_0x1d21('0x25')](function(_0x55b861){var _0x1278e1=_0x236f44['user'][_0x1d21('0x27')]({'plain':!![]});if(!_0x1278e1)throw new Error(_0x1d21('0x4f'));if(_0x1278e1[_0x1d21('0x50')]===_0x1d21('0x51')){var _0x2e74b2=_0x55b861[_0x1d21('0x27')]({'plain':!![]});var _0x3c2701=_0x1d21('0x28');return db['UserProfileSection'][_0x1d21('0x4c')]({'where':{'name':_0x3c2701,'userProfileId':_0x1278e1[_0x1d21('0x52')]},'raw':!![]})[_0x1d21('0x25')](function(_0x5973cf){if(_0x5973cf&&_0x5973cf['autoAssociation']===0x0){return db[_0x1d21('0x29')][_0x1d21('0x4d')]({'name':_0x2e74b2[_0x1d21('0x2d')],'resourceId':_0x2e74b2['id'],'type':_0x5973cf[_0x1d21('0x2d')],'sectionId':_0x5973cf['id']},{})[_0x1d21('0x25')](function(){return _0x55b861;});}else{return _0x55b861;}})[_0x1d21('0x49')](function(_0x4ac97e){logger[_0x1d21('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ac97e);throw _0x4ac97e;});}return _0x55b861;})['then'](respondWithResult(_0x315ad1,0xc9))[_0x1d21('0x49')](handleError(_0x315ad1,null));};exports[_0x1d21('0x53')]=function(_0x4168d5,_0x25ca1b){var _0x215536={'where':{'id':_0x4168d5[_0x1d21('0x54')]['id']}},_0x8ce708={};_0x8ce708[_0x1d21('0x39')]=_[_0x1d21('0x35')](db[_0x1d21('0x30')][_0x1d21('0x31')]);_0x215536['attributes']=_[_0x1d21('0x38')](_0x8ce708[_0x1d21('0x39')],qs['fields'](_0x4168d5['query'][_0x1d21('0x4b')]));_0x215536[_0x1d21('0x37')]=_0x215536[_0x1d21('0x37')][_0x1d21('0x3a')]?_0x215536[_0x1d21('0x37')]:_0x8ce708[_0x1d21('0x39')];if(_0x4168d5[_0x1d21('0x34')][_0x1d21('0x45')]){_0x215536['include']=[{'all':!![]}];}_0x215536=_[_0x1d21('0x41')]({},_0x215536,_0x4168d5[_0x1d21('0x44')]);return db[_0x1d21('0x30')][_0x1d21('0x4c')](_0x215536)[_0x1d21('0x25')](handleEntityNotFound(_0x25ca1b,null))[_0x1d21('0x25')](function(_0x22b06b){if(_0x22b06b){var _0x3f0a06=_0x22b06b[_0x1d21('0x27')]({'plain':!![]});_0x3f0a06=qs['omit'](_0x3f0a06,['id','createdAt',_0x1d21('0x55')]);_0x4168d5[_0x1d21('0x4e')]=_[_0x1d21('0x56')](_0x4168d5[_0x1d21('0x4e')],['id',_0x1d21('0x57'),_0x1d21('0x55')]);return db[_0x1d21('0x30')][_0x1d21('0x4d')](_[_0x1d21('0x41')](_0x3f0a06,_0x4168d5[_0x1d21('0x4e')]),{'include':_0x4168d5[_0x1d21('0x34')][_0x1d21('0x45')]?[{'all':!![]}]:undefined})['then'](function(_0x4eb02d){var _0x27b370=_0x4168d5[_0x1d21('0x51')][_0x1d21('0x27')]({'plain':!![]});if(!_0x27b370)throw new Error(_0x1d21('0x4f'));if(_0x27b370[_0x1d21('0x50')]===_0x1d21('0x51')){var _0x2783eb=_0x4eb02d[_0x1d21('0x27')]({'plain':!![]});var _0x29f5a4=_0x1d21('0x28');return db[_0x1d21('0x58')][_0x1d21('0x4c')]({'where':{'name':_0x29f5a4,'userProfileId':_0x27b370[_0x1d21('0x52')]},'raw':!![]})['then'](function(_0x211cf1){if(_0x211cf1&&_0x211cf1[_0x1d21('0x59')]===0x0){return db['UserProfileResource']['create']({'name':_0x2783eb[_0x1d21('0x2d')],'resourceId':_0x2783eb['id'],'type':_0x211cf1[_0x1d21('0x2d')],'sectionId':_0x211cf1['id']},{})[_0x1d21('0x25')](function(){return _0x4eb02d;});}else{return _0x4eb02d;}})[_0x1d21('0x49')](function(_0x20d346){logger['error'](_0x1d21('0x5a'),_0x20d346);throw _0x20d346;});}return _0x4eb02d;});}})[_0x1d21('0x25')](respondWithResult(_0x25ca1b,0xc9))['catch'](handleError(_0x25ca1b,null));};exports['update']=function(_0x2a509f,_0x1e5d42){if(_0x2a509f[_0x1d21('0x4e')]['id']){delete _0x2a509f['body']['id'];}return db[_0x1d21('0x30')][_0x1d21('0x4c')]({'where':{'id':_0x2a509f['params']['id']}})['then'](handleEntityNotFound(_0x1e5d42,null))[_0x1d21('0x25')](saveUpdates(_0x2a509f[_0x1d21('0x4e')],null))[_0x1d21('0x25')](respondWithResult(_0x1e5d42,null))[_0x1d21('0x49')](handleError(_0x1e5d42,null));};exports['destroy']=function(_0x5691c5,_0x3be44f){return db[_0x1d21('0x30')][_0x1d21('0x4c')]({'where':{'id':_0x5691c5[_0x1d21('0x54')]['id']}})[_0x1d21('0x25')](handleEntityNotFound(_0x3be44f,null))[_0x1d21('0x25')](removeEntity(_0x3be44f,null))[_0x1d21('0x49')](handleError(_0x3be44f,null));};function widgetAttributes(_0x378794){try{switch(_0x378794[_0x1d21('0x42')]){case'iframe':return[{'name':_0x1d21('0x5b'),'value':_0x378794[_0x1d21('0x5b')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794['attrs'][0x0]?_0x378794[_0x1d21('0x5c')][0x0][_0x1d21('0x5d')]:undefined)||_0x1d21('0x5e')}];case _0x1d21('0x5f'):return[{'name':_0x1d21('0x60'),'value':_0x378794[_0x1d21('0x60')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794['attrs'][0x0]?_0x378794[_0x1d21('0x5c')][0x0][_0x1d21('0x5d')]:undefined)||''}];case _0x1d21('0x61'):return[{'name':'attrHourFormat','value':_0x378794[_0x1d21('0x62')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794['attrs'][0x0]?_0x378794[_0x1d21('0x5c')][0x0][_0x1d21('0x5d')]:undefined)||_0x1d21('0x63')},{'name':_0x1d21('0x64'),'value':_0x378794[_0x1d21('0x64')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794['attrs'][0x1]?_0x378794[_0x1d21('0x5c')][0x1][_0x1d21('0x5d')]:undefined)||_0x1d21('0x65')},{'name':_0x1d21('0x66'),'value':_0x378794[_0x1d21('0x66')]||(_0x378794['attrs']&&_0x378794[_0x1d21('0x5c')][0x2]?_0x378794[_0x1d21('0x5c')][0x2][_0x1d21('0x5d')]:undefined)||0xc}];case _0x1d21('0x67'):return[{'name':_0x1d21('0x68'),'value':_0x378794[_0x1d21('0x68')]||(_0x378794['attrs']&&_0x378794[_0x1d21('0x5c')][0x0]?_0x378794['attrs'][0x0][_0x1d21('0x5d')]:undefined)||_0x1d21('0x69')},{'name':_0x1d21('0x6a'),'value':_0x378794[_0x1d21('0x6a')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794[_0x1d21('0x5c')][0x1]?_0x378794[_0x1d21('0x5c')][0x1][_0x1d21('0x5d')]:undefined)||[]},{'name':'attrFontSize','value':_0x378794[_0x1d21('0x66')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794[_0x1d21('0x5c')][0x2]?_0x378794[_0x1d21('0x5c')][0x2]['value']:undefined)||0x14}];case _0x1d21('0x6b'):case _0x1d21('0x6c'):return[{'name':_0x1d21('0x6d'),'value':_0x378794[_0x1d21('0x6d')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794[_0x1d21('0x5c')][0x0]?_0x378794[_0x1d21('0x5c')][0x0][_0x1d21('0x5d')]:undefined)||_0x1d21('0x69')},{'name':'attrSerie2','value':_0x378794['attrSerie2']||(_0x378794['attrs']&&_0x378794['attrs'][0x1]?_0x378794[_0x1d21('0x5c')][0x1][_0x1d21('0x5d')]:undefined)||null},{'name':_0x1d21('0x6e'),'value':_0x378794['attrSerie3']||(_0x378794['attrs']&&_0x378794[_0x1d21('0x5c')][0x2]?_0x378794[_0x1d21('0x5c')][0x2][_0x1d21('0x5d')]:undefined)||null},{'name':_0x1d21('0x6a'),'value':_0x378794[_0x1d21('0x6a')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794[_0x1d21('0x5c')][0x3]?_0x378794['attrs'][0x3][_0x1d21('0x5d')]:undefined)||[]}];case _0x1d21('0x6f'):return[{'name':'attrReport','type':_0x378794['reportType']||(_0x378794[_0x1d21('0x5c')]&&_0x378794['attrs'][0x0]?_0x378794[_0x1d21('0x5c')][0x0][_0x1d21('0x42')]:undefined)||null,'value':_0x378794[_0x1d21('0x70')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794[_0x1d21('0x5c')][0x0]?_0x378794[_0x1d21('0x5c')][0x0][_0x1d21('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x378794[_0x1d21('0x71')]||(_0x378794[_0x1d21('0x5c')]&&_0x378794[_0x1d21('0x5c')][0x1]?_0x378794[_0x1d21('0x5c')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x372bc4){logger[_0x1d21('0x2b')](_0x1d21('0x72'),JSON[_0x1d21('0x73')](_0x372bc4));return[];}}exports[_0x1d21('0x74')]=function(_0x4b831a,_0x35e3f7,_0x202109){if(_0x4b831a['body']['id']){delete _0x4b831a[_0x1d21('0x4e')]['id'];}return db[_0x1d21('0x30')][_0x1d21('0x4c')]({'where':{'id':_0x4b831a[_0x1d21('0x54')]['id']}})['then'](handleEntityNotFound(_0x35e3f7,null))[_0x1d21('0x25')](function(_0x4d73db){if(_0x4d73db){_0x4b831a[_0x1d21('0x4e')][_0x1d21('0x75')]=_0x4d73db['id'];_0x4b831a[_0x1d21('0x4e')][_0x1d21('0x5c')]=widgetAttributes(_0x4b831a[_0x1d21('0x4e')]);return db['DashboardItem'][_0x1d21('0x4d')](_0x4b831a['body']);}})['then'](respondWithResult(_0x35e3f7,null))[_0x1d21('0x49')](handleError(_0x35e3f7,null));};exports['getItems']=function(_0x3376a0,_0x118b9e,_0x55ada7){var _0xaa882={};var _0x11d430={};var _0x3215a7;var _0xcf52d3;return db[_0x1d21('0x30')][_0x1d21('0x76')]({'where':{'id':_0x3376a0[_0x1d21('0x54')]['id']}})[_0x1d21('0x25')](handleEntityNotFound(_0x118b9e,null))[_0x1d21('0x25')](function(_0x537f70){if(_0x537f70){_0x3215a7=_0x537f70;_0x11d430[_0x1d21('0x39')]=_[_0x1d21('0x35')](db[_0x1d21('0x77')][_0x1d21('0x31')]);_0x11d430[_0x1d21('0x34')]=_[_0x1d21('0x35')](_0x3376a0[_0x1d21('0x34')]);_0x11d430[_0x1d21('0x36')]=_[_0x1d21('0x38')](_0x11d430['model'],_0x11d430[_0x1d21('0x34')]);_0xaa882[_0x1d21('0x37')]=_['intersection'](_0x11d430['model'],qs[_0x1d21('0x4b')](_0x3376a0['query'][_0x1d21('0x4b')]));_0xaa882[_0x1d21('0x37')]=_0xaa882['attributes'][_0x1d21('0x3a')]?_0xaa882[_0x1d21('0x37')]:_0x11d430['model'];_0xaa882['order']=qs['sort'](_0x3376a0['query'][_0x1d21('0x3e')]);_0xaa882[_0x1d21('0x3f')]=qs[_0x1d21('0x36')](_[_0x1d21('0x78')](_0x3376a0['query'],_0x11d430[_0x1d21('0x36')]));if(_0x3376a0[_0x1d21('0x34')][_0x1d21('0x40')]){_0xaa882[_0x1d21('0x3f')]=_[_0x1d21('0x41')](_0xaa882[_0x1d21('0x3f')],{'$or':_[_0x1d21('0x33')](_0xaa882[_0x1d21('0x37')],function(_0x551d14){var _0x33d1b6={};_0x33d1b6[_0x551d14]={'$like':'%'+_0x3376a0[_0x1d21('0x34')][_0x1d21('0x40')]+'%'};return _0x33d1b6;})});}_0xaa882=_[_0x1d21('0x41')]({},_0xaa882,_0x3376a0[_0x1d21('0x44')]);return _0x3215a7[_0x1d21('0x79')](_0xaa882);}})[_0x1d21('0x25')](function(_0x53bbe){if(_0x53bbe){_0xcf52d3=_0x53bbe[_0x1d21('0x3a')];if(!_0x3376a0[_0x1d21('0x34')][_0x1d21('0x3b')](_0x1d21('0x3c'))){_0xaa882[_0x1d21('0x1f')]=qs[_0x1d21('0x1f')](_0x3376a0[_0x1d21('0x34')][_0x1d21('0x1f')]);_0xaa882[_0x1d21('0x1d')]=qs[_0x1d21('0x1d')](_0x3376a0[_0x1d21('0x34')][_0x1d21('0x1d')]);}return _0x3215a7['getItems'](_0xaa882);}})['then'](function(_0x43b959){if(_0x43b959){return _0x43b959?{'count':_0xcf52d3,'rows':_0x43b959}:null;}})[_0x1d21('0x25')](respondWithResult(_0x118b9e,null))['catch'](handleError(_0x118b9e,null));}; \ No newline at end of file +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 diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index fe14252..247b47e 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 _0x1cce=['Dashboard','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0xaad6f5,_0x9e9751){var _0x555298=function(_0x2092d8){while(--_0x2092d8){_0xaad6f5['push'](_0xaad6f5['shift']());}};_0x555298(++_0x9e9751);}(_0x1cce,0x80));var _0xe1cc=function(_0x50a448,_0x3d1a4d){_0x50a448=_0x50a448-0x0;var _0x5da8c6=_0x1cce[_0x50a448];return _0x5da8c6;};'use strict';var EventEmitter=require(_0xe1cc('0x0'));var Dashboard=require(_0xe1cc('0x1'))['db'][_0xe1cc('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xe1cc('0x3')](0x0);var events={'afterCreate':_0xe1cc('0x4'),'afterUpdate':_0xe1cc('0x5'),'afterDestroy':_0xe1cc('0x6')};function emitEvent(_0x5c168b){return function(_0x5720e8,_0x434241,_0x5de6a9){DashboardEvents[_0xe1cc('0x7')](_0x5c168b+':'+_0x5720e8['id'],_0x5720e8);DashboardEvents[_0xe1cc('0x7')](_0x5c168b,_0x5720e8);_0x5de6a9(null);};}for(var e in events){if(events[_0xe1cc('0x8')](e)){var event=events[e];Dashboard[_0xe1cc('0x9')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +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 diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 44e9f9a..bd6e961 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 _0x4808=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','dashboards','lodash','util'];(function(_0x3a54c1,_0x1b19a7){var _0x532e71=function(_0x232423){while(--_0x232423){_0x3a54c1['push'](_0x3a54c1['shift']());}};_0x532e71(++_0x1b19a7);}(_0x4808,0x1cc));var _0x8480=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x4808[_0x2dea24];return _0x309d58;};'use strict';var _=require(_0x8480('0x0'));var util=require(_0x8480('0x1'));var logger=require(_0x8480('0x2'))(_0x8480('0x3'));var moment=require(_0x8480('0x4'));var BPromise=require(_0x8480('0x5'));var rp=require(_0x8480('0x6'));var fs=require('fs');var path=require(_0x8480('0x7'));var rimraf=require(_0x8480('0x8'));var config=require(_0x8480('0x9'));var attributes=require(_0x8480('0xa'));module['exports']=function(_0x195872,_0xf1622f){return _0x195872[_0x8480('0xb')](_0x8480('0xc'),attributes,{'tableName':_0x8480('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index d4b4c7e..1d786e3 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 _0x0e5d=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./dashboard.socket','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x2d1840,_0x5dc27e){var _0xd06a88=function(_0x4770c9){while(--_0x4770c9){_0x2d1840['push'](_0x2d1840['shift']());}};_0xd06a88(++_0x5dc27e);}(_0x0e5d,0x152));var _0xd0e5=function(_0x2f0373,_0x272541){_0x2f0373=_0x2f0373-0x0;var _0x2032f4=_0x0e5d[_0x2f0373];return _0x2032f4;};'use strict';var _=require(_0xd0e5('0x0'));var util=require(_0xd0e5('0x1'));var moment=require('moment');var BPromise=require(_0xd0e5('0x2'));var rs=require(_0xd0e5('0x3'));var fs=require('fs');var Redis=require(_0xd0e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd0e5('0x5'));var logger=require(_0xd0e5('0x6'))(_0xd0e5('0x7'));var config=require(_0xd0e5('0x8'));var jayson=require(_0xd0e5('0x9'));var client=jayson[_0xd0e5('0xa')][_0xd0e5('0xb')]({'port':0x232a});config[_0xd0e5('0xc')]=_['defaults'](config[_0xd0e5('0xc')],{'host':_0xd0e5('0xd'),'port':0x18eb});var socket=require(_0xd0e5('0xe'))(new Redis(config[_0xd0e5('0xc')]));require(_0xd0e5('0xf'))['register'](socket);function respondWithRpcPromise(_0x37212f,_0x44c99c,_0x31f1f0){return new BPromise(function(_0x465867,_0x266509){return client[_0xd0e5('0x10')](_0x37212f,_0x31f1f0)['then'](function(_0x21d73b){logger[_0xd0e5('0x11')](_0xd0e5('0x12'),_0x44c99c,_0xd0e5('0x13'));logger['debug'](_0xd0e5('0x14'),_0x44c99c,_0xd0e5('0x13'),JSON[_0xd0e5('0x15')](_0x21d73b));if(_0x21d73b['error']){if(_0x21d73b[_0xd0e5('0x16')]['code']===0x1f4){logger['error'](_0xd0e5('0x12'),_0x44c99c,_0x21d73b['error'][_0xd0e5('0x17')]);return _0x266509(_0x21d73b[_0xd0e5('0x16')]['message']);}logger[_0xd0e5('0x16')](_0xd0e5('0x12'),_0x44c99c,_0x21d73b[_0xd0e5('0x16')][_0xd0e5('0x17')]);return _0x465867(_0x21d73b[_0xd0e5('0x16')][_0xd0e5('0x17')]);}else{logger[_0xd0e5('0x11')](_0xd0e5('0x12'),_0x44c99c,_0xd0e5('0x13'));_0x465867(_0x21d73b[_0xd0e5('0x18')][_0xd0e5('0x17')]);}})[_0xd0e5('0x19')](function(_0x3d37a0){logger[_0xd0e5('0x16')]('Dashboard,\x20%s,\x20%s',_0x44c99c,_0x3d37a0);_0x266509(_0x3d37a0);});});} \ No newline at end of file +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 diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 1a5dfbb..a048524 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 _0x1d37=['register','length','dashboard:','remove','update','emit','removeListener'];(function(_0x4e08e8,_0x130b6c){var _0xa81663=function(_0x41b7d7){while(--_0x41b7d7){_0x4e08e8['push'](_0x4e08e8['shift']());}};_0xa81663(++_0x130b6c);}(_0x1d37,0x1df));var _0x71d3=function(_0x2d1840,_0x5dc27e){_0x2d1840=_0x2d1840-0x0;var _0xd06a88=_0x1d37[_0x2d1840];return _0xd06a88;};'use strict';var DashboardEvents=require('./dashboard.events');var events=['save',_0x71d3('0x0'),_0x71d3('0x1')];function createListener(_0x1cbf10,_0x5d619b){return function(_0x26a9b0){_0x5d619b[_0x71d3('0x2')](_0x1cbf10,_0x26a9b0);};}function removeListener(_0x483e9d,_0x383092){return function(){DashboardEvents[_0x71d3('0x3')](_0x483e9d,_0x383092);};}exports[_0x71d3('0x4')]=function(_0x52a451){for(var _0x315d2f=0x0,_0x37c158=events[_0x71d3('0x5')];_0x315d2f<_0x37c158;_0x315d2f++){var _0x474a36=events[_0x315d2f];var _0x42547b=createListener(_0x71d3('0x6')+_0x474a36,_0x52a451);DashboardEvents['on'](_0x474a36,_0x42547b);}}; \ No newline at end of file +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 diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index bcddd43..d373bf0 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 _0x9d63=['/:id/items','post','create','/:id/clone','clone','addItem','put','update','delete','destroy','util','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','show'];(function(_0x2ade0c,_0x929020){var _0x4adf4b=function(_0x2aadca){while(--_0x2aadca){_0x2ade0c['push'](_0x2ade0c['shift']());}};_0x4adf4b(++_0x929020);}(_0x9d63,0x19a));var _0x39d6=function(_0x37756b,_0x24db76){_0x37756b=_0x37756b-0x0;var _0x46efec=_0x9d63[_0x37756b];return _0x46efec;};'use strict';var multer=require('multer');var util=require(_0x39d6('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x39d6('0x1'));var router=express[_0x39d6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x39d6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x39d6('0x4'));var controller=require(_0x39d6('0x5'));router[_0x39d6('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x39d6('0x6')](_0x39d6('0x7'),auth[_0x39d6('0x8')](),controller[_0x39d6('0x9')]);router[_0x39d6('0x6')](_0x39d6('0xa'),auth['isAuthenticated'](),controller['getItems']);router[_0x39d6('0xb')]('/',auth[_0x39d6('0x8')](),controller[_0x39d6('0xc')]);router[_0x39d6('0xb')](_0x39d6('0xd'),auth[_0x39d6('0x8')](),controller[_0x39d6('0xe')]);router[_0x39d6('0xb')](_0x39d6('0xa'),auth[_0x39d6('0x8')](),controller[_0x39d6('0xf')]);router[_0x39d6('0x10')](_0x39d6('0x7'),auth[_0x39d6('0x8')](),controller[_0x39d6('0x11')]);router[_0x39d6('0x12')](_0x39d6('0x7'),auth[_0x39d6('0x8')](),controller[_0x39d6('0x13')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 89902f9..9d8d91d 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 _0x2542=['exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash'];(function(_0x3a0863,_0x4cd5ef){var _0x85c557=function(_0x3011cb){while(--_0x3011cb){_0x3a0863['push'](_0x3a0863['shift']());}};_0x85c557(++_0x4cd5ef);}(_0x2542,0x169));var _0x2254=function(_0x570dff,_0x325880){_0x570dff=_0x570dff-0x0;var _0x3b1e20=_0x2542[_0x570dff];return _0x3b1e20;};'use strict';var Sequelize=require(_0x2254('0x0'));var squel=require(_0x2254('0x1'));var _=require(_0x2254('0x2'));module[_0x2254('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2254('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x2254('0x5')),'get':function(){try{return JSON[_0x2254('0x6')](this[_0x2254('0x7')](_0x2254('0x8')));}catch(_0x76c902){return[];}},'set':function(_0x508183){try{this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')](_0x508183));}catch(_0x3c45ec){this[_0x2254('0x9')](_0x2254('0x8'),JSON[_0x2254('0xa')]([]));}}},'sizeX':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x2254('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x2254('0xb')]},'col':{'type':Sequelize[_0x2254('0xb')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2254('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x2254('0x4')],'allowNull':![],'defaultValue':_0x2254('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x2254('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +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 diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 2b3d719..d6d7e49 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 _0x8c59=['attrSerie2','attrSerie3','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','request-promise','moment','mustache','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','destroy','then','error','stack','name','send','show','params','model','keys','filters','intersection','query','attributes','fields','length','include','merge','options','find','catch','iframe','attrUrl','attrs','value','https://','attrPath','clock','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','pie-chart'];(function(_0x527d04,_0x20b7ed){var _0x36ad11=function(_0x56c85e){while(--_0x56c85e){_0x527d04['push'](_0x527d04['shift']());}};_0x36ad11(++_0x20b7ed);}(_0x8c59,0x1c2));var _0x98c5=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8c59[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x98c5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x98c5('0x1'));var moment=require(_0x98c5('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x98c5('0x3'));var util=require('util');var path=require('path');var sox=require(_0x98c5('0x4'));var csv=require('to-csv');var ejs=require(_0x98c5('0x5'));var fs=require('fs');var fs_extra=require(_0x98c5('0x6'));var _=require('lodash');var squel=require(_0x98c5('0x7'));var crypto=require(_0x98c5('0x8'));var jsforce=require(_0x98c5('0x9'));var deskjs=require(_0x98c5('0xa'));var toCsv=require(_0x98c5('0xb'));var querystring=require(_0x98c5('0xc'));var Papa=require(_0x98c5('0xd'));var Redis=require('ioredis');var authService=require(_0x98c5('0xe'));var qs=require(_0x98c5('0xf'));var as=require(_0x98c5('0x10'));var hardwareService=require(_0x98c5('0x11'));var logger=require(_0x98c5('0x12'))(_0x98c5('0x13'));var utils=require(_0x98c5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x98c5('0x15'));var db=require(_0x98c5('0x16'))['db'];config[_0x98c5('0x17')]=_[_0x98c5('0x18')](config['redis'],{'host':_0x98c5('0x19'),'port':0x18eb});var socket=require(_0x98c5('0x1a'))(new Redis(config['redis']));require(_0x98c5('0x1b'))[_0x98c5('0x1c')](socket);function respondWithStatusCode(_0x3d3f19,_0x305e63){_0x305e63=_0x305e63||0xcc;return function(_0x4e5ede){if(_0x4e5ede){return _0x3d3f19[_0x98c5('0x1d')](_0x305e63);}return _0x3d3f19[_0x98c5('0x1e')](_0x305e63)[_0x98c5('0x1f')]();};}function respondWithResult(_0x3d1fde,_0x2d17f3){_0x2d17f3=_0x2d17f3||0xc8;return function(_0x1a9fc9){if(_0x1a9fc9){return _0x3d1fde['status'](_0x2d17f3)[_0x98c5('0x20')](_0x1a9fc9);}};}function respondWithFilteredResult(_0x10ff6d,_0x486bf3){return function(_0x264238){if(_0x264238){var _0x2f071c=typeof _0x486bf3[_0x98c5('0x21')]===_0x98c5('0x22')&&typeof _0x486bf3[_0x98c5('0x23')]==='undefined';var _0x1e57fa=_0x264238['count'];var _0x1a4c00=_0x2f071c?0x0:_0x486bf3[_0x98c5('0x21')];var _0x1b8cdf=_0x2f071c?_0x264238[_0x98c5('0x24')]:_0x486bf3[_0x98c5('0x21')]+_0x486bf3['limit'];var _0x5eaee5;if(_0x1b8cdf>=_0x1e57fa){_0x1b8cdf=_0x1e57fa;_0x5eaee5=0xc8;}else{_0x5eaee5=0xce;}_0x10ff6d[_0x98c5('0x1e')](_0x5eaee5);return _0x10ff6d[_0x98c5('0x25')]('Content-Range',_0x1a4c00+'-'+_0x1b8cdf+'/'+_0x1e57fa)[_0x98c5('0x20')](_0x264238);}return null;};}function patchUpdates(_0x268300){return function(_0x2a29d8){try{jsonpatch[_0x98c5('0x26')](_0x2a29d8,_0x268300,!![]);}catch(_0x340d6d){return BPromise['reject'](_0x340d6d);}return _0x2a29d8[_0x98c5('0x27')]();};}function saveUpdates(_0x2cf6fe,_0x6e1e20){return function(_0x2149b6){if(_0x2149b6){return _0x2149b6[_0x98c5('0x28')](_0x2cf6fe)['then'](function(_0x28a66d){return _0x28a66d;});}return null;};}function removeEntity(_0x520913,_0xea42ec){return function(_0x4c1973){if(_0x4c1973){return _0x4c1973[_0x98c5('0x29')]()[_0x98c5('0x2a')](function(){_0x520913[_0x98c5('0x1e')](0xcc)[_0x98c5('0x1f')]();});}};}function handleEntityNotFound(_0x208742,_0x5cbd2b){return function(_0x3dd37b){if(!_0x3dd37b){_0x208742[_0x98c5('0x1d')](0x194);}return _0x3dd37b;};}function handleError(_0x212d12,_0x47e7a3){_0x47e7a3=_0x47e7a3||0x1f4;return function(_0x191eb7){logger[_0x98c5('0x2b')](_0x191eb7[_0x98c5('0x2c')]);if(_0x191eb7[_0x98c5('0x2d')]){delete _0x191eb7[_0x98c5('0x2d')];}_0x212d12[_0x98c5('0x1e')](_0x47e7a3)[_0x98c5('0x2e')](_0x191eb7);};}exports[_0x98c5('0x2f')]=function(_0x2c882b,_0x548f33){var _0x3e63f3={'raw':![],'where':{'id':_0x2c882b[_0x98c5('0x30')]['id']}},_0x1fc9c6={};_0x1fc9c6[_0x98c5('0x31')]=_[_0x98c5('0x32')](db['DashboardItem']['rawAttributes']);_0x1fc9c6['query']=_[_0x98c5('0x32')](_0x2c882b['query']);_0x1fc9c6[_0x98c5('0x33')]=_[_0x98c5('0x34')](_0x1fc9c6['model'],_0x1fc9c6[_0x98c5('0x35')]);_0x3e63f3[_0x98c5('0x36')]=_[_0x98c5('0x34')](_0x1fc9c6['model'],qs[_0x98c5('0x37')](_0x2c882b[_0x98c5('0x35')]['fields']));_0x3e63f3[_0x98c5('0x36')]=_0x3e63f3[_0x98c5('0x36')][_0x98c5('0x38')]?_0x3e63f3[_0x98c5('0x36')]:_0x1fc9c6[_0x98c5('0x31')];if(_0x2c882b['query']['includeAll']){_0x3e63f3[_0x98c5('0x39')]=[{'all':!![]}];}_0x3e63f3=_[_0x98c5('0x3a')]({},_0x3e63f3,_0x2c882b[_0x98c5('0x3b')]);return db['DashboardItem'][_0x98c5('0x3c')](_0x3e63f3)['then'](handleEntityNotFound(_0x548f33,null))['then'](respondWithResult(_0x548f33,null))[_0x98c5('0x3d')](handleError(_0x548f33,null));};exports['destroy']=function(_0x38253c,_0x24ef71){return db['DashboardItem']['find']({'where':{'id':_0x38253c[_0x98c5('0x30')]['id']}})[_0x98c5('0x2a')](handleEntityNotFound(_0x24ef71,null))['then'](removeEntity(_0x24ef71,null))[_0x98c5('0x3d')](handleError(_0x24ef71,null));};function widgetAttributes(_0x16d1ee){try{switch(_0x16d1ee['type']){case _0x98c5('0x3e'):return[{'name':_0x98c5('0x3f'),'value':_0x16d1ee[_0x98c5('0x3f')]||(_0x16d1ee['attrs']&&_0x16d1ee[_0x98c5('0x40')][0x0]?_0x16d1ee[_0x98c5('0x40')][0x0][_0x98c5('0x41')]:undefined)||_0x98c5('0x42')}];case'custom':return[{'name':_0x98c5('0x43'),'value':_0x16d1ee[_0x98c5('0x43')]||(_0x16d1ee['attrs']&&_0x16d1ee['attrs'][0x0]?_0x16d1ee[_0x98c5('0x40')][0x0][_0x98c5('0x41')]:undefined)||''}];case _0x98c5('0x44'):return[{'name':'attrHourFormat','value':_0x16d1ee['attrHourFormat']||(_0x16d1ee['attrs']&&_0x16d1ee['attrs'][0x0]?_0x16d1ee[_0x98c5('0x40')][0x0][_0x98c5('0x41')]:undefined)||_0x98c5('0x45')},{'name':'attrTimezone','value':_0x16d1ee[_0x98c5('0x46')]||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee['attrs'][0x1]?_0x16d1ee[_0x98c5('0x40')][0x1][_0x98c5('0x41')]:undefined)||_0x98c5('0x47')},{'name':_0x98c5('0x48'),'value':_0x16d1ee['attrFontSize']||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee[_0x98c5('0x40')][0x2]?_0x16d1ee['attrs'][0x2][_0x98c5('0x41')]:undefined)||0xc}];case _0x98c5('0x49'):return[{'name':_0x98c5('0x4a'),'value':_0x16d1ee['attrMetric']||(_0x16d1ee['attrs']&&_0x16d1ee['attrs'][0x0]?_0x16d1ee[_0x98c5('0x40')][0x0]['value']:undefined)||_0x98c5('0x4b')},{'name':_0x98c5('0x4c'),'value':_0x16d1ee[_0x98c5('0x4c')]||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee[_0x98c5('0x40')][0x1]?_0x16d1ee[_0x98c5('0x40')][0x1][_0x98c5('0x41')]:undefined)||[]},{'name':_0x98c5('0x48'),'value':_0x16d1ee[_0x98c5('0x48')]||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee[_0x98c5('0x40')][0x2]?_0x16d1ee[_0x98c5('0x40')][0x2]['value']:undefined)||0x14}];case'multibar-chart':case _0x98c5('0x4d'):return[{'name':'attrSerie1','value':_0x16d1ee['attrSerie1']||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee[_0x98c5('0x40')][0x0]?_0x16d1ee[_0x98c5('0x40')][0x0][_0x98c5('0x41')]:undefined)||'total'},{'name':_0x98c5('0x4e'),'value':_0x16d1ee[_0x98c5('0x4e')]||(_0x16d1ee['attrs']&&_0x16d1ee[_0x98c5('0x40')][0x1]?_0x16d1ee[_0x98c5('0x40')][0x1]['value']:undefined)||null},{'name':_0x98c5('0x4f'),'value':_0x16d1ee[_0x98c5('0x4f')]||(_0x16d1ee['attrs']&&_0x16d1ee[_0x98c5('0x40')][0x2]?_0x16d1ee[_0x98c5('0x40')][0x2]['value']:undefined)||null},{'name':_0x98c5('0x4c'),'value':_0x16d1ee[_0x98c5('0x4c')]||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee[_0x98c5('0x40')][0x3]?_0x16d1ee['attrs'][0x3][_0x98c5('0x41')]:undefined)||[]}];case'web-report':return[{'name':_0x98c5('0x50'),'type':_0x16d1ee[_0x98c5('0x51')]||(_0x16d1ee[_0x98c5('0x40')]&&_0x16d1ee[_0x98c5('0x40')][0x0]?_0x16d1ee['attrs'][0x0][_0x98c5('0x52')]:undefined)||null,'value':_0x16d1ee[_0x98c5('0x50')]||(_0x16d1ee['attrs']&&_0x16d1ee['attrs'][0x0]?_0x16d1ee[_0x98c5('0x40')][0x0][_0x98c5('0x41')]:undefined)||null},{'name':_0x98c5('0x53'),'value':_0x16d1ee[_0x98c5('0x53')]||(_0x16d1ee['attrs']&&_0x16d1ee[_0x98c5('0x40')][0x1]?_0x16d1ee[_0x98c5('0x40')][0x1][_0x98c5('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x44c41f){logger[_0x98c5('0x2b')](_0x98c5('0x54'),JSON[_0x98c5('0x55')](_0x44c41f));return[];}}exports[_0x98c5('0x56')]=function(_0x4bbaf0,_0x22a8e3){if(_0x4bbaf0['body']){_0x4bbaf0[_0x98c5('0x57')][_0x98c5('0x40')]=widgetAttributes(_0x4bbaf0[_0x98c5('0x57')]);}return db['DashboardItem'][_0x98c5('0x56')](_0x4bbaf0[_0x98c5('0x57')],{})['then'](respondWithResult(_0x22a8e3,0xc9))[_0x98c5('0x3d')](handleError(_0x22a8e3,null));};exports[_0x98c5('0x28')]=function(_0x126544,_0x55e407){if(_0x126544[_0x98c5('0x57')]['id']){delete _0x126544['body']['id'];}_0x126544['body'][_0x98c5('0x40')]=widgetAttributes(_0x126544[_0x98c5('0x57')]);return db['DashboardItem']['find']({'where':{'id':_0x126544[_0x98c5('0x30')]['id']}})['then'](handleEntityNotFound(_0x55e407,null))[_0x98c5('0x2a')](saveUpdates(_0x126544[_0x98c5('0x57')],null))[_0x98c5('0x2a')](respondWithResult(_0x55e407,null))[_0x98c5('0x3d')](handleError(_0x55e407,null));}; \ No newline at end of file +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 diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index fb41196..e010970 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 _0xb954=['DashboardItem','setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x148aa9,_0x421ae3){var _0x530a22=function(_0x458499){while(--_0x458499){_0x148aa9['push'](_0x148aa9['shift']());}};_0x530a22(++_0x421ae3);}(_0xb954,0x115));var _0x4b95=function(_0x5ce2e3,_0x3dc503){_0x5ce2e3=_0x5ce2e3-0x0;var _0x3b53ab=_0xb954[_0x5ce2e3];return _0x3b53ab;};'use strict';var EventEmitter=require(_0x4b95('0x0'));var DashboardItem=require(_0x4b95('0x1'))['db'][_0x4b95('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4b95('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4b95('0x4')};function emitEvent(_0x493f4b){return function(_0x26fbd7,_0x2f7c1b,_0x1a4f01){DashboardItemEvents[_0x4b95('0x5')](_0x493f4b+':'+_0x26fbd7['id'],_0x26fbd7);DashboardItemEvents['emit'](_0x493f4b,_0x26fbd7);_0x1a4f01(null);};}for(var e in events){if(events[_0x4b95('0x6')](e)){var event=events[e];DashboardItem[_0x4b95('0x7')](e,emitEvent(event));}}module[_0x4b95('0x8')]=DashboardItemEvents; \ No newline at end of file +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 diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 24e833e..eb0bebb 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 _0x89c2=['define','DashboardItem','dashboard_items','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes'];(function(_0x3b3785,_0x3c29b4){var _0x3afaf1=function(_0x355a8f){while(--_0x355a8f){_0x3b3785['push'](_0x3b3785['shift']());}};_0x3afaf1(++_0x3c29b4);}(_0x89c2,0x184));var _0x289c=function(_0x3209f2,_0x273533){_0x3209f2=_0x3209f2-0x0;var _0x3a691e=_0x89c2[_0x3209f2];return _0x3a691e;};'use strict';var _=require(_0x289c('0x0'));var util=require('util');var logger=require(_0x289c('0x1'))('api');var moment=require(_0x289c('0x2'));var BPromise=require('bluebird');var rp=require(_0x289c('0x3'));var fs=require('fs');var path=require(_0x289c('0x4'));var rimraf=require(_0x289c('0x5'));var config=require(_0x289c('0x6'));var attributes=require(_0x289c('0x7'));module['exports']=function(_0x255a01,_0x4f89c5){return _0x255a01[_0x289c('0x8')](_0x289c('0x9'),attributes,{'tableName':_0x289c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index 4267ddb..bd4cc9c 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 _0xf4b0=['ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring'];(function(_0x333734,_0x412291){var _0x4e91e7=function(_0x272e12){while(--_0x272e12){_0x333734['push'](_0x333734['shift']());}};_0x4e91e7(++_0x412291);}(_0xf4b0,0x194));var _0x0f4b=function(_0x3ccb65,_0x13aeeb){_0x3ccb65=_0x3ccb65-0x0;var _0x273239=_0xf4b0[_0x3ccb65];return _0x273239;};'use strict';var _=require(_0x0f4b('0x0'));var util=require(_0x0f4b('0x1'));var moment=require(_0x0f4b('0x2'));var BPromise=require('bluebird');var rs=require(_0x0f4b('0x3'));var fs=require('fs');var Redis=require(_0x0f4b('0x4'));var db=require(_0x0f4b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0f4b('0x6'))('rpc');var config=require(_0x0f4b('0x7'));var jayson=require(_0x0f4b('0x8'));var client=jayson[_0x0f4b('0x9')][_0x0f4b('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0f4b('0xb')],{'host':_0x0f4b('0xc'),'port':0x18eb});var socket=require(_0x0f4b('0xd'))(new Redis(config['redis']));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x3822c4,_0x728c92,_0x1c4c9b){return new BPromise(function(_0x1c84d6,_0x2b396b){return client[_0x0f4b('0xe')](_0x3822c4,_0x1c4c9b)[_0x0f4b('0xf')](function(_0x51e129){logger[_0x0f4b('0x10')]('DashboardItem,\x20%s,\x20%s',_0x728c92,_0x0f4b('0x11'));logger['debug']('DashboardItem,\x20%s,\x20%s,\x20%s',_0x728c92,'request\x20sent',JSON['stringify'](_0x51e129));if(_0x51e129[_0x0f4b('0x12')]){if(_0x51e129[_0x0f4b('0x12')][_0x0f4b('0x13')]===0x1f4){logger[_0x0f4b('0x12')](_0x0f4b('0x14'),_0x728c92,_0x51e129['error'][_0x0f4b('0x15')]);return _0x2b396b(_0x51e129[_0x0f4b('0x12')]['message']);}logger['error'](_0x0f4b('0x14'),_0x728c92,_0x51e129[_0x0f4b('0x12')][_0x0f4b('0x15')]);return _0x1c84d6(_0x51e129[_0x0f4b('0x12')][_0x0f4b('0x15')]);}else{logger[_0x0f4b('0x10')](_0x0f4b('0x14'),_0x728c92,_0x0f4b('0x11'));_0x1c84d6(_0x51e129[_0x0f4b('0x16')]['message']);}})[_0x0f4b('0x17')](function(_0x2cb550){logger[_0x0f4b('0x12')](_0x0f4b('0x14'),_0x728c92,_0x2cb550);_0x2b396b(_0x2cb550);});});} \ No newline at end of file +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 diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 0a93792..34deceb 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 _0xc1e2=['dashboardItem:','./dashboardItem.events','update','emit','removeListener','length'];(function(_0x4b4340,_0x295fc0){var _0x4cdb42=function(_0x1a7231){while(--_0x1a7231){_0x4b4340['push'](_0x4b4340['shift']());}};_0x4cdb42(++_0x295fc0);}(_0xc1e2,0xd9));var _0x2c1e=function(_0x802c18,_0x422a1a){_0x802c18=_0x802c18-0x0;var _0x32448f=_0xc1e2[_0x802c18];return _0x32448f;};'use strict';var DashboardItemEvents=require(_0x2c1e('0x0'));var events=['save','remove',_0x2c1e('0x1')];function createListener(_0x17b9ee,_0x25179c){return function(_0x58e75e){_0x25179c[_0x2c1e('0x2')](_0x17b9ee,_0x58e75e);};}function removeListener(_0x2911bc,_0x2c8c8a){return function(){DashboardItemEvents[_0x2c1e('0x3')](_0x2911bc,_0x2c8c8a);};}exports['register']=function(_0x1fdf29){for(var _0x1ebd9d=0x0,_0x1017dc=events[_0x2c1e('0x4')];_0x1ebd9d<_0x1017dc;_0x1ebd9d++){var _0xb07e25=events[_0x1ebd9d];var _0x4d66fd=createListener(_0x2c1e('0x5')+_0xb07e25,_0x1fdf29);DashboardItemEvents['on'](_0xb07e25,_0x4d66fd);}}; \ No newline at end of file +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 diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 450bc18..628f8d2 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 _0xd865=['delete','destroy','exports','multer','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','show','isAuthenticated','update'];(function(_0x824f7b,_0x3b8339){var _0xadb7e9=function(_0x556703){while(--_0x556703){_0x824f7b['push'](_0x824f7b['shift']());}};_0xadb7e9(++_0x3b8339);}(_0xd865,0x12e));var _0x5d86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd865[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5d86('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5d86('0x1'));var auth=require(_0x5d86('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x5d86('0x3'));var controller=require(_0x5d86('0x4'));router[_0x5d86('0x5')](_0x5d86('0x6'),auth['isAuthenticated'](),controller[_0x5d86('0x7')]);router['post']('/',auth[_0x5d86('0x8')](),controller['create']);router['put'](_0x5d86('0x6'),auth[_0x5d86('0x8')](),controller[_0x5d86('0x9')]);router[_0x5d86('0xa')](_0x5d86('0x6'),auth[_0x5d86('0x8')](),controller[_0x5d86('0xb')]);module[_0x5d86('0xc')]=router; \ No newline at end of file +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 diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index a70f112..00f9bab 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 _0xe7ff=['ENUM','first','exports','STRING'];(function(_0x2ae8e6,_0xd596a0){var _0x419306=function(_0x17a910){while(--_0x17a910){_0x2ae8e6['push'](_0x2ae8e6['shift']());}};_0x419306(++_0xd596a0);}(_0xe7ff,0x166));var _0xfe7f=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xe7ff[_0x474bc0];return _0x4b24cf;};'use strict';var Sequelize=require('sequelize');module[_0xfe7f('0x0')]={'name':{'type':Sequelize[_0xfe7f('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xfe7f('0x2')]('first','second','third'),'allowNull':![],'defaultValue':_0xfe7f('0x3')},'description':{'type':Sequelize[_0xfe7f('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index f5aeb60..6cec87b 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 _0x072e=['role','Dispositions','UserProfileSection','userProfileId','autoAssociation','create','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','end','error','name','map','Disposition','rawAttributes','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','show','params','keys','find','catch','body','user','get'];(function(_0x18b23c,_0x403314){var _0x21ca9d=function(_0x2b2184){while(--_0x2b2184){_0x18b23c['push'](_0x18b23c['shift']());}};_0x21ca9d(++_0x403314);}(_0x072e,0x1aa));var _0xe072=function(_0x295a97,_0x2879f4){_0x295a97=_0x295a97-0x0;var _0x56333a=_0x072e[_0x295a97];return _0x56333a;};'use strict';var emlformat=require(_0xe072('0x0'));var rimraf=require(_0xe072('0x1'));var zipdir=require(_0xe072('0x2'));var jsonpatch=require(_0xe072('0x3'));var rp=require(_0xe072('0x4'));var moment=require('moment');var BPromise=require(_0xe072('0x5'));var Mustache=require(_0xe072('0x6'));var util=require(_0xe072('0x7'));var path=require('path');var sox=require(_0xe072('0x8'));var csv=require('to-csv');var ejs=require(_0xe072('0x9'));var fs=require('fs');var fs_extra=require(_0xe072('0xa'));var _=require(_0xe072('0xb'));var squel=require(_0xe072('0xc'));var crypto=require(_0xe072('0xd'));var jsforce=require(_0xe072('0xe'));var deskjs=require(_0xe072('0xf'));var toCsv=require(_0xe072('0x10'));var querystring=require(_0xe072('0x11'));var Papa=require(_0xe072('0x12'));var Redis=require(_0xe072('0x13'));var authService=require(_0xe072('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe072('0x15'));var hardwareService=require(_0xe072('0x16'));var logger=require('../../config/logger')(_0xe072('0x17'));var utils=require(_0xe072('0x18'));var config=require(_0xe072('0x19'));var licenseUtil=require(_0xe072('0x1a'));var db=require(_0xe072('0x1b'))['db'];function respondWithStatusCode(_0x532088,_0xb13239){_0xb13239=_0xb13239||0xcc;return function(_0xb034c1){if(_0xb034c1){return _0x532088[_0xe072('0x1c')](_0xb13239);}return _0x532088[_0xe072('0x1d')](_0xb13239)['end']();};}function respondWithResult(_0x81242f,_0x1a8097){_0x1a8097=_0x1a8097||0xc8;return function(_0x440877){if(_0x440877){return _0x81242f[_0xe072('0x1d')](_0x1a8097)['json'](_0x440877);}};}function respondWithFilteredResult(_0xf7ec5e,_0xf272b5){return function(_0x317637){if(_0x317637){var _0x58698e=typeof _0xf272b5['offset']===_0xe072('0x1e')&&typeof _0xf272b5[_0xe072('0x1f')]===_0xe072('0x1e');var _0x499c2d=_0x317637[_0xe072('0x20')];var _0x537c7a=_0x58698e?0x0:_0xf272b5[_0xe072('0x21')];var _0x4f4a21=_0x58698e?_0x317637[_0xe072('0x20')]:_0xf272b5['offset']+_0xf272b5[_0xe072('0x1f')];var _0x515268;if(_0x4f4a21>=_0x499c2d){_0x4f4a21=_0x499c2d;_0x515268=0xc8;}else{_0x515268=0xce;}_0xf7ec5e['status'](_0x515268);return _0xf7ec5e[_0xe072('0x22')](_0xe072('0x23'),_0x537c7a+'-'+_0x4f4a21+'/'+_0x499c2d)[_0xe072('0x24')](_0x317637);}return null;};}function patchUpdates(_0xd1fc04){return function(_0x1dc9d3){try{jsonpatch[_0xe072('0x25')](_0x1dc9d3,_0xd1fc04,!![]);}catch(_0x592f9d){return BPromise[_0xe072('0x26')](_0x592f9d);}return _0x1dc9d3[_0xe072('0x27')]();};}function saveUpdates(_0x5c7842,_0x361c82){return function(_0x24f2e6){if(_0x24f2e6){return _0x24f2e6[_0xe072('0x28')](_0x5c7842)[_0xe072('0x29')](function(_0x22c542){return _0x22c542;});}return null;};}function removeEntity(_0x427431,_0x29960b){return function(_0x1b9bb8){if(_0x1b9bb8){return _0x1b9bb8[_0xe072('0x2a')]()['then'](function(){var _0x5b5f7f=_0x1b9bb8['get']({'plain':!![]});var _0x5221f='Dispositions';return db[_0xe072('0x2b')]['destroy']({'where':{'type':_0x5221f,'resourceId':_0x5b5f7f['id']}})[_0xe072('0x29')](function(){return _0x1b9bb8;});})[_0xe072('0x29')](function(){_0x427431[_0xe072('0x1d')](0xcc)[_0xe072('0x2c')]();});}};}function handleEntityNotFound(_0x190d58,_0x551915){return function(_0x4b33ec){if(!_0x4b33ec){_0x190d58['sendStatus'](0x194);}return _0x4b33ec;};}function handleError(_0x4166c8,_0x44a90c){_0x44a90c=_0x44a90c||0x1f4;return function(_0x1c8234){logger[_0xe072('0x2d')](_0x1c8234['stack']);if(_0x1c8234[_0xe072('0x2e')]){delete _0x1c8234[_0xe072('0x2e')];}_0x4166c8[_0xe072('0x1d')](_0x44a90c)['send'](_0x1c8234);};}exports['index']=function(_0x5c9971,_0x35b3fa){var _0x24ede8={},_0x47c099={},_0x48fce1={'count':0x0,'rows':[]};var _0x4ed2ae=_[_0xe072('0x2f')](db[_0xe072('0x30')][_0xe072('0x31')],function(_0x5ac81c){return{'name':_0x5ac81c['fieldName'],'type':_0x5ac81c['type'][_0xe072('0x32')]};});_0x47c099[_0xe072('0x33')]=_[_0xe072('0x2f')](_0x4ed2ae,_0xe072('0x2e'));_0x47c099[_0xe072('0x34')]=_['keys'](_0x5c9971[_0xe072('0x34')]);_0x47c099[_0xe072('0x35')]=_['intersection'](_0x47c099[_0xe072('0x33')],_0x47c099[_0xe072('0x34')]);_0x24ede8[_0xe072('0x36')]=_[_0xe072('0x37')](_0x47c099[_0xe072('0x33')],qs[_0xe072('0x38')](_0x5c9971[_0xe072('0x34')][_0xe072('0x38')]));_0x24ede8[_0xe072('0x36')]=_0x24ede8[_0xe072('0x36')]['length']?_0x24ede8['attributes']:_0x47c099[_0xe072('0x33')];if(!_0x5c9971[_0xe072('0x34')][_0xe072('0x39')](_0xe072('0x3a'))){_0x24ede8[_0xe072('0x1f')]=qs[_0xe072('0x1f')](_0x5c9971['query'][_0xe072('0x1f')]);_0x24ede8[_0xe072('0x21')]=qs[_0xe072('0x21')](_0x5c9971['query'][_0xe072('0x21')]);}_0x24ede8[_0xe072('0x3b')]=qs[_0xe072('0x3c')](_0x5c9971[_0xe072('0x34')]['sort']);_0x24ede8[_0xe072('0x3d')]=qs[_0xe072('0x35')](_[_0xe072('0x3e')](_0x5c9971[_0xe072('0x34')],_0x47c099[_0xe072('0x35')]),_0x4ed2ae);if(_0x5c9971[_0xe072('0x34')][_0xe072('0x3f')]){_0x24ede8['where']=_[_0xe072('0x40')](_0x24ede8['where'],{'$or':_[_0xe072('0x2f')](_0x4ed2ae,function(_0xa14022){if(_0xa14022[_0xe072('0x41')]!==_0xe072('0x42')){var _0x50bb7c={};_0x50bb7c[_0xa14022[_0xe072('0x2e')]]={'$like':'%'+_0x5c9971['query'][_0xe072('0x3f')]+'%'};return _0x50bb7c;}})});}_0x24ede8=_[_0xe072('0x40')]({},_0x24ede8,_0x5c9971[_0xe072('0x43')]);var _0x386a66={'where':_0x24ede8[_0xe072('0x3d')]};return db[_0xe072('0x30')][_0xe072('0x20')](_0x386a66)['then'](function(_0x2465b5){_0x48fce1[_0xe072('0x20')]=_0x2465b5;if(_0x5c9971[_0xe072('0x34')][_0xe072('0x44')]){_0x24ede8[_0xe072('0x45')]=[{'all':!![]}];}return db[_0xe072('0x30')]['findAll'](_0x24ede8);})[_0xe072('0x29')](function(_0x50213d){_0x48fce1['rows']=_0x50213d;return _0x48fce1;})[_0xe072('0x29')](respondWithFilteredResult(_0x35b3fa,_0x24ede8))['catch'](handleError(_0x35b3fa,null));};exports[_0xe072('0x46')]=function(_0x38bf6f,_0x369c83){var _0xc2f72f={'raw':!![],'where':{'id':_0x38bf6f[_0xe072('0x47')]['id']}},_0x186aad={};_0x186aad[_0xe072('0x33')]=_[_0xe072('0x48')](db[_0xe072('0x30')]['rawAttributes']);_0x186aad[_0xe072('0x34')]=_[_0xe072('0x48')](_0x38bf6f[_0xe072('0x34')]);_0x186aad[_0xe072('0x35')]=_['intersection'](_0x186aad[_0xe072('0x33')],_0x186aad[_0xe072('0x34')]);_0xc2f72f[_0xe072('0x36')]=_[_0xe072('0x37')](_0x186aad[_0xe072('0x33')],qs[_0xe072('0x38')](_0x38bf6f[_0xe072('0x34')][_0xe072('0x38')]));_0xc2f72f[_0xe072('0x36')]=_0xc2f72f['attributes']['length']?_0xc2f72f[_0xe072('0x36')]:_0x186aad['model'];if(_0x38bf6f[_0xe072('0x34')]['includeAll']){_0xc2f72f[_0xe072('0x45')]=[{'all':!![]}];}_0xc2f72f=_['merge']({},_0xc2f72f,_0x38bf6f['options']);return db[_0xe072('0x30')][_0xe072('0x49')](_0xc2f72f)['then'](handleEntityNotFound(_0x369c83,null))[_0xe072('0x29')](respondWithResult(_0x369c83,null))[_0xe072('0x4a')](handleError(_0x369c83,null));};exports['create']=function(_0x36f301,_0x398242){return db[_0xe072('0x30')]['create'](_0x36f301[_0xe072('0x4b')],{})[_0xe072('0x29')](function(_0x58c7a4){var _0x2c6ea7=_0x36f301[_0xe072('0x4c')][_0xe072('0x4d')]({'plain':!![]});if(!_0x2c6ea7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2c6ea7[_0xe072('0x4e')]===_0xe072('0x4c')){var _0x3dadd9=_0x58c7a4[_0xe072('0x4d')]({'plain':!![]});var _0x27b299=_0xe072('0x4f');return db[_0xe072('0x50')][_0xe072('0x49')]({'where':{'name':_0x27b299,'userProfileId':_0x2c6ea7[_0xe072('0x51')]},'raw':!![]})['then'](function(_0x1d6829){if(_0x1d6829&&_0x1d6829[_0xe072('0x52')]===0x0){return db[_0xe072('0x2b')][_0xe072('0x53')]({'name':_0x3dadd9[_0xe072('0x2e')],'resourceId':_0x3dadd9['id'],'type':_0x1d6829[_0xe072('0x2e')],'sectionId':_0x1d6829['id']},{})[_0xe072('0x29')](function(){return _0x58c7a4;});}else{return _0x58c7a4;}})['catch'](function(_0x57addb){logger[_0xe072('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x57addb);throw _0x57addb;});}return _0x58c7a4;})[_0xe072('0x29')](respondWithResult(_0x398242,0xc9))[_0xe072('0x4a')](handleError(_0x398242,null));};exports['update']=function(_0x3a1278,_0xcc54ca){if(_0x3a1278[_0xe072('0x4b')]['id']){delete _0x3a1278[_0xe072('0x4b')]['id'];}return db['Disposition'][_0xe072('0x49')]({'where':{'id':_0x3a1278[_0xe072('0x47')]['id']}})[_0xe072('0x29')](handleEntityNotFound(_0xcc54ca,null))[_0xe072('0x29')](saveUpdates(_0x3a1278[_0xe072('0x4b')],null))[_0xe072('0x29')](respondWithResult(_0xcc54ca,null))[_0xe072('0x4a')](handleError(_0xcc54ca,null));};exports[_0xe072('0x2a')]=function(_0x21c7cf,_0x2e042d){return db['Disposition'][_0xe072('0x49')]({'where':{'id':_0x21c7cf['params']['id']}})[_0xe072('0x29')](handleEntityNotFound(_0x2e042d,null))[_0xe072('0x29')](removeEntity(_0x2e042d,null))[_0xe072('0x4a')](handleError(_0x2e042d,null));}; \ No newline at end of file +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 diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 918e8c9..c7e5ee9 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 _0xab35=['MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','Disposition','tools_dispositions','name','ListId','name_chat','ChatWebsiteId','name_mail'];(function(_0x348e67,_0x377898){var _0xaf05fa=function(_0x1946bb){while(--_0x1946bb){_0x348e67['push'](_0x348e67['shift']());}};_0xaf05fa(++_0x377898);}(_0xab35,0xab));var _0x5ab3=function(_0x1ca890,_0x21d0d3){_0x1ca890=_0x1ca890-0x0;var _0x3f8e01=_0xab35[_0x1ca890];return _0x3f8e01;};'use strict';var _=require(_0x5ab3('0x0'));var util=require(_0x5ab3('0x1'));var logger=require(_0x5ab3('0x2'))(_0x5ab3('0x3'));var moment=require(_0x5ab3('0x4'));var BPromise=require(_0x5ab3('0x5'));var rp=require(_0x5ab3('0x6'));var fs=require('fs');var path=require(_0x5ab3('0x7'));var rimraf=require(_0x5ab3('0x8'));var config=require(_0x5ab3('0x9'));var attributes=require(_0x5ab3('0xa'));module['exports']=function(_0x16f9f0,_0xbc6f29){return _0x16f9f0['define'](_0x5ab3('0xb'),attributes,{'tableName':_0x5ab3('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x5ab3('0xd'),_0x5ab3('0xe')]},{'unique':!![],'name':_0x5ab3('0xf'),'fields':[_0x5ab3('0xd'),_0x5ab3('0x10')]},{'unique':!![],'name':_0x5ab3('0x11'),'fields':[_0x5ab3('0xd'),_0x5ab3('0x12')]},{'unique':!![],'name':_0x5ab3('0x13'),'fields':[_0x5ab3('0xd'),_0x5ab3('0x14')]},{'unique':!![],'name':_0x5ab3('0x15'),'fields':['name',_0x5ab3('0x16')]},{'unique':!![],'name':_0x5ab3('0x17'),'fields':[_0x5ab3('0xd'),_0x5ab3('0x18')]},{'unique':!![],'name':_0x5ab3('0x19'),'fields':[_0x5ab3('0xd'),_0x5ab3('0x1a')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 01e995b..5ca445e 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(_0x15f606,_0x28c52d){var _0x49de47=function(_0x565843){while(--_0x565843){_0x15f606['push'](_0x15f606['shift']());}};_0x49de47(++_0x28c52d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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(_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 diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 0670d9f..6213318 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 _0x917b=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id'];(function(_0x2e613,_0x27f18c){var _0x66c745=function(_0x2d9a01){while(--_0x2d9a01){_0x2e613['push'](_0x2e613['shift']());}};_0x66c745(++_0x27f18c);}(_0x917b,0x1f1));var _0xb917=function(_0x447036,_0x307e00){_0x447036=_0x447036-0x0;var _0x262775=_0x917b[_0x447036];return _0x262775;};'use strict';var multer=require(_0xb917('0x0'));var util=require(_0xb917('0x1'));var path=require(_0xb917('0x2'));var timeout=require(_0xb917('0x3'));var express=require(_0xb917('0x4'));var router=express[_0xb917('0x5')]();var fs_extra=require(_0xb917('0x6'));var auth=require(_0xb917('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xb917('0x8')]('/',auth[_0xb917('0x9')](),controller[_0xb917('0xa')]);router['get']('/:id',auth[_0xb917('0x9')](),controller[_0xb917('0xb')]);router[_0xb917('0xc')]('/',auth['isAuthenticated'](),controller[_0xb917('0xd')]);router[_0xb917('0xe')](_0xb917('0xf'),auth[_0xb917('0x9')](),controller[_0xb917('0x10')]);router[_0xb917('0x11')](_0xb917('0xf'),auth[_0xb917('0x9')](),controller['destroy']);module[_0xb917('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 196c5e3..d976ee7 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 _0x85fe=['sequelize','exports','STRING','yes','localstationid','4800','9600','12000','14400','ENUM','2400','7200','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x151381,_0x97b314){var _0x2afab6=function(_0x4b3941){while(--_0x4b3941){_0x151381['push'](_0x151381['shift']());}};_0x2afab6(++_0x97b314);}(_0x85fe,0x73));var _0xe85f=function(_0x347bcf,_0xac0725){_0x347bcf=_0x347bcf-0x0;var _0x189d83=_0x85fe[_0x347bcf];return _0x189d83;};'use strict';var Sequelize=require(_0xe85f('0x0'));module[_0xe85f('0x1')]={'name':{'type':Sequelize[_0xe85f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe85f('0x2')]},'ecm':{'type':Sequelize['ENUM'](_0xe85f('0x3'),'no'),'defaultValue':_0xe85f('0x3')},'headerinfo':{'type':Sequelize[_0xe85f('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xe85f('0x2')],'unique':_0xe85f('0x4')},'minrate':{'type':Sequelize['ENUM']('2400',_0xe85f('0x5'),'7200',_0xe85f('0x6'),_0xe85f('0x7'),_0xe85f('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0xe85f('0x9')](_0xe85f('0xa'),_0xe85f('0x5'),_0xe85f('0xb'),_0xe85f('0x6'),_0xe85f('0x7'),_0xe85f('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xe85f('0x2')],'defaultValue':'v17,v27,v29'},'gateway':{'type':Sequelize[_0xe85f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xe85f('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xe85f('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xe85f('0x9')](_0xe85f('0xd'),_0xe85f('0xe'),'DADHI',_0xe85f('0xf')),'defaultValue':_0xe85f('0xd')},'key':{'type':Sequelize[_0xe85f('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xe85f('0x10')],'defaultValue':function(){return _0xe85f('0x11');}},'notificationSound':{'type':Sequelize[_0xe85f('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe85f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xe85f('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xe85f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe85f('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe85f('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe85f('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xe85f('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x49fa64){if(!_0x49fa64)this[_0xe85f('0x14')](_0xe85f('0x15'),null);this[_0xe85f('0x14')](_0xe85f('0x16'),_0x49fa64);}}}; \ No newline at end of file +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 diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 6518618..6bf035d 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 _0x9b74=['limit','count','set','Content-Range','reject','save','update','then','get','FaxAccounts','UserProfileResource','sendStatus','name','send','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','Pause','rawAttributes','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','options','removeDispositions','CannedAnswer','getAnswers','removeAnswers','FaxInteraction','addInteraction','omit','ids','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','transaction','FaxApplication','destroy','bulkCreate','priority','getApplications','context','from-voip-provider','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','Set','ecm','gateway','faxdetect','headerinfo','minrate','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','createdAt','TrunkId','ListId','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','CmContact','updatedAt','DESC','attachments','join','root','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','Contacts','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','userFaxAccount:save','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','status','end','offset','undefined'];(function(_0x2f5cd1,_0x2ab583){var _0x464517=function(_0x9651f3){while(--_0x9651f3){_0x2f5cd1['push'](_0x2f5cd1['shift']());}};_0x464517(++_0x2ab583);}(_0x9b74,0x91));var _0x49b7=function(_0x4c19e9,_0x4ecb10){_0x4c19e9=_0x4c19e9-0x0;var _0x4d2a80=_0x9b74[_0x4c19e9];return _0x4d2a80;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49b7('0x0'));var jsonpatch=require(_0x49b7('0x1'));var rp=require('request-promise');var moment=require(_0x49b7('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x49b7('0x3'));var util=require(_0x49b7('0x4'));var path=require(_0x49b7('0x5'));var sox=require(_0x49b7('0x6'));var csv=require(_0x49b7('0x7'));var ejs=require(_0x49b7('0x8'));var fs=require('fs');var fs_extra=require(_0x49b7('0x9'));var _=require('lodash');var squel=require(_0x49b7('0xa'));var crypto=require(_0x49b7('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x49b7('0x7'));var querystring=require('querystring');var Papa=require(_0x49b7('0xc'));var Redis=require(_0x49b7('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x49b7('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x49b7('0xf'));var logger=require('../../config/logger')(_0x49b7('0x10'));var utils=require(_0x49b7('0x11'));var config=require(_0x49b7('0x12'));var licenseUtil=require(_0x49b7('0x13'));var db=require('../../mysqldb')['db'];config[_0x49b7('0x14')]=_[_0x49b7('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x49b7('0x16'))(new Redis(config['redis']));require(_0x49b7('0x17'))[_0x49b7('0x18')](socket);var jayson=require(_0x49b7('0x19'));var client=jayson[_0x49b7('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x49b7('0x1a')][_0x49b7('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x5ddc7d,_0x10899d,_0x5451e3,_0x569010){return new BPromise(function(_0x38c798,_0x20b426){var _0xfc9a1f=_0x569010||client;return _0xfc9a1f['request'](_0x5ddc7d,_0x5451e3)['then'](function(_0x498ca8){logger[_0x49b7('0x1c')](_0x49b7('0x1d'),_0x10899d,'request\x20sent');logger[_0x49b7('0x1e')](_0x49b7('0x1f'),_0x10899d,_0x49b7('0x20'),JSON[_0x49b7('0x21')](_0x498ca8));if(_0x498ca8['error']){if(_0x498ca8['error'][_0x49b7('0x22')]===0x1f4){logger[_0x49b7('0x23')](_0x49b7('0x1d'),_0x10899d,_0x498ca8[_0x49b7('0x23')][_0x49b7('0x24')]);return _0x20b426(_0x498ca8['error'][_0x49b7('0x24')]);}logger[_0x49b7('0x23')]('FaxAccount,\x20%s,\x20%s',_0x10899d,_0x498ca8['error'][_0x49b7('0x24')]);return _0x38c798(_0x498ca8[_0x49b7('0x23')][_0x49b7('0x24')]);}else{logger[_0x49b7('0x1c')](_0x49b7('0x1d'),_0x10899d,_0x49b7('0x20'));_0x38c798(_0x498ca8[_0x49b7('0x25')][_0x49b7('0x24')]);}})[_0x49b7('0x26')](function(_0x278376){logger[_0x49b7('0x23')](_0x49b7('0x1d'),_0x10899d,_0x278376);_0x20b426(_0x278376);});});}function respondWithStatusCode(_0x281ddf,_0x413dc4){_0x413dc4=_0x413dc4||0xcc;return function(_0x464db9){if(_0x464db9){return _0x281ddf['sendStatus'](_0x413dc4);}return _0x281ddf[_0x49b7('0x27')](_0x413dc4)[_0x49b7('0x28')]();};}function respondWithResult(_0x584759,_0x343612){_0x343612=_0x343612||0xc8;return function(_0x3b868b){if(_0x3b868b){return _0x584759['status'](_0x343612)['json'](_0x3b868b);}};}function respondWithFilteredResult(_0x59e164,_0x3bf5c4){return function(_0x32e8db){if(_0x32e8db){var _0x206745=typeof _0x3bf5c4[_0x49b7('0x29')]===_0x49b7('0x2a')&&typeof _0x3bf5c4[_0x49b7('0x2b')]==='undefined';var _0x4ea547=_0x32e8db[_0x49b7('0x2c')];var _0x52e025=_0x206745?0x0:_0x3bf5c4['offset'];var _0x3c851d=_0x206745?_0x32e8db[_0x49b7('0x2c')]:_0x3bf5c4[_0x49b7('0x29')]+_0x3bf5c4['limit'];var _0x320d44;if(_0x3c851d>=_0x4ea547){_0x3c851d=_0x4ea547;_0x320d44=0xc8;}else{_0x320d44=0xce;}_0x59e164[_0x49b7('0x27')](_0x320d44);return _0x59e164[_0x49b7('0x2d')](_0x49b7('0x2e'),_0x52e025+'-'+_0x3c851d+'/'+_0x4ea547)['json'](_0x32e8db);}return null;};}function patchUpdates(_0x22d3a3){return function(_0x4520ba){try{jsonpatch['apply'](_0x4520ba,_0x22d3a3,!![]);}catch(_0x49f57c){return BPromise[_0x49b7('0x2f')](_0x49f57c);}return _0x4520ba[_0x49b7('0x30')]();};}function saveUpdates(_0x6a5265,_0x4edb68){return function(_0x3c16a3){if(_0x3c16a3){return _0x3c16a3[_0x49b7('0x31')](_0x6a5265)[_0x49b7('0x32')](function(_0x57f27e){return _0x57f27e;});}return null;};}function removeEntity(_0x418a6d,_0x229d6b){return function(_0x53f37d){if(_0x53f37d){return _0x53f37d['destroy']()[_0x49b7('0x32')](function(){var _0x2df401=_0x53f37d[_0x49b7('0x33')]({'plain':!![]});var _0x4de914=_0x49b7('0x34');return db[_0x49b7('0x35')]['destroy']({'where':{'type':_0x4de914,'resourceId':_0x2df401['id']}})[_0x49b7('0x32')](function(){return _0x53f37d;});})[_0x49b7('0x32')](function(){_0x418a6d[_0x49b7('0x27')](0xcc)[_0x49b7('0x28')]();});}};}function handleEntityNotFound(_0x59371a,_0x18b6dd){return function(_0x7425cc){if(!_0x7425cc){_0x59371a[_0x49b7('0x36')](0x194);}return _0x7425cc;};}function handleError(_0x355614,_0x5ede02){_0x5ede02=_0x5ede02||0x1f4;return function(_0x450575){logger[_0x49b7('0x23')](_0x450575['stack']);if(_0x450575[_0x49b7('0x37')]){delete _0x450575['name'];}_0x355614['status'](_0x5ede02)[_0x49b7('0x38')](_0x450575);};}exports['index']=function(_0x2a0302,_0x4af438){var _0x380d41={'include':[{'model':db['Pause'],'as':_0x49b7('0x39')}]},_0x4654d8={},_0x3cb673={'count':0x0,'rows':[]};var _0x192983=_[_0x49b7('0x3a')](db[_0x49b7('0x3b')]['rawAttributes'],function(_0xe81618){return{'name':_0xe81618[_0x49b7('0x3c')],'type':_0xe81618[_0x49b7('0x3d')][_0x49b7('0x3e')]};});_0x4654d8[_0x49b7('0x3f')]=_[_0x49b7('0x3a')](_0x192983,_0x49b7('0x37'));_0x4654d8['query']=_[_0x49b7('0x40')](_0x2a0302['query']);_0x4654d8[_0x49b7('0x41')]=_[_0x49b7('0x42')](_0x4654d8[_0x49b7('0x3f')],_0x4654d8[_0x49b7('0x43')]);_0x380d41[_0x49b7('0x44')]=_[_0x49b7('0x42')](_0x4654d8[_0x49b7('0x3f')],qs['fields'](_0x2a0302[_0x49b7('0x43')][_0x49b7('0x45')]));_0x380d41[_0x49b7('0x44')]=_0x380d41[_0x49b7('0x44')][_0x49b7('0x46')]?_0x380d41['attributes']:_0x4654d8[_0x49b7('0x3f')];if(!_0x2a0302[_0x49b7('0x43')][_0x49b7('0x47')](_0x49b7('0x48'))){_0x380d41[_0x49b7('0x2b')]=qs[_0x49b7('0x2b')](_0x2a0302[_0x49b7('0x43')]['limit']);_0x380d41[_0x49b7('0x29')]=qs['offset'](_0x2a0302['query'][_0x49b7('0x29')]);}_0x380d41[_0x49b7('0x49')]=qs['sort'](_0x2a0302[_0x49b7('0x43')][_0x49b7('0x4a')]);_0x380d41[_0x49b7('0x4b')]=qs['filters'](_[_0x49b7('0x4c')](_0x2a0302[_0x49b7('0x43')],_0x4654d8[_0x49b7('0x41')]),_0x192983);if(_0x2a0302['query'][_0x49b7('0x4d')]){_0x380d41[_0x49b7('0x4b')]=_[_0x49b7('0x4e')](_0x380d41[_0x49b7('0x4b')],{'$or':_[_0x49b7('0x3a')](_0x192983,function(_0x4a8285){if(_0x4a8285['type']!=='VIRTUAL'){var _0x421e0f={};_0x421e0f[_0x4a8285[_0x49b7('0x37')]]={'$like':'%'+_0x2a0302[_0x49b7('0x43')][_0x49b7('0x4d')]+'%'};return _0x421e0f;}})});}_0x380d41=_[_0x49b7('0x4e')]({},_0x380d41,_0x2a0302['options']);var _0x66a763={'where':_0x380d41[_0x49b7('0x4b')]};return db['FaxAccount'][_0x49b7('0x2c')](_0x66a763)[_0x49b7('0x32')](function(_0x22de50){_0x3cb673['count']=_0x22de50;if(_0x2a0302[_0x49b7('0x43')][_0x49b7('0x4f')]){_0x380d41[_0x49b7('0x50')]=[{'all':!![]}];}return db[_0x49b7('0x3b')][_0x49b7('0x51')](_0x380d41);})[_0x49b7('0x32')](function(_0xd2187d){_0x3cb673[_0x49b7('0x52')]=_0xd2187d;return _0x3cb673;})['then'](respondWithFilteredResult(_0x4af438,_0x380d41))[_0x49b7('0x26')](handleError(_0x4af438,null));};exports['show']=function(_0x32a345,_0x209aa4){var _0x4df2d8={'raw':![],'where':{'id':_0x32a345[_0x49b7('0x53')]['id']},'include':[{'model':db[_0x49b7('0x54')],'as':_0x49b7('0x39')}]},_0x1e65ea={};_0x1e65ea[_0x49b7('0x3f')]=_[_0x49b7('0x40')](db[_0x49b7('0x3b')][_0x49b7('0x55')]);_0x1e65ea[_0x49b7('0x43')]=_[_0x49b7('0x40')](_0x32a345['query']);_0x1e65ea[_0x49b7('0x41')]=_['intersection'](_0x1e65ea[_0x49b7('0x3f')],_0x1e65ea[_0x49b7('0x43')]);_0x4df2d8[_0x49b7('0x44')]=_[_0x49b7('0x42')](_0x1e65ea[_0x49b7('0x3f')],qs[_0x49b7('0x45')](_0x32a345[_0x49b7('0x43')][_0x49b7('0x45')]));_0x4df2d8['attributes']=_0x4df2d8[_0x49b7('0x44')][_0x49b7('0x46')]?_0x4df2d8[_0x49b7('0x44')]:_0x1e65ea[_0x49b7('0x3f')];if(_0x32a345[_0x49b7('0x43')]['includeAll']){_0x4df2d8['include']=[{'all':!![]}];}_0x4df2d8=_['merge']({},_0x4df2d8,_0x32a345['options']);return db['FaxAccount']['find'](_0x4df2d8)['then'](handleEntityNotFound(_0x209aa4,null))['then'](respondWithResult(_0x209aa4,null))[_0x49b7('0x26')](handleError(_0x209aa4,null));};exports[_0x49b7('0x56')]=function(_0x30ef4e,_0x4291ed){return db[_0x49b7('0x3b')][_0x49b7('0x56')](_0x30ef4e[_0x49b7('0x57')],{})[_0x49b7('0x32')](function(_0x1c6bdd){var _0x5461ad=_0x30ef4e[_0x49b7('0x58')][_0x49b7('0x33')]({'plain':!![]});if(!_0x5461ad)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5461ad['role']===_0x49b7('0x58')){var _0x10c8d1=_0x1c6bdd[_0x49b7('0x33')]({'plain':!![]});var _0x4f96a6=_0x49b7('0x34');return db[_0x49b7('0x59')][_0x49b7('0x5a')]({'where':{'name':_0x4f96a6,'userProfileId':_0x5461ad[_0x49b7('0x5b')]},'raw':!![]})[_0x49b7('0x32')](function(_0x540087){if(_0x540087&&_0x540087[_0x49b7('0x5c')]===0x0){return db[_0x49b7('0x35')][_0x49b7('0x56')]({'name':_0x10c8d1[_0x49b7('0x37')],'resourceId':_0x10c8d1['id'],'type':_0x540087[_0x49b7('0x37')],'sectionId':_0x540087['id']},{})['then'](function(){return _0x1c6bdd;});}else{return _0x1c6bdd;}})[_0x49b7('0x26')](function(_0x248707){logger[_0x49b7('0x23')](_0x49b7('0x5d'),_0x248707);throw _0x248707;});}return _0x1c6bdd;})[_0x49b7('0x32')](respondWithResult(_0x4291ed,0xc9))[_0x49b7('0x26')](handleError(_0x4291ed,null));};exports['update']=function(_0x5b0dee,_0x565259){if(_0x5b0dee[_0x49b7('0x57')]['id']){delete _0x5b0dee[_0x49b7('0x57')]['id'];}return db[_0x49b7('0x3b')]['find']({'where':{'id':_0x5b0dee['params']['id']},'include':[{'model':db['Pause'],'as':_0x49b7('0x39')}]})[_0x49b7('0x32')](handleEntityNotFound(_0x565259,null))[_0x49b7('0x32')](saveUpdates(_0x5b0dee[_0x49b7('0x57')],null))[_0x49b7('0x32')](respondWithResult(_0x565259,null))[_0x49b7('0x26')](handleError(_0x565259,null));};exports['destroy']=function(_0x735848,_0x4bd42b){return db[_0x49b7('0x3b')][_0x49b7('0x5a')]({'where':{'id':_0x735848[_0x49b7('0x53')]['id']}})['then'](handleEntityNotFound(_0x4bd42b,null))[_0x49b7('0x32')](removeEntity(_0x4bd42b,null))[_0x49b7('0x26')](handleError(_0x4bd42b,null));};exports['describe']=function(_0x254c48,_0xc99c27){return db[_0x49b7('0x3b')][_0x49b7('0x5e')]()[_0x49b7('0x32')](respondWithResult(_0xc99c27,null))[_0x49b7('0x26')](handleError(_0xc99c27,null));};exports[_0x49b7('0x5f')]=function(_0x1f7ad3,_0x49adb5,_0x1abf8e){if(_0x1f7ad3[_0x49b7('0x57')]['id']){delete _0x1f7ad3[_0x49b7('0x57')]['id'];}return db[_0x49b7('0x3b')][_0x49b7('0x5a')]({'where':{'id':_0x1f7ad3[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x49adb5,null))['then'](function(_0xb9daf6){if(_0xb9daf6){_0x1f7ad3[_0x49b7('0x57')][_0x49b7('0x60')]=_0xb9daf6['id'];return db[_0x49b7('0x61')]['create'](_0x1f7ad3['body']);}})[_0x49b7('0x32')](respondWithResult(_0x49adb5,null))['catch'](handleError(_0x49adb5,null));};exports['getDispositions']=function(_0x25ee66,_0x13ba30,_0x4f8d32){var _0x29327b={'raw':![],'where':{}};var _0x95e20={};var _0x49cd01={'count':0x0,'rows':[]};return db[_0x49b7('0x3b')][_0x49b7('0x62')]({'where':{'id':_0x25ee66[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x13ba30,null))[_0x49b7('0x32')](function(_0x5f24d5){if(_0x5f24d5){_0x95e20[_0x49b7('0x3f')]=_[_0x49b7('0x40')](db[_0x49b7('0x61')]['rawAttributes']);_0x95e20[_0x49b7('0x43')]=_[_0x49b7('0x40')](_0x25ee66[_0x49b7('0x43')]);_0x95e20[_0x49b7('0x41')]=_[_0x49b7('0x42')](_0x95e20[_0x49b7('0x3f')],_0x95e20[_0x49b7('0x43')]);_0x29327b[_0x49b7('0x44')]=_[_0x49b7('0x42')](_0x95e20[_0x49b7('0x3f')],qs['fields'](_0x25ee66['query']['fields']));_0x29327b[_0x49b7('0x44')]=_0x29327b[_0x49b7('0x44')][_0x49b7('0x46')]?_0x29327b[_0x49b7('0x44')]:_0x95e20[_0x49b7('0x3f')];if(!_0x25ee66['query']['hasOwnProperty'](_0x49b7('0x48'))){_0x29327b[_0x49b7('0x2b')]=qs[_0x49b7('0x2b')](_0x25ee66[_0x49b7('0x43')][_0x49b7('0x2b')]);_0x29327b['offset']=qs[_0x49b7('0x29')](_0x25ee66['query']['offset']);}_0x29327b[_0x49b7('0x49')]=qs[_0x49b7('0x4a')](_0x25ee66[_0x49b7('0x43')][_0x49b7('0x4a')]);_0x29327b[_0x49b7('0x4b')]=qs[_0x49b7('0x41')](_[_0x49b7('0x4c')](_0x25ee66[_0x49b7('0x43')],_0x95e20['filters']));_0x29327b[_0x49b7('0x4b')][_0x49b7('0x60')]=_0x5f24d5['id'];if(_0x25ee66[_0x49b7('0x43')][_0x49b7('0x4d')]){_0x29327b['where']=_[_0x49b7('0x4e')](_0x29327b[_0x49b7('0x4b')],{'$or':_[_0x49b7('0x3a')](_0x29327b[_0x49b7('0x44')],function(_0xd8f3fb){var _0x4fe156={};_0x4fe156[_0xd8f3fb]={'$like':'%'+_0x25ee66['query'][_0x49b7('0x4d')]+'%'};return _0x4fe156;})});}_0x29327b=_['merge']({},_0x29327b,_0x25ee66[_0x49b7('0x63')]);return db[_0x49b7('0x61')]['count']({'where':_0x29327b[_0x49b7('0x4b')]})[_0x49b7('0x32')](function(_0x52cc8a){_0x49cd01[_0x49b7('0x2c')]=_0x52cc8a;if(_0x25ee66['query'][_0x49b7('0x4f')]){_0x29327b[_0x49b7('0x50')]=[{'all':!![]}];}return db[_0x49b7('0x61')][_0x49b7('0x51')](_0x29327b);})[_0x49b7('0x32')](function(_0x327057){_0x49cd01[_0x49b7('0x52')]=_0x327057;return _0x49cd01;});}})[_0x49b7('0x32')](respondWithFilteredResult(_0x13ba30,_0x29327b))[_0x49b7('0x26')](handleError(_0x13ba30,null));};exports['removeDispositions']=function(_0x200e11,_0x42c7c6,_0x845204){return db[_0x49b7('0x3b')]['find']({'where':{'id':_0x200e11['params']['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x42c7c6,null))[_0x49b7('0x32')](function(_0x7c3331){if(_0x7c3331){return _0x7c3331[_0x49b7('0x64')](_0x200e11[_0x49b7('0x43')]['ids']);}})[_0x49b7('0x32')](respondWithStatusCode(_0x42c7c6,null))[_0x49b7('0x26')](handleError(_0x42c7c6,null));};exports['addAnswer']=function(_0x991bd7,_0x5017fd,_0x48156f){if(_0x991bd7[_0x49b7('0x57')]['id']){delete _0x991bd7['body']['id'];}return db[_0x49b7('0x3b')][_0x49b7('0x5a')]({'where':{'id':_0x991bd7[_0x49b7('0x53')]['id']}})['then'](handleEntityNotFound(_0x5017fd,null))[_0x49b7('0x32')](function(_0x554209){if(_0x554209){_0x991bd7[_0x49b7('0x57')][_0x49b7('0x60')]=_0x554209['id'];return db[_0x49b7('0x65')]['create'](_0x991bd7[_0x49b7('0x57')]);}})[_0x49b7('0x32')](respondWithResult(_0x5017fd,null))[_0x49b7('0x26')](handleError(_0x5017fd,null));};exports[_0x49b7('0x66')]=function(_0x1c9c75,_0x32189c,_0x320923){var _0x30074c={'raw':![],'where':{}};var _0x2c5306={};var _0x40dac5={'count':0x0,'rows':[]};return db[_0x49b7('0x3b')][_0x49b7('0x62')]({'where':{'id':_0x1c9c75[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x32189c,null))['then'](function(_0x3eba11){if(_0x3eba11){_0x2c5306[_0x49b7('0x3f')]=_[_0x49b7('0x40')](db[_0x49b7('0x65')][_0x49b7('0x55')]);_0x2c5306[_0x49b7('0x43')]=_[_0x49b7('0x40')](_0x1c9c75[_0x49b7('0x43')]);_0x2c5306[_0x49b7('0x41')]=_[_0x49b7('0x42')](_0x2c5306[_0x49b7('0x3f')],_0x2c5306['query']);_0x30074c[_0x49b7('0x44')]=_[_0x49b7('0x42')](_0x2c5306[_0x49b7('0x3f')],qs[_0x49b7('0x45')](_0x1c9c75[_0x49b7('0x43')][_0x49b7('0x45')]));_0x30074c[_0x49b7('0x44')]=_0x30074c['attributes'][_0x49b7('0x46')]?_0x30074c[_0x49b7('0x44')]:_0x2c5306[_0x49b7('0x3f')];if(!_0x1c9c75[_0x49b7('0x43')][_0x49b7('0x47')](_0x49b7('0x48'))){_0x30074c[_0x49b7('0x2b')]=qs[_0x49b7('0x2b')](_0x1c9c75[_0x49b7('0x43')]['limit']);_0x30074c[_0x49b7('0x29')]=qs[_0x49b7('0x29')](_0x1c9c75[_0x49b7('0x43')]['offset']);}_0x30074c[_0x49b7('0x49')]=qs[_0x49b7('0x4a')](_0x1c9c75[_0x49b7('0x43')][_0x49b7('0x4a')]);_0x30074c['where']=qs[_0x49b7('0x41')](_[_0x49b7('0x4c')](_0x1c9c75[_0x49b7('0x43')],_0x2c5306[_0x49b7('0x41')]));_0x30074c[_0x49b7('0x4b')][_0x49b7('0x60')]=_0x3eba11['id'];if(_0x1c9c75[_0x49b7('0x43')][_0x49b7('0x4d')]){_0x30074c['where']=_['merge'](_0x30074c['where'],{'$or':_[_0x49b7('0x3a')](_0x30074c[_0x49b7('0x44')],function(_0xedae79){var _0x5093ee={};_0x5093ee[_0xedae79]={'$like':'%'+_0x1c9c75[_0x49b7('0x43')]['filter']+'%'};return _0x5093ee;})});}_0x30074c=_[_0x49b7('0x4e')]({},_0x30074c,_0x1c9c75[_0x49b7('0x63')]);return db[_0x49b7('0x65')][_0x49b7('0x2c')]({'where':_0x30074c[_0x49b7('0x4b')]})[_0x49b7('0x32')](function(_0x86ca2e){_0x40dac5[_0x49b7('0x2c')]=_0x86ca2e;if(_0x1c9c75[_0x49b7('0x43')][_0x49b7('0x4f')]){_0x30074c[_0x49b7('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x49b7('0x51')](_0x30074c);})[_0x49b7('0x32')](function(_0x4c7dbb){_0x40dac5[_0x49b7('0x52')]=_0x4c7dbb;return _0x40dac5;});}})[_0x49b7('0x32')](respondWithFilteredResult(_0x32189c,_0x30074c))[_0x49b7('0x26')](handleError(_0x32189c,null));};exports[_0x49b7('0x67')]=function(_0x5ed5a1,_0x5d6e67,_0x1a73e3){return db[_0x49b7('0x3b')][_0x49b7('0x5a')]({'where':{'id':_0x5ed5a1[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x5d6e67,null))['then'](function(_0x3077a2){if(_0x3077a2){return _0x3077a2['removeAnswers'](_0x5ed5a1[_0x49b7('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x5d6e67,null))[_0x49b7('0x26')](handleError(_0x5d6e67,null));};exports['addInteraction']=function(_0x94de56,_0x36d4ab,_0xaaa08d){return db[_0x49b7('0x68')][_0x49b7('0x5a')]({'where':{'id':_0x94de56[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x36d4ab,null))[_0x49b7('0x32')](function(_0x375346){if(_0x375346){return _0x375346[_0x49b7('0x69')](_0x94de56[_0x49b7('0x57')]['ids'],_[_0x49b7('0x6a')](_0x94de56[_0x49b7('0x57')],[_0x49b7('0x6b'),'id'])||{});}})[_0x49b7('0x32')](respondWithResult(_0x36d4ab,null))[_0x49b7('0x26')](handleError(_0x36d4ab,null));};exports[_0x49b7('0x6c')]=function(_0x356105,_0x178991,_0x380d4d){var _0x9bea43={'raw':![],'where':{}};var _0x16a268={};var _0x4977fd={'count':0x0,'rows':[]};return db[_0x49b7('0x3b')][_0x49b7('0x62')]({'where':{'id':_0x356105[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x178991,null))[_0x49b7('0x32')](function(_0x17ff3c){if(_0x17ff3c){_0x16a268[_0x49b7('0x3f')]=_[_0x49b7('0x40')](db[_0x49b7('0x68')][_0x49b7('0x55')]);_0x16a268['query']=_[_0x49b7('0x40')](_0x356105[_0x49b7('0x43')]);_0x16a268[_0x49b7('0x41')]=_[_0x49b7('0x42')](_0x16a268[_0x49b7('0x3f')],_0x16a268[_0x49b7('0x43')]);_0x9bea43['attributes']=_[_0x49b7('0x42')](_0x16a268[_0x49b7('0x3f')],qs[_0x49b7('0x45')](_0x356105[_0x49b7('0x43')]['fields']));_0x9bea43['attributes']=_0x9bea43[_0x49b7('0x44')][_0x49b7('0x46')]?_0x9bea43[_0x49b7('0x44')]:_0x16a268[_0x49b7('0x3f')];if(!_0x356105[_0x49b7('0x43')][_0x49b7('0x47')](_0x49b7('0x48'))){_0x9bea43[_0x49b7('0x2b')]=qs['limit'](_0x356105['query']['limit']);_0x9bea43[_0x49b7('0x29')]=qs['offset'](_0x356105['query']['offset']);}_0x9bea43[_0x49b7('0x49')]=qs[_0x49b7('0x4a')](_0x356105['query'][_0x49b7('0x4a')]);_0x9bea43['where']=qs[_0x49b7('0x41')](_[_0x49b7('0x4c')](_0x356105['query'],_0x16a268[_0x49b7('0x41')]));_0x9bea43[_0x49b7('0x4b')][_0x49b7('0x60')]=_0x17ff3c['id'];if(_0x356105[_0x49b7('0x43')]['filter']){_0x9bea43[_0x49b7('0x4b')]=_[_0x49b7('0x4e')](_0x9bea43[_0x49b7('0x4b')],{'$or':_[_0x49b7('0x3a')](_0x9bea43['attributes'],function(_0x2732db){var _0x4a7a0d={};_0x4a7a0d[_0x2732db]={'$like':'%'+_0x356105['query']['filter']+'%'};return _0x4a7a0d;})});}_0x9bea43=_['merge']({},_0x9bea43,_0x356105[_0x49b7('0x63')]);return db['FaxInteraction']['count']({'where':_0x9bea43[_0x49b7('0x4b')]})[_0x49b7('0x32')](function(_0x495730){_0x4977fd[_0x49b7('0x2c')]=_0x495730;if(_0x356105['query']['includeAll']){_0x9bea43[_0x49b7('0x50')]=[{'model':db['CmContact'],'as':_0x49b7('0x6d'),'required':![]},{'model':db['User'],'as':_0x49b7('0x6e'),'attributes':[_0x49b7('0x37'),_0x49b7('0x6f'),_0x49b7('0x70')],'required':![]},{'model':db[_0x49b7('0x71')],'as':_0x49b7('0x72'),'attributes':['id','name',_0x49b7('0x73')],'where':_0x356105[_0x49b7('0x43')][_0x49b7('0x74')]?{'id':_0x356105[_0x49b7('0x43')][_0x49b7('0x74')]}:undefined,'required':_0x356105[_0x49b7('0x43')][_0x49b7('0x74')]?!![]:![]}];}return db['FaxInteraction'][_0x49b7('0x51')](_0x9bea43);})[_0x49b7('0x32')](function(_0x325fe7){_0x4977fd[_0x49b7('0x52')]=_0x325fe7;return _0x4977fd;});}})[_0x49b7('0x32')](respondWithFilteredResult(_0x178991,_0x9bea43))[_0x49b7('0x26')](handleError(_0x178991,null));};exports['addApplications']=function(_0x459a11,_0x1a8750,_0xff8213){return db[_0x49b7('0x3b')]['findOne']({'where':{'id':_0x459a11[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x1a8750,null))[_0x49b7('0x32')](function(_0x48b263){if(_0x48b263){return db[_0x49b7('0x75')][_0x49b7('0x76')](function(_0xf38316){return db[_0x49b7('0x77')][_0x49b7('0x78')]({'where':{'FaxAccountId':_0x459a11[_0x49b7('0x53')]['id']},'transaction':_0xf38316})[_0x49b7('0x32')](function(_0x315a62){var _0xe2b424=_[_0x49b7('0x3a')](_0x459a11[_0x49b7('0x57')],function(_0x4c7af0){_0x4c7af0[_0x49b7('0x60')]=_0x459a11[_0x49b7('0x53')]['id'];return _0x4c7af0;});return db['FaxApplication'][_0x49b7('0x79')](_0xe2b424,{'transaction':_0xf38316});});})[_0x49b7('0x32')](function(){return db[_0x49b7('0x77')]['findAndCountAll']({'where':{'FaxAccountId':_0x459a11[_0x49b7('0x53')]['id']},'order':_0x49b7('0x7a')});});}})[_0x49b7('0x32')](respondWithResult(_0x1a8750,null))[_0x49b7('0x26')](handleError(_0x1a8750,null));};exports[_0x49b7('0x7b')]=function(_0x17f12f,_0x368b1b,_0x52d624){var _0x2159ac={};var _0x5c4687={};var _0x2f531c;var _0x1abae5;return db['FaxAccount'][_0x49b7('0x62')]({'where':{'id':_0x17f12f[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x368b1b,null))[_0x49b7('0x32')](function(_0x1a6a69){if(_0x1a6a69){_0x2f531c=_0x1a6a69;_0x5c4687[_0x49b7('0x3f')]=_[_0x49b7('0x40')](db[_0x49b7('0x77')][_0x49b7('0x55')]);_0x5c4687[_0x49b7('0x43')]=_[_0x49b7('0x40')](_0x17f12f[_0x49b7('0x43')]);_0x5c4687[_0x49b7('0x41')]=_[_0x49b7('0x42')](_0x5c4687[_0x49b7('0x3f')],_0x5c4687[_0x49b7('0x43')]);_0x2159ac[_0x49b7('0x44')]=_[_0x49b7('0x42')](_0x5c4687['model'],qs['fields'](_0x17f12f[_0x49b7('0x43')][_0x49b7('0x45')]));_0x2159ac['attributes']=_0x2159ac[_0x49b7('0x44')][_0x49b7('0x46')]?_0x2159ac[_0x49b7('0x44')]:_0x5c4687[_0x49b7('0x3f')];_0x2159ac[_0x49b7('0x49')]=qs[_0x49b7('0x4a')](_0x17f12f[_0x49b7('0x43')][_0x49b7('0x4a')]);_0x2159ac[_0x49b7('0x4b')]=qs[_0x49b7('0x41')](_[_0x49b7('0x4c')](_0x17f12f[_0x49b7('0x43')],_0x5c4687[_0x49b7('0x41')]));if(_0x17f12f[_0x49b7('0x43')][_0x49b7('0x4d')]){_0x2159ac[_0x49b7('0x4b')]=_[_0x49b7('0x4e')](_0x2159ac[_0x49b7('0x4b')],{'$or':_['map'](_0x2159ac[_0x49b7('0x44')],function(_0x2c3225){var _0x5e654e={};_0x5e654e[_0x2c3225]={'$like':'%'+_0x17f12f[_0x49b7('0x43')]['filter']+'%'};return _0x5e654e;})});}_0x2159ac=_[_0x49b7('0x4e')]({},_0x2159ac,_0x17f12f['options']);return _0x2f531c[_0x49b7('0x7b')](_0x2159ac);}})[_0x49b7('0x32')](function(_0x264420){if(_0x264420){_0x1abae5=_0x264420[_0x49b7('0x46')];if(!_0x17f12f[_0x49b7('0x43')]['hasOwnProperty'](_0x49b7('0x48'))){_0x2159ac[_0x49b7('0x2b')]=qs['limit'](_0x17f12f[_0x49b7('0x43')][_0x49b7('0x2b')]);_0x2159ac[_0x49b7('0x29')]=qs['offset'](_0x17f12f['query']['offset']);}return _0x2f531c[_0x49b7('0x7b')](_0x2159ac);}})[_0x49b7('0x32')](function(_0x380107){if(_0x380107){return _0x380107?{'count':_0x1abae5,'rows':_0x380107}:null;}})[_0x49b7('0x32')](respondWithResult(_0x368b1b,null))['catch'](handleError(_0x368b1b,null));};function Extension(_0x116946,_0x5bd792,_0x574c84,_0x453749){this[_0x49b7('0x7c')]=_0x49b7('0x7d');this[_0x49b7('0x7e')]=_0x116946[_0x49b7('0x7f')];this[_0x49b7('0x80')]=_0x453749;this['type']=_0x49b7('0x81');this[_0x49b7('0x82')]=_0x49b7('0x83');this[_0x49b7('0x60')]=_0x116946['id'];this[_0x49b7('0x7a')]=_0x5bd792;this[_0x49b7('0x84')]=_0x574c84;}function createExtensionsReciveFax(_0x1e042f){var _0x1f5173=0x1;var _0x570189=[];_0x570189[_0x49b7('0x85')](new Extension(_0x1e042f,_0x1f5173,'',_0x49b7('0x86')));_0x1f5173+=0x1;_0x570189[_0x49b7('0x85')](new Extension(_0x1e042f,_0x1f5173,'CDR(type)=inbound-fax',_0x49b7('0x87')));_0x1f5173+=0x1;for(var _0x89a9dc in _0x1e042f){if(_0x1e042f[_0x49b7('0x47')](_0x89a9dc)&&(_0x89a9dc===_0x49b7('0x88')||_0x89a9dc===_0x49b7('0x7f')||_0x89a9dc===_0x49b7('0x89')||_0x89a9dc===_0x49b7('0x8a')||_0x89a9dc===_0x49b7('0x8b')||_0x89a9dc==='maxrate'||_0x89a9dc===_0x49b7('0x8c')||_0x89a9dc==='modem'||_0x89a9dc===_0x49b7('0x8d'))){_0x570189['push'](new Extension(_0x1e042f,_0x1f5173,_0x49b7('0x8e')+_0x89a9dc+')='+_0x1e042f[_0x89a9dc],'Set'));_0x1f5173+=0x1;}}_0x570189['push'](new Extension(_0x1e042f,_0x1f5173,'6','Wait'));_0x1f5173+=0x1;_0x570189[_0x49b7('0x85')](new Extension(_0x1e042f,_0x1f5173,_0x49b7('0x8f'),_0x49b7('0x90')));_0x1f5173=0x0;return _0x570189;}exports[_0x49b7('0x91')]=function(_0x23b17b,_0x226d8f,_0xa6f82b){var _0x21b960;return db[_0x49b7('0x75')][_0x49b7('0x76')](function(_0x528d8e){return db[_0x49b7('0x3b')][_0x49b7('0x56')](_0x23b17b[_0x49b7('0x57')],{'transaction':_0x528d8e})[_0x49b7('0x32')](function(_0xe8382a){_0x21b960=_0xe8382a[_0x49b7('0x33')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x21b960),{'transaction':_0x528d8e});});})[_0x49b7('0x32')](function(){return _0x21b960;})[_0x49b7('0x32')](respondWithResult(_0x226d8f,null))[_0x49b7('0x26')](handleError(_0x226d8f,null));};exports[_0x49b7('0x92')]=function(_0x56f110,_0x1a19fb,_0x53b971){var _0x5d73c1;return db[_0x49b7('0x75')]['transaction'](function(_0x1f2516){return db[_0x49b7('0x3b')][_0x49b7('0x31')](_0x56f110['body'],{'where':{'id':_0x56f110[_0x49b7('0x57')]['id']},'transaction':_0x1f2516})[_0x49b7('0x32')](function(_0x44bddd){return db['VoiceExtension']['destroy']({'where':{'FaxAccountId':_0x56f110[_0x49b7('0x57')]['id']},'transaction':_0x1f2516})['then'](function(_0x38e078){return db[_0x49b7('0x93')][_0x49b7('0x79')](createExtensionsReciveFax(_[_0x49b7('0x6a')](_0x56f110[_0x49b7('0x57')],['tech',_0x49b7('0x3e'),_0x49b7('0x94'),'updatedAt',_0x49b7('0x95'),_0x49b7('0x96')])),{'transaction':_0x1f2516});});});})[_0x49b7('0x32')](function(){return db['FaxAccount'][_0x49b7('0x97')](_0x56f110['body']['id']);})[_0x49b7('0x32')](respondWithResult(_0x1a19fb,null))[_0x49b7('0x26')](handleError(_0x1a19fb,null));};exports['getMessages']=function(_0x302d86,_0x23417d,_0x5011a0){var _0x3c24d1={'raw':!![],'where':{}};var _0x4d7c49={};var _0x450afb={'count':0x0,'rows':[]};return db['FaxAccount'][_0x49b7('0x62')]({'where':{'id':_0x302d86[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x23417d,null))[_0x49b7('0x32')](function(_0x4dee41){if(_0x4dee41){_0x4d7c49[_0x49b7('0x3f')]=_['keys'](db['FaxMessage'][_0x49b7('0x55')]);_0x4d7c49[_0x49b7('0x43')]=_[_0x49b7('0x40')](_0x302d86[_0x49b7('0x43')]);_0x4d7c49['filters']=_['intersection'](_0x4d7c49[_0x49b7('0x3f')],_0x4d7c49[_0x49b7('0x43')]);_0x3c24d1[_0x49b7('0x44')]=_[_0x49b7('0x42')](_0x4d7c49[_0x49b7('0x3f')],qs['fields'](_0x302d86[_0x49b7('0x43')][_0x49b7('0x45')]));_0x3c24d1[_0x49b7('0x44')]=_0x3c24d1[_0x49b7('0x44')]['length']?_0x3c24d1[_0x49b7('0x44')]:_0x4d7c49['model'];if(!_0x302d86[_0x49b7('0x43')]['hasOwnProperty'](_0x49b7('0x48'))){_0x3c24d1['limit']=qs[_0x49b7('0x2b')](_0x302d86[_0x49b7('0x43')][_0x49b7('0x2b')]);_0x3c24d1[_0x49b7('0x29')]=qs[_0x49b7('0x29')](_0x302d86[_0x49b7('0x43')][_0x49b7('0x29')]);}_0x3c24d1[_0x49b7('0x49')]=qs[_0x49b7('0x4a')](_0x302d86[_0x49b7('0x43')]['sort']);_0x3c24d1['where']=qs[_0x49b7('0x41')](_[_0x49b7('0x4c')](_0x302d86[_0x49b7('0x43')],_0x4d7c49[_0x49b7('0x41')]));_0x3c24d1[_0x49b7('0x4b')][_0x49b7('0x60')]=_0x4dee41['id'];if(_0x302d86['query']['filter']){_0x3c24d1['where']=_[_0x49b7('0x4e')](_0x3c24d1['where'],{'$or':_['map'](_0x3c24d1['attributes'],function(_0x43b12e){var _0x4f8223={};_0x4f8223[_0x43b12e]={'$like':'%'+_0x302d86[_0x49b7('0x43')][_0x49b7('0x4d')]+'%'};return _0x4f8223;})});}if(_0x302d86[_0x49b7('0x43')][_0x49b7('0x98')]){var _0x5047de=_0x302d86[_0x49b7('0x43')][_0x49b7('0x98')][_0x49b7('0x99')](',');var _0x5cfdb0={};_0x5cfdb0[_0x5047de[0x0]]={'$gte':moment(_0x5047de[0x1])[_0x49b7('0x9a')](_0x49b7('0x9b'))};_0x3c24d1[_0x49b7('0x4b')]=_[_0x49b7('0x4e')](_0x3c24d1[_0x49b7('0x4b')],_0x5cfdb0);}_0x3c24d1=_['merge']({},_0x3c24d1,_0x302d86[_0x49b7('0x63')]);return db[_0x49b7('0x9c')][_0x49b7('0x2c')]({'where':_0x3c24d1[_0x49b7('0x4b')]})[_0x49b7('0x32')](function(_0x259033){_0x450afb[_0x49b7('0x2c')]=_0x259033;if(_0x302d86[_0x49b7('0x43')][_0x49b7('0x4f')]){_0x3c24d1[_0x49b7('0x50')]=[{'all':!![]}];}return db[_0x49b7('0x9c')]['findAll'](_0x3c24d1);})[_0x49b7('0x32')](function(_0x5a6f74){_0x450afb[_0x49b7('0x52')]=_0x5a6f74;return _0x450afb;});}})[_0x49b7('0x32')](respondWithFilteredResult(_0x23417d,_0x3c24d1))[_0x49b7('0x26')](handleError(_0x23417d,null));};exports[_0x49b7('0x38')]=function(_0x5c0541,_0x3d542c,_0x4555b1){var _0x2067df,_0x19bb48={},_0x4554ea;if(_0x5c0541['body']['to']){_0x4554ea=_0x5c0541[_0x49b7('0x57')]['to'][0x0];}return db[_0x49b7('0x3b')]['find']({'where':{'id':_0x5c0541[_0x49b7('0x53')]['id']},'include':[{'model':db[_0x49b7('0x9d')],'as':'List','include':[{'model':db[_0x49b7('0x9e')],'as':'Contacts','where':{'fax':_0x4554ea},'limit':0x1,'order':[[_0x49b7('0x9f'),_0x49b7('0xa0')]]}]}]})[_0x49b7('0x32')](handleEntityNotFound(_0x3d542c,null))[_0x49b7('0x32')](function(_0x31be13){_0x2067df=_0x31be13;if(_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')]&&_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')]['length']){for(var _0x4107ae=0x0;_0x4107ae<_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][_0x49b7('0x46')];_0x4107ae+=0x1){_0x5c0541['body'][_0x49b7('0xa1')][_0x4107ae]={'filename':_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][_0x4107ae][_0x49b7('0x37')],'id':_0x5c0541[_0x49b7('0x57')]['attachments'][_0x4107ae]['id'],'path':path[_0x49b7('0xa2')](config[_0x49b7('0xa3')],'server/files/attachments',_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][_0x4107ae]['basename'])};}}return respondWithRpcPromise(_0x49b7('0xa4'),_0x49b7('0xa4'),{'FaxAccountId':_[_0x49b7('0xa5')](_0x5c0541['params']['id'])?undefined:_0x5c0541[_0x49b7('0x53')]['id'],'path':_[_0x49b7('0xa5')](_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][0x0]['path'])?undefined:_0x5c0541['body'][_0x49b7('0xa1')][0x0][_0x49b7('0x5')],'fax':_[_0x49b7('0xa5')](_0x5c0541['body']['to'][0x0])?undefined:_0x5c0541[_0x49b7('0x57')]['to'][0x0]},client9002);})[_0x49b7('0x32')](function(){if(_0x2067df){if(_[_0x49b7('0xa5')](_0x5c0541[_0x49b7('0x57')]['from'])){_0x5c0541['body'][_0x49b7('0xa6')]=util[_0x49b7('0x9a')](_0x49b7('0xa7'),_0x2067df[_0x49b7('0x37')],_0x2067df[_0x49b7('0xa8')]);}if(_0x2067df[_0x49b7('0xa9')]){if(_0x2067df[_0x49b7('0xa9')][_0x49b7('0xaa')][_0x49b7('0x46')]){return _0x2067df[_0x49b7('0xa9')][_0x49b7('0xaa')][0x0];}else{return db[_0x49b7('0x9e')][_0x49b7('0x56')](_['defaults'](_0x5c0541['body'],{'firstName':_0x5c0541[_0x49b7('0x57')]['to'][0x0],'phone':_0x5c0541[_0x49b7('0x57')]['to'][0x0],'fax':_0x5c0541[_0x49b7('0x57')]['to'][0x0],'ListId':_0x2067df['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x49b7('0xab'));}})[_0x49b7('0x32')](function(_0x33b864){if(_0x33b864){return db[_0x49b7('0x68')]['find']({'where':{'ContactId':_0x33b864['id'],'closed':![],'FaxAccountId':_0x2067df['id']}})[_0x49b7('0x32')](function(_0x5c6644){if(_0x5c6644){return[_0x5c6644,![]];}return db['FaxInteraction'][_0x49b7('0x56')]({'UserId':_0x5c0541[_0x49b7('0x58')]['id'],'ContactId':_0x33b864['id'],'FaxAccountId':_0x2067df['id'],'fax':_0x5c0541[_0x49b7('0x57')]['to'][0x0],'firstMsgDirection':_0x49b7('0xac'),'Messages':[_[_0x49b7('0x4e')](_0x5c0541['body'],{'read':![],'body':_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][0x0][_0x49b7('0xad')],'FaxAccountId':_0x2067df['id'],'UserId':_0x5c0541[_0x49b7('0x58')]['id'],'ContactId':_0x33b864['id'],'AttachmentId':_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][0x0]['id']})]},{'include':[{'model':db[_0x49b7('0x9c')],'as':_0x49b7('0xae')}]})[_0x49b7('0x32')](function(_0x1f609f){return[_0x1f609f,!![]];});});}else{throw new Error(_0x49b7('0xaf'));}})[_0x49b7('0xb0')](function(_0x301198,_0x5e567e){if(_0x5e567e){return _0x301198;}return db[_0x49b7('0x9c')]['create']({'direction':_0x49b7('0xac'),'read':![],'body':_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][0x0][_0x49b7('0xad')],'FaxAccountId':_0x2067df['id'],'FaxInteractionId':_0x301198['id'],'UserId':_0x5c0541[_0x49b7('0x58')]['id'],'ContactId':_0x301198['ContactId'],'AttachmentId':_0x5c0541['body'][_0x49b7('0xa1')][0x0]['id']})[_0x49b7('0x32')](function(_0x3737c1){_0x301198[_0x49b7('0xb1')][_0x49b7('0xae')]=[];_0x301198['dataValues'][_0x49b7('0xae')][_0x49b7('0x85')](_0x3737c1[_0x49b7('0xb1')]);return _0x301198;});})['then'](function(_0x2cf9c9){respondWithRpcPromise(_0x49b7('0xb2'),_0x49b7('0xb2'),{'FaxAccountId':_[_0x49b7('0xa5')](_0x5c0541[_0x49b7('0x53')]['id'])?undefined:_0x5c0541['params']['id'],'path':_[_0x49b7('0xa5')](_0x5c0541[_0x49b7('0x57')]['attachments'][0x0]['path'])?undefined:_0x5c0541[_0x49b7('0x57')][_0x49b7('0xa1')][0x0]['path'],'fax':_[_0x49b7('0xa5')](_0x5c0541['body']['to'][0x0])?undefined:_0x5c0541[_0x49b7('0x57')]['to'][0x0],'AttachmentId':_0x5c0541['body'][_0x49b7('0xa1')][0x0]['id']},client9002)[_0x49b7('0x32')](function(_0x3e5cb7){logger[_0x49b7('0x1c')](_0x49b7('0xb3'),_0x3e5cb7);})['catch'](function(_0x18dbf6){logger['info'](_0x49b7('0xb3'),_0x18dbf6);});return _0x2cf9c9;})[_0x49b7('0x32')](respondWithResult(_0x3d542c,null))[_0x49b7('0x26')](handleError(_0x3d542c,null));};exports[_0x49b7('0xb4')]=function(_0x4f7670,_0x2e4c7f,_0x45153f){return db[_0x49b7('0x3b')]['find']({'where':{'id':_0x4f7670[_0x49b7('0x53')]['id']}})['then'](handleEntityNotFound(_0x2e4c7f,null))['then'](function(_0xc55aae){if(_0xc55aae){return _0xc55aae[_0x49b7('0xb4')](_0x4f7670[_0x49b7('0x57')]['ids'],_['omit'](_0x4f7670[_0x49b7('0x57')],['ids','id'])||{})[_0x49b7('0xb0')](function(_0x10cee0){for(var _0x417e54=0x0;_0x417e54<_0x4f7670[_0x49b7('0x57')]['ids'][_0x49b7('0x46')];_0x417e54+=0x1){socket['emit'](_0x49b7('0xb5'),{'UserId':Number(_0x4f7670['body'][_0x49b7('0x6b')][_0x417e54]),'FaxAccountId':Number(_0x4f7670[_0x49b7('0x53')]['id'])});}return _0x10cee0;});}})[_0x49b7('0x32')](respondWithResult(_0x2e4c7f,null))[_0x49b7('0x26')](handleError(_0x2e4c7f,null));};exports[_0x49b7('0xb6')]=function(_0x43a3cb,_0xc886d9,_0x1ff8ad){return db[_0x49b7('0x3b')][_0x49b7('0x5a')]({'where':{'id':_0x43a3cb[_0x49b7('0x53')]['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0xc886d9,null))[_0x49b7('0x32')](function(_0x18b7f0){if(_0x18b7f0){return _0x18b7f0[_0x49b7('0xb6')](_0x43a3cb[_0x49b7('0x43')][_0x49b7('0x6b')])[_0x49b7('0x32')](function(){if(_[_0x49b7('0xb7')](_0x43a3cb[_0x49b7('0x43')][_0x49b7('0x6b')])){for(var _0x478508=0x0;_0x478508<_0x43a3cb[_0x49b7('0x43')]['ids'][_0x49b7('0x46')];_0x478508+=0x1){socket[_0x49b7('0xb8')](_0x49b7('0xb9'),{'UserId':Number(_0x43a3cb[_0x49b7('0x43')][_0x49b7('0x6b')][_0x478508]),'FaxAccountId':Number(_0x43a3cb[_0x49b7('0x53')]['id'])});}}else{socket[_0x49b7('0xb8')]('userFaxAccount:remove',{'UserId':Number(_0x43a3cb['query']['ids']),'FaxAccountId':Number(_0x43a3cb[_0x49b7('0x53')]['id'])});}});}})[_0x49b7('0x32')](respondWithStatusCode(_0xc886d9,null))[_0x49b7('0x26')](handleError(_0xc886d9,null));};exports[_0x49b7('0xba')]=function(_0x1a7468,_0x3ae3f8,_0x3d0af2){var _0x2ee784={};var _0xe67668={};var _0x3c7ce0;var _0x1ba375;return db[_0x49b7('0x3b')][_0x49b7('0x62')]({'where':{'id':_0x1a7468['params']['id']}})[_0x49b7('0x32')](handleEntityNotFound(_0x3ae3f8,null))[_0x49b7('0x32')](function(_0x2335ad){if(_0x2335ad){_0x3c7ce0=_0x2335ad;_0xe67668['model']=_[_0x49b7('0x40')](db[_0x49b7('0xbb')][_0x49b7('0x55')]);_0xe67668[_0x49b7('0x43')]=_['keys'](_0x1a7468[_0x49b7('0x43')]);_0xe67668[_0x49b7('0x41')]=_[_0x49b7('0x42')](_0xe67668[_0x49b7('0x3f')],_0xe67668['query']);_0x2ee784[_0x49b7('0x44')]=_['intersection'](_0xe67668[_0x49b7('0x3f')],qs[_0x49b7('0x45')](_0x1a7468['query']['fields']));_0x2ee784[_0x49b7('0x44')]=_0x2ee784['attributes'][_0x49b7('0x46')]?_0x2ee784[_0x49b7('0x44')]:_0xe67668[_0x49b7('0x3f')];_0x2ee784[_0x49b7('0x49')]=qs['sort'](_0x1a7468[_0x49b7('0x43')][_0x49b7('0x4a')]);_0x2ee784[_0x49b7('0x4b')]=qs['filters'](_[_0x49b7('0x4c')](_0x1a7468['query'],_0xe67668[_0x49b7('0x41')]));if(_0x1a7468['query'][_0x49b7('0x4d')]){_0x2ee784[_0x49b7('0x4b')]=_['merge'](_0x2ee784['where'],{'$or':_[_0x49b7('0x3a')](_0x2ee784[_0x49b7('0x44')],function(_0x5b2f6b){var _0x147e75={};_0x147e75[_0x5b2f6b]={'$like':'%'+_0x1a7468['query']['filter']+'%'};return _0x147e75;})});}_0x2ee784=_['merge']({},_0x2ee784,_0x1a7468[_0x49b7('0x63')]);return _0x3c7ce0['getAgents'](_0x2ee784);}})[_0x49b7('0x32')](function(_0x447be7){if(_0x447be7){_0x1ba375=_0x447be7[_0x49b7('0x46')];if(!_0x1a7468[_0x49b7('0x43')][_0x49b7('0x47')](_0x49b7('0x48'))){_0x2ee784[_0x49b7('0x2b')]=qs[_0x49b7('0x2b')](_0x1a7468[_0x49b7('0x43')]['limit']);_0x2ee784[_0x49b7('0x29')]=qs['offset'](_0x1a7468['query'][_0x49b7('0x29')]);}return _0x3c7ce0['getAgents'](_0x2ee784);}})[_0x49b7('0x32')](function(_0x527aef){if(_0x527aef){return _0x527aef?{'count':_0x1ba375,'rows':_0x527aef}:null;}})[_0x49b7('0x32')](respondWithResult(_0x3ae3f8,null))['catch'](handleError(_0x3ae3f8,null));}; \ No newline at end of file +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 diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 6721598..d1b351e 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 _0x02fb=['FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x572ce4,_0x31ce71){var _0x149ec9=function(_0x440244){while(--_0x440244){_0x572ce4['push'](_0x572ce4['shift']());}};_0x149ec9(++_0x31ce71);}(_0x02fb,0x1b6));var _0xb02f=function(_0x491f15,_0x1572ad){_0x491f15=_0x491f15-0x0;var _0x40c94f=_0x02fb[_0x491f15];return _0x40c94f;};'use strict';var EventEmitter=require(_0xb02f('0x0'));var FaxAccount=require(_0xb02f('0x1'))['db'][_0xb02f('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xb02f('0x3')](0x0);var events={'afterCreate':_0xb02f('0x4'),'afterUpdate':_0xb02f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2b0150){return function(_0x40c5a2,_0x533aee,_0x232b16){FaxAccountEvents[_0xb02f('0x6')](_0x2b0150+':'+_0x40c5a2['id'],_0x40c5a2);FaxAccountEvents[_0xb02f('0x6')](_0x2b0150,_0x40c5a2);_0x232b16(null);};}for(var e in events){if(events[_0xb02f('0x7')](e)){var event=events[e];FaxAccount[_0xb02f('0x8')](e,emitEvent(event));}}module[_0xb02f('0x9')]=FaxAccountEvents; \ No newline at end of file +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 diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 341509d..eb4bf6a 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 _0xb37f=['exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','path','./faxAccount.attributes'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0xb37f,0x1a6));var _0xfb37=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xb37f[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0xfb37('0x0'));var util=require(_0xfb37('0x1'));var logger=require(_0xfb37('0x2'))(_0xfb37('0x3'));var moment=require(_0xfb37('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfb37('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfb37('0x6'));module[_0xfb37('0x7')]=function(_0x1ce458,_0x1d1bf7){return _0x1ce458[_0xfb37('0x8')](_0xfb37('0x9'),attributes,{'tableName':_0xfb37('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 013d3a7..73d872c 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 _0xcc74=['List','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','length','Contacts','defaults','create','FaxInteraction','Contact\x20not\x20found','get','autoclose','push','close','unmanaged','created','FaxMessage','ContactId','UserId','User','name','interaction','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','request','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','FaxAccount,\x20%s,\x20%s','result','catch','FaxAccount','raw','options','where','limit','include','map','model','attributes','then','GetFaxAccount','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','from','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account'];(function(_0x297d26,_0x181c70){var _0x386f9f=function(_0xd5114){while(--_0xd5114){_0x297d26['push'](_0x297d26['shift']());}};_0x386f9f(++_0x181c70);}(_0xcc74,0x11f));var _0x4cc7=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xcc74[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x4cc7('0x0'));var util=require(_0x4cc7('0x1'));var moment=require(_0x4cc7('0x2'));var BPromise=require('bluebird');var rs=require(_0x4cc7('0x3'));var fs=require('fs');var Redis=require(_0x4cc7('0x4'));var db=require(_0x4cc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4cc7('0x6'));var config=require(_0x4cc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4cc7('0x8')][_0x4cc7('0x9')]({'port':0x232c});config['redis']=_['defaults'](config[_0x4cc7('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4cc7('0xa')]));require('./faxAccount.socket')['register'](socket);function respondWithRpcPromise(_0x273c0b,_0x92670e,_0x226d2e){return new BPromise(function(_0x51e9e4,_0x48b791){return client[_0x4cc7('0xb')](_0x273c0b,_0x226d2e)['then'](function(_0x5022d2){logger[_0x4cc7('0xc')]('FaxAccount,\x20%s,\x20%s',_0x92670e,'request\x20sent');logger[_0x4cc7('0xd')](_0x4cc7('0xe'),_0x92670e,_0x4cc7('0xf'),JSON['stringify'](_0x5022d2));if(_0x5022d2[_0x4cc7('0x10')]){if(_0x5022d2[_0x4cc7('0x10')][_0x4cc7('0x11')]===0x1f4){logger[_0x4cc7('0x10')]('FaxAccount,\x20%s,\x20%s',_0x92670e,_0x5022d2[_0x4cc7('0x10')]['message']);return _0x48b791(_0x5022d2[_0x4cc7('0x10')][_0x4cc7('0x12')]);}logger[_0x4cc7('0x10')](_0x4cc7('0x13'),_0x92670e,_0x5022d2[_0x4cc7('0x10')]['message']);return _0x51e9e4(_0x5022d2['error'][_0x4cc7('0x12')]);}else{logger[_0x4cc7('0xc')](_0x4cc7('0x13'),_0x92670e,_0x4cc7('0xf'));_0x51e9e4(_0x5022d2[_0x4cc7('0x14')][_0x4cc7('0x12')]);}})[_0x4cc7('0x15')](function(_0x24a5a0){logger[_0x4cc7('0x10')](_0x4cc7('0x13'),_0x92670e,_0x24a5a0);_0x48b791(_0x24a5a0);});});}exports['GetFaxAccount']=function(_0x5aa96b){var _0x432b8c=this;return new Promise(function(_0xa91213,_0x2ef03b){return db[_0x4cc7('0x16')]['findAll']({'raw':_0x5aa96b['options']?_0x5aa96b['options'][_0x4cc7('0x17')]===undefined?!![]:![]:!![],'where':_0x5aa96b[_0x4cc7('0x18')]?_0x5aa96b[_0x4cc7('0x18')][_0x4cc7('0x19')]||null:null,'attributes':_0x5aa96b[_0x4cc7('0x18')]?_0x5aa96b['options']['attributes']||null:null,'limit':_0x5aa96b[_0x4cc7('0x18')]?_0x5aa96b[_0x4cc7('0x18')][_0x4cc7('0x1a')]||null:null,'include':_0x5aa96b['options']?_0x5aa96b[_0x4cc7('0x18')][_0x4cc7('0x1b')]?_[_0x4cc7('0x1c')](_0x5aa96b[_0x4cc7('0x18')][_0x4cc7('0x1b')],function(_0x15eb72){return{'model':db[_0x15eb72[_0x4cc7('0x1d')]],'as':_0x15eb72['as'],'attributes':_0x15eb72[_0x4cc7('0x1e')],'include':_0x15eb72[_0x4cc7('0x1b')]?_[_0x4cc7('0x1c')](_0x15eb72[_0x4cc7('0x1b')],function(_0x210262){return{'model':db[_0x210262[_0x4cc7('0x1d')]],'as':_0x210262['as'],'attributes':_0x210262[_0x4cc7('0x1e')],'include':_0x210262['include']?_[_0x4cc7('0x1c')](_0x210262['include'],function(_0x15a612){return{'model':db[_0x15a612[_0x4cc7('0x1d')]],'as':_0x15a612['as'],'attributes':_0x15a612[_0x4cc7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4cc7('0x1f')](function(_0x30524e){logger[_0x4cc7('0xc')](_0x4cc7('0x20'),_0x5aa96b);logger[_0x4cc7('0xd')](_0x4cc7('0x20'),_0x5aa96b,JSON[_0x4cc7('0x21')](_0x30524e));_0xa91213(_0x30524e);})[_0x4cc7('0x15')](function(_0x1124fd){logger[_0x4cc7('0x10')]('GetFaxAccount',_0x1124fd['message'],_0x5aa96b);_0x2ef03b(_0x432b8c['error'](0x1f4,_0x1124fd[_0x4cc7('0x12')]));});});};exports[_0x4cc7('0x22')]=function(_0x6e781c,_0x115dde,_0x251f83){var _0xacdd4e=this;return new Promise(function(_0x5434d4,_0x365a09){var _0x1db001={'body':_0x6e781c[_0x4cc7('0x23')],'channel':_0x4cc7('0x24')};var _0x5b85ad=[];var _0x4643a1=[];var _0x602a4e={};return db[_0x4cc7('0x25')]['describe']()[_0x4cc7('0x1f')](function(_0xcff949){if(!_0xcff949){throw new db[(_0x4cc7('0x26'))][(_0x4cc7('0x27'))](_0x4cc7('0x28'));}_0x5b85ad=_[_0x4cc7('0x29')](_['keys'](_0xcff949),['createdAt',_0x4cc7('0x2a')]);_0x4643a1=_['difference'](_['keys'](_0xcff949),[_0x4cc7('0x2b'),'updatedAt','CompanyId',_0x4cc7('0x2c')]);if(_0x6e781c[_0x4cc7('0x23')]['id']){delete _0x6e781c[_0x4cc7('0x23')]['id'];}if(_['isNil'](_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x2d')])){throw new db['Sequelize'][(_0x4cc7('0x27'))]('from\x20is\x20mandatory');}if(_[_0x4cc7('0x2e')](_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x23')])||_0x6e781c['body'][_0x4cc7('0x23')]===''){throw new db[(_0x4cc7('0x26'))][(_0x4cc7('0x27'))](_0x4cc7('0x2f'));}if(_[_0x4cc7('0x2e')](_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x30')])){throw new db['Sequelize'][(_0x4cc7('0x27'))](_0x4cc7('0x31')+_0x4643a1);}if(!_['includes'](_0x4643a1,_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x30')])){throw new db['Sequelize'][(_0x4cc7('0x27'))](_0x4cc7('0x32')+_0x4643a1);}_0x602a4e[_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x30')]]=_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x2d')];})[_0x4cc7('0x1f')](function(){return db[_0x4cc7('0x16')][_0x4cc7('0x33')]({'where':{'id':_0x6e781c[_0x4cc7('0x34')]['id']},'include':[{'model':db['CmList'],'as':_0x4cc7('0x35'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x602a4e,'limit':0x1,'order':[[_0x4cc7('0x2a'),_0x4cc7('0x36')]]}]},{'model':db[_0x4cc7('0x37')],'as':_0x4cc7('0x38')}]});})[_0x4cc7('0x1f')](function(_0x5e0654){if(_0x5e0654&&_0x5e0654[_0x4cc7('0x35')]){var _0x2f1397=_0x5e0654['get']({'plain':!![]});_0x1db001['account']=_0x2f1397;_0x1db001[_0x4cc7('0x39')]=_0x2f1397[_0x4cc7('0x38')];_0x1db001[_0x4cc7('0x3a')]=_0x2f1397[_0x4cc7('0x35')];_0x1db001[_0x4cc7('0x39')]=_[_0x4cc7('0x3b')](_0x1db001[_0x4cc7('0x39')],[_0x4cc7('0x3c')],[_0x4cc7('0x3d')]);if(_0x1db001[_0x4cc7('0x34')][_0x4cc7('0x38')]){delete _0x1db001[_0x4cc7('0x34')]['Applications'];}if(_0x1db001[_0x4cc7('0x34')][_0x4cc7('0x35')]&&_0x1db001[_0x4cc7('0x34')][_0x4cc7('0x35')]['Contacts'][_0x4cc7('0x3e')]){return _0x1db001[_0x4cc7('0x34')][_0x4cc7('0x35')][_0x4cc7('0x3f')][0x0];}var _0x247092=_[_0x4cc7('0x40')](_0x6e781c[_0x4cc7('0x23')],{'firstName':_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x2d')],'ListId':_0x2f1397['ListId']});_0x247092[_0x6e781c['body'][_0x4cc7('0x30')]]=_0x6e781c['body'][_0x4cc7('0x2d')];return db[_0x4cc7('0x25')][_0x4cc7('0x41')](_0x247092,{'fields':_0x5b85ad,'raw':!![]});}})[_0x4cc7('0x1f')](function(_0x28d407){_0x1db001['contact']=_0x28d407;if(_0x28d407){var _0x25899d={'ContactId':_0x28d407['id'],'FaxAccountId':_0x6e781c[_0x4cc7('0x34')]['id'],'fax':_0x28d407['fax']};return db[_0x4cc7('0x42')][_0x4cc7('0x33')]({'where':{'ContactId':_0x28d407['id'],'closed':![],'FaxAccountId':_0x6e781c[_0x4cc7('0x34')]['id']}})[_0x4cc7('0x1f')](function(_0x53e27c){if(_0x53e27c){return[_0x53e27c,![]];}return db[_0x4cc7('0x42')][_0x4cc7('0x41')](_0x25899d)['then'](function(_0x1d3028){return[_0x1d3028,!![]];});});}else{throw new Error(_0x4cc7('0x43'));}})['spread'](function(_0x323f4f,_0x51d367){var _0x14f4ed=_0x323f4f[_0x4cc7('0x44')]({'plain':!![]});if(_0x51d367){if(_0x1db001[_0x4cc7('0x34')][_0x4cc7('0x45')]){_0x1db001[_0x4cc7('0x39')][_0x4cc7('0x46')]({'id':0x0,'priority':_0x1db001['applications'][_0x4cc7('0x3e')]+0x1,'app':_0x4cc7('0x47'),'appdata':_0x4cc7('0x48'),'interval':'*,*,*,*'});}_0x14f4ed[_0x4cc7('0x49')]=!![];}else{_0x14f4ed[_0x4cc7('0x49')]=![];}_0x1db001['interaction']=_0x14f4ed;return db[_0x4cc7('0x4a')][_0x4cc7('0x41')]({'body':_0x6e781c[_0x4cc7('0x23')][_0x4cc7('0x23')],'FaxAccountId':_0x6e781c[_0x4cc7('0x34')]['id'],'FaxInteractionId':_0x323f4f['id'],'direction':'in','ContactId':_0x323f4f[_0x4cc7('0x4b')],'AttachmentId':_0x6e781c[_0x4cc7('0x23')]['AttachmentId']});})[_0x4cc7('0x1f')](function(_0x1f1e9a){_0x1db001[_0x4cc7('0x12')]=_0x1f1e9a;if(_0x1db001['interaction'][_0x4cc7('0x4c')]){return db[_0x4cc7('0x4d')][_0x4cc7('0x33')]({'attributes':['id',_0x4cc7('0x4e')],'where':{'id':_0x1db001[_0x4cc7('0x4f')]['UserId']}})[_0x4cc7('0x1f')](function(_0x2b016e){if(_0x2b016e){_0x1db001['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x4cc7('0x50'),'appdata':_0x2b016e['name']+','+(_0x1db001['account'][_0x4cc7('0x51')]||0xa),'interval':_0x4cc7('0x52')});}return respondWithRpcPromise(_0x4cc7('0x53'),'startRouting',_0x1db001);});}return respondWithRpcPromise(_0x4cc7('0x53'),_0x4cc7('0x54'),_0x1db001);})[_0x4cc7('0x1f')](function(_0x103041){_0x5434d4(_0x103041);})[_0x4cc7('0x15')](function(_0x5940dd){_0x365a09(_0xacdd4e[_0x4cc7('0x10')](0x1f4,_0x5940dd[_0x4cc7('0x12')]));});});}; \ No newline at end of file +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 diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6bb0386..c724b5b 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 _0xbaa3=['register','length','faxAccount:','./faxAccount.events','save','remove','emit','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbaa3,0x1db));var _0x3baa=function(_0x460dae,_0x3a907f){_0x460dae=_0x460dae-0x0;var _0x36e6d0=_0xbaa3[_0x460dae];return _0x36e6d0;};'use strict';var FaxAccountEvents=require(_0x3baa('0x0'));var events=[_0x3baa('0x1'),_0x3baa('0x2'),'update'];function createListener(_0x4bbaad,_0x29a5d1){return function(_0x432218){_0x29a5d1[_0x3baa('0x3')](_0x4bbaad,_0x432218);};}function removeListener(_0x12f256,_0x18a61f){return function(){FaxAccountEvents[_0x3baa('0x4')](_0x12f256,_0x18a61f);};}exports[_0x3baa('0x5')]=function(_0x24153d){for(var _0x328afd=0x0,_0x3bc964=events[_0x3baa('0x6')];_0x328afd<_0x3bc964;_0x328afd++){var _0x283e75=events[_0x328afd];var _0x2f4c82=createListener(_0x3baa('0x7')+_0x283e75,_0x24153d);FaxAccountEvents['on'](_0x283e75,_0x2f4c82);}}; \ No newline at end of file +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 diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 7655ba8..797c0be 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(_0x4e165a,_0x5a948f){var _0x4d09ec=function(_0x1d484f){while(--_0x1d484f){_0x4e165a['push'](_0x4e165a['shift']());}};_0x4d09ec(++_0x5a948f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_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 diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 6b5eedf..7e1a943 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 _0x956a=['sequelize','INTEGER','STRING','noop','TEXT'];(function(_0x41ab24,_0x27a1ce){var _0x182c4d=function(_0x3b2963){while(--_0x3b2963){_0x41ab24['push'](_0x41ab24['shift']());}};_0x182c4d(++_0x27a1ce);}(_0x956a,0x1cc));var _0xa956=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x956a[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xa956('0x0'));module['exports']={'priority':{'type':Sequelize[_0xa956('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa956('0x2')],'allowNull':![],'defaultValue':_0xa956('0x3')},'appdata':{'type':Sequelize[_0xa956('0x4')]()},'description':{'type':Sequelize[_0xa956('0x2')]},'interval':{'type':Sequelize[_0xa956('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +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 diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index c835dbb..8193cd9 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 _0x404e=['order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','ejs','lodash','crypto','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','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','sendStatus','stack','name','send','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty'];(function(_0x1c97c8,_0x28d564){var _0x2c096d=function(_0x1bf3ec){while(--_0x1bf3ec){_0x1c97c8['push'](_0x1c97c8['shift']());}};_0x2c096d(++_0x28d564);}(_0x404e,0x133));var _0xe404=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x404e[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0xe404('0x0'));var rimraf=require(_0xe404('0x1'));var zipdir=require(_0xe404('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe404('0x3'));var moment=require(_0xe404('0x4'));var BPromise=require(_0xe404('0x5'));var Mustache=require(_0xe404('0x6'));var util=require('util');var path=require(_0xe404('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe404('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe404('0x9'));var squel=require('squel');var crypto=require(_0xe404('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe404('0xb'));var toCsv=require(_0xe404('0xc'));var querystring=require(_0xe404('0xd'));var Papa=require(_0xe404('0xe'));var Redis=require(_0xe404('0xf'));var authService=require(_0xe404('0x10'));var qs=require(_0xe404('0x11'));var as=require(_0xe404('0x12'));var hardwareService=require(_0xe404('0x13'));var logger=require(_0xe404('0x14'))(_0xe404('0x15'));var utils=require(_0xe404('0x16'));var config=require(_0xe404('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe404('0x18'))['db'];function respondWithStatusCode(_0x3d3faa,_0x5c38ab){_0x5c38ab=_0x5c38ab||0xcc;return function(_0x310cca){if(_0x310cca){return _0x3d3faa['sendStatus'](_0x5c38ab);}return _0x3d3faa[_0xe404('0x19')](_0x5c38ab)['end']();};}function respondWithResult(_0x197e93,_0xbcf35d){_0xbcf35d=_0xbcf35d||0xc8;return function(_0x4e79d8){if(_0x4e79d8){return _0x197e93[_0xe404('0x19')](_0xbcf35d)[_0xe404('0x1a')](_0x4e79d8);}};}function respondWithFilteredResult(_0x4de524,_0x1a73b5){return function(_0x5cc866){if(_0x5cc866){var _0x2d6474=typeof _0x1a73b5[_0xe404('0x1b')]==='undefined'&&typeof _0x1a73b5[_0xe404('0x1c')]===_0xe404('0x1d');var _0x3662cd=_0x5cc866[_0xe404('0x1e')];var _0x3fcd81=_0x2d6474?0x0:_0x1a73b5['offset'];var _0x4795b2=_0x2d6474?_0x5cc866[_0xe404('0x1e')]:_0x1a73b5['offset']+_0x1a73b5[_0xe404('0x1c')];var _0x1ea762;if(_0x4795b2>=_0x3662cd){_0x4795b2=_0x3662cd;_0x1ea762=0xc8;}else{_0x1ea762=0xce;}_0x4de524[_0xe404('0x19')](_0x1ea762);return _0x4de524[_0xe404('0x1f')](_0xe404('0x20'),_0x3fcd81+'-'+_0x4795b2+'/'+_0x3662cd)['json'](_0x5cc866);}return null;};}function patchUpdates(_0x1434df){return function(_0x10dcfb){try{jsonpatch['apply'](_0x10dcfb,_0x1434df,!![]);}catch(_0x5aa43a){return BPromise[_0xe404('0x21')](_0x5aa43a);}return _0x10dcfb['save']();};}function saveUpdates(_0xa169e4,_0x5c9f1a){return function(_0x4218e2){if(_0x4218e2){return _0x4218e2[_0xe404('0x22')](_0xa169e4)[_0xe404('0x23')](function(_0x378da6){return _0x378da6;});}return null;};}function removeEntity(_0x4b9bea,_0x19ab44){return function(_0x478f9a){if(_0x478f9a){return _0x478f9a['destroy']()[_0xe404('0x23')](function(){_0x4b9bea[_0xe404('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36e4d0,_0x9608d9){return function(_0x5b5670){if(!_0x5b5670){_0x36e4d0[_0xe404('0x24')](0x194);}return _0x5b5670;};}function handleError(_0x4fcd82,_0x5e03d9){_0x5e03d9=_0x5e03d9||0x1f4;return function(_0x19f8f7){logger['error'](_0x19f8f7[_0xe404('0x25')]);if(_0x19f8f7[_0xe404('0x26')]){delete _0x19f8f7['name'];}_0x4fcd82['status'](_0x5e03d9)[_0xe404('0x27')](_0x19f8f7);};}exports['index']=function(_0xd65055,_0x510901){var _0x4c2b15={},_0x5ba778={},_0x2dd256={'count':0x0,'rows':[]};var _0x2e4fd2=_[_0xe404('0x28')](db[_0xe404('0x29')][_0xe404('0x2a')],function(_0x11a0d4){return{'name':_0x11a0d4[_0xe404('0x2b')],'type':_0x11a0d4['type'][_0xe404('0x2c')]};});_0x5ba778[_0xe404('0x2d')]=_['map'](_0x2e4fd2,_0xe404('0x26'));_0x5ba778[_0xe404('0x2e')]=_[_0xe404('0x2f')](_0xd65055[_0xe404('0x2e')]);_0x5ba778[_0xe404('0x30')]=_[_0xe404('0x31')](_0x5ba778[_0xe404('0x2d')],_0x5ba778[_0xe404('0x2e')]);_0x4c2b15[_0xe404('0x32')]=_[_0xe404('0x31')](_0x5ba778[_0xe404('0x2d')],qs[_0xe404('0x33')](_0xd65055[_0xe404('0x2e')]['fields']));_0x4c2b15[_0xe404('0x32')]=_0x4c2b15['attributes']['length']?_0x4c2b15[_0xe404('0x32')]:_0x5ba778[_0xe404('0x2d')];if(!_0xd65055['query'][_0xe404('0x34')]('nolimit')){_0x4c2b15[_0xe404('0x1c')]=qs[_0xe404('0x1c')](_0xd65055[_0xe404('0x2e')]['limit']);_0x4c2b15['offset']=qs[_0xe404('0x1b')](_0xd65055[_0xe404('0x2e')][_0xe404('0x1b')]);}_0x4c2b15[_0xe404('0x35')]=qs[_0xe404('0x36')](_0xd65055[_0xe404('0x2e')]['sort']);_0x4c2b15[_0xe404('0x37')]=qs[_0xe404('0x30')](_['pick'](_0xd65055[_0xe404('0x2e')],_0x5ba778[_0xe404('0x30')]),_0x2e4fd2);if(_0xd65055[_0xe404('0x2e')]['filter']){_0x4c2b15['where']=_['merge'](_0x4c2b15['where'],{'$or':_['map'](_0x2e4fd2,function(_0x17e2ef){if(_0x17e2ef['type']!==_0xe404('0x38')){var _0x1feb70={};_0x1feb70[_0x17e2ef[_0xe404('0x26')]]={'$like':'%'+_0xd65055[_0xe404('0x2e')][_0xe404('0x39')]+'%'};return _0x1feb70;}})});}_0x4c2b15=_[_0xe404('0x3a')]({},_0x4c2b15,_0xd65055[_0xe404('0x3b')]);var _0x12bd6b={'where':_0x4c2b15['where']};return db[_0xe404('0x29')][_0xe404('0x1e')](_0x12bd6b)[_0xe404('0x23')](function(_0x4de77f){_0x2dd256[_0xe404('0x1e')]=_0x4de77f;if(_0xd65055[_0xe404('0x2e')][_0xe404('0x3c')]){_0x4c2b15[_0xe404('0x3d')]=[{'all':!![]}];}return db[_0xe404('0x29')][_0xe404('0x3e')](_0x4c2b15);})['then'](function(_0x1411f1){_0x2dd256[_0xe404('0x3f')]=_0x1411f1;return _0x2dd256;})[_0xe404('0x23')](respondWithFilteredResult(_0x510901,_0x4c2b15))[_0xe404('0x40')](handleError(_0x510901,null));};exports[_0xe404('0x41')]=function(_0x3c8c1b,_0x2fab23){var _0x2f06e7={'raw':!![],'where':{'id':_0x3c8c1b[_0xe404('0x42')]['id']}},_0x5bd21e={};_0x5bd21e[_0xe404('0x2d')]=_[_0xe404('0x2f')](db[_0xe404('0x29')][_0xe404('0x2a')]);_0x5bd21e[_0xe404('0x2e')]=_[_0xe404('0x2f')](_0x3c8c1b[_0xe404('0x2e')]);_0x5bd21e[_0xe404('0x30')]=_[_0xe404('0x31')](_0x5bd21e[_0xe404('0x2d')],_0x5bd21e[_0xe404('0x2e')]);_0x2f06e7[_0xe404('0x32')]=_[_0xe404('0x31')](_0x5bd21e[_0xe404('0x2d')],qs[_0xe404('0x33')](_0x3c8c1b[_0xe404('0x2e')][_0xe404('0x33')]));_0x2f06e7['attributes']=_0x2f06e7[_0xe404('0x32')][_0xe404('0x43')]?_0x2f06e7[_0xe404('0x32')]:_0x5bd21e[_0xe404('0x2d')];if(_0x3c8c1b['query']['includeAll']){_0x2f06e7[_0xe404('0x3d')]=[{'all':!![]}];}_0x2f06e7=_[_0xe404('0x3a')]({},_0x2f06e7,_0x3c8c1b['options']);return db[_0xe404('0x29')][_0xe404('0x44')](_0x2f06e7)[_0xe404('0x23')](handleEntityNotFound(_0x2fab23,null))['then'](respondWithResult(_0x2fab23,null))['catch'](handleError(_0x2fab23,null));};exports['create']=function(_0x267cd0,_0x32f865){return db['FaxApplication'][_0xe404('0x45')](_0x267cd0['body'],{})[_0xe404('0x23')](respondWithResult(_0x32f865,0xc9))[_0xe404('0x40')](handleError(_0x32f865,null));};exports[_0xe404('0x22')]=function(_0x2e98ae,_0x4870af){if(_0x2e98ae[_0xe404('0x46')]['id']){delete _0x2e98ae[_0xe404('0x46')]['id'];}return db[_0xe404('0x29')][_0xe404('0x44')]({'where':{'id':_0x2e98ae[_0xe404('0x42')]['id']}})['then'](handleEntityNotFound(_0x4870af,null))[_0xe404('0x23')](saveUpdates(_0x2e98ae[_0xe404('0x46')],null))['then'](respondWithResult(_0x4870af,null))['catch'](handleError(_0x4870af,null));};exports[_0xe404('0x47')]=function(_0x30f227,_0x6402f8){return db['FaxApplication']['find']({'where':{'id':_0x30f227[_0xe404('0x42')]['id']}})['then'](handleEntityNotFound(_0x6402f8,null))[_0xe404('0x23')](removeEntity(_0x6402f8,null))[_0xe404('0x40')](handleError(_0x6402f8,null));}; \ No newline at end of file +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 diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index d0db9c1..ddff28f 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 _0xed51=['path','rimraf','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise'];(function(_0x282c1b,_0x32494b){var _0x36dd49=function(_0x4f0e84){while(--_0x4f0e84){_0x282c1b['push'](_0x282c1b['shift']());}};_0x36dd49(++_0x32494b);}(_0xed51,0xdf));var _0x1ed5=function(_0x595688,_0x2f499a){_0x595688=_0x595688-0x0;var _0x458ad4=_0xed51[_0x595688];return _0x458ad4;};'use strict';var _=require('lodash');var util=require(_0x1ed5('0x0'));var logger=require('../../config/logger')(_0x1ed5('0x1'));var moment=require(_0x1ed5('0x2'));var BPromise=require(_0x1ed5('0x3'));var rp=require(_0x1ed5('0x4'));var fs=require('fs');var path=require(_0x1ed5('0x5'));var rimraf=require(_0x1ed5('0x6'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module[_0x1ed5('0x7')]=function(_0x125e0b,_0x274197){return _0x125e0b[_0x1ed5('0x8')]('FaxApplication',attributes,{'tableName':_0x1ed5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1ed5('0xa'),'collate':_0x1ed5('0xb')});}; \ No newline at end of file +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 diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 46daed0..1c14bb3 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 _0x30d1=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','lodash','util'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x30d1,0x127));var _0x130d=function(_0x77773a,_0x5a7026){_0x77773a=_0x77773a-0x0;var _0x1091a2=_0x30d1[_0x77773a];return _0x1091a2;};'use strict';var _=require(_0x130d('0x0'));var util=require(_0x130d('0x1'));var moment=require(_0x130d('0x2'));var BPromise=require(_0x130d('0x3'));var rs=require(_0x130d('0x4'));var fs=require('fs');var Redis=require(_0x130d('0x5'));var db=require(_0x130d('0x6'))['db'];var utils=require(_0x130d('0x7'));var logger=require(_0x130d('0x8'))('rpc');var config=require(_0x130d('0x9'));var jayson=require(_0x130d('0xa'));var client=jayson[_0x130d('0xb')][_0x130d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51fa39,_0x5a8596,_0x4ebad4){return new BPromise(function(_0x47705e,_0x4bdc72){return client['request'](_0x51fa39,_0x4ebad4)[_0x130d('0xd')](function(_0x273827){logger['info'](_0x130d('0xe'),_0x5a8596,_0x130d('0xf'));logger[_0x130d('0x10')](_0x130d('0x11'),_0x5a8596,_0x130d('0xf'),JSON[_0x130d('0x12')](_0x273827));if(_0x273827['error']){if(_0x273827[_0x130d('0x13')][_0x130d('0x14')]===0x1f4){logger[_0x130d('0x13')](_0x130d('0xe'),_0x5a8596,_0x273827[_0x130d('0x13')][_0x130d('0x15')]);return _0x4bdc72(_0x273827[_0x130d('0x13')]['message']);}logger[_0x130d('0x13')](_0x130d('0xe'),_0x5a8596,_0x273827[_0x130d('0x13')][_0x130d('0x15')]);return _0x47705e(_0x273827[_0x130d('0x13')][_0x130d('0x15')]);}else{logger[_0x130d('0x16')](_0x130d('0xe'),_0x5a8596,_0x130d('0xf'));_0x47705e(_0x273827[_0x130d('0x17')][_0x130d('0x15')]);}})[_0x130d('0x18')](function(_0x2604d6){logger[_0x130d('0x13')](_0x130d('0xe'),_0x5a8596,_0x2604d6);_0x4bdc72(_0x2604d6);});});}exports[_0x130d('0x19')]=function(_0x25d53b){var _0x18ef15=this;return new Promise(function(_0x4e6765,_0x3137a3){return db[_0x130d('0x1a')]['update'](_0x25d53b[_0x130d('0x1b')],{'raw':_0x25d53b['options']?_0x25d53b[_0x130d('0x1c')][_0x130d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x25d53b[_0x130d('0x1c')]?_0x25d53b['options'][_0x130d('0x1e')]||null:null,'attributes':_0x25d53b[_0x130d('0x1c')]?_0x25d53b[_0x130d('0x1c')][_0x130d('0x1f')]||null:null,'limit':_0x25d53b[_0x130d('0x1c')]?_0x25d53b[_0x130d('0x1c')][_0x130d('0x20')]||null:null})[_0x130d('0xd')](function(_0x24e156){logger[_0x130d('0x16')]('UpdateFaxApplication',_0x25d53b);logger[_0x130d('0x10')]('UpdateFaxApplication',_0x25d53b,JSON[_0x130d('0x12')](_0x24e156));_0x4e6765(_0x24e156);})['catch'](function(_0xd08841){logger[_0x130d('0x13')](_0x130d('0x19'),_0xd08841[_0x130d('0x15')],_0x25d53b);_0x3137a3(_0x18ef15[_0x130d('0x13')](0x1f4,_0xd08841[_0x130d('0x15')]));});});}; \ No newline at end of file +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 diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 899ff5f..3aaa9ca 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 _0xefda=['post','create','update','delete','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','/:id','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xefda,0x96));var _0xaefd=function(_0x221764,_0x6ad5d){_0x221764=_0x221764-0x0;var _0xb8a1b2=_0xefda[_0x221764];return _0xb8a1b2;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0xc')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaefd('0xe')]);router[_0xaefd('0xf')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);module[_0xaefd('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index e2a7d50..7773cc5 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 _0x98b6=['ENUM','out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x98b6,0x11a));var _0x698b=function(_0x29b9f8,_0x31e7ac){_0x29b9f8=_0x29b9f8-0x0;var _0x1e27e6=_0x98b6[_0x29b9f8];return _0x1e27e6;};'use strict';var Sequelize=require(_0x698b('0x0'));module[_0x698b('0x1')]={'closed':{'type':Sequelize[_0x698b('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x698b('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x698b('0x3')]},'note':{'type':Sequelize[_0x698b('0x3')]},'read1stAt':{'type':Sequelize[_0x698b('0x4')]},'fax':{'type':Sequelize[_0x698b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x698b('0x5')]('in',_0x698b('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x698b('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x698b('0x5')]('in',_0x698b('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 6fddeab..bf4c365 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 _0xe114=['cm_contacts','users','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','forEach','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','end','compact','isEmpty','FaxAccountId','createdAt','$gte','parse','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','replace','isNumeric','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','push','all','rows','catch','show','params','rawAttributes','includeAll','include','options','create','update','describe','ids','omit','findOne','FaxMessage','merge','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','transcript-%d-%s.zip','Attachment','Messages','mkdirSync','existsSync','createReadStream','basename','unlinkSync','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','Users','fullname','TagIds','Tags','index','map','FaxInteraction','fieldName','type','key','model','keys','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','field','color','from','tools_tags','select','ui.FaxInteractionId','user_has_fax_interactions','u.id\x20=\x20ui.UserId','fax_interactions','left_join'];(function(_0x1dac50,_0x3b92e1){var _0x4b13d4=function(_0x418102){while(--_0x418102){_0x1dac50['push'](_0x1dac50['shift']());}};_0x4b13d4(++_0x3b92e1);}(_0xe114,0x82));var _0x4e11=function(_0x16fc39,_0x425678){_0x16fc39=_0x16fc39-0x0;var _0x3744ac=_0xe114[_0x16fc39];return _0x3744ac;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e11('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4e11('0x1'));var rp=require(_0x4e11('0x2'));var moment=require(_0x4e11('0x3'));var BPromise=require(_0x4e11('0x4'));var Mustache=require(_0x4e11('0x5'));var util=require('util');var path=require(_0x4e11('0x6'));var sox=require(_0x4e11('0x7'));var csv=require(_0x4e11('0x8'));var ejs=require(_0x4e11('0x9'));var fs=require('fs');var fs_extra=require(_0x4e11('0xa'));var _=require(_0x4e11('0xb'));var squel=require(_0x4e11('0xc'));var crypto=require('crypto');var jsforce=require(_0x4e11('0xd'));var deskjs=require(_0x4e11('0xe'));var toCsv=require(_0x4e11('0x8'));var querystring=require(_0x4e11('0xf'));var Papa=require('papaparse');var Redis=require(_0x4e11('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4e11('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e11('0x12'));var logger=require(_0x4e11('0x13'))('api');var utils=require(_0x4e11('0x14'));var config=require(_0x4e11('0x15'));var licenseUtil=require(_0x4e11('0x16'));var db=require(_0x4e11('0x17'))['db'];config[_0x4e11('0x18')]=_['defaults'](config[_0x4e11('0x18')],{'host':_0x4e11('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4e11('0x18')]));require(_0x4e11('0x1a'))['register'](socket);function respondWithStatusCode(_0x539277,_0x174ee7){_0x174ee7=_0x174ee7||0xcc;return function(_0x370b98){if(_0x370b98){return _0x539277[_0x4e11('0x1b')](_0x174ee7);}return _0x539277[_0x4e11('0x1c')](_0x174ee7)['end']();};}function respondWithResult(_0x3c64e4,_0x177b27){_0x177b27=_0x177b27||0xc8;return function(_0x441091){if(_0x441091){return _0x3c64e4[_0x4e11('0x1c')](_0x177b27)[_0x4e11('0x1d')](_0x441091);}};}function respondWithFilteredResult(_0x6d3b48,_0x1b1d94){return function(_0x89d528){if(_0x89d528){var _0x5d5c61=typeof _0x1b1d94[_0x4e11('0x1e')]===_0x4e11('0x1f')&&typeof _0x1b1d94[_0x4e11('0x20')]===_0x4e11('0x1f');var _0x2bf817=_0x89d528[_0x4e11('0x21')];var _0xa61bd7=_0x5d5c61?0x0:_0x1b1d94[_0x4e11('0x1e')];var _0x4edb0b=_0x5d5c61?_0x89d528['count']:_0x1b1d94[_0x4e11('0x1e')]+_0x1b1d94['limit'];var _0x43a6c0;if(_0x4edb0b>=_0x2bf817){_0x4edb0b=_0x2bf817;_0x43a6c0=0xc8;}else{_0x43a6c0=0xce;}_0x6d3b48[_0x4e11('0x1c')](_0x43a6c0);return _0x6d3b48[_0x4e11('0x22')](_0x4e11('0x23'),_0xa61bd7+'-'+_0x4edb0b+'/'+_0x2bf817)[_0x4e11('0x1d')](_0x89d528);}return null;};}function patchUpdates(_0xdcf657){return function(_0x34de7d){try{jsonpatch['apply'](_0x34de7d,_0xdcf657,!![]);}catch(_0x2a2676){return BPromise[_0x4e11('0x24')](_0x2a2676);}return _0x34de7d[_0x4e11('0x25')]();};}function saveUpdates(_0x196f11,_0x255516){return function(_0x4637ab){if(_0x4637ab){return _0x4637ab['update'](_0x196f11)[_0x4e11('0x26')](function(_0x5bd99d){return _0x5bd99d;});}return null;};}function removeEntity(_0x107c14,_0x5cb052){return function(_0x31d340){if(_0x31d340){return _0x31d340[_0x4e11('0x27')]()['then'](function(){_0x107c14[_0x4e11('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x451f05,_0x1bf1d8){return function(_0x589fe3){if(!_0x589fe3){_0x451f05['sendStatus'](0x194);}return _0x589fe3;};}function handleError(_0xd6292,_0x28405a){_0x28405a=_0x28405a||0x1f4;return function(_0x9b98){logger[_0x4e11('0x28')](_0x9b98[_0x4e11('0x29')]);if(_0x9b98[_0x4e11('0x2a')]){delete _0x9b98[_0x4e11('0x2a')];}_0xd6292[_0x4e11('0x1c')](_0x28405a)[_0x4e11('0x2b')](_0x9b98);};}function getInteractionUsers(_0x4e1ef9,_0x5d17c3){return new BPromise(function(_0x3f09b5,_0x1ed2ad){try{if(_0x5d17c3[_0x4e1ef9['id']]){_0x4e1ef9[_0x4e11('0x2c')]=_['map'](_0x5d17c3[_0x4e1ef9['id']],function(_0x229767){return{'id':_0x229767['id'],'fullname':_0x229767[_0x4e11('0x2d')]};});}}catch(_0x23904c){_0x1ed2ad(_0x23904c);}_0x3f09b5(_0x4e1ef9);});}function getInteractionTags(_0x15e408,_0x1a7e96){return new BPromise(function(_0x3cd07c,_0x6d563){try{if(_0x15e408[_0x4e11('0x2e')]){_0x15e408['Tags']=[];_0x15e408[_0x4e11('0x2e')]['split'](',')['forEach'](function(_0x18e195){_0x15e408[_0x4e11('0x2f')]['push'](_0x1a7e96[_0x18e195]);});}delete _0x15e408[_0x4e11('0x2e')];}catch(_0x1c9a93){_0x6d563(_0x1c9a93);}_0x3cd07c(_0x15e408);});}function updateFaxInteraction(_0x374222,_0x322adb,_0x30c49d){return new BPromise(function(_0x397635,_0x5dd764){return getInteractionUsers(_0x374222,_0x30c49d)[_0x4e11('0x26')](function(_0x3fe3d6){return getInteractionTags(_0x3fe3d6,_0x322adb);})[_0x4e11('0x26')](function(_0x51f6ba){_0x397635(_0x51f6ba);})['catch'](function(_0x48267a){_0x5dd764(_0x48267a);});});}exports[_0x4e11('0x30')]=function(_0x1b286f,_0x1299c3){var _0x4feed1={},_0x125bc3={},_0x10b797={'count':0x0,'rows':[]};var _0x4f2670=_[_0x4e11('0x31')](db[_0x4e11('0x32')]['rawAttributes'],function(_0x40f4f2){return{'name':_0x40f4f2[_0x4e11('0x33')],'type':_0x40f4f2[_0x4e11('0x34')][_0x4e11('0x35')]};});_0x125bc3[_0x4e11('0x36')]=_[_0x4e11('0x31')](_0x4f2670,'name');_0x125bc3['query']=_[_0x4e11('0x37')](_0x1b286f[_0x4e11('0x38')]);_0x125bc3['filters']=_[_0x4e11('0x39')](_0x125bc3[_0x4e11('0x36')],_0x125bc3[_0x4e11('0x38')]);_0x4feed1['attributes']=_[_0x4e11('0x39')](_0x125bc3[_0x4e11('0x36')],qs[_0x4e11('0x3a')](_0x1b286f[_0x4e11('0x38')][_0x4e11('0x3a')]));_0x4feed1[_0x4e11('0x3b')]=_0x4feed1[_0x4e11('0x3b')]['length']?_0x4feed1['attributes']:_0x125bc3['model'];if(!_0x1b286f[_0x4e11('0x38')][_0x4e11('0x3c')](_0x4e11('0x3d'))){_0x4feed1[_0x4e11('0x20')]=qs[_0x4e11('0x20')](_0x1b286f[_0x4e11('0x38')][_0x4e11('0x20')]);_0x4feed1['offset']=qs[_0x4e11('0x1e')](_0x1b286f[_0x4e11('0x38')][_0x4e11('0x1e')]);}_0x4feed1[_0x4e11('0x3e')]=qs[_0x4e11('0x3f')](_0x1b286f[_0x4e11('0x38')][_0x4e11('0x3f')]);_0x4feed1[_0x4e11('0x40')]=qs['filters'](_[_0x4e11('0x41')](_0x1b286f['query'],_0x125bc3[_0x4e11('0x42')]),_0x4f2670);var _0x453bdc=[];var _0x54ed50=squel['select']()[_0x4e11('0x43')]('id')[_0x4e11('0x43')]('name')[_0x4e11('0x43')](_0x4e11('0x44'))[_0x4e11('0x45')](_0x4e11('0x46'));var _0x31d9cb=squel[_0x4e11('0x47')]()[_0x4e11('0x43')]('u.id')['field']('u.fullname')[_0x4e11('0x43')](_0x4e11('0x48'))[_0x4e11('0x45')](_0x4e11('0x49'),'ui')['left_join']('users','u',_0x4e11('0x4a'));var _0x88bc07=squel[_0x4e11('0x47')]()[_0x4e11('0x45')](_0x4e11('0x4b'),'i')[_0x4e11('0x4c')](_0x4e11('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x4e11('0x4c')](_0x4e11('0x4e'),'o',_0x4e11('0x4f'))[_0x4e11('0x4c')](_0x4e11('0x50'),'a','a.id\x20=\x20i.FaxAccountId')[_0x4e11('0x4c')](_0x4e11('0x51'),'me',_0x4e11('0x52'))[_0x4e11('0x4c')](_0x4e11('0x53'),'it',_0x4e11('0x54'))[_0x4e11('0x4c')](_0x4e11('0x46'),'t',_0x4e11('0x55'));var _0x4a5858=squel['expr']();var _0x43ba3b=[];var _0x3669c1=squel['expr']();var _0x24c6e1;if(_0x1b286f[_0x4e11('0x38')]['search']){_0x24c6e1=as[_0x4e11('0x56')](_0x1b286f['query'][_0x4e11('0x57')]);var _0x42c5c9=_0x24c6e1[_0x4e11('0x58')];for(var _0x16e1e1=0x0;_0x16e1e1<_0x24c6e1[_0x4e11('0x59')]['length'];_0x16e1e1++){var _0x238a34=_0x24c6e1[_0x4e11('0x59')][_0x16e1e1];var _0x5e4396='i';var _0x5c03c7=_[_0x4e11('0x5a')](_0x4f2670,[_0x4e11('0x2a'),_0x238a34[_0x4e11('0x43')]]);if(!_0x5c03c7){switch(_0x238a34['field']){case _0x4e11('0x5b'):if(_0x238a34[_0x4e11('0x5c')]==0x1){_0x88bc07[_0x4e11('0x5d')]('`'+_0x238a34[_0x4e11('0x43')]+'`\x20=\x200');}else{_0x88bc07['having']('`'+_0x238a34[_0x4e11('0x43')]+_0x4e11('0x5e'));}break;case _0x4e11('0x5f'):if(_0x238a34[_0x4e11('0x60')]===_0x4e11('0x61')){if(_0x238a34[_0x4e11('0x5c')][_0x4e11('0x62')]('\x20')[_0x4e11('0x63')]>0x1){_0x4a5858[_0x42c5c9](_0x4e11('0x64'),qs['getFullTextValue'](_0x238a34[_0x4e11('0x5c')]),null);}else{var _0x3cd85b='%'+_0x238a34[_0x4e11('0x5c')]+'%';_0x4a5858[_0x42c5c9](_0x4e11('0x65'),_0x3cd85b,_0x3cd85b,_0x3cd85b);}}else{_0x5c03c7=_[_0x4e11('0x5a')](_0x4f2670,[_0x4e11('0x2a'),_0x4e11('0x66')]);_0x238a34['field']=_0x4e11('0x66');_0x347300=as[_0x4e11('0x67')](_0x5e4396,_0x5c03c7[_0x4e11('0x34')],_0x238a34);_0x4a5858[_0x42c5c9](_0x347300[_0x4e11('0x68')],_0x347300[_0x4e11('0x5c')][_0x4e11('0x69')],_0x347300[_0x4e11('0x5c')]['end']);}break;case'Tag':var _0xcdeae9=_0x238a34[_0x4e11('0x5c')][_0x4e11('0x62')](',')['map'](function(_0x3de4bf){return Number(_0x3de4bf);});_0xcdeae9[_0x4e11('0x6a')](function(_0x4fd886){_0x3669c1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x4fd886+',%');});_0x43ba3b=_[_0x4e11('0x6b')](_0x43ba3b,_0xcdeae9);break;case'User':if(_0x238a34['operator']==='$substring'){_0x4a5858[_0x42c5c9](_0x4e11('0x6c'),'%'+_0x238a34['value']+'%',null);}else{_0x5c03c7=_['find'](_0x4f2670,['name',_0x4e11('0x6d')]);_0x238a34[_0x4e11('0x43')]=_0x4e11('0x6d');_0x347300=as[_0x4e11('0x67')](_0x5e4396,_0x5c03c7['type'],_0x238a34);_0x4a5858[_0x42c5c9](_0x347300[_0x4e11('0x68')],_0x347300['value']['start'],_0x347300[_0x4e11('0x5c')]['end']);}break;case _0x4e11('0x6e'):_0x347300=as[_0x4e11('0x67')]('me',null,_0x238a34);_0x4a5858[_0x42c5c9](_0x347300[_0x4e11('0x68')],_0x347300[_0x4e11('0x5c')][_0x4e11('0x69')],_0x347300[_0x4e11('0x5c')]['end']);break;}}else{var _0x347300=as[_0x4e11('0x67')](_0x5e4396,_0x5c03c7[_0x4e11('0x34')],_0x238a34);_0x4a5858[_0x42c5c9](_0x347300['text'],_0x347300[_0x4e11('0x5c')]['start'],_0x347300[_0x4e11('0x5c')][_0x4e11('0x6f')]);}}}else{var _0x5b848d=_(_0x1b286f[_0x4e11('0x38')])['keys']()['map'](function(_0x546fe2){return _['some'](_0x4f2670,[_0x4e11('0x2a'),_0x546fe2])?_0x546fe2:undefined;})[_0x4e11('0x70')]()[_0x4e11('0x5c')]();if(!_[_0x4e11('0x71')](_0x5b848d)){_0x5b848d['forEach'](function(_0x394e95){if(_0x394e95===_0x4e11('0x72')){_0x88bc07[_0x4e11('0x40')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x1b286f[_0x4e11('0x38')][_0x394e95]));}else if(_0x394e95===_0x4e11('0x73')){var _0x4d8e76=JSON['parse'](_0x1b286f[_0x4e11('0x38')][_0x394e95])[_0x4e11('0x74')];var _0x36edd9=JSON[_0x4e11('0x75')](_0x1b286f['query'][_0x394e95])['$lte'];_0x88bc07[_0x4e11('0x40')](_0x4e11('0x76'),_0x4d8e76,_0x36edd9);}else{if(_0x1b286f['query'][_0x394e95]===_0x4e11('0x77')){_0x88bc07[_0x4e11('0x40')]('i.'+_0x394e95+_0x4e11('0x78'));}else{_0x88bc07[_0x4e11('0x40')]('i.'+_0x394e95+_0x4e11('0x79'),_0x1b286f[_0x4e11('0x38')][_0x394e95]);}}});}if(_0x1b286f[_0x4e11('0x38')][_0x4e11('0x7a')]){if(_0x1b286f[_0x4e11('0x38')]['read']==0x1){_0x88bc07[_0x4e11('0x5d')](_0x4e11('0x7b'));}else{_0x88bc07[_0x4e11('0x5d')](_0x4e11('0x7c'));}}if(_0x1b286f[_0x4e11('0x38')][_0x4e11('0x7d')]){_0x43ba3b=_[_0x4e11('0x7e')](_0x1b286f[_0x4e11('0x38')]['tag'])?_0x1b286f[_0x4e11('0x38')]['tag']:new Array(_0x1b286f[_0x4e11('0x38')]['tag']);_0x43ba3b['forEach'](function(_0x3e5944){_0x3669c1['or'](_0x4e11('0x7f'),'%,'+_0x3e5944+',%');});}if(_0x1b286f[_0x4e11('0x38')]['filter']){var _0x19655b=_0x1b286f[_0x4e11('0x38')][_0x4e11('0x80')]['replace']('\x5c','\x5c\x5c')[_0x4e11('0x81')](/'/g,'\x27\x27');if(qs[_0x4e11('0x82')](_0x19655b)){_0x4a5858['or']('i.id\x20LIKE\x20?',_0x19655b+'%')['or'](_0x4e11('0x83'),_0x19655b+'%');}_0x4a5858['or'](_0x4e11('0x84'),_0x19655b+'%');}}_0x88bc07[_0x4e11('0x40')](_0x4a5858);_0x88bc07[_0x4e11('0x85')]('i.id');var _0x5e8ee9={'type':db['Sequelize'][_0x4e11('0x86')]['SELECT'],'raw':!![]};var _0x38e269=_0x88bc07[_0x4e11('0x87')]();_0x38e269['field']('i.id');_0x38e269[_0x4e11('0x43')](_0x4e11('0x88'),'unreadMessages');if(_0x4feed1[_0x4e11('0x3e')]){_0x4feed1['order'][_0x4e11('0x6a')](function(_0x3eeb35){var _0x3b49d9=_0x3eeb35[0x0]===_0x4e11('0x89')?_0x3eeb35[0x0]:'i.'+_0x3eeb35[0x0];_0x88bc07[_0x4e11('0x3e')](_0x3b49d9,_0x3eeb35[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x43ba3b)){_0x88bc07[_0x4e11('0x5d')](_0x3669c1);_0x38e269[_0x4e11('0x40')]('t.id\x20IN\x20?',_0x43ba3b);}BPromise[_0x4e11('0x8a')]()[_0x4e11('0x26')](function(){if(!_0x24c6e1){if(_0x1b286f[_0x4e11('0x38')][_0x4e11('0x72')])return;_0x38e269[_0x4e11('0x40')](_0x4e11('0x8b'));_0x88bc07[_0x4e11('0x40')](_0x4e11('0x8b'));return;}if(_0x1b286f['user'][_0x4e11('0x8c')]!==_0x4e11('0x8d'))return;return _0x1b286f[_0x4e11('0x8e')][_0x4e11('0x8f')]({'attributes':['id'],'raw':!![]})[_0x4e11('0x26')](function(_0x140ec8){if(_['isEmpty'](_0x140ec8)){_0x38e269[_0x4e11('0x40')](_0x4e11('0x90'));_0x88bc07[_0x4e11('0x40')](_0x4e11('0x90'));}else{_0x38e269[_0x4e11('0x40')](_0x4e11('0x91'),_[_0x4e11('0x31')](_0x140ec8,'id'));_0x88bc07['where'](_0x4e11('0x91'),_[_0x4e11('0x31')](_0x140ec8,'id'));}});})['then'](function(){if(_0x1b286f['user']['role']==='agent'&&!_0x24c6e1&&!_0x1b286f[_0x4e11('0x38')][_0x4e11('0x72')])return[];return db[_0x4e11('0x92')][_0x4e11('0x38')](_0x38e269['toString'](),_0x5e8ee9);})[_0x4e11('0x26')](function(_0x573757){_0x10b797[_0x4e11('0x21')]=_0x573757[_0x4e11('0x63')];if(_0x10b797[_0x4e11('0x21')]===0x0)return[];return db[_0x4e11('0x92')]['query'](_0x54ed50[_0x4e11('0x93')](),_0x5e8ee9)[_0x4e11('0x26')](function(_0x40b330){_0x453bdc=_[_0x4e11('0x94')](_0x40b330,'id');_0x5e8ee9=_['merge'](_0x5e8ee9,{'model':db[_0x4e11('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1b286f[_0x4e11('0x38')]['fields']){_0x4feed1[_0x4e11('0x3b')]['forEach'](function(_0x58cc6e){_0x88bc07[_0x4e11('0x43')]('i.'+_0x58cc6e);});}else{_0x88bc07[_0x4e11('0x43')](_0x4e11('0x88'),_0x4e11('0x5b'));_0x88bc07[_0x4e11('0x43')](_0x4e11('0x95'),_0x4e11('0x96'));_0x88bc07['field'](_0x4e11('0x97'),_0x4e11('0x98'));_0x88bc07[_0x4e11('0x43')]('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',_0x4e11('0x89'));_0x88bc07[_0x4e11('0x43')]('i.*');_0x88bc07[_0x4e11('0x43')](_0x4e11('0x99'),'Contact.firstName');_0x88bc07[_0x4e11('0x43')](_0x4e11('0x9a'),_0x4e11('0x9b'));_0x88bc07[_0x4e11('0x43')](_0x4e11('0x9c'),_0x4e11('0x9d'));_0x88bc07['field'](_0x4e11('0x9e'),'Contact.phone');_0x88bc07[_0x4e11('0x43')](_0x4e11('0x9f'),'Contact.mobile');_0x88bc07['field'](_0x4e11('0xa0'),_0x4e11('0xa1'));_0x88bc07[_0x4e11('0x43')](_0x4e11('0xa2'),_0x4e11('0xa3'));_0x88bc07[_0x4e11('0x43')](_0x4e11('0xa4'),_0x4e11('0xa5'));_0x88bc07[_0x4e11('0x43')](_0x4e11('0xa6'),_0x4e11('0x2e'));}if(_0x4feed1[_0x4e11('0x20')])_0x88bc07[_0x4e11('0x20')](_0x4feed1[_0x4e11('0x20')]);if(_0x4feed1['offset'])_0x88bc07[_0x4e11('0x1e')](_0x4feed1[_0x4e11('0x1e')]);return db['sequelize'][_0x4e11('0x38')](_0x88bc07[_0x4e11('0x93')](),_0x5e8ee9);})[_0x4e11('0x26')](function(_0x1ba543){if(_0x1ba543['length']>0x0)_0x31d9cb[_0x4e11('0x40')](_0x4e11('0xa7'),_[_0x4e11('0x31')](_0x1ba543,'id'));return db['sequelize']['query'](_0x31d9cb[_0x4e11('0x93')](),_0x5e8ee9)['then'](function(_0x56de1c){var _0x5f4463=_['groupBy'](_0x56de1c,_0x4e11('0xa8'));var _0x53437a=[];_0x1ba543['forEach'](function(_0x486c41){_0x53437a[_0x4e11('0xa9')](updateFaxInteraction(_0x486c41,_0x453bdc,_0x5f4463));});return BPromise[_0x4e11('0xaa')](_0x53437a);});});})[_0x4e11('0x26')](function(_0x2c4015){_0x10b797[_0x4e11('0xab')]=_0x2c4015;return _0x10b797;})[_0x4e11('0x26')](respondWithFilteredResult(_0x1299c3,_0x4feed1))[_0x4e11('0xac')](handleError(_0x1299c3,null));};exports[_0x4e11('0xad')]=function(_0x323485,_0x13a2c9){var _0x1ff776={'raw':![],'where':{'id':_0x323485[_0x4e11('0xae')]['id']}},_0x1d9f7b={};_0x1d9f7b[_0x4e11('0x36')]=_[_0x4e11('0x37')](db[_0x4e11('0x32')][_0x4e11('0xaf')]);_0x1d9f7b[_0x4e11('0x38')]=_[_0x4e11('0x37')](_0x323485[_0x4e11('0x38')]);_0x1d9f7b['filters']=_[_0x4e11('0x39')](_0x1d9f7b[_0x4e11('0x36')],_0x1d9f7b[_0x4e11('0x38')]);_0x1ff776['attributes']=_[_0x4e11('0x39')](_0x1d9f7b[_0x4e11('0x36')],qs[_0x4e11('0x3a')](_0x323485[_0x4e11('0x38')]['fields']));_0x1ff776['attributes']=_0x1ff776[_0x4e11('0x3b')][_0x4e11('0x63')]?_0x1ff776[_0x4e11('0x3b')]:_0x1d9f7b[_0x4e11('0x36')];if(_0x323485[_0x4e11('0x38')][_0x4e11('0xb0')]){_0x1ff776[_0x4e11('0xb1')]=[{'all':!![]}];}_0x1ff776=_['merge']({},_0x1ff776,_0x323485[_0x4e11('0xb2')]);return db[_0x4e11('0x32')]['find'](_0x1ff776)[_0x4e11('0x26')](handleEntityNotFound(_0x13a2c9,null))[_0x4e11('0x26')](respondWithResult(_0x13a2c9,null))[_0x4e11('0xac')](handleError(_0x13a2c9,null));};exports['create']=function(_0x25b43c,_0x389c7c){return db[_0x4e11('0x32')][_0x4e11('0xb3')](_0x25b43c[_0x4e11('0x6e')],{})[_0x4e11('0x26')](respondWithResult(_0x389c7c,0xc9))['catch'](handleError(_0x389c7c,null));};exports[_0x4e11('0xb4')]=function(_0x27abbf,_0x5ed785){if(_0x27abbf['body']['id']){delete _0x27abbf[_0x4e11('0x6e')]['id'];}return db[_0x4e11('0x32')][_0x4e11('0x5a')]({'where':{'id':_0x27abbf[_0x4e11('0xae')]['id']}})[_0x4e11('0x26')](handleEntityNotFound(_0x5ed785,null))[_0x4e11('0x26')](saveUpdates(_0x27abbf[_0x4e11('0x6e')],null))[_0x4e11('0x26')](respondWithResult(_0x5ed785,null))['catch'](handleError(_0x5ed785,null));};exports['destroy']=function(_0xc906dd,_0x1fb2bc){return db[_0x4e11('0x32')][_0x4e11('0x5a')]({'where':{'id':_0xc906dd['params']['id']}})[_0x4e11('0x26')](handleEntityNotFound(_0x1fb2bc,null))[_0x4e11('0x26')](removeEntity(_0x1fb2bc,null))['catch'](handleError(_0x1fb2bc,null));};exports[_0x4e11('0xb5')]=function(_0x108e69,_0x4d1e63){return db[_0x4e11('0x32')]['describe']()['then'](respondWithResult(_0x4d1e63,null))[_0x4e11('0xac')](handleError(_0x4d1e63,null));};exports['addMessage']=function(_0x2afcc3,_0x173202,_0xdb15a0){return db['FaxMessage']['find']({'where':{'id':_0x2afcc3[_0x4e11('0xae')]['id']}})['then'](handleEntityNotFound(_0x173202,null))[_0x4e11('0x26')](function(_0x1c52d3){if(_0x1c52d3){return _0x1c52d3['addMessage'](_0x2afcc3[_0x4e11('0x6e')][_0x4e11('0xb6')],_[_0x4e11('0xb7')](_0x2afcc3[_0x4e11('0x6e')],[_0x4e11('0xb6'),'id'])||{});}})[_0x4e11('0x26')](respondWithResult(_0x173202,null))[_0x4e11('0xac')](handleError(_0x173202,null));};exports['getMessages']=function(_0x409ef4,_0x2e673b,_0x37baa0){var _0x380c2a={'raw':![],'where':{}};var _0x2fe431={};var _0x1f6abd={'count':0x0,'rows':[]};return db[_0x4e11('0x32')][_0x4e11('0xb8')]({'where':{'id':_0x409ef4[_0x4e11('0xae')]['id']}})[_0x4e11('0x26')](handleEntityNotFound(_0x2e673b,null))[_0x4e11('0x26')](function(_0x16047f){if(_0x16047f){_0x2fe431[_0x4e11('0x36')]=_[_0x4e11('0x37')](db[_0x4e11('0xb9')][_0x4e11('0xaf')]);_0x2fe431['query']=_['keys'](_0x409ef4[_0x4e11('0x38')]);_0x2fe431[_0x4e11('0x42')]=_[_0x4e11('0x39')](_0x2fe431[_0x4e11('0x36')],_0x2fe431[_0x4e11('0x38')]);_0x380c2a[_0x4e11('0x3b')]=_['intersection'](_0x2fe431[_0x4e11('0x36')],qs[_0x4e11('0x3a')](_0x409ef4['query'][_0x4e11('0x3a')]));_0x380c2a[_0x4e11('0x3b')]=_0x380c2a[_0x4e11('0x3b')]['length']?_0x380c2a[_0x4e11('0x3b')]:_0x2fe431[_0x4e11('0x36')];if(!_0x409ef4[_0x4e11('0x38')]['hasOwnProperty'](_0x4e11('0x3d'))){_0x380c2a[_0x4e11('0x20')]=qs[_0x4e11('0x20')](_0x409ef4[_0x4e11('0x38')]['limit']);_0x380c2a[_0x4e11('0x1e')]=qs[_0x4e11('0x1e')](_0x409ef4[_0x4e11('0x38')]['offset']);}_0x380c2a['order']=qs[_0x4e11('0x3f')](_0x409ef4[_0x4e11('0x38')][_0x4e11('0x3f')]);_0x380c2a['where']=qs['filters'](_[_0x4e11('0x41')](_0x409ef4[_0x4e11('0x38')],_0x2fe431[_0x4e11('0x42')]));_0x380c2a[_0x4e11('0x40')]['FaxInteractionId']=_0x16047f['id'];if(_0x409ef4[_0x4e11('0x38')][_0x4e11('0x80')]){_0x380c2a['where']=_[_0x4e11('0xba')](_0x380c2a['where'],{'$or':_[_0x4e11('0x31')](_0x380c2a[_0x4e11('0x3b')],function(_0x47f3a2){var _0x4b430f={};_0x4b430f[_0x47f3a2]={'$like':'%'+_0x409ef4['query']['filter']+'%'};return _0x4b430f;})});}if(_0x409ef4['query'][_0x4e11('0x74')]){var _0xb94fd2=_0x409ef4[_0x4e11('0x38')][_0x4e11('0x74')][_0x4e11('0x62')](',');var _0x34a6ed={};_0x34a6ed[_0xb94fd2[0x0]]={'$gte':moment(_0xb94fd2[0x1])['format'](_0x4e11('0xbb'))};_0x380c2a[_0x4e11('0x40')]=_[_0x4e11('0xba')](_0x380c2a[_0x4e11('0x40')],_0x34a6ed);}_0x380c2a=_['merge']({},_0x380c2a,_0x409ef4[_0x4e11('0xb2')]);return db[_0x4e11('0xb9')][_0x4e11('0x21')]({'where':_0x380c2a[_0x4e11('0x40')]})[_0x4e11('0x26')](function(_0x28d165){_0x1f6abd[_0x4e11('0x21')]=_0x28d165;if(_0x409ef4[_0x4e11('0x38')][_0x4e11('0xb0')]){_0x380c2a[_0x4e11('0xb1')]=[{'all':!![]}];}return db[_0x4e11('0xb9')][_0x4e11('0xbc')](_0x380c2a);})[_0x4e11('0x26')](function(_0x18e7db){_0x1f6abd[_0x4e11('0xab')]=_0x18e7db;return _0x1f6abd;});}})[_0x4e11('0x26')](respondWithFilteredResult(_0x2e673b,_0x380c2a))['catch'](handleError(_0x2e673b,null));};exports[_0x4e11('0xbd')]=function(_0x577c0a,_0x5e9223,_0x56839a){return db[_0x4e11('0x32')]['find']({'where':{'id':_0x577c0a['params']['id']}})[_0x4e11('0x26')](handleEntityNotFound(_0x5e9223,null))[_0x4e11('0x26')](function(_0x5761cb){if(_0x5761cb){return _0x5761cb['setTags'](_0x577c0a['body']['ids'],_['omit'](_0x577c0a[_0x4e11('0x6e')],['ids','id'])||{})['spread'](function(){return db[_0x4e11('0xbe')][_0x4e11('0xbc')]({'attributes':['id',_0x4e11('0x2a'),'color'],'where':{'id':_0x577c0a['body'][_0x4e11('0xb6')]}});})[_0x4e11('0x26')](function(_0x4c2869){socket[_0x4e11('0xbf')](_0x4e11('0xc0'),{'id':Number(_0x577c0a[_0x4e11('0xae')]['id']),'tags':_0x4c2869||[]});return{'id':Number(_0x577c0a['params']['id']),'tags':_0x4c2869||[]};});}})[_0x4e11('0x26')](respondWithResult(_0x5e9223,null))[_0x4e11('0xac')](handleError(_0x5e9223,null));};exports[_0x4e11('0xc1')]=function(_0xf7e85f,_0x59f567,_0x4c927a){return db[_0x4e11('0x32')][_0x4e11('0x5a')]({'where':{'id':_0xf7e85f[_0x4e11('0xae')]['id']}})[_0x4e11('0x26')](handleEntityNotFound(_0x59f567,null))['then'](function(_0x324d75){if(_0x324d75){return _0x324d75[_0x4e11('0xc1')](_0xf7e85f['query'][_0x4e11('0xb6')]);}})[_0x4e11('0x26')](respondWithStatusCode(_0x59f567,null))[_0x4e11('0xac')](handleError(_0x59f567,null));};exports[_0x4e11('0xc2')]=function(_0x355a80,_0x54166f){var _0x1ae679=moment()['unix']()['toString']();var _0x1f11f7=path[_0x4e11('0xc3')](config[_0x4e11('0xc4')],_0x4e11('0xc5'),'files','tmp');var _0x7e36b7=path[_0x4e11('0xc3')](config[_0x4e11('0xc4')],'server',_0x4e11('0xc6'),'attachments');var _0x4fe217=path['join'](_0x1f11f7,_0x1ae679);var _0xdd2a90=util['format'](_0x4e11('0xc7'),_0x355a80[_0x4e11('0xae')]['id'],_0x1ae679);var _0x39478b=path['join'](_0x1f11f7,_0xdd2a90);var _0x4b5fbc=[];_0x4b5fbc[_0x4e11('0xa9')]({'model':db['Attachment'],'as':_0x4e11('0xc8'),'raw':!![]});var _0x17f22b=[{'model':db[_0x4e11('0xb9')],'as':_0x4e11('0xc9'),'attributes':['id',_0x4e11('0x6e'),_0x4e11('0x73')],'include':_0x4b5fbc}];return db['FaxInteraction']['find']({'where':{'id':_0x355a80['params']['id']},'include':_0x17f22b})[_0x4e11('0x26')](handleEntityNotFound(_0x54166f,null))[_0x4e11('0x26')](function(_0xa90203){if(_0xa90203&&_0xa90203[_0x4e11('0xc9')]){var _0x4e4ef5=_0xa90203['get']({'plain':!![]});fs[_0x4e11('0xca')](_0x4fe217);for(var _0xf4eedc=0x0;_0xf4eedc<_0x4e4ef5[_0x4e11('0xc9')]['length'];_0xf4eedc++){var _0x748f3b=_0x4e4ef5[_0x4e11('0xc9')][_0xf4eedc][_0x4e11('0xc8')];if(_0x748f3b){var _0x43df2f=path[_0x4e11('0xc3')](_0x7e36b7,_0x748f3b['basename']);if(fs[_0x4e11('0xcb')](_0x43df2f)){fs[_0x4e11('0xcc')](_0x43df2f)['pipe'](fs['createWriteStream'](path['join'](_0x4fe217,_0x748f3b[_0x4e11('0xcd')])));}}}return BPromise[_0x4e11('0x8a')]()[_0x4e11('0x26')](function(){return new BPromise(function(_0x59e510,_0x1c6c74){zipdir(_0x4fe217,{'saveTo':_0x39478b},function(_0x19e268,_0x2df137){if(_0x19e268)return _0x1c6c74(_0x19e268);return _0x59e510(_0x2df137);});})[_0x4e11('0x26')](function(){return new BPromise(function(_0x157709,_0x2b8f8b){rimraf(_0x4fe217,function(_0x47b289){if(_0x47b289)_0x2b8f8b(_0x47b289);return _0x157709();});});})[_0x4e11('0x26')](function(){return _0x54166f[_0x4e11('0xc2')](_0x39478b,_0xdd2a90,function(_0x4aa3f6){if(_0x4aa3f6){console['log']('err',_0x4aa3f6);}else{fs[_0x4e11('0xce')](_0x39478b);}});});});}else{return _0x54166f['sendStatus'](0xc8);}})[_0x4e11('0xac')](handleError(_0x54166f,null));}; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 1b87016..55b441f 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 _0xe1da=['../../mysqldb','FaxMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hook','exports','events'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xe1da,0x10f));var _0xae1d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe1da[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xae1d('0x0'));var FaxInteraction=require(_0xae1d('0x1'))['db']['FaxInteraction'];var FaxMessage=require('../../mysqldb')['db'][_0xae1d('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xae1d('0x3')](0x0);var events={'afterCreate':_0xae1d('0x4'),'afterUpdate':'update','afterDestroy':_0xae1d('0x5')};function emitEvent(_0x57695e){return function(_0x38b33f,_0x4c150a,_0x453312){_0x38b33f[_0xae1d('0x6')]({'attributes':['id'],'raw':!![]})[_0xae1d('0x7')](function(_0x3d01d4){_0x38b33f[_0xae1d('0x8')](_0xae1d('0x9'),_0x3d01d4['map'](function(_0x3f2a61){return{'id':_0x3f2a61['id']};}));return FaxMessage[_0xae1d('0xa')]({'where':{'FaxInteractionId':_0x38b33f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xae1d('0x7')](function(_0x4cedab){_0x38b33f[_0xae1d('0x8')](_0xae1d('0xb'),_0x4cedab[_0xae1d('0xc')]);FaxInteractionEvents[_0xae1d('0xd')](_0x57695e+':'+_0x38b33f['id'],_0x38b33f);FaxInteractionEvents['emit'](_0x57695e,_0x38b33f);_0x453312(null);})[_0xae1d('0xe')](_0x453312(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xae1d('0xf')](e,emitEvent(event));}}module[_0xae1d('0x10')]=FaxInteractionEvents; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 051a9ad..f5e243d 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 _0x3089=['FaxInteraction','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','./faxInteraction.attributes','exports'];(function(_0x567f5b,_0x1ccf7e){var _0x325458=function(_0x4ddf2e){while(--_0x4ddf2e){_0x567f5b['push'](_0x567f5b['shift']());}};_0x325458(++_0x1ccf7e);}(_0x3089,0x19c));var _0x9308=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x3089[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x9308('0x0'));var util=require(_0x9308('0x1'));var logger=require(_0x9308('0x2'))(_0x9308('0x3'));var moment=require(_0x9308('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9308('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9308('0x6'));module[_0x9308('0x7')]=function(_0x49f907,_0x50cb01){return _0x49f907['define'](_0x9308('0x8'),attributes,{'tableName':_0x9308('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x511286,_0x4c98ec,_0xaa8a3a){if(_0x511286['changed'](_0x9308('0xa'))){_0x511286[_0x9308('0xb')]=moment()[_0x9308('0xc')](_0x9308('0xd'));}_0xaa8a3a(null,_0x511286);}}});}; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 5ad0982..ef1df2c 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 _0x7aac=['./faxInteraction.socket','request','info','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxInteraction,\x20%s,\x20%s','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','then','addTags','omit','ids','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','localhost','redis'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0x7aac,0x66));var _0xc7aa=function(_0x27111c,_0x39dc4f){_0x27111c=_0x27111c-0x0;var _0x251f30=_0x7aac[_0x27111c];return _0x251f30;};'use strict';var _=require(_0xc7aa('0x0'));var util=require(_0xc7aa('0x1'));var moment=require(_0xc7aa('0x2'));var BPromise=require(_0xc7aa('0x3'));var rs=require(_0xc7aa('0x4'));var fs=require('fs');var Redis=require(_0xc7aa('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc7aa('0x6'))(_0xc7aa('0x7'));var config=require(_0xc7aa('0x8'));var jayson=require(_0xc7aa('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc7aa('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc7aa('0xb')]));require(_0xc7aa('0xc'))['register'](socket);function respondWithRpcPromise(_0x5e5e2f,_0x1f515b,_0x1cf863){return new BPromise(function(_0x1c1ac6,_0x3ee6da){return client[_0xc7aa('0xd')](_0x5e5e2f,_0x1cf863)['then'](function(_0xbc1ebd){logger[_0xc7aa('0xe')]('FaxInteraction,\x20%s,\x20%s',_0x1f515b,_0xc7aa('0xf'));logger['debug'](_0xc7aa('0x10'),_0x1f515b,_0xc7aa('0xf'),JSON[_0xc7aa('0x11')](_0xbc1ebd));if(_0xbc1ebd[_0xc7aa('0x12')]){if(_0xbc1ebd[_0xc7aa('0x12')][_0xc7aa('0x13')]===0x1f4){logger[_0xc7aa('0x12')](_0xc7aa('0x14'),_0x1f515b,_0xbc1ebd['error']['message']);return _0x3ee6da(_0xbc1ebd[_0xc7aa('0x12')][_0xc7aa('0x15')]);}logger[_0xc7aa('0x12')](_0xc7aa('0x14'),_0x1f515b,_0xbc1ebd[_0xc7aa('0x12')][_0xc7aa('0x15')]);return _0x1c1ac6(_0xbc1ebd[_0xc7aa('0x12')][_0xc7aa('0x15')]);}else{logger[_0xc7aa('0xe')](_0xc7aa('0x14'),_0x1f515b,'request\x20sent');_0x1c1ac6(_0xbc1ebd[_0xc7aa('0x16')][_0xc7aa('0x15')]);}})[_0xc7aa('0x17')](function(_0x3e44e8){logger[_0xc7aa('0x12')](_0xc7aa('0x14'),_0x1f515b,_0x3e44e8);_0x3ee6da(_0x3e44e8);});});}exports[_0xc7aa('0x18')]=function(_0x50e544){var _0x327ed4=this;return new Promise(function(_0x25925f,_0x5d1eff){return db[_0xc7aa('0x19')][_0xc7aa('0x1a')](_0x50e544[_0xc7aa('0x1b')],{'raw':_0x50e544[_0xc7aa('0x1c')]?_0x50e544['options'][_0xc7aa('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50e544[_0xc7aa('0x1c')]?_0x50e544[_0xc7aa('0x1c')][_0xc7aa('0x1e')]||null:null,'attributes':_0x50e544[_0xc7aa('0x1c')]?_0x50e544['options'][_0xc7aa('0x1f')]||null:null,'limit':_0x50e544['options']?_0x50e544[_0xc7aa('0x1c')]['limit']||null:null})[_0xc7aa('0x20')](function(_0x3077cb){logger[_0xc7aa('0xe')](_0xc7aa('0x18'),_0x50e544);logger['debug'](_0xc7aa('0x18'),_0x50e544,JSON[_0xc7aa('0x11')](_0x3077cb));_0x25925f(_0x3077cb);})[_0xc7aa('0x17')](function(_0x4eb86a){logger[_0xc7aa('0x12')](_0xc7aa('0x18'),_0x4eb86a['message'],_0x50e544);_0x5d1eff(_0x327ed4['error'](0x1f4,_0x4eb86a[_0xc7aa('0x15')]));});});};exports['AddTagsToFaxInteraction']=function(_0x14d024){return new Promise(function(_0x41a599,_0x27844a){return db[_0xc7aa('0x19')]['find']({'where':_0x14d024['options']?_0x14d024['options'][_0xc7aa('0x1e')]||null:null})[_0xc7aa('0x20')](function(_0x167aec){if(_0x167aec){return _0x167aec[_0xc7aa('0x21')](_0x14d024[_0xc7aa('0x1b')]['ids'],_[_0xc7aa('0x22')](_0x14d024[_0xc7aa('0x1b')],[_0xc7aa('0x23'),'id'])||{});}})['spread'](function(_0x4a97a6){logger['info'](_0xc7aa('0x24'),_0x14d024);logger[_0xc7aa('0x25')](_0xc7aa('0x24'),_0x14d024,JSON[_0xc7aa('0x11')](_0x4a97a6));_0x41a599(_0x4a97a6);})[_0xc7aa('0x17')](function(_0x5ace4d){logger[_0xc7aa('0x12')]('AddTags',_0x5ace4d[_0xc7aa('0x15')],_0x14d024);_0x27844a(_this[_0xc7aa('0x12')](0x1f4,_0x5ace4d[_0xc7aa('0x15')]));});});}; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 15d2d61..ca8ecef 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 _0x0f91=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x342ca1,_0x208095){var _0x49e2fd=function(_0xd8e094){while(--_0xd8e094){_0x342ca1['push'](_0x342ca1['shift']());}};_0x49e2fd(++_0x208095);}(_0x0f91,0x16a));var _0x10f9=function(_0x2f8619,_0x195689){_0x2f8619=_0x2f8619-0x0;var _0x13b303=_0x0f91[_0x2f8619];return _0x13b303;};'use strict';var FaxInteractionEvents=require(_0x10f9('0x0'));var events=[_0x10f9('0x1'),_0x10f9('0x2'),_0x10f9('0x3')];function createListener(_0x3c70c6,_0x48f270){return function(_0x5617e1){_0x48f270[_0x10f9('0x4')](_0x3c70c6,_0x5617e1);};}function removeListener(_0x39e173,_0x55c36c){return function(){FaxInteractionEvents[_0x10f9('0x5')](_0x39e173,_0x55c36c);};}exports[_0x10f9('0x6')]=function(_0x3db501){for(var _0x476e8f=0x0,_0x3dd372=events[_0x10f9('0x7')];_0x476e8f<_0x3dd372;_0x476e8f++){var _0x4ae9e1=events[_0x476e8f];var _0x2e91e1=createListener(_0x10f9('0x8')+_0x4ae9e1,_0x3db501);FaxInteractionEvents['on'](_0x4ae9e1,_0x2e91e1);}}; \ No newline at end of file +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 diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index bc05a9d..81ec485 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 _0x408e=['/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','fax','faxinteraction:addtags','put','tracked','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get'];(function(_0x32a01c,_0x288e8f){var _0x4868dd=function(_0x1cbf41){while(--_0x1cbf41){_0x32a01c['push'](_0x32a01c['shift']());}};_0x4868dd(++_0x288e8f);}(_0x408e,0x1d3));var _0xe408=function(_0x35c97a,_0x513aba){_0x35c97a=_0x35c97a-0x0;var _0x388917=_0x408e[_0x35c97a];return _0x388917;};'use strict';var multer=require('multer');var util=require(_0xe408('0x0'));var path=require(_0xe408('0x1'));var timeout=require('connect-timeout');var express=require(_0xe408('0x2'));var router=express[_0xe408('0x3')]();var fs_extra=require(_0xe408('0x4'));var auth=require(_0xe408('0x5'));var interaction=require(_0xe408('0x6'));var config=require(_0xe408('0x7'));var controller=require('./faxInteraction.controller');router['get']('/',auth[_0xe408('0x8')](),controller[_0xe408('0x9')]);router['get'](_0xe408('0xa'),auth['isAuthenticated'](),controller[_0xe408('0xb')]);router[_0xe408('0xc')](_0xe408('0xd'),auth[_0xe408('0x8')](),controller[_0xe408('0xe')]);router[_0xe408('0xc')](_0xe408('0xf'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xe408('0x10'),auth[_0xe408('0x8')](),controller[_0xe408('0x11')]);router[_0xe408('0x12')]('/',auth['isAuthenticated'](),controller[_0xe408('0x13')]);router[_0xe408('0x12')](_0xe408('0xf'),auth[_0xe408('0x8')](),controller[_0xe408('0x14')]);router[_0xe408('0x12')]('/:id/tags',auth[_0xe408('0x8')](),interaction['tracked'](_0xe408('0x15'),_0xe408('0x16')),controller['addTags']);router[_0xe408('0x17')](_0xe408('0xd'),auth[_0xe408('0x8')](),interaction[_0xe408('0x18')](_0xe408('0x15'),_0xe408('0x19')),controller[_0xe408('0x1a')]);router[_0xe408('0x1b')]('/:id',auth[_0xe408('0x8')](),interaction[_0xe408('0x18')]('fax',_0xe408('0x1c')),controller[_0xe408('0x1d')]);router['delete']('/:id/tags',auth[_0xe408('0x8')](),controller[_0xe408('0x1e')]);module[_0xe408('0x1f')]=router; \ No newline at end of file +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 diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ddb0d3f..fb23f58 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 _0x28a2=['exports','TEXT','medium','BOOLEAN','ENUM','out','sequelize'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x228a('0x0'));module[_0x228a('0x1')]={'body':{'type':Sequelize[_0x228a('0x2')](_0x228a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x228a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x228a('0x5')]('in',_0x228a('0x6')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x228a('0x2')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +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 diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d828db7..dd9c375 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 _0x857e=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','body','describe','accept','fax','read','readAt','format','UserId','user','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','fax-interactions','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','User','rejectmessage','create','Attachment','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','debug','FaxMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x857e,0xdd));var _0xe857=function(_0x4b0290,_0x188c34){_0x4b0290=_0x4b0290-0x0;var _0x4bd9f4=_0x857e[_0x4b0290];return _0x4bd9f4;};'use strict';var emlformat=require(_0xe857('0x0'));var rimraf=require(_0xe857('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe857('0x2'));var rp=require(_0xe857('0x3'));var moment=require(_0xe857('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe857('0x5'));var util=require(_0xe857('0x6'));var path=require(_0xe857('0x7'));var sox=require(_0xe857('0x8'));var csv=require('to-csv');var ejs=require(_0xe857('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe857('0xa'));var crypto=require('crypto');var jsforce=require(_0xe857('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe857('0xc'));var Papa=require(_0xe857('0xd'));var Redis=require(_0xe857('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe857('0xf'));var as=require(_0xe857('0x10'));var hardwareService=require(_0xe857('0x11'));var logger=require(_0xe857('0x12'))(_0xe857('0x13'));var utils=require(_0xe857('0x14'));var config=require(_0xe857('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe857('0x16'))['db'];config[_0xe857('0x17')]=_[_0xe857('0x18')](config[_0xe857('0x17')],{'host':_0xe857('0x19'),'port':0x18eb});var socket=require(_0xe857('0x1a'))(new Redis(config['redis']));require(_0xe857('0x1b'))[_0xe857('0x1c')](socket);var jayson=require(_0xe857('0x1d'));var client=jayson[_0xe857('0x1e')][_0xe857('0x1f')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4a5067,_0x39a030,_0x85e5e3,_0x106a5c){return new BPromise(function(_0x4fcdb5,_0x5710f7){var _0x4398ce=_0x106a5c||client;return _0x4398ce[_0xe857('0x20')](_0x4a5067,_0x85e5e3)['then'](function(_0x5f0196){logger[_0xe857('0x21')](_0xe857('0x22'),_0x39a030,'request\x20sent');logger[_0xe857('0x23')](_0xe857('0x24'),_0x39a030,_0xe857('0x25'),JSON['stringify'](_0x5f0196));if(_0x5f0196[_0xe857('0x26')]){if(_0x5f0196[_0xe857('0x26')][_0xe857('0x27')]===0x1f4){logger[_0xe857('0x26')](_0xe857('0x22'),_0x39a030,_0x5f0196[_0xe857('0x26')][_0xe857('0x28')]);return _0x5710f7(_0x5f0196['error'][_0xe857('0x28')]);}logger['error'](_0xe857('0x22'),_0x39a030,_0x5f0196[_0xe857('0x26')][_0xe857('0x28')]);return _0x4fcdb5(_0x5f0196['error'][_0xe857('0x28')]);}else{logger[_0xe857('0x21')]('FaxMessage,\x20%s,\x20%s',_0x39a030,'request\x20sent');_0x4fcdb5(_0x5f0196[_0xe857('0x29')][_0xe857('0x28')]);}})[_0xe857('0x2a')](function(_0x149c81){logger['error']('FaxMessage,\x20%s,\x20%s',_0x39a030,_0x149c81);_0x5710f7(_0x149c81);});});}function respondWithStatusCode(_0x2bc76f,_0x53ff5a){_0x53ff5a=_0x53ff5a||0xcc;return function(_0x14286c){if(_0x14286c){return _0x2bc76f['sendStatus'](_0x53ff5a);}return _0x2bc76f[_0xe857('0x2b')](_0x53ff5a)['end']();};}function respondWithResult(_0x17268e,_0xc29c11){_0xc29c11=_0xc29c11||0xc8;return function(_0x2df643){if(_0x2df643){return _0x17268e[_0xe857('0x2b')](_0xc29c11)[_0xe857('0x2c')](_0x2df643);}};}function respondWithFilteredResult(_0x42be6e,_0x3c3416){return function(_0x40248b){if(_0x40248b){var _0x27471e=typeof _0x3c3416[_0xe857('0x2d')]===_0xe857('0x2e')&&typeof _0x3c3416[_0xe857('0x2f')]==='undefined';var _0x3d0608=_0x40248b[_0xe857('0x30')];var _0x199e53=_0x27471e?0x0:_0x3c3416[_0xe857('0x2d')];var _0x5e63af=_0x27471e?_0x40248b['count']:_0x3c3416[_0xe857('0x2d')]+_0x3c3416[_0xe857('0x2f')];var _0x58d3b2;if(_0x5e63af>=_0x3d0608){_0x5e63af=_0x3d0608;_0x58d3b2=0xc8;}else{_0x58d3b2=0xce;}_0x42be6e['status'](_0x58d3b2);return _0x42be6e[_0xe857('0x31')](_0xe857('0x32'),_0x199e53+'-'+_0x5e63af+'/'+_0x3d0608)['json'](_0x40248b);}return null;};}function patchUpdates(_0x1dd4c3){return function(_0x453d22){try{jsonpatch['apply'](_0x453d22,_0x1dd4c3,!![]);}catch(_0x276b66){return BPromise[_0xe857('0x33')](_0x276b66);}return _0x453d22[_0xe857('0x34')]();};}function saveUpdates(_0x3990b5,_0x14ea69){return function(_0x1d3ee3){if(_0x1d3ee3){return _0x1d3ee3[_0xe857('0x35')](_0x3990b5)['then'](function(_0x22e6d7){return _0x22e6d7;});}return null;};}function removeEntity(_0x2a9b3d,_0x3e126e){return function(_0x41dfd8){if(_0x41dfd8){return _0x41dfd8[_0xe857('0x36')]()[_0xe857('0x37')](function(){_0x2a9b3d[_0xe857('0x2b')](0xcc)[_0xe857('0x38')]();});}};}function handleEntityNotFound(_0x53d080,_0x58c2e4){return function(_0x38eddb){if(!_0x38eddb){_0x53d080[_0xe857('0x39')](0x194);}return _0x38eddb;};}function handleError(_0x9ce0c0,_0x20f1f6){_0x20f1f6=_0x20f1f6||0x1f4;return function(_0x467a8e){logger[_0xe857('0x26')](_0x467a8e[_0xe857('0x3a')]);if(_0x467a8e[_0xe857('0x3b')]){delete _0x467a8e[_0xe857('0x3b')];}_0x9ce0c0['status'](_0x20f1f6)[_0xe857('0x3c')](_0x467a8e);};}exports[_0xe857('0x3d')]=function(_0x208412,_0x266c3b){var _0x194a1e={},_0x17e388={},_0x48e41e={'count':0x0,'rows':[]};var _0x2b72fb=_[_0xe857('0x3e')](db[_0xe857('0x3f')][_0xe857('0x40')],function(_0x3d6095){return{'name':_0x3d6095[_0xe857('0x41')],'type':_0x3d6095[_0xe857('0x42')]['key']};});_0x17e388['model']=_[_0xe857('0x3e')](_0x2b72fb,_0xe857('0x3b'));_0x17e388[_0xe857('0x43')]=_[_0xe857('0x44')](_0x208412[_0xe857('0x43')]);_0x17e388[_0xe857('0x45')]=_[_0xe857('0x46')](_0x17e388[_0xe857('0x47')],_0x17e388['query']);_0x194a1e[_0xe857('0x48')]=_[_0xe857('0x46')](_0x17e388[_0xe857('0x47')],qs['fields'](_0x208412[_0xe857('0x43')][_0xe857('0x49')]));_0x194a1e[_0xe857('0x48')]=_0x194a1e['attributes'][_0xe857('0x4a')]?_0x194a1e[_0xe857('0x48')]:_0x17e388[_0xe857('0x47')];if(!_0x208412['query'][_0xe857('0x4b')](_0xe857('0x4c'))){_0x194a1e[_0xe857('0x2f')]=qs[_0xe857('0x2f')](_0x208412[_0xe857('0x43')][_0xe857('0x2f')]);_0x194a1e[_0xe857('0x2d')]=qs[_0xe857('0x2d')](_0x208412[_0xe857('0x43')][_0xe857('0x2d')]);}_0x194a1e[_0xe857('0x4d')]=qs[_0xe857('0x4e')](_0x208412['query'][_0xe857('0x4e')]);_0x194a1e['where']=qs[_0xe857('0x45')](_[_0xe857('0x4f')](_0x208412['query'],_0x17e388[_0xe857('0x45')]),_0x2b72fb);if(_0x208412[_0xe857('0x43')][_0xe857('0x50')]){_0x194a1e[_0xe857('0x51')]=_['merge'](_0x194a1e[_0xe857('0x51')],{'$or':_[_0xe857('0x3e')](_0x2b72fb,function(_0x533dc7){if(_0x533dc7[_0xe857('0x42')]!==_0xe857('0x52')){var _0x18bbe5={};_0x18bbe5[_0x533dc7[_0xe857('0x3b')]]={'$like':'%'+_0x208412[_0xe857('0x43')]['filter']+'%'};return _0x18bbe5;}})});}_0x194a1e=_[_0xe857('0x53')]({},_0x194a1e,_0x208412[_0xe857('0x54')]);var _0x4d4511={'where':_0x194a1e['where']};return db[_0xe857('0x3f')][_0xe857('0x30')](_0x4d4511)[_0xe857('0x37')](function(_0x4c9cb5){_0x48e41e['count']=_0x4c9cb5;if(_0x208412[_0xe857('0x43')]['includeAll']){_0x194a1e[_0xe857('0x55')]=[{'all':!![]}];}return db[_0xe857('0x3f')]['findAll'](_0x194a1e);})[_0xe857('0x37')](function(_0x509dc1){_0x48e41e[_0xe857('0x56')]=_0x509dc1;return _0x48e41e;})[_0xe857('0x37')](respondWithFilteredResult(_0x266c3b,_0x194a1e))[_0xe857('0x2a')](handleError(_0x266c3b,null));};exports[_0xe857('0x57')]=function(_0x2369a5,_0x4b86d4){var _0x1cbc87={'raw':!![],'where':{'id':_0x2369a5[_0xe857('0x58')]['id']}},_0x329131={};_0x329131[_0xe857('0x47')]=_[_0xe857('0x44')](db[_0xe857('0x3f')][_0xe857('0x40')]);_0x329131[_0xe857('0x43')]=_['keys'](_0x2369a5['query']);_0x329131[_0xe857('0x45')]=_[_0xe857('0x46')](_0x329131[_0xe857('0x47')],_0x329131['query']);_0x1cbc87[_0xe857('0x48')]=_['intersection'](_0x329131[_0xe857('0x47')],qs[_0xe857('0x49')](_0x2369a5[_0xe857('0x43')][_0xe857('0x49')]));_0x1cbc87['attributes']=_0x1cbc87[_0xe857('0x48')][_0xe857('0x4a')]?_0x1cbc87['attributes']:_0x329131[_0xe857('0x47')];if(_0x2369a5['query'][_0xe857('0x59')]){_0x1cbc87['include']=[{'all':!![]}];}_0x1cbc87=_[_0xe857('0x53')]({},_0x1cbc87,_0x2369a5[_0xe857('0x54')]);return db[_0xe857('0x3f')][_0xe857('0x5a')](_0x1cbc87)[_0xe857('0x37')](handleEntityNotFound(_0x4b86d4,null))['then'](respondWithResult(_0x4b86d4,null))[_0xe857('0x2a')](handleError(_0x4b86d4,null));};exports['update']=function(_0x4b6dc5,_0x322061){if(_0x4b6dc5[_0xe857('0x5b')]['id']){delete _0x4b6dc5[_0xe857('0x5b')]['id'];}return db['FaxMessage'][_0xe857('0x5a')]({'where':{'id':_0x4b6dc5[_0xe857('0x58')]['id']}})['then'](handleEntityNotFound(_0x322061,null))['then'](saveUpdates(_0x4b6dc5['body'],null))[_0xe857('0x37')](respondWithResult(_0x322061,null))['catch'](handleError(_0x322061,null));};exports['destroy']=function(_0xf9262c,_0x527ecc){return db[_0xe857('0x3f')]['find']({'where':{'id':_0xf9262c[_0xe857('0x58')]['id']}})[_0xe857('0x37')](handleEntityNotFound(_0x527ecc,null))[_0xe857('0x37')](removeEntity(_0x527ecc,null))['catch'](handleError(_0x527ecc,null));};exports[_0xe857('0x5c')]=function(_0x45f67f,_0x49a36b){return db[_0xe857('0x3f')][_0xe857('0x5c')]()['then'](respondWithResult(_0x49a36b,null))[_0xe857('0x2a')](handleError(_0x49a36b,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xe857('0x5d')]=function(_0x501525,_0x2ebbf7,_0x53ad02){var _0x18e1b0={'agent':{},'channel':_0xe857('0x5e')};if(_0x501525[_0xe857('0x5b')]['id']){delete _0x501525[_0xe857('0x5b')]['id'];}_0x501525[_0xe857('0x5b')][_0xe857('0x5f')]=!![];_0x501525['body'][_0xe857('0x60')]=moment()[_0xe857('0x61')]('YYYY-MM-DD\x20HH:mm:ss');_0x501525[_0xe857('0x5b')]['UserId']=_0x501525[_0xe857('0x5b')][_0xe857('0x62')]||_0x501525[_0xe857('0x63')]['id'];_0x18e1b0['agent']['id']=_0x501525[_0xe857('0x5b')][_0xe857('0x62')];return db[_0xe857('0x3f')]['find']({'where':{'id':_0x501525['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ebbf7,null))[_0xe857('0x37')](saveUpdates(_0x501525[_0xe857('0x5b')],null))[_0xe857('0x37')](function(_0x4f3939){if(_0x4f3939){_0x18e1b0[_0xe857('0x28')]=_0x4f3939[_0xe857('0x64')]({'plain':!![]});return db[_0xe857('0x65')][_0xe857('0x5a')]({'where':{'id':_0x4f3939[_0xe857('0x66')]}});}return null;})[_0xe857('0x37')](handleEntityNotFound(_0x2ebbf7,null))['then'](function(_0x42b0d8){if(_0x42b0d8){return _0x42b0d8['update']({'UserId':_0x501525[_0xe857('0x5b')]['UserId'],'read1stAt':_[_0xe857('0x67')](_0x42b0d8[_0xe857('0x68')])?moment()[_0xe857('0x61')](_0xe857('0x69')):undefined});}return null;})[_0xe857('0x37')](function(_0x3ac4b6){if(_0x3ac4b6){_0x18e1b0['interaction']=_0x3ac4b6[_0xe857('0x64')]({'plain':!![]});interaction_log[_0xe857('0x21')](_0xe857('0x6a'),_0x501525[_0xe857('0x63')]['id'],_0x501525[_0xe857('0x63')]['name'],_0x501525[_0xe857('0x63')][_0xe857('0x6b')],_0x18e1b0[_0xe857('0x6c')]['id'],_0x501525[_0xe857('0x5b')]?JSON['stringify'](_0x501525[_0xe857('0x5b')]):_0xe857('0x6d'));return respondWithRpcPromise(_0xe857('0x6e'),_0xe857('0x6f'),_0x18e1b0);}return null;})['then'](function(_0x35bd4d){var _0x52ee31=_0xe857('0x70')+_0x35bd4d[_0xe857('0x28')][_0xe857('0x71')];return db[_0xe857('0x72')][_0xe857('0x43')](_0x52ee31,{'type':db[_0xe857('0x73')][_0xe857('0x74')][_0xe857('0x75')],'raw':!![]})[_0xe857('0x37')](function(_0x33c727){return _0x33c727;});})[_0xe857('0x37')](function(_0x3df6a6){if(_0x3df6a6){_0x18e1b0['message'][_0xe857('0x76')]=_0x3df6a6[0x0];if(!_0x501525[_0xe857('0x5b')]['UserId'])return;return db['User'][_0xe857('0x5a')]({'where':{'id':_0x501525['body'][_0xe857('0x62')],'role':_0xe857('0x77')},'attributes':['id','name',_0xe857('0x78'),_0xe857('0x79'),_0xe857('0x7a')],'raw':!![]});}return null;})['then'](function(_0x33586f){if(!_0x33586f)return null;_0x18e1b0[_0xe857('0x28')][_0xe857('0x77')]=_0x33586f;return _0x18e1b0;})['then'](function(_0x4d2f18){if(_0x4d2f18){if(_0x501525[_0xe857('0x5b')][_0xe857('0x7b')]){_0x18e1b0[_0xe857('0x28')][_0xe857('0x7c')]=util[_0xe857('0x61')](_0xe857('0x7d'),_0x501525[_0xe857('0x63')][_0xe857('0x3b')]);_0x18e1b0[_0xe857('0x28')][_0xe857('0x7e')]=_0x18e1b0[_0xe857('0x7e')];_0x18e1b0['message'][_0xe857('0x7f')]=_0x18e1b0[_0xe857('0x7e')];_0x18e1b0['message'][_0xe857('0x80')]='accept';return respondWithRpcPromise(_0xe857('0x81'),'EventManager',{'event':_0xe857('0x82'),'message':_0x18e1b0[_0xe857('0x28')]},client9002)[_0xe857('0x37')](function(){return _0x18e1b0;});}return _0x18e1b0;}return null;})[_0xe857('0x37')](respondWithResult(_0x2ebbf7,null))[_0xe857('0x2a')](handleError(_0x2ebbf7,null));};var interaction_log=require(_0xe857('0x12'))(_0xe857('0x83'));exports['reject']=function(_0x337eb3,_0x59380a,_0x4413b7){var _0x379996={'agent':{},'channel':_0xe857('0x5e')};if(_0x337eb3[_0xe857('0x5b')]['id']){delete _0x337eb3['body']['id'];}_0x337eb3[_0xe857('0x5b')][_0xe857('0x62')]=_0x337eb3[_0xe857('0x5b')]['UserId']||_0x337eb3['user']['id'];_0x379996[_0xe857('0x77')]['id']=_0x337eb3[_0xe857('0x5b')][_0xe857('0x62')];return db[_0xe857('0x3f')][_0xe857('0x5a')]({'where':{'id':_0x337eb3['params']['id'],'UserId':null}})[_0xe857('0x37')](handleEntityNotFound(_0x59380a,null))['then'](function(_0x33cf9f){if(_0x33cf9f){_0x379996[_0xe857('0x28')]=_0x33cf9f[_0xe857('0x64')]({'plain':!![]});return db[_0xe857('0x65')][_0xe857('0x5a')]({'where':{'id':_0x33cf9f[_0xe857('0x66')]}});}return null;})[_0xe857('0x37')](handleEntityNotFound(_0x59380a,null))[_0xe857('0x37')](function(_0x5a6744){if(_0x5a6744){_0x379996[_0xe857('0x6c')]=_0x5a6744[_0xe857('0x64')]({'plain':!![]});interaction_log[_0xe857('0x21')](_0xe857('0x84'),_0x337eb3[_0xe857('0x63')]['id'],_0x337eb3[_0xe857('0x63')][_0xe857('0x3b')],_0x337eb3[_0xe857('0x63')][_0xe857('0x6b')],_0x379996['interaction']['id'],_0x337eb3[_0xe857('0x5b')]?JSON['stringify'](_0x337eb3[_0xe857('0x5b')]):_0xe857('0x6d'));return respondWithRpcPromise('RejectMessage',_0xe857('0x85'),_0x379996);}return null;})['then'](function(_0x57bc4a){var _0x549788=_0xe857('0x70')+_0x57bc4a[_0xe857('0x28')][_0xe857('0x71')];return db[_0xe857('0x72')][_0xe857('0x43')](_0x549788,{'type':db['Sequelize'][_0xe857('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x11c7ef){return _0x11c7ef;});})[_0xe857('0x37')](function(_0xe4f12a){if(_0xe4f12a){_0x379996[_0xe857('0x28')][_0xe857('0x76')]=_0xe4f12a[0x0];if(!_0x337eb3[_0xe857('0x5b')]['UserId'])return;return db[_0xe857('0x86')]['find']({'where':{'id':_0x337eb3[_0xe857('0x5b')][_0xe857('0x62')],'role':'agent'},'attributes':['id',_0xe857('0x3b'),_0xe857('0x78'),_0xe857('0x79'),_0xe857('0x7a')],'raw':!![]});}return null;})['then'](function(_0x29fe01){if(!_0x29fe01)return null;_0x379996[_0xe857('0x28')][_0xe857('0x77')]=_0x29fe01;return _0x379996;})[_0xe857('0x37')](function(_0x4dcad8){if(_0x4dcad8){_0x4dcad8[_0xe857('0x28')][_0xe857('0x7c')]=util[_0xe857('0x61')](_0xe857('0x7d'),_0x337eb3['user'][_0xe857('0x3b')]);_0x4dcad8['message'][_0xe857('0x7e')]=_0x379996['channel'];_0x4dcad8[_0xe857('0x28')][_0xe857('0x7f')]=_0x379996[_0xe857('0x7e')];_0x4dcad8[_0xe857('0x28')][_0xe857('0x80')]='reject';respondWithRpcPromise('EventManager',_0xe857('0x81'),{'event':_0xe857('0x87'),'message':_0x4dcad8[_0xe857('0x28')]},client9002);return _0x379996;}return null;})[_0xe857('0x37')](respondWithResult(_0x59380a,null))[_0xe857('0x2a')](handleError(_0x59380a,null));};exports[_0xe857('0x88')]=function(_0x2fc75b,_0x191b92){var _0x580163;return db[_0xe857('0x3f')][_0xe857('0x88')](_0x2fc75b[_0xe857('0x5b')],{})['then'](function(_0x3f6ee8){_0x580163=_0x3f6ee8;return db['CmContact']['findOne']({'where':{'id':_0x580163['ContactId']}});})[_0xe857('0x37')](function(_0x7dad2b){if(_[_0xe857('0x67')](_0x7dad2b)){return;}else{_0x580163['fax']=_0x7dad2b[_0xe857('0x5e')];return db[_0xe857('0x89')]['findOne']({'where':{'id':_0x580163[_0xe857('0x8a')]}});}})[_0xe857('0x37')](function(_0x1fd6fe){return respondWithRpcPromise(_0xe857('0x8b'),_0xe857('0x8b'),{'FaxAccountId':_[_0xe857('0x67')](_0x2fc75b[_0xe857('0x5b')])?undefined:_0x2fc75b[_0xe857('0x5b')]['FaxAccountId'],'path':_['isNil'](_0x1fd6fe)?undefined:util[_0xe857('0x61')](_0xe857('0x8c'),_0x1fd6fe['basename']),'fax':_['isNil'](_0x580163['fax'])?undefined:_0x580163[_0xe857('0x5e')],'AttachmentId':_0x580163[_0xe857('0x8a')]},client9002);})[_0xe857('0x37')](respondWithResult(_0x191b92,0xc9))[_0xe857('0x2a')](handleError(_0x191b92,null));};exports[_0xe857('0x8d')]=function(_0x2e4002,_0x4fd8f0){var _0x5b6982=path[_0xe857('0x8e')](config[_0xe857('0x8f')],_0xe857('0x90'),_0xe857('0x91'),_0xe857('0x92'));return db['FaxMessage'][_0xe857('0x5a')]({'where':{'id':_0x2e4002[_0xe857('0x58')]['id']},'include':[{'model':db[_0xe857('0x89')],'as':_0xe857('0x89')}]})[_0xe857('0x37')](handleEntityNotFound(_0x4fd8f0,null))[_0xe857('0x37')](function(_0x43a7ea){if(_0x43a7ea){return _0x4fd8f0['download'](path['join'](_0x5b6982,_0x43a7ea['Attachment'][_0xe857('0x93')]));}})['catch'](handleError(_0x4fd8f0,null));}; \ No newline at end of file +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 diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e5f58e9..d1e30cc 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 _0x93bb=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93bb,0x135));var _0xb93b=function(_0x58bd70,_0x5b7863){_0x58bd70=_0x58bd70-0x0;var _0x3e54dd=_0x93bb[_0x58bd70];return _0x3e54dd;};'use strict';var EventEmitter=require(_0xb93b('0x0'));var FaxMessage=require(_0xb93b('0x1'))['db'][_0xb93b('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xb93b('0x3')](0x0);var events={'afterCreate':_0xb93b('0x4'),'afterUpdate':_0xb93b('0x5'),'afterDestroy':_0xb93b('0x6')};function emitEvent(_0x3d634e){return function(_0x3eb285,_0x355196,_0x540b3c){FaxMessageEvents[_0xb93b('0x7')](_0x3d634e+':'+_0x3eb285['id'],_0x3eb285);FaxMessageEvents[_0xb93b('0x7')](_0x3d634e,_0x3eb285);_0x540b3c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0xb93b('0x8')](e,emitEvent(event));}}module[_0xb93b('0x9')]=FaxMessageEvents; \ No newline at end of file +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 diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 1808907..ffff34b 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 _0xeea2=['toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','secret','isNil','FaxInteraction','findOne','then','update'];(function(_0x4a0e64,_0x2bcdbf){var _0x534ef4=function(_0x30cc33){while(--_0x30cc33){_0x4a0e64['push'](_0x4a0e64['shift']());}};_0x534ef4(++_0x2bcdbf);}(_0xeea2,0xde));var _0x2eea=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xeea2[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x2eea('0x0'));var util=require(_0x2eea('0x1'));var logger=require(_0x2eea('0x2'))(_0x2eea('0x3'));var moment=require(_0x2eea('0x4'));var BPromise=require(_0x2eea('0x5'));var rp=require(_0x2eea('0x6'));var fs=require('fs');var path=require(_0x2eea('0x7'));var rimraf=require(_0x2eea('0x8'));var config=require(_0x2eea('0x9'));var attributes=require(_0x2eea('0xa'));module[_0x2eea('0xb')]=function(_0x428553,_0x365501){return _0x428553[_0x2eea('0xc')]('FaxMessage',attributes,{'tableName':_0x2eea('0xd'),'paranoid':![],'indexes':[{'name':_0x2eea('0xe'),'fields':[_0x2eea('0xf')],'type':_0x2eea('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b94dc,_0x29d309,_0x5daacb){var _0x37c582=_0x428553[_0x2eea('0x11')];var _0x833059=_0x5b94dc[_0x2eea('0x12')]({'plain':!![]});if(_0x833059[_0x2eea('0x13')]['toLowerCase']()==='in'||_0x833059[_0x2eea('0x13')]['toLowerCase']()==='out'&&!_0x833059[_0x2eea('0x14')]&&!_[_0x2eea('0x15')](_0x833059['UserId'])){_0x37c582[_0x2eea('0x16')][_0x2eea('0x17')]({'where':{'id':_0x833059['FaxInteractionId']}})[_0x2eea('0x18')](function(_0x4e0503){if(_0x4e0503){_0x4e0503[_0x2eea('0x19')]({'lastMsgAt':_0x833059['createdAt'],'lastMsgDirection':_0x833059[_0x2eea('0x13')][_0x2eea('0x1a')]()});}})[_0x2eea('0x1b')](function(_0x17ea33){console[_0x2eea('0x1c')](_0x17ea33);});}_0x5daacb();}},'charset':_0x2eea('0x1d'),'collate':_0x2eea('0x1e')});}; \ No newline at end of file +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 diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 93c5121..7a29535 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 _0xeec6=['FaxMessage','create','body','options','then','catch','UpdateFaxMessage','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage'];(function(_0x53f0be,_0x18826e){var _0x492e6c=function(_0xb7d4df){while(--_0xb7d4df){_0x53f0be['push'](_0x53f0be['shift']());}};_0x492e6c(++_0x18826e);}(_0xeec6,0x1c2));var _0x6eec=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0xeec6[_0x41bdd4];return _0x5c03a6;};'use strict';var _=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var moment=require(_0x6eec('0x2'));var BPromise=require(_0x6eec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6eec('0x4'));var db=require(_0x6eec('0x5'))['db'];var utils=require(_0x6eec('0x6'));var logger=require(_0x6eec('0x7'))(_0x6eec('0x8'));var config=require(_0x6eec('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6eec('0xa')][_0x6eec('0xb')]({'port':0x232a});config['redis']=_[_0x6eec('0xc')](config[_0x6eec('0xd')],{'host':_0x6eec('0xe'),'port':0x18eb});var socket=require(_0x6eec('0xf'))(new Redis(config['redis']));require(_0x6eec('0x10'))[_0x6eec('0x11')](socket);function respondWithRpcPromise(_0x1c774d,_0x49ad4c,_0x595dd4){return new BPromise(function(_0x5e8aba,_0x295cae){return client[_0x6eec('0x12')](_0x1c774d,_0x595dd4)['then'](function(_0x4b8de1){logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));logger[_0x6eec('0x15')](_0x6eec('0x16'),_0x49ad4c,_0x6eec('0x14'),JSON[_0x6eec('0x17')](_0x4b8de1));if(_0x4b8de1['error']){if(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x19')]===0x1f4){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);return _0x295cae(_0x4b8de1[_0x6eec('0x18')][_0x6eec('0x1b')]);}logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x4b8de1['error'][_0x6eec('0x1b')]);return _0x5e8aba(_0x4b8de1['error'][_0x6eec('0x1b')]);}else{logger[_0x6eec('0x13')]('FaxMessage,\x20%s,\x20%s',_0x49ad4c,_0x6eec('0x14'));_0x5e8aba(_0x4b8de1[_0x6eec('0x1c')][_0x6eec('0x1b')]);}})['catch'](function(_0x87f3be){logger[_0x6eec('0x18')](_0x6eec('0x1a'),_0x49ad4c,_0x87f3be);_0x295cae(_0x87f3be);});});}exports[_0x6eec('0x1d')]=function(_0xd86135){var _0x1761f4=this;return new Promise(function(_0x536429,_0x328693){return db[_0x6eec('0x1e')][_0x6eec('0x1f')](_0xd86135[_0x6eec('0x20')],{'raw':_0xd86135[_0x6eec('0x21')]?_0xd86135[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![]})[_0x6eec('0x22')](function(_0x852d08){logger[_0x6eec('0x13')](_0x6eec('0x1d'),_0xd86135);logger[_0x6eec('0x15')](_0x6eec('0x1d'),_0xd86135,JSON['stringify'](_0x852d08));_0x536429(_0x852d08);})[_0x6eec('0x23')](function(_0x2ad14b){logger[_0x6eec('0x18')](_0x6eec('0x1d'),_0x2ad14b[_0x6eec('0x1b')],_0xd86135);_0x328693(_0x1761f4[_0x6eec('0x18')](0x1f4,_0x2ad14b[_0x6eec('0x1b')]));});});};exports[_0x6eec('0x24')]=function(_0x316317){var _0x58f95c=this;return new Promise(function(_0x1d750c,_0x44b31c){return db[_0x6eec('0x1e')][_0x6eec('0x25')](_0x316317['body'],{'raw':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316317['options']?_0x316317[_0x6eec('0x21')]['where']||null:null,'attributes':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x26')]||null:null,'limit':_0x316317[_0x6eec('0x21')]?_0x316317[_0x6eec('0x21')][_0x6eec('0x27')]||null:null})[_0x6eec('0x22')](function(_0x33e4a1){logger[_0x6eec('0x13')](_0x6eec('0x24'),_0x316317);logger['debug'](_0x6eec('0x24'),_0x316317,JSON['stringify'](_0x33e4a1));_0x1d750c(_0x33e4a1);})[_0x6eec('0x23')](function(_0x125bfc){logger[_0x6eec('0x18')]('UpdateFaxMessage',_0x125bfc['message'],_0x316317);_0x44b31c(_0x58f95c['error'](0x1f4,_0x125bfc[_0x6eec('0x1b')]));});});}; \ No newline at end of file +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 diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 0e048cc..a31f57d 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 _0x8dd7=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x3ee5b4,_0x3feae8){var _0x5dcecd=function(_0x4463c3){while(--_0x4463c3){_0x3ee5b4['push'](_0x3ee5b4['shift']());}};_0x5dcecd(++_0x3feae8);}(_0x8dd7,0xdb));var _0x78dd=function(_0x56851f,_0x44069b){_0x56851f=_0x56851f-0x0;var _0x48cae9=_0x8dd7[_0x56851f];return _0x48cae9;};'use strict';var FaxMessageEvents=require(_0x78dd('0x0'));var events=[_0x78dd('0x1'),_0x78dd('0x2'),_0x78dd('0x3')];function createListener(_0x476dab,_0x3e3a8e){return function(_0x25a3d8){_0x3e3a8e[_0x78dd('0x4')](_0x476dab,_0x25a3d8);};}function removeListener(_0x202cf7,_0xeff7a6){return function(){FaxMessageEvents[_0x78dd('0x5')](_0x202cf7,_0xeff7a6);};}exports[_0x78dd('0x6')]=function(_0x540948){for(var _0x3b8e10=0x0,_0x57e3cb=events[_0x78dd('0x7')];_0x3b8e10<_0x57e3cb;_0x3b8e10++){var _0x293bcd=events[_0x3b8e10];var _0x5c79b1=createListener(_0x78dd('0x8')+_0x293bcd,_0x540948);FaxMessageEvents['on'](_0x293bcd,_0x5c79b1);}}; \ No newline at end of file +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 diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 7729e66..2b6b1b7 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 _0xbc9d=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','describe','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','/:id/accept','accept','reject','delete','destroy','multer','util'];(function(_0x28cf70,_0x272d86){var _0x4421ac=function(_0x18dd4d){while(--_0x18dd4d){_0x28cf70['push'](_0x28cf70['shift']());}};_0x4421ac(++_0x272d86);}(_0xbc9d,0xb4));var _0xdbc9=function(_0xcb56c7,_0x5b00ef){_0xcb56c7=_0xcb56c7-0x0;var _0x2906fa=_0xbc9d[_0xcb56c7];return _0x2906fa;};'use strict';var multer=require(_0xdbc9('0x0'));var util=require(_0xdbc9('0x1'));var path=require(_0xdbc9('0x2'));var timeout=require(_0xdbc9('0x3'));var express=require(_0xdbc9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbc9('0x5'));var config=require(_0xdbc9('0x6'));var controller=require(_0xdbc9('0x7'));router[_0xdbc9('0x8')]('/',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xa')]);router[_0xdbc9('0x8')]('/describe',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xb')]);router[_0xdbc9('0x8')]('/:id',auth[_0xdbc9('0x9')](),controller['show']);router['get'](_0xdbc9('0xc'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0xd')]);router[_0xdbc9('0xe')]('/',auth['isAuthenticated'](),interaction[_0xdbc9('0xf')](_0xdbc9('0x10'),_0xdbc9('0x11')),controller[_0xdbc9('0x12')]);router[_0xdbc9('0x13')](_0xdbc9('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xdbc9('0x13')](_0xdbc9('0x15'),auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x16')]);router[_0xdbc9('0x13')]('/:id/reject',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x17')]);router[_0xdbc9('0x18')]('/:id',auth[_0xdbc9('0x9')](),controller[_0xdbc9('0x19')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 3c35023..2d3e631 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 _0x13cf=['exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin','sequelize'];(function(_0x2a1085,_0x13ec46){var _0x19f19b=function(_0x1c2ba0){while(--_0x1c2ba0){_0x2a1085['push'](_0x2a1085['shift']());}};_0x19f19b(++_0x13ec46);}(_0x13cf,0x13f));var _0xf13c=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x13cf[_0x13b02f];return _0x12e9a6;};'use strict';var Sequelize=require(_0xf13c('0x0'));module[_0xf13c('0x1')]={'name':{'type':Sequelize[_0xf13c('0x2')],'unique':_0xf13c('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf13c('0x2')]},'timeout':{'type':Sequelize[_0xf13c('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf13c('0x5')](_0xf13c('0x6'),'beepall',_0xf13c('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xf13c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 94b9f8e..a965695 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 _0x6b40=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','map','FaxQueue','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMembers','UserFaxQueue','FaxQueueId','findAll','findAndCountAll','UserId','faxPause','createdAt','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','nolimit','addTeams','ids','Agents','online','voicePause','interface','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','findOne','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b40,0x1a4));var _0x06b4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6b40[_0x5d6456];return _0x4d66c1;};'use strict';var emlformat=require(_0x06b4('0x0'));var rimraf=require(_0x06b4('0x1'));var zipdir=require(_0x06b4('0x2'));var jsonpatch=require(_0x06b4('0x3'));var rp=require(_0x06b4('0x4'));var moment=require(_0x06b4('0x5'));var BPromise=require(_0x06b4('0x6'));var Mustache=require(_0x06b4('0x7'));var util=require(_0x06b4('0x8'));var path=require('path');var sox=require(_0x06b4('0x9'));var csv=require(_0x06b4('0xa'));var ejs=require(_0x06b4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x06b4('0xc'));var crypto=require(_0x06b4('0xd'));var jsforce=require(_0x06b4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x06b4('0xa'));var querystring=require(_0x06b4('0xf'));var Papa=require(_0x06b4('0x10'));var Redis=require(_0x06b4('0x11'));var authService=require(_0x06b4('0x12'));var qs=require(_0x06b4('0x13'));var as=require(_0x06b4('0x14'));var hardwareService=require(_0x06b4('0x15'));var logger=require('../../config/logger')(_0x06b4('0x16'));var utils=require(_0x06b4('0x17'));var config=require(_0x06b4('0x18'));var licenseUtil=require(_0x06b4('0x19'));var db=require(_0x06b4('0x1a'))['db'];config[_0x06b4('0x1b')]=_[_0x06b4('0x1c')](config[_0x06b4('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x06b4('0x1d'))(new Redis(config['redis']));require('./faxQueue.socket')['register'](socket);function respondWithStatusCode(_0x320527,_0x11fc8b){_0x11fc8b=_0x11fc8b||0xcc;return function(_0x14f1f6){if(_0x14f1f6){return _0x320527[_0x06b4('0x1e')](_0x11fc8b);}return _0x320527[_0x06b4('0x1f')](_0x11fc8b)[_0x06b4('0x20')]();};}function respondWithResult(_0xe1357c,_0x3b3d33){_0x3b3d33=_0x3b3d33||0xc8;return function(_0x2de436){if(_0x2de436){return _0xe1357c[_0x06b4('0x1f')](_0x3b3d33)[_0x06b4('0x21')](_0x2de436);}};}function respondWithFilteredResult(_0x426c96,_0x42d989){return function(_0x50faf8){if(_0x50faf8){var _0x3fe4bc=typeof _0x42d989[_0x06b4('0x22')]===_0x06b4('0x23')&&typeof _0x42d989[_0x06b4('0x24')]==='undefined';var _0x578fd2=_0x50faf8[_0x06b4('0x25')];var _0x1b9d61=_0x3fe4bc?0x0:_0x42d989['offset'];var _0x1261df=_0x3fe4bc?_0x50faf8[_0x06b4('0x25')]:_0x42d989['offset']+_0x42d989['limit'];var _0x42b128;if(_0x1261df>=_0x578fd2){_0x1261df=_0x578fd2;_0x42b128=0xc8;}else{_0x42b128=0xce;}_0x426c96[_0x06b4('0x1f')](_0x42b128);return _0x426c96['set']('Content-Range',_0x1b9d61+'-'+_0x1261df+'/'+_0x578fd2)[_0x06b4('0x21')](_0x50faf8);}return null;};}function patchUpdates(_0x4b51c0){return function(_0x474947){try{jsonpatch[_0x06b4('0x26')](_0x474947,_0x4b51c0,!![]);}catch(_0x14a5ce){return BPromise['reject'](_0x14a5ce);}return _0x474947[_0x06b4('0x27')]();};}function saveUpdates(_0x2190e0,_0x52d4d7){return function(_0x1713d5){if(_0x1713d5){return _0x1713d5[_0x06b4('0x28')](_0x2190e0)[_0x06b4('0x29')](function(_0x325855){return _0x325855;});}return null;};}function removeEntity(_0x2502af,_0x1994c8){return function(_0x4a81ee){if(_0x4a81ee){return _0x4a81ee['destroy']()['then'](function(){var _0x2fe92a=_0x4a81ee[_0x06b4('0x2a')]({'plain':!![]});var _0x455211=_0x06b4('0x2b');return db[_0x06b4('0x2c')][_0x06b4('0x2d')]({'where':{'type':_0x455211,'resourceId':_0x2fe92a['id']}})[_0x06b4('0x29')](function(){return _0x4a81ee;});})['then'](function(){_0x2502af[_0x06b4('0x1f')](0xcc)[_0x06b4('0x20')]();});}};}function handleEntityNotFound(_0x43c9a2,_0x1a874a){return function(_0x2b771a){if(!_0x2b771a){_0x43c9a2['sendStatus'](0x194);}return _0x2b771a;};}function handleError(_0x25a310,_0x11ae6c){_0x11ae6c=_0x11ae6c||0x1f4;return function(_0x46ca0e){logger[_0x06b4('0x2e')](_0x46ca0e[_0x06b4('0x2f')]);if(_0x46ca0e[_0x06b4('0x30')]){delete _0x46ca0e[_0x06b4('0x30')];}_0x25a310[_0x06b4('0x1f')](_0x11ae6c)[_0x06b4('0x31')](_0x46ca0e);};}exports[_0x06b4('0x32')]=function(_0x2b0d3b,_0x33cb8d){var _0xff250a={},_0x123a01={},_0x135e59={'count':0x0,'rows':[]};var _0x357a9c=_[_0x06b4('0x33')](db[_0x06b4('0x34')]['rawAttributes'],function(_0x5e1659){return{'name':_0x5e1659[_0x06b4('0x35')],'type':_0x5e1659[_0x06b4('0x36')][_0x06b4('0x37')]};});_0x123a01[_0x06b4('0x38')]=_['map'](_0x357a9c,_0x06b4('0x30'));_0x123a01[_0x06b4('0x39')]=_[_0x06b4('0x3a')](_0x2b0d3b[_0x06b4('0x39')]);_0x123a01['filters']=_[_0x06b4('0x3b')](_0x123a01[_0x06b4('0x38')],_0x123a01['query']);_0xff250a[_0x06b4('0x3c')]=_['intersection'](_0x123a01[_0x06b4('0x38')],qs[_0x06b4('0x3d')](_0x2b0d3b[_0x06b4('0x39')]['fields']));_0xff250a[_0x06b4('0x3c')]=_0xff250a[_0x06b4('0x3c')][_0x06b4('0x3e')]?_0xff250a[_0x06b4('0x3c')]:_0x123a01[_0x06b4('0x38')];if(!_0x2b0d3b[_0x06b4('0x39')]['hasOwnProperty']('nolimit')){_0xff250a[_0x06b4('0x24')]=qs[_0x06b4('0x24')](_0x2b0d3b['query'][_0x06b4('0x24')]);_0xff250a['offset']=qs[_0x06b4('0x22')](_0x2b0d3b[_0x06b4('0x39')]['offset']);}_0xff250a[_0x06b4('0x3f')]=qs[_0x06b4('0x40')](_0x2b0d3b['query'][_0x06b4('0x40')]);_0xff250a[_0x06b4('0x41')]=qs[_0x06b4('0x42')](_[_0x06b4('0x43')](_0x2b0d3b['query'],_0x123a01[_0x06b4('0x42')]),_0x357a9c);if(_0x2b0d3b[_0x06b4('0x39')][_0x06b4('0x44')]){_0xff250a[_0x06b4('0x41')]=_[_0x06b4('0x45')](_0xff250a[_0x06b4('0x41')],{'$or':_['map'](_0x357a9c,function(_0x2822e0){if(_0x2822e0['type']!==_0x06b4('0x46')){var _0x59cf54={};_0x59cf54[_0x2822e0['name']]={'$like':'%'+_0x2b0d3b[_0x06b4('0x39')][_0x06b4('0x44')]+'%'};return _0x59cf54;}})});}_0xff250a=_[_0x06b4('0x45')]({},_0xff250a,_0x2b0d3b[_0x06b4('0x47')]);var _0x33efbb={'where':_0xff250a[_0x06b4('0x41')]};return db['FaxQueue'][_0x06b4('0x25')](_0x33efbb)['then'](function(_0x298ea7){_0x135e59[_0x06b4('0x25')]=_0x298ea7;if(_0x2b0d3b[_0x06b4('0x39')][_0x06b4('0x48')]){_0xff250a[_0x06b4('0x49')]=[{'all':!![]}];}return db[_0x06b4('0x34')]['findAll'](_0xff250a);})[_0x06b4('0x29')](function(_0xb7d920){_0x135e59[_0x06b4('0x4a')]=_0xb7d920;return _0x135e59;})[_0x06b4('0x29')](respondWithFilteredResult(_0x33cb8d,_0xff250a))[_0x06b4('0x4b')](handleError(_0x33cb8d,null));};exports[_0x06b4('0x4c')]=function(_0x4b22a3,_0x1aca2c){var _0x4aa06f={'raw':!![],'where':{'id':_0x4b22a3['params']['id']}},_0x91318a={};_0x91318a[_0x06b4('0x38')]=_[_0x06b4('0x3a')](db[_0x06b4('0x34')][_0x06b4('0x4d')]);_0x91318a[_0x06b4('0x39')]=_['keys'](_0x4b22a3[_0x06b4('0x39')]);_0x91318a['filters']=_[_0x06b4('0x3b')](_0x91318a['model'],_0x91318a[_0x06b4('0x39')]);_0x4aa06f['attributes']=_[_0x06b4('0x3b')](_0x91318a['model'],qs[_0x06b4('0x3d')](_0x4b22a3[_0x06b4('0x39')][_0x06b4('0x3d')]));_0x4aa06f[_0x06b4('0x3c')]=_0x4aa06f[_0x06b4('0x3c')][_0x06b4('0x3e')]?_0x4aa06f[_0x06b4('0x3c')]:_0x91318a[_0x06b4('0x38')];if(_0x4b22a3[_0x06b4('0x39')][_0x06b4('0x48')]){_0x4aa06f['include']=[{'all':!![]}];}_0x4aa06f=_[_0x06b4('0x45')]({},_0x4aa06f,_0x4b22a3[_0x06b4('0x47')]);return db['FaxQueue'][_0x06b4('0x4e')](_0x4aa06f)[_0x06b4('0x29')](handleEntityNotFound(_0x1aca2c,null))[_0x06b4('0x29')](respondWithResult(_0x1aca2c,null))[_0x06b4('0x4b')](handleError(_0x1aca2c,null));};exports[_0x06b4('0x4f')]=function(_0x3acb68,_0x8daa16){return db['FaxQueue'][_0x06b4('0x4f')](_0x3acb68[_0x06b4('0x50')],{})[_0x06b4('0x29')](function(_0x336537){var _0x26b0ec=_0x3acb68[_0x06b4('0x51')]['get']({'plain':!![]});if(!_0x26b0ec)throw new Error(_0x06b4('0x52'));if(_0x26b0ec['role']===_0x06b4('0x51')){var _0x246150=_0x336537[_0x06b4('0x2a')]({'plain':!![]});var _0x1e8132='FaxQueues';return db[_0x06b4('0x53')][_0x06b4('0x4e')]({'where':{'name':_0x1e8132,'userProfileId':_0x26b0ec[_0x06b4('0x54')]},'raw':!![]})[_0x06b4('0x29')](function(_0x5d78ef){if(_0x5d78ef&&_0x5d78ef['autoAssociation']===0x0){return db[_0x06b4('0x2c')][_0x06b4('0x4f')]({'name':_0x246150[_0x06b4('0x30')],'resourceId':_0x246150['id'],'type':_0x5d78ef[_0x06b4('0x30')],'sectionId':_0x5d78ef['id']},{})[_0x06b4('0x29')](function(){return _0x336537;});}else{return _0x336537;}})[_0x06b4('0x4b')](function(_0x4cfc9e){logger[_0x06b4('0x2e')](_0x06b4('0x55'),_0x4cfc9e);throw _0x4cfc9e;});}return _0x336537;})[_0x06b4('0x29')](respondWithResult(_0x8daa16,0xc9))[_0x06b4('0x4b')](handleError(_0x8daa16,null));};exports['update']=function(_0x50b8b4,_0xac4d77){if(_0x50b8b4['body']['id']){delete _0x50b8b4['body']['id'];}return db[_0x06b4('0x34')]['find']({'where':{'id':_0x50b8b4[_0x06b4('0x56')]['id']}})[_0x06b4('0x29')](handleEntityNotFound(_0xac4d77,null))[_0x06b4('0x29')](saveUpdates(_0x50b8b4['body'],null))['then'](respondWithResult(_0xac4d77,null))[_0x06b4('0x4b')](handleError(_0xac4d77,null));};exports[_0x06b4('0x2d')]=function(_0x205b93,_0x3adff4){return db[_0x06b4('0x34')]['find']({'where':{'id':_0x205b93[_0x06b4('0x56')]['id']}})[_0x06b4('0x29')](handleEntityNotFound(_0x3adff4,null))[_0x06b4('0x29')](removeEntity(_0x3adff4,null))['catch'](handleError(_0x3adff4,null));};exports['describe']=function(_0x305754,_0x303086){return db['FaxQueue']['describe']()[_0x06b4('0x29')](respondWithResult(_0x303086,null))[_0x06b4('0x4b')](handleError(_0x303086,null));};exports[_0x06b4('0x57')]=function(_0x133306,_0x481915,_0x17eaa0){var _0x1fa5ed={'raw':!![],'where':{}},_0x390df0={},_0x10b845;return db[_0x06b4('0x34')]['findOne']({'where':{'id':_0x133306[_0x06b4('0x56')]['id']}})['then'](handleEntityNotFound(_0x481915,null))[_0x06b4('0x29')](function(_0x220ed5){if(_0x220ed5){_0x10b845=_0x220ed5['get']({'plain':!![]});_0x390df0['model']=_['keys'](db[_0x06b4('0x58')]['rawAttributes']);_0x390df0[_0x06b4('0x39')]=_[_0x06b4('0x3a')](_0x133306[_0x06b4('0x39')]);_0x390df0[_0x06b4('0x42')]=_[_0x06b4('0x3b')](_0x390df0[_0x06b4('0x38')],_0x390df0[_0x06b4('0x39')]);_0x1fa5ed[_0x06b4('0x3c')]=_['intersection'](_0x390df0[_0x06b4('0x38')],qs[_0x06b4('0x3d')](_0x133306[_0x06b4('0x39')][_0x06b4('0x3d')]));_0x1fa5ed['attributes']=_0x1fa5ed[_0x06b4('0x3c')][_0x06b4('0x3e')]?_0x1fa5ed[_0x06b4('0x3c')]:_0x390df0['model'];if(!_0x133306[_0x06b4('0x39')]['hasOwnProperty']('nolimit')){_0x1fa5ed[_0x06b4('0x24')]=qs[_0x06b4('0x24')](_0x133306['query']['limit']);_0x1fa5ed[_0x06b4('0x22')]=qs[_0x06b4('0x22')](_0x133306[_0x06b4('0x39')][_0x06b4('0x22')]);}_0x1fa5ed[_0x06b4('0x3f')]=qs['sort'](_0x133306[_0x06b4('0x39')][_0x06b4('0x40')]);_0x1fa5ed['where']=qs[_0x06b4('0x42')](_['pick'](_0x133306['query'],_0x390df0[_0x06b4('0x42')]));_0x1fa5ed[_0x06b4('0x41')][_0x06b4('0x59')]=_0x220ed5['id'];if(_0x133306[_0x06b4('0x39')][_0x06b4('0x44')]){_0x1fa5ed[_0x06b4('0x41')]=_['merge'](_0x1fa5ed[_0x06b4('0x41')],{'$or':_['map'](_0x1fa5ed[_0x06b4('0x3c')],function(_0x579543){var _0x4f16e7={};_0x4f16e7[_0x579543]={'$like':'%'+_0x133306[_0x06b4('0x39')]['filter']+'%'};return _0x4f16e7;})});}_0x1fa5ed=_[_0x06b4('0x45')]({},_0x1fa5ed,_0x133306[_0x06b4('0x47')]);return db[_0x06b4('0x58')][_0x06b4('0x5a')](_0x1fa5ed);}})[_0x06b4('0x29')](function(_0x23b00b){if(_0x23b00b){return db['User'][_0x06b4('0x5b')]({'where':{'id':_[_0x06b4('0x33')](_0x23b00b,_0x06b4('0x5c')),'role':'agent'},'attributes':['id',_0x06b4('0x30'),_0x06b4('0x5d'),'updatedAt',_0x06b4('0x5e')]});}})[_0x06b4('0x29')](function(_0x38ff47){if(_0x38ff47){return{'count':_0x38ff47[_0x06b4('0x25')],'rows':_[_0x06b4('0x33')](_0x38ff47[_0x06b4('0x4a')],function(_0x295339){return{'membername':_0x295339[_0x06b4('0x30')],'UserId':_0x295339['id'],'queue_name':_0x10b845[_0x06b4('0x30')],'FaxQueueId':_0x10b845['id'],'interface':util[_0x06b4('0x5f')](_0x06b4('0x60'),_0x06b4('0x61'),_0x295339[_0x06b4('0x30')]),'penalty':0x0,'paused':_0x295339['faxPause'],'createdAt':_0x295339['createdAt'],'updatedAt':_0x295339['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x06b4('0x29')](respondWithFilteredResult(_0x481915,_0x1fa5ed))['catch'](handleError(_0x481915,null));};exports[_0x06b4('0x62')]=function(_0x426ecf,_0x172d1e,_0x5240a4){var _0x42c6fb={};var _0x33c5e2={};var _0x4482b1;var _0xa73ea0;return db[_0x06b4('0x34')]['findOne']({'where':{'id':_0x426ecf['params']['id']}})[_0x06b4('0x29')](handleEntityNotFound(_0x172d1e,null))[_0x06b4('0x29')](function(_0x2c8bdd){if(_0x2c8bdd){_0x4482b1=_0x2c8bdd;_0x33c5e2[_0x06b4('0x38')]=_['keys'](db[_0x06b4('0x63')][_0x06b4('0x4d')]);_0x33c5e2[_0x06b4('0x39')]=_[_0x06b4('0x3a')](_0x426ecf['query']);_0x33c5e2['filters']=_[_0x06b4('0x3b')](_0x33c5e2[_0x06b4('0x38')],_0x33c5e2['query']);_0x42c6fb['attributes']=_[_0x06b4('0x3b')](_0x33c5e2[_0x06b4('0x38')],qs[_0x06b4('0x3d')](_0x426ecf[_0x06b4('0x39')][_0x06b4('0x3d')]));_0x42c6fb[_0x06b4('0x3c')]=_0x42c6fb[_0x06b4('0x3c')]['length']?_0x42c6fb[_0x06b4('0x3c')]:_0x33c5e2[_0x06b4('0x38')];_0x42c6fb[_0x06b4('0x3f')]=qs[_0x06b4('0x40')](_0x426ecf[_0x06b4('0x39')][_0x06b4('0x40')]);_0x42c6fb['where']=qs['filters'](_[_0x06b4('0x43')](_0x426ecf[_0x06b4('0x39')],_0x33c5e2['filters']));if(_0x426ecf[_0x06b4('0x39')][_0x06b4('0x44')]){_0x42c6fb['where']=_[_0x06b4('0x45')](_0x42c6fb['where'],{'$or':_[_0x06b4('0x33')](_0x42c6fb['attributes'],function(_0xbf0c3){var _0x2f4d4a={};_0x2f4d4a[_0xbf0c3]={'$like':'%'+_0x426ecf[_0x06b4('0x39')][_0x06b4('0x44')]+'%'};return _0x2f4d4a;})});}_0x42c6fb=_[_0x06b4('0x45')]({},_0x42c6fb,_0x426ecf[_0x06b4('0x47')]);return _0x4482b1[_0x06b4('0x62')](_0x42c6fb);}})[_0x06b4('0x29')](function(_0x5d2b9a){if(_0x5d2b9a){_0xa73ea0=_0x5d2b9a['length'];if(!_0x426ecf[_0x06b4('0x39')][_0x06b4('0x64')](_0x06b4('0x65'))){_0x42c6fb[_0x06b4('0x24')]=qs['limit'](_0x426ecf['query'][_0x06b4('0x24')]);_0x42c6fb[_0x06b4('0x22')]=qs[_0x06b4('0x22')](_0x426ecf['query'][_0x06b4('0x22')]);}return _0x4482b1[_0x06b4('0x62')](_0x42c6fb);}})['then'](function(_0x159c06){if(_0x159c06){return _0x159c06?{'count':_0xa73ea0,'rows':_0x159c06}:null;}})[_0x06b4('0x29')](respondWithResult(_0x172d1e,null))[_0x06b4('0x4b')](handleError(_0x172d1e,null));};exports[_0x06b4('0x66')]=function(_0x133ab9,_0x2bf06c,_0x2f4243){var _0x550805=_0x133ab9[_0x06b4('0x50')][_0x06b4('0x67')];return db[_0x06b4('0x63')][_0x06b4('0x5a')]({'where':{'id':_0x550805},'attributes':['id'],'include':[{'model':db['User'],'as':_0x06b4('0x68'),'attributes':['id',_0x06b4('0x30'),_0x06b4('0x69'),_0x06b4('0x6a'),_0x06b4('0x6b')],'raw':!![]}]})[_0x06b4('0x29')](function(_0x1d8540){if(_0x1d8540){var _0x135dc2=_['flatMap'](_0x1d8540,function(_0x32945e){var _0x23315e=_0x32945e[_0x06b4('0x2a')]({'plain':!![]});return _0x23315e[_0x06b4('0x68')];});return db[_0x06b4('0x34')][_0x06b4('0x4e')]({'where':{'id':_0x133ab9[_0x06b4('0x56')]['id']}})[_0x06b4('0x29')](function(_0x456d63){return db['sequelize'][_0x06b4('0x6c')](function(_0x2bebd8){return _0x456d63[_0x06b4('0x66')](_0x550805,{'transaction':_0x2bebd8})[_0x06b4('0x29')](function(){return BPromise[_0x06b4('0x6d')](_0x135dc2,function(_0x2a01bb){return db[_0x06b4('0x58')][_0x06b4('0x6e')]({'where':{'UserId':_0x2a01bb['id'],'FaxQueueId':_0x133ab9[_0x06b4('0x56')]['id']},'transaction':_0x2bebd8});});})[_0x06b4('0x29')](function(){_0x135dc2[_0x06b4('0x6f')](function(_0x702f6){socket[_0x06b4('0x70')](_0x06b4('0x71'),{'UserId':_0x702f6['id'],'FaxQueueId':_0x456d63['id']});});});});});}})[_0x06b4('0x29')](respondWithStatusCode(_0x2bf06c,null))[_0x06b4('0x4b')](handleError(_0x2bf06c,null));};exports[_0x06b4('0x72')]=function(_0x5ce0fd,_0x54b8e5,_0x86e070){return db[_0x06b4('0x63')][_0x06b4('0x5a')]({'where':{'id':_0x5ce0fd[_0x06b4('0x39')][_0x06b4('0x67')]},'attributes':['id'],'include':[{'model':db[_0x06b4('0x73')],'as':_0x06b4('0x68'),'attributes':['id'],'raw':!![]}]})[_0x06b4('0x29')](handleEntityNotFound(_0x54b8e5,null))[_0x06b4('0x29')](function(_0x4d64e4){var _0x2ba56d=_[_0x06b4('0x33')](_0x4d64e4,'id');var _0x2da1f7=[];var _0x2a0e75=[];var _0x284fd9=squel[_0x06b4('0x74')]();_0x284fd9[_0x06b4('0x75')](_0x06b4('0x76'))[_0x06b4('0x77')](_0x06b4('0x78'),'tq')[_0x06b4('0x79')](_0x06b4('0x7a'),'ut',_0x06b4('0x7b'))[_0x06b4('0x41')](_0x06b4('0x7c'),_0x5ce0fd[_0x06b4('0x56')]['id']);for(var _0x40aa16=0x0;_0x40aa16<_0x4d64e4[_0x06b4('0x3e')];_0x40aa16+=0x1){let _0x158052=_0x4d64e4[_0x40aa16];for(var _0x4e655b=0x0;_0x4e655b<_0x158052[_0x06b4('0x68')][_0x06b4('0x3e')];_0x4e655b+=0x1){let _0x40f7b1=_0x158052[_0x06b4('0x68')][_0x4e655b];var _0x557bca=_0x284fd9[_0x06b4('0x7d')]();_0x557bca['where'](_0x06b4('0x7e'),_0x40f7b1['id']);_0x2a0e75[_0x06b4('0x7f')](db[_0x06b4('0x80')][_0x06b4('0x39')](_0x557bca[_0x06b4('0x81')](),{'type':db[_0x06b4('0x80')][_0x06b4('0x82')][_0x06b4('0x83')]})['then'](function(_0x594d09){if(_0x594d09['length']===0x1){return _0x40f7b1['id'];}else{var _0x473dbe=_[_0x06b4('0x84')](_[_0x06b4('0x33')](_0x594d09,_0x06b4('0x85')),function(_0x2fe26f){return _[_0x06b4('0x86')](_0x2ba56d,_0x2fe26f);});if(_0x473dbe){return _0x40f7b1['id'];}}}));}}return BPromise[_0x06b4('0x87')](_0x2a0e75)[_0x06b4('0x29')](function(_0x4df42c){_0x2da1f7=_(_0x2da1f7)[_0x06b4('0x88')](_0x4df42c)['compact']()['value']();return db[_0x06b4('0x34')][_0x06b4('0x4e')]({'where':{'id':_0x5ce0fd[_0x06b4('0x56')]['id']}})[_0x06b4('0x29')](function(_0xafb4aa){return db[_0x06b4('0x80')][_0x06b4('0x6c')](function(_0x5d0ab2){return _0xafb4aa[_0x06b4('0x72')](_0x5ce0fd[_0x06b4('0x39')]['ids'],{'transaction':_0x5d0ab2})[_0x06b4('0x29')](function(){if(!_[_0x06b4('0x89')](_0x2da1f7)){return _0xafb4aa[_0x06b4('0x8a')](_0x2da1f7,{'transaction':_0x5d0ab2});}})['then'](function(){_0x2da1f7[_0x06b4('0x6f')](function(_0x2a9b80){socket[_0x06b4('0x70')](_0x06b4('0x8b'),{'UserId':_0x2a9b80,'FaxQueueId':_0xafb4aa['id']});});});});});});})[_0x06b4('0x29')](respondWithStatusCode(_0x54b8e5,null))[_0x06b4('0x4b')](handleError(_0x54b8e5,null));};exports[_0x06b4('0x8c')]=function(_0x502ddf,_0x1c71fb,_0x313cea){return db[_0x06b4('0x34')][_0x06b4('0x4e')]({'where':{'id':_0x502ddf[_0x06b4('0x56')]['id']}})['then'](handleEntityNotFound(_0x1c71fb,null))[_0x06b4('0x29')](function(_0x54fc65){if(_0x54fc65){return _0x54fc65[_0x06b4('0x8c')](_0x502ddf['body']['ids'],_[_0x06b4('0x8d')](_0x502ddf[_0x06b4('0x50')],['ids','id'])||{})[_0x06b4('0x8e')](function(_0x120a51){for(var _0x2ae9df=0x0;_0x2ae9df<_0x502ddf['body'][_0x06b4('0x67')][_0x06b4('0x3e')];_0x2ae9df+=0x1){socket[_0x06b4('0x70')]('userFaxQueue:save',{'UserId':Number(_0x502ddf[_0x06b4('0x50')][_0x06b4('0x67')][_0x2ae9df]),'FaxQueueId':Number(_0x502ddf[_0x06b4('0x56')]['id'])});}return _0x120a51;});}})[_0x06b4('0x29')](respondWithResult(_0x1c71fb,null))[_0x06b4('0x4b')](handleError(_0x1c71fb,null));};exports['removeAgents']=function(_0x4ee92e,_0x1ce54e,_0x3fc672){return db[_0x06b4('0x34')]['find']({'where':{'id':_0x4ee92e[_0x06b4('0x56')]['id']}})['then'](handleEntityNotFound(_0x1ce54e,null))[_0x06b4('0x29')](function(_0x4b2ff6){if(_0x4b2ff6){return _0x4b2ff6[_0x06b4('0x8a')](_0x4ee92e['query']['ids'])['then'](function(){if(_[_0x06b4('0x8f')](_0x4ee92e[_0x06b4('0x39')]['ids'])){for(var _0x246a10=0x0;_0x246a10<_0x4ee92e[_0x06b4('0x39')][_0x06b4('0x67')][_0x06b4('0x3e')];_0x246a10+=0x1){socket[_0x06b4('0x70')](_0x06b4('0x8b'),{'UserId':Number(_0x4ee92e[_0x06b4('0x39')]['ids'][_0x246a10]),'FaxQueueId':Number(_0x4ee92e[_0x06b4('0x56')]['id'])});}}else{socket[_0x06b4('0x70')](_0x06b4('0x8b'),{'UserId':Number(_0x4ee92e[_0x06b4('0x39')][_0x06b4('0x67')]),'FaxQueueId':Number(_0x4ee92e[_0x06b4('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x1ce54e,null))[_0x06b4('0x4b')](handleError(_0x1ce54e,null));};exports['getAgents']=function(_0x52edac,_0x2465f7,_0x38a75b){var _0x2659a2={};var _0xdc9ea1={};var _0x5daf19;var _0x3c604a;return db[_0x06b4('0x34')][_0x06b4('0x90')]({'where':{'id':_0x52edac['params']['id']}})[_0x06b4('0x29')](handleEntityNotFound(_0x2465f7,null))['then'](function(_0x3d1abb){if(_0x3d1abb){_0x5daf19=_0x3d1abb;_0xdc9ea1['model']=_[_0x06b4('0x3a')](db[_0x06b4('0x73')][_0x06b4('0x4d')]);_0xdc9ea1['query']=_[_0x06b4('0x3a')](_0x52edac[_0x06b4('0x39')]);_0xdc9ea1['filters']=_['intersection'](_0xdc9ea1[_0x06b4('0x38')],_0xdc9ea1[_0x06b4('0x39')]);_0x2659a2[_0x06b4('0x3c')]=_['intersection'](_0xdc9ea1[_0x06b4('0x38')],qs[_0x06b4('0x3d')](_0x52edac[_0x06b4('0x39')][_0x06b4('0x3d')]));_0x2659a2[_0x06b4('0x3c')]=_0x2659a2[_0x06b4('0x3c')][_0x06b4('0x3e')]?_0x2659a2[_0x06b4('0x3c')]:_0xdc9ea1[_0x06b4('0x38')];_0x2659a2[_0x06b4('0x3f')]=qs[_0x06b4('0x40')](_0x52edac[_0x06b4('0x39')][_0x06b4('0x40')]);_0x2659a2[_0x06b4('0x41')]=qs[_0x06b4('0x42')](_[_0x06b4('0x43')](_0x52edac[_0x06b4('0x39')],_0xdc9ea1[_0x06b4('0x42')]));if(_0x52edac[_0x06b4('0x39')]['filter']){_0x2659a2[_0x06b4('0x41')]=_[_0x06b4('0x45')](_0x2659a2[_0x06b4('0x41')],{'$or':_[_0x06b4('0x33')](_0x2659a2[_0x06b4('0x3c')],function(_0x3ca5d6){var _0x4fb4e3={};_0x4fb4e3[_0x3ca5d6]={'$like':'%'+_0x52edac[_0x06b4('0x39')][_0x06b4('0x44')]+'%'};return _0x4fb4e3;})});}_0x2659a2=_[_0x06b4('0x45')]({},_0x2659a2,_0x52edac[_0x06b4('0x47')]);return _0x5daf19['getAgents'](_0x2659a2);}})['then'](function(_0x40e321){if(_0x40e321){_0x3c604a=_0x40e321[_0x06b4('0x3e')];if(!_0x52edac[_0x06b4('0x39')]['hasOwnProperty'](_0x06b4('0x65'))){_0x2659a2['limit']=qs[_0x06b4('0x24')](_0x52edac[_0x06b4('0x39')]['limit']);_0x2659a2['offset']=qs[_0x06b4('0x22')](_0x52edac[_0x06b4('0x39')][_0x06b4('0x22')]);}return _0x5daf19[_0x06b4('0x91')](_0x2659a2);}})[_0x06b4('0x29')](function(_0x1ce885){if(_0x1ce885){return _0x1ce885?{'count':_0x3c604a,'rows':_0x1ce885}:null;}})[_0x06b4('0x29')](respondWithResult(_0x2465f7,null))[_0x06b4('0x4b')](handleError(_0x2465f7,null));}; \ No newline at end of file +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 diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 27a6668..4a74b9f 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 _0x2dab=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue'];(function(_0x4868f0,_0x5bc1cf){var _0x530a79=function(_0x3e1ed6){while(--_0x3e1ed6){_0x4868f0['push'](_0x4868f0['shift']());}};_0x530a79(++_0x5bc1cf);}(_0x2dab,0x1c9));var _0xb2da=function(_0x41ea68,_0x5746d3){_0x41ea68=_0x41ea68-0x0;var _0x1947c=_0x2dab[_0x41ea68];return _0x1947c;};'use strict';var EventEmitter=require(_0xb2da('0x0'));var FaxQueue=require(_0xb2da('0x1'))['db'][_0xb2da('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb2da('0x3')](0x0);var events={'afterCreate':_0xb2da('0x4'),'afterUpdate':_0xb2da('0x5'),'afterDestroy':_0xb2da('0x6')};function emitEvent(_0x1aa705){return function(_0x26dc3f,_0x1ce256,_0x10624e){FaxQueueEvents['emit'](_0x1aa705+':'+_0x26dc3f['id'],_0x26dc3f);FaxQueueEvents[_0xb2da('0x7')](_0x1aa705,_0x26dc3f);_0x10624e(null);};}for(var e in events){if(events[_0xb2da('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xb2da('0x9')]=FaxQueueEvents; \ No newline at end of file +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 diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index f92c491..ca9a3c2 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 _0xc29f=['define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x219016,_0x289dc7){var _0x4d2e48=function(_0x589561){while(--_0x589561){_0x219016['push'](_0x219016['shift']());}};_0x4d2e48(++_0x289dc7);}(_0xc29f,0x1ed));var _0xfc29=function(_0x3b39ec,_0x1f8c50){_0x3b39ec=_0x3b39ec-0x0;var _0x15c313=_0xc29f[_0x3b39ec];return _0x15c313;};'use strict';var _=require(_0xfc29('0x0'));var util=require(_0xfc29('0x1'));var logger=require(_0xfc29('0x2'))(_0xfc29('0x3'));var moment=require(_0xfc29('0x4'));var BPromise=require(_0xfc29('0x5'));var rp=require(_0xfc29('0x6'));var fs=require('fs');var path=require(_0xfc29('0x7'));var rimraf=require(_0xfc29('0x8'));var config=require(_0xfc29('0x9'));var attributes=require('./faxQueue.attributes');module[_0xfc29('0xa')]=function(_0x39a7f9,_0x341daf){return _0x39a7f9[_0xfc29('0xb')](_0xfc29('0xc'),attributes,{'tableName':_0xfc29('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index 71d124e..db14cbc 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 _0xdb8d=['debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch','FaxQueue','findAll','options','where','attributes','include','map','model','GetFaxQueue','ShowFaxQueue','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxQueue.socket','then','FaxQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xdb8d,0xf8));var _0xddb8=function(_0x326e69,_0x1f015a){_0x326e69=_0x326e69-0x0;var _0x313cc2=_0xdb8d[_0x326e69];return _0x313cc2;};'use strict';var _=require(_0xddb8('0x0'));var util=require(_0xddb8('0x1'));var moment=require(_0xddb8('0x2'));var BPromise=require(_0xddb8('0x3'));var rs=require(_0xddb8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xddb8('0x5'))['db'];var utils=require(_0xddb8('0x6'));var logger=require('../../config/logger')(_0xddb8('0x7'));var config=require(_0xddb8('0x8'));var jayson=require(_0xddb8('0x9'));var client=jayson[_0xddb8('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xddb8('0xb')],{'host':_0xddb8('0xc'),'port':0x18eb});var socket=require(_0xddb8('0xd'))(new Redis(config[_0xddb8('0xb')]));require(_0xddb8('0xe'))['register'](socket);function respondWithRpcPromise(_0x3ef039,_0x4c393e,_0x297fa6){return new BPromise(function(_0x35c990,_0xd3162f){return client['request'](_0x3ef039,_0x297fa6)[_0xddb8('0xf')](function(_0x551de3){logger['info'](_0xddb8('0x10'),_0x4c393e,_0xddb8('0x11'));logger[_0xddb8('0x12')](_0xddb8('0x13'),_0x4c393e,_0xddb8('0x11'),JSON[_0xddb8('0x14')](_0x551de3));if(_0x551de3['error']){if(_0x551de3['error'][_0xddb8('0x15')]===0x1f4){logger[_0xddb8('0x16')](_0xddb8('0x10'),_0x4c393e,_0x551de3[_0xddb8('0x16')][_0xddb8('0x17')]);return _0xd3162f(_0x551de3[_0xddb8('0x16')]['message']);}logger[_0xddb8('0x16')](_0xddb8('0x10'),_0x4c393e,_0x551de3[_0xddb8('0x16')][_0xddb8('0x17')]);return _0x35c990(_0x551de3[_0xddb8('0x16')][_0xddb8('0x17')]);}else{logger[_0xddb8('0x18')](_0xddb8('0x10'),_0x4c393e,_0xddb8('0x11'));_0x35c990(_0x551de3['result'][_0xddb8('0x17')]);}})[_0xddb8('0x19')](function(_0x152a6a){logger[_0xddb8('0x16')](_0xddb8('0x10'),_0x4c393e,_0x152a6a);_0xd3162f(_0x152a6a);});});}exports['GetFaxQueue']=function(_0x1956f5){var _0x5e7afb=this;return new Promise(function(_0x48d537,_0x3aff6a){return db[_0xddb8('0x1a')][_0xddb8('0x1b')]({'raw':_0x1956f5[_0xddb8('0x1c')]?_0x1956f5[_0xddb8('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1956f5[_0xddb8('0x1c')]?_0x1956f5[_0xddb8('0x1c')][_0xddb8('0x1d')]||null:null,'attributes':_0x1956f5[_0xddb8('0x1c')]?_0x1956f5['options'][_0xddb8('0x1e')]||null:null,'limit':_0x1956f5[_0xddb8('0x1c')]?_0x1956f5['options']['limit']||null:null,'include':_0x1956f5[_0xddb8('0x1c')]?_0x1956f5[_0xddb8('0x1c')][_0xddb8('0x1f')]?_[_0xddb8('0x20')](_0x1956f5['options'][_0xddb8('0x1f')],function(_0xa4cfcf){return{'model':db[_0xa4cfcf['model']],'as':_0xa4cfcf['as'],'attributes':_0xa4cfcf['attributes'],'include':_0xa4cfcf[_0xddb8('0x1f')]?_[_0xddb8('0x20')](_0xa4cfcf[_0xddb8('0x1f')],function(_0x444852){return{'model':db[_0x444852['model']],'as':_0x444852['as'],'attributes':_0x444852[_0xddb8('0x1e')],'include':_0x444852['include']?_[_0xddb8('0x20')](_0x444852[_0xddb8('0x1f')],function(_0x9b2426){return{'model':db[_0x9b2426[_0xddb8('0x21')]],'as':_0x9b2426['as'],'attributes':_0x9b2426[_0xddb8('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe469f0){logger[_0xddb8('0x18')](_0xddb8('0x22'),_0x1956f5);logger[_0xddb8('0x12')](_0xddb8('0x22'),_0x1956f5,JSON[_0xddb8('0x14')](_0xe469f0));_0x48d537(_0xe469f0);})[_0xddb8('0x19')](function(_0x2e5cfd){logger[_0xddb8('0x16')](_0xddb8('0x22'),_0x2e5cfd[_0xddb8('0x17')],_0x1956f5);_0x3aff6a(_0x5e7afb[_0xddb8('0x16')](0x1f4,_0x2e5cfd[_0xddb8('0x17')]));});});};exports[_0xddb8('0x23')]=function(_0x1d9c2d){var _0x1de4fc=this;return new Promise(function(_0x1bf639,_0x38afbe){return db[_0xddb8('0x1a')][_0xddb8('0x24')]({'raw':_0x1d9c2d[_0xddb8('0x1c')]?_0x1d9c2d['options'][_0xddb8('0x25')]===undefined?!![]:![]:!![],'where':_0x1d9c2d[_0xddb8('0x1c')]?_0x1d9c2d[_0xddb8('0x1c')][_0xddb8('0x1d')]||null:null,'attributes':_0x1d9c2d['options']?_0x1d9c2d[_0xddb8('0x1c')][_0xddb8('0x1e')]||null:null,'include':_0x1d9c2d['options']?_0x1d9c2d[_0xddb8('0x1c')][_0xddb8('0x1f')]?_['map'](_0x1d9c2d[_0xddb8('0x1c')][_0xddb8('0x1f')],function(_0x3ec566){return{'model':db[_0x3ec566['model']],'as':_0x3ec566['as'],'attributes':_0x3ec566[_0xddb8('0x1e')],'include':_0x3ec566[_0xddb8('0x1f')]?_[_0xddb8('0x20')](_0x3ec566[_0xddb8('0x1f')],function(_0x57bd53){return{'model':db[_0x57bd53[_0xddb8('0x21')]],'as':_0x57bd53['as'],'attributes':_0x57bd53[_0xddb8('0x1e')],'include':_0x57bd53[_0xddb8('0x1f')]?_['map'](_0x57bd53[_0xddb8('0x1f')],function(_0xcde4dd){return{'model':db[_0xcde4dd[_0xddb8('0x21')]],'as':_0xcde4dd['as'],'attributes':_0xcde4dd[_0xddb8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xddb8('0xf')](function(_0x379d87){logger['info']('ShowFaxQueue',_0x1d9c2d);logger[_0xddb8('0x12')](_0xddb8('0x23'),_0x1d9c2d,JSON[_0xddb8('0x14')](_0x379d87));_0x1bf639(_0x379d87);})[_0xddb8('0x19')](function(_0x12e512){logger[_0xddb8('0x16')](_0xddb8('0x23'),_0x12e512['message'],_0x1d9c2d);_0x38afbe(_0x1de4fc[_0xddb8('0x16')](0x1f4,_0x12e512[_0xddb8('0x17')]));});});}; \ No newline at end of file +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 diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index fb6e661..c622123 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 _0xef39=['faxQueue:','./faxQueue.events','save','remove','update','removeListener','register','length'];(function(_0x5edf60,_0xc0b458){var _0x27d02b=function(_0x25448f){while(--_0x25448f){_0x5edf60['push'](_0x5edf60['shift']());}};_0x27d02b(++_0xc0b458);}(_0xef39,0xa9));var _0x9ef3=function(_0x588f2b,_0x502bc9){_0x588f2b=_0x588f2b-0x0;var _0x2fe0b2=_0xef39[_0x588f2b];return _0x2fe0b2;};'use strict';var FaxQueueEvents=require(_0x9ef3('0x0'));var events=[_0x9ef3('0x1'),_0x9ef3('0x2'),_0x9ef3('0x3')];function createListener(_0x51bcbe,_0x16d018){return function(_0x48deea){_0x16d018['emit'](_0x51bcbe,_0x48deea);};}function removeListener(_0x1979fb,_0x48e219){return function(){FaxQueueEvents[_0x9ef3('0x4')](_0x1979fb,_0x48e219);};}exports[_0x9ef3('0x5')]=function(_0x526bc5){for(var _0x1fc51d=0x0,_0x2247ab=events[_0x9ef3('0x6')];_0x1fc51d<_0x2247ab;_0x1fc51d++){var _0x1c5119=events[_0x1fc51d];var _0x4dfedf=createListener(_0x9ef3('0x7')+_0x1c5119,_0x526bc5);FaxQueueEvents['on'](_0x1c5119,_0x4dfedf);}}; \ No newline at end of file +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 diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 0a6dc87..e5f2426 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 _0x9bd9=['/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','create','addTeams','addAgents','put','update','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe'];(function(_0x30f572,_0x5a0600){var _0x4c7f3d=function(_0x4259c3){while(--_0x4259c3){_0x30f572['push'](_0x30f572['shift']());}};_0x4c7f3d(++_0x5a0600);}(_0x9bd9,0x1a4));var _0x99bd=function(_0x45f42e,_0x417bb){_0x45f42e=_0x45f42e-0x0;var _0x5704b6=_0x9bd9[_0x45f42e];return _0x5704b6;};'use strict';var multer=require(_0x99bd('0x0'));var util=require(_0x99bd('0x1'));var path=require(_0x99bd('0x2'));var timeout=require(_0x99bd('0x3'));var express=require(_0x99bd('0x4'));var router=express[_0x99bd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x99bd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x99bd('0x7'));var controller=require(_0x99bd('0x8'));router['get']('/',auth[_0x99bd('0x9')](),controller[_0x99bd('0xa')]);router[_0x99bd('0xb')](_0x99bd('0xc'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xd')]);router[_0x99bd('0xb')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0xf')]);router[_0x99bd('0xb')](_0x99bd('0x10'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x11')]);router['get'](_0x99bd('0x12'),auth['isAuthenticated'](),controller[_0x99bd('0x13')]);router['get'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller['getAgents']);router[_0x99bd('0x15')]('/',auth['isAuthenticated'](),controller[_0x99bd('0x16')]);router['post'](_0x99bd('0x12'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x17')]);router['post'](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x18')]);router[_0x99bd('0x19')](_0x99bd('0xe'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1a')]);router[_0x99bd('0x1b')](_0x99bd('0xe'),auth['isAuthenticated'](),controller[_0x99bd('0x1c')]);router[_0x99bd('0x1b')](_0x99bd('0x12'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x99bd('0x1b')](_0x99bd('0x14'),auth[_0x99bd('0x9')](),controller[_0x99bd('0x1d')]);module[_0x99bd('0x1e')]=router; \ No newline at end of file +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 diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 69ab0f9..b8f1664 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 _0xc5bf=['sequelize','STRING','DATE'];(function(_0xe6e78c,_0x582369){var _0x2a09c8=function(_0x470ccc){while(--_0x470ccc){_0xe6e78c['push'](_0xe6e78c['shift']());}};_0x2a09c8(++_0x582369);}(_0xc5bf,0x1ad));var _0xfc5b=function(_0x4960db,_0x543010){_0x4960db=_0x4960db-0x0;var _0x50d232=_0xc5bf[_0x4960db];return _0x50d232;};'use strict';var moment=require('moment');var Sequelize=require(_0xfc5b('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xfc5b('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xfc5b('0x1')]},'joinAt':{'type':Sequelize[_0xfc5b('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfc5b('0x2')]},'exitAt':{'type':Sequelize[_0xfc5b('0x2')]},'reason':{'type':Sequelize[_0xfc5b('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 0ff5270..e3ab9a1 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 _0x7b05=['params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','FaxQueueReport','includeAll','include','findAll','rows','catch','show','options','find','create','body'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x7b05,0x91));var _0x57b0=function(_0x460150,_0x232949){_0x460150=_0x460150-0x0;var _0x340677=_0x7b05[_0x460150];return _0x340677;};'use strict';var emlformat=require(_0x57b0('0x0'));var rimraf=require(_0x57b0('0x1'));var zipdir=require(_0x57b0('0x2'));var jsonpatch=require(_0x57b0('0x3'));var rp=require('request-promise');var moment=require(_0x57b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57b0('0x5'));var util=require(_0x57b0('0x6'));var path=require(_0x57b0('0x7'));var sox=require(_0x57b0('0x8'));var csv=require(_0x57b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57b0('0xa'));var _=require('lodash');var squel=require(_0x57b0('0xb'));var crypto=require(_0x57b0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57b0('0xd'));var Redis=require(_0x57b0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57b0('0xf'));var logger=require(_0x57b0('0x10'))(_0x57b0('0x11'));var utils=require(_0x57b0('0x12'));var config=require(_0x57b0('0x13'));var licenseUtil=require(_0x57b0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363096,_0x145eae){_0x145eae=_0x145eae||0xcc;return function(_0xee8335){if(_0xee8335){return _0x363096['sendStatus'](_0x145eae);}return _0x363096['status'](_0x145eae)[_0x57b0('0x15')]();};}function respondWithResult(_0x3f95e3,_0xc9044f){_0xc9044f=_0xc9044f||0xc8;return function(_0x3b48a3){if(_0x3b48a3){return _0x3f95e3['status'](_0xc9044f)[_0x57b0('0x16')](_0x3b48a3);}};}function respondWithFilteredResult(_0x5c46a5,_0x235d4a){return function(_0xa20423){if(_0xa20423){var _0x55fd9c=typeof _0x235d4a[_0x57b0('0x17')]===_0x57b0('0x18')&&typeof _0x235d4a[_0x57b0('0x19')]===_0x57b0('0x18');var _0x3eb198=_0xa20423['count'];var _0x37bd5d=_0x55fd9c?0x0:_0x235d4a['offset'];var _0x592b2d=_0x55fd9c?_0xa20423[_0x57b0('0x1a')]:_0x235d4a[_0x57b0('0x17')]+_0x235d4a[_0x57b0('0x19')];var _0x3e14f5;if(_0x592b2d>=_0x3eb198){_0x592b2d=_0x3eb198;_0x3e14f5=0xc8;}else{_0x3e14f5=0xce;}_0x5c46a5[_0x57b0('0x1b')](_0x3e14f5);return _0x5c46a5[_0x57b0('0x1c')]('Content-Range',_0x37bd5d+'-'+_0x592b2d+'/'+_0x3eb198)[_0x57b0('0x16')](_0xa20423);}return null;};}function patchUpdates(_0x1d81ff){return function(_0x35a457){try{jsonpatch['apply'](_0x35a457,_0x1d81ff,!![]);}catch(_0x12f2f6){return BPromise[_0x57b0('0x1d')](_0x12f2f6);}return _0x35a457[_0x57b0('0x1e')]();};}function saveUpdates(_0x149056,_0x2ffc0a){return function(_0x22b11e){if(_0x22b11e){return _0x22b11e[_0x57b0('0x1f')](_0x149056)[_0x57b0('0x20')](function(_0x3497e4){return _0x3497e4;});}return null;};}function removeEntity(_0x5c60b9,_0x55b870){return function(_0x40c279){if(_0x40c279){return _0x40c279['destroy']()[_0x57b0('0x20')](function(){_0x5c60b9[_0x57b0('0x1b')](0xcc)[_0x57b0('0x15')]();});}};}function handleEntityNotFound(_0x38e3a0,_0x3e75e8){return function(_0xbf54ac){if(!_0xbf54ac){_0x38e3a0[_0x57b0('0x21')](0x194);}return _0xbf54ac;};}function handleError(_0x1eb523,_0xacd07c){_0xacd07c=_0xacd07c||0x1f4;return function(_0x109678){logger[_0x57b0('0x22')](_0x109678[_0x57b0('0x23')]);if(_0x109678[_0x57b0('0x24')]){delete _0x109678['name'];}_0x1eb523[_0x57b0('0x1b')](_0xacd07c)[_0x57b0('0x25')](_0x109678);};}exports[_0x57b0('0x26')]=function(_0x228dfe,_0x5e046c){var _0x552f3e={},_0x325e39={},_0x3aaf57={'count':0x0,'rows':[]};var _0x1ccf42=_['map'](db['FaxQueueReport'][_0x57b0('0x27')],function(_0x577dae){return{'name':_0x577dae[_0x57b0('0x28')],'type':_0x577dae['type']['key']};});_0x325e39[_0x57b0('0x29')]=_[_0x57b0('0x2a')](_0x1ccf42,'name');_0x325e39[_0x57b0('0x2b')]=_[_0x57b0('0x2c')](_0x228dfe['query']);_0x325e39[_0x57b0('0x2d')]=_[_0x57b0('0x2e')](_0x325e39[_0x57b0('0x29')],_0x325e39['query']);_0x552f3e[_0x57b0('0x2f')]=_[_0x57b0('0x2e')](_0x325e39[_0x57b0('0x29')],qs[_0x57b0('0x30')](_0x228dfe[_0x57b0('0x2b')]['fields']));_0x552f3e['attributes']=_0x552f3e['attributes']['length']?_0x552f3e[_0x57b0('0x2f')]:_0x325e39[_0x57b0('0x29')];if(!_0x228dfe[_0x57b0('0x2b')][_0x57b0('0x31')](_0x57b0('0x32'))){_0x552f3e['limit']=qs[_0x57b0('0x19')](_0x228dfe[_0x57b0('0x2b')][_0x57b0('0x19')]);_0x552f3e[_0x57b0('0x17')]=qs['offset'](_0x228dfe[_0x57b0('0x2b')][_0x57b0('0x17')]);}_0x552f3e['order']=qs[_0x57b0('0x33')](_0x228dfe[_0x57b0('0x2b')]['sort']);_0x552f3e['where']=qs[_0x57b0('0x2d')](_[_0x57b0('0x34')](_0x228dfe[_0x57b0('0x2b')],_0x325e39[_0x57b0('0x2d')]),_0x1ccf42);if(_0x228dfe[_0x57b0('0x2b')][_0x57b0('0x35')]){_0x552f3e[_0x57b0('0x36')]=_[_0x57b0('0x37')](_0x552f3e[_0x57b0('0x36')],{'$or':_[_0x57b0('0x2a')](_0x1ccf42,function(_0x37e0a7){if(_0x37e0a7[_0x57b0('0x38')]!=='VIRTUAL'){var _0x3fc2a1={};_0x3fc2a1[_0x37e0a7[_0x57b0('0x24')]]={'$like':'%'+_0x228dfe[_0x57b0('0x2b')]['filter']+'%'};return _0x3fc2a1;}})});}_0x552f3e=_['merge']({},_0x552f3e,_0x228dfe['options']);var _0x14ce66={'where':_0x552f3e[_0x57b0('0x36')]};return db[_0x57b0('0x39')][_0x57b0('0x1a')](_0x14ce66)['then'](function(_0x24fa42){_0x3aaf57[_0x57b0('0x1a')]=_0x24fa42;if(_0x228dfe['query'][_0x57b0('0x3a')]){_0x552f3e[_0x57b0('0x3b')]=[{'all':!![]}];}return db[_0x57b0('0x39')][_0x57b0('0x3c')](_0x552f3e);})[_0x57b0('0x20')](function(_0x5980db){_0x3aaf57[_0x57b0('0x3d')]=_0x5980db;return _0x3aaf57;})[_0x57b0('0x20')](respondWithFilteredResult(_0x5e046c,_0x552f3e))[_0x57b0('0x3e')](handleError(_0x5e046c,null));};exports[_0x57b0('0x3f')]=function(_0x58c320,_0x574431){var _0xa7b431={'raw':!![],'where':{'id':_0x58c320['params']['id']}},_0x344bc6={};_0x344bc6[_0x57b0('0x29')]=_[_0x57b0('0x2c')](db[_0x57b0('0x39')]['rawAttributes']);_0x344bc6['query']=_[_0x57b0('0x2c')](_0x58c320[_0x57b0('0x2b')]);_0x344bc6[_0x57b0('0x2d')]=_[_0x57b0('0x2e')](_0x344bc6[_0x57b0('0x29')],_0x344bc6['query']);_0xa7b431[_0x57b0('0x2f')]=_[_0x57b0('0x2e')](_0x344bc6[_0x57b0('0x29')],qs[_0x57b0('0x30')](_0x58c320[_0x57b0('0x2b')]['fields']));_0xa7b431['attributes']=_0xa7b431['attributes']['length']?_0xa7b431[_0x57b0('0x2f')]:_0x344bc6[_0x57b0('0x29')];if(_0x58c320[_0x57b0('0x2b')][_0x57b0('0x3a')]){_0xa7b431[_0x57b0('0x3b')]=[{'all':!![]}];}_0xa7b431=_[_0x57b0('0x37')]({},_0xa7b431,_0x58c320[_0x57b0('0x40')]);return db['FaxQueueReport'][_0x57b0('0x41')](_0xa7b431)[_0x57b0('0x20')](handleEntityNotFound(_0x574431,null))[_0x57b0('0x20')](respondWithResult(_0x574431,null))[_0x57b0('0x3e')](handleError(_0x574431,null));};exports[_0x57b0('0x42')]=function(_0x358517,_0x5380e7){return db['FaxQueueReport'][_0x57b0('0x42')](_0x358517['body'],{})[_0x57b0('0x20')](respondWithResult(_0x5380e7,0xc9))['catch'](handleError(_0x5380e7,null));};exports[_0x57b0('0x1f')]=function(_0x5cae47,_0x40dae2){if(_0x5cae47[_0x57b0('0x43')]['id']){delete _0x5cae47['body']['id'];}return db[_0x57b0('0x39')][_0x57b0('0x41')]({'where':{'id':_0x5cae47[_0x57b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x40dae2,null))[_0x57b0('0x20')](saveUpdates(_0x5cae47[_0x57b0('0x43')],null))['then'](respondWithResult(_0x40dae2,null))[_0x57b0('0x3e')](handleError(_0x40dae2,null));};exports[_0x57b0('0x45')]=function(_0x4d891b,_0x467731){return db[_0x57b0('0x39')][_0x57b0('0x41')]({'where':{'id':_0x4d891b[_0x57b0('0x44')]['id']}})[_0x57b0('0x20')](handleEntityNotFound(_0x467731,null))['then'](removeEntity(_0x467731,null))['catch'](handleError(_0x467731,null));};exports[_0x57b0('0x46')]=function(_0x1e0702,_0x22f0ae){return db['FaxQueueReport'][_0x57b0('0x46')]()[_0x57b0('0x20')](respondWithResult(_0x22f0ae,null))[_0x57b0('0x3e')](handleError(_0x22f0ae,null));}; \ No newline at end of file +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 diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 757ee2b..17f4022 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 _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x814b,0x1a2));var _0xb814=function(_0x5538d5,_0x190032){_0x5538d5=_0x5538d5-0x0;var _0x323b1a=_0x814b[_0x5538d5];return _0x323b1a;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 5a557c0..e9b6679 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 _0x0b1b=['FaxQueueReport','create','options','raw','then','debug','UpdateFaxQueueReport','update','body','where','attributes','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxQueueReport'];(function(_0x48229a,_0x2dac65){var _0x5342e5=function(_0x3ccffe){while(--_0x3ccffe){_0x48229a['push'](_0x48229a['shift']());}};_0x5342e5(++_0x2dac65);}(_0x0b1b,0x6b));var _0xb0b1=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x0b1b[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb0b1('0x0'));var BPromise=require('bluebird');var rs=require(_0xb0b1('0x1'));var fs=require('fs');var Redis=require(_0xb0b1('0x2'));var db=require(_0xb0b1('0x3'))['db'];var utils=require(_0xb0b1('0x4'));var logger=require(_0xb0b1('0x5'))(_0xb0b1('0x6'));var config=require('../../config/environment');var jayson=require(_0xb0b1('0x7'));var client=jayson['client'][_0xb0b1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5236cf,_0x1c87c2,_0x2b4138){return new BPromise(function(_0x5e78ed,_0x5e6848){return client[_0xb0b1('0x9')](_0x5236cf,_0x2b4138)['then'](function(_0x13e4f1){logger['info'](_0xb0b1('0xa'),_0x1c87c2,'request\x20sent');logger['debug'](_0xb0b1('0xb'),_0x1c87c2,_0xb0b1('0xc'),JSON[_0xb0b1('0xd')](_0x13e4f1));if(_0x13e4f1['error']){if(_0x13e4f1[_0xb0b1('0xe')][_0xb0b1('0xf')]===0x1f4){logger[_0xb0b1('0xe')](_0xb0b1('0xa'),_0x1c87c2,_0x13e4f1[_0xb0b1('0xe')][_0xb0b1('0x10')]);return _0x5e6848(_0x13e4f1[_0xb0b1('0xe')][_0xb0b1('0x10')]);}logger[_0xb0b1('0xe')]('FaxQueueReport,\x20%s,\x20%s',_0x1c87c2,_0x13e4f1['error'][_0xb0b1('0x10')]);return _0x5e78ed(_0x13e4f1[_0xb0b1('0xe')]['message']);}else{logger[_0xb0b1('0x11')](_0xb0b1('0xa'),_0x1c87c2,_0xb0b1('0xc'));_0x5e78ed(_0x13e4f1[_0xb0b1('0x12')][_0xb0b1('0x10')]);}})[_0xb0b1('0x13')](function(_0x2f4d39){logger['error'](_0xb0b1('0xa'),_0x1c87c2,_0x2f4d39);_0x5e6848(_0x2f4d39);});});}exports[_0xb0b1('0x14')]=function(_0x5be853){var _0x41b426=this;return new Promise(function(_0x40234d,_0x5e5e98){return db[_0xb0b1('0x15')][_0xb0b1('0x16')](_0x5be853['body'],{'raw':_0x5be853[_0xb0b1('0x17')]?_0x5be853[_0xb0b1('0x17')][_0xb0b1('0x18')]===undefined?!![]:![]:!![]})[_0xb0b1('0x19')](function(_0x4dfb30){logger[_0xb0b1('0x11')]('CreateFaxQueueReport',_0x5be853);logger[_0xb0b1('0x1a')](_0xb0b1('0x14'),_0x5be853,JSON['stringify'](_0x4dfb30));_0x40234d(_0x4dfb30);})['catch'](function(_0xc553bc){logger[_0xb0b1('0xe')](_0xb0b1('0x14'),_0xc553bc[_0xb0b1('0x10')],_0x5be853);_0x5e5e98(_0x41b426['error'](0x1f4,_0xc553bc[_0xb0b1('0x10')]));});});};exports[_0xb0b1('0x1b')]=function(_0x206bff){var _0x4ad898=this;return new Promise(function(_0x2c9699,_0xeb0b7f){return db[_0xb0b1('0x15')][_0xb0b1('0x1c')](_0x206bff[_0xb0b1('0x1d')],{'raw':_0x206bff[_0xb0b1('0x17')]?_0x206bff[_0xb0b1('0x17')][_0xb0b1('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x206bff[_0xb0b1('0x17')]?_0x206bff['options'][_0xb0b1('0x1e')]||null:null,'attributes':_0x206bff[_0xb0b1('0x17')]?_0x206bff[_0xb0b1('0x17')][_0xb0b1('0x1f')]||null:null,'limit':_0x206bff[_0xb0b1('0x17')]?_0x206bff['options']['limit']||null:null})['then'](function(_0x10619e){logger[_0xb0b1('0x11')](_0xb0b1('0x1b'),_0x206bff);logger[_0xb0b1('0x1a')](_0xb0b1('0x1b'),_0x206bff,JSON['stringify'](_0x10619e));_0x2c9699(_0x10619e);})[_0xb0b1('0x13')](function(_0x1cd64c){logger['error'](_0xb0b1('0x1b'),_0x1cd64c[_0xb0b1('0x10')],_0x206bff);_0xeb0b7f(_0x4ad898[_0xb0b1('0xe')](0x1f4,_0x1cd64c[_0xb0b1('0x10')]));});});}; \ No newline at end of file +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 diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e1d0d83..0b2af42 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 _0x6556=['/:id','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./faxQueueReport.controller','get','isAuthenticated','index','/describe','show','put'];(function(_0x1863be,_0x3fb18f){var _0x5835e1=function(_0xaa0e92){while(--_0xaa0e92){_0x1863be['push'](_0x1863be['shift']());}};_0x5835e1(++_0x3fb18f);}(_0x6556,0xc9));var _0x6655=function(_0x270d27,_0x521c3a){_0x270d27=_0x270d27-0x0;var _0x49a72f=_0x6556[_0x270d27];return _0x49a72f;};'use strict';var multer=require(_0x6655('0x0'));var util=require(_0x6655('0x1'));var path=require(_0x6655('0x2'));var timeout=require(_0x6655('0x3'));var express=require(_0x6655('0x4'));var router=express[_0x6655('0x5')]();var fs_extra=require(_0x6655('0x6'));var auth=require(_0x6655('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6655('0x8'));router[_0x6655('0x9')]('/',auth[_0x6655('0xa')](),controller[_0x6655('0xb')]);router[_0x6655('0x9')](_0x6655('0xc'),auth[_0x6655('0xa')](),controller['describe']);router[_0x6655('0x9')]('/:id',auth[_0x6655('0xa')](),controller[_0x6655('0xd')]);router['post']('/',auth[_0x6655('0xa')](),controller['create']);router[_0x6655('0xe')](_0x6655('0xf'),auth[_0x6655('0xa')](),controller[_0x6655('0x10')]);router[_0x6655('0x11')]('/:id',auth[_0x6655('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index ccc434d..eb3766a 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2a77de,_0x5c56f5){var _0x532075=function(_0x333d04){while(--_0x333d04){_0x2a77de['push'](_0x2a77de['shift']());}};_0x532075(++_0x5c56f5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 _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 diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index a8d4121..8c0b753 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 _0xdd8a=['desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','FaxTransferReport','fieldName','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','show','rawAttributes','options','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x2a18d5,_0x482b20){var _0x5900af=function(_0x2dfd73){while(--_0x2dfd73){_0x2a18d5['push'](_0x2a18d5['shift']());}};_0x5900af(++_0x482b20);}(_0xdd8a,0x84));var _0xadd8=function(_0x21ecc8,_0x2bdead){_0x21ecc8=_0x21ecc8-0x0;var _0x510c1d=_0xdd8a[_0x21ecc8];return _0x510c1d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadd8('0x0'));var zipdir=require(_0xadd8('0x1'));var jsonpatch=require(_0xadd8('0x2'));var rp=require(_0xadd8('0x3'));var moment=require(_0xadd8('0x4'));var BPromise=require(_0xadd8('0x5'));var Mustache=require(_0xadd8('0x6'));var util=require('util');var path=require(_0xadd8('0x7'));var sox=require(_0xadd8('0x8'));var csv=require(_0xadd8('0x9'));var ejs=require(_0xadd8('0xa'));var fs=require('fs');var fs_extra=require(_0xadd8('0xb'));var _=require(_0xadd8('0xc'));var squel=require(_0xadd8('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xadd8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xadd8('0xf'));var Papa=require(_0xadd8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xadd8('0x11'));var as=require(_0xadd8('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xadd8('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xadd8('0x14'));var licenseUtil=require(_0xadd8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x877514,_0x2b6d7a){_0x2b6d7a=_0x2b6d7a||0xcc;return function(_0x23c4cb){if(_0x23c4cb){return _0x877514[_0xadd8('0x16')](_0x2b6d7a);}return _0x877514['status'](_0x2b6d7a)[_0xadd8('0x17')]();};}function respondWithResult(_0x3d0399,_0x5cc0ce){_0x5cc0ce=_0x5cc0ce||0xc8;return function(_0x1546cb){if(_0x1546cb){return _0x3d0399[_0xadd8('0x18')](_0x5cc0ce)[_0xadd8('0x19')](_0x1546cb);}};}function respondWithFilteredResult(_0x10e522,_0x530151){return function(_0x41b594){if(_0x41b594){var _0x51d6e6=typeof _0x530151[_0xadd8('0x1a')]===_0xadd8('0x1b')&&typeof _0x530151[_0xadd8('0x1c')]==='undefined';var _0x52c58a=_0x41b594[_0xadd8('0x1d')];var _0x3d875a=_0x51d6e6?0x0:_0x530151['offset'];var _0xaf0ef9=_0x51d6e6?_0x41b594[_0xadd8('0x1d')]:_0x530151['offset']+_0x530151[_0xadd8('0x1c')];var _0x1e603d;if(_0xaf0ef9>=_0x52c58a){_0xaf0ef9=_0x52c58a;_0x1e603d=0xc8;}else{_0x1e603d=0xce;}_0x10e522[_0xadd8('0x18')](_0x1e603d);return _0x10e522[_0xadd8('0x1e')]('Content-Range',_0x3d875a+'-'+_0xaf0ef9+'/'+_0x52c58a)[_0xadd8('0x19')](_0x41b594);}return null;};}function patchUpdates(_0x4d0b0f){return function(_0x1f9cdd){try{jsonpatch[_0xadd8('0x1f')](_0x1f9cdd,_0x4d0b0f,!![]);}catch(_0x30e9ca){return BPromise[_0xadd8('0x20')](_0x30e9ca);}return _0x1f9cdd[_0xadd8('0x21')]();};}function saveUpdates(_0x357c0d,_0x26e26a){return function(_0x1c544b){if(_0x1c544b){return _0x1c544b[_0xadd8('0x22')](_0x357c0d)['then'](function(_0x60bd95){return _0x60bd95;});}return null;};}function removeEntity(_0x9ecda3,_0x399b89){return function(_0x2456f2){if(_0x2456f2){return _0x2456f2[_0xadd8('0x23')]()['then'](function(){_0x9ecda3[_0xadd8('0x18')](0xcc)[_0xadd8('0x17')]();});}};}function handleEntityNotFound(_0x45ee5c,_0x2b363a){return function(_0x423cef){if(!_0x423cef){_0x45ee5c[_0xadd8('0x16')](0x194);}return _0x423cef;};}function handleError(_0x332a7d,_0x1b39a3){_0x1b39a3=_0x1b39a3||0x1f4;return function(_0x1bff3d){logger[_0xadd8('0x24')](_0x1bff3d[_0xadd8('0x25')]);if(_0x1bff3d[_0xadd8('0x26')]){delete _0x1bff3d[_0xadd8('0x26')];}_0x332a7d[_0xadd8('0x18')](_0x1b39a3)[_0xadd8('0x27')](_0x1bff3d);};}exports[_0xadd8('0x28')]=function(_0x28e0e6,_0x3b2f9b){var _0x7858af={},_0x1ed54d={},_0x22c674={'count':0x0,'rows':[]};var _0x1f2ab3=_['map'](db[_0xadd8('0x29')]['rawAttributes'],function(_0x13f800){return{'name':_0x13f800[_0xadd8('0x2a')],'type':_0x13f800[_0xadd8('0x2b')]['key']};});_0x1ed54d['model']=_[_0xadd8('0x2c')](_0x1f2ab3,'name');_0x1ed54d[_0xadd8('0x2d')]=_['keys'](_0x28e0e6[_0xadd8('0x2d')]);_0x1ed54d[_0xadd8('0x2e')]=_['intersection'](_0x1ed54d[_0xadd8('0x2f')],_0x1ed54d[_0xadd8('0x2d')]);_0x7858af[_0xadd8('0x30')]=_[_0xadd8('0x31')](_0x1ed54d[_0xadd8('0x2f')],qs[_0xadd8('0x32')](_0x28e0e6[_0xadd8('0x2d')][_0xadd8('0x32')]));_0x7858af['attributes']=_0x7858af['attributes'][_0xadd8('0x33')]?_0x7858af[_0xadd8('0x30')]:_0x1ed54d[_0xadd8('0x2f')];if(!_0x28e0e6[_0xadd8('0x2d')][_0xadd8('0x34')]('nolimit')){_0x7858af['limit']=qs[_0xadd8('0x1c')](_0x28e0e6[_0xadd8('0x2d')]['limit']);_0x7858af[_0xadd8('0x1a')]=qs[_0xadd8('0x1a')](_0x28e0e6[_0xadd8('0x2d')][_0xadd8('0x1a')]);}_0x7858af['order']=qs['sort'](_0x28e0e6['query'][_0xadd8('0x35')]);_0x7858af[_0xadd8('0x36')]=qs[_0xadd8('0x2e')](_[_0xadd8('0x37')](_0x28e0e6[_0xadd8('0x2d')],_0x1ed54d[_0xadd8('0x2e')]),_0x1f2ab3);if(_0x28e0e6['query'][_0xadd8('0x38')]){_0x7858af[_0xadd8('0x36')]=_[_0xadd8('0x39')](_0x7858af[_0xadd8('0x36')],{'$or':_['map'](_0x1f2ab3,function(_0x1b66a4){if(_0x1b66a4[_0xadd8('0x2b')]!==_0xadd8('0x3a')){var _0x5d7eee={};_0x5d7eee[_0x1b66a4[_0xadd8('0x26')]]={'$like':'%'+_0x28e0e6[_0xadd8('0x2d')][_0xadd8('0x38')]+'%'};return _0x5d7eee;}})});}_0x7858af=_[_0xadd8('0x39')]({},_0x7858af,_0x28e0e6['options']);var _0x236afd={'where':_0x7858af[_0xadd8('0x36')]};return db['FaxTransferReport'][_0xadd8('0x1d')](_0x236afd)[_0xadd8('0x3b')](function(_0x50c79c){_0x22c674[_0xadd8('0x1d')]=_0x50c79c;if(_0x28e0e6[_0xadd8('0x2d')][_0xadd8('0x3c')]){_0x7858af[_0xadd8('0x3d')]=[{'all':!![]}];}return db[_0xadd8('0x29')][_0xadd8('0x3e')](_0x7858af);})[_0xadd8('0x3b')](function(_0x5b4615){_0x22c674[_0xadd8('0x3f')]=_0x5b4615;return _0x22c674;})[_0xadd8('0x3b')](respondWithFilteredResult(_0x3b2f9b,_0x7858af))[_0xadd8('0x40')](handleError(_0x3b2f9b,null));};exports[_0xadd8('0x41')]=function(_0x5a7457,_0x57d633){var _0x1995c4={'raw':!![],'where':{'id':_0x5a7457['params']['id']}},_0xfe91a8={};_0xfe91a8[_0xadd8('0x2f')]=_['keys'](db[_0xadd8('0x29')][_0xadd8('0x42')]);_0xfe91a8[_0xadd8('0x2d')]=_['keys'](_0x5a7457['query']);_0xfe91a8['filters']=_['intersection'](_0xfe91a8[_0xadd8('0x2f')],_0xfe91a8['query']);_0x1995c4['attributes']=_[_0xadd8('0x31')](_0xfe91a8[_0xadd8('0x2f')],qs['fields'](_0x5a7457[_0xadd8('0x2d')]['fields']));_0x1995c4[_0xadd8('0x30')]=_0x1995c4[_0xadd8('0x30')][_0xadd8('0x33')]?_0x1995c4[_0xadd8('0x30')]:_0xfe91a8[_0xadd8('0x2f')];if(_0x5a7457[_0xadd8('0x2d')][_0xadd8('0x3c')]){_0x1995c4[_0xadd8('0x3d')]=[{'all':!![]}];}_0x1995c4=_[_0xadd8('0x39')]({},_0x1995c4,_0x5a7457[_0xadd8('0x43')]);return db[_0xadd8('0x29')][_0xadd8('0x44')](_0x1995c4)[_0xadd8('0x3b')](handleEntityNotFound(_0x57d633,null))['then'](respondWithResult(_0x57d633,null))[_0xadd8('0x40')](handleError(_0x57d633,null));};exports[_0xadd8('0x45')]=function(_0x9a68e0,_0x1570c5){return db['FaxTransferReport'][_0xadd8('0x45')](_0x9a68e0[_0xadd8('0x46')],{})[_0xadd8('0x3b')](respondWithResult(_0x1570c5,0xc9))['catch'](handleError(_0x1570c5,null));};exports[_0xadd8('0x22')]=function(_0x51755d,_0x5d5cd7){if(_0x51755d[_0xadd8('0x46')]['id']){delete _0x51755d[_0xadd8('0x46')]['id'];}return db[_0xadd8('0x29')][_0xadd8('0x44')]({'where':{'id':_0x51755d[_0xadd8('0x47')]['id']}})[_0xadd8('0x3b')](handleEntityNotFound(_0x5d5cd7,null))[_0xadd8('0x3b')](saveUpdates(_0x51755d[_0xadd8('0x46')],null))[_0xadd8('0x3b')](respondWithResult(_0x5d5cd7,null))[_0xadd8('0x40')](handleError(_0x5d5cd7,null));};exports[_0xadd8('0x23')]=function(_0x50cf8b,_0x34df34){return db[_0xadd8('0x29')][_0xadd8('0x44')]({'where':{'id':_0x50cf8b[_0xadd8('0x47')]['id']}})[_0xadd8('0x3b')](handleEntityNotFound(_0x34df34,null))[_0xadd8('0x3b')](removeEntity(_0x34df34,null))[_0xadd8('0x40')](handleError(_0x34df34,null));};exports[_0xadd8('0x48')]=function(_0x417636,_0x5f0cff){return db[_0xadd8('0x29')]['describe']()[_0xadd8('0x3b')](respondWithResult(_0x5f0cff,null))[_0xadd8('0x40')](handleError(_0x5f0cff,null));}; \ No newline at end of file +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 diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 2f6acca..b5aa758 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 _0xc25d=['moment','request-promise','rimraf','./faxTransferReport.attributes','define','FaxTransferReport','report_fax_transfer','uniqueid','api'];(function(_0x148d9a,_0x1f3ab2){var _0x1440db=function(_0x28c9f8){while(--_0x28c9f8){_0x148d9a['push'](_0x148d9a['shift']());}};_0x1440db(++_0x1f3ab2);}(_0xc25d,0x1ee));var _0xdc25=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xc25d[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xdc25('0x0'));var moment=require(_0xdc25('0x1'));var BPromise=require('bluebird');var rp=require(_0xdc25('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc25('0x3'));var config=require('../../config/environment');var attributes=require(_0xdc25('0x4'));module['exports']=function(_0x3a2376,_0xb06b60){return _0x3a2376[_0xdc25('0x5')](_0xdc25('0x6'),attributes,{'tableName':_0xdc25('0x7'),'paranoid':![],'indexes':[{'name':_0xdc25('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index e59b19e..6dfe48c 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 _0x6c6c=['stringify','error','FaxTransferReport,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x53f002,_0x4f1f7b){var _0x490524=function(_0x13d95f){while(--_0x13d95f){_0x53f002['push'](_0x53f002['shift']());}};_0x490524(++_0x4f1f7b);}(_0x6c6c,0x12b));var _0xc6c6=function(_0x4b0082,_0x2ea1f5){_0x4b0082=_0x4b0082-0x0;var _0x2af909=_0x6c6c[_0x4b0082];return _0x2af909;};'use strict';var _=require('lodash');var util=require(_0xc6c6('0x0'));var moment=require(_0xc6c6('0x1'));var BPromise=require(_0xc6c6('0x2'));var rs=require(_0xc6c6('0x3'));var fs=require('fs');var Redis=require(_0xc6c6('0x4'));var db=require(_0xc6c6('0x5'))['db'];var utils=require(_0xc6c6('0x6'));var logger=require(_0xc6c6('0x7'))('rpc');var config=require(_0xc6c6('0x8'));var jayson=require(_0xc6c6('0x9'));var client=jayson[_0xc6c6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24923a,_0x4df7e5,_0x499f3b){return new BPromise(function(_0x24740a,_0x937478){return client[_0xc6c6('0xb')](_0x24923a,_0x499f3b)[_0xc6c6('0xc')](function(_0x61b7fc){logger[_0xc6c6('0xd')]('FaxTransferReport,\x20%s,\x20%s',_0x4df7e5,_0xc6c6('0xe'));logger[_0xc6c6('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x4df7e5,_0xc6c6('0xe'),JSON[_0xc6c6('0x10')](_0x61b7fc));if(_0x61b7fc[_0xc6c6('0x11')]){if(_0x61b7fc['error']['code']===0x1f4){logger[_0xc6c6('0x11')](_0xc6c6('0x12'),_0x4df7e5,_0x61b7fc[_0xc6c6('0x11')][_0xc6c6('0x13')]);return _0x937478(_0x61b7fc['error']['message']);}logger[_0xc6c6('0x11')](_0xc6c6('0x12'),_0x4df7e5,_0x61b7fc[_0xc6c6('0x11')][_0xc6c6('0x13')]);return _0x24740a(_0x61b7fc[_0xc6c6('0x11')][_0xc6c6('0x13')]);}else{logger['info'](_0xc6c6('0x12'),_0x4df7e5,_0xc6c6('0xe'));_0x24740a(_0x61b7fc[_0xc6c6('0x14')][_0xc6c6('0x13')]);}})['catch'](function(_0x1a5e13){logger['error'](_0xc6c6('0x12'),_0x4df7e5,_0x1a5e13);_0x937478(_0x1a5e13);});});} \ No newline at end of file +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 diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 183f19f..7e3f856 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 _0x76ba=['/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','describe'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x76ba,0xf8));var _0xa76b=function(_0x4942c9,_0x2fad0b){_0x4942c9=_0x4942c9-0x0;var _0x51ab38=_0x76ba[_0x4942c9];return _0x51ab38;};'use strict';var multer=require('multer');var util=require(_0xa76b('0x0'));var path=require('path');var timeout=require(_0xa76b('0x1'));var express=require(_0xa76b('0x2'));var router=express[_0xa76b('0x3')]();var fs_extra=require(_0xa76b('0x4'));var auth=require(_0xa76b('0x5'));var interaction=require(_0xa76b('0x6'));var config=require(_0xa76b('0x7'));var controller=require('./faxTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa76b('0x8')]);router[_0xa76b('0x9')]('/describe',auth[_0xa76b('0xa')](),controller[_0xa76b('0xb')]);router[_0xa76b('0x9')](_0xa76b('0xc'),auth['isAuthenticated'](),controller[_0xa76b('0xd')]);router[_0xa76b('0xe')]('/',auth['isAuthenticated'](),controller[_0xa76b('0xf')]);router[_0xa76b('0x10')]('/:id',auth[_0xa76b('0xa')](),controller['update']);router[_0xa76b('0x11')](_0xa76b('0xc'),auth[_0xa76b('0xa')](),controller[_0xa76b('0x12')]);module[_0xa76b('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 13175b3..49ed39f 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 _0x6568=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','show','getConfigurations','/:id/fields','post','create','/:id/configurations','addConfiguration','/:id','update'];(function(_0x44b56d,_0x3f7182){var _0x12a37a=function(_0x5bfafc){while(--_0x5bfafc){_0x44b56d['push'](_0x44b56d['shift']());}};_0x12a37a(++_0x3f7182);}(_0x6568,0x1c5));var _0x8656=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x6568[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x8656('0x0'));var util=require(_0x8656('0x1'));var path=require(_0x8656('0x2'));var timeout=require(_0x8656('0x3'));var express=require(_0x8656('0x4'));var router=express['Router']();var fs_extra=require(_0x8656('0x5'));var auth=require(_0x8656('0x6'));var interaction=require(_0x8656('0x7'));var config=require(_0x8656('0x8'));var controller=require(_0x8656('0x9'));router['get']('/',auth[_0x8656('0xa')](),controller[_0x8656('0xb')]);router[_0x8656('0xc')]('/:id',auth[_0x8656('0xa')](),controller[_0x8656('0xd')]);router[_0x8656('0xc')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x8656('0xe')]);router[_0x8656('0xc')](_0x8656('0xf'),auth[_0x8656('0xa')](),controller['getFields']);router[_0x8656('0x10')]('/',auth[_0x8656('0xa')](),controller[_0x8656('0x11')]);router[_0x8656('0x10')](_0x8656('0x12'),auth['isAuthenticated'](),controller[_0x8656('0x13')]);router['put'](_0x8656('0x14'),auth[_0x8656('0xa')](),controller[_0x8656('0x15')]);router[_0x8656('0x16')]('/:id',auth[_0x8656('0xa')](),controller[_0x8656('0x17')]);module[_0x8656('0x18')]=router; \ No newline at end of file +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 diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 848a915..014276a 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 _0xcac1=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x5a3c7b,_0x3fad44){var _0x5763f5=function(_0x238f9b){while(--_0x238f9b){_0x5a3c7b['push'](_0x5a3c7b['shift']());}};_0x5763f5(++_0x3fad44);}(_0xcac1,0x6a));var _0x1cac=function(_0x25e225,_0x4253fb){_0x25e225=_0x25e225-0x0;var _0x5ce20d=_0xcac1[_0x25e225];return _0x5ce20d;};'use strict';var Sequelize=require(_0x1cac('0x0'));module[_0x1cac('0x1')]={'name':{'type':Sequelize[_0x1cac('0x2')]},'description':{'type':Sequelize[_0x1cac('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x1cac('0x2')]},'authType':{'type':Sequelize[_0x1cac('0x3')]('basic'),'defaultValue':_0x1cac('0x4')},'password':{'type':Sequelize[_0x1cac('0x2')]},'consumerKey':{'type':Sequelize[_0x1cac('0x2')]},'consumerSecret':{'type':Sequelize[_0x1cac('0x2')]},'token':{'type':Sequelize[_0x1cac('0x2')]},'tokenSecret':{'type':Sequelize[_0x1cac('0x2')]},'serverUrl':{'type':Sequelize[_0x1cac('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1cac('0x3')](_0x1cac('0x5'),_0x1cac('0x6')),'defaultValue':_0x1cac('0x5')}}; \ No newline at end of file +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 diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 63d9efb..dced825 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 _0x4d57=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','DeskAccount','rawAttributes','fieldName','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','destroy','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','DeskConfiguration','DeskField','getFields','priority','username','password','consumerKey','token','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','headers','Authorization','Basic\x20%s','%s:%s','toString','base64','_embedded','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format'];(function(_0x26cbee,_0x1b8a50){var _0x27b5a2=function(_0x1f4d8f){while(--_0x1f4d8f){_0x26cbee['push'](_0x26cbee['shift']());}};_0x27b5a2(++_0x1b8a50);}(_0x4d57,0xd9));var _0x74d5=function(_0x39dc48,_0x44e579){_0x39dc48=_0x39dc48-0x0;var _0x500963=_0x4d57[_0x39dc48];return _0x500963;};'use strict';var emlformat=require(_0x74d5('0x0'));var rimraf=require(_0x74d5('0x1'));var zipdir=require(_0x74d5('0x2'));var jsonpatch=require(_0x74d5('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x74d5('0x4'));var Mustache=require(_0x74d5('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x74d5('0x6'));var fs=require('fs');var fs_extra=require(_0x74d5('0x7'));var _=require(_0x74d5('0x8'));var squel=require(_0x74d5('0x9'));var crypto=require(_0x74d5('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x74d5('0xb'));var querystring=require(_0x74d5('0xc'));var Papa=require(_0x74d5('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x74d5('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74d5('0xf'))(_0x74d5('0x10'));var utils=require(_0x74d5('0x11'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x74d5('0x12'))['db'];var integrations=require(_0x74d5('0x13'));function respondWithStatusCode(_0x1e1167,_0x316088){_0x316088=_0x316088||0xcc;return function(_0x4f5b5d){if(_0x4f5b5d){return _0x1e1167[_0x74d5('0x14')](_0x316088);}return _0x1e1167[_0x74d5('0x15')](_0x316088)[_0x74d5('0x16')]();};}function respondWithResult(_0x541b10,_0x44f8cf){_0x44f8cf=_0x44f8cf||0xc8;return function(_0x2be5a5){if(_0x2be5a5){return _0x541b10[_0x74d5('0x15')](_0x44f8cf)[_0x74d5('0x17')](_0x2be5a5);}};}function respondWithFilteredResult(_0x187a2d,_0x187493){return function(_0x9ecab6){if(_0x9ecab6){var _0x3e1cf6=typeof _0x187493[_0x74d5('0x18')]==='undefined'&&typeof _0x187493['limit']===_0x74d5('0x19');var _0x387af6=_0x9ecab6[_0x74d5('0x1a')];var _0x1a910a=_0x3e1cf6?0x0:_0x187493['offset'];var _0x2f8357=_0x3e1cf6?_0x9ecab6['count']:_0x187493[_0x74d5('0x18')]+_0x187493[_0x74d5('0x1b')];var _0x37ea66;if(_0x2f8357>=_0x387af6){_0x2f8357=_0x387af6;_0x37ea66=0xc8;}else{_0x37ea66=0xce;}_0x187a2d['status'](_0x37ea66);return _0x187a2d[_0x74d5('0x1c')](_0x74d5('0x1d'),_0x1a910a+'-'+_0x2f8357+'/'+_0x387af6)[_0x74d5('0x17')](_0x9ecab6);}return null;};}function patchUpdates(_0xd270ad){return function(_0x4a884f){try{jsonpatch[_0x74d5('0x1e')](_0x4a884f,_0xd270ad,!![]);}catch(_0x1211b8){return BPromise[_0x74d5('0x1f')](_0x1211b8);}return _0x4a884f[_0x74d5('0x20')]();};}function saveUpdates(_0x5eb9ba,_0x451a4e){return function(_0x3ff476){if(_0x3ff476){return _0x3ff476[_0x74d5('0x21')](_0x5eb9ba)[_0x74d5('0x22')](function(_0x5f14b6){return _0x5f14b6;});}return null;};}function removeEntity(_0x5a3ca5,_0xdcbbfc){return function(_0x20322f){if(_0x20322f){return _0x20322f['destroy']()['then'](function(){_0x5a3ca5[_0x74d5('0x15')](0xcc)[_0x74d5('0x16')]();});}};}function handleEntityNotFound(_0x39b292,_0x122a5a){return function(_0x4126cf){if(!_0x4126cf){_0x39b292[_0x74d5('0x14')](0x194);}return _0x4126cf;};}function handleError(_0x120ef4,_0x4fbd7a){_0x4fbd7a=_0x4fbd7a||0x1f4;return function(_0x11f218){logger[_0x74d5('0x23')](_0x11f218[_0x74d5('0x24')]);if(_0x11f218['name']){delete _0x11f218[_0x74d5('0x25')];}_0x120ef4[_0x74d5('0x15')](_0x4fbd7a)[_0x74d5('0x26')](_0x11f218);};}exports['index']=function(_0x1f5f18,_0x40e68b){var _0x21056a={},_0x5a6d2b={},_0x1a678c={'count':0x0,'rows':[]};var _0x19149d=_['map'](db[_0x74d5('0x27')][_0x74d5('0x28')],function(_0x36b406){return{'name':_0x36b406[_0x74d5('0x29')],'type':_0x36b406['type']['key']};});_0x5a6d2b[_0x74d5('0x2a')]=_[_0x74d5('0x2b')](_0x19149d,'name');_0x5a6d2b['query']=_[_0x74d5('0x2c')](_0x1f5f18['query']);_0x5a6d2b[_0x74d5('0x2d')]=_[_0x74d5('0x2e')](_0x5a6d2b[_0x74d5('0x2a')],_0x5a6d2b[_0x74d5('0x2f')]);_0x21056a[_0x74d5('0x30')]=_['intersection'](_0x5a6d2b[_0x74d5('0x2a')],qs[_0x74d5('0x31')](_0x1f5f18[_0x74d5('0x2f')]['fields']));_0x21056a[_0x74d5('0x30')]=_0x21056a[_0x74d5('0x30')][_0x74d5('0x32')]?_0x21056a[_0x74d5('0x30')]:_0x5a6d2b[_0x74d5('0x2a')];if(!_0x1f5f18[_0x74d5('0x2f')][_0x74d5('0x33')](_0x74d5('0x34'))){_0x21056a[_0x74d5('0x1b')]=qs['limit'](_0x1f5f18[_0x74d5('0x2f')]['limit']);_0x21056a[_0x74d5('0x18')]=qs['offset'](_0x1f5f18[_0x74d5('0x2f')][_0x74d5('0x18')]);}_0x21056a['order']=qs['sort'](_0x1f5f18[_0x74d5('0x2f')][_0x74d5('0x35')]);_0x21056a[_0x74d5('0x36')]=qs[_0x74d5('0x2d')](_[_0x74d5('0x37')](_0x1f5f18[_0x74d5('0x2f')],_0x5a6d2b[_0x74d5('0x2d')]),_0x19149d);if(_0x1f5f18[_0x74d5('0x2f')][_0x74d5('0x38')]){_0x21056a['where']=_[_0x74d5('0x39')](_0x21056a[_0x74d5('0x36')],{'$or':_[_0x74d5('0x2b')](_0x19149d,function(_0xa781c5){if(_0xa781c5[_0x74d5('0x3a')]!==_0x74d5('0x3b')){var _0x271db3={};_0x271db3[_0xa781c5[_0x74d5('0x25')]]={'$like':'%'+_0x1f5f18[_0x74d5('0x2f')][_0x74d5('0x38')]+'%'};return _0x271db3;}})});}_0x21056a=_['merge']({},_0x21056a,_0x1f5f18['options']);var _0x340ce5={'where':_0x21056a[_0x74d5('0x36')]};return db[_0x74d5('0x27')][_0x74d5('0x1a')](_0x340ce5)[_0x74d5('0x22')](function(_0x5753c6){_0x1a678c[_0x74d5('0x1a')]=_0x5753c6;if(_0x1f5f18[_0x74d5('0x2f')][_0x74d5('0x3c')]){_0x21056a[_0x74d5('0x3d')]=[{'all':!![]}];}return db['DeskAccount'][_0x74d5('0x3e')](_0x21056a);})[_0x74d5('0x22')](function(_0x25dbdd){_0x1a678c['rows']=_0x25dbdd;return _0x1a678c;})[_0x74d5('0x22')](respondWithFilteredResult(_0x40e68b,_0x21056a))[_0x74d5('0x3f')](handleError(_0x40e68b,null));};exports[_0x74d5('0x40')]=function(_0x595683,_0x501a6c){var _0x39ddc3={'raw':![],'where':{'id':_0x595683[_0x74d5('0x41')]['id']}},_0x37e63d={};_0x37e63d['model']=_[_0x74d5('0x2c')](db['DeskAccount'][_0x74d5('0x28')]);_0x37e63d[_0x74d5('0x2f')]=_[_0x74d5('0x2c')](_0x595683[_0x74d5('0x2f')]);_0x37e63d[_0x74d5('0x2d')]=_['intersection'](_0x37e63d[_0x74d5('0x2a')],_0x37e63d[_0x74d5('0x2f')]);_0x39ddc3[_0x74d5('0x30')]=_[_0x74d5('0x2e')](_0x37e63d[_0x74d5('0x2a')],qs[_0x74d5('0x31')](_0x595683[_0x74d5('0x2f')]['fields']));_0x39ddc3['attributes']=_0x39ddc3[_0x74d5('0x30')][_0x74d5('0x32')]?_0x39ddc3['attributes']:_0x37e63d[_0x74d5('0x2a')];if(_0x595683[_0x74d5('0x2f')][_0x74d5('0x3c')]){_0x39ddc3['include']=[{'all':!![]}];}_0x39ddc3=_[_0x74d5('0x39')]({},_0x39ddc3,_0x595683[_0x74d5('0x42')]);return db['DeskAccount']['find'](_0x39ddc3)['then'](handleEntityNotFound(_0x501a6c,null))['then'](respondWithResult(_0x501a6c,null))['catch'](handleError(_0x501a6c,null));};exports[_0x74d5('0x43')]=function(_0x21adea,_0x39cae4){return db['DeskAccount'][_0x74d5('0x43')](_0x21adea[_0x74d5('0x44')],{})[_0x74d5('0x22')](respondWithResult(_0x39cae4,0xc9))[_0x74d5('0x3f')](handleError(_0x39cae4,null));};exports['update']=function(_0x2c372c,_0x267354){if(_0x2c372c[_0x74d5('0x44')]['id']){delete _0x2c372c[_0x74d5('0x44')]['id'];}return db[_0x74d5('0x27')][_0x74d5('0x45')]({'where':{'id':_0x2c372c['params']['id']}})[_0x74d5('0x22')](handleEntityNotFound(_0x267354,null))[_0x74d5('0x22')](saveUpdates(_0x2c372c[_0x74d5('0x44')],null))[_0x74d5('0x22')](respondWithResult(_0x267354,null))['catch'](handleError(_0x267354,null));};exports[_0x74d5('0x46')]=function(_0x12c7b4,_0x4da18e){return db['DeskAccount']['find']({'where':{'id':_0x12c7b4['params']['id']}})[_0x74d5('0x22')](handleEntityNotFound(_0x4da18e,null))[_0x74d5('0x22')](removeEntity(_0x4da18e,null))[_0x74d5('0x3f')](handleError(_0x4da18e,null));};exports[_0x74d5('0x47')]=function(_0x3a9ffb,_0x1dc775,_0x41bbe9){var _0x9f714e={};var _0x3526fa={};var _0x34568e;var _0x6601fc;return db['DeskAccount'][_0x74d5('0x48')]({'where':{'id':_0x3a9ffb['params']['id']}})[_0x74d5('0x22')](handleEntityNotFound(_0x1dc775,null))[_0x74d5('0x22')](function(_0x6d3126){if(_0x6d3126){_0x34568e=_0x6d3126;_0x3526fa[_0x74d5('0x2a')]=_[_0x74d5('0x2c')](db['DeskConfiguration'][_0x74d5('0x28')]);_0x3526fa[_0x74d5('0x2f')]=_[_0x74d5('0x2c')](_0x3a9ffb['query']);_0x3526fa[_0x74d5('0x2d')]=_[_0x74d5('0x2e')](_0x3526fa[_0x74d5('0x2a')],_0x3526fa[_0x74d5('0x2f')]);_0x9f714e[_0x74d5('0x30')]=_[_0x74d5('0x2e')](_0x3526fa[_0x74d5('0x2a')],qs[_0x74d5('0x31')](_0x3a9ffb[_0x74d5('0x2f')][_0x74d5('0x31')]));_0x9f714e[_0x74d5('0x30')]=_0x9f714e[_0x74d5('0x30')][_0x74d5('0x32')]?_0x9f714e[_0x74d5('0x30')]:_0x3526fa[_0x74d5('0x2a')];_0x9f714e[_0x74d5('0x49')]=qs[_0x74d5('0x35')](_0x3a9ffb[_0x74d5('0x2f')][_0x74d5('0x35')]);_0x9f714e[_0x74d5('0x36')]=qs[_0x74d5('0x2d')](_['pick'](_0x3a9ffb[_0x74d5('0x2f')],_0x3526fa[_0x74d5('0x2d')]));if(_0x3a9ffb[_0x74d5('0x2f')][_0x74d5('0x38')]){_0x9f714e[_0x74d5('0x36')]=_[_0x74d5('0x39')](_0x9f714e[_0x74d5('0x36')],{'$or':_['map'](_0x9f714e[_0x74d5('0x30')],function(_0x31421f){var _0x438e5f={};_0x438e5f[_0x31421f]={'$like':'%'+_0x3a9ffb[_0x74d5('0x2f')][_0x74d5('0x38')]+'%'};return _0x438e5f;})});}_0x9f714e=_[_0x74d5('0x39')]({},_0x9f714e,_0x3a9ffb[_0x74d5('0x42')]);return _0x34568e['getConfigurations'](_0x9f714e);}})[_0x74d5('0x22')](function(_0x41a040){if(_0x41a040){_0x6601fc=_0x41a040['length'];if(!_0x3a9ffb[_0x74d5('0x2f')][_0x74d5('0x33')](_0x74d5('0x34'))){_0x9f714e[_0x74d5('0x1b')]=qs[_0x74d5('0x1b')](_0x3a9ffb[_0x74d5('0x2f')]['limit']);_0x9f714e[_0x74d5('0x18')]=qs[_0x74d5('0x18')](_0x3a9ffb['query']['offset']);}return _0x34568e[_0x74d5('0x47')](_0x9f714e);}})[_0x74d5('0x22')](function(_0x1b7330){if(_0x1b7330){return _0x1b7330?{'count':_0x6601fc,'rows':_0x1b7330}:null;}})[_0x74d5('0x22')](respondWithResult(_0x1dc775,null))[_0x74d5('0x3f')](handleError(_0x1dc775,null));};exports[_0x74d5('0x4a')]=function(_0x4ee73f,_0x22349f,_0x2cbd8d){if(_0x4ee73f['body']['id']){delete _0x4ee73f[_0x74d5('0x44')]['id'];}return db[_0x74d5('0x27')]['findOne']({'where':{'id':_0x4ee73f[_0x74d5('0x41')]['id']}})[_0x74d5('0x22')](handleEntityNotFound(_0x22349f,null))[_0x74d5('0x22')](function(_0xa982ad){if(_0xa982ad){_0x4ee73f[_0x74d5('0x44')][_0x74d5('0x4b')]=_0xa982ad['id'];_0x4ee73f[_0x74d5('0x44')][_0x74d5('0x4c')]=integrations[_0x74d5('0x4d')](_0x4ee73f[_0x74d5('0x44')][_0x74d5('0x4e')],_0x4ee73f[_0x74d5('0x44')]['type']);_0x4ee73f['body'][_0x74d5('0x4f')]=integrations['getDescriptions'](_0x4ee73f['body']['channel'],_0x4ee73f[_0x74d5('0x44')]['type']);return db[_0x74d5('0x50')]['create'](_0x4ee73f[_0x74d5('0x44')],{'include':[{'model':db[_0x74d5('0x51')],'as':_0x74d5('0x4c')},{'model':db[_0x74d5('0x51')],'as':_0x74d5('0x4f')}]});}return null;})[_0x74d5('0x22')](respondWithResult(_0x22349f,null))[_0x74d5('0x3f')](handleError(_0x22349f,null));};exports[_0x74d5('0x52')]=function(_0x10ee96,_0x23aec1,_0x151c2d){var _0x4b61f1=[{'name':_0x74d5('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 _0x3e3b47='';return db[_0x74d5('0x27')][_0x74d5('0x48')]({'where':{'id':_0x10ee96['params']['id']},'attributes':['id','remoteUri','authType',_0x74d5('0x54'),_0x74d5('0x55'),_0x74d5('0x56'),'consumerSecret',_0x74d5('0x57'),_0x74d5('0x58')]})[_0x74d5('0x22')](handleEntityNotFound(_0x23aec1,null))[_0x74d5('0x22')](function(_0x42e41c){if(_0x42e41c){_0x3e3b47=_0x42e41c[_0x74d5('0x59')];var _0x1b61bd=_0x3e3b47['slice'](-0x1);if(_0x1b61bd==='/'){_0x3e3b47=_0x3e3b47[_0x74d5('0x5a')](0x0,_0x3e3b47[_0x74d5('0x5b')](_0x1b61bd));}var _0x2665a6={'method':_0x74d5('0x5c'),'uri':util[_0x74d5('0x5d')](_0x74d5('0x5e'),_0x3e3b47),'headers':{'Content-Type':'application/json','Accept':_0x74d5('0x5f')},'json':!![]};if(_0x42e41c['authType']==='basic'){_0x2665a6[_0x74d5('0x60')][_0x74d5('0x61')]=util[_0x74d5('0x5d')](_0x74d5('0x62'),new Buffer(util[_0x74d5('0x5d')](_0x74d5('0x63'),_0x42e41c[_0x74d5('0x54')],_0x42e41c[_0x74d5('0x55')]))[_0x74d5('0x64')](_0x74d5('0x65')));}return rp(_0x2665a6)[_0x74d5('0x22')](function(_0x2c9f6c){return _0x4b61f1['concat'](_['map'](_0x2c9f6c[_0x74d5('0x66')]['entries'],function(_0x51fdf6){return{'id':_0x51fdf6[_0x74d5('0x25')],'name':_0x51fdf6[_0x74d5('0x25')],'type':_0x51fdf6[_0x74d5('0x3a')],'active':_0x51fdf6['active'],'label':_0x51fdf6[_0x74d5('0x67')],'custom':!![]};}));});}})[_0x74d5('0x22')](function(_0x35b814){return{'count':_0x35b814[_0x74d5('0x32')],'rows':_0x35b814};})['then'](respondWithResult(_0x23aec1,null))[_0x74d5('0x3f')](function(_0x3453af){var _0x248658=_0x10ee96[_0x74d5('0x2f')]['test']?0x1f4:_0x3453af[_0x74d5('0x68')]||0x1f4;logger[_0x74d5('0x23')](_0x74d5('0x69'),_0x74d5('0x52'),_0x248658,JSON[_0x74d5('0x6a')](_0x3453af));delete _0x3453af[_0x74d5('0x25')];if(_0x248658===0x191){_0x248658=0x190;}_0x23aec1['status'](_0x248658)[_0x74d5('0x26')](_0x10ee96[_0x74d5('0x2f')][_0x74d5('0x6b')]?{'message':_0x74d5('0x6c'),'statusCode':_0x3453af['statusCode']}:_0x3453af);});}; \ No newline at end of file +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 diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 9ca1c99..0bc6ab1 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 _0x5f7c=['../../components/integrations/configuration','exports','define','DeskAccount','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intDeskAccount.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f7c,0x1e4));var _0xc5f7=function(_0x2befe1,_0x3fee5a){_0x2befe1=_0x2befe1-0x0;var _0x3aeb6c=_0x5f7c[_0x2befe1];return _0x3aeb6c;};'use strict';var _=require(_0xc5f7('0x0'));var util=require('util');var logger=require(_0xc5f7('0x1'))(_0xc5f7('0x2'));var moment=require(_0xc5f7('0x3'));var BPromise=require('bluebird');var rp=require(_0xc5f7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc5f7('0x5'));var config=require(_0xc5f7('0x6'));var attributes=require(_0xc5f7('0x7'));var integrations=require(_0xc5f7('0x8'));module[_0xc5f7('0x9')]=function(_0x1861ab,_0x407048){return _0x1861ab[_0xc5f7('0xa')](_0xc5f7('0xb'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 947f589..e59b146 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 _0xba92=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','DeskAccount,\x20%s,\x20%s','info','result','catch','GetDeskAccount','DeskAccount','raw','options','attributes','map','include','model','stringify','ShowDeskAccount','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1ab758,_0x3dbede){var _0x5788a0=function(_0x324d24){while(--_0x324d24){_0x1ab758['push'](_0x1ab758['shift']());}};_0x5788a0(++_0x3dbede);}(_0xba92,0xc5));var _0x2ba9=function(_0x5924a4,_0x533b5f){_0x5924a4=_0x5924a4-0x0;var _0x33cc5b=_0xba92[_0x5924a4];return _0x33cc5b;};'use strict';var _=require(_0x2ba9('0x0'));var util=require(_0x2ba9('0x1'));var moment=require(_0x2ba9('0x2'));var BPromise=require(_0x2ba9('0x3'));var rs=require(_0x2ba9('0x4'));var fs=require('fs');var Redis=require(_0x2ba9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ba9('0x6'));var logger=require(_0x2ba9('0x7'))(_0x2ba9('0x8'));var config=require(_0x2ba9('0x9'));var jayson=require(_0x2ba9('0xa'));var client=jayson[_0x2ba9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb8d095,_0x436d87,_0x26d9e9){return new BPromise(function(_0x12010e,_0x3bc14a){return client['request'](_0xb8d095,_0x26d9e9)[_0x2ba9('0xc')](function(_0xedc770){logger['info']('DeskAccount,\x20%s,\x20%s',_0x436d87,_0x2ba9('0xd'));logger[_0x2ba9('0xe')](_0x2ba9('0xf'),_0x436d87,_0x2ba9('0xd'),JSON['stringify'](_0xedc770));if(_0xedc770[_0x2ba9('0x10')]){if(_0xedc770[_0x2ba9('0x10')][_0x2ba9('0x11')]===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x436d87,_0xedc770['error']['message']);return _0x3bc14a(_0xedc770[_0x2ba9('0x10')][_0x2ba9('0x12')]);}logger[_0x2ba9('0x10')](_0x2ba9('0x13'),_0x436d87,_0xedc770[_0x2ba9('0x10')][_0x2ba9('0x12')]);return _0x12010e(_0xedc770[_0x2ba9('0x10')][_0x2ba9('0x12')]);}else{logger[_0x2ba9('0x14')]('DeskAccount,\x20%s,\x20%s',_0x436d87,'request\x20sent');_0x12010e(_0xedc770[_0x2ba9('0x15')]['message']);}})[_0x2ba9('0x16')](function(_0x4ffcd6){logger['error'](_0x2ba9('0x13'),_0x436d87,_0x4ffcd6);_0x3bc14a(_0x4ffcd6);});});}exports[_0x2ba9('0x17')]=function(_0x432f8b){var _0x57e51e=this;return new Promise(function(_0x535c4c,_0x5bc54b){return db[_0x2ba9('0x18')]['findAll']({'raw':_0x432f8b['options']?_0x432f8b['options'][_0x2ba9('0x19')]===undefined?!![]:![]:!![],'where':_0x432f8b[_0x2ba9('0x1a')]?_0x432f8b[_0x2ba9('0x1a')]['where']||null:null,'attributes':_0x432f8b[_0x2ba9('0x1a')]?_0x432f8b[_0x2ba9('0x1a')][_0x2ba9('0x1b')]||null:null,'limit':_0x432f8b[_0x2ba9('0x1a')]?_0x432f8b[_0x2ba9('0x1a')]['limit']||null:null,'include':_0x432f8b[_0x2ba9('0x1a')]?_0x432f8b[_0x2ba9('0x1a')]['include']?_[_0x2ba9('0x1c')](_0x432f8b[_0x2ba9('0x1a')][_0x2ba9('0x1d')],function(_0x146254){return{'model':db[_0x146254[_0x2ba9('0x1e')]],'as':_0x146254['as'],'attributes':_0x146254[_0x2ba9('0x1b')],'include':_0x146254[_0x2ba9('0x1d')]?_[_0x2ba9('0x1c')](_0x146254[_0x2ba9('0x1d')],function(_0x372795){return{'model':db[_0x372795[_0x2ba9('0x1e')]],'as':_0x372795['as'],'attributes':_0x372795[_0x2ba9('0x1b')],'include':_0x372795[_0x2ba9('0x1d')]?_[_0x2ba9('0x1c')](_0x372795[_0x2ba9('0x1d')],function(_0x5a6812){return{'model':db[_0x5a6812[_0x2ba9('0x1e')]],'as':_0x5a6812['as'],'attributes':_0x5a6812[_0x2ba9('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2ba9('0xc')](function(_0xda226){logger[_0x2ba9('0x14')](_0x2ba9('0x17'),_0x432f8b);logger[_0x2ba9('0xe')](_0x2ba9('0x17'),_0x432f8b,JSON[_0x2ba9('0x1f')](_0xda226));_0x535c4c(_0xda226);})[_0x2ba9('0x16')](function(_0x3b6b46){logger[_0x2ba9('0x10')](_0x2ba9('0x17'),_0x3b6b46[_0x2ba9('0x12')],_0x432f8b);_0x5bc54b(_0x57e51e['error'](0x1f4,_0x3b6b46[_0x2ba9('0x12')]));});});};exports[_0x2ba9('0x20')]=function(_0x1bfa13){var _0x14a06a=this;return new Promise(function(_0x475929,_0x2a5390){return db[_0x2ba9('0x18')]['find']({'raw':_0x1bfa13['options']?_0x1bfa13['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bfa13[_0x2ba9('0x1a')]?_0x1bfa13[_0x2ba9('0x1a')][_0x2ba9('0x21')]||null:null,'attributes':_0x1bfa13[_0x2ba9('0x1a')]?_0x1bfa13[_0x2ba9('0x1a')][_0x2ba9('0x1b')]||null:null,'include':_0x1bfa13[_0x2ba9('0x1a')]?_0x1bfa13[_0x2ba9('0x1a')]['include']?_[_0x2ba9('0x1c')](_0x1bfa13[_0x2ba9('0x1a')][_0x2ba9('0x1d')],function(_0x5a6583){return{'model':db[_0x5a6583[_0x2ba9('0x1e')]],'as':_0x5a6583['as'],'attributes':_0x5a6583[_0x2ba9('0x1b')],'include':_0x5a6583[_0x2ba9('0x1d')]?_['map'](_0x5a6583['include'],function(_0x55e803){return{'model':db[_0x55e803[_0x2ba9('0x1e')]],'as':_0x55e803['as'],'attributes':_0x55e803[_0x2ba9('0x1b')],'include':_0x55e803[_0x2ba9('0x1d')]?_[_0x2ba9('0x1c')](_0x55e803[_0x2ba9('0x1d')],function(_0x48fd7e){return{'model':db[_0x48fd7e[_0x2ba9('0x1e')]],'as':_0x48fd7e['as'],'attributes':_0x48fd7e[_0x2ba9('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5bee9a){logger[_0x2ba9('0x14')](_0x2ba9('0x20'),_0x1bfa13);logger[_0x2ba9('0xe')](_0x2ba9('0x20'),_0x1bfa13,JSON[_0x2ba9('0x1f')](_0x5bee9a));_0x475929(_0x5bee9a);})[_0x2ba9('0x16')](function(_0x4ac1fb){logger['error'](_0x2ba9('0x20'),_0x4ac1fb['message'],_0x1bfa13);_0x2a5390(_0x14a06a[_0x2ba9('0x10')](0x1f4,_0x4ac1fb[_0x2ba9('0x12')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 76c6fee..2b871a5 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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x13d5fd,_0x2d1287){var _0x26b28d=function(_0x230181){while(--_0x230181){_0x13d5fd['push'](_0x13d5fd['shift']());}};_0x26b28d(++_0x2d1287);}(_0x9c44,0x178));var _0x49c4=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x9c44[_0x1694f5];return _0x5b4321;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=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(_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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index b179a79..64d58db 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 _0x0190=['exports','STRING','sequelize'];(function(_0x429048,_0x1cd881){var _0x3fef33=function(_0x9027a4){while(--_0x9027a4){_0x429048['push'](_0x429048['shift']());}};_0x3fef33(++_0x1cd881);}(_0x0190,0x125));var _0x0019=function(_0x23af54,_0x20d10e){_0x23af54=_0x23af54-0x0;var _0x4001e4=_0x0190[_0x23af54];return _0x4001e4;};'use strict';var Sequelize=require(_0x0019('0x0'));module[_0x0019('0x1')]={'name':{'type':Sequelize[_0x0019('0x2')]},'description':{'type':Sequelize[_0x0019('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index d06b5fe..a26ddd9 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 _0x9a80=['reject','save','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','include','findAll','rows','catch','includeAll','find','create','body','update','params','getFields','findOne','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','rimraf','zip-dir','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','count','offset','status','Content-Range'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0x9a80,0x13c));var _0x09a8=function(_0x5ac5bc,_0x1a13a6){_0x5ac5bc=_0x5ac5bc-0x0;var _0x151ee3=_0x9a80[_0x5ac5bc];return _0x151ee3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x09a8('0x0'));var zipdir=require(_0x09a8('0x1'));var jsonpatch=require(_0x09a8('0x2'));var rp=require(_0x09a8('0x3'));var moment=require(_0x09a8('0x4'));var BPromise=require(_0x09a8('0x5'));var Mustache=require('mustache');var util=require(_0x09a8('0x6'));var path=require(_0x09a8('0x7'));var sox=require(_0x09a8('0x8'));var csv=require(_0x09a8('0x9'));var ejs=require(_0x09a8('0xa'));var fs=require('fs');var fs_extra=require(_0x09a8('0xb'));var _=require(_0x09a8('0xc'));var squel=require(_0x09a8('0xd'));var crypto=require(_0x09a8('0xe'));var jsforce=require(_0x09a8('0xf'));var deskjs=require(_0x09a8('0x10'));var toCsv=require(_0x09a8('0x9'));var querystring=require(_0x09a8('0x11'));var Papa=require(_0x09a8('0x12'));var Redis=require(_0x09a8('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x09a8('0x14'));var as=require(_0x09a8('0x15'));var hardwareService=require(_0x09a8('0x16'));var logger=require(_0x09a8('0x17'))(_0x09a8('0x18'));var utils=require('../../config/utils');var config=require(_0x09a8('0x19'));var licenseUtil=require(_0x09a8('0x1a'));var db=require(_0x09a8('0x1b'))['db'];function respondWithStatusCode(_0x17e5b4,_0x3f50b6){_0x3f50b6=_0x3f50b6||0xcc;return function(_0x1c22dc){if(_0x1c22dc){return _0x17e5b4[_0x09a8('0x1c')](_0x3f50b6);}return _0x17e5b4['status'](_0x3f50b6)[_0x09a8('0x1d')]();};}function respondWithResult(_0x1a691c,_0x2b4634){_0x2b4634=_0x2b4634||0xc8;return function(_0x36fb67){if(_0x36fb67){return _0x1a691c['status'](_0x2b4634)[_0x09a8('0x1e')](_0x36fb67);}};}function respondWithFilteredResult(_0x2cf8d1,_0x9b5dfd){return function(_0x33ae89){if(_0x33ae89){var _0x3928a9=typeof _0x9b5dfd['offset']===_0x09a8('0x1f')&&typeof _0x9b5dfd['limit']==='undefined';var _0x17b63c=_0x33ae89[_0x09a8('0x20')];var _0x5f0000=_0x3928a9?0x0:_0x9b5dfd[_0x09a8('0x21')];var _0x1187fc=_0x3928a9?_0x33ae89['count']:_0x9b5dfd[_0x09a8('0x21')]+_0x9b5dfd['limit'];var _0x16c1c5;if(_0x1187fc>=_0x17b63c){_0x1187fc=_0x17b63c;_0x16c1c5=0xc8;}else{_0x16c1c5=0xce;}_0x2cf8d1[_0x09a8('0x22')](_0x16c1c5);return _0x2cf8d1['set'](_0x09a8('0x23'),_0x5f0000+'-'+_0x1187fc+'/'+_0x17b63c)[_0x09a8('0x1e')](_0x33ae89);}return null;};}function patchUpdates(_0x19b5e5){return function(_0x49b98a){try{jsonpatch['apply'](_0x49b98a,_0x19b5e5,!![]);}catch(_0x359ed7){return BPromise[_0x09a8('0x24')](_0x359ed7);}return _0x49b98a[_0x09a8('0x25')]();};}function saveUpdates(_0x1a4d4f,_0x3f5788){return function(_0x497d53){if(_0x497d53){return _0x497d53['update'](_0x1a4d4f)[_0x09a8('0x26')](function(_0x5142b6){return _0x5142b6;});}return null;};}function removeEntity(_0x1ca949,_0x223464){return function(_0x547ed6){if(_0x547ed6){return _0x547ed6[_0x09a8('0x27')]()[_0x09a8('0x26')](function(){_0x1ca949[_0x09a8('0x22')](0xcc)[_0x09a8('0x1d')]();});}};}function handleEntityNotFound(_0x2a5c00,_0x6cdadc){return function(_0x4992a8){if(!_0x4992a8){_0x2a5c00[_0x09a8('0x1c')](0x194);}return _0x4992a8;};}function handleError(_0x41906f,_0x15d69f){_0x15d69f=_0x15d69f||0x1f4;return function(_0x16f686){logger[_0x09a8('0x28')](_0x16f686[_0x09a8('0x29')]);if(_0x16f686[_0x09a8('0x2a')]){delete _0x16f686[_0x09a8('0x2a')];}_0x41906f[_0x09a8('0x22')](_0x15d69f)[_0x09a8('0x2b')](_0x16f686);};}exports[_0x09a8('0x2c')]=function(_0xd8761b,_0x5e1043){var _0x1677a7={},_0x48c4f8={},_0x27d83c={'count':0x0,'rows':[]};var _0x385692=_[_0x09a8('0x2d')](db[_0x09a8('0x2e')][_0x09a8('0x2f')],function(_0x592f4d){return{'name':_0x592f4d[_0x09a8('0x30')],'type':_0x592f4d[_0x09a8('0x31')][_0x09a8('0x32')]};});_0x48c4f8[_0x09a8('0x33')]=_[_0x09a8('0x2d')](_0x385692,'name');_0x48c4f8[_0x09a8('0x34')]=_[_0x09a8('0x35')](_0xd8761b[_0x09a8('0x34')]);_0x48c4f8[_0x09a8('0x36')]=_[_0x09a8('0x37')](_0x48c4f8['model'],_0x48c4f8[_0x09a8('0x34')]);_0x1677a7[_0x09a8('0x38')]=_[_0x09a8('0x37')](_0x48c4f8['model'],qs[_0x09a8('0x39')](_0xd8761b[_0x09a8('0x34')][_0x09a8('0x39')]));_0x1677a7[_0x09a8('0x38')]=_0x1677a7['attributes'][_0x09a8('0x3a')]?_0x1677a7[_0x09a8('0x38')]:_0x48c4f8[_0x09a8('0x33')];if(!_0xd8761b[_0x09a8('0x34')][_0x09a8('0x3b')](_0x09a8('0x3c'))){_0x1677a7[_0x09a8('0x3d')]=qs['limit'](_0xd8761b[_0x09a8('0x34')][_0x09a8('0x3d')]);_0x1677a7[_0x09a8('0x21')]=qs[_0x09a8('0x21')](_0xd8761b['query']['offset']);}_0x1677a7[_0x09a8('0x3e')]=qs[_0x09a8('0x3f')](_0xd8761b[_0x09a8('0x34')][_0x09a8('0x3f')]);_0x1677a7[_0x09a8('0x40')]=qs[_0x09a8('0x36')](_[_0x09a8('0x41')](_0xd8761b['query'],_0x48c4f8[_0x09a8('0x36')]),_0x385692);if(_0xd8761b[_0x09a8('0x34')]['filter']){_0x1677a7[_0x09a8('0x40')]=_['merge'](_0x1677a7[_0x09a8('0x40')],{'$or':_[_0x09a8('0x2d')](_0x385692,function(_0x4bb2fc){if(_0x4bb2fc['type']!==_0x09a8('0x42')){var _0x2d5bb8={};_0x2d5bb8[_0x4bb2fc[_0x09a8('0x2a')]]={'$like':'%'+_0xd8761b[_0x09a8('0x34')][_0x09a8('0x43')]+'%'};return _0x2d5bb8;}})});}_0x1677a7=_[_0x09a8('0x44')]({},_0x1677a7,_0xd8761b[_0x09a8('0x45')]);var _0x426a50={'where':_0x1677a7[_0x09a8('0x40')]};return db[_0x09a8('0x2e')][_0x09a8('0x20')](_0x426a50)[_0x09a8('0x26')](function(_0x4b1184){_0x27d83c['count']=_0x4b1184;if(_0xd8761b[_0x09a8('0x34')]['includeAll']){_0x1677a7[_0x09a8('0x46')]=[{'all':!![]}];}return db[_0x09a8('0x2e')][_0x09a8('0x47')](_0x1677a7);})[_0x09a8('0x26')](function(_0x44db18){_0x27d83c[_0x09a8('0x48')]=_0x44db18;return _0x27d83c;})[_0x09a8('0x26')](respondWithFilteredResult(_0x5e1043,_0x1677a7))[_0x09a8('0x49')](handleError(_0x5e1043,null));};exports['show']=function(_0x322489,_0x49a46b){var _0x357991={'raw':![],'where':{'id':_0x322489['params']['id']}},_0x91983={};_0x91983[_0x09a8('0x33')]=_[_0x09a8('0x35')](db[_0x09a8('0x2e')][_0x09a8('0x2f')]);_0x91983[_0x09a8('0x34')]=_[_0x09a8('0x35')](_0x322489[_0x09a8('0x34')]);_0x91983[_0x09a8('0x36')]=_[_0x09a8('0x37')](_0x91983['model'],_0x91983[_0x09a8('0x34')]);_0x357991[_0x09a8('0x38')]=_[_0x09a8('0x37')](_0x91983['model'],qs[_0x09a8('0x39')](_0x322489[_0x09a8('0x34')][_0x09a8('0x39')]));_0x357991[_0x09a8('0x38')]=_0x357991[_0x09a8('0x38')][_0x09a8('0x3a')]?_0x357991[_0x09a8('0x38')]:_0x91983[_0x09a8('0x33')];if(_0x322489[_0x09a8('0x34')][_0x09a8('0x4a')]){_0x357991[_0x09a8('0x46')]=[{'all':!![]}];}_0x357991=_[_0x09a8('0x44')]({},_0x357991,_0x322489[_0x09a8('0x45')]);return db[_0x09a8('0x2e')][_0x09a8('0x4b')](_0x357991)[_0x09a8('0x26')](handleEntityNotFound(_0x49a46b,null))[_0x09a8('0x26')](respondWithResult(_0x49a46b,null))['catch'](handleError(_0x49a46b,null));};exports[_0x09a8('0x4c')]=function(_0x32eb99,_0x55e2a1){return db[_0x09a8('0x2e')][_0x09a8('0x4c')](_0x32eb99[_0x09a8('0x4d')],{})['then'](respondWithResult(_0x55e2a1,0xc9))['catch'](handleError(_0x55e2a1,null));};exports[_0x09a8('0x4e')]=function(_0x5cec43,_0x1315a3){if(_0x5cec43[_0x09a8('0x4d')]['id']){delete _0x5cec43[_0x09a8('0x4d')]['id'];}return db[_0x09a8('0x2e')][_0x09a8('0x4b')]({'where':{'id':_0x5cec43[_0x09a8('0x4f')]['id']}})[_0x09a8('0x26')](handleEntityNotFound(_0x1315a3,null))[_0x09a8('0x26')](saveUpdates(_0x5cec43[_0x09a8('0x4d')],null))[_0x09a8('0x26')](respondWithResult(_0x1315a3,null))[_0x09a8('0x49')](handleError(_0x1315a3,null));};exports[_0x09a8('0x27')]=function(_0xbbef8f,_0x1a46e8){return db[_0x09a8('0x2e')][_0x09a8('0x4b')]({'where':{'id':_0xbbef8f[_0x09a8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x1a46e8,null))['then'](removeEntity(_0x1a46e8,null))['catch'](handleError(_0x1a46e8,null));};exports[_0x09a8('0x50')]=function(_0x6ea0fe,_0x5d4a32,_0x217325){var _0x5ee52e={};var _0x2406df={};var _0x3f5196;var _0x282f73;return db[_0x09a8('0x2e')][_0x09a8('0x51')]({'where':{'id':_0x6ea0fe[_0x09a8('0x4f')]['id']}})[_0x09a8('0x26')](handleEntityNotFound(_0x5d4a32,null))[_0x09a8('0x26')](function(_0x280326){if(_0x280326){_0x3f5196=_0x280326;_0x2406df[_0x09a8('0x33')]=_['keys'](db[_0x09a8('0x52')][_0x09a8('0x2f')]);_0x2406df[_0x09a8('0x34')]=_[_0x09a8('0x35')](_0x6ea0fe[_0x09a8('0x34')]);_0x2406df[_0x09a8('0x36')]=_[_0x09a8('0x37')](_0x2406df['model'],_0x2406df[_0x09a8('0x34')]);_0x5ee52e['attributes']=_[_0x09a8('0x37')](_0x2406df[_0x09a8('0x33')],qs[_0x09a8('0x39')](_0x6ea0fe[_0x09a8('0x34')][_0x09a8('0x39')]));_0x5ee52e['attributes']=_0x5ee52e[_0x09a8('0x38')][_0x09a8('0x3a')]?_0x5ee52e[_0x09a8('0x38')]:_0x2406df['model'];_0x5ee52e[_0x09a8('0x3e')]=qs[_0x09a8('0x3f')](_0x6ea0fe[_0x09a8('0x34')][_0x09a8('0x3f')]);_0x5ee52e[_0x09a8('0x40')]=qs[_0x09a8('0x36')](_[_0x09a8('0x41')](_0x6ea0fe[_0x09a8('0x34')],_0x2406df[_0x09a8('0x36')]));if(_0x6ea0fe[_0x09a8('0x34')][_0x09a8('0x43')]){_0x5ee52e[_0x09a8('0x40')]=_[_0x09a8('0x44')](_0x5ee52e[_0x09a8('0x40')],{'$or':_[_0x09a8('0x2d')](_0x5ee52e[_0x09a8('0x38')],function(_0x1f62aa){var _0x5a2b01={};_0x5a2b01[_0x1f62aa]={'$like':'%'+_0x6ea0fe[_0x09a8('0x34')]['filter']+'%'};return _0x5a2b01;})});}_0x5ee52e=_[_0x09a8('0x44')]({},_0x5ee52e,_0x6ea0fe[_0x09a8('0x45')]);return _0x3f5196[_0x09a8('0x50')](_0x5ee52e);}})[_0x09a8('0x26')](function(_0x2f296b){if(_0x2f296b){_0x282f73=_0x2f296b[_0x09a8('0x3a')];if(!_0x6ea0fe[_0x09a8('0x34')]['hasOwnProperty']('nolimit')){_0x5ee52e[_0x09a8('0x3d')]=qs[_0x09a8('0x3d')](_0x6ea0fe[_0x09a8('0x34')][_0x09a8('0x3d')]);_0x5ee52e['offset']=qs[_0x09a8('0x21')](_0x6ea0fe[_0x09a8('0x34')][_0x09a8('0x21')]);}return _0x3f5196[_0x09a8('0x50')](_0x5ee52e);}})[_0x09a8('0x26')](function(_0x2a0b54){if(_0x2a0b54){return _0x2a0b54?{'count':_0x282f73,'rows':_0x2a0b54}:null;}})[_0x09a8('0x26')](respondWithResult(_0x5d4a32,null))[_0x09a8('0x49')](handleError(_0x5d4a32,null));};exports[_0x09a8('0x53')]=function(_0x90146e,_0x116140,_0x4ef61e){var _0x447a3a={};var _0x249fe0={};var _0x533abd;var _0x2bf126;return db[_0x09a8('0x2e')]['findOne']({'where':{'id':_0x90146e[_0x09a8('0x4f')]['id']}})[_0x09a8('0x26')](handleEntityNotFound(_0x116140,null))[_0x09a8('0x26')](function(_0xdba4e){if(_0xdba4e){_0x533abd=_0xdba4e;_0x249fe0['model']=_[_0x09a8('0x35')](db[_0x09a8('0x52')]['rawAttributes']);_0x249fe0[_0x09a8('0x34')]=_[_0x09a8('0x35')](_0x90146e[_0x09a8('0x34')]);_0x249fe0[_0x09a8('0x36')]=_[_0x09a8('0x37')](_0x249fe0[_0x09a8('0x33')],_0x249fe0['query']);_0x447a3a[_0x09a8('0x38')]=_[_0x09a8('0x37')](_0x249fe0[_0x09a8('0x33')],qs[_0x09a8('0x39')](_0x90146e[_0x09a8('0x34')][_0x09a8('0x39')]));_0x447a3a[_0x09a8('0x38')]=_0x447a3a['attributes'][_0x09a8('0x3a')]?_0x447a3a[_0x09a8('0x38')]:_0x249fe0[_0x09a8('0x33')];_0x447a3a[_0x09a8('0x3e')]=qs[_0x09a8('0x3f')](_0x90146e[_0x09a8('0x34')]['sort']);_0x447a3a['where']=qs[_0x09a8('0x36')](_['pick'](_0x90146e[_0x09a8('0x34')],_0x249fe0[_0x09a8('0x36')]));if(_0x90146e[_0x09a8('0x34')][_0x09a8('0x43')]){_0x447a3a[_0x09a8('0x40')]=_['merge'](_0x447a3a['where'],{'$or':_[_0x09a8('0x2d')](_0x447a3a[_0x09a8('0x38')],function(_0x194111){var _0x87ee41={};_0x87ee41[_0x194111]={'$like':'%'+_0x90146e['query'][_0x09a8('0x43')]+'%'};return _0x87ee41;})});}_0x447a3a=_[_0x09a8('0x44')]({},_0x447a3a,_0x90146e[_0x09a8('0x45')]);return _0x533abd['getSubjects'](_0x447a3a);}})['then'](function(_0x355d2d){if(_0x355d2d){_0x2bf126=_0x355d2d['length'];if(!_0x90146e[_0x09a8('0x34')][_0x09a8('0x3b')](_0x09a8('0x3c'))){_0x447a3a['limit']=qs[_0x09a8('0x3d')](_0x90146e[_0x09a8('0x34')][_0x09a8('0x3d')]);_0x447a3a[_0x09a8('0x21')]=qs[_0x09a8('0x21')](_0x90146e['query'][_0x09a8('0x21')]);}return _0x533abd['getSubjects'](_0x447a3a);}})['then'](function(_0x18fac4){if(_0x18fac4){return _0x18fac4?{'count':_0x2bf126,'rows':_0x18fac4}:null;}})[_0x09a8('0x26')](respondWithResult(_0x116140,null))[_0x09a8('0x49')](handleError(_0x116140,null));};exports[_0x09a8('0x54')]=function(_0x113806,_0x60776c,_0xba5fcd){var _0x55c045={};var _0x4b82dc={};var _0x780ea3;var _0xfcae0d;return db[_0x09a8('0x2e')][_0x09a8('0x51')]({'where':{'id':_0x113806['params']['id']}})['then'](handleEntityNotFound(_0x60776c,null))[_0x09a8('0x26')](function(_0x247096){if(_0x247096){_0x780ea3=_0x247096;_0x4b82dc[_0x09a8('0x33')]=_[_0x09a8('0x35')](db[_0x09a8('0x52')][_0x09a8('0x2f')]);_0x4b82dc['query']=_[_0x09a8('0x35')](_0x113806['query']);_0x4b82dc[_0x09a8('0x36')]=_[_0x09a8('0x37')](_0x4b82dc['model'],_0x4b82dc[_0x09a8('0x34')]);_0x55c045[_0x09a8('0x38')]=_[_0x09a8('0x37')](_0x4b82dc['model'],qs[_0x09a8('0x39')](_0x113806['query'][_0x09a8('0x39')]));_0x55c045['attributes']=_0x55c045['attributes'][_0x09a8('0x3a')]?_0x55c045['attributes']:_0x4b82dc['model'];_0x55c045['order']=qs[_0x09a8('0x3f')](_0x113806[_0x09a8('0x34')][_0x09a8('0x3f')]);_0x55c045[_0x09a8('0x40')]=qs[_0x09a8('0x36')](_[_0x09a8('0x41')](_0x113806[_0x09a8('0x34')],_0x4b82dc['filters']));if(_0x113806[_0x09a8('0x34')][_0x09a8('0x43')]){_0x55c045[_0x09a8('0x40')]=_[_0x09a8('0x44')](_0x55c045['where'],{'$or':_[_0x09a8('0x2d')](_0x55c045['attributes'],function(_0x3048de){var _0x7ac1d0={};_0x7ac1d0[_0x3048de]={'$like':'%'+_0x113806[_0x09a8('0x34')][_0x09a8('0x43')]+'%'};return _0x7ac1d0;})});}_0x55c045=_[_0x09a8('0x44')]({},_0x55c045,_0x113806['options']);return _0x780ea3[_0x09a8('0x54')](_0x55c045);}})[_0x09a8('0x26')](function(_0xdbe7b0){if(_0xdbe7b0){_0xfcae0d=_0xdbe7b0[_0x09a8('0x3a')];if(!_0x113806['query'][_0x09a8('0x3b')](_0x09a8('0x3c'))){_0x55c045[_0x09a8('0x3d')]=qs[_0x09a8('0x3d')](_0x113806[_0x09a8('0x34')][_0x09a8('0x3d')]);_0x55c045[_0x09a8('0x21')]=qs[_0x09a8('0x21')](_0x113806[_0x09a8('0x34')][_0x09a8('0x21')]);}return _0x780ea3['getDescriptions'](_0x55c045);}})[_0x09a8('0x26')](function(_0x487549){if(_0x487549){return _0x487549?{'count':_0xfcae0d,'rows':_0x487549}:null;}})[_0x09a8('0x26')](respondWithResult(_0x60776c,null))['catch'](handleError(_0x60776c,null));};exports[_0x09a8('0x55')]=function(_0x5a1deb,_0x32e518,_0x3b09d5){var _0x2835a6={};var _0x19cec2={};var _0x33aeac;var _0x11e2f3;return db[_0x09a8('0x2e')]['findOne']({'where':{'id':_0x5a1deb[_0x09a8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x32e518,null))[_0x09a8('0x26')](function(_0x2a94a9){if(_0x2a94a9){_0x33aeac=_0x2a94a9;_0x19cec2[_0x09a8('0x33')]=_[_0x09a8('0x35')](db[_0x09a8('0x56')][_0x09a8('0x2f')]);_0x19cec2['query']=_[_0x09a8('0x35')](_0x5a1deb['query']);_0x19cec2[_0x09a8('0x36')]=_[_0x09a8('0x37')](_0x19cec2[_0x09a8('0x33')],_0x19cec2[_0x09a8('0x34')]);_0x2835a6[_0x09a8('0x38')]=_[_0x09a8('0x37')](_0x19cec2[_0x09a8('0x33')],qs[_0x09a8('0x39')](_0x5a1deb[_0x09a8('0x34')][_0x09a8('0x39')]));_0x2835a6[_0x09a8('0x38')]=_0x2835a6['attributes']['length']?_0x2835a6[_0x09a8('0x38')]:_0x19cec2['model'];_0x2835a6['order']=qs['sort'](_0x5a1deb[_0x09a8('0x34')]['sort']);_0x2835a6[_0x09a8('0x40')]=qs[_0x09a8('0x36')](_['pick'](_0x5a1deb['query'],_0x19cec2[_0x09a8('0x36')]));if(_0x5a1deb[_0x09a8('0x34')][_0x09a8('0x43')]){_0x2835a6[_0x09a8('0x40')]=_[_0x09a8('0x44')](_0x2835a6['where'],{'$or':_[_0x09a8('0x2d')](_0x2835a6[_0x09a8('0x38')],function(_0x354efe){var _0x6c0f99={};_0x6c0f99[_0x354efe]={'$like':'%'+_0x5a1deb[_0x09a8('0x34')]['filter']+'%'};return _0x6c0f99;})});}_0x2835a6=_['merge']({},_0x2835a6,_0x5a1deb[_0x09a8('0x45')]);return _0x33aeac[_0x09a8('0x55')](_0x2835a6);}})['then'](function(_0x5ab4c7){if(_0x5ab4c7){_0x11e2f3=_0x5ab4c7[_0x09a8('0x3a')];if(!_0x5a1deb[_0x09a8('0x34')][_0x09a8('0x3b')](_0x09a8('0x3c'))){_0x2835a6[_0x09a8('0x3d')]=qs[_0x09a8('0x3d')](_0x5a1deb[_0x09a8('0x34')]['limit']);_0x2835a6['offset']=qs[_0x09a8('0x21')](_0x5a1deb[_0x09a8('0x34')][_0x09a8('0x21')]);}return _0x33aeac[_0x09a8('0x55')](_0x2835a6);}})[_0x09a8('0x26')](function(_0xcaab40){if(_0xcaab40){return _0xcaab40?{'count':_0x11e2f3,'rows':_0xcaab40}:null;}})[_0x09a8('0x26')](respondWithResult(_0x32e518,null))[_0x09a8('0x49')](handleError(_0x32e518,null));};exports[_0x09a8('0x57')]=function(_0x544fc4,_0xc6e2d0,_0x429894){if(_0x544fc4[_0x09a8('0x4d')]['id']){delete _0x544fc4[_0x09a8('0x4d')]['id'];}return db['DeskConfiguration'][_0x09a8('0x51')]({'where':{'id':_0x544fc4[_0x09a8('0x4f')]['id']}})[_0x09a8('0x26')](handleEntityNotFound(_0xc6e2d0,null))['then'](function(_0x29dd22){if(_0x29dd22){return _0x29dd22[_0x09a8('0x57')](_0x544fc4['body']['ids']||[]);}return null;})['then'](respondWithResult(_0xc6e2d0,null))[_0x09a8('0x49')](handleError(_0xc6e2d0,null));}; \ No newline at end of file +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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 9736042..54b611f 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 _0x8535=['./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','util','api','moment','bluebird','path','rimraf'];(function(_0x39ec06,_0xa5e032){var _0x43c12f=function(_0x31fcfc){while(--_0x31fcfc){_0x39ec06['push'](_0x39ec06['shift']());}};_0x43c12f(++_0xa5e032);}(_0x8535,0x66));var _0x5853=function(_0x581e41,_0x491965){_0x581e41=_0x581e41-0x0;var _0x39661b=_0x8535[_0x581e41];return _0x39661b;};'use strict';var _=require('lodash');var util=require(_0x5853('0x0'));var logger=require('../../config/logger')(_0x5853('0x1'));var moment=require(_0x5853('0x2'));var BPromise=require(_0x5853('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5853('0x4'));var rimraf=require(_0x5853('0x5'));var config=require('../../config/environment');var attributes=require(_0x5853('0x6'));module['exports']=function(_0x3a1f4b,_0x2dd66d){return _0x3a1f4b['define'](_0x5853('0x7'),attributes,{'tableName':_0x5853('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 2842214..29efe48 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 _0xf777=['http','request','then','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x28be0b,_0x313a44){var _0x52e009=function(_0x12445d){while(--_0x12445d){_0x28be0b['push'](_0x28be0b['shift']());}};_0x52e009(++_0x313a44);}(_0xf777,0x1e9));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7f77('0x0'));var util=require(_0x7f77('0x1'));var moment=require(_0x7f77('0x2'));var BPromise=require(_0x7f77('0x3'));var rs=require(_0x7f77('0x4'));var fs=require('fs');var Redis=require(_0x7f77('0x5'));var db=require(_0x7f77('0x6'))['db'];var utils=require(_0x7f77('0x7'));var logger=require(_0x7f77('0x8'))('rpc');var config=require(_0x7f77('0x9'));var jayson=require(_0x7f77('0xa'));var client=jayson['client'][_0x7f77('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53df7d,_0x7bfea,_0x598934){return new BPromise(function(_0x87bd54,_0x322466){return client[_0x7f77('0xc')](_0x53df7d,_0x598934)[_0x7f77('0xd')](function(_0xc8bbae){logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x7bfea,_0x7f77('0xe'));logger[_0x7f77('0xf')](_0x7f77('0x10'),_0x7bfea,_0x7f77('0xe'),JSON[_0x7f77('0x11')](_0xc8bbae));if(_0xc8bbae['error']){if(_0xc8bbae[_0x7f77('0x12')][_0x7f77('0x13')]===0x1f4){logger[_0x7f77('0x12')](_0x7f77('0x14'),_0x7bfea,_0xc8bbae[_0x7f77('0x12')]['message']);return _0x322466(_0xc8bbae['error'][_0x7f77('0x15')]);}logger[_0x7f77('0x12')](_0x7f77('0x14'),_0x7bfea,_0xc8bbae[_0x7f77('0x12')][_0x7f77('0x15')]);return _0x87bd54(_0xc8bbae[_0x7f77('0x12')][_0x7f77('0x15')]);}else{logger[_0x7f77('0x16')](_0x7f77('0x14'),_0x7bfea,_0x7f77('0xe'));_0x87bd54(_0xc8bbae[_0x7f77('0x17')][_0x7f77('0x15')]);}})[_0x7f77('0x18')](function(_0x3f96e9){logger[_0x7f77('0x12')](_0x7f77('0x14'),_0x7bfea,_0x3f96e9);_0x322466(_0x3f96e9);});});} \ No newline at end of file +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 diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 4981b23..3d8915d 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 _0xfc31=['multer','util','path','express','fs-extra','../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy'];(function(_0x38b14f,_0xd08fa8){var _0x22a324=function(_0x4bbb05){while(--_0x4bbb05){_0x38b14f['push'](_0x38b14f['shift']());}};_0x22a324(++_0xd08fa8);}(_0xfc31,0x121));var _0x1fc3=function(_0x5f3842,_0x43f403){_0x5f3842=_0x5f3842-0x0;var _0x22f4ba=_0xfc31[_0x5f3842];return _0x22f4ba;};'use strict';var multer=require(_0x1fc3('0x0'));var util=require(_0x1fc3('0x1'));var path=require(_0x1fc3('0x2'));var timeout=require('connect-timeout');var express=require(_0x1fc3('0x3'));var router=express['Router']();var fs_extra=require(_0x1fc3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1fc3('0x5'));var config=require('../../config/environment');var controller=require(_0x1fc3('0x6'));router[_0x1fc3('0x7')]('/',auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x9')]);router[_0x1fc3('0x7')](_0x1fc3('0xa'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0xb')]);router[_0x1fc3('0xc')]('/',auth[_0x1fc3('0x8')](),controller[_0x1fc3('0xd')]);router[_0x1fc3('0xe')](_0x1fc3('0xa'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0xf')]);router['delete'](_0x1fc3('0xa'),auth[_0x1fc3('0x8')](),controller[_0x1fc3('0x10')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index eb9110d..540472d 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 _0x7696=['variable','customVariable','keyValue','picklist','string','STRING','ENUM','BOOLEAN','sequelize'];(function(_0x483102,_0x54e93d){var _0x5cc885=function(_0x54931c){while(--_0x54931c){_0x483102['push'](_0x483102['shift']());}};_0x5cc885(++_0x54e93d);}(_0x7696,0x194));var _0x6769=function(_0x433415,_0x50c6bd){_0x433415=_0x433415-0x0;var _0x24cd03=_0x7696[_0x433415];return _0x24cd03;};'use strict';var Sequelize=require(_0x6769('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x6769('0x1'),_0x6769('0x2'),_0x6769('0x3'),_0x6769('0x4')),'defaultValue':_0x6769('0x5')},'content':{'type':Sequelize[_0x6769('0x6')]},'key':{'type':Sequelize[_0x6769('0x6')]},'keyType':{'type':Sequelize[_0x6769('0x7')](_0x6769('0x5'),_0x6769('0x1'),_0x6769('0x2'))},'keyContent':{'type':Sequelize[_0x6769('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6769('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6769('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 8a72726..fa92402 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 _0x1bce=['count','set','Content-Range','then','destroy','status','end','stack','name','index','map','DeskField','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','json','offset','limit','undefined'];(function(_0x2dcc48,_0x59027c){var _0x292bc8=function(_0x303fbc){while(--_0x303fbc){_0x2dcc48['push'](_0x2dcc48['shift']());}};_0x292bc8(++_0x59027c);}(_0x1bce,0x73));var _0xe1bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bce[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xe1bc('0x0'));var rimraf=require(_0xe1bc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe1bc('0x2'));var rp=require(_0xe1bc('0x3'));var moment=require(_0xe1bc('0x4'));var BPromise=require(_0xe1bc('0x5'));var Mustache=require(_0xe1bc('0x6'));var util=require(_0xe1bc('0x7'));var path=require(_0xe1bc('0x8'));var sox=require(_0xe1bc('0x9'));var csv=require(_0xe1bc('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1bc('0xb'));var squel=require(_0xe1bc('0xc'));var crypto=require(_0xe1bc('0xd'));var jsforce=require(_0xe1bc('0xe'));var deskjs=require(_0xe1bc('0xf'));var toCsv=require(_0xe1bc('0xa'));var querystring=require('querystring');var Papa=require(_0xe1bc('0x10'));var Redis=require('ioredis');var authService=require(_0xe1bc('0x11'));var qs=require(_0xe1bc('0x12'));var as=require(_0xe1bc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1bc('0x14'))(_0xe1bc('0x15'));var utils=require('../../config/utils');var config=require(_0xe1bc('0x16'));var licenseUtil=require(_0xe1bc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c8b9f,_0xdb61b){_0xdb61b=_0xdb61b||0xcc;return function(_0xc89560){if(_0xc89560){return _0x5c8b9f[_0xe1bc('0x18')](_0xdb61b);}return _0x5c8b9f['status'](_0xdb61b)['end']();};}function respondWithResult(_0x161955,_0x16b0cd){_0x16b0cd=_0x16b0cd||0xc8;return function(_0x402a22){if(_0x402a22){return _0x161955['status'](_0x16b0cd)[_0xe1bc('0x19')](_0x402a22);}};}function respondWithFilteredResult(_0x3a073e,_0x17cfc3){return function(_0x46ab48){if(_0x46ab48){var _0x556001=typeof _0x17cfc3[_0xe1bc('0x1a')]==='undefined'&&typeof _0x17cfc3[_0xe1bc('0x1b')]===_0xe1bc('0x1c');var _0x4acd5b=_0x46ab48[_0xe1bc('0x1d')];var _0x1ed85d=_0x556001?0x0:_0x17cfc3[_0xe1bc('0x1a')];var _0x3fd489=_0x556001?_0x46ab48[_0xe1bc('0x1d')]:_0x17cfc3[_0xe1bc('0x1a')]+_0x17cfc3['limit'];var _0x2d2caa;if(_0x3fd489>=_0x4acd5b){_0x3fd489=_0x4acd5b;_0x2d2caa=0xc8;}else{_0x2d2caa=0xce;}_0x3a073e['status'](_0x2d2caa);return _0x3a073e[_0xe1bc('0x1e')](_0xe1bc('0x1f'),_0x1ed85d+'-'+_0x3fd489+'/'+_0x4acd5b)[_0xe1bc('0x19')](_0x46ab48);}return null;};}function patchUpdates(_0x1d222c){return function(_0x2a79f1){try{jsonpatch['apply'](_0x2a79f1,_0x1d222c,!![]);}catch(_0x313b16){return BPromise['reject'](_0x313b16);}return _0x2a79f1['save']();};}function saveUpdates(_0x3a5f82,_0x2a999c){return function(_0x5cc42d){if(_0x5cc42d){return _0x5cc42d['update'](_0x3a5f82)[_0xe1bc('0x20')](function(_0x7a8e22){return _0x7a8e22;});}return null;};}function removeEntity(_0x26582e,_0x126ae3){return function(_0x229b43){if(_0x229b43){return _0x229b43[_0xe1bc('0x21')]()[_0xe1bc('0x20')](function(){_0x26582e[_0xe1bc('0x22')](0xcc)[_0xe1bc('0x23')]();});}};}function handleEntityNotFound(_0x16631e,_0x927963){return function(_0x3d1946){if(!_0x3d1946){_0x16631e[_0xe1bc('0x18')](0x194);}return _0x3d1946;};}function handleError(_0x584622,_0x4dd024){_0x4dd024=_0x4dd024||0x1f4;return function(_0x6311aa){logger['error'](_0x6311aa[_0xe1bc('0x24')]);if(_0x6311aa['name']){delete _0x6311aa[_0xe1bc('0x25')];}_0x584622['status'](_0x4dd024)['send'](_0x6311aa);};}exports[_0xe1bc('0x26')]=function(_0x3958a4,_0x58a667){var _0x47d9b3={},_0x39017e={},_0x23caa1={'count':0x0,'rows':[]};var _0x345da1=_[_0xe1bc('0x27')](db[_0xe1bc('0x28')][_0xe1bc('0x29')],function(_0x122da8){return{'name':_0x122da8[_0xe1bc('0x2a')],'type':_0x122da8[_0xe1bc('0x2b')]['key']};});_0x39017e[_0xe1bc('0x2c')]=_[_0xe1bc('0x27')](_0x345da1,_0xe1bc('0x25'));_0x39017e['query']=_[_0xe1bc('0x2d')](_0x3958a4[_0xe1bc('0x2e')]);_0x39017e[_0xe1bc('0x2f')]=_[_0xe1bc('0x30')](_0x39017e[_0xe1bc('0x2c')],_0x39017e['query']);_0x47d9b3[_0xe1bc('0x31')]=_['intersection'](_0x39017e['model'],qs[_0xe1bc('0x32')](_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x32')]));_0x47d9b3['attributes']=_0x47d9b3[_0xe1bc('0x31')][_0xe1bc('0x33')]?_0x47d9b3['attributes']:_0x39017e[_0xe1bc('0x2c')];if(!_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x34')](_0xe1bc('0x35'))){_0x47d9b3[_0xe1bc('0x1b')]=qs[_0xe1bc('0x1b')](_0x3958a4['query'][_0xe1bc('0x1b')]);_0x47d9b3[_0xe1bc('0x1a')]=qs['offset'](_0x3958a4[_0xe1bc('0x2e')]['offset']);}_0x47d9b3[_0xe1bc('0x36')]=qs[_0xe1bc('0x37')](_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x37')]);_0x47d9b3['where']=qs[_0xe1bc('0x2f')](_[_0xe1bc('0x38')](_0x3958a4[_0xe1bc('0x2e')],_0x39017e[_0xe1bc('0x2f')]),_0x345da1);if(_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x39')]){_0x47d9b3[_0xe1bc('0x3a')]=_[_0xe1bc('0x3b')](_0x47d9b3[_0xe1bc('0x3a')],{'$or':_[_0xe1bc('0x27')](_0x345da1,function(_0x344b42){if(_0x344b42[_0xe1bc('0x2b')]!==_0xe1bc('0x3c')){var _0x45ddd3={};_0x45ddd3[_0x344b42['name']]={'$like':'%'+_0x3958a4[_0xe1bc('0x2e')][_0xe1bc('0x39')]+'%'};return _0x45ddd3;}})});}_0x47d9b3=_['merge']({},_0x47d9b3,_0x3958a4[_0xe1bc('0x3d')]);var _0x4e3d2d={'where':_0x47d9b3[_0xe1bc('0x3a')]};return db[_0xe1bc('0x28')][_0xe1bc('0x1d')](_0x4e3d2d)[_0xe1bc('0x20')](function(_0x254e8b){_0x23caa1['count']=_0x254e8b;if(_0x3958a4['query'][_0xe1bc('0x3e')]){_0x47d9b3[_0xe1bc('0x3f')]=[{'all':!![]}];}return db[_0xe1bc('0x28')][_0xe1bc('0x40')](_0x47d9b3);})[_0xe1bc('0x20')](function(_0xbe9e0e){_0x23caa1['rows']=_0xbe9e0e;return _0x23caa1;})[_0xe1bc('0x20')](respondWithFilteredResult(_0x58a667,_0x47d9b3))[_0xe1bc('0x41')](handleError(_0x58a667,null));};exports[_0xe1bc('0x42')]=function(_0x5b0339,_0x3fee8f){var _0x4c5634={'raw':!![],'where':{'id':_0x5b0339[_0xe1bc('0x43')]['id']}},_0x22cc17={};_0x22cc17[_0xe1bc('0x2c')]=_['keys'](db[_0xe1bc('0x28')][_0xe1bc('0x29')]);_0x22cc17[_0xe1bc('0x2e')]=_['keys'](_0x5b0339[_0xe1bc('0x2e')]);_0x22cc17['filters']=_['intersection'](_0x22cc17['model'],_0x22cc17['query']);_0x4c5634['attributes']=_['intersection'](_0x22cc17[_0xe1bc('0x2c')],qs[_0xe1bc('0x32')](_0x5b0339[_0xe1bc('0x2e')][_0xe1bc('0x32')]));_0x4c5634[_0xe1bc('0x31')]=_0x4c5634[_0xe1bc('0x31')]['length']?_0x4c5634[_0xe1bc('0x31')]:_0x22cc17[_0xe1bc('0x2c')];if(_0x5b0339[_0xe1bc('0x2e')][_0xe1bc('0x3e')]){_0x4c5634[_0xe1bc('0x3f')]=[{'all':!![]}];}_0x4c5634=_['merge']({},_0x4c5634,_0x5b0339[_0xe1bc('0x3d')]);return db[_0xe1bc('0x28')]['find'](_0x4c5634)[_0xe1bc('0x20')](handleEntityNotFound(_0x3fee8f,null))[_0xe1bc('0x20')](respondWithResult(_0x3fee8f,null))['catch'](handleError(_0x3fee8f,null));};exports[_0xe1bc('0x44')]=function(_0x52263b,_0x1ec1dc){return db['DeskField']['create'](_0x52263b[_0xe1bc('0x45')],{})[_0xe1bc('0x20')](respondWithResult(_0x1ec1dc,0xc9))[_0xe1bc('0x41')](handleError(_0x1ec1dc,null));};exports[_0xe1bc('0x46')]=function(_0xd4884c,_0x2dccb7){if(_0xd4884c['body']['id']){delete _0xd4884c[_0xe1bc('0x45')]['id'];}return db[_0xe1bc('0x28')]['find']({'where':{'id':_0xd4884c[_0xe1bc('0x43')]['id']}})['then'](handleEntityNotFound(_0x2dccb7,null))[_0xe1bc('0x20')](saveUpdates(_0xd4884c['body'],null))[_0xe1bc('0x20')](respondWithResult(_0x2dccb7,null))[_0xe1bc('0x41')](handleError(_0x2dccb7,null));};exports[_0xe1bc('0x21')]=function(_0x5bc275,_0x3b6165){return db['DeskField'][_0xe1bc('0x47')]({'where':{'id':_0x5bc275[_0xe1bc('0x43')]['id']}})[_0xe1bc('0x20')](handleEntityNotFound(_0x3b6165,null))['then'](removeEntity(_0x3b6165,null))[_0xe1bc('0x41')](handleError(_0x3b6165,null));}; \ No newline at end of file +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 diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 30c8a97..c013ad5 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 _0x466f=['FieldId','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports','DeskField','int_desk_fields','desk_unique_index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x466f,0x1dd));var _0xf466=function(_0x2c5a45,_0x2c8e6e){_0x2c5a45=_0x2c5a45-0x0;var _0x4f2005=_0x466f[_0x2c5a45];return _0x4f2005;};'use strict';var _=require(_0xf466('0x0'));var util=require(_0xf466('0x1'));var logger=require(_0xf466('0x2'))(_0xf466('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf466('0x4'));var fs=require('fs');var path=require(_0xf466('0x5'));var rimraf=require(_0xf466('0x6'));var config=require(_0xf466('0x7'));var attributes=require(_0xf466('0x8'));module[_0xf466('0x9')]=function(_0xfc2605,_0x3c730c){return _0xfc2605['define'](_0xf466('0xa'),attributes,{'tableName':_0xf466('0xb'),'paranoid':![],'indexes':[{'name':_0xf466('0xc'),'fields':['idField',_0xf466('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index 04896ed..ed49730 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 _0x4fb5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2d63ce,_0x4564d4){var _0x108e2c=function(_0x2c149f){while(--_0x2c149f){_0x2d63ce['push'](_0x2d63ce['shift']());}};_0x108e2c(++_0x4564d4);}(_0x4fb5,0x103));var _0x54fb=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0x4fb5[_0x1b7368];return _0x25d54c;};'use strict';var _=require(_0x54fb('0x0'));var util=require(_0x54fb('0x1'));var moment=require(_0x54fb('0x2'));var BPromise=require(_0x54fb('0x3'));var rs=require(_0x54fb('0x4'));var fs=require('fs');var Redis=require(_0x54fb('0x5'));var db=require(_0x54fb('0x6'))['db'];var utils=require(_0x54fb('0x7'));var logger=require(_0x54fb('0x8'))(_0x54fb('0x9'));var config=require(_0x54fb('0xa'));var jayson=require(_0x54fb('0xb'));var client=jayson[_0x54fb('0xc')][_0x54fb('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1f3a94,_0x3703f9,_0x34a671){return new BPromise(function(_0xd44027,_0x25b3c1){return client[_0x54fb('0xe')](_0x1f3a94,_0x34a671)[_0x54fb('0xf')](function(_0x5e5873){logger['info'](_0x54fb('0x10'),_0x3703f9,_0x54fb('0x11'));logger['debug'](_0x54fb('0x12'),_0x3703f9,_0x54fb('0x11'),JSON[_0x54fb('0x13')](_0x5e5873));if(_0x5e5873[_0x54fb('0x14')]){if(_0x5e5873[_0x54fb('0x14')][_0x54fb('0x15')]===0x1f4){logger[_0x54fb('0x14')]('DeskField,\x20%s,\x20%s',_0x3703f9,_0x5e5873[_0x54fb('0x14')][_0x54fb('0x16')]);return _0x25b3c1(_0x5e5873[_0x54fb('0x14')]['message']);}logger[_0x54fb('0x14')](_0x54fb('0x10'),_0x3703f9,_0x5e5873[_0x54fb('0x14')][_0x54fb('0x16')]);return _0xd44027(_0x5e5873[_0x54fb('0x14')][_0x54fb('0x16')]);}else{logger[_0x54fb('0x17')](_0x54fb('0x10'),_0x3703f9,_0x54fb('0x11'));_0xd44027(_0x5e5873[_0x54fb('0x18')]['message']);}})[_0x54fb('0x19')](function(_0x7e73f4){logger[_0x54fb('0x14')]('DeskField,\x20%s,\x20%s',_0x3703f9,_0x7e73f4);_0x25b3c1(_0x7e73f4);});});} \ No newline at end of file +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 diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 72e93f9..99f9b96 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 _0xc569=['../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','/:id','delete','destroy','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x332432,_0x4e8d9a){var _0x233e28=function(_0x2ec7bf){while(--_0x2ec7bf){_0x332432['push'](_0x332432['shift']());}};_0x233e28(++_0x4e8d9a);}(_0xc569,0xe1));var _0x9c56=function(_0x1e24fd,_0x55bee4){_0x1e24fd=_0x1e24fd-0x0;var _0x3d2334=_0xc569[_0x1e24fd];return _0x3d2334;};'use strict';var multer=require(_0x9c56('0x0'));var util=require('util');var path=require(_0x9c56('0x1'));var timeout=require(_0x9c56('0x2'));var express=require('express');var router=express[_0x9c56('0x3')]();var fs_extra=require(_0x9c56('0x4'));var auth=require(_0x9c56('0x5'));var interaction=require(_0x9c56('0x6'));var config=require(_0x9c56('0x7'));var controller=require(_0x9c56('0x8'));router['get']('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0xa')]);router['get']('/:id',auth[_0x9c56('0x9')](),controller['show']);router[_0x9c56('0xb')](_0x9c56('0xc'),auth[_0x9c56('0x9')](),controller[_0x9c56('0xd')]);router[_0x9c56('0xb')](_0x9c56('0xe'),auth[_0x9c56('0x9')](),controller[_0x9c56('0xf')]);router[_0x9c56('0x10')]('/',auth[_0x9c56('0x9')](),controller[_0x9c56('0x11')]);router[_0x9c56('0x10')](_0x9c56('0xc'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x9c56('0x12'),auth[_0x9c56('0x9')](),controller['update']);router[_0x9c56('0x13')](_0x9c56('0x12'),auth[_0x9c56('0x9')](),controller[_0x9c56('0x14')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 8ce431c..e85908e 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 _0x4f8f=['STRING','exports'];(function(_0x15204b,_0x12d6af){var _0x410d73=function(_0x48e1df){while(--_0x48e1df){_0x15204b['push'](_0x15204b['shift']());}};_0x410d73(++_0x12d6af);}(_0x4f8f,0x175));var _0xf4f8=function(_0x5dc770,_0x3f9ca1){_0x5dc770=_0x5dc770-0x0;var _0x3b111b=_0x4f8f[_0x5dc770];return _0x3b111b;};'use strict';var Sequelize=require('sequelize');module[_0xf4f8('0x0')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xf4f8('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0xf4f8('0x1')]},'clientId':{'type':Sequelize[_0xf4f8('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf4f8('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index a6184c6..d5dd01d 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 _0xf961=['responseby','responsiblecontactidname','sentimentvalue','slaname','statecode','ticketnumber','transactioncurrencyidname','versionnumber','concat','findOne','username','remoteUri','tenantId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','/oauth2/token','clientId','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','send','Wrong\x20credentials','statusCode','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','stack','name','index','Dynamics365Account','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','getConfigurations','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','owneridname','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby'];(function(_0x53dd63,_0x5e1852){var _0x460c0a=function(_0x599511){while(--_0x599511){_0x53dd63['push'](_0x53dd63['shift']());}};_0x460c0a(++_0x5e1852);}(_0xf961,0x1cf));var _0x1f96=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0xf961[_0x75f869];return _0x10af8b;};'use strict';var emlformat=require(_0x1f96('0x0'));var rimraf=require(_0x1f96('0x1'));var zipdir=require(_0x1f96('0x2'));var jsonpatch=require(_0x1f96('0x3'));var rp=require('request-promise');var moment=require(_0x1f96('0x4'));var BPromise=require(_0x1f96('0x5'));var Mustache=require(_0x1f96('0x6'));var util=require('util');var path=require(_0x1f96('0x7'));var sox=require(_0x1f96('0x8'));var csv=require(_0x1f96('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f96('0xa'));var _=require('lodash');var squel=require(_0x1f96('0xb'));var crypto=require(_0x1f96('0xc'));var jsforce=require(_0x1f96('0xd'));var deskjs=require(_0x1f96('0xe'));var toCsv=require(_0x1f96('0x9'));var querystring=require(_0x1f96('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f96('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1f96('0x11'));var hardwareService=require(_0x1f96('0x12'));var logger=require(_0x1f96('0x13'))(_0x1f96('0x14'));var utils=require('../../config/utils');var config=require(_0x1f96('0x15'));var licenseUtil=require(_0x1f96('0x16'));var db=require(_0x1f96('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x7a4391,_0x13c5d3){_0x13c5d3=_0x13c5d3||0xcc;return function(_0x4669b3){if(_0x4669b3){return _0x7a4391[_0x1f96('0x18')](_0x13c5d3);}return _0x7a4391[_0x1f96('0x19')](_0x13c5d3)[_0x1f96('0x1a')]();};}function respondWithResult(_0x591aea,_0x11d22d){_0x11d22d=_0x11d22d||0xc8;return function(_0x43e677){if(_0x43e677){return _0x591aea[_0x1f96('0x19')](_0x11d22d)[_0x1f96('0x1b')](_0x43e677);}};}function respondWithFilteredResult(_0x51daa4,_0x1fe208){return function(_0x2d2cee){if(_0x2d2cee){var _0x1f3d82=typeof _0x1fe208[_0x1f96('0x1c')]===_0x1f96('0x1d')&&typeof _0x1fe208[_0x1f96('0x1e')]===_0x1f96('0x1d');var _0x39f1d4=_0x2d2cee['count'];var _0x1c24fc=_0x1f3d82?0x0:_0x1fe208[_0x1f96('0x1c')];var _0x4f8942=_0x1f3d82?_0x2d2cee[_0x1f96('0x1f')]:_0x1fe208[_0x1f96('0x1c')]+_0x1fe208[_0x1f96('0x1e')];var _0x17aa92;if(_0x4f8942>=_0x39f1d4){_0x4f8942=_0x39f1d4;_0x17aa92=0xc8;}else{_0x17aa92=0xce;}_0x51daa4[_0x1f96('0x19')](_0x17aa92);return _0x51daa4[_0x1f96('0x20')]('Content-Range',_0x1c24fc+'-'+_0x4f8942+'/'+_0x39f1d4)[_0x1f96('0x1b')](_0x2d2cee);}return null;};}function patchUpdates(_0x47f3e6){return function(_0x41254a){try{jsonpatch[_0x1f96('0x21')](_0x41254a,_0x47f3e6,!![]);}catch(_0x2575e9){return BPromise[_0x1f96('0x22')](_0x2575e9);}return _0x41254a['save']();};}function saveUpdates(_0x382146,_0x28c9cb){return function(_0x51d0b3){if(_0x51d0b3){return _0x51d0b3['update'](_0x382146)[_0x1f96('0x23')](function(_0x120d84){return _0x120d84;});}return null;};}function removeEntity(_0x1bf598,_0x573808){return function(_0x151bc8){if(_0x151bc8){return _0x151bc8[_0x1f96('0x24')]()[_0x1f96('0x23')](function(){_0x1bf598[_0x1f96('0x19')](0xcc)[_0x1f96('0x1a')]();});}};}function handleEntityNotFound(_0x1ffa96,_0x987bd9){return function(_0x4057f6){if(!_0x4057f6){_0x1ffa96['sendStatus'](0x194);}return _0x4057f6;};}function handleError(_0x4fafae,_0x5c075f){_0x5c075f=_0x5c075f||0x1f4;return function(_0x47c351){logger['error'](_0x47c351[_0x1f96('0x25')]);if(_0x47c351[_0x1f96('0x26')]){delete _0x47c351[_0x1f96('0x26')];}_0x4fafae[_0x1f96('0x19')](_0x5c075f)['send'](_0x47c351);};}exports[_0x1f96('0x27')]=function(_0x1cd885,_0x29e1d2){var _0x4b25e2={},_0xff1c50={},_0x1b7ba9={'count':0x0,'rows':[]};var _0x5358f4=_['map'](db[_0x1f96('0x28')][_0x1f96('0x29')],function(_0x44e36f){return{'name':_0x44e36f[_0x1f96('0x2a')],'type':_0x44e36f[_0x1f96('0x2b')][_0x1f96('0x2c')]};});_0xff1c50['model']=_[_0x1f96('0x2d')](_0x5358f4,'name');_0xff1c50[_0x1f96('0x2e')]=_[_0x1f96('0x2f')](_0x1cd885[_0x1f96('0x2e')]);_0xff1c50[_0x1f96('0x30')]=_[_0x1f96('0x31')](_0xff1c50['model'],_0xff1c50[_0x1f96('0x2e')]);_0x4b25e2[_0x1f96('0x32')]=_['intersection'](_0xff1c50[_0x1f96('0x33')],qs[_0x1f96('0x34')](_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x34')]));_0x4b25e2['attributes']=_0x4b25e2[_0x1f96('0x32')][_0x1f96('0x35')]?_0x4b25e2[_0x1f96('0x32')]:_0xff1c50['model'];if(!_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x36')](_0x1f96('0x37'))){_0x4b25e2[_0x1f96('0x1e')]=qs[_0x1f96('0x1e')](_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x1e')]);_0x4b25e2[_0x1f96('0x1c')]=qs['offset'](_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x1c')]);}_0x4b25e2[_0x1f96('0x38')]=qs[_0x1f96('0x39')](_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x39')]);_0x4b25e2[_0x1f96('0x3a')]=qs[_0x1f96('0x30')](_[_0x1f96('0x3b')](_0x1cd885[_0x1f96('0x2e')],_0xff1c50[_0x1f96('0x30')]),_0x5358f4);if(_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x3c')]){_0x4b25e2[_0x1f96('0x3a')]=_['merge'](_0x4b25e2[_0x1f96('0x3a')],{'$or':_[_0x1f96('0x2d')](_0x5358f4,function(_0x52d64d){if(_0x52d64d['type']!==_0x1f96('0x3d')){var _0x40f93c={};_0x40f93c[_0x52d64d['name']]={'$like':'%'+_0x1cd885['query'][_0x1f96('0x3c')]+'%'};return _0x40f93c;}})});}_0x4b25e2=_[_0x1f96('0x3e')]({},_0x4b25e2,_0x1cd885[_0x1f96('0x3f')]);var _0x133270={'where':_0x4b25e2[_0x1f96('0x3a')]};return db[_0x1f96('0x28')]['count'](_0x133270)[_0x1f96('0x23')](function(_0x505173){_0x1b7ba9['count']=_0x505173;if(_0x1cd885[_0x1f96('0x2e')][_0x1f96('0x40')]){_0x4b25e2[_0x1f96('0x41')]=[{'all':!![]}];}return db[_0x1f96('0x28')][_0x1f96('0x42')](_0x4b25e2);})['then'](function(_0x41ed8c){_0x1b7ba9[_0x1f96('0x43')]=_0x41ed8c;return _0x1b7ba9;})['then'](respondWithFilteredResult(_0x29e1d2,_0x4b25e2))[_0x1f96('0x44')](handleError(_0x29e1d2,null));};exports[_0x1f96('0x45')]=function(_0x4155eb,_0x106c1f){var _0x515e1c={'raw':![],'where':{'id':_0x4155eb[_0x1f96('0x46')]['id']}},_0x2c8ffe={};_0x2c8ffe[_0x1f96('0x33')]=_['keys'](db['Dynamics365Account'][_0x1f96('0x29')]);_0x2c8ffe[_0x1f96('0x2e')]=_[_0x1f96('0x2f')](_0x4155eb[_0x1f96('0x2e')]);_0x2c8ffe[_0x1f96('0x30')]=_['intersection'](_0x2c8ffe[_0x1f96('0x33')],_0x2c8ffe[_0x1f96('0x2e')]);_0x515e1c[_0x1f96('0x32')]=_[_0x1f96('0x31')](_0x2c8ffe[_0x1f96('0x33')],qs['fields'](_0x4155eb[_0x1f96('0x2e')][_0x1f96('0x34')]));_0x515e1c[_0x1f96('0x32')]=_0x515e1c[_0x1f96('0x32')][_0x1f96('0x35')]?_0x515e1c[_0x1f96('0x32')]:_0x2c8ffe[_0x1f96('0x33')];if(_0x4155eb[_0x1f96('0x2e')][_0x1f96('0x40')]){_0x515e1c['include']=[{'all':!![]}];}_0x515e1c=_[_0x1f96('0x3e')]({},_0x515e1c,_0x4155eb[_0x1f96('0x3f')]);return db[_0x1f96('0x28')][_0x1f96('0x47')](_0x515e1c)[_0x1f96('0x23')](handleEntityNotFound(_0x106c1f,null))[_0x1f96('0x23')](respondWithResult(_0x106c1f,null))[_0x1f96('0x44')](handleError(_0x106c1f,null));};exports[_0x1f96('0x48')]=function(_0x2525e6,_0x15a0dd){return db[_0x1f96('0x28')]['create'](_0x2525e6[_0x1f96('0x49')],{})['then'](respondWithResult(_0x15a0dd,0xc9))[_0x1f96('0x44')](handleError(_0x15a0dd,null));};exports[_0x1f96('0x4a')]=function(_0x3bcf8a,_0x182a1e){if(_0x3bcf8a[_0x1f96('0x49')]['id']){delete _0x3bcf8a['body']['id'];}return db[_0x1f96('0x28')][_0x1f96('0x47')]({'where':{'id':_0x3bcf8a[_0x1f96('0x46')]['id']}})[_0x1f96('0x23')](handleEntityNotFound(_0x182a1e,null))[_0x1f96('0x23')](saveUpdates(_0x3bcf8a[_0x1f96('0x49')],null))['then'](respondWithResult(_0x182a1e,null))[_0x1f96('0x44')](handleError(_0x182a1e,null));};exports[_0x1f96('0x24')]=function(_0x3f25cb,_0x545ea9){return db['Dynamics365Account'][_0x1f96('0x47')]({'where':{'id':_0x3f25cb[_0x1f96('0x46')]['id']}})['then'](handleEntityNotFound(_0x545ea9,null))[_0x1f96('0x23')](removeEntity(_0x545ea9,null))['catch'](handleError(_0x545ea9,null));};exports[_0x1f96('0x4b')]=function(_0x3966cd,_0x58be70,_0x443e74){var _0x4c715d={};var _0x253e33={};var _0x55d91a;var _0x33057b;return db['Dynamics365Account']['findOne']({'where':{'id':_0x3966cd[_0x1f96('0x46')]['id']}})['then'](handleEntityNotFound(_0x58be70,null))[_0x1f96('0x23')](function(_0x36f791){if(_0x36f791){_0x55d91a=_0x36f791;_0x253e33[_0x1f96('0x33')]=_['keys'](db[_0x1f96('0x4c')][_0x1f96('0x29')]);_0x253e33[_0x1f96('0x2e')]=_['keys'](_0x3966cd[_0x1f96('0x2e')]);_0x253e33['filters']=_[_0x1f96('0x31')](_0x253e33[_0x1f96('0x33')],_0x253e33[_0x1f96('0x2e')]);_0x4c715d['attributes']=_['intersection'](_0x253e33['model'],qs['fields'](_0x3966cd['query'][_0x1f96('0x34')]));_0x4c715d[_0x1f96('0x32')]=_0x4c715d[_0x1f96('0x32')][_0x1f96('0x35')]?_0x4c715d['attributes']:_0x253e33[_0x1f96('0x33')];_0x4c715d['order']=qs[_0x1f96('0x39')](_0x3966cd[_0x1f96('0x2e')][_0x1f96('0x39')]);_0x4c715d[_0x1f96('0x3a')]=qs[_0x1f96('0x30')](_[_0x1f96('0x3b')](_0x3966cd['query'],_0x253e33[_0x1f96('0x30')]));if(_0x3966cd[_0x1f96('0x2e')][_0x1f96('0x3c')]){_0x4c715d[_0x1f96('0x3a')]=_[_0x1f96('0x3e')](_0x4c715d[_0x1f96('0x3a')],{'$or':_[_0x1f96('0x2d')](_0x4c715d[_0x1f96('0x32')],function(_0x445b7b){var _0x191e2d={};_0x191e2d[_0x445b7b]={'$like':'%'+_0x3966cd[_0x1f96('0x2e')][_0x1f96('0x3c')]+'%'};return _0x191e2d;})});}_0x4c715d=_[_0x1f96('0x3e')]({},_0x4c715d,_0x3966cd[_0x1f96('0x3f')]);return _0x55d91a[_0x1f96('0x4b')](_0x4c715d);}})[_0x1f96('0x23')](function(_0x471f74){if(_0x471f74){_0x33057b=_0x471f74[_0x1f96('0x35')];if(!_0x3966cd[_0x1f96('0x2e')][_0x1f96('0x36')]('nolimit')){_0x4c715d[_0x1f96('0x1e')]=qs['limit'](_0x3966cd['query']['limit']);_0x4c715d['offset']=qs['offset'](_0x3966cd[_0x1f96('0x2e')][_0x1f96('0x1c')]);}return _0x55d91a[_0x1f96('0x4b')](_0x4c715d);}})[_0x1f96('0x23')](function(_0x531291){if(_0x531291){return _0x531291?{'count':_0x33057b,'rows':_0x531291}:null;}})[_0x1f96('0x23')](respondWithResult(_0x58be70,null))[_0x1f96('0x44')](handleError(_0x58be70,null));};exports[_0x1f96('0x4d')]=function(_0x4e61a2,_0x168d5f,_0x1faafd){if(_0x4e61a2[_0x1f96('0x49')]['id']){delete _0x4e61a2[_0x1f96('0x49')]['id'];}return db[_0x1f96('0x28')]['findOne']({'where':{'id':_0x4e61a2[_0x1f96('0x46')]['id']}})['then'](handleEntityNotFound(_0x168d5f,null))[_0x1f96('0x23')](function(_0x508360){if(_0x508360){_0x4e61a2[_0x1f96('0x49')][_0x1f96('0x4e')]=_0x508360['id'];_0x4e61a2['body'][_0x1f96('0x4f')]=integrations[_0x1f96('0x50')](_0x4e61a2[_0x1f96('0x49')][_0x1f96('0x51')],_0x4e61a2[_0x1f96('0x49')][_0x1f96('0x2b')]);_0x4e61a2[_0x1f96('0x49')][_0x1f96('0x52')]=integrations[_0x1f96('0x53')](_0x4e61a2[_0x1f96('0x49')][_0x1f96('0x51')],_0x4e61a2[_0x1f96('0x49')][_0x1f96('0x2b')]);return db[_0x1f96('0x4c')][_0x1f96('0x48')](_0x4e61a2[_0x1f96('0x49')],{'include':[{'model':db[_0x1f96('0x54')],'as':_0x1f96('0x4f')},{'model':db[_0x1f96('0x54')],'as':_0x1f96('0x52')}]});}return null;})[_0x1f96('0x23')](respondWithResult(_0x168d5f,null))[_0x1f96('0x44')](handleError(_0x168d5f,null));};exports[_0x1f96('0x55')]=function(_0x12b98b,_0x3fc635,_0x26d3f9){var _0x5f4d99=_0x12b98b['query'][_0x1f96('0x56')];var _0x232222=_0x5f4d99===_0x1f96('0x57')?_0x1f96('0x58'):'PhoneCall';var _0x1a8b3e='';var _0x5b4810='';var _0x2a7b22='';var _0xff9176='';var _0x5ecdb2='';var _0x409364='';var _0x5b3fa0='';var _0x3b0ced='';var _0x391c00=[_0x1f96('0x59'),_0x1f96('0x5a'),_0x1f96('0x5b'),_0x1f96('0x5c'),_0x1f96('0x5d'),_0x1f96('0x5e'),_0x1f96('0x5f'),_0x1f96('0x60'),'directioncode',_0x1f96('0x61')];var _0x9bdbc7=[_0x1f96('0x62'),_0x1f96('0x63'),'actualserviceunits',_0x1f96('0x64'),_0x1f96('0x65'),_0x1f96('0x66'),_0x1f96('0x67'),_0x1f96('0x68'),_0x1f96('0x69'),'createdbyexternalpartyyominame',_0x1f96('0x6a'),_0x1f96('0x6b'),_0x1f96('0x6c'),_0x1f96('0x6d'),_0x1f96('0x6e'),'customeridname','customeridtype',_0x1f96('0x6f'),'emailaddress',_0x1f96('0x70'),'entityimage_timestamp',_0x1f96('0x71'),_0x1f96('0x72'),'exchangerate',_0x1f96('0x73'),'followupby','importsequencenumber',_0x1f96('0x74'),_0x1f96('0x75'),_0x1f96('0x76'),_0x1f96('0x77'),_0x1f96('0x78'),_0x1f96('0x79'),_0x1f96('0x7a'),'modifiedbyyominame',_0x1f96('0x7b'),_0x1f96('0x7c'),_0x1f96('0x7d'),_0x1f96('0x7e'),'msdyn_iotalertname','numberofchildincidents',_0x1f96('0x7f'),'overriddencreatedon',_0x1f96('0x80'),'owneridtype','owneridyominame',_0x1f96('0x81'),_0x1f96('0x82'),'primarycontactidyominame','prioritycodename',_0x1f96('0x83'),_0x1f96('0x84'),_0x1f96('0x85'),'resolvebykpiidname',_0x1f96('0x86'),_0x1f96('0x87'),'responsiblecontactidyominame',_0x1f96('0x88'),'slainvokedidname',_0x1f96('0x89'),'socialprofileidname',_0x1f96('0x8a'),'statuscode','subjectidname',_0x1f96('0x8b'),'timezoneruleversionnumber',_0x1f96('0x8c'),'traversedpath','utcconversiontimezonecode',_0x1f96('0x8d')];var _0xfd7098=_0x391c00[_0x1f96('0x8e')](_0x9bdbc7);return db[_0x1f96('0x28')][_0x1f96('0x8f')]({'where':{'id':_0x12b98b[_0x1f96('0x46')]['id']},'attributes':['id',_0x1f96('0x90'),'password',_0x1f96('0x91'),_0x1f96('0x92'),'clientId',_0x1f96('0x93')]})[_0x1f96('0x23')](handleEntityNotFound(_0x3fc635,null))[_0x1f96('0x23')](function(_0x164ce3){if(_0x164ce3){_0x3b0ced=_0x164ce3[_0x1f96('0x91')];var _0x353c72=_0x3b0ced[_0x1f96('0x94')](-0x1);if(_0x353c72==='/'){_0x3b0ced=_0x3b0ced[_0x1f96('0x95')](0x0,_0x3b0ced[_0x1f96('0x96')](_0x353c72));}_0x5b3fa0=util[_0x1f96('0x97')](_0x1f96('0x98'),_0x3b0ced);var _0x392277={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x164ce3[_0x1f96('0x92')]+_0x1f96('0x99'),'form':{'client_id':_0x164ce3[_0x1f96('0x9a')],'resource':_0x3b0ced,'username':_0x164ce3[_0x1f96('0x90')],'password':_0x164ce3[_0x1f96('0x9b')],'grant_type':_0x1f96('0x9b'),'client_secret':_0x164ce3[_0x1f96('0x93')]},'json':!![]};return rp(_0x392277);}})[_0x1f96('0x23')](function(_0x1049e5){_0x409364=_0x1049e5['access_token'];var _0x27c3d6={'method':_0x1f96('0x9c'),'uri':encodeURI(_0x5b3fa0+_0x1f96('0x9d')+_0x232222+'\x27'),'headers':{'Authorization':_0x1f96('0x9e')+_0x409364,'If-None-Match':null,'OData-Version':_0x1f96('0x9f')},'json':!![]};return rp(_0x27c3d6);})[_0x1f96('0x23')](function(_0x348ebd){var _0x5af3e8=_0x348ebd[_0x1f96('0xa0')][0x0];var _0x46e462=_0x5af3e8['MetadataId'];var _0x3e4e46={'method':_0x1f96('0x9c'),'uri':_0x5b3fa0+_0x1f96('0xa1')+_0x46e462+_0x1f96('0xa2'),'headers':{'Authorization':_0x1f96('0x9e')+_0x409364,'If-None-Match':null,'OData-Version':_0x1f96('0x9f')},'json':!![]};return rp(_0x3e4e46);})['then'](function(_0x482ef2){_0x1a8b3e=_0x482ef2;_0x5b4810=_0x1a8b3e[_0x1f96('0xa3')];_0x5b4810=_[_0x1f96('0xa4')](_0x5b4810,function(_0x2e274a){return!_0xfd7098['includes'](_0x2e274a[_0x1f96('0xa5')]);});var _0x3ea287=[];var _0x672304=[];_0x5b4810[_0x1f96('0xa6')](function(_0x44197d){if(_0x44197d['@odata.type']){var _0x4ac0bf=_0x44197d['@odata.type'][_0x1f96('0x95')](_0x44197d[_0x1f96('0xa7')]['lastIndexOf']('.')+0x1);if(_0x4ac0bf===_0x1f96('0xa8')){_0x3ea287[_0x1f96('0xa9')](getSelectList(_0x5b3fa0,_0x5f4d99,_0x672304,_0x1a8b3e['MetadataId'],_0x44197d[_0x1f96('0xaa')],_0x409364));}}});return Promise[_0x1f96('0xab')](_0x3ea287);})[_0x1f96('0x23')](function(_0x3ae881){_0x2a7b22=_0x3ae881[0x0];var _0x1f2604=[];var _0x2317b9=[];_0x5b4810[_0x1f96('0xa6')](function(_0xdcff2f){if(!_[_0x1f96('0xac')](_0xdcff2f['@odata.type'])){var _0x44b1b6=_0xdcff2f[_0x1f96('0xa7')][_0x1f96('0x95')](_0xdcff2f['@odata.type'][_0x1f96('0x96')]('.')+0x1);if(_0x44b1b6===_0x1f96('0xad')){_0x1f2604[_0x1f96('0xa9')](getBooleanList(_0x5b3fa0,_0x5f4d99,_0x2317b9,_0x1a8b3e[_0x1f96('0xaa')],_0xdcff2f[_0x1f96('0xaa')],_0x409364));}}});return Promise[_0x1f96('0xab')](_0x1f2604);})['then'](function(_0x264bdd){_0xff9176=_0x264bdd[0x0];var _0x3f58a1=[];var _0x5a55a5=[];_0x5b4810[_0x1f96('0xa6')](function(_0x1cdf4a){if(_0x1cdf4a['@odata.type']){var _0x413f08=_0x1cdf4a[_0x1f96('0xa7')][_0x1f96('0x95')](_0x1cdf4a[_0x1f96('0xa7')]['lastIndexOf']('.')+0x1);if(_0x413f08===_0x1f96('0xae')||_0x413f08===_0x1f96('0xaf')||_0x413f08===_0x1f96('0xb0')||_0x413f08===_0x1f96('0xb1')||_0x413f08===_0x1f96('0xb2')||_0x413f08===_0x1f96('0xb3')||_0x413f08===_0x1f96('0xb4')||_0x413f08==='EntityNameAttributeMetadata'||_0x413f08===_0x1f96('0xb5')||_0x413f08===_0x1f96('0xb6')){_0x3f58a1[_0x1f96('0xa9')](getInputList(_0x5b3fa0,_0x5f4d99,_0x413f08,_0x5a55a5,_0x1a8b3e['MetadataId'],_0x1cdf4a[_0x1f96('0xaa')],_0x409364));}}});return Promise[_0x1f96('0xab')](_0x3f58a1);})[_0x1f96('0x23')](function(_0x12dbc6){_0x5ecdb2=_0x12dbc6[0x0];var _0x18f85b=_0x2a7b22[_0x1f96('0x8e')](_0xff9176)[_0x1f96('0x8e')](_0x5ecdb2);var _0x57461b={'count':_0x18f85b[_0x1f96('0x35')],'rows':_0x18f85b};return _0x57461b;})[_0x1f96('0x23')](respondWithResult(_0x3fc635,null))[_0x1f96('0x44')](function(_0x210379){var _0x4b57fe=_0x12b98b['query']['test']?0x1f4:_0x210379['statusCode']||0x1f4;logger['error'](_0x210379[_0x1f96('0x25')]);delete _0x210379[_0x1f96('0x26')];if(_0x4b57fe===0x191){_0x4b57fe=0x190;}_0x3fc635['status'](_0x4b57fe)[_0x1f96('0xb7')](_0x12b98b[_0x1f96('0x2e')]['test']?{'message':_0x1f96('0xb8'),'statusCode':_0x210379[_0x1f96('0xb9')]}:_0x210379);});};function getSelectList(_0x480d55,_0x428612,_0xdd6934,_0x54db42,_0x50ae26,_0x493ac2){var _0x27c6f7={'method':_0x1f96('0x9c'),'uri':_0x480d55+'EntityDefinitions('+_0x54db42+')/Attributes('+_0x50ae26+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x1f96('0xba'),'headers':{'Authorization':_0x1f96('0x9e')+_0x493ac2,'If-None-Match':null,'OData-Version':_0x1f96('0x9f')},'json':!![]};return rp(_0x27c6f7)[_0x1f96('0x23')](function(_0x2078c6){var _0x15e886=[];var _0x3a30b9=_0x2078c6['OptionSet'][_0x1f96('0xbb')];_0x3a30b9['forEach'](function(_0x44babc){_0x15e886[_0x1f96('0xa9')]({'name':_0x44babc[_0x1f96('0xbc')]['UserLocalizedLabel'][_0x1f96('0xbc')],'value':String(_0x44babc[_0x1f96('0xbd')])});});var _0x115c14={'id':_0x428612+'_'+_0x2078c6[_0x1f96('0xa5')],'name':_0x2078c6[_0x1f96('0xbe')][_0x1f96('0xbf')]['Label'],'custom':![],'options':_0x15e886};_0xdd6934['push'](_0x115c14);return _0xdd6934;});}function getBooleanList(_0x446a76,_0x4048b4,_0x18f9ec,_0x331d11,_0x5958a3,_0x46b015){var _0x26fe84={'method':_0x1f96('0x9c'),'uri':_0x446a76+_0x1f96('0xa1')+_0x331d11+_0x1f96('0xc0')+_0x5958a3+_0x1f96('0xc1'),'headers':{'Authorization':'Bearer\x20'+_0x46b015,'If-None-Match':null,'OData-Version':_0x1f96('0x9f')},'json':!![]};return rp(_0x26fe84)[_0x1f96('0x23')](function(_0x56a286){var _0x422b2b=[];_0x422b2b[_0x1f96('0xa9')]({'name':_0x56a286[_0x1f96('0xc2')]['TrueOption'][_0x1f96('0xbc')]['UserLocalizedLabel']['Label'],'value':'true'},{'name':_0x56a286[_0x1f96('0xc2')][_0x1f96('0xc3')][_0x1f96('0xbc')][_0x1f96('0xbf')][_0x1f96('0xbc')],'value':_0x1f96('0xc4')});var _0x13cc3d={'id':_0x4048b4+'_'+_0x56a286[_0x1f96('0xa5')],'name':_0x56a286['DisplayName'][_0x1f96('0xbf')][_0x1f96('0xbc')],'custom':![],'options':_0x422b2b};_0x18f9ec[_0x1f96('0xa9')](_0x13cc3d);return _0x18f9ec;});}function getInputList(_0xa68215,_0x43b869,_0x5e9a31,_0x3fc92c,_0x8b81b4,_0x2ba1e2,_0x4dc2db){var _0x5b6281={'method':'GET','uri':_0xa68215+_0x1f96('0xa1')+_0x8b81b4+_0x1f96('0xc0')+_0x2ba1e2+_0x1f96('0xc5')+_0x5e9a31+_0x1f96('0xc6'),'headers':{'Authorization':_0x1f96('0x9e')+_0x4dc2db,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b6281)[_0x1f96('0x23')](function(_0x30cbd8){var _0x278eaa={'id':_0x43b869+'_'+_0x30cbd8[_0x1f96('0xa5')],'name':_0x30cbd8[_0x1f96('0xbe')]['UserLocalizedLabel']?_0x30cbd8['DisplayName'][_0x1f96('0xbf')]['Label']:_0x30cbd8[_0x1f96('0xa5')],'custom':![],'options':[]};_0x3fc92c[_0x1f96('0xa9')](_0x278eaa);return _0x3fc92c;});} \ No newline at end of file +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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 4fa6db3..84bbf34 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57c155,_0x8b96f7){var _0x443278=function(_0x48eb64){while(--_0x48eb64){_0x57c155['push'](_0x57c155['shift']());}};_0x443278(++_0x8b96f7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _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 diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index d403475..e82d12f 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 _0x57a5=['error','code','Dynamics365Account,\x20%s,\x20%s','message','result','catch','GetDynamics365Account','findAll','options','raw','where','attributes','limit','map','include','model','stringify','Dynamics365Account','find','ShowDynamics365Account','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s'];(function(_0x48474a,_0xc851ea){var _0x3c8355=function(_0x546b9e){while(--_0x546b9e){_0x48474a['push'](_0x48474a['shift']());}};_0x3c8355(++_0xc851ea);}(_0x57a5,0x1dc));var _0x557a=function(_0x23f89e,_0x3fb22d){_0x23f89e=_0x23f89e-0x0;var _0x1391ba=_0x57a5[_0x23f89e];return _0x1391ba;};'use strict';var _=require(_0x557a('0x0'));var util=require(_0x557a('0x1'));var moment=require('moment');var BPromise=require(_0x557a('0x2'));var rs=require(_0x557a('0x3'));var fs=require('fs');var Redis=require(_0x557a('0x4'));var db=require(_0x557a('0x5'))['db'];var utils=require(_0x557a('0x6'));var logger=require(_0x557a('0x7'))(_0x557a('0x8'));var config=require(_0x557a('0x9'));var jayson=require(_0x557a('0xa'));var client=jayson[_0x557a('0xb')][_0x557a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ad9fa,_0x5a336d,_0x49ec6d){return new BPromise(function(_0x3cbf9c,_0xd5b1c5){return client['request'](_0x1ad9fa,_0x49ec6d)[_0x557a('0xd')](function(_0x10ff5c){logger[_0x557a('0xe')]('Dynamics365Account,\x20%s,\x20%s',_0x5a336d,_0x557a('0xf'));logger[_0x557a('0x10')](_0x557a('0x11'),_0x5a336d,_0x557a('0xf'),JSON['stringify'](_0x10ff5c));if(_0x10ff5c[_0x557a('0x12')]){if(_0x10ff5c[_0x557a('0x12')][_0x557a('0x13')]===0x1f4){logger[_0x557a('0x12')](_0x557a('0x14'),_0x5a336d,_0x10ff5c[_0x557a('0x12')][_0x557a('0x15')]);return _0xd5b1c5(_0x10ff5c[_0x557a('0x12')][_0x557a('0x15')]);}logger['error'](_0x557a('0x14'),_0x5a336d,_0x10ff5c[_0x557a('0x12')][_0x557a('0x15')]);return _0x3cbf9c(_0x10ff5c[_0x557a('0x12')][_0x557a('0x15')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x5a336d,'request\x20sent');_0x3cbf9c(_0x10ff5c[_0x557a('0x16')][_0x557a('0x15')]);}})[_0x557a('0x17')](function(_0x1785b9){logger['error'](_0x557a('0x14'),_0x5a336d,_0x1785b9);_0xd5b1c5(_0x1785b9);});});}exports[_0x557a('0x18')]=function(_0xa36c3f){var _0x5b9c84=this;return new Promise(function(_0x11be00,_0x3d5c1a){return db['Dynamics365Account'][_0x557a('0x19')]({'raw':_0xa36c3f['options']?_0xa36c3f[_0x557a('0x1a')][_0x557a('0x1b')]===undefined?!![]:![]:!![],'where':_0xa36c3f[_0x557a('0x1a')]?_0xa36c3f[_0x557a('0x1a')][_0x557a('0x1c')]||null:null,'attributes':_0xa36c3f['options']?_0xa36c3f[_0x557a('0x1a')][_0x557a('0x1d')]||null:null,'limit':_0xa36c3f[_0x557a('0x1a')]?_0xa36c3f[_0x557a('0x1a')][_0x557a('0x1e')]||null:null,'include':_0xa36c3f[_0x557a('0x1a')]?_0xa36c3f[_0x557a('0x1a')]['include']?_[_0x557a('0x1f')](_0xa36c3f[_0x557a('0x1a')][_0x557a('0x20')],function(_0x456b6b){return{'model':db[_0x456b6b[_0x557a('0x21')]],'as':_0x456b6b['as'],'attributes':_0x456b6b[_0x557a('0x1d')],'include':_0x456b6b['include']?_[_0x557a('0x1f')](_0x456b6b[_0x557a('0x20')],function(_0x36be30){return{'model':db[_0x36be30[_0x557a('0x21')]],'as':_0x36be30['as'],'attributes':_0x36be30['attributes'],'include':_0x36be30['include']?_[_0x557a('0x1f')](_0x36be30[_0x557a('0x20')],function(_0x1ecb7b){return{'model':db[_0x1ecb7b[_0x557a('0x21')]],'as':_0x1ecb7b['as'],'attributes':_0x1ecb7b['attributes']};}):[]};}):[]};}):[]:[]})[_0x557a('0xd')](function(_0x565a49){logger['info'](_0x557a('0x18'),_0xa36c3f);logger[_0x557a('0x10')]('GetDynamics365Account',_0xa36c3f,JSON[_0x557a('0x22')](_0x565a49));_0x11be00(_0x565a49);})[_0x557a('0x17')](function(_0x2d896d){logger[_0x557a('0x12')](_0x557a('0x18'),_0x2d896d['message'],_0xa36c3f);_0x3d5c1a(_0x5b9c84[_0x557a('0x12')](0x1f4,_0x2d896d[_0x557a('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x421ec0){var _0x163d72=this;return new Promise(function(_0x4864a9,_0x4cec1f){return db[_0x557a('0x23')][_0x557a('0x24')]({'raw':_0x421ec0[_0x557a('0x1a')]?_0x421ec0[_0x557a('0x1a')][_0x557a('0x1b')]===undefined?!![]:![]:!![],'where':_0x421ec0[_0x557a('0x1a')]?_0x421ec0['options'][_0x557a('0x1c')]||null:null,'attributes':_0x421ec0[_0x557a('0x1a')]?_0x421ec0[_0x557a('0x1a')][_0x557a('0x1d')]||null:null,'include':_0x421ec0[_0x557a('0x1a')]?_0x421ec0[_0x557a('0x1a')]['include']?_['map'](_0x421ec0[_0x557a('0x1a')][_0x557a('0x20')],function(_0xc3cded){return{'model':db[_0xc3cded[_0x557a('0x21')]],'as':_0xc3cded['as'],'attributes':_0xc3cded['attributes'],'include':_0xc3cded[_0x557a('0x20')]?_['map'](_0xc3cded[_0x557a('0x20')],function(_0x1a0690){return{'model':db[_0x1a0690[_0x557a('0x21')]],'as':_0x1a0690['as'],'attributes':_0x1a0690[_0x557a('0x1d')],'include':_0x1a0690['include']?_[_0x557a('0x1f')](_0x1a0690[_0x557a('0x20')],function(_0x48961c){return{'model':db[_0x48961c[_0x557a('0x21')]],'as':_0x48961c['as'],'attributes':_0x48961c[_0x557a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x557a('0xd')](function(_0x50511d){logger['info'](_0x557a('0x25'),_0x421ec0);logger[_0x557a('0x10')](_0x557a('0x25'),_0x421ec0,JSON[_0x557a('0x22')](_0x50511d));_0x4864a9(_0x50511d);})[_0x557a('0x17')](function(_0x5282a6){logger[_0x557a('0x12')](_0x557a('0x25'),_0x5282a6[_0x557a('0x15')],_0x421ec0);_0x4cec1f(_0x163d72[_0x557a('0x12')](0x1f4,_0x5282a6[_0x557a('0x15')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 206415e..1640973 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 _0x713c=['/:id/descriptions','getDescriptions','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x713c,0x1e1));var _0xc713=function(_0x216941,_0x1eb36a){_0x216941=_0x216941-0x0;var _0x5c05ba=_0x713c[_0x216941];return _0x5c05ba;};'use strict';var multer=require(_0xc713('0x0'));var util=require(_0xc713('0x1'));var path=require(_0xc713('0x2'));var timeout=require(_0xc713('0x3'));var express=require(_0xc713('0x4'));var router=express[_0xc713('0x5')]();var fs_extra=require(_0xc713('0x6'));var auth=require(_0xc713('0x7'));var interaction=require(_0xc713('0x8'));var config=require(_0xc713('0x9'));var controller=require('./intDynamics365Configuration.controller');router[_0xc713('0xa')]('/',auth[_0xc713('0xb')](),controller[_0xc713('0xc')]);router['get'](_0xc713('0xd'),auth[_0xc713('0xb')](),controller[_0xc713('0xe')]);router[_0xc713('0xa')](_0xc713('0xf'),auth[_0xc713('0xb')](),controller[_0xc713('0x10')]);router['get'](_0xc713('0x11'),auth[_0xc713('0xb')](),controller[_0xc713('0x12')]);router[_0xc713('0xa')](_0xc713('0x13'),auth[_0xc713('0xb')](),controller[_0xc713('0x14')]);router['post']('/',auth[_0xc713('0xb')](),controller[_0xc713('0x15')]);router[_0xc713('0x16')](_0xc713('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xc713('0x17')](_0xc713('0xd'),auth[_0xc713('0xb')](),controller[_0xc713('0x18')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 2442cf9..3af68dc 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 _0xc486=['phonecall','STRING','ENUM','incident'];(function(_0x42a103,_0xa19a69){var _0x288cfd=function(_0x22d10a){while(--_0x22d10a){_0x42a103['push'](_0x42a103['shift']());}};_0x288cfd(++_0xa19a69);}(_0xc486,0x171));var _0x6c48=function(_0x1a3243,_0x201872){_0x1a3243=_0x1a3243-0x0;var _0x33f2ca=_0xc486[_0x1a3243];return _0x33f2ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6c48('0x0')]},'description':{'type':Sequelize[_0x6c48('0x0')]},'ticketType':{'type':Sequelize[_0x6c48('0x1')](_0x6c48('0x2'),_0x6c48('0x3')),'defaultValue':_0x6c48('0x2')}}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index ecddae7..9f4cc0c 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 _0xdbae=['squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','create','body','getFields','findOne','sort','pick','getSubjects','Dynamics365Field','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x3bd51e,_0x59c4b9){var _0x425b54=function(_0x3e822e){while(--_0x3e822e){_0x3bd51e['push'](_0x3bd51e['shift']());}};_0x425b54(++_0x59c4b9);}(_0xdbae,0x133));var _0xedba=function(_0x5ba2a4,_0x4b93b7){_0x5ba2a4=_0x5ba2a4-0x0;var _0x56d0e9=_0xdbae[_0x5ba2a4];return _0x56d0e9;};'use strict';var emlformat=require(_0xedba('0x0'));var rimraf=require(_0xedba('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedba('0x2'));var rp=require(_0xedba('0x3'));var moment=require(_0xedba('0x4'));var BPromise=require(_0xedba('0x5'));var Mustache=require('mustache');var util=require(_0xedba('0x6'));var path=require(_0xedba('0x7'));var sox=require(_0xedba('0x8'));var csv=require(_0xedba('0x9'));var ejs=require(_0xedba('0xa'));var fs=require('fs');var fs_extra=require(_0xedba('0xb'));var _=require(_0xedba('0xc'));var squel=require(_0xedba('0xd'));var crypto=require('crypto');var jsforce=require(_0xedba('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedba('0x9'));var querystring=require(_0xedba('0xf'));var Papa=require(_0xedba('0x10'));var Redis=require(_0xedba('0x11'));var authService=require(_0xedba('0x12'));var qs=require(_0xedba('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedba('0x14'));var logger=require(_0xedba('0x15'))('api');var utils=require(_0xedba('0x16'));var config=require(_0xedba('0x17'));var licenseUtil=require(_0xedba('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8c07c5,_0x54d437){_0x54d437=_0x54d437||0xcc;return function(_0x4851cf){if(_0x4851cf){return _0x8c07c5['sendStatus'](_0x54d437);}return _0x8c07c5[_0xedba('0x19')](_0x54d437)[_0xedba('0x1a')]();};}function respondWithResult(_0x1f64ca,_0x2468a9){_0x2468a9=_0x2468a9||0xc8;return function(_0x93451c){if(_0x93451c){return _0x1f64ca[_0xedba('0x19')](_0x2468a9)[_0xedba('0x1b')](_0x93451c);}};}function respondWithFilteredResult(_0x23673c,_0x1d14bb){return function(_0x2fd1e2){if(_0x2fd1e2){var _0x255961=typeof _0x1d14bb[_0xedba('0x1c')]===_0xedba('0x1d')&&typeof _0x1d14bb[_0xedba('0x1e')]===_0xedba('0x1d');var _0x494b20=_0x2fd1e2['count'];var _0x3fc79b=_0x255961?0x0:_0x1d14bb[_0xedba('0x1c')];var _0x204422=_0x255961?_0x2fd1e2[_0xedba('0x1f')]:_0x1d14bb[_0xedba('0x1c')]+_0x1d14bb[_0xedba('0x1e')];var _0x2aeb63;if(_0x204422>=_0x494b20){_0x204422=_0x494b20;_0x2aeb63=0xc8;}else{_0x2aeb63=0xce;}_0x23673c[_0xedba('0x19')](_0x2aeb63);return _0x23673c[_0xedba('0x20')](_0xedba('0x21'),_0x3fc79b+'-'+_0x204422+'/'+_0x494b20)[_0xedba('0x1b')](_0x2fd1e2);}return null;};}function patchUpdates(_0x3c37d6){return function(_0x244eee){try{jsonpatch['apply'](_0x244eee,_0x3c37d6,!![]);}catch(_0x2e0bd2){return BPromise[_0xedba('0x22')](_0x2e0bd2);}return _0x244eee[_0xedba('0x23')]();};}function saveUpdates(_0x1bb129,_0x4ab71e){return function(_0x41668a){if(_0x41668a){return _0x41668a[_0xedba('0x24')](_0x1bb129)[_0xedba('0x25')](function(_0x3c3c6e){return _0x3c3c6e;});}return null;};}function removeEntity(_0x2f545f,_0x56f818){return function(_0x5ed95a){if(_0x5ed95a){return _0x5ed95a[_0xedba('0x26')]()[_0xedba('0x25')](function(){_0x2f545f[_0xedba('0x19')](0xcc)[_0xedba('0x1a')]();});}};}function handleEntityNotFound(_0x9a872d,_0x157c49){return function(_0x396af9){if(!_0x396af9){_0x9a872d[_0xedba('0x27')](0x194);}return _0x396af9;};}function handleError(_0x41ee6f,_0x5b096d){_0x5b096d=_0x5b096d||0x1f4;return function(_0x497614){logger[_0xedba('0x28')](_0x497614[_0xedba('0x29')]);if(_0x497614[_0xedba('0x2a')]){delete _0x497614['name'];}_0x41ee6f[_0xedba('0x19')](_0x5b096d)[_0xedba('0x2b')](_0x497614);};}exports['index']=function(_0x5a4da3,_0x477486){var _0x26e299={},_0x1bf80c={},_0xc6a9f2={'count':0x0,'rows':[]};var _0x736541=_[_0xedba('0x2c')](db[_0xedba('0x2d')][_0xedba('0x2e')],function(_0x4194f2){return{'name':_0x4194f2['fieldName'],'type':_0x4194f2[_0xedba('0x2f')][_0xedba('0x30')]};});_0x1bf80c[_0xedba('0x31')]=_[_0xedba('0x2c')](_0x736541,_0xedba('0x2a'));_0x1bf80c[_0xedba('0x32')]=_[_0xedba('0x33')](_0x5a4da3[_0xedba('0x32')]);_0x1bf80c[_0xedba('0x34')]=_[_0xedba('0x35')](_0x1bf80c[_0xedba('0x31')],_0x1bf80c['query']);_0x26e299[_0xedba('0x36')]=_[_0xedba('0x35')](_0x1bf80c[_0xedba('0x31')],qs[_0xedba('0x37')](_0x5a4da3[_0xedba('0x32')]['fields']));_0x26e299[_0xedba('0x36')]=_0x26e299['attributes'][_0xedba('0x38')]?_0x26e299[_0xedba('0x36')]:_0x1bf80c[_0xedba('0x31')];if(!_0x5a4da3[_0xedba('0x32')][_0xedba('0x39')](_0xedba('0x3a'))){_0x26e299[_0xedba('0x1e')]=qs[_0xedba('0x1e')](_0x5a4da3['query'][_0xedba('0x1e')]);_0x26e299[_0xedba('0x1c')]=qs[_0xedba('0x1c')](_0x5a4da3[_0xedba('0x32')][_0xedba('0x1c')]);}_0x26e299[_0xedba('0x3b')]=qs['sort'](_0x5a4da3['query']['sort']);_0x26e299[_0xedba('0x3c')]=qs['filters'](_['pick'](_0x5a4da3[_0xedba('0x32')],_0x1bf80c[_0xedba('0x34')]),_0x736541);if(_0x5a4da3[_0xedba('0x32')][_0xedba('0x3d')]){_0x26e299['where']=_[_0xedba('0x3e')](_0x26e299[_0xedba('0x3c')],{'$or':_[_0xedba('0x2c')](_0x736541,function(_0x5267dd){if(_0x5267dd[_0xedba('0x2f')]!==_0xedba('0x3f')){var _0x3914e3={};_0x3914e3[_0x5267dd[_0xedba('0x2a')]]={'$like':'%'+_0x5a4da3['query']['filter']+'%'};return _0x3914e3;}})});}_0x26e299=_[_0xedba('0x3e')]({},_0x26e299,_0x5a4da3[_0xedba('0x40')]);var _0x2bf947={'where':_0x26e299[_0xedba('0x3c')]};return db[_0xedba('0x2d')][_0xedba('0x1f')](_0x2bf947)[_0xedba('0x25')](function(_0x55261e){_0xc6a9f2['count']=_0x55261e;if(_0x5a4da3['query'][_0xedba('0x41')]){_0x26e299[_0xedba('0x42')]=[{'all':!![]}];}return db[_0xedba('0x2d')][_0xedba('0x43')](_0x26e299);})[_0xedba('0x25')](function(_0x1d9a19){_0xc6a9f2['rows']=_0x1d9a19;return _0xc6a9f2;})[_0xedba('0x25')](respondWithFilteredResult(_0x477486,_0x26e299))[_0xedba('0x44')](handleError(_0x477486,null));};exports[_0xedba('0x45')]=function(_0x478c1f,_0x1e7a52){var _0xd72468={'raw':![],'where':{'id':_0x478c1f[_0xedba('0x46')]['id']}},_0x28a9f0={};_0x28a9f0[_0xedba('0x31')]=_[_0xedba('0x33')](db[_0xedba('0x2d')][_0xedba('0x2e')]);_0x28a9f0[_0xedba('0x32')]=_[_0xedba('0x33')](_0x478c1f[_0xedba('0x32')]);_0x28a9f0[_0xedba('0x34')]=_['intersection'](_0x28a9f0[_0xedba('0x31')],_0x28a9f0['query']);_0xd72468[_0xedba('0x36')]=_['intersection'](_0x28a9f0[_0xedba('0x31')],qs[_0xedba('0x37')](_0x478c1f[_0xedba('0x32')][_0xedba('0x37')]));_0xd72468[_0xedba('0x36')]=_0xd72468[_0xedba('0x36')][_0xedba('0x38')]?_0xd72468[_0xedba('0x36')]:_0x28a9f0[_0xedba('0x31')];if(_0x478c1f[_0xedba('0x32')]['includeAll']){_0xd72468['include']=[{'all':!![]}];}_0xd72468=_[_0xedba('0x3e')]({},_0xd72468,_0x478c1f[_0xedba('0x40')]);return db['Dynamics365Configuration']['find'](_0xd72468)[_0xedba('0x25')](handleEntityNotFound(_0x1e7a52,null))[_0xedba('0x25')](respondWithResult(_0x1e7a52,null))[_0xedba('0x44')](handleError(_0x1e7a52,null));};exports['create']=function(_0x4d80e7,_0x53948c){return db[_0xedba('0x2d')][_0xedba('0x47')](_0x4d80e7[_0xedba('0x48')],{})[_0xedba('0x25')](respondWithResult(_0x53948c,0xc9))[_0xedba('0x44')](handleError(_0x53948c,null));};exports[_0xedba('0x24')]=function(_0xd34abb,_0x5ce584){if(_0xd34abb['body']['id']){delete _0xd34abb['body']['id'];}return db[_0xedba('0x2d')]['find']({'where':{'id':_0xd34abb[_0xedba('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ce584,null))['then'](saveUpdates(_0xd34abb[_0xedba('0x48')],null))[_0xedba('0x25')](respondWithResult(_0x5ce584,null))[_0xedba('0x44')](handleError(_0x5ce584,null));};exports[_0xedba('0x26')]=function(_0x44a451,_0x1205d8){return db[_0xedba('0x2d')]['find']({'where':{'id':_0x44a451[_0xedba('0x46')]['id']}})[_0xedba('0x25')](handleEntityNotFound(_0x1205d8,null))[_0xedba('0x25')](removeEntity(_0x1205d8,null))[_0xedba('0x44')](handleError(_0x1205d8,null));};exports[_0xedba('0x49')]=function(_0x16ac72,_0x43db65,_0x47ba50){var _0xf70686={};var _0x1eff99={};var _0x18a819;var _0x1e24ae;return db[_0xedba('0x2d')][_0xedba('0x4a')]({'where':{'id':_0x16ac72[_0xedba('0x46')]['id']}})[_0xedba('0x25')](handleEntityNotFound(_0x43db65,null))[_0xedba('0x25')](function(_0x1e3109){if(_0x1e3109){_0x18a819=_0x1e3109;_0x1eff99[_0xedba('0x31')]=_[_0xedba('0x33')](db['Dynamics365Field']['rawAttributes']);_0x1eff99['query']=_[_0xedba('0x33')](_0x16ac72[_0xedba('0x32')]);_0x1eff99[_0xedba('0x34')]=_[_0xedba('0x35')](_0x1eff99[_0xedba('0x31')],_0x1eff99['query']);_0xf70686[_0xedba('0x36')]=_['intersection'](_0x1eff99[_0xedba('0x31')],qs[_0xedba('0x37')](_0x16ac72[_0xedba('0x32')][_0xedba('0x37')]));_0xf70686[_0xedba('0x36')]=_0xf70686[_0xedba('0x36')][_0xedba('0x38')]?_0xf70686['attributes']:_0x1eff99[_0xedba('0x31')];_0xf70686[_0xedba('0x3b')]=qs[_0xedba('0x4b')](_0x16ac72[_0xedba('0x32')][_0xedba('0x4b')]);_0xf70686['where']=qs[_0xedba('0x34')](_[_0xedba('0x4c')](_0x16ac72[_0xedba('0x32')],_0x1eff99['filters']));if(_0x16ac72['query']['filter']){_0xf70686['where']=_[_0xedba('0x3e')](_0xf70686[_0xedba('0x3c')],{'$or':_[_0xedba('0x2c')](_0xf70686[_0xedba('0x36')],function(_0xcbea2){var _0x177bcf={};_0x177bcf[_0xcbea2]={'$like':'%'+_0x16ac72[_0xedba('0x32')][_0xedba('0x3d')]+'%'};return _0x177bcf;})});}_0xf70686=_[_0xedba('0x3e')]({},_0xf70686,_0x16ac72[_0xedba('0x40')]);return _0x18a819[_0xedba('0x49')](_0xf70686);}})[_0xedba('0x25')](function(_0x3540cd){if(_0x3540cd){_0x1e24ae=_0x3540cd[_0xedba('0x38')];if(!_0x16ac72[_0xedba('0x32')]['hasOwnProperty'](_0xedba('0x3a'))){_0xf70686['limit']=qs[_0xedba('0x1e')](_0x16ac72[_0xedba('0x32')][_0xedba('0x1e')]);_0xf70686[_0xedba('0x1c')]=qs[_0xedba('0x1c')](_0x16ac72[_0xedba('0x32')][_0xedba('0x1c')]);}return _0x18a819[_0xedba('0x49')](_0xf70686);}})[_0xedba('0x25')](function(_0x1434f2){if(_0x1434f2){return _0x1434f2?{'count':_0x1e24ae,'rows':_0x1434f2}:null;}})['then'](respondWithResult(_0x43db65,null))['catch'](handleError(_0x43db65,null));};exports[_0xedba('0x4d')]=function(_0x5a38f5,_0x5c17bb,_0x3af74b){var _0x15d7b3={};var _0x306988={};var _0x590ddf;var _0x1445a6;return db[_0xedba('0x2d')][_0xedba('0x4a')]({'where':{'id':_0x5a38f5['params']['id']}})[_0xedba('0x25')](handleEntityNotFound(_0x5c17bb,null))['then'](function(_0x225539){if(_0x225539){_0x590ddf=_0x225539;_0x306988[_0xedba('0x31')]=_[_0xedba('0x33')](db[_0xedba('0x4e')][_0xedba('0x2e')]);_0x306988['query']=_['keys'](_0x5a38f5[_0xedba('0x32')]);_0x306988[_0xedba('0x34')]=_[_0xedba('0x35')](_0x306988[_0xedba('0x31')],_0x306988[_0xedba('0x32')]);_0x15d7b3[_0xedba('0x36')]=_['intersection'](_0x306988['model'],qs[_0xedba('0x37')](_0x5a38f5[_0xedba('0x32')]['fields']));_0x15d7b3[_0xedba('0x36')]=_0x15d7b3[_0xedba('0x36')]['length']?_0x15d7b3['attributes']:_0x306988['model'];_0x15d7b3['order']=qs[_0xedba('0x4b')](_0x5a38f5[_0xedba('0x32')][_0xedba('0x4b')]);_0x15d7b3['where']=qs[_0xedba('0x34')](_[_0xedba('0x4c')](_0x5a38f5[_0xedba('0x32')],_0x306988['filters']));if(_0x5a38f5[_0xedba('0x32')][_0xedba('0x3d')]){_0x15d7b3[_0xedba('0x3c')]=_[_0xedba('0x3e')](_0x15d7b3['where'],{'$or':_[_0xedba('0x2c')](_0x15d7b3['attributes'],function(_0x104ece){var _0x3d9c12={};_0x3d9c12[_0x104ece]={'$like':'%'+_0x5a38f5[_0xedba('0x32')][_0xedba('0x3d')]+'%'};return _0x3d9c12;})});}_0x15d7b3=_[_0xedba('0x3e')]({},_0x15d7b3,_0x5a38f5[_0xedba('0x40')]);return _0x590ddf[_0xedba('0x4d')](_0x15d7b3);}})[_0xedba('0x25')](function(_0x291f42){if(_0x291f42){_0x1445a6=_0x291f42[_0xedba('0x38')];if(!_0x5a38f5[_0xedba('0x32')][_0xedba('0x39')](_0xedba('0x3a'))){_0x15d7b3[_0xedba('0x1e')]=qs[_0xedba('0x1e')](_0x5a38f5[_0xedba('0x32')][_0xedba('0x1e')]);_0x15d7b3[_0xedba('0x1c')]=qs[_0xedba('0x1c')](_0x5a38f5['query'][_0xedba('0x1c')]);}return _0x590ddf['getSubjects'](_0x15d7b3);}})[_0xedba('0x25')](function(_0x27a6b0){if(_0x27a6b0){return _0x27a6b0?{'count':_0x1445a6,'rows':_0x27a6b0}:null;}})[_0xedba('0x25')](respondWithResult(_0x5c17bb,null))[_0xedba('0x44')](handleError(_0x5c17bb,null));};exports[_0xedba('0x4f')]=function(_0x1e3e05,_0x130612,_0x38b6b3){var _0x8b6357={};var _0x2f9e84={};var _0x4f98ed;var _0x151057;return db[_0xedba('0x2d')][_0xedba('0x4a')]({'where':{'id':_0x1e3e05[_0xedba('0x46')]['id']}})[_0xedba('0x25')](handleEntityNotFound(_0x130612,null))[_0xedba('0x25')](function(_0x110273){if(_0x110273){_0x4f98ed=_0x110273;_0x2f9e84[_0xedba('0x31')]=_[_0xedba('0x33')](db[_0xedba('0x4e')][_0xedba('0x2e')]);_0x2f9e84['query']=_[_0xedba('0x33')](_0x1e3e05['query']);_0x2f9e84[_0xedba('0x34')]=_[_0xedba('0x35')](_0x2f9e84[_0xedba('0x31')],_0x2f9e84[_0xedba('0x32')]);_0x8b6357[_0xedba('0x36')]=_['intersection'](_0x2f9e84[_0xedba('0x31')],qs['fields'](_0x1e3e05[_0xedba('0x32')][_0xedba('0x37')]));_0x8b6357[_0xedba('0x36')]=_0x8b6357['attributes']['length']?_0x8b6357[_0xedba('0x36')]:_0x2f9e84['model'];_0x8b6357[_0xedba('0x3b')]=qs[_0xedba('0x4b')](_0x1e3e05[_0xedba('0x32')][_0xedba('0x4b')]);_0x8b6357[_0xedba('0x3c')]=qs[_0xedba('0x34')](_[_0xedba('0x4c')](_0x1e3e05[_0xedba('0x32')],_0x2f9e84['filters']));if(_0x1e3e05[_0xedba('0x32')][_0xedba('0x3d')]){_0x8b6357[_0xedba('0x3c')]=_[_0xedba('0x3e')](_0x8b6357[_0xedba('0x3c')],{'$or':_[_0xedba('0x2c')](_0x8b6357[_0xedba('0x36')],function(_0x2d663c){var _0x1d6f00={};_0x1d6f00[_0x2d663c]={'$like':'%'+_0x1e3e05[_0xedba('0x32')][_0xedba('0x3d')]+'%'};return _0x1d6f00;})});}_0x8b6357=_[_0xedba('0x3e')]({},_0x8b6357,_0x1e3e05['options']);return _0x4f98ed[_0xedba('0x4f')](_0x8b6357);}})[_0xedba('0x25')](function(_0x33f0dc){if(_0x33f0dc){_0x151057=_0x33f0dc[_0xedba('0x38')];if(!_0x1e3e05[_0xedba('0x32')][_0xedba('0x39')](_0xedba('0x3a'))){_0x8b6357[_0xedba('0x1e')]=qs['limit'](_0x1e3e05['query'][_0xedba('0x1e')]);_0x8b6357[_0xedba('0x1c')]=qs[_0xedba('0x1c')](_0x1e3e05['query'][_0xedba('0x1c')]);}return _0x4f98ed['getDescriptions'](_0x8b6357);}})[_0xedba('0x25')](function(_0x26d1fb){if(_0x26d1fb){return _0x26d1fb?{'count':_0x151057,'rows':_0x26d1fb}:null;}})['then'](respondWithResult(_0x130612,null))[_0xedba('0x44')](handleError(_0x130612,null));}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5318b5d..f9d71a9 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 _0x008c=['define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x510b98,_0x4c4cbb){var _0x45e775=function(_0x29ec11){while(--_0x29ec11){_0x510b98['push'](_0x510b98['shift']());}};_0x45e775(++_0x4c4cbb);}(_0x008c,0x188));var _0xc008=function(_0x41b872,_0x4c4ef9){_0x41b872=_0x41b872-0x0;var _0x439768=_0x008c[_0x41b872];return _0x439768;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','util'];(function(_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 diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 9021ab4..3aac55b 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 _0x36a2=['request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1a7a12,_0x16f45a){var _0x53c66e=function(_0x404bb7){while(--_0x404bb7){_0x1a7a12['push'](_0x1a7a12['shift']());}};_0x53c66e(++_0x16f45a);}(_0x36a2,0x158));var _0x236a=function(_0x5b3e28,_0x2ad693){_0x5b3e28=_0x5b3e28-0x0;var _0x21a6f4=_0x36a2[_0x5b3e28];return _0x21a6f4;};'use strict';var _=require(_0x236a('0x0'));var util=require(_0x236a('0x1'));var moment=require(_0x236a('0x2'));var BPromise=require(_0x236a('0x3'));var rs=require(_0x236a('0x4'));var fs=require('fs');var Redis=require(_0x236a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x236a('0x6'));var logger=require(_0x236a('0x7'))(_0x236a('0x8'));var config=require(_0x236a('0x9'));var jayson=require(_0x236a('0xa'));var client=jayson[_0x236a('0xb')][_0x236a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x11685d,_0x224884,_0x2485bc){return new BPromise(function(_0x15b1db,_0x2a43e3){return client[_0x236a('0xd')](_0x11685d,_0x2485bc)[_0x236a('0xe')](function(_0x44edc4){logger[_0x236a('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x224884,_0x236a('0x10'));logger[_0x236a('0x11')](_0x236a('0x12'),_0x224884,_0x236a('0x10'),JSON[_0x236a('0x13')](_0x44edc4));if(_0x44edc4[_0x236a('0x14')]){if(_0x44edc4[_0x236a('0x14')]['code']===0x1f4){logger[_0x236a('0x14')](_0x236a('0x15'),_0x224884,_0x44edc4[_0x236a('0x14')]['message']);return _0x2a43e3(_0x44edc4[_0x236a('0x14')][_0x236a('0x16')]);}logger[_0x236a('0x14')](_0x236a('0x15'),_0x224884,_0x44edc4[_0x236a('0x14')]['message']);return _0x15b1db(_0x44edc4[_0x236a('0x14')][_0x236a('0x16')]);}else{logger['info'](_0x236a('0x15'),_0x224884,'request\x20sent');_0x15b1db(_0x44edc4['result'][_0x236a('0x16')]);}})[_0x236a('0x17')](function(_0x15cafa){logger[_0x236a('0x14')](_0x236a('0x15'),_0x224884,_0x15cafa);_0x2a43e3(_0x15cafa);});});} \ No newline at end of file +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 diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 374ea00..318a9c5 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 _0xcffe=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','index','post','isAuthenticated','create','put','/:id','delete','destroy','exports','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xcffe,0x197));var _0xecff=function(_0x3c2b2e,_0x3e6e53){_0x3c2b2e=_0x3c2b2e-0x0;var _0x27a338=_0xcffe[_0x3c2b2e];return _0x27a338;};'use strict';var multer=require('multer');var util=require(_0xecff('0x0'));var path=require(_0xecff('0x1'));var timeout=require('connect-timeout');var express=require(_0xecff('0x2'));var router=express['Router']();var fs_extra=require(_0xecff('0x3'));var auth=require(_0xecff('0x4'));var interaction=require(_0xecff('0x5'));var config=require('../../config/environment');var controller=require(_0xecff('0x6'));router[_0xecff('0x7')]('/',auth['isAuthenticated'](),controller[_0xecff('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0xecff('0x9')]('/',auth[_0xecff('0xa')](),controller[_0xecff('0xb')]);router[_0xecff('0xc')](_0xecff('0xd'),auth[_0xecff('0xa')](),controller['update']);router[_0xecff('0xe')](_0xecff('0xd'),auth[_0xecff('0xa')](),controller[_0xecff('0xf')]);module[_0xecff('0x10')]=router; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index eca9f98..f5590a8 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 _0x4021=['picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x1c0adf,_0x38fcc7){var _0x5fe2dd=function(_0x3e8764){while(--_0x3e8764){_0x1c0adf['push'](_0x1c0adf['shift']());}};_0x5fe2dd(++_0x38fcc7);}(_0x4021,0x1da));var _0x1402=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4021[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x1402('0x0'));module[_0x1402('0x1')]={'type':{'type':Sequelize[_0x1402('0x2')](_0x1402('0x3'),_0x1402('0x4'),'customVariable',_0x1402('0x5'),_0x1402('0x6')),'defaultValue':_0x1402('0x3')},'content':{'type':Sequelize[_0x1402('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x1402('0x2')](_0x1402('0x3'),_0x1402('0x4'),_0x1402('0x8'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1402('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1402('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1402('0x7')]}}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 8e69c5b..6b425f0 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 _0xcd18=['VIRTUAL','options','includeAll','include','findAll','params','length','find','create','body','catch','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','update','then','stack','name','send','index','Dynamics365Field','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge'];(function(_0x4a910e,_0x84df25){var _0xf60b33=function(_0x1a2895){while(--_0x1a2895){_0x4a910e['push'](_0x4a910e['shift']());}};_0xf60b33(++_0x84df25);}(_0xcd18,0x1e0));var _0x8cd1=function(_0x38af48,_0x400460){_0x38af48=_0x38af48-0x0;var _0x445384=_0xcd18[_0x38af48];return _0x445384;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cd1('0x0'));var zipdir=require(_0x8cd1('0x1'));var jsonpatch=require(_0x8cd1('0x2'));var rp=require('request-promise');var moment=require(_0x8cd1('0x3'));var BPromise=require(_0x8cd1('0x4'));var Mustache=require(_0x8cd1('0x5'));var util=require(_0x8cd1('0x6'));var path=require(_0x8cd1('0x7'));var sox=require(_0x8cd1('0x8'));var csv=require(_0x8cd1('0x9'));var ejs=require(_0x8cd1('0xa'));var fs=require('fs');var fs_extra=require(_0x8cd1('0xb'));var _=require(_0x8cd1('0xc'));var squel=require(_0x8cd1('0xd'));var crypto=require(_0x8cd1('0xe'));var jsforce=require(_0x8cd1('0xf'));var deskjs=require(_0x8cd1('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8cd1('0x11'));var Papa=require(_0x8cd1('0x12'));var Redis=require(_0x8cd1('0x13'));var authService=require(_0x8cd1('0x14'));var qs=require(_0x8cd1('0x15'));var as=require(_0x8cd1('0x16'));var hardwareService=require(_0x8cd1('0x17'));var logger=require(_0x8cd1('0x18'))('api');var utils=require(_0x8cd1('0x19'));var config=require(_0x8cd1('0x1a'));var licenseUtil=require(_0x8cd1('0x1b'));var db=require(_0x8cd1('0x1c'))['db'];function respondWithStatusCode(_0x25b551,_0x4ee61){_0x4ee61=_0x4ee61||0xcc;return function(_0xa3089b){if(_0xa3089b){return _0x25b551[_0x8cd1('0x1d')](_0x4ee61);}return _0x25b551[_0x8cd1('0x1e')](_0x4ee61)[_0x8cd1('0x1f')]();};}function respondWithResult(_0x2b46d0,_0x3e384d){_0x3e384d=_0x3e384d||0xc8;return function(_0x51d778){if(_0x51d778){return _0x2b46d0['status'](_0x3e384d)['json'](_0x51d778);}};}function respondWithFilteredResult(_0x32afca,_0x5d0f82){return function(_0x13943f){if(_0x13943f){var _0x3e3f5f=typeof _0x5d0f82[_0x8cd1('0x20')]===_0x8cd1('0x21')&&typeof _0x5d0f82[_0x8cd1('0x22')]===_0x8cd1('0x21');var _0x82e75d=_0x13943f[_0x8cd1('0x23')];var _0x4b9cfc=_0x3e3f5f?0x0:_0x5d0f82[_0x8cd1('0x20')];var _0x3617f8=_0x3e3f5f?_0x13943f[_0x8cd1('0x23')]:_0x5d0f82[_0x8cd1('0x20')]+_0x5d0f82['limit'];var _0x5ef69e;if(_0x3617f8>=_0x82e75d){_0x3617f8=_0x82e75d;_0x5ef69e=0xc8;}else{_0x5ef69e=0xce;}_0x32afca[_0x8cd1('0x1e')](_0x5ef69e);return _0x32afca[_0x8cd1('0x24')](_0x8cd1('0x25'),_0x4b9cfc+'-'+_0x3617f8+'/'+_0x82e75d)['json'](_0x13943f);}return null;};}function patchUpdates(_0x16ec16){return function(_0x3cc4d4){try{jsonpatch['apply'](_0x3cc4d4,_0x16ec16,!![]);}catch(_0x3932d2){return BPromise['reject'](_0x3932d2);}return _0x3cc4d4[_0x8cd1('0x26')]();};}function saveUpdates(_0x2fb138,_0x29ed2b){return function(_0x34ef90){if(_0x34ef90){return _0x34ef90[_0x8cd1('0x27')](_0x2fb138)[_0x8cd1('0x28')](function(_0x5d73c6){return _0x5d73c6;});}return null;};}function removeEntity(_0x4c4602,_0xed27b0){return function(_0x1c44a0){if(_0x1c44a0){return _0x1c44a0['destroy']()['then'](function(){_0x4c4602[_0x8cd1('0x1e')](0xcc)[_0x8cd1('0x1f')]();});}};}function handleEntityNotFound(_0x1926c2,_0x1ba9fd){return function(_0x35165b){if(!_0x35165b){_0x1926c2[_0x8cd1('0x1d')](0x194);}return _0x35165b;};}function handleError(_0xa44c8e,_0x298cfb){_0x298cfb=_0x298cfb||0x1f4;return function(_0xcc6225){logger['error'](_0xcc6225[_0x8cd1('0x29')]);if(_0xcc6225[_0x8cd1('0x2a')]){delete _0xcc6225[_0x8cd1('0x2a')];}_0xa44c8e[_0x8cd1('0x1e')](_0x298cfb)[_0x8cd1('0x2b')](_0xcc6225);};}exports[_0x8cd1('0x2c')]=function(_0x3d9ce5,_0x838f53){var _0x5d27b6={},_0x4ca6d3={},_0x511812={'count':0x0,'rows':[]};var _0x3e86c5=_['map'](db[_0x8cd1('0x2d')][_0x8cd1('0x2e')],function(_0x3005a9){return{'name':_0x3005a9[_0x8cd1('0x2f')],'type':_0x3005a9[_0x8cd1('0x30')][_0x8cd1('0x31')]};});_0x4ca6d3[_0x8cd1('0x32')]=_[_0x8cd1('0x33')](_0x3e86c5,'name');_0x4ca6d3[_0x8cd1('0x34')]=_[_0x8cd1('0x35')](_0x3d9ce5[_0x8cd1('0x34')]);_0x4ca6d3[_0x8cd1('0x36')]=_['intersection'](_0x4ca6d3[_0x8cd1('0x32')],_0x4ca6d3[_0x8cd1('0x34')]);_0x5d27b6['attributes']=_[_0x8cd1('0x37')](_0x4ca6d3[_0x8cd1('0x32')],qs[_0x8cd1('0x38')](_0x3d9ce5[_0x8cd1('0x34')][_0x8cd1('0x38')]));_0x5d27b6['attributes']=_0x5d27b6[_0x8cd1('0x39')]['length']?_0x5d27b6[_0x8cd1('0x39')]:_0x4ca6d3[_0x8cd1('0x32')];if(!_0x3d9ce5[_0x8cd1('0x34')][_0x8cd1('0x3a')](_0x8cd1('0x3b'))){_0x5d27b6[_0x8cd1('0x22')]=qs[_0x8cd1('0x22')](_0x3d9ce5[_0x8cd1('0x34')][_0x8cd1('0x22')]);_0x5d27b6[_0x8cd1('0x20')]=qs[_0x8cd1('0x20')](_0x3d9ce5['query'][_0x8cd1('0x20')]);}_0x5d27b6[_0x8cd1('0x3c')]=qs['sort'](_0x3d9ce5['query'][_0x8cd1('0x3d')]);_0x5d27b6['where']=qs[_0x8cd1('0x36')](_[_0x8cd1('0x3e')](_0x3d9ce5[_0x8cd1('0x34')],_0x4ca6d3[_0x8cd1('0x36')]),_0x3e86c5);if(_0x3d9ce5[_0x8cd1('0x34')][_0x8cd1('0x3f')]){_0x5d27b6[_0x8cd1('0x40')]=_[_0x8cd1('0x41')](_0x5d27b6[_0x8cd1('0x40')],{'$or':_[_0x8cd1('0x33')](_0x3e86c5,function(_0x50acb4){if(_0x50acb4[_0x8cd1('0x30')]!==_0x8cd1('0x42')){var _0x2a7485={};_0x2a7485[_0x50acb4[_0x8cd1('0x2a')]]={'$like':'%'+_0x3d9ce5[_0x8cd1('0x34')]['filter']+'%'};return _0x2a7485;}})});}_0x5d27b6=_[_0x8cd1('0x41')]({},_0x5d27b6,_0x3d9ce5[_0x8cd1('0x43')]);var _0x2d7b3d={'where':_0x5d27b6[_0x8cd1('0x40')]};return db[_0x8cd1('0x2d')][_0x8cd1('0x23')](_0x2d7b3d)[_0x8cd1('0x28')](function(_0x4dc857){_0x511812[_0x8cd1('0x23')]=_0x4dc857;if(_0x3d9ce5[_0x8cd1('0x34')][_0x8cd1('0x44')]){_0x5d27b6[_0x8cd1('0x45')]=[{'all':!![]}];}return db[_0x8cd1('0x2d')][_0x8cd1('0x46')](_0x5d27b6);})[_0x8cd1('0x28')](function(_0x5167a9){_0x511812['rows']=_0x5167a9;return _0x511812;})[_0x8cd1('0x28')](respondWithFilteredResult(_0x838f53,_0x5d27b6))['catch'](handleError(_0x838f53,null));};exports['show']=function(_0x3355de,_0x3a1e38){var _0x1fc32b={'raw':!![],'where':{'id':_0x3355de[_0x8cd1('0x47')]['id']}},_0xa3ca51={};_0xa3ca51[_0x8cd1('0x32')]=_['keys'](db[_0x8cd1('0x2d')][_0x8cd1('0x2e')]);_0xa3ca51['query']=_['keys'](_0x3355de[_0x8cd1('0x34')]);_0xa3ca51[_0x8cd1('0x36')]=_[_0x8cd1('0x37')](_0xa3ca51[_0x8cd1('0x32')],_0xa3ca51['query']);_0x1fc32b[_0x8cd1('0x39')]=_[_0x8cd1('0x37')](_0xa3ca51[_0x8cd1('0x32')],qs[_0x8cd1('0x38')](_0x3355de[_0x8cd1('0x34')][_0x8cd1('0x38')]));_0x1fc32b['attributes']=_0x1fc32b[_0x8cd1('0x39')][_0x8cd1('0x48')]?_0x1fc32b[_0x8cd1('0x39')]:_0xa3ca51[_0x8cd1('0x32')];if(_0x3355de[_0x8cd1('0x34')]['includeAll']){_0x1fc32b[_0x8cd1('0x45')]=[{'all':!![]}];}_0x1fc32b=_[_0x8cd1('0x41')]({},_0x1fc32b,_0x3355de[_0x8cd1('0x43')]);return db['Dynamics365Field'][_0x8cd1('0x49')](_0x1fc32b)[_0x8cd1('0x28')](handleEntityNotFound(_0x3a1e38,null))[_0x8cd1('0x28')](respondWithResult(_0x3a1e38,null))['catch'](handleError(_0x3a1e38,null));};exports[_0x8cd1('0x4a')]=function(_0xa8367,_0x21831b){return db[_0x8cd1('0x2d')][_0x8cd1('0x4a')](_0xa8367[_0x8cd1('0x4b')],{})['then'](respondWithResult(_0x21831b,0xc9))[_0x8cd1('0x4c')](handleError(_0x21831b,null));};exports['update']=function(_0x4d5e26,_0x2040cc){if(_0x4d5e26['body']['id']){delete _0x4d5e26[_0x8cd1('0x4b')]['id'];}return db[_0x8cd1('0x2d')][_0x8cd1('0x49')]({'where':{'id':_0x4d5e26[_0x8cd1('0x47')]['id']}})[_0x8cd1('0x28')](handleEntityNotFound(_0x2040cc,null))[_0x8cd1('0x28')](saveUpdates(_0x4d5e26['body'],null))[_0x8cd1('0x28')](respondWithResult(_0x2040cc,null))[_0x8cd1('0x4c')](handleError(_0x2040cc,null));};exports[_0x8cd1('0x4d')]=function(_0x4a0bea,_0x9124d2){return db[_0x8cd1('0x2d')][_0x8cd1('0x49')]({'where':{'id':_0x4a0bea['params']['id']}})[_0x8cd1('0x28')](handleEntityNotFound(_0x9124d2,null))[_0x8cd1('0x28')](removeEntity(_0x9124d2,null))[_0x8cd1('0x4c')](handleError(_0x9124d2,null));}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index c005861..5d6b972 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 _0x3031=['int_dynamics365_fields','util','../../config/logger','api','moment','path','rimraf','./intDynamics365Field.attributes','Dynamics365Field'];(function(_0x163977,_0x4ef72e){var _0x28bf3a=function(_0x16f38a){while(--_0x16f38a){_0x163977['push'](_0x163977['shift']());}};_0x28bf3a(++_0x4ef72e);}(_0x3031,0x1e7));var _0x1303=function(_0x5e3403,_0x2d159e){_0x5e3403=_0x5e3403-0x0;var _0x33b779=_0x3031[_0x5e3403];return _0x33b779;};'use strict';var _=require('lodash');var util=require(_0x1303('0x0'));var logger=require(_0x1303('0x1'))(_0x1303('0x2'));var moment=require(_0x1303('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1303('0x4'));var rimraf=require(_0x1303('0x5'));var config=require('../../config/environment');var attributes=require(_0x1303('0x6'));module['exports']=function(_0x20afbd,_0x2bdebf){return _0x20afbd['define'](_0x1303('0x7'),attributes,{'tableName':_0x1303('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index b64ccc3..8fb83d7 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 _0x0d0a=['catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x5737ae,_0x5d58c8){var _0xdccc1a=function(_0x221c15){while(--_0x221c15){_0x5737ae['push'](_0x5737ae['shift']());}};_0xdccc1a(++_0x5d58c8);}(_0x0d0a,0x8d));var _0xa0d0=function(_0x16ae97,_0x4287f1){_0x16ae97=_0x16ae97-0x0;var _0x460302=_0x0d0a[_0x16ae97];return _0x460302;};'use strict';var _=require('lodash');var util=require(_0xa0d0('0x0'));var moment=require('moment');var BPromise=require(_0xa0d0('0x1'));var rs=require(_0xa0d0('0x2'));var fs=require('fs');var Redis=require(_0xa0d0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa0d0('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa0d0('0x5'));var jayson=require(_0xa0d0('0x6'));var client=jayson[_0xa0d0('0x7')][_0xa0d0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xefb2d8,_0x35ebd1,_0x9be6a1){return new BPromise(function(_0x30d784,_0x249c96){return client[_0xa0d0('0x9')](_0xefb2d8,_0x9be6a1)[_0xa0d0('0xa')](function(_0x1ad8e9){logger[_0xa0d0('0xb')](_0xa0d0('0xc'),_0x35ebd1,_0xa0d0('0xd'));logger[_0xa0d0('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x35ebd1,'request\x20sent',JSON[_0xa0d0('0xf')](_0x1ad8e9));if(_0x1ad8e9[_0xa0d0('0x10')]){if(_0x1ad8e9[_0xa0d0('0x10')]['code']===0x1f4){logger['error'](_0xa0d0('0xc'),_0x35ebd1,_0x1ad8e9[_0xa0d0('0x10')][_0xa0d0('0x11')]);return _0x249c96(_0x1ad8e9[_0xa0d0('0x10')][_0xa0d0('0x11')]);}logger[_0xa0d0('0x10')](_0xa0d0('0xc'),_0x35ebd1,_0x1ad8e9[_0xa0d0('0x10')][_0xa0d0('0x11')]);return _0x30d784(_0x1ad8e9[_0xa0d0('0x10')][_0xa0d0('0x11')]);}else{logger[_0xa0d0('0xb')](_0xa0d0('0xc'),_0x35ebd1,_0xa0d0('0xd'));_0x30d784(_0x1ad8e9[_0xa0d0('0x12')][_0xa0d0('0x11')]);}})[_0xa0d0('0x13')](function(_0x3be317){logger['error'](_0xa0d0('0xc'),_0x35ebd1,_0x3be317);_0x249c96(_0x3be317);});});} \ No newline at end of file +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 diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 60f241d..849836b 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 _0xe093=['./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0xe093,0x75));var _0x3e09=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xe093[_0x1beef3];return _0x5af964;};'use strict';var multer=require(_0x3e09('0x0'));var util=require(_0x3e09('0x1'));var path=require(_0x3e09('0x2'));var timeout=require(_0x3e09('0x3'));var express=require(_0x3e09('0x4'));var router=express[_0x3e09('0x5')]();var fs_extra=require(_0x3e09('0x6'));var auth=require(_0x3e09('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e09('0x8'));router[_0x3e09('0x9')]('/',auth[_0x3e09('0xa')](),controller[_0x3e09('0xb')]);router[_0x3e09('0x9')](_0x3e09('0xc'),auth[_0x3e09('0xa')](),controller[_0x3e09('0xd')]);router[_0x3e09('0x9')]('/:id/configurations',auth[_0x3e09('0xa')](),controller[_0x3e09('0xe')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x3e09('0xf')]);router[_0x3e09('0x10')]('/',auth['isAuthenticated'](),controller[_0x3e09('0x11')]);router['post'](_0x3e09('0x12'),auth[_0x3e09('0xa')](),controller[_0x3e09('0x13')]);router[_0x3e09('0x14')](_0x3e09('0xc'),auth[_0x3e09('0xa')](),controller[_0x3e09('0x15')]);router[_0x3e09('0x16')]('/:id',auth[_0x3e09('0xa')](),controller[_0x3e09('0x17')]);module[_0x3e09('0x18')]=router; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index a39e51a..c55af25 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 _0xb10b=['remoteUri','sequelize','STRING'];(function(_0xc0d498,_0x268586){var _0x486115=function(_0x4b0307){while(--_0x4b0307){_0xc0d498['push'](_0xc0d498['shift']());}};_0x486115(++_0x268586);}(_0xb10b,0x12a));var _0xbb10=function(_0x28c1c0,_0x2398aa){_0x28c1c0=_0x28c1c0-0x0;var _0x2ff1e3=_0xb10b[_0x28c1c0];return _0x2ff1e3;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')]},'description':{'type':Sequelize[_0xbb10('0x1')]},'username':{'type':Sequelize[_0xbb10('0x1')],'unique':'username'},'apiKey':{'type':Sequelize[_0xbb10('0x1')]},'remoteUri':{'type':Sequelize[_0xbb10('0x1')],'unique':_0xbb10('0x2')},'serverUrl':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index e90c344..bc8fd95 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 _0x7daf=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','apiKey','substring','lastIndexOf','format','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','priority','group','source','ticket_type','company','includes','default','custom_text','custom_dropdown','choices','capitalize','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','statusCode','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','FreshdeskAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x105356,_0x540294){var _0x310604=function(_0x188dab){while(--_0x188dab){_0x105356['push'](_0x105356['shift']());}};_0x310604(++_0x540294);}(_0x7daf,0xaa));var _0xf7da=function(_0x416c50,_0x974ac7){_0x416c50=_0x416c50-0x0;var _0x596d03=_0x7daf[_0x416c50];return _0x596d03;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf7da('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf7da('0x1'));var rp=require(_0xf7da('0x2'));var moment=require('moment');var BPromise=require(_0xf7da('0x3'));var Mustache=require(_0xf7da('0x4'));var util=require(_0xf7da('0x5'));var path=require(_0xf7da('0x6'));var sox=require(_0xf7da('0x7'));var csv=require('to-csv');var ejs=require(_0xf7da('0x8'));var fs=require('fs');var fs_extra=require(_0xf7da('0x9'));var _=require(_0xf7da('0xa'));var squel=require(_0xf7da('0xb'));var crypto=require(_0xf7da('0xc'));var jsforce=require(_0xf7da('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf7da('0xe'));var querystring=require(_0xf7da('0xf'));var Papa=require(_0xf7da('0x10'));var Redis=require(_0xf7da('0x11'));var authService=require(_0xf7da('0x12'));var qs=require(_0xf7da('0x13'));var as=require(_0xf7da('0x14'));var hardwareService=require(_0xf7da('0x15'));var logger=require(_0xf7da('0x16'))(_0xf7da('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf7da('0x18'));var db=require(_0xf7da('0x19'))['db'];var integrations=require(_0xf7da('0x1a'));function respondWithStatusCode(_0x392244,_0x2da6bd){_0x2da6bd=_0x2da6bd||0xcc;return function(_0x2dcc1c){if(_0x2dcc1c){return _0x392244['sendStatus'](_0x2da6bd);}return _0x392244[_0xf7da('0x1b')](_0x2da6bd)[_0xf7da('0x1c')]();};}function respondWithResult(_0x5bfc67,_0x1958dd){_0x1958dd=_0x1958dd||0xc8;return function(_0x59715){if(_0x59715){return _0x5bfc67[_0xf7da('0x1b')](_0x1958dd)[_0xf7da('0x1d')](_0x59715);}};}function respondWithFilteredResult(_0xe82d40,_0x26f112){return function(_0x4f5afa){if(_0x4f5afa){var _0x54bc0b=typeof _0x26f112['offset']===_0xf7da('0x1e')&&typeof _0x26f112[_0xf7da('0x1f')]===_0xf7da('0x1e');var _0x4554e8=_0x4f5afa[_0xf7da('0x20')];var _0x1f3d53=_0x54bc0b?0x0:_0x26f112[_0xf7da('0x21')];var _0x13cd4a=_0x54bc0b?_0x4f5afa[_0xf7da('0x20')]:_0x26f112[_0xf7da('0x21')]+_0x26f112[_0xf7da('0x1f')];var _0x183ca5;if(_0x13cd4a>=_0x4554e8){_0x13cd4a=_0x4554e8;_0x183ca5=0xc8;}else{_0x183ca5=0xce;}_0xe82d40[_0xf7da('0x1b')](_0x183ca5);return _0xe82d40[_0xf7da('0x22')]('Content-Range',_0x1f3d53+'-'+_0x13cd4a+'/'+_0x4554e8)[_0xf7da('0x1d')](_0x4f5afa);}return null;};}function patchUpdates(_0x3b0913){return function(_0x3810f7){try{jsonpatch[_0xf7da('0x23')](_0x3810f7,_0x3b0913,!![]);}catch(_0x45e6d3){return BPromise[_0xf7da('0x24')](_0x45e6d3);}return _0x3810f7[_0xf7da('0x25')]();};}function saveUpdates(_0x35ac94,_0x3affce){return function(_0x5f48c9){if(_0x5f48c9){return _0x5f48c9[_0xf7da('0x26')](_0x35ac94)[_0xf7da('0x27')](function(_0x265192){return _0x265192;});}return null;};}function removeEntity(_0x4b627e,_0x3bf5d1){return function(_0x1e3d68){if(_0x1e3d68){return _0x1e3d68[_0xf7da('0x28')]()[_0xf7da('0x27')](function(){_0x4b627e[_0xf7da('0x1b')](0xcc)[_0xf7da('0x1c')]();});}};}function handleEntityNotFound(_0x5a9866,_0x1aadd8){return function(_0x3eb470){if(!_0x3eb470){_0x5a9866[_0xf7da('0x29')](0x194);}return _0x3eb470;};}function handleError(_0x583bfc,_0x13ace4){_0x13ace4=_0x13ace4||0x1f4;return function(_0x2c75c4){logger[_0xf7da('0x2a')](_0x2c75c4[_0xf7da('0x2b')]);if(_0x2c75c4[_0xf7da('0x2c')]){delete _0x2c75c4['name'];}_0x583bfc[_0xf7da('0x1b')](_0x13ace4)['send'](_0x2c75c4);};}exports[_0xf7da('0x2d')]=function(_0xdaef0d,_0x1dfcc5){var _0x23a27e={},_0x509330={},_0x1356ed={'count':0x0,'rows':[]};var _0x3b82f5=_[_0xf7da('0x2e')](db[_0xf7da('0x2f')][_0xf7da('0x30')],function(_0xccc6cb){return{'name':_0xccc6cb[_0xf7da('0x31')],'type':_0xccc6cb[_0xf7da('0x32')]['key']};});_0x509330[_0xf7da('0x33')]=_[_0xf7da('0x2e')](_0x3b82f5,_0xf7da('0x2c'));_0x509330[_0xf7da('0x34')]=_[_0xf7da('0x35')](_0xdaef0d['query']);_0x509330[_0xf7da('0x36')]=_[_0xf7da('0x37')](_0x509330['model'],_0x509330[_0xf7da('0x34')]);_0x23a27e['attributes']=_[_0xf7da('0x37')](_0x509330[_0xf7da('0x33')],qs[_0xf7da('0x38')](_0xdaef0d[_0xf7da('0x34')][_0xf7da('0x38')]));_0x23a27e[_0xf7da('0x39')]=_0x23a27e['attributes'][_0xf7da('0x3a')]?_0x23a27e[_0xf7da('0x39')]:_0x509330[_0xf7da('0x33')];if(!_0xdaef0d['query']['hasOwnProperty'](_0xf7da('0x3b'))){_0x23a27e['limit']=qs['limit'](_0xdaef0d['query']['limit']);_0x23a27e[_0xf7da('0x21')]=qs['offset'](_0xdaef0d[_0xf7da('0x34')]['offset']);}_0x23a27e[_0xf7da('0x3c')]=qs['sort'](_0xdaef0d[_0xf7da('0x34')][_0xf7da('0x3d')]);_0x23a27e[_0xf7da('0x3e')]=qs[_0xf7da('0x36')](_[_0xf7da('0x3f')](_0xdaef0d['query'],_0x509330[_0xf7da('0x36')]),_0x3b82f5);if(_0xdaef0d[_0xf7da('0x34')][_0xf7da('0x40')]){_0x23a27e[_0xf7da('0x3e')]=_[_0xf7da('0x41')](_0x23a27e[_0xf7da('0x3e')],{'$or':_['map'](_0x3b82f5,function(_0x152da6){if(_0x152da6[_0xf7da('0x32')]!==_0xf7da('0x42')){var _0x4212e4={};_0x4212e4[_0x152da6[_0xf7da('0x2c')]]={'$like':'%'+_0xdaef0d['query'][_0xf7da('0x40')]+'%'};return _0x4212e4;}})});}_0x23a27e=_[_0xf7da('0x41')]({},_0x23a27e,_0xdaef0d[_0xf7da('0x43')]);var _0x56a23d={'where':_0x23a27e[_0xf7da('0x3e')]};return db['FreshdeskAccount']['count'](_0x56a23d)['then'](function(_0x68e872){_0x1356ed[_0xf7da('0x20')]=_0x68e872;if(_0xdaef0d[_0xf7da('0x34')][_0xf7da('0x44')]){_0x23a27e[_0xf7da('0x45')]=[{'all':!![]}];}return db[_0xf7da('0x2f')][_0xf7da('0x46')](_0x23a27e);})[_0xf7da('0x27')](function(_0x29494c){_0x1356ed[_0xf7da('0x47')]=_0x29494c;return _0x1356ed;})[_0xf7da('0x27')](respondWithFilteredResult(_0x1dfcc5,_0x23a27e))[_0xf7da('0x48')](handleError(_0x1dfcc5,null));};exports[_0xf7da('0x49')]=function(_0x351031,_0x837154){var _0x5c9235={'raw':![],'where':{'id':_0x351031[_0xf7da('0x4a')]['id']}},_0x2c831d={};_0x2c831d['model']=_[_0xf7da('0x35')](db[_0xf7da('0x2f')][_0xf7da('0x30')]);_0x2c831d[_0xf7da('0x34')]=_['keys'](_0x351031[_0xf7da('0x34')]);_0x2c831d['filters']=_[_0xf7da('0x37')](_0x2c831d[_0xf7da('0x33')],_0x2c831d[_0xf7da('0x34')]);_0x5c9235[_0xf7da('0x39')]=_[_0xf7da('0x37')](_0x2c831d[_0xf7da('0x33')],qs[_0xf7da('0x38')](_0x351031[_0xf7da('0x34')][_0xf7da('0x38')]));_0x5c9235[_0xf7da('0x39')]=_0x5c9235['attributes'][_0xf7da('0x3a')]?_0x5c9235[_0xf7da('0x39')]:_0x2c831d['model'];if(_0x351031[_0xf7da('0x34')][_0xf7da('0x44')]){_0x5c9235[_0xf7da('0x45')]=[{'all':!![]}];}_0x5c9235=_[_0xf7da('0x41')]({},_0x5c9235,_0x351031['options']);return db[_0xf7da('0x2f')][_0xf7da('0x4b')](_0x5c9235)[_0xf7da('0x27')](handleEntityNotFound(_0x837154,null))[_0xf7da('0x27')](respondWithResult(_0x837154,null))[_0xf7da('0x48')](handleError(_0x837154,null));};exports['create']=function(_0x2df8aa,_0xdb5c40){return db[_0xf7da('0x2f')][_0xf7da('0x4c')](_0x2df8aa[_0xf7da('0x4d')],{})[_0xf7da('0x27')](respondWithResult(_0xdb5c40,0xc9))[_0xf7da('0x48')](handleError(_0xdb5c40,null));};exports[_0xf7da('0x26')]=function(_0x27bfe2,_0x241e35){if(_0x27bfe2[_0xf7da('0x4d')]['id']){delete _0x27bfe2[_0xf7da('0x4d')]['id'];}return db['FreshdeskAccount'][_0xf7da('0x4b')]({'where':{'id':_0x27bfe2[_0xf7da('0x4a')]['id']}})['then'](handleEntityNotFound(_0x241e35,null))[_0xf7da('0x27')](saveUpdates(_0x27bfe2[_0xf7da('0x4d')],null))[_0xf7da('0x27')](respondWithResult(_0x241e35,null))['catch'](handleError(_0x241e35,null));};exports[_0xf7da('0x28')]=function(_0x34506a,_0x4b0255){return db[_0xf7da('0x2f')][_0xf7da('0x4b')]({'where':{'id':_0x34506a[_0xf7da('0x4a')]['id']}})[_0xf7da('0x27')](handleEntityNotFound(_0x4b0255,null))[_0xf7da('0x27')](removeEntity(_0x4b0255,null))[_0xf7da('0x48')](handleError(_0x4b0255,null));};exports[_0xf7da('0x4e')]=function(_0x125310,_0x176780,_0x4425f0){var _0x3a1025={};var _0x558736={};var _0x1986b5;var _0x6a3b1f;return db[_0xf7da('0x2f')][_0xf7da('0x4f')]({'where':{'id':_0x125310[_0xf7da('0x4a')]['id']}})['then'](handleEntityNotFound(_0x176780,null))[_0xf7da('0x27')](function(_0x3bec85){if(_0x3bec85){_0x1986b5=_0x3bec85;_0x558736[_0xf7da('0x33')]=_['keys'](db[_0xf7da('0x50')][_0xf7da('0x30')]);_0x558736['query']=_['keys'](_0x125310[_0xf7da('0x34')]);_0x558736['filters']=_[_0xf7da('0x37')](_0x558736['model'],_0x558736['query']);_0x3a1025[_0xf7da('0x39')]=_[_0xf7da('0x37')](_0x558736[_0xf7da('0x33')],qs[_0xf7da('0x38')](_0x125310[_0xf7da('0x34')][_0xf7da('0x38')]));_0x3a1025[_0xf7da('0x39')]=_0x3a1025[_0xf7da('0x39')]['length']?_0x3a1025[_0xf7da('0x39')]:_0x558736[_0xf7da('0x33')];_0x3a1025[_0xf7da('0x3c')]=qs[_0xf7da('0x3d')](_0x125310['query'][_0xf7da('0x3d')]);_0x3a1025[_0xf7da('0x3e')]=qs[_0xf7da('0x36')](_['pick'](_0x125310[_0xf7da('0x34')],_0x558736[_0xf7da('0x36')]));if(_0x125310[_0xf7da('0x34')][_0xf7da('0x40')]){_0x3a1025['where']=_[_0xf7da('0x41')](_0x3a1025[_0xf7da('0x3e')],{'$or':_[_0xf7da('0x2e')](_0x3a1025[_0xf7da('0x39')],function(_0x4b9b13){var _0x48b89d={};_0x48b89d[_0x4b9b13]={'$like':'%'+_0x125310[_0xf7da('0x34')]['filter']+'%'};return _0x48b89d;})});}_0x3a1025=_['merge']({},_0x3a1025,_0x125310[_0xf7da('0x43')]);return _0x1986b5[_0xf7da('0x4e')](_0x3a1025);}})[_0xf7da('0x27')](function(_0x24aef6){if(_0x24aef6){_0x6a3b1f=_0x24aef6['length'];if(!_0x125310['query'][_0xf7da('0x51')](_0xf7da('0x3b'))){_0x3a1025[_0xf7da('0x1f')]=qs[_0xf7da('0x1f')](_0x125310[_0xf7da('0x34')][_0xf7da('0x1f')]);_0x3a1025[_0xf7da('0x21')]=qs[_0xf7da('0x21')](_0x125310['query']['offset']);}return _0x1986b5[_0xf7da('0x4e')](_0x3a1025);}})[_0xf7da('0x27')](function(_0x28f1fe){if(_0x28f1fe){return _0x28f1fe?{'count':_0x6a3b1f,'rows':_0x28f1fe}:null;}})['then'](respondWithResult(_0x176780,null))['catch'](handleError(_0x176780,null));};exports[_0xf7da('0x52')]=function(_0x68335f,_0x524b40,_0x1ebb43){if(_0x68335f['body']['id']){delete _0x68335f[_0xf7da('0x4d')]['id'];}return db[_0xf7da('0x2f')][_0xf7da('0x4f')]({'where':{'id':_0x68335f[_0xf7da('0x4a')]['id']}})['then'](handleEntityNotFound(_0x524b40,null))[_0xf7da('0x27')](function(_0x1a1c32){if(_0x1a1c32){_0x68335f[_0xf7da('0x4d')][_0xf7da('0x53')]=_0x1a1c32['id'];_0x68335f[_0xf7da('0x4d')][_0xf7da('0x54')]=integrations[_0xf7da('0x55')](_0x68335f['body'][_0xf7da('0x56')],_0x68335f[_0xf7da('0x4d')][_0xf7da('0x32')]);_0x68335f[_0xf7da('0x4d')][_0xf7da('0x57')]=integrations[_0xf7da('0x58')](_0x68335f['body']['channel'],_0x68335f[_0xf7da('0x4d')][_0xf7da('0x32')]);return db['FreshdeskConfiguration']['create'](_0x68335f['body'],{'include':[{'model':db[_0xf7da('0x59')],'as':'Subjects'},{'model':db[_0xf7da('0x59')],'as':_0xf7da('0x57')}]});}return null;})[_0xf7da('0x27')](respondWithResult(_0x524b40,null))[_0xf7da('0x48')](handleError(_0x524b40,null));};exports['getFields']=function(_0x5329c1,_0x224dcf,_0x6c6b95){var _0x52396c='';return db['FreshdeskAccount'][_0xf7da('0x4f')]({'where':{'id':_0x5329c1[_0xf7da('0x4a')]['id']},'attributes':['id','remoteUri',_0xf7da('0x5a')]})['then'](handleEntityNotFound(_0x224dcf,null))[_0xf7da('0x27')](function(_0x122c10){if(_0x122c10){_0x52396c=_0x122c10['remoteUri'];var _0x22412b=_0x52396c['slice'](-0x1);if(_0x22412b==='/'){_0x52396c=_0x52396c[_0xf7da('0x5b')](0x0,_0x52396c[_0xf7da('0x5c')](_0x22412b));}return rp({'method':'GET','uri':util[_0xf7da('0x5d')]('%s/%s',_0x52396c,_0xf7da('0x5e')),'headers':{'Authorization':util[_0xf7da('0x5d')]('Basic\x20%s',new Buffer(util['format'](_0xf7da('0x5f'),_0x122c10[_0xf7da('0x5a')]))[_0xf7da('0x60')](_0xf7da('0x61')))},'json':!![]});}})[_0xf7da('0x27')](function(_0x533cb8){if(_0x533cb8){var _0x27c2fc=['requester',_0xf7da('0x62'),_0xf7da('0x63'),'description','status',_0xf7da('0x64'),_0xf7da('0x65'),_0xf7da('0x66'),_0xf7da('0x67'),_0xf7da('0x65'),_0xf7da('0x68')];_['remove'](_0x533cb8,function(_0x1673f0){return _0x27c2fc[_0xf7da('0x69')](_0x1673f0[_0xf7da('0x2c')])||!_0x1673f0[_0xf7da('0x6a')]&&_0x1673f0['type']!==_0xf7da('0x6b')&&_0x1673f0[_0xf7da('0x32')]!==_0xf7da('0x6c');});return{'count':_0x533cb8[_0xf7da('0x3a')],'rows':_[_0xf7da('0x2e')](_0x533cb8,function(_0x32ee23){return{'id':_0x32ee23[_0xf7da('0x2c')],'name':_0x32ee23['label'],'custom':!_0x32ee23[_0xf7da('0x6a')],'options':_0x32ee23['choices']?_['map'](_0x32ee23[_0xf7da('0x6d')],function(_0x294ff5){return{'name':_[_0xf7da('0x6e')](_0x294ff5),'value':_0x294ff5};}):[]};})};}})[_0xf7da('0x27')](respondWithResult(_0x224dcf,null))[_0xf7da('0x48')](function(_0xe8610e){var _0x2067a5=_0x5329c1['query'][_0xf7da('0x6f')]?0x1f4:_0xe8610e['statusCode']||0x1f4;logger[_0xf7da('0x2a')](_0xf7da('0x70'),_0xf7da('0x71'),_0x2067a5,JSON[_0xf7da('0x72')](_0xe8610e));delete _0xe8610e['name'];if(_0x2067a5===0x191){_0x2067a5=0x190;}_0x224dcf[_0xf7da('0x1b')](_0x2067a5)[_0xf7da('0x73')](_0x5329c1[_0xf7da('0x34')][_0xf7da('0x6f')]?{'message':_0xf7da('0x74'),'statusCode':_0xe8610e[_0xf7da('0x75')]}:_0xe8610e);});}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index f2ef5bd..9a24410 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 _0x2018=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshdeskAccount.attributes','../../components/integrations/configuration','define','FreshdeskAccount','int_freshdesk_accounts'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x2018,0x12c));var _0x8201=function(_0x4df94b,_0x1169a5){_0x4df94b=_0x4df94b-0x0;var _0x3fb6b4=_0x2018[_0x4df94b];return _0x3fb6b4;};'use strict';var _=require(_0x8201('0x0'));var util=require('util');var logger=require(_0x8201('0x1'))(_0x8201('0x2'));var moment=require(_0x8201('0x3'));var BPromise=require(_0x8201('0x4'));var rp=require(_0x8201('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8201('0x6'));var config=require('../../config/environment');var attributes=require(_0x8201('0x7'));var integrations=require(_0x8201('0x8'));module['exports']=function(_0x136a53,_0x1c8094){return _0x136a53[_0x8201('0x9')](_0x8201('0xa'),attributes,{'tableName':_0x8201('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 3debf0d..24055a6 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 _0x4fb3=['catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowFreshdeskAccount','find','util','../../config/utils','../../config/environment','jayson/promise','http','then','info','debug','request\x20sent','error','code','message','FreshdeskAccount,\x20%s,\x20%s','result'];(function(_0xebc073,_0x12c063){var _0x21b213=function(_0xc550ed){while(--_0xc550ed){_0xebc073['push'](_0xebc073['shift']());}};_0x21b213(++_0x12c063);}(_0x4fb3,0xbd));var _0x34fb=function(_0x1bc68f,_0x3e28bd){_0x1bc68f=_0x1bc68f-0x0;var _0x229946=_0x4fb3[_0x1bc68f];return _0x229946;};'use strict';var _=require('lodash');var util=require(_0x34fb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x34fb('0x1'));var logger=require('../../config/logger')('rpc');var config=require(_0x34fb('0x2'));var jayson=require(_0x34fb('0x3'));var client=jayson['client'][_0x34fb('0x4')]({'port':0x232a});function respondWithRpcPromise(_0x555ecd,_0x407150,_0x4ac14e){return new BPromise(function(_0x5a1766,_0x40b6b8){return client['request'](_0x555ecd,_0x4ac14e)[_0x34fb('0x5')](function(_0x2a9a7a){logger[_0x34fb('0x6')]('FreshdeskAccount,\x20%s,\x20%s',_0x407150,'request\x20sent');logger[_0x34fb('0x7')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x407150,_0x34fb('0x8'),JSON['stringify'](_0x2a9a7a));if(_0x2a9a7a['error']){if(_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xa')]===0x1f4){logger[_0x34fb('0x9')]('FreshdeskAccount,\x20%s,\x20%s',_0x407150,_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xb')]);return _0x40b6b8(_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xb')]);}logger['error'](_0x34fb('0xc'),_0x407150,_0x2a9a7a[_0x34fb('0x9')]['message']);return _0x5a1766(_0x2a9a7a[_0x34fb('0x9')][_0x34fb('0xb')]);}else{logger[_0x34fb('0x6')]('FreshdeskAccount,\x20%s,\x20%s',_0x407150,_0x34fb('0x8'));_0x5a1766(_0x2a9a7a[_0x34fb('0xd')][_0x34fb('0xb')]);}})[_0x34fb('0xe')](function(_0x3c10c1){logger[_0x34fb('0x9')](_0x34fb('0xc'),_0x407150,_0x3c10c1);_0x40b6b8(_0x3c10c1);});});}exports[_0x34fb('0xf')]=function(_0x13dd9d){var _0x5f5034=this;return new Promise(function(_0x499abe,_0x5e58e){return db[_0x34fb('0x10')][_0x34fb('0x11')]({'raw':_0x13dd9d[_0x34fb('0x12')]?_0x13dd9d[_0x34fb('0x12')][_0x34fb('0x13')]===undefined?!![]:![]:!![],'where':_0x13dd9d[_0x34fb('0x12')]?_0x13dd9d['options'][_0x34fb('0x14')]||null:null,'attributes':_0x13dd9d[_0x34fb('0x12')]?_0x13dd9d['options'][_0x34fb('0x15')]||null:null,'limit':_0x13dd9d[_0x34fb('0x12')]?_0x13dd9d['options'][_0x34fb('0x16')]||null:null,'include':_0x13dd9d[_0x34fb('0x12')]?_0x13dd9d[_0x34fb('0x12')][_0x34fb('0x17')]?_[_0x34fb('0x18')](_0x13dd9d['options'][_0x34fb('0x17')],function(_0x2ba659){return{'model':db[_0x2ba659[_0x34fb('0x19')]],'as':_0x2ba659['as'],'attributes':_0x2ba659[_0x34fb('0x15')],'include':_0x2ba659[_0x34fb('0x17')]?_['map'](_0x2ba659[_0x34fb('0x17')],function(_0x2fbf72){return{'model':db[_0x2fbf72[_0x34fb('0x19')]],'as':_0x2fbf72['as'],'attributes':_0x2fbf72[_0x34fb('0x15')],'include':_0x2fbf72['include']?_['map'](_0x2fbf72['include'],function(_0x1ab513){return{'model':db[_0x1ab513['model']],'as':_0x1ab513['as'],'attributes':_0x1ab513[_0x34fb('0x15')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2896aa){logger['info'](_0x34fb('0xf'),_0x13dd9d);logger[_0x34fb('0x7')](_0x34fb('0xf'),_0x13dd9d,JSON[_0x34fb('0x1a')](_0x2896aa));_0x499abe(_0x2896aa);})[_0x34fb('0xe')](function(_0x5e3c76){logger[_0x34fb('0x9')]('GetFreshdeskAccount',_0x5e3c76[_0x34fb('0xb')],_0x13dd9d);_0x5e58e(_0x5f5034[_0x34fb('0x9')](0x1f4,_0x5e3c76[_0x34fb('0xb')]));});});};exports[_0x34fb('0x1b')]=function(_0x253bd8){var _0x441d53=this;return new Promise(function(_0x353ef3,_0x296b97){return db['FreshdeskAccount'][_0x34fb('0x1c')]({'raw':_0x253bd8[_0x34fb('0x12')]?_0x253bd8[_0x34fb('0x12')][_0x34fb('0x13')]===undefined?!![]:![]:!![],'where':_0x253bd8[_0x34fb('0x12')]?_0x253bd8[_0x34fb('0x12')]['where']||null:null,'attributes':_0x253bd8[_0x34fb('0x12')]?_0x253bd8[_0x34fb('0x12')][_0x34fb('0x15')]||null:null,'include':_0x253bd8[_0x34fb('0x12')]?_0x253bd8[_0x34fb('0x12')][_0x34fb('0x17')]?_[_0x34fb('0x18')](_0x253bd8['options'][_0x34fb('0x17')],function(_0x24ae4d){return{'model':db[_0x24ae4d['model']],'as':_0x24ae4d['as'],'attributes':_0x24ae4d[_0x34fb('0x15')],'include':_0x24ae4d['include']?_['map'](_0x24ae4d['include'],function(_0x45e670){return{'model':db[_0x45e670['model']],'as':_0x45e670['as'],'attributes':_0x45e670[_0x34fb('0x15')],'include':_0x45e670['include']?_[_0x34fb('0x18')](_0x45e670['include'],function(_0x1ac366){return{'model':db[_0x1ac366[_0x34fb('0x19')]],'as':_0x1ac366['as'],'attributes':_0x1ac366[_0x34fb('0x15')]};}):[]};}):[]};}):[]:[]})[_0x34fb('0x5')](function(_0x2e08dd){logger[_0x34fb('0x6')](_0x34fb('0x1b'),_0x253bd8);logger[_0x34fb('0x7')](_0x34fb('0x1b'),_0x253bd8,JSON[_0x34fb('0x1a')](_0x2e08dd));_0x353ef3(_0x2e08dd);})[_0x34fb('0xe')](function(_0x51f43b){logger['error'](_0x34fb('0x1b'),_0x51f43b['message'],_0x253bd8);_0x296b97(_0x441d53['error'](0x1f4,_0x51f43b[_0x34fb('0xb')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 6ac669f..6bc53b3 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 _0x3198=['getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','getFields','/:id/subjects'];(function(_0x464061,_0xdbfa32){var _0x32a70a=function(_0x24baeb){while(--_0x24baeb){_0x464061['push'](_0x464061['shift']());}};_0x32a70a(++_0xdbfa32);}(_0x3198,0xe4));var _0x8319=function(_0x22ae5d,_0x459201){_0x22ae5d=_0x22ae5d-0x0;var _0x121474=_0x3198[_0x22ae5d];return _0x121474;};'use strict';var multer=require(_0x8319('0x0'));var util=require('util');var path=require(_0x8319('0x1'));var timeout=require(_0x8319('0x2'));var express=require(_0x8319('0x3'));var router=express[_0x8319('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8319('0x5'));var interaction=require(_0x8319('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x8319('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8319('0x8'),auth[_0x8319('0x9')](),controller['show']);router[_0x8319('0x7')]('/:id/fields',auth[_0x8319('0x9')](),controller[_0x8319('0xa')]);router['get'](_0x8319('0xb'),auth[_0x8319('0x9')](),controller[_0x8319('0xc')]);router[_0x8319('0x7')](_0x8319('0xd'),auth[_0x8319('0x9')](),controller[_0x8319('0xe')]);router[_0x8319('0x7')](_0x8319('0xf'),auth['isAuthenticated'](),controller[_0x8319('0x10')]);router[_0x8319('0x11')]('/',auth['isAuthenticated'](),controller[_0x8319('0x12')]);router[_0x8319('0x11')](_0x8319('0xf'),auth['isAuthenticated'](),controller[_0x8319('0x13')]);router[_0x8319('0x14')](_0x8319('0x8'),auth['isAuthenticated'](),controller['update']);router[_0x8319('0x15')](_0x8319('0x8'),auth[_0x8319('0x9')](),controller[_0x8319('0x16')]);module[_0x8319('0x17')]=router; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 3f5847b..dddb1ae 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 _0x600d=['STRING','sequelize'];(function(_0x7f644a,_0x2a14e4){var _0x5e9e36=function(_0x7a97b1){while(--_0x7a97b1){_0x7f644a['push'](_0x7f644a['shift']());}};_0x5e9e36(++_0x2a14e4);}(_0x600d,0xe5));var _0xd600=function(_0xcb6ade,_0x516edf){_0xcb6ade=_0xcb6ade-0x0;var _0x46e8fc=_0x600d[_0xcb6ade];return _0x46e8fc;};'use strict';var Sequelize=require(_0xd600('0x0'));module['exports']={'name':{'type':Sequelize[_0xd600('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 070bd5a..dea9758 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 _0xbfe4=['catch','create','body','getFields','findOne','FreshdeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','type','map','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','FreshdeskConfiguration','intersection','length','find'];(function(_0x5a272e,_0x13b958){var _0x285e30=function(_0x14c065){while(--_0x14c065){_0x5a272e['push'](_0x5a272e['shift']());}};_0x285e30(++_0x13b958);}(_0xbfe4,0x1a6));var _0x4bfe=function(_0x39297b,_0x3674eb){_0x39297b=_0x39297b-0x0;var _0x1cae79=_0xbfe4[_0x39297b];return _0x1cae79;};'use strict';var emlformat=require(_0x4bfe('0x0'));var rimraf=require(_0x4bfe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4bfe('0x2'));var rp=require(_0x4bfe('0x3'));var moment=require('moment');var BPromise=require(_0x4bfe('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4bfe('0x5'));var sox=require(_0x4bfe('0x6'));var csv=require(_0x4bfe('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4bfe('0x8'));var _=require('lodash');var squel=require(_0x4bfe('0x9'));var crypto=require(_0x4bfe('0xa'));var jsforce=require(_0x4bfe('0xb'));var deskjs=require(_0x4bfe('0xc'));var toCsv=require(_0x4bfe('0x7'));var querystring=require('querystring');var Papa=require(_0x4bfe('0xd'));var Redis=require(_0x4bfe('0xe'));var authService=require(_0x4bfe('0xf'));var qs=require(_0x4bfe('0x10'));var as=require(_0x4bfe('0x11'));var hardwareService=require(_0x4bfe('0x12'));var logger=require(_0x4bfe('0x13'))('api');var utils=require(_0x4bfe('0x14'));var config=require(_0x4bfe('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa5acb2,_0x1a275b){_0x1a275b=_0x1a275b||0xcc;return function(_0x85b892){if(_0x85b892){return _0xa5acb2[_0x4bfe('0x16')](_0x1a275b);}return _0xa5acb2[_0x4bfe('0x17')](_0x1a275b)[_0x4bfe('0x18')]();};}function respondWithResult(_0x5dff19,_0x5330e0){_0x5330e0=_0x5330e0||0xc8;return function(_0x1bb95d){if(_0x1bb95d){return _0x5dff19[_0x4bfe('0x17')](_0x5330e0)['json'](_0x1bb95d);}};}function respondWithFilteredResult(_0x46d379,_0x5b4b02){return function(_0x2f3466){if(_0x2f3466){var _0x85f3c8=typeof _0x5b4b02['offset']===_0x4bfe('0x19')&&typeof _0x5b4b02[_0x4bfe('0x1a')]===_0x4bfe('0x19');var _0x4efa65=_0x2f3466['count'];var _0x53afe6=_0x85f3c8?0x0:_0x5b4b02['offset'];var _0x5d9262=_0x85f3c8?_0x2f3466[_0x4bfe('0x1b')]:_0x5b4b02['offset']+_0x5b4b02[_0x4bfe('0x1a')];var _0x19ad74;if(_0x5d9262>=_0x4efa65){_0x5d9262=_0x4efa65;_0x19ad74=0xc8;}else{_0x19ad74=0xce;}_0x46d379[_0x4bfe('0x17')](_0x19ad74);return _0x46d379[_0x4bfe('0x1c')](_0x4bfe('0x1d'),_0x53afe6+'-'+_0x5d9262+'/'+_0x4efa65)[_0x4bfe('0x1e')](_0x2f3466);}return null;};}function patchUpdates(_0x52e2f1){return function(_0x2e606e){try{jsonpatch[_0x4bfe('0x1f')](_0x2e606e,_0x52e2f1,!![]);}catch(_0x6778fb){return BPromise[_0x4bfe('0x20')](_0x6778fb);}return _0x2e606e['save']();};}function saveUpdates(_0x165c46,_0x48f184){return function(_0x3a04ca){if(_0x3a04ca){return _0x3a04ca[_0x4bfe('0x21')](_0x165c46)[_0x4bfe('0x22')](function(_0x4d0a69){return _0x4d0a69;});}return null;};}function removeEntity(_0xfe208b,_0x6bb519){return function(_0x1902dd){if(_0x1902dd){return _0x1902dd[_0x4bfe('0x23')]()[_0x4bfe('0x22')](function(){_0xfe208b[_0x4bfe('0x17')](0xcc)[_0x4bfe('0x18')]();});}};}function handleEntityNotFound(_0x2ad4b7,_0xa1d5a9){return function(_0x18d930){if(!_0x18d930){_0x2ad4b7[_0x4bfe('0x16')](0x194);}return _0x18d930;};}function handleError(_0x551ba0,_0x184a36){_0x184a36=_0x184a36||0x1f4;return function(_0xa6dccc){logger[_0x4bfe('0x24')](_0xa6dccc[_0x4bfe('0x25')]);if(_0xa6dccc[_0x4bfe('0x26')]){delete _0xa6dccc['name'];}_0x551ba0[_0x4bfe('0x17')](_0x184a36)[_0x4bfe('0x27')](_0xa6dccc);};}exports[_0x4bfe('0x28')]=function(_0xaf4ab9,_0x4c9f76){var _0x8ce92f={},_0x5a4bef={},_0x21d62d={'count':0x0,'rows':[]};var _0x5a6c57=_['map'](db['FreshdeskConfiguration'][_0x4bfe('0x29')],function(_0x30b79a){return{'name':_0x30b79a['fieldName'],'type':_0x30b79a[_0x4bfe('0x2a')]['key']};});_0x5a4bef['model']=_[_0x4bfe('0x2b')](_0x5a6c57,'name');_0x5a4bef[_0x4bfe('0x2c')]=_[_0x4bfe('0x2d')](_0xaf4ab9[_0x4bfe('0x2c')]);_0x5a4bef[_0x4bfe('0x2e')]=_['intersection'](_0x5a4bef[_0x4bfe('0x2f')],_0x5a4bef[_0x4bfe('0x2c')]);_0x8ce92f[_0x4bfe('0x30')]=_['intersection'](_0x5a4bef[_0x4bfe('0x2f')],qs[_0x4bfe('0x31')](_0xaf4ab9['query'][_0x4bfe('0x31')]));_0x8ce92f[_0x4bfe('0x30')]=_0x8ce92f['attributes']['length']?_0x8ce92f[_0x4bfe('0x30')]:_0x5a4bef['model'];if(!_0xaf4ab9['query'][_0x4bfe('0x32')](_0x4bfe('0x33'))){_0x8ce92f[_0x4bfe('0x1a')]=qs['limit'](_0xaf4ab9[_0x4bfe('0x2c')][_0x4bfe('0x1a')]);_0x8ce92f[_0x4bfe('0x34')]=qs[_0x4bfe('0x34')](_0xaf4ab9[_0x4bfe('0x2c')][_0x4bfe('0x34')]);}_0x8ce92f[_0x4bfe('0x35')]=qs[_0x4bfe('0x36')](_0xaf4ab9[_0x4bfe('0x2c')][_0x4bfe('0x36')]);_0x8ce92f[_0x4bfe('0x37')]=qs[_0x4bfe('0x2e')](_[_0x4bfe('0x38')](_0xaf4ab9['query'],_0x5a4bef[_0x4bfe('0x2e')]),_0x5a6c57);if(_0xaf4ab9[_0x4bfe('0x2c')][_0x4bfe('0x39')]){_0x8ce92f[_0x4bfe('0x37')]=_[_0x4bfe('0x3a')](_0x8ce92f[_0x4bfe('0x37')],{'$or':_[_0x4bfe('0x2b')](_0x5a6c57,function(_0x566f8b){if(_0x566f8b[_0x4bfe('0x2a')]!==_0x4bfe('0x3b')){var _0x2efe2e={};_0x2efe2e[_0x566f8b[_0x4bfe('0x26')]]={'$like':'%'+_0xaf4ab9[_0x4bfe('0x2c')][_0x4bfe('0x39')]+'%'};return _0x2efe2e;}})});}_0x8ce92f=_[_0x4bfe('0x3a')]({},_0x8ce92f,_0xaf4ab9[_0x4bfe('0x3c')]);var _0x42ddf7={'where':_0x8ce92f[_0x4bfe('0x37')]};return db['FreshdeskConfiguration'][_0x4bfe('0x1b')](_0x42ddf7)['then'](function(_0x34012b){_0x21d62d[_0x4bfe('0x1b')]=_0x34012b;if(_0xaf4ab9['query'][_0x4bfe('0x3d')]){_0x8ce92f[_0x4bfe('0x3e')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x4bfe('0x3f')](_0x8ce92f);})[_0x4bfe('0x22')](function(_0x3665c1){_0x21d62d['rows']=_0x3665c1;return _0x21d62d;})[_0x4bfe('0x22')](respondWithFilteredResult(_0x4c9f76,_0x8ce92f))['catch'](handleError(_0x4c9f76,null));};exports[_0x4bfe('0x40')]=function(_0x260a31,_0x5ed1a8){var _0x1381ad={'raw':![],'where':{'id':_0x260a31[_0x4bfe('0x41')]['id']}},_0x2d645c={};_0x2d645c[_0x4bfe('0x2f')]=_[_0x4bfe('0x2d')](db[_0x4bfe('0x42')][_0x4bfe('0x29')]);_0x2d645c['query']=_[_0x4bfe('0x2d')](_0x260a31[_0x4bfe('0x2c')]);_0x2d645c[_0x4bfe('0x2e')]=_[_0x4bfe('0x43')](_0x2d645c[_0x4bfe('0x2f')],_0x2d645c[_0x4bfe('0x2c')]);_0x1381ad[_0x4bfe('0x30')]=_[_0x4bfe('0x43')](_0x2d645c['model'],qs[_0x4bfe('0x31')](_0x260a31[_0x4bfe('0x2c')]['fields']));_0x1381ad['attributes']=_0x1381ad[_0x4bfe('0x30')][_0x4bfe('0x44')]?_0x1381ad[_0x4bfe('0x30')]:_0x2d645c['model'];if(_0x260a31[_0x4bfe('0x2c')]['includeAll']){_0x1381ad[_0x4bfe('0x3e')]=[{'all':!![]}];}_0x1381ad=_[_0x4bfe('0x3a')]({},_0x1381ad,_0x260a31[_0x4bfe('0x3c')]);return db[_0x4bfe('0x42')][_0x4bfe('0x45')](_0x1381ad)[_0x4bfe('0x22')](handleEntityNotFound(_0x5ed1a8,null))[_0x4bfe('0x22')](respondWithResult(_0x5ed1a8,null))[_0x4bfe('0x46')](handleError(_0x5ed1a8,null));};exports[_0x4bfe('0x47')]=function(_0x1b40d1,_0x474f49){return db['FreshdeskConfiguration'][_0x4bfe('0x47')](_0x1b40d1[_0x4bfe('0x48')],{})[_0x4bfe('0x22')](respondWithResult(_0x474f49,0xc9))[_0x4bfe('0x46')](handleError(_0x474f49,null));};exports[_0x4bfe('0x21')]=function(_0x445188,_0x51639e){if(_0x445188[_0x4bfe('0x48')]['id']){delete _0x445188[_0x4bfe('0x48')]['id'];}return db[_0x4bfe('0x42')][_0x4bfe('0x45')]({'where':{'id':_0x445188[_0x4bfe('0x41')]['id']}})[_0x4bfe('0x22')](handleEntityNotFound(_0x51639e,null))[_0x4bfe('0x22')](saveUpdates(_0x445188['body'],null))['then'](respondWithResult(_0x51639e,null))[_0x4bfe('0x46')](handleError(_0x51639e,null));};exports[_0x4bfe('0x23')]=function(_0xdc2fdd,_0x208db6){return db[_0x4bfe('0x42')][_0x4bfe('0x45')]({'where':{'id':_0xdc2fdd[_0x4bfe('0x41')]['id']}})['then'](handleEntityNotFound(_0x208db6,null))[_0x4bfe('0x22')](removeEntity(_0x208db6,null))['catch'](handleError(_0x208db6,null));};exports[_0x4bfe('0x49')]=function(_0x3636f3,_0x44563d,_0x2ec0ca){var _0x51d69a={};var _0x5d1b1a={};var _0x229874;var _0x1aabfe;return db[_0x4bfe('0x42')][_0x4bfe('0x4a')]({'where':{'id':_0x3636f3[_0x4bfe('0x41')]['id']}})[_0x4bfe('0x22')](handleEntityNotFound(_0x44563d,null))[_0x4bfe('0x22')](function(_0x4e19f9){if(_0x4e19f9){_0x229874=_0x4e19f9;_0x5d1b1a[_0x4bfe('0x2f')]=_[_0x4bfe('0x2d')](db[_0x4bfe('0x4b')]['rawAttributes']);_0x5d1b1a[_0x4bfe('0x2c')]=_[_0x4bfe('0x2d')](_0x3636f3[_0x4bfe('0x2c')]);_0x5d1b1a['filters']=_[_0x4bfe('0x43')](_0x5d1b1a['model'],_0x5d1b1a[_0x4bfe('0x2c')]);_0x51d69a['attributes']=_[_0x4bfe('0x43')](_0x5d1b1a[_0x4bfe('0x2f')],qs[_0x4bfe('0x31')](_0x3636f3[_0x4bfe('0x2c')][_0x4bfe('0x31')]));_0x51d69a[_0x4bfe('0x30')]=_0x51d69a[_0x4bfe('0x30')]['length']?_0x51d69a[_0x4bfe('0x30')]:_0x5d1b1a[_0x4bfe('0x2f')];_0x51d69a[_0x4bfe('0x35')]=qs[_0x4bfe('0x36')](_0x3636f3[_0x4bfe('0x2c')][_0x4bfe('0x36')]);_0x51d69a[_0x4bfe('0x37')]=qs[_0x4bfe('0x2e')](_[_0x4bfe('0x38')](_0x3636f3[_0x4bfe('0x2c')],_0x5d1b1a['filters']));if(_0x3636f3[_0x4bfe('0x2c')][_0x4bfe('0x39')]){_0x51d69a[_0x4bfe('0x37')]=_[_0x4bfe('0x3a')](_0x51d69a[_0x4bfe('0x37')],{'$or':_[_0x4bfe('0x2b')](_0x51d69a['attributes'],function(_0x1ac54b){var _0x1d170c={};_0x1d170c[_0x1ac54b]={'$like':'%'+_0x3636f3[_0x4bfe('0x2c')]['filter']+'%'};return _0x1d170c;})});}_0x51d69a=_[_0x4bfe('0x3a')]({},_0x51d69a,_0x3636f3[_0x4bfe('0x3c')]);return _0x229874[_0x4bfe('0x49')](_0x51d69a);}})[_0x4bfe('0x22')](function(_0x143b3d){if(_0x143b3d){_0x1aabfe=_0x143b3d['length'];if(!_0x3636f3['query'][_0x4bfe('0x32')](_0x4bfe('0x33'))){_0x51d69a[_0x4bfe('0x1a')]=qs[_0x4bfe('0x1a')](_0x3636f3['query'][_0x4bfe('0x1a')]);_0x51d69a['offset']=qs['offset'](_0x3636f3[_0x4bfe('0x2c')][_0x4bfe('0x34')]);}return _0x229874[_0x4bfe('0x49')](_0x51d69a);}})['then'](function(_0x58db1b){if(_0x58db1b){return _0x58db1b?{'count':_0x1aabfe,'rows':_0x58db1b}:null;}})['then'](respondWithResult(_0x44563d,null))[_0x4bfe('0x46')](handleError(_0x44563d,null));};exports[_0x4bfe('0x4c')]=function(_0x55db9f,_0xf0e7a5,_0x144d3e){var _0x400f6f={};var _0x5d8233={};var _0x3e2eff;var _0x210e8c;return db[_0x4bfe('0x42')][_0x4bfe('0x4a')]({'where':{'id':_0x55db9f['params']['id']}})[_0x4bfe('0x22')](handleEntityNotFound(_0xf0e7a5,null))['then'](function(_0x1b8657){if(_0x1b8657){_0x3e2eff=_0x1b8657;_0x5d8233[_0x4bfe('0x2f')]=_[_0x4bfe('0x2d')](db['FreshdeskField']['rawAttributes']);_0x5d8233[_0x4bfe('0x2c')]=_['keys'](_0x55db9f[_0x4bfe('0x2c')]);_0x5d8233['filters']=_['intersection'](_0x5d8233[_0x4bfe('0x2f')],_0x5d8233[_0x4bfe('0x2c')]);_0x400f6f['attributes']=_[_0x4bfe('0x43')](_0x5d8233[_0x4bfe('0x2f')],qs[_0x4bfe('0x31')](_0x55db9f[_0x4bfe('0x2c')][_0x4bfe('0x31')]));_0x400f6f[_0x4bfe('0x30')]=_0x400f6f[_0x4bfe('0x30')][_0x4bfe('0x44')]?_0x400f6f[_0x4bfe('0x30')]:_0x5d8233[_0x4bfe('0x2f')];_0x400f6f[_0x4bfe('0x35')]=qs[_0x4bfe('0x36')](_0x55db9f['query'][_0x4bfe('0x36')]);_0x400f6f[_0x4bfe('0x37')]=qs['filters'](_['pick'](_0x55db9f['query'],_0x5d8233[_0x4bfe('0x2e')]));if(_0x55db9f['query'][_0x4bfe('0x39')]){_0x400f6f['where']=_[_0x4bfe('0x3a')](_0x400f6f[_0x4bfe('0x37')],{'$or':_[_0x4bfe('0x2b')](_0x400f6f[_0x4bfe('0x30')],function(_0x4c1149){var _0x570bd0={};_0x570bd0[_0x4c1149]={'$like':'%'+_0x55db9f[_0x4bfe('0x2c')][_0x4bfe('0x39')]+'%'};return _0x570bd0;})});}_0x400f6f=_[_0x4bfe('0x3a')]({},_0x400f6f,_0x55db9f[_0x4bfe('0x3c')]);return _0x3e2eff['getSubjects'](_0x400f6f);}})[_0x4bfe('0x22')](function(_0x4f0720){if(_0x4f0720){_0x210e8c=_0x4f0720[_0x4bfe('0x44')];if(!_0x55db9f[_0x4bfe('0x2c')][_0x4bfe('0x32')](_0x4bfe('0x33'))){_0x400f6f[_0x4bfe('0x1a')]=qs['limit'](_0x55db9f[_0x4bfe('0x2c')]['limit']);_0x400f6f[_0x4bfe('0x34')]=qs[_0x4bfe('0x34')](_0x55db9f[_0x4bfe('0x2c')][_0x4bfe('0x34')]);}return _0x3e2eff[_0x4bfe('0x4c')](_0x400f6f);}})[_0x4bfe('0x22')](function(_0x36a481){if(_0x36a481){return _0x36a481?{'count':_0x210e8c,'rows':_0x36a481}:null;}})[_0x4bfe('0x22')](respondWithResult(_0xf0e7a5,null))['catch'](handleError(_0xf0e7a5,null));};exports[_0x4bfe('0x4d')]=function(_0x25cbfb,_0x3c3eea,_0x32fc18){var _0x30220e={};var _0x44c1f8={};var _0x230605;var _0x3495e0;return db[_0x4bfe('0x42')][_0x4bfe('0x4a')]({'where':{'id':_0x25cbfb[_0x4bfe('0x41')]['id']}})[_0x4bfe('0x22')](handleEntityNotFound(_0x3c3eea,null))[_0x4bfe('0x22')](function(_0x8cc99b){if(_0x8cc99b){_0x230605=_0x8cc99b;_0x44c1f8[_0x4bfe('0x2f')]=_[_0x4bfe('0x2d')](db['FreshdeskField']['rawAttributes']);_0x44c1f8['query']=_['keys'](_0x25cbfb[_0x4bfe('0x2c')]);_0x44c1f8['filters']=_[_0x4bfe('0x43')](_0x44c1f8[_0x4bfe('0x2f')],_0x44c1f8[_0x4bfe('0x2c')]);_0x30220e[_0x4bfe('0x30')]=_['intersection'](_0x44c1f8[_0x4bfe('0x2f')],qs['fields'](_0x25cbfb[_0x4bfe('0x2c')][_0x4bfe('0x31')]));_0x30220e[_0x4bfe('0x30')]=_0x30220e[_0x4bfe('0x30')]['length']?_0x30220e[_0x4bfe('0x30')]:_0x44c1f8['model'];_0x30220e[_0x4bfe('0x35')]=qs[_0x4bfe('0x36')](_0x25cbfb[_0x4bfe('0x2c')][_0x4bfe('0x36')]);_0x30220e[_0x4bfe('0x37')]=qs[_0x4bfe('0x2e')](_[_0x4bfe('0x38')](_0x25cbfb['query'],_0x44c1f8[_0x4bfe('0x2e')]));if(_0x25cbfb[_0x4bfe('0x2c')][_0x4bfe('0x39')]){_0x30220e['where']=_[_0x4bfe('0x3a')](_0x30220e[_0x4bfe('0x37')],{'$or':_[_0x4bfe('0x2b')](_0x30220e['attributes'],function(_0x33df54){var _0x2c4f7d={};_0x2c4f7d[_0x33df54]={'$like':'%'+_0x25cbfb['query']['filter']+'%'};return _0x2c4f7d;})});}_0x30220e=_[_0x4bfe('0x3a')]({},_0x30220e,_0x25cbfb['options']);return _0x230605[_0x4bfe('0x4d')](_0x30220e);}})[_0x4bfe('0x22')](function(_0xa7851f){if(_0xa7851f){_0x3495e0=_0xa7851f[_0x4bfe('0x44')];if(!_0x25cbfb[_0x4bfe('0x2c')][_0x4bfe('0x32')](_0x4bfe('0x33'))){_0x30220e[_0x4bfe('0x1a')]=qs['limit'](_0x25cbfb['query'][_0x4bfe('0x1a')]);_0x30220e[_0x4bfe('0x34')]=qs['offset'](_0x25cbfb[_0x4bfe('0x2c')][_0x4bfe('0x34')]);}return _0x230605[_0x4bfe('0x4d')](_0x30220e);}})[_0x4bfe('0x22')](function(_0x1d3011){if(_0x1d3011){return _0x1d3011?{'count':_0x3495e0,'rows':_0x1d3011}:null;}})[_0x4bfe('0x22')](respondWithResult(_0x3c3eea,null))[_0x4bfe('0x46')](handleError(_0x3c3eea,null));};exports[_0x4bfe('0x4e')]=function(_0x286e09,_0xce65c4,_0x384ad5){var _0x3fde5c={};var _0x44fd3b={};var _0x11bba8;var _0x447fcf;return db[_0x4bfe('0x42')][_0x4bfe('0x4a')]({'where':{'id':_0x286e09[_0x4bfe('0x41')]['id']}})['then'](handleEntityNotFound(_0xce65c4,null))[_0x4bfe('0x22')](function(_0x2377f1){if(_0x2377f1){_0x11bba8=_0x2377f1;_0x44fd3b[_0x4bfe('0x2f')]=_[_0x4bfe('0x2d')](db[_0x4bfe('0x4f')]['rawAttributes']);_0x44fd3b[_0x4bfe('0x2c')]=_[_0x4bfe('0x2d')](_0x286e09[_0x4bfe('0x2c')]);_0x44fd3b[_0x4bfe('0x2e')]=_[_0x4bfe('0x43')](_0x44fd3b['model'],_0x44fd3b[_0x4bfe('0x2c')]);_0x3fde5c[_0x4bfe('0x30')]=_[_0x4bfe('0x43')](_0x44fd3b[_0x4bfe('0x2f')],qs[_0x4bfe('0x31')](_0x286e09[_0x4bfe('0x2c')][_0x4bfe('0x31')]));_0x3fde5c[_0x4bfe('0x30')]=_0x3fde5c[_0x4bfe('0x30')]['length']?_0x3fde5c[_0x4bfe('0x30')]:_0x44fd3b[_0x4bfe('0x2f')];_0x3fde5c[_0x4bfe('0x35')]=qs['sort'](_0x286e09['query'][_0x4bfe('0x36')]);_0x3fde5c[_0x4bfe('0x37')]=qs['filters'](_[_0x4bfe('0x38')](_0x286e09[_0x4bfe('0x2c')],_0x44fd3b[_0x4bfe('0x2e')]));if(_0x286e09[_0x4bfe('0x2c')]['filter']){_0x3fde5c[_0x4bfe('0x37')]=_[_0x4bfe('0x3a')](_0x3fde5c['where'],{'$or':_[_0x4bfe('0x2b')](_0x3fde5c['attributes'],function(_0x4b2473){var _0x8e9078={};_0x8e9078[_0x4b2473]={'$like':'%'+_0x286e09['query'][_0x4bfe('0x39')]+'%'};return _0x8e9078;})});}_0x3fde5c=_['merge']({},_0x3fde5c,_0x286e09[_0x4bfe('0x3c')]);return _0x11bba8['getTags'](_0x3fde5c);}})[_0x4bfe('0x22')](function(_0x3515a0){if(_0x3515a0){_0x447fcf=_0x3515a0[_0x4bfe('0x44')];if(!_0x286e09[_0x4bfe('0x2c')]['hasOwnProperty'](_0x4bfe('0x33'))){_0x3fde5c[_0x4bfe('0x1a')]=qs[_0x4bfe('0x1a')](_0x286e09[_0x4bfe('0x2c')][_0x4bfe('0x1a')]);_0x3fde5c[_0x4bfe('0x34')]=qs['offset'](_0x286e09['query'][_0x4bfe('0x34')]);}return _0x11bba8[_0x4bfe('0x4e')](_0x3fde5c);}})[_0x4bfe('0x22')](function(_0x3962b2){if(_0x3962b2){return _0x3962b2?{'count':_0x447fcf,'rows':_0x3962b2}:null;}})['then'](respondWithResult(_0xce65c4,null))[_0x4bfe('0x46')](handleError(_0xce65c4,null));};exports[_0x4bfe('0x50')]=function(_0x4ee9eb,_0x4c36db,_0x142b9c){if(_0x4ee9eb[_0x4bfe('0x48')]['id']){delete _0x4ee9eb[_0x4bfe('0x48')]['id'];}return db[_0x4bfe('0x42')][_0x4bfe('0x4a')]({'where':{'id':_0x4ee9eb[_0x4bfe('0x41')]['id']}})['then'](handleEntityNotFound(_0x4c36db,null))[_0x4bfe('0x22')](function(_0x4606fd){if(_0x4606fd){return _0x4606fd[_0x4bfe('0x50')](_0x4ee9eb[_0x4bfe('0x48')][_0x4bfe('0x51')]||[]);}return null;})[_0x4bfe('0x22')](respondWithResult(_0x4c36db,null))['catch'](handleError(_0x4c36db,null));}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 92d2dda..5e07c72 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 _0x91e7=['define','int_freshdesk_configurations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x15d2e3,_0x1d7241){var _0x218b3e=function(_0x396d96){while(--_0x396d96){_0x15d2e3['push'](_0x15d2e3['shift']());}};_0x218b3e(++_0x1d7241);}(_0x91e7,0x173));var _0x791e=function(_0x492af5,_0xd51471){_0x492af5=_0x492af5-0x0;var _0x59f529=_0x91e7[_0x492af5];return _0x59f529;};'use strict';var _=require('lodash');var util=require(_0x791e('0x0'));var logger=require(_0x791e('0x1'))(_0x791e('0x2'));var moment=require('moment');var BPromise=require(_0x791e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791e('0x4'));var rimraf=require(_0x791e('0x5'));var config=require(_0x791e('0x6'));var attributes=require('./intFreshdeskConfiguration.attributes');module['exports']=function(_0x2b3caa,_0x837d1b){return _0x2b3caa[_0x791e('0x7')]('FreshdeskConfiguration',attributes,{'tableName':_0x791e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index ce79659..096d170 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 _0x52ea=['stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x29adfe,_0x4593aa){var _0x295dc1=function(_0x1bd965){while(--_0x1bd965){_0x29adfe['push'](_0x29adfe['shift']());}};_0x295dc1(++_0x4593aa);}(_0x52ea,0xf6));var _0xa52e=function(_0x3653c7,_0xadb356){_0x3653c7=_0x3653c7-0x0;var _0x58a021=_0x52ea[_0x3653c7];return _0x58a021;};'use strict';var _=require(_0xa52e('0x0'));var util=require(_0xa52e('0x1'));var moment=require('moment');var BPromise=require(_0xa52e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa52e('0x3'));var db=require(_0xa52e('0x4'))['db'];var utils=require(_0xa52e('0x5'));var logger=require(_0xa52e('0x6'))(_0xa52e('0x7'));var config=require(_0xa52e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa52e('0x9')][_0xa52e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12fd7b,_0x494a68,_0x449307){return new BPromise(function(_0x3c5f84,_0x2cd2a5){return client[_0xa52e('0xb')](_0x12fd7b,_0x449307)[_0xa52e('0xc')](function(_0x329ca6){logger[_0xa52e('0xd')](_0xa52e('0xe'),_0x494a68,_0xa52e('0xf'));logger[_0xa52e('0x10')](_0xa52e('0x11'),_0x494a68,_0xa52e('0xf'),JSON[_0xa52e('0x12')](_0x329ca6));if(_0x329ca6[_0xa52e('0x13')]){if(_0x329ca6[_0xa52e('0x13')][_0xa52e('0x14')]===0x1f4){logger['error'](_0xa52e('0xe'),_0x494a68,_0x329ca6[_0xa52e('0x13')][_0xa52e('0x15')]);return _0x2cd2a5(_0x329ca6[_0xa52e('0x13')][_0xa52e('0x15')]);}logger['error'](_0xa52e('0xe'),_0x494a68,_0x329ca6['error'][_0xa52e('0x15')]);return _0x3c5f84(_0x329ca6[_0xa52e('0x13')][_0xa52e('0x15')]);}else{logger[_0xa52e('0xd')](_0xa52e('0xe'),_0x494a68,_0xa52e('0xf'));_0x3c5f84(_0x329ca6[_0xa52e('0x16')][_0xa52e('0x15')]);}})[_0xa52e('0x17')](function(_0x1e7d31){logger[_0xa52e('0x13')](_0xa52e('0xe'),_0x494a68,_0x1e7d31);_0x2cd2a5(_0x1e7d31);});});} \ No newline at end of file +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 diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 5984ce3..fc462c1 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 _0xac63=['./intFreshdeskField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x46d550,_0x2aeca9){var _0x1165ef=function(_0x1f2700){while(--_0x1f2700){_0x46d550['push'](_0x46d550['shift']());}};_0x1165ef(++_0x2aeca9);}(_0xac63,0xda));var _0x3ac6=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xac63[_0x26b8b5];return _0x2150a9;};'use strict';var multer=require('multer');var util=require(_0x3ac6('0x0'));var path=require('path');var timeout=require(_0x3ac6('0x1'));var express=require(_0x3ac6('0x2'));var router=express[_0x3ac6('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3ac6('0x4'));var config=require(_0x3ac6('0x5'));var controller=require(_0x3ac6('0x6'));router[_0x3ac6('0x7')]('/',auth[_0x3ac6('0x8')](),controller[_0x3ac6('0x9')]);router[_0x3ac6('0x7')](_0x3ac6('0xa'),auth[_0x3ac6('0x8')](),controller['show']);router[_0x3ac6('0xb')]('/',auth[_0x3ac6('0x8')](),controller[_0x3ac6('0xc')]);router[_0x3ac6('0xd')](_0x3ac6('0xa'),auth[_0x3ac6('0x8')](),controller['update']);router[_0x3ac6('0xe')](_0x3ac6('0xa'),auth[_0x3ac6('0x8')](),controller['destroy']);module[_0x3ac6('0xf')]=router; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index 8a8000c..40c1b9b 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 _0x50ea=['STRING','sequelize','exports','ENUM','string','variable','customVariable','keyValue','picklist'];(function(_0x235a29,_0x249d2f){var _0x5e22fe=function(_0x390002){while(--_0x390002){_0x235a29['push'](_0x235a29['shift']());}};_0x5e22fe(++_0x249d2f);}(_0x50ea,0x1e7));var _0xa50e=function(_0x3d1aa4,_0x466991){_0x3d1aa4=_0x3d1aa4-0x0;var _0x337b10=_0x50ea[_0x3d1aa4];return _0x337b10;};'use strict';var Sequelize=require(_0xa50e('0x0'));module[_0xa50e('0x1')]={'type':{'type':Sequelize[_0xa50e('0x2')](_0xa50e('0x3'),_0xa50e('0x4'),_0xa50e('0x5'),_0xa50e('0x6'),_0xa50e('0x7')),'defaultValue':_0xa50e('0x3')},'content':{'type':Sequelize[_0xa50e('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa50e('0x2')](_0xa50e('0x3'),'variable',_0xa50e('0x5'))},'keyContent':{'type':Sequelize[_0xa50e('0x8')]},'idField':{'type':Sequelize[_0xa50e('0x8')]},'nameField':{'type':Sequelize[_0xa50e('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa50e('0x8')]}}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 4560b40..247c356 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 _0xd87e=['request-promise','moment','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskField','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch'];(function(_0x50afba,_0x42ab42){var _0x2ee3f7=function(_0x848709){while(--_0x848709){_0x50afba['push'](_0x50afba['shift']());}};_0x2ee3f7(++_0x42ab42);}(_0xd87e,0x1bf));var _0xed87=function(_0x5592e0,_0x3ea264){_0x5592e0=_0x5592e0-0x0;var _0x8afcaa=_0xd87e[_0x5592e0];return _0x8afcaa;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['index']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={},_0x3dff74={},_0x33c367={'count':0x0,'rows':[]};var _0x21c93b=_['map'](db['FreshdeskField'][_0xed87('0x29')],function(_0x428b75){return{'name':_0x428b75[_0xed87('0x2a')],'type':_0x428b75['type'][_0xed87('0x2b')]};});_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0x21c93b,_0xed87('0x27'));_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0xb32b1c[_0xed87('0x2e')]);_0x3dff74[_0xed87('0x30')]=_[_0xed87('0x31')](_0x3dff74['model'],_0x3dff74[_0xed87('0x2e')]);_0x4eaa44[_0xed87('0x32')]=_['intersection'](_0x3dff74[_0xed87('0x2c')],qs['fields'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x4eaa44[_0xed87('0x32')]=_0x4eaa44[_0xed87('0x32')][_0xed87('0x34')]?_0x4eaa44[_0xed87('0x32')]:_0x3dff74[_0xed87('0x2c')];if(!_0xb32b1c[_0xed87('0x2e')][_0xed87('0x35')](_0xed87('0x36'))){_0x4eaa44[_0xed87('0x1e')]=qs['limit'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x1e')]);_0x4eaa44['offset']=qs[_0xed87('0x1c')](_0xb32b1c['query'][_0xed87('0x1c')]);}_0x4eaa44[_0xed87('0x37')]=qs['sort'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x38')]);_0x4eaa44[_0xed87('0x39')]=qs[_0xed87('0x30')](_[_0xed87('0x3a')](_0xb32b1c['query'],_0x3dff74[_0xed87('0x30')]),_0x21c93b);if(_0xb32b1c['query'][_0xed87('0x3b')]){_0x4eaa44['where']=_[_0xed87('0x3c')](_0x4eaa44[_0xed87('0x39')],{'$or':_[_0xed87('0x2d')](_0x21c93b,function(_0x217435){if(_0x217435[_0xed87('0x3d')]!==_0xed87('0x3e')){var _0x9e3356={};_0x9e3356[_0x217435[_0xed87('0x27')]]={'$like':'%'+_0xb32b1c[_0xed87('0x2e')]['filter']+'%'};return _0x9e3356;}})});}_0x4eaa44=_['merge']({},_0x4eaa44,_0xb32b1c[_0xed87('0x3f')]);var _0x206544={'where':_0x4eaa44[_0xed87('0x39')]};return db[_0xed87('0x40')][_0xed87('0x1f')](_0x206544)[_0xed87('0x23')](function(_0x5d1bd0){_0x33c367[_0xed87('0x1f')]=_0x5d1bd0;if(_0xb32b1c[_0xed87('0x2e')][_0xed87('0x41')]){_0x4eaa44['include']=[{'all':!![]}];}return db[_0xed87('0x40')][_0xed87('0x42')](_0x4eaa44);})[_0xed87('0x23')](function(_0x1b0092){_0x33c367[_0xed87('0x43')]=_0x1b0092;return _0x33c367;})[_0xed87('0x23')](respondWithFilteredResult(_0x1c4a65,_0x4eaa44))[_0xed87('0x44')](handleError(_0x1c4a65,null));};exports[_0xed87('0x45')]=function(_0x35bd1c,_0x406b73){var _0x5c6925={'raw':!![],'where':{'id':_0x35bd1c[_0xed87('0x46')]['id']}},_0x7e6cbb={};_0x7e6cbb[_0xed87('0x2c')]=_['keys'](db['FreshdeskField'][_0xed87('0x29')]);_0x7e6cbb[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x35bd1c[_0xed87('0x2e')]);_0x7e6cbb['filters']=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],_0x7e6cbb['query']);_0x5c6925[_0xed87('0x32')]=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],qs[_0xed87('0x33')](_0x35bd1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x5c6925[_0xed87('0x32')]=_0x5c6925[_0xed87('0x32')][_0xed87('0x34')]?_0x5c6925[_0xed87('0x32')]:_0x7e6cbb[_0xed87('0x2c')];if(_0x35bd1c['query'][_0xed87('0x41')]){_0x5c6925[_0xed87('0x47')]=[{'all':!![]}];}_0x5c6925=_[_0xed87('0x3c')]({},_0x5c6925,_0x35bd1c[_0xed87('0x3f')]);return db[_0xed87('0x40')][_0xed87('0x48')](_0x5c6925)[_0xed87('0x23')](handleEntityNotFound(_0x406b73,null))[_0xed87('0x23')](respondWithResult(_0x406b73,null))[_0xed87('0x44')](handleError(_0x406b73,null));};exports[_0xed87('0x49')]=function(_0x8aa499,_0x26c8f4){return db[_0xed87('0x40')][_0xed87('0x49')](_0x8aa499[_0xed87('0x4a')],{})[_0xed87('0x23')](respondWithResult(_0x26c8f4,0xc9))[_0xed87('0x44')](handleError(_0x26c8f4,null));};exports['update']=function(_0x2c7bef,_0x1a68a7){if(_0x2c7bef[_0xed87('0x4a')]['id']){delete _0x2c7bef['body']['id'];}return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x2c7bef['params']['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x1a68a7,null))[_0xed87('0x23')](saveUpdates(_0x2c7bef[_0xed87('0x4a')],null))[_0xed87('0x23')](respondWithResult(_0x1a68a7,null))['catch'](handleError(_0x1a68a7,null));};exports[_0xed87('0x24')]=function(_0x436e15,_0x3ca34c){return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x436e15[_0xed87('0x46')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3ca34c,null))[_0xed87('0x23')](removeEntity(_0x3ca34c,null))[_0xed87('0x44')](handleError(_0x3ca34c,null));}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index c160a56..0567d40 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 _0xdff8=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xdff8,0xc3));var _0x8dff=function(_0x3ced90,_0xf1aad1){_0x3ced90=_0x3ced90-0x0;var _0x5b9d75=_0xdff8[_0x3ced90];return _0x5b9d75;};'use strict';var _=require(_0x8dff('0x0'));var util=require(_0x8dff('0x1'));var logger=require(_0x8dff('0x2'))('api');var moment=require('moment');var BPromise=require(_0x8dff('0x3'));var rp=require(_0x8dff('0x4'));var fs=require('fs');var path=require(_0x8dff('0x5'));var rimraf=require(_0x8dff('0x6'));var config=require(_0x8dff('0x7'));var attributes=require(_0x8dff('0x8'));module['exports']=function(_0x4e09cc,_0x517540){return _0x4e09cc['define'](_0x8dff('0x9'),attributes,{'tableName':_0x8dff('0xa'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x8dff('0xb'),_0x8dff('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 5a94e68..b46b38a 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 _0x6497=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','bluebird','randomstring','../../mysqldb'];(function(_0x5a6025,_0x59ace5){var _0x56b890=function(_0x353c2f){while(--_0x353c2f){_0x5a6025['push'](_0x5a6025['shift']());}};_0x56b890(++_0x59ace5);}(_0x6497,0x152));var _0x7649=function(_0x2181fc,_0x7283aa){_0x2181fc=_0x2181fc-0x0;var _0x315da1=_0x6497[_0x2181fc];return _0x315da1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7649('0x0'));var BPromise=require(_0x7649('0x1'));var rs=require(_0x7649('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7649('0x3'))['db'];var utils=require(_0x7649('0x4'));var logger=require(_0x7649('0x5'))('rpc');var config=require(_0x7649('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x7649('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25c587,_0x1619a1,_0x2c4fda){return new BPromise(function(_0x383cd9,_0x1e0a2c){return client[_0x7649('0x8')](_0x25c587,_0x2c4fda)[_0x7649('0x9')](function(_0x14e003){logger[_0x7649('0xa')](_0x7649('0xb'),_0x1619a1,_0x7649('0xc'));logger[_0x7649('0xd')](_0x7649('0xe'),_0x1619a1,'request\x20sent',JSON[_0x7649('0xf')](_0x14e003));if(_0x14e003[_0x7649('0x10')]){if(_0x14e003[_0x7649('0x10')]['code']===0x1f4){logger[_0x7649('0x10')]('FreshdeskField,\x20%s,\x20%s',_0x1619a1,_0x14e003[_0x7649('0x10')][_0x7649('0x11')]);return _0x1e0a2c(_0x14e003['error'][_0x7649('0x11')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x1619a1,_0x14e003[_0x7649('0x10')][_0x7649('0x11')]);return _0x383cd9(_0x14e003[_0x7649('0x10')][_0x7649('0x11')]);}else{logger['info'](_0x7649('0xb'),_0x1619a1,_0x7649('0xc'));_0x383cd9(_0x14e003[_0x7649('0x12')][_0x7649('0x11')]);}})['catch'](function(_0x482bbc){logger[_0x7649('0x10')](_0x7649('0xb'),_0x1619a1,_0x482bbc);_0x1e0a2c(_0x482bbc);});});} \ No newline at end of file +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 diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 54d5f2e..3b7c86f 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 _0x58a4=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','exports','multer'];(function(_0x1cce11,_0x2ea295){var _0x491387=function(_0x423b8d){while(--_0x423b8d){_0x1cce11['push'](_0x1cce11['shift']());}};_0x491387(++_0x2ea295);}(_0x58a4,0xbf));var _0x458a=function(_0x102243,_0x2b4dde){_0x102243=_0x102243-0x0;var _0x1d302c=_0x58a4[_0x102243];return _0x1d302c;};'use strict';var multer=require(_0x458a('0x0'));var util=require(_0x458a('0x1'));var path=require(_0x458a('0x2'));var timeout=require(_0x458a('0x3'));var express=require(_0x458a('0x4'));var router=express[_0x458a('0x5')]();var fs_extra=require(_0x458a('0x6'));var auth=require(_0x458a('0x7'));var interaction=require(_0x458a('0x8'));var config=require(_0x458a('0x9'));var controller=require(_0x458a('0xa'));router[_0x458a('0xb')]('/',auth[_0x458a('0xc')](),controller['index']);router['get'](_0x458a('0xd'),auth[_0x458a('0xc')](),controller[_0x458a('0xe')]);router[_0x458a('0xb')](_0x458a('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x458a('0xb')](_0x458a('0x10'),auth[_0x458a('0xc')](),controller[_0x458a('0x11')]);router[_0x458a('0x12')]('/',auth['isAuthenticated'](),controller[_0x458a('0x13')]);router[_0x458a('0x12')]('/:id/configurations',auth[_0x458a('0xc')](),controller[_0x458a('0x14')]);router[_0x458a('0x15')](_0x458a('0xd'),auth[_0x458a('0xc')](),controller['update']);router['delete'](_0x458a('0xd'),auth['isAuthenticated'](),controller[_0x458a('0x16')]);module[_0x458a('0x17')]=router; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index d938fbf..a82922e 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 _0x5f2f=['exports','STRING','username','sequelize'];(function(_0xf9adb6,_0x418452){var _0x22d882=function(_0x4e7255){while(--_0x4e7255){_0xf9adb6['push'](_0xf9adb6['shift']());}};_0x22d882(++_0x418452);}(_0x5f2f,0x73));var _0xf5f2=function(_0x125b44,_0x5b1c42){_0x125b44=_0x125b44-0x0;var _0x59dc97=_0x5f2f[_0x125b44];return _0x59dc97;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'name':{'type':Sequelize[_0xf5f2('0x2')]},'description':{'type':Sequelize[_0xf5f2('0x2')]},'username':{'type':Sequelize[_0xf5f2('0x2')],'unique':_0xf5f2('0x3')},'apiKey':{'type':Sequelize[_0xf5f2('0x2')]},'remoteUri':{'type':Sequelize[_0xf5f2('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f73dd3c..9b7961e 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 _0x0563=['keys','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','find','create','body','findOne','FreshsalesConfiguration','hasOwnProperty','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','slice','substring','lastIndexOf','%s%s','Token\x20token=','users','email','stringify','test','statusCode','eml-format','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','reject','then','destroy','error','stack','name','send','index','map','FreshsalesAccount','rawAttributes','type','query'];(function(_0x24f326,_0x616a7){var _0x488e2d=function(_0x293d9a){while(--_0x293d9a){_0x24f326['push'](_0x24f326['shift']());}};_0x488e2d(++_0x616a7);}(_0x0563,0x147));var _0x3056=function(_0x48618c,_0x3cd59b){_0x48618c=_0x48618c-0x0;var _0x5a3543=_0x0563[_0x48618c];return _0x5a3543;};'use strict';var emlformat=require(_0x3056('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3056('0x1'));var moment=require('moment');var BPromise=require(_0x3056('0x2'));var Mustache=require(_0x3056('0x3'));var util=require(_0x3056('0x4'));var path=require(_0x3056('0x5'));var sox=require(_0x3056('0x6'));var csv=require('to-csv');var ejs=require(_0x3056('0x7'));var fs=require('fs');var fs_extra=require(_0x3056('0x8'));var _=require('lodash');var squel=require(_0x3056('0x9'));var crypto=require(_0x3056('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3056('0xb'));var toCsv=require(_0x3056('0xc'));var querystring=require(_0x3056('0xd'));var Papa=require('papaparse');var Redis=require(_0x3056('0xe'));var authService=require(_0x3056('0xf'));var qs=require(_0x3056('0x10'));var as=require(_0x3056('0x11'));var hardwareService=require(_0x3056('0x12'));var logger=require('../../config/logger')(_0x3056('0x13'));var utils=require('../../config/utils');var config=require(_0x3056('0x14'));var licenseUtil=require(_0x3056('0x15'));var db=require(_0x3056('0x16'))['db'];var integrations=require(_0x3056('0x17'));function respondWithStatusCode(_0x47a2ef,_0x342cd0){_0x342cd0=_0x342cd0||0xcc;return function(_0x4ebbec){if(_0x4ebbec){return _0x47a2ef[_0x3056('0x18')](_0x342cd0);}return _0x47a2ef[_0x3056('0x19')](_0x342cd0)[_0x3056('0x1a')]();};}function respondWithResult(_0x501c0c,_0x2ec4ad){_0x2ec4ad=_0x2ec4ad||0xc8;return function(_0x5eb3e3){if(_0x5eb3e3){return _0x501c0c['status'](_0x2ec4ad)[_0x3056('0x1b')](_0x5eb3e3);}};}function respondWithFilteredResult(_0x4eb041,_0xa55c8d){return function(_0xf1f933){if(_0xf1f933){var _0x25f54a=typeof _0xa55c8d[_0x3056('0x1c')]===_0x3056('0x1d')&&typeof _0xa55c8d[_0x3056('0x1e')]===_0x3056('0x1d');var _0x421fbf=_0xf1f933[_0x3056('0x1f')];var _0x5d76d5=_0x25f54a?0x0:_0xa55c8d['offset'];var _0x2b52eb=_0x25f54a?_0xf1f933['count']:_0xa55c8d[_0x3056('0x1c')]+_0xa55c8d[_0x3056('0x1e')];var _0x139f16;if(_0x2b52eb>=_0x421fbf){_0x2b52eb=_0x421fbf;_0x139f16=0xc8;}else{_0x139f16=0xce;}_0x4eb041['status'](_0x139f16);return _0x4eb041['set']('Content-Range',_0x5d76d5+'-'+_0x2b52eb+'/'+_0x421fbf)[_0x3056('0x1b')](_0xf1f933);}return null;};}function patchUpdates(_0xe0c821){return function(_0x1301f1){try{jsonpatch['apply'](_0x1301f1,_0xe0c821,!![]);}catch(_0x35ac54){return BPromise[_0x3056('0x20')](_0x35ac54);}return _0x1301f1['save']();};}function saveUpdates(_0x2d3ce3,_0x33e5f4){return function(_0x4d7589){if(_0x4d7589){return _0x4d7589['update'](_0x2d3ce3)[_0x3056('0x21')](function(_0x49d300){return _0x49d300;});}return null;};}function removeEntity(_0x1cc81b,_0x1dec11){return function(_0x442785){if(_0x442785){return _0x442785[_0x3056('0x22')]()[_0x3056('0x21')](function(){_0x1cc81b[_0x3056('0x19')](0xcc)[_0x3056('0x1a')]();});}};}function handleEntityNotFound(_0x2c7ffe,_0x28c4ff){return function(_0x29c4e4){if(!_0x29c4e4){_0x2c7ffe[_0x3056('0x18')](0x194);}return _0x29c4e4;};}function handleError(_0x2a39d9,_0x5ef2f6){_0x5ef2f6=_0x5ef2f6||0x1f4;return function(_0xccc745){logger[_0x3056('0x23')](_0xccc745[_0x3056('0x24')]);if(_0xccc745['name']){delete _0xccc745[_0x3056('0x25')];}_0x2a39d9[_0x3056('0x19')](_0x5ef2f6)[_0x3056('0x26')](_0xccc745);};}exports[_0x3056('0x27')]=function(_0xcccd8a,_0x1e9470){var _0x2ca52c={},_0x371ca1={},_0x5dffd8={'count':0x0,'rows':[]};var _0x5f02a0=_[_0x3056('0x28')](db[_0x3056('0x29')][_0x3056('0x2a')],function(_0x34efdb){return{'name':_0x34efdb['fieldName'],'type':_0x34efdb[_0x3056('0x2b')]['key']};});_0x371ca1['model']=_['map'](_0x5f02a0,_0x3056('0x25'));_0x371ca1[_0x3056('0x2c')]=_[_0x3056('0x2d')](_0xcccd8a[_0x3056('0x2c')]);_0x371ca1[_0x3056('0x2e')]=_[_0x3056('0x2f')](_0x371ca1[_0x3056('0x30')],_0x371ca1['query']);_0x2ca52c[_0x3056('0x31')]=_['intersection'](_0x371ca1[_0x3056('0x30')],qs['fields'](_0xcccd8a[_0x3056('0x2c')][_0x3056('0x32')]));_0x2ca52c[_0x3056('0x31')]=_0x2ca52c['attributes'][_0x3056('0x33')]?_0x2ca52c[_0x3056('0x31')]:_0x371ca1['model'];if(!_0xcccd8a[_0x3056('0x2c')]['hasOwnProperty']('nolimit')){_0x2ca52c['limit']=qs[_0x3056('0x1e')](_0xcccd8a['query'][_0x3056('0x1e')]);_0x2ca52c[_0x3056('0x1c')]=qs[_0x3056('0x1c')](_0xcccd8a[_0x3056('0x2c')][_0x3056('0x1c')]);}_0x2ca52c[_0x3056('0x34')]=qs[_0x3056('0x35')](_0xcccd8a[_0x3056('0x2c')][_0x3056('0x35')]);_0x2ca52c[_0x3056('0x36')]=qs[_0x3056('0x2e')](_[_0x3056('0x37')](_0xcccd8a['query'],_0x371ca1[_0x3056('0x2e')]),_0x5f02a0);if(_0xcccd8a[_0x3056('0x2c')][_0x3056('0x38')]){_0x2ca52c[_0x3056('0x36')]=_[_0x3056('0x39')](_0x2ca52c[_0x3056('0x36')],{'$or':_[_0x3056('0x28')](_0x5f02a0,function(_0x185bf3){if(_0x185bf3['type']!=='VIRTUAL'){var _0x442624={};_0x442624[_0x185bf3[_0x3056('0x25')]]={'$like':'%'+_0xcccd8a[_0x3056('0x2c')][_0x3056('0x38')]+'%'};return _0x442624;}})});}_0x2ca52c=_[_0x3056('0x39')]({},_0x2ca52c,_0xcccd8a['options']);var _0x2abbe3={'where':_0x2ca52c[_0x3056('0x36')]};return db[_0x3056('0x29')][_0x3056('0x1f')](_0x2abbe3)['then'](function(_0x29fb2f){_0x5dffd8[_0x3056('0x1f')]=_0x29fb2f;if(_0xcccd8a['query'][_0x3056('0x3a')]){_0x2ca52c[_0x3056('0x3b')]=[{'all':!![]}];}return db[_0x3056('0x29')]['findAll'](_0x2ca52c);})[_0x3056('0x21')](function(_0x28e5c4){_0x5dffd8[_0x3056('0x3c')]=_0x28e5c4;return _0x5dffd8;})[_0x3056('0x21')](respondWithFilteredResult(_0x1e9470,_0x2ca52c))[_0x3056('0x3d')](handleError(_0x1e9470,null));};exports[_0x3056('0x3e')]=function(_0x141126,_0x2a7026){var _0x34a9d7={'raw':![],'where':{'id':_0x141126[_0x3056('0x3f')]['id']}},_0x1ffd70={};_0x1ffd70[_0x3056('0x30')]=_[_0x3056('0x2d')](db[_0x3056('0x29')]['rawAttributes']);_0x1ffd70[_0x3056('0x2c')]=_[_0x3056('0x2d')](_0x141126[_0x3056('0x2c')]);_0x1ffd70[_0x3056('0x2e')]=_['intersection'](_0x1ffd70[_0x3056('0x30')],_0x1ffd70[_0x3056('0x2c')]);_0x34a9d7[_0x3056('0x31')]=_[_0x3056('0x2f')](_0x1ffd70[_0x3056('0x30')],qs[_0x3056('0x32')](_0x141126['query']['fields']));_0x34a9d7[_0x3056('0x31')]=_0x34a9d7[_0x3056('0x31')]['length']?_0x34a9d7[_0x3056('0x31')]:_0x1ffd70[_0x3056('0x30')];if(_0x141126[_0x3056('0x2c')][_0x3056('0x3a')]){_0x34a9d7['include']=[{'all':!![]}];}_0x34a9d7=_['merge']({},_0x34a9d7,_0x141126['options']);return db['FreshsalesAccount'][_0x3056('0x40')](_0x34a9d7)[_0x3056('0x21')](handleEntityNotFound(_0x2a7026,null))['then'](respondWithResult(_0x2a7026,null))[_0x3056('0x3d')](handleError(_0x2a7026,null));};exports[_0x3056('0x41')]=function(_0x555aa9,_0x36ece4){return db[_0x3056('0x29')][_0x3056('0x41')](_0x555aa9[_0x3056('0x42')],{})[_0x3056('0x21')](respondWithResult(_0x36ece4,0xc9))['catch'](handleError(_0x36ece4,null));};exports['update']=function(_0x3ed6e7,_0x375e48){if(_0x3ed6e7[_0x3056('0x42')]['id']){delete _0x3ed6e7['body']['id'];}return db[_0x3056('0x29')][_0x3056('0x40')]({'where':{'id':_0x3ed6e7[_0x3056('0x3f')]['id']}})['then'](handleEntityNotFound(_0x375e48,null))[_0x3056('0x21')](saveUpdates(_0x3ed6e7['body'],null))[_0x3056('0x21')](respondWithResult(_0x375e48,null))[_0x3056('0x3d')](handleError(_0x375e48,null));};exports[_0x3056('0x22')]=function(_0x4347f5,_0x4f3e52){return db[_0x3056('0x29')][_0x3056('0x40')]({'where':{'id':_0x4347f5[_0x3056('0x3f')]['id']}})[_0x3056('0x21')](handleEntityNotFound(_0x4f3e52,null))[_0x3056('0x21')](removeEntity(_0x4f3e52,null))[_0x3056('0x3d')](handleError(_0x4f3e52,null));};exports['getConfigurations']=function(_0x165b62,_0x81bc2a,_0x5e6fa1){var _0x5e8ee4={};var _0xbc5157={};var _0x513640;var _0x7d23c2;return db['FreshsalesAccount'][_0x3056('0x43')]({'where':{'id':_0x165b62['params']['id']}})['then'](handleEntityNotFound(_0x81bc2a,null))[_0x3056('0x21')](function(_0x3d43eb){if(_0x3d43eb){_0x513640=_0x3d43eb;_0xbc5157[_0x3056('0x30')]=_[_0x3056('0x2d')](db[_0x3056('0x44')]['rawAttributes']);_0xbc5157[_0x3056('0x2c')]=_[_0x3056('0x2d')](_0x165b62[_0x3056('0x2c')]);_0xbc5157[_0x3056('0x2e')]=_[_0x3056('0x2f')](_0xbc5157[_0x3056('0x30')],_0xbc5157[_0x3056('0x2c')]);_0x5e8ee4[_0x3056('0x31')]=_['intersection'](_0xbc5157[_0x3056('0x30')],qs[_0x3056('0x32')](_0x165b62[_0x3056('0x2c')]['fields']));_0x5e8ee4[_0x3056('0x31')]=_0x5e8ee4[_0x3056('0x31')][_0x3056('0x33')]?_0x5e8ee4[_0x3056('0x31')]:_0xbc5157['model'];_0x5e8ee4[_0x3056('0x34')]=qs[_0x3056('0x35')](_0x165b62[_0x3056('0x2c')][_0x3056('0x35')]);_0x5e8ee4[_0x3056('0x36')]=qs[_0x3056('0x2e')](_[_0x3056('0x37')](_0x165b62[_0x3056('0x2c')],_0xbc5157['filters']));if(_0x165b62[_0x3056('0x2c')][_0x3056('0x38')]){_0x5e8ee4['where']=_['merge'](_0x5e8ee4[_0x3056('0x36')],{'$or':_['map'](_0x5e8ee4[_0x3056('0x31')],function(_0x4937cd){var _0x412ca7={};_0x412ca7[_0x4937cd]={'$like':'%'+_0x165b62['query'][_0x3056('0x38')]+'%'};return _0x412ca7;})});}_0x5e8ee4=_[_0x3056('0x39')]({},_0x5e8ee4,_0x165b62['options']);return _0x513640['getConfigurations'](_0x5e8ee4);}})[_0x3056('0x21')](function(_0x4faaff){if(_0x4faaff){_0x7d23c2=_0x4faaff[_0x3056('0x33')];if(!_0x165b62[_0x3056('0x2c')][_0x3056('0x45')]('nolimit')){_0x5e8ee4[_0x3056('0x1e')]=qs[_0x3056('0x1e')](_0x165b62[_0x3056('0x2c')]['limit']);_0x5e8ee4[_0x3056('0x1c')]=qs[_0x3056('0x1c')](_0x165b62[_0x3056('0x2c')][_0x3056('0x1c')]);}return _0x513640[_0x3056('0x46')](_0x5e8ee4);}})[_0x3056('0x21')](function(_0x2eb3b2){if(_0x2eb3b2){return _0x2eb3b2?{'count':_0x7d23c2,'rows':_0x2eb3b2}:null;}})[_0x3056('0x21')](respondWithResult(_0x81bc2a,null))['catch'](handleError(_0x81bc2a,null));};exports[_0x3056('0x47')]=function(_0xcf6c91,_0x15af87,_0x1964b2){if(_0xcf6c91['body']['id']){delete _0xcf6c91[_0x3056('0x42')]['id'];}return db[_0x3056('0x29')]['findOne']({'where':{'id':_0xcf6c91['params']['id']}})[_0x3056('0x21')](handleEntityNotFound(_0x15af87,null))[_0x3056('0x21')](function(_0x1616f9){if(_0x1616f9){_0xcf6c91['body'][_0x3056('0x48')]=_0x1616f9['id'];_0xcf6c91['body'][_0x3056('0x49')]=integrations[_0x3056('0x4a')](_0xcf6c91[_0x3056('0x42')][_0x3056('0x4b')],_0xcf6c91[_0x3056('0x42')][_0x3056('0x2b')]);_0xcf6c91[_0x3056('0x42')][_0x3056('0x4c')]=integrations[_0x3056('0x4d')](_0xcf6c91['body'][_0x3056('0x4b')],_0xcf6c91[_0x3056('0x42')][_0x3056('0x2b')]);return db['FreshsalesConfiguration'][_0x3056('0x41')](_0xcf6c91[_0x3056('0x42')],{'include':[{'model':db['FreshsalesField'],'as':_0x3056('0x49')},{'model':db[_0x3056('0x4e')],'as':_0x3056('0x4c')}]});}return null;})[_0x3056('0x21')](respondWithResult(_0x15af87,null))[_0x3056('0x3d')](handleError(_0x15af87,null));};exports[_0x3056('0x4f')]=function(_0x51f5f5,_0x462c19,_0x26de0c){var _0x59bfe9='';var _0x3d0f65='';return db[_0x3056('0x29')]['findOne']({'where':{'id':_0x51f5f5[_0x3056('0x3f')]['id']},'attributes':['id',_0x3056('0x50'),_0x3056('0x51'),_0x3056('0x52')]})[_0x3056('0x21')](handleEntityNotFound(_0x462c19,null))['then'](function(_0x26b8ec){if(_0x26b8ec){_0x3d0f65=_0x26b8ec['username'];_0x59bfe9=_0x26b8ec['remoteUri'];var _0x1f99fb=_0x26b8ec['remoteUri'][_0x3056('0x53')](-0x1);if(_0x1f99fb==='/'){_0x59bfe9=_0x59bfe9[_0x3056('0x54')](0x0,_0x59bfe9[_0x3056('0x55')](_0x1f99fb));}return rp({'method':'GET','uri':util['format'](_0x3056('0x56'),_0x59bfe9,'/api/selector/owners'),'headers':{'Authorization':_0x3056('0x57')+_0x26b8ec['apiKey']},'json':!![]});}})[_0x3056('0x21')](function(_0x11f789){if(_0x11f789){var _0x277ab0=_0x11f789[_0x3056('0x58')];var _0x451c96=![];var _0x530f3c=null;for(_0x530f3c=0x0;_0x530f3c<_0x277ab0[_0x3056('0x33')];_0x530f3c++){if(_0x277ab0[_0x530f3c][_0x3056('0x59')]===_0x3d0f65){_0x451c96=!![];}}if(_0x451c96){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0x3056('0x21')](respondWithResult(_0x462c19,null))[_0x3056('0x3d')](function(_0x11b9e6){var _0x3d13c7=_0x51f5f5[_0x3056('0x2c')]['test']?0x1f4:_0x11b9e6['statusCode']||0x1f4;logger[_0x3056('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x3056('0x4f'),_0x3d13c7,JSON[_0x3056('0x5a')](_0x11b9e6));delete _0x11b9e6[_0x3056('0x25')];if(_0x3d13c7===0x191){_0x3d13c7=0x190;}_0x462c19[_0x3056('0x19')](_0x3d13c7)[_0x3056('0x26')](_0x51f5f5['query'][_0x3056('0x5b')]?{'message':'Wrong\x20credentials','statusCode':_0x11b9e6[_0x3056('0x5c')]}:_0x11b9e6);});}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 3c01660..0d8d7c4 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 _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api'];(function(_0x190c9f,_0x1c29e7){var _0x2151b8=function(_0x157e2c){while(--_0x157e2c){_0x190c9f['push'](_0x190c9f['shift']());}};_0x2151b8(++_0x1c29e7);}(_0xdb28,0x106));var _0x8db2=function(_0x12b16b,_0x272881){_0x12b16b=_0x12b16b-0x0;var _0x1a59c7=_0xdb28[_0x12b16b];return _0x1a59c7;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var logger=require(_0x8db2('0x2'))(_0x8db2('0x3'));var moment=require('moment');var BPromise=require(_0x8db2('0x4'));var rp=require(_0x8db2('0x5'));var fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x8db2('0x9'));module[_0x8db2('0xa')]=function(_0x5f42ee,_0x494b40){return _0x5f42ee[_0x8db2('0xb')](_0x8db2('0xc'),attributes,{'tableName':_0x8db2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','lodash','util','../../config/logger','api','moment'];(function(_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 diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 28f6ce4..f1f04b5 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 _0x7bd0=['limit','include','model','map','GetFreshsalesAccount','ShowFreshsalesAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','FreshsalesAccount','findAll','options','raw','where','attributes'];(function(_0x34cafa,_0x52242a){var _0x446908=function(_0x31dc69){while(--_0x31dc69){_0x34cafa['push'](_0x34cafa['shift']());}};_0x446908(++_0x52242a);}(_0x7bd0,0x111));var _0x07bd=function(_0x5db99b,_0xdee23a){_0x5db99b=_0x5db99b-0x0;var _0x4b2d0e=_0x7bd0[_0x5db99b];return _0x4b2d0e;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var moment=require(_0x07bd('0x2'));var BPromise=require(_0x07bd('0x3'));var rs=require(_0x07bd('0x4'));var fs=require('fs');var Redis=require(_0x07bd('0x5'));var db=require(_0x07bd('0x6'))['db'];var utils=require(_0x07bd('0x7'));var logger=require('../../config/logger')(_0x07bd('0x8'));var config=require(_0x07bd('0x9'));var jayson=require(_0x07bd('0xa'));var client=jayson[_0x07bd('0xb')][_0x07bd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x422a22,_0x2e4cd1,_0x5a939d){return new BPromise(function(_0x3968d9,_0x5cd446){return client[_0x07bd('0xd')](_0x422a22,_0x5a939d)[_0x07bd('0xe')](function(_0x323724){logger['info'](_0x07bd('0xf'),_0x2e4cd1,_0x07bd('0x10'));logger[_0x07bd('0x11')](_0x07bd('0x12'),_0x2e4cd1,'request\x20sent',JSON[_0x07bd('0x13')](_0x323724));if(_0x323724[_0x07bd('0x14')]){if(_0x323724[_0x07bd('0x14')][_0x07bd('0x15')]===0x1f4){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x5cd446(_0x323724['error']['message']);}logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);return _0x3968d9(_0x323724[_0x07bd('0x14')][_0x07bd('0x16')]);}else{logger[_0x07bd('0x17')]('FreshsalesAccount,\x20%s,\x20%s',_0x2e4cd1,_0x07bd('0x10'));_0x3968d9(_0x323724['result'][_0x07bd('0x16')]);}})[_0x07bd('0x18')](function(_0x31655a){logger[_0x07bd('0x14')](_0x07bd('0xf'),_0x2e4cd1,_0x31655a);_0x5cd446(_0x31655a);});});}exports['GetFreshsalesAccount']=function(_0x3f9f0b){var _0xc4cf4c=this;return new Promise(function(_0x4948f4,_0x3e8ec4){return db[_0x07bd('0x19')][_0x07bd('0x1a')]({'raw':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1d')]||null:null,'attributes':_0x3f9f0b['options']?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'limit':_0x3f9f0b[_0x07bd('0x1b')]?_0x3f9f0b[_0x07bd('0x1b')][_0x07bd('0x1f')]||null:null,'include':_0x3f9f0b['options']?_0x3f9f0b['options'][_0x07bd('0x20')]?_['map'](_0x3f9f0b[_0x07bd('0x1b')]['include'],function(_0x50bd12){return{'model':db[_0x50bd12[_0x07bd('0x21')]],'as':_0x50bd12['as'],'attributes':_0x50bd12[_0x07bd('0x1e')],'include':_0x50bd12[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x50bd12[_0x07bd('0x20')],function(_0x43cbc8){return{'model':db[_0x43cbc8['model']],'as':_0x43cbc8['as'],'attributes':_0x43cbc8[_0x07bd('0x1e')],'include':_0x43cbc8[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x43cbc8[_0x07bd('0x20')],function(_0x12ce26){return{'model':db[_0x12ce26[_0x07bd('0x21')]],'as':_0x12ce26['as'],'attributes':_0x12ce26['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5184dc){logger[_0x07bd('0x17')](_0x07bd('0x23'),_0x3f9f0b);logger[_0x07bd('0x11')]('GetFreshsalesAccount',_0x3f9f0b,JSON[_0x07bd('0x13')](_0x5184dc));_0x4948f4(_0x5184dc);})[_0x07bd('0x18')](function(_0x253dc0){logger[_0x07bd('0x14')](_0x07bd('0x23'),_0x253dc0[_0x07bd('0x16')],_0x3f9f0b);_0x3e8ec4(_0xc4cf4c['error'](0x1f4,_0x253dc0[_0x07bd('0x16')]));});});};exports[_0x07bd('0x24')]=function(_0x4182b9){var _0x321200=this;return new Promise(function(_0x1b6cc,_0x314bda){return db[_0x07bd('0x19')][_0x07bd('0x25')]({'raw':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x1c')]===undefined?!![]:![]:!![],'where':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')]['where']||null:null,'attributes':_0x4182b9[_0x07bd('0x1b')]?_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x1e')]||null:null,'include':_0x4182b9['options']?_0x4182b9['options'][_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x4182b9[_0x07bd('0x1b')][_0x07bd('0x20')],function(_0x5f29c5){return{'model':db[_0x5f29c5[_0x07bd('0x21')]],'as':_0x5f29c5['as'],'attributes':_0x5f29c5[_0x07bd('0x1e')],'include':_0x5f29c5[_0x07bd('0x20')]?_['map'](_0x5f29c5[_0x07bd('0x20')],function(_0x31c381){return{'model':db[_0x31c381['model']],'as':_0x31c381['as'],'attributes':_0x31c381[_0x07bd('0x1e')],'include':_0x31c381[_0x07bd('0x20')]?_[_0x07bd('0x22')](_0x31c381[_0x07bd('0x20')],function(_0x5cde8d){return{'model':db[_0x5cde8d['model']],'as':_0x5cde8d['as'],'attributes':_0x5cde8d[_0x07bd('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c2878){logger[_0x07bd('0x17')](_0x07bd('0x24'),_0x4182b9);logger[_0x07bd('0x11')](_0x07bd('0x24'),_0x4182b9,JSON[_0x07bd('0x13')](_0x3c2878));_0x1b6cc(_0x3c2878);})[_0x07bd('0x18')](function(_0x333ac2){logger[_0x07bd('0x14')](_0x07bd('0x24'),_0x333ac2[_0x07bd('0x16')],_0x4182b9);_0x314bda(_0x321200[_0x07bd('0x14')](0x1f4,_0x333ac2[_0x07bd('0x16')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 0858bdc..40b79e7 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 _0x7c38=['get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller'];(function(_0x484da9,_0x341e4e){var _0x361959=function(_0x39e9ea){while(--_0x39e9ea){_0x484da9['push'](_0x484da9['shift']());}};_0x361959(++_0x341e4e);}(_0x7c38,0x10b));var _0x87c3=function(_0x1b614d,_0x3251eb){_0x1b614d=_0x1b614d-0x0;var _0x597574=_0x7c38[_0x1b614d];return _0x597574;};'use strict';var multer=require(_0x87c3('0x0'));var util=require(_0x87c3('0x1'));var path=require('path');var timeout=require(_0x87c3('0x2'));var express=require(_0x87c3('0x3'));var router=express[_0x87c3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x87c3('0x5'));var interaction=require(_0x87c3('0x6'));var config=require(_0x87c3('0x7'));var controller=require(_0x87c3('0x8'));router[_0x87c3('0x9')]('/',auth[_0x87c3('0xa')](),controller['index']);router[_0x87c3('0x9')](_0x87c3('0xb'),auth[_0x87c3('0xa')](),controller['show']);router['get'](_0x87c3('0xc'),auth[_0x87c3('0xa')](),controller[_0x87c3('0xd')]);router['get'](_0x87c3('0xe'),auth[_0x87c3('0xa')](),controller[_0x87c3('0xf')]);router[_0x87c3('0x9')](_0x87c3('0x10'),auth[_0x87c3('0xa')](),controller[_0x87c3('0x11')]);router['post']('/',auth[_0x87c3('0xa')](),controller[_0x87c3('0x12')]);router[_0x87c3('0x13')](_0x87c3('0xb'),auth[_0x87c3('0xa')](),controller[_0x87c3('0x14')]);router[_0x87c3('0x15')](_0x87c3('0xb'),auth[_0x87c3('0xa')](),controller[_0x87c3('0x16')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index f07aefd..22b7021 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 _0x23bb=['STRING','sequelize'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0x23bb,0x91));var _0xb23b=function(_0xa970d1,_0x8e9f98){_0xa970d1=_0xa970d1-0x0;var _0x4c5a31=_0x23bb[_0xa970d1];return _0x4c5a31;};'use strict';var Sequelize=require(_0xb23b('0x0'));module['exports']={'name':{'type':Sequelize[_0xb23b('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 3f84c6c..8f0c7b1 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 _0x8980=['keys','intersection','find','catch','create','body','getSubjects','getDescriptions','findOne','FreshsalesField','getFields','eml-format','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params'];(function(_0x528bc4,_0x4d3005){var _0x580720=function(_0x32a882){while(--_0x32a882){_0x528bc4['push'](_0x528bc4['shift']());}};_0x580720(++_0x4d3005);}(_0x8980,0x143));var _0x0898=function(_0x340214,_0x117887){_0x340214=_0x340214-0x0;var _0x5269ea=_0x8980[_0x340214];return _0x5269ea;};'use strict';var emlformat=require(_0x0898('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0898('0x1'));var rp=require(_0x0898('0x2'));var moment=require('moment');var BPromise=require(_0x0898('0x3'));var Mustache=require('mustache');var util=require(_0x0898('0x4'));var path=require('path');var sox=require(_0x0898('0x5'));var csv=require(_0x0898('0x6'));var ejs=require(_0x0898('0x7'));var fs=require('fs');var fs_extra=require(_0x0898('0x8'));var _=require(_0x0898('0x9'));var squel=require(_0x0898('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0898('0xb'));var toCsv=require(_0x0898('0x6'));var querystring=require(_0x0898('0xc'));var Papa=require('papaparse');var Redis=require(_0x0898('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0898('0xe'));var hardwareService=require(_0x0898('0xf'));var logger=require(_0x0898('0x10'))(_0x0898('0x11'));var utils=require(_0x0898('0x12'));var config=require(_0x0898('0x13'));var licenseUtil=require(_0x0898('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x428bfa,_0x154cb6){_0x154cb6=_0x154cb6||0xcc;return function(_0x549eb1){if(_0x549eb1){return _0x428bfa[_0x0898('0x15')](_0x154cb6);}return _0x428bfa['status'](_0x154cb6)[_0x0898('0x16')]();};}function respondWithResult(_0x577d45,_0x574395){_0x574395=_0x574395||0xc8;return function(_0xca7f2f){if(_0xca7f2f){return _0x577d45[_0x0898('0x17')](_0x574395)[_0x0898('0x18')](_0xca7f2f);}};}function respondWithFilteredResult(_0x4efdcf,_0x3c64e5){return function(_0x549104){if(_0x549104){var _0x339368=typeof _0x3c64e5[_0x0898('0x19')]===_0x0898('0x1a')&&typeof _0x3c64e5['limit']===_0x0898('0x1a');var _0x184d7b=_0x549104[_0x0898('0x1b')];var _0x238b71=_0x339368?0x0:_0x3c64e5[_0x0898('0x19')];var _0x464fe2=_0x339368?_0x549104[_0x0898('0x1b')]:_0x3c64e5['offset']+_0x3c64e5[_0x0898('0x1c')];var _0x374368;if(_0x464fe2>=_0x184d7b){_0x464fe2=_0x184d7b;_0x374368=0xc8;}else{_0x374368=0xce;}_0x4efdcf[_0x0898('0x17')](_0x374368);return _0x4efdcf[_0x0898('0x1d')](_0x0898('0x1e'),_0x238b71+'-'+_0x464fe2+'/'+_0x184d7b)[_0x0898('0x18')](_0x549104);}return null;};}function patchUpdates(_0x1b26dd){return function(_0x495660){try{jsonpatch[_0x0898('0x1f')](_0x495660,_0x1b26dd,!![]);}catch(_0xe82da0){return BPromise['reject'](_0xe82da0);}return _0x495660[_0x0898('0x20')]();};}function saveUpdates(_0x543271,_0x50ff28){return function(_0x4bd79e){if(_0x4bd79e){return _0x4bd79e[_0x0898('0x21')](_0x543271)[_0x0898('0x22')](function(_0x56f0ed){return _0x56f0ed;});}return null;};}function removeEntity(_0x3cc2cb,_0x439034){return function(_0x100553){if(_0x100553){return _0x100553[_0x0898('0x23')]()['then'](function(){_0x3cc2cb[_0x0898('0x17')](0xcc)[_0x0898('0x16')]();});}};}function handleEntityNotFound(_0x547254,_0x345ed7){return function(_0x486d31){if(!_0x486d31){_0x547254[_0x0898('0x15')](0x194);}return _0x486d31;};}function handleError(_0x1305a8,_0x3139e6){_0x3139e6=_0x3139e6||0x1f4;return function(_0x14c5bf){logger[_0x0898('0x24')](_0x14c5bf[_0x0898('0x25')]);if(_0x14c5bf[_0x0898('0x26')]){delete _0x14c5bf[_0x0898('0x26')];}_0x1305a8[_0x0898('0x17')](_0x3139e6)[_0x0898('0x27')](_0x14c5bf);};}exports[_0x0898('0x28')]=function(_0x4fac19,_0x182142){var _0xd6f30e={},_0x7727b0={},_0x4f5a41={'count':0x0,'rows':[]};var _0x1a0103=_[_0x0898('0x29')](db[_0x0898('0x2a')][_0x0898('0x2b')],function(_0x455436){return{'name':_0x455436[_0x0898('0x2c')],'type':_0x455436[_0x0898('0x2d')]['key']};});_0x7727b0[_0x0898('0x2e')]=_['map'](_0x1a0103,_0x0898('0x26'));_0x7727b0[_0x0898('0x2f')]=_['keys'](_0x4fac19['query']);_0x7727b0[_0x0898('0x30')]=_['intersection'](_0x7727b0[_0x0898('0x2e')],_0x7727b0[_0x0898('0x2f')]);_0xd6f30e[_0x0898('0x31')]=_['intersection'](_0x7727b0[_0x0898('0x2e')],qs['fields'](_0x4fac19[_0x0898('0x2f')][_0x0898('0x32')]));_0xd6f30e['attributes']=_0xd6f30e[_0x0898('0x31')][_0x0898('0x33')]?_0xd6f30e['attributes']:_0x7727b0[_0x0898('0x2e')];if(!_0x4fac19['query'][_0x0898('0x34')](_0x0898('0x35'))){_0xd6f30e['limit']=qs['limit'](_0x4fac19[_0x0898('0x2f')][_0x0898('0x1c')]);_0xd6f30e[_0x0898('0x19')]=qs[_0x0898('0x19')](_0x4fac19[_0x0898('0x2f')][_0x0898('0x19')]);}_0xd6f30e[_0x0898('0x36')]=qs[_0x0898('0x37')](_0x4fac19['query'][_0x0898('0x37')]);_0xd6f30e[_0x0898('0x38')]=qs[_0x0898('0x30')](_[_0x0898('0x39')](_0x4fac19['query'],_0x7727b0[_0x0898('0x30')]),_0x1a0103);if(_0x4fac19[_0x0898('0x2f')][_0x0898('0x3a')]){_0xd6f30e['where']=_[_0x0898('0x3b')](_0xd6f30e[_0x0898('0x38')],{'$or':_[_0x0898('0x29')](_0x1a0103,function(_0x3b7548){if(_0x3b7548[_0x0898('0x2d')]!==_0x0898('0x3c')){var _0xe464b9={};_0xe464b9[_0x3b7548[_0x0898('0x26')]]={'$like':'%'+_0x4fac19[_0x0898('0x2f')]['filter']+'%'};return _0xe464b9;}})});}_0xd6f30e=_['merge']({},_0xd6f30e,_0x4fac19[_0x0898('0x3d')]);var _0x4bf82d={'where':_0xd6f30e[_0x0898('0x38')]};return db[_0x0898('0x2a')][_0x0898('0x1b')](_0x4bf82d)[_0x0898('0x22')](function(_0x583c39){_0x4f5a41[_0x0898('0x1b')]=_0x583c39;if(_0x4fac19[_0x0898('0x2f')][_0x0898('0x3e')]){_0xd6f30e[_0x0898('0x3f')]=[{'all':!![]}];}return db[_0x0898('0x2a')][_0x0898('0x40')](_0xd6f30e);})[_0x0898('0x22')](function(_0x2ba8e3){_0x4f5a41['rows']=_0x2ba8e3;return _0x4f5a41;})[_0x0898('0x22')](respondWithFilteredResult(_0x182142,_0xd6f30e))['catch'](handleError(_0x182142,null));};exports[_0x0898('0x41')]=function(_0x6b504f,_0x3d7019){var _0x31e99f={'raw':![],'where':{'id':_0x6b504f[_0x0898('0x42')]['id']}},_0x5e9c8d={};_0x5e9c8d[_0x0898('0x2e')]=_[_0x0898('0x43')](db['FreshsalesConfiguration'][_0x0898('0x2b')]);_0x5e9c8d[_0x0898('0x2f')]=_[_0x0898('0x43')](_0x6b504f['query']);_0x5e9c8d['filters']=_[_0x0898('0x44')](_0x5e9c8d[_0x0898('0x2e')],_0x5e9c8d[_0x0898('0x2f')]);_0x31e99f[_0x0898('0x31')]=_['intersection'](_0x5e9c8d[_0x0898('0x2e')],qs[_0x0898('0x32')](_0x6b504f['query'][_0x0898('0x32')]));_0x31e99f[_0x0898('0x31')]=_0x31e99f['attributes'][_0x0898('0x33')]?_0x31e99f[_0x0898('0x31')]:_0x5e9c8d['model'];if(_0x6b504f['query'][_0x0898('0x3e')]){_0x31e99f[_0x0898('0x3f')]=[{'all':!![]}];}_0x31e99f=_[_0x0898('0x3b')]({},_0x31e99f,_0x6b504f[_0x0898('0x3d')]);return db[_0x0898('0x2a')][_0x0898('0x45')](_0x31e99f)[_0x0898('0x22')](handleEntityNotFound(_0x3d7019,null))[_0x0898('0x22')](respondWithResult(_0x3d7019,null))[_0x0898('0x46')](handleError(_0x3d7019,null));};exports[_0x0898('0x47')]=function(_0x101bc9,_0x27de5c){return db[_0x0898('0x2a')]['create'](_0x101bc9[_0x0898('0x48')],{})['then'](respondWithResult(_0x27de5c,0xc9))[_0x0898('0x46')](handleError(_0x27de5c,null));};exports[_0x0898('0x21')]=function(_0x3ee7f2,_0x44d022){if(_0x3ee7f2[_0x0898('0x48')]['id']){delete _0x3ee7f2[_0x0898('0x48')]['id'];}return db[_0x0898('0x2a')][_0x0898('0x45')]({'where':{'id':_0x3ee7f2['params']['id']}})['then'](handleEntityNotFound(_0x44d022,null))[_0x0898('0x22')](saveUpdates(_0x3ee7f2[_0x0898('0x48')],null))['then'](respondWithResult(_0x44d022,null))[_0x0898('0x46')](handleError(_0x44d022,null));};exports[_0x0898('0x23')]=function(_0x376276,_0x1149f8){return db[_0x0898('0x2a')][_0x0898('0x45')]({'where':{'id':_0x376276[_0x0898('0x42')]['id']}})[_0x0898('0x22')](handleEntityNotFound(_0x1149f8,null))[_0x0898('0x22')](removeEntity(_0x1149f8,null))[_0x0898('0x46')](handleError(_0x1149f8,null));};exports[_0x0898('0x49')]=function(_0x569020,_0x5c5df3,_0x237207){var _0x53b089={};var _0x2f2669={};var _0x29cd94;var _0x541aff;return db[_0x0898('0x2a')]['findOne']({'where':{'id':_0x569020['params']['id']}})[_0x0898('0x22')](handleEntityNotFound(_0x5c5df3,null))['then'](function(_0x3163ea){if(_0x3163ea){_0x29cd94=_0x3163ea;_0x2f2669[_0x0898('0x2e')]=_[_0x0898('0x43')](db['FreshsalesField'][_0x0898('0x2b')]);_0x2f2669[_0x0898('0x2f')]=_[_0x0898('0x43')](_0x569020[_0x0898('0x2f')]);_0x2f2669[_0x0898('0x30')]=_[_0x0898('0x44')](_0x2f2669[_0x0898('0x2e')],_0x2f2669[_0x0898('0x2f')]);_0x53b089[_0x0898('0x31')]=_['intersection'](_0x2f2669[_0x0898('0x2e')],qs[_0x0898('0x32')](_0x569020[_0x0898('0x2f')]['fields']));_0x53b089[_0x0898('0x31')]=_0x53b089['attributes'][_0x0898('0x33')]?_0x53b089[_0x0898('0x31')]:_0x2f2669[_0x0898('0x2e')];_0x53b089[_0x0898('0x36')]=qs['sort'](_0x569020[_0x0898('0x2f')]['sort']);_0x53b089[_0x0898('0x38')]=qs[_0x0898('0x30')](_['pick'](_0x569020['query'],_0x2f2669[_0x0898('0x30')]));if(_0x569020['query'][_0x0898('0x3a')]){_0x53b089[_0x0898('0x38')]=_[_0x0898('0x3b')](_0x53b089['where'],{'$or':_['map'](_0x53b089[_0x0898('0x31')],function(_0x21494b){var _0x246fa8={};_0x246fa8[_0x21494b]={'$like':'%'+_0x569020[_0x0898('0x2f')]['filter']+'%'};return _0x246fa8;})});}_0x53b089=_[_0x0898('0x3b')]({},_0x53b089,_0x569020[_0x0898('0x3d')]);return _0x29cd94[_0x0898('0x49')](_0x53b089);}})[_0x0898('0x22')](function(_0x289a08){if(_0x289a08){_0x541aff=_0x289a08[_0x0898('0x33')];if(!_0x569020[_0x0898('0x2f')][_0x0898('0x34')](_0x0898('0x35'))){_0x53b089[_0x0898('0x1c')]=qs[_0x0898('0x1c')](_0x569020[_0x0898('0x2f')]['limit']);_0x53b089['offset']=qs[_0x0898('0x19')](_0x569020[_0x0898('0x2f')]['offset']);}return _0x29cd94[_0x0898('0x49')](_0x53b089);}})[_0x0898('0x22')](function(_0x1f727a){if(_0x1f727a){return _0x1f727a?{'count':_0x541aff,'rows':_0x1f727a}:null;}})[_0x0898('0x22')](respondWithResult(_0x5c5df3,null))[_0x0898('0x46')](handleError(_0x5c5df3,null));};exports[_0x0898('0x4a')]=function(_0xbc0bea,_0x2bfdda,_0x283fb4){var _0x5bc79f={};var _0x124cfc={};var _0x5918ef;var _0x3d3e05;return db[_0x0898('0x2a')][_0x0898('0x4b')]({'where':{'id':_0xbc0bea[_0x0898('0x42')]['id']}})['then'](handleEntityNotFound(_0x2bfdda,null))['then'](function(_0x344968){if(_0x344968){_0x5918ef=_0x344968;_0x124cfc[_0x0898('0x2e')]=_['keys'](db[_0x0898('0x4c')][_0x0898('0x2b')]);_0x124cfc[_0x0898('0x2f')]=_[_0x0898('0x43')](_0xbc0bea[_0x0898('0x2f')]);_0x124cfc[_0x0898('0x30')]=_['intersection'](_0x124cfc['model'],_0x124cfc[_0x0898('0x2f')]);_0x5bc79f['attributes']=_[_0x0898('0x44')](_0x124cfc[_0x0898('0x2e')],qs[_0x0898('0x32')](_0xbc0bea[_0x0898('0x2f')][_0x0898('0x32')]));_0x5bc79f[_0x0898('0x31')]=_0x5bc79f[_0x0898('0x31')]['length']?_0x5bc79f['attributes']:_0x124cfc[_0x0898('0x2e')];_0x5bc79f[_0x0898('0x36')]=qs[_0x0898('0x37')](_0xbc0bea[_0x0898('0x2f')]['sort']);_0x5bc79f[_0x0898('0x38')]=qs['filters'](_[_0x0898('0x39')](_0xbc0bea[_0x0898('0x2f')],_0x124cfc[_0x0898('0x30')]));if(_0xbc0bea[_0x0898('0x2f')][_0x0898('0x3a')]){_0x5bc79f['where']=_[_0x0898('0x3b')](_0x5bc79f[_0x0898('0x38')],{'$or':_['map'](_0x5bc79f[_0x0898('0x31')],function(_0xd4db76){var _0x19824d={};_0x19824d[_0xd4db76]={'$like':'%'+_0xbc0bea[_0x0898('0x2f')][_0x0898('0x3a')]+'%'};return _0x19824d;})});}_0x5bc79f=_[_0x0898('0x3b')]({},_0x5bc79f,_0xbc0bea[_0x0898('0x3d')]);return _0x5918ef[_0x0898('0x4a')](_0x5bc79f);}})[_0x0898('0x22')](function(_0xba5c70){if(_0xba5c70){_0x3d3e05=_0xba5c70[_0x0898('0x33')];if(!_0xbc0bea['query'][_0x0898('0x34')](_0x0898('0x35'))){_0x5bc79f[_0x0898('0x1c')]=qs[_0x0898('0x1c')](_0xbc0bea[_0x0898('0x2f')][_0x0898('0x1c')]);_0x5bc79f[_0x0898('0x19')]=qs[_0x0898('0x19')](_0xbc0bea[_0x0898('0x2f')][_0x0898('0x19')]);}return _0x5918ef[_0x0898('0x4a')](_0x5bc79f);}})['then'](function(_0x45457b){if(_0x45457b){return _0x45457b?{'count':_0x3d3e05,'rows':_0x45457b}:null;}})[_0x0898('0x22')](respondWithResult(_0x2bfdda,null))[_0x0898('0x46')](handleError(_0x2bfdda,null));};exports[_0x0898('0x4d')]=function(_0x212d3f,_0x2a73a4,_0x158364){var _0x2c61cb={};var _0x1ad792={};var _0x2094b8;var _0x2aa11a;return db['FreshsalesConfiguration'][_0x0898('0x4b')]({'where':{'id':_0x212d3f[_0x0898('0x42')]['id']}})[_0x0898('0x22')](handleEntityNotFound(_0x2a73a4,null))[_0x0898('0x22')](function(_0x199d1f){if(_0x199d1f){_0x2094b8=_0x199d1f;_0x1ad792['model']=_[_0x0898('0x43')](db[_0x0898('0x4c')][_0x0898('0x2b')]);_0x1ad792[_0x0898('0x2f')]=_[_0x0898('0x43')](_0x212d3f[_0x0898('0x2f')]);_0x1ad792[_0x0898('0x30')]=_[_0x0898('0x44')](_0x1ad792[_0x0898('0x2e')],_0x1ad792[_0x0898('0x2f')]);_0x2c61cb['attributes']=_['intersection'](_0x1ad792['model'],qs[_0x0898('0x32')](_0x212d3f['query'][_0x0898('0x32')]));_0x2c61cb[_0x0898('0x31')]=_0x2c61cb['attributes'][_0x0898('0x33')]?_0x2c61cb['attributes']:_0x1ad792[_0x0898('0x2e')];_0x2c61cb['order']=qs['sort'](_0x212d3f[_0x0898('0x2f')][_0x0898('0x37')]);_0x2c61cb[_0x0898('0x38')]=qs[_0x0898('0x30')](_['pick'](_0x212d3f['query'],_0x1ad792[_0x0898('0x30')]));if(_0x212d3f[_0x0898('0x2f')][_0x0898('0x3a')]){_0x2c61cb[_0x0898('0x38')]=_[_0x0898('0x3b')](_0x2c61cb['where'],{'$or':_['map'](_0x2c61cb[_0x0898('0x31')],function(_0xed67ab){var _0x1c5094={};_0x1c5094[_0xed67ab]={'$like':'%'+_0x212d3f[_0x0898('0x2f')]['filter']+'%'};return _0x1c5094;})});}_0x2c61cb=_[_0x0898('0x3b')]({},_0x2c61cb,_0x212d3f['options']);return _0x2094b8[_0x0898('0x4d')](_0x2c61cb);}})[_0x0898('0x22')](function(_0x3b803b){if(_0x3b803b){_0x2aa11a=_0x3b803b['length'];if(!_0x212d3f[_0x0898('0x2f')]['hasOwnProperty'](_0x0898('0x35'))){_0x2c61cb[_0x0898('0x1c')]=qs['limit'](_0x212d3f['query'][_0x0898('0x1c')]);_0x2c61cb[_0x0898('0x19')]=qs[_0x0898('0x19')](_0x212d3f[_0x0898('0x2f')][_0x0898('0x19')]);}return _0x2094b8[_0x0898('0x4d')](_0x2c61cb);}})['then'](function(_0x2c5211){if(_0x2c5211){return _0x2c5211?{'count':_0x2aa11a,'rows':_0x2c5211}:null;}})[_0x0898('0x22')](respondWithResult(_0x2a73a4,null))[_0x0898('0x46')](handleError(_0x2a73a4,null));}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 382e3d6..d54b26f 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 _0x1f51=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','FreshsalesConfiguration','lodash'];(function(_0x134098,_0x5393ba){var _0x1dfeb1=function(_0x17e371){while(--_0x17e371){_0x134098['push'](_0x134098['shift']());}};_0x1dfeb1(++_0x5393ba);}(_0x1f51,0x12b));var _0x11f5=function(_0x12c2b0,_0x438b2c){_0x12c2b0=_0x12c2b0-0x0;var _0x218170=_0x1f51[_0x12c2b0];return _0x218170;};'use strict';var _=require(_0x11f5('0x0'));var util=require('util');var logger=require(_0x11f5('0x1'))('api');var moment=require(_0x11f5('0x2'));var BPromise=require(_0x11f5('0x3'));var rp=require(_0x11f5('0x4'));var fs=require('fs');var path=require(_0x11f5('0x5'));var rimraf=require(_0x11f5('0x6'));var config=require(_0x11f5('0x7'));var attributes=require(_0x11f5('0x8'));module['exports']=function(_0x5d178e,_0x18c8d2){return _0x5d178e['define'](_0x11f5('0x9'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index dbc8032..9d3dd71 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 _0xa479=['FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2c27ed,_0x5c50f0){var _0x597bd1=function(_0xd6db18){while(--_0xd6db18){_0x2c27ed['push'](_0x2c27ed['shift']());}};_0x597bd1(++_0x5c50f0);}(_0xa479,0xd3));var _0x9a47=function(_0x4fd3e5,_0x1ad7cd){_0x4fd3e5=_0x4fd3e5-0x0;var _0x44264b=_0xa479[_0x4fd3e5];return _0x44264b;};'use strict';var _=require(_0x9a47('0x0'));var util=require(_0x9a47('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9a47('0x2'));var fs=require('fs');var Redis=require(_0x9a47('0x3'));var db=require(_0x9a47('0x4'))['db'];var utils=require(_0x9a47('0x5'));var logger=require(_0x9a47('0x6'))(_0x9a47('0x7'));var config=require(_0x9a47('0x8'));var jayson=require(_0x9a47('0x9'));var client=jayson[_0x9a47('0xa')][_0x9a47('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x53c08b,_0x250a3a,_0x42ef58){return new BPromise(function(_0x54fce8,_0x3f57da){return client[_0x9a47('0xc')](_0x53c08b,_0x42ef58)[_0x9a47('0xd')](function(_0x123675){logger['info'](_0x9a47('0xe'),_0x250a3a,'request\x20sent');logger[_0x9a47('0xf')](_0x9a47('0x10'),_0x250a3a,_0x9a47('0x11'),JSON[_0x9a47('0x12')](_0x123675));if(_0x123675[_0x9a47('0x13')]){if(_0x123675[_0x9a47('0x13')][_0x9a47('0x14')]===0x1f4){logger['error'](_0x9a47('0xe'),_0x250a3a,_0x123675[_0x9a47('0x13')][_0x9a47('0x15')]);return _0x3f57da(_0x123675[_0x9a47('0x13')][_0x9a47('0x15')]);}logger[_0x9a47('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x250a3a,_0x123675[_0x9a47('0x13')][_0x9a47('0x15')]);return _0x54fce8(_0x123675[_0x9a47('0x13')]['message']);}else{logger[_0x9a47('0x16')](_0x9a47('0xe'),_0x250a3a,_0x9a47('0x11'));_0x54fce8(_0x123675[_0x9a47('0x17')][_0x9a47('0x15')]);}})[_0x9a47('0x18')](function(_0x14462c){logger[_0x9a47('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x250a3a,_0x14462c);_0x3f57da(_0x14462c);});});} \ No newline at end of file +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 diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ea7be63..6a9c8aa 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 _0xe812=['destroy','exports','util','path','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','update','delete'];(function(_0x29b93b,_0x427d53){var _0x31911d=function(_0x4cebc9){while(--_0x4cebc9){_0x29b93b['push'](_0x29b93b['shift']());}};_0x31911d(++_0x427d53);}(_0xe812,0x1f2));var _0x2e81=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xe812[_0x4b369d];return _0x571a98;};'use strict';var multer=require('multer');var util=require(_0x2e81('0x0'));var path=require(_0x2e81('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2e81('0x2')]();var fs_extra=require(_0x2e81('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2e81('0x4'));var config=require(_0x2e81('0x5'));var controller=require('./intFreshsalesField.controller');router[_0x2e81('0x6')]('/',auth[_0x2e81('0x7')](),controller['index']);router[_0x2e81('0x6')](_0x2e81('0x8'),auth[_0x2e81('0x7')](),controller['show']);router[_0x2e81('0x9')]('/',auth[_0x2e81('0x7')](),controller[_0x2e81('0xa')]);router[_0x2e81('0xb')]('/:id',auth[_0x2e81('0x7')](),controller[_0x2e81('0xc')]);router[_0x2e81('0xd')](_0x2e81('0x8'),auth[_0x2e81('0x7')](),controller[_0x2e81('0xe')]);module[_0x2e81('0xf')]=router; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index e7bde70..137a4fa 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 _0x2f19=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','picklist','STRING','variable'];(function(_0x29725c,_0x1595bb){var _0x36339e=function(_0x33f780){while(--_0x33f780){_0x29725c['push'](_0x29725c['shift']());}};_0x36339e(++_0x1595bb);}(_0x2f19,0xac));var _0x92f1=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0x2f19[_0x154cb5];return _0x3f574f;};'use strict';var Sequelize=require(_0x92f1('0x0'));module[_0x92f1('0x1')]={'type':{'type':Sequelize[_0x92f1('0x2')](_0x92f1('0x3'),'variable',_0x92f1('0x4'),'keyValue',_0x92f1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x92f1('0x6')]},'keyType':{'type':Sequelize[_0x92f1('0x2')](_0x92f1('0x3'),_0x92f1('0x7'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x92f1('0x6')]},'customField':{'type':Sequelize[_0x92f1('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x92f1('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index f7f2f9e..0800a01 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 _0x5e62=['attributes','fields','length','hasOwnProperty','order','sort','where','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','params','create','update','body','find','rimraf','zip-dir','fast-json-patch','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','error','stack','name','index','map','FreshsalesField','rawAttributes','fieldName','key','model','query','keys','filters','intersection'];(function(_0x51c392,_0x414ce6){var _0x3da072=function(_0x3853be){while(--_0x3853be){_0x51c392['push'](_0x51c392['shift']());}};_0x3da072(++_0x414ce6);}(_0x5e62,0x1d2));var _0x25e6=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0x5e62[_0x2fc012];return _0x2891f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x25e6('0x0'));var zipdir=require(_0x25e6('0x1'));var jsonpatch=require(_0x25e6('0x2'));var rp=require('request-promise');var moment=require(_0x25e6('0x3'));var BPromise=require(_0x25e6('0x4'));var Mustache=require(_0x25e6('0x5'));var util=require(_0x25e6('0x6'));var path=require(_0x25e6('0x7'));var sox=require(_0x25e6('0x8'));var csv=require(_0x25e6('0x9'));var ejs=require(_0x25e6('0xa'));var fs=require('fs');var fs_extra=require(_0x25e6('0xb'));var _=require(_0x25e6('0xc'));var squel=require(_0x25e6('0xd'));var crypto=require(_0x25e6('0xe'));var jsforce=require(_0x25e6('0xf'));var deskjs=require(_0x25e6('0x10'));var toCsv=require(_0x25e6('0x9'));var querystring=require('querystring');var Papa=require(_0x25e6('0x11'));var Redis=require(_0x25e6('0x12'));var authService=require(_0x25e6('0x13'));var qs=require(_0x25e6('0x14'));var as=require(_0x25e6('0x15'));var hardwareService=require(_0x25e6('0x16'));var logger=require(_0x25e6('0x17'))('api');var utils=require(_0x25e6('0x18'));var config=require(_0x25e6('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x25e6('0x1a'))['db'];function respondWithStatusCode(_0x55ea53,_0x5542ef){_0x5542ef=_0x5542ef||0xcc;return function(_0x2aaa96){if(_0x2aaa96){return _0x55ea53[_0x25e6('0x1b')](_0x5542ef);}return _0x55ea53[_0x25e6('0x1c')](_0x5542ef)[_0x25e6('0x1d')]();};}function respondWithResult(_0x4d0069,_0x2a1a93){_0x2a1a93=_0x2a1a93||0xc8;return function(_0x575a0c){if(_0x575a0c){return _0x4d0069[_0x25e6('0x1c')](_0x2a1a93)[_0x25e6('0x1e')](_0x575a0c);}};}function respondWithFilteredResult(_0x19298f,_0x409afb){return function(_0x4d90fd){if(_0x4d90fd){var _0x46824d=typeof _0x409afb[_0x25e6('0x1f')]===_0x25e6('0x20')&&typeof _0x409afb[_0x25e6('0x21')]==='undefined';var _0x28ba8e=_0x4d90fd['count'];var _0x49d420=_0x46824d?0x0:_0x409afb[_0x25e6('0x1f')];var _0x2651ac=_0x46824d?_0x4d90fd[_0x25e6('0x22')]:_0x409afb[_0x25e6('0x1f')]+_0x409afb[_0x25e6('0x21')];var _0x323ccb;if(_0x2651ac>=_0x28ba8e){_0x2651ac=_0x28ba8e;_0x323ccb=0xc8;}else{_0x323ccb=0xce;}_0x19298f['status'](_0x323ccb);return _0x19298f['set']('Content-Range',_0x49d420+'-'+_0x2651ac+'/'+_0x28ba8e)[_0x25e6('0x1e')](_0x4d90fd);}return null;};}function patchUpdates(_0x3920e5){return function(_0x6fcdeb){try{jsonpatch['apply'](_0x6fcdeb,_0x3920e5,!![]);}catch(_0x5a7926){return BPromise[_0x25e6('0x23')](_0x5a7926);}return _0x6fcdeb[_0x25e6('0x24')]();};}function saveUpdates(_0x4c87b1,_0x3b9e2e){return function(_0x22bc28){if(_0x22bc28){return _0x22bc28['update'](_0x4c87b1)[_0x25e6('0x25')](function(_0x2da34f){return _0x2da34f;});}return null;};}function removeEntity(_0xb4bee9,_0x278f36){return function(_0x309aeb){if(_0x309aeb){return _0x309aeb['destroy']()['then'](function(){_0xb4bee9[_0x25e6('0x1c')](0xcc)[_0x25e6('0x1d')]();});}};}function handleEntityNotFound(_0x4fb658,_0x579a88){return function(_0x28e70e){if(!_0x28e70e){_0x4fb658['sendStatus'](0x194);}return _0x28e70e;};}function handleError(_0x73c3f1,_0x19b248){_0x19b248=_0x19b248||0x1f4;return function(_0x171a85){logger[_0x25e6('0x26')](_0x171a85[_0x25e6('0x27')]);if(_0x171a85[_0x25e6('0x28')]){delete _0x171a85[_0x25e6('0x28')];}_0x73c3f1[_0x25e6('0x1c')](_0x19b248)['send'](_0x171a85);};}exports[_0x25e6('0x29')]=function(_0x1834db,_0xf02123){var _0x52c3ad={},_0x59d0b5={},_0x111d6c={'count':0x0,'rows':[]};var _0x1617d5=_[_0x25e6('0x2a')](db[_0x25e6('0x2b')][_0x25e6('0x2c')],function(_0x36f3d8){return{'name':_0x36f3d8[_0x25e6('0x2d')],'type':_0x36f3d8['type'][_0x25e6('0x2e')]};});_0x59d0b5[_0x25e6('0x2f')]=_['map'](_0x1617d5,_0x25e6('0x28'));_0x59d0b5[_0x25e6('0x30')]=_[_0x25e6('0x31')](_0x1834db[_0x25e6('0x30')]);_0x59d0b5[_0x25e6('0x32')]=_[_0x25e6('0x33')](_0x59d0b5[_0x25e6('0x2f')],_0x59d0b5[_0x25e6('0x30')]);_0x52c3ad[_0x25e6('0x34')]=_['intersection'](_0x59d0b5[_0x25e6('0x2f')],qs[_0x25e6('0x35')](_0x1834db[_0x25e6('0x30')][_0x25e6('0x35')]));_0x52c3ad[_0x25e6('0x34')]=_0x52c3ad[_0x25e6('0x34')][_0x25e6('0x36')]?_0x52c3ad['attributes']:_0x59d0b5['model'];if(!_0x1834db[_0x25e6('0x30')][_0x25e6('0x37')]('nolimit')){_0x52c3ad[_0x25e6('0x21')]=qs[_0x25e6('0x21')](_0x1834db[_0x25e6('0x30')][_0x25e6('0x21')]);_0x52c3ad[_0x25e6('0x1f')]=qs[_0x25e6('0x1f')](_0x1834db['query'][_0x25e6('0x1f')]);}_0x52c3ad[_0x25e6('0x38')]=qs[_0x25e6('0x39')](_0x1834db['query'][_0x25e6('0x39')]);_0x52c3ad[_0x25e6('0x3a')]=qs[_0x25e6('0x32')](_['pick'](_0x1834db[_0x25e6('0x30')],_0x59d0b5[_0x25e6('0x32')]),_0x1617d5);if(_0x1834db[_0x25e6('0x30')]['filter']){_0x52c3ad['where']=_['merge'](_0x52c3ad[_0x25e6('0x3a')],{'$or':_[_0x25e6('0x2a')](_0x1617d5,function(_0x33ca38){if(_0x33ca38[_0x25e6('0x3b')]!==_0x25e6('0x3c')){var _0x4b7f0c={};_0x4b7f0c[_0x33ca38[_0x25e6('0x28')]]={'$like':'%'+_0x1834db['query'][_0x25e6('0x3d')]+'%'};return _0x4b7f0c;}})});}_0x52c3ad=_[_0x25e6('0x3e')]({},_0x52c3ad,_0x1834db[_0x25e6('0x3f')]);var _0x526fc4={'where':_0x52c3ad[_0x25e6('0x3a')]};return db['FreshsalesField']['count'](_0x526fc4)[_0x25e6('0x25')](function(_0x118cce){_0x111d6c[_0x25e6('0x22')]=_0x118cce;if(_0x1834db[_0x25e6('0x30')][_0x25e6('0x40')]){_0x52c3ad[_0x25e6('0x41')]=[{'all':!![]}];}return db[_0x25e6('0x2b')][_0x25e6('0x42')](_0x52c3ad);})[_0x25e6('0x25')](function(_0x2104b2){_0x111d6c['rows']=_0x2104b2;return _0x111d6c;})[_0x25e6('0x25')](respondWithFilteredResult(_0xf02123,_0x52c3ad))[_0x25e6('0x43')](handleError(_0xf02123,null));};exports[_0x25e6('0x44')]=function(_0x574149,_0x29f567){var _0x4ad853={'raw':!![],'where':{'id':_0x574149[_0x25e6('0x45')]['id']}},_0xbbb2b6={};_0xbbb2b6[_0x25e6('0x2f')]=_[_0x25e6('0x31')](db[_0x25e6('0x2b')]['rawAttributes']);_0xbbb2b6[_0x25e6('0x30')]=_[_0x25e6('0x31')](_0x574149['query']);_0xbbb2b6[_0x25e6('0x32')]=_['intersection'](_0xbbb2b6[_0x25e6('0x2f')],_0xbbb2b6[_0x25e6('0x30')]);_0x4ad853[_0x25e6('0x34')]=_[_0x25e6('0x33')](_0xbbb2b6[_0x25e6('0x2f')],qs['fields'](_0x574149['query'][_0x25e6('0x35')]));_0x4ad853['attributes']=_0x4ad853[_0x25e6('0x34')][_0x25e6('0x36')]?_0x4ad853['attributes']:_0xbbb2b6[_0x25e6('0x2f')];if(_0x574149[_0x25e6('0x30')][_0x25e6('0x40')]){_0x4ad853['include']=[{'all':!![]}];}_0x4ad853=_[_0x25e6('0x3e')]({},_0x4ad853,_0x574149[_0x25e6('0x3f')]);return db[_0x25e6('0x2b')]['find'](_0x4ad853)[_0x25e6('0x25')](handleEntityNotFound(_0x29f567,null))['then'](respondWithResult(_0x29f567,null))[_0x25e6('0x43')](handleError(_0x29f567,null));};exports[_0x25e6('0x46')]=function(_0x47eec1,_0x24acf0){return db[_0x25e6('0x2b')][_0x25e6('0x46')](_0x47eec1['body'],{})[_0x25e6('0x25')](respondWithResult(_0x24acf0,0xc9))[_0x25e6('0x43')](handleError(_0x24acf0,null));};exports[_0x25e6('0x47')]=function(_0x1f1893,_0x19b36f){if(_0x1f1893[_0x25e6('0x48')]['id']){delete _0x1f1893[_0x25e6('0x48')]['id'];}return db[_0x25e6('0x2b')][_0x25e6('0x49')]({'where':{'id':_0x1f1893['params']['id']}})['then'](handleEntityNotFound(_0x19b36f,null))['then'](saveUpdates(_0x1f1893[_0x25e6('0x48')],null))[_0x25e6('0x25')](respondWithResult(_0x19b36f,null))['catch'](handleError(_0x19b36f,null));};exports['destroy']=function(_0x36417f,_0x36bf77){return db['FreshsalesField'][_0x25e6('0x49')]({'where':{'id':_0x36417f[_0x25e6('0x45')]['id']}})[_0x25e6('0x25')](handleEntityNotFound(_0x36bf77,null))['then'](removeEntity(_0x36bf77,null))[_0x25e6('0x43')](handleError(_0x36bf77,null));}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index f58d0e9..6d664f0 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 _0xe890=['freshsales_unique_index','idField','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe890,0x1a6));var _0x0e89=function(_0x3bbffe,_0x4b2a2b){_0x3bbffe=_0x3bbffe-0x0;var _0x1abe39=_0xe890[_0x3bbffe];return _0x1abe39;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e89('0x0'))(_0x0e89('0x1'));var moment=require(_0x0e89('0x2'));var BPromise=require(_0x0e89('0x3'));var rp=require(_0x0e89('0x4'));var fs=require('fs');var path=require(_0x0e89('0x5'));var rimraf=require(_0x0e89('0x6'));var config=require(_0x0e89('0x7'));var attributes=require(_0x0e89('0x8'));module[_0x0e89('0x9')]=function(_0x563a51,_0x58f553){return _0x563a51[_0x0e89('0xa')](_0x0e89('0xb'),attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0x0e89('0xc'),'fields':[_0x0e89('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index e756627..5a66323 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 _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x30ae0d,_0x54a175){var _0x2d7416=function(_0x30bfd1){while(--_0x30bfd1){_0x30ae0d['push'](_0x30ae0d['shift']());}};_0x2d7416(++_0x54a175);}(_0xeda8,0x104));var _0x8eda=function(_0x1e1c73,_0x450fda){_0x1e1c73=_0x1e1c73-0x0;var _0x2c3d6a=_0xeda8[_0x1e1c73];return _0x2c3d6a;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file +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 diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 90f08f3..73e2ef2 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x38ce69,_0x17cd22){var _0x2f080c=function(_0x303b2a){while(--_0x303b2a){_0x38ce69['push'](_0x38ce69['shift']());}};_0x2f080c(++_0x17cd22);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 37dd0f0..8e81e6d 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 _0x184d=['STRING','integrationTab','exports'];(function(_0x40a77f,_0x1d5f8d){var _0x415aa1=function(_0x1e45bc){while(--_0x1e45bc){_0x40a77f['push'](_0x40a77f['shift']());}};_0x415aa1(++_0x1d5f8d);}(_0x184d,0x1d0));var _0xd184=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0x184d[_0x616290];return _0x453879;};'use strict';var Sequelize=require('sequelize');module[_0xd184('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0xd184('0x1')]},'password':{'type':Sequelize[_0xd184('0x1')]},'clientId':{'type':Sequelize[_0xd184('0x1')]},'clientSecret':{'type':Sequelize[_0xd184('0x1')]},'securityToken':{'type':Sequelize[_0xd184('0x1')]},'serverUrl':{'type':Sequelize[_0xd184('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab','newTab'),'defaultValue':_0xd184('0x2')}}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index c54995b..10c2b99 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 _0x5997=['email','phone','remove','label','custom','picklistValues','value','True','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','SalesforceAccount','include','findAll','rows','catch','rawAttributes','keys','length','options','find','create','body','params','findOne','SalesforceConfiguration','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean'];(function(_0x2eaa8d,_0x44cd5d){var _0x566cad=function(_0x1a9abb){while(--_0x1a9abb){_0x2eaa8d['push'](_0x2eaa8d['shift']());}};_0x566cad(++_0x44cd5d);}(_0x5997,0x8e));var _0x7599=function(_0x32b8a9,_0x59d62b){_0x32b8a9=_0x32b8a9-0x0;var _0x40105c=_0x5997[_0x32b8a9];return _0x40105c;};'use strict';var emlformat=require(_0x7599('0x0'));var rimraf=require(_0x7599('0x1'));var zipdir=require(_0x7599('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7599('0x3'));var moment=require(_0x7599('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7599('0x5'));var util=require(_0x7599('0x6'));var path=require(_0x7599('0x7'));var sox=require(_0x7599('0x8'));var csv=require(_0x7599('0x9'));var ejs=require(_0x7599('0xa'));var fs=require('fs');var fs_extra=require(_0x7599('0xb'));var _=require(_0x7599('0xc'));var squel=require(_0x7599('0xd'));var crypto=require('crypto');var jsforce=require(_0x7599('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7599('0x9'));var querystring=require(_0x7599('0xf'));var Papa=require('papaparse');var Redis=require(_0x7599('0x10'));var authService=require(_0x7599('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7599('0x12'));var hardwareService=require(_0x7599('0x13'));var logger=require(_0x7599('0x14'))(_0x7599('0x15'));var utils=require(_0x7599('0x16'));var config=require(_0x7599('0x17'));var licenseUtil=require(_0x7599('0x18'));var db=require(_0x7599('0x19'))['db'];var integrations=require(_0x7599('0x1a'));function respondWithStatusCode(_0x4e2587,_0x31f334){_0x31f334=_0x31f334||0xcc;return function(_0x2aed0c){if(_0x2aed0c){return _0x4e2587['sendStatus'](_0x31f334);}return _0x4e2587[_0x7599('0x1b')](_0x31f334)[_0x7599('0x1c')]();};}function respondWithResult(_0x3b289c,_0x21d135){_0x21d135=_0x21d135||0xc8;return function(_0x164347){if(_0x164347){return _0x3b289c[_0x7599('0x1b')](_0x21d135)[_0x7599('0x1d')](_0x164347);}};}function respondWithFilteredResult(_0x122ad9,_0x2a9a10){return function(_0x1db338){if(_0x1db338){var _0x2f48e7=typeof _0x2a9a10[_0x7599('0x1e')]===_0x7599('0x1f')&&typeof _0x2a9a10[_0x7599('0x20')]==='undefined';var _0xec375b=_0x1db338[_0x7599('0x21')];var _0x2cc05b=_0x2f48e7?0x0:_0x2a9a10[_0x7599('0x1e')];var _0x573859=_0x2f48e7?_0x1db338[_0x7599('0x21')]:_0x2a9a10['offset']+_0x2a9a10[_0x7599('0x20')];var _0xf164c4;if(_0x573859>=_0xec375b){_0x573859=_0xec375b;_0xf164c4=0xc8;}else{_0xf164c4=0xce;}_0x122ad9[_0x7599('0x1b')](_0xf164c4);return _0x122ad9[_0x7599('0x22')](_0x7599('0x23'),_0x2cc05b+'-'+_0x573859+'/'+_0xec375b)[_0x7599('0x1d')](_0x1db338);}return null;};}function patchUpdates(_0x1f64bd){return function(_0x3a9c30){try{jsonpatch[_0x7599('0x24')](_0x3a9c30,_0x1f64bd,!![]);}catch(_0x3e8d8e){return BPromise['reject'](_0x3e8d8e);}return _0x3a9c30[_0x7599('0x25')]();};}function saveUpdates(_0x2e2701,_0x5493c3){return function(_0x27c85c){if(_0x27c85c){return _0x27c85c[_0x7599('0x26')](_0x2e2701)[_0x7599('0x27')](function(_0x5c73a0){return _0x5c73a0;});}return null;};}function removeEntity(_0x19f1b6,_0x1cf20f){return function(_0x791454){if(_0x791454){return _0x791454[_0x7599('0x28')]()[_0x7599('0x27')](function(){_0x19f1b6[_0x7599('0x1b')](0xcc)[_0x7599('0x1c')]();});}};}function handleEntityNotFound(_0x29be95,_0x48af8e){return function(_0x2dbc8d){if(!_0x2dbc8d){_0x29be95[_0x7599('0x29')](0x194);}return _0x2dbc8d;};}function handleError(_0x4d860e,_0x4d0350){_0x4d0350=_0x4d0350||0x1f4;return function(_0x528c26){logger['error'](_0x528c26[_0x7599('0x2a')]);if(_0x528c26[_0x7599('0x2b')]){delete _0x528c26[_0x7599('0x2b')];}_0x4d860e[_0x7599('0x1b')](_0x4d0350)['send'](_0x528c26);};}exports[_0x7599('0x2c')]=function(_0x4e4492,_0x825330){var _0x1022e6={},_0x46d1cd={},_0x11fd80={'count':0x0,'rows':[]};var _0x5d9b5d=_[_0x7599('0x2d')](db['SalesforceAccount']['rawAttributes'],function(_0x15578f){return{'name':_0x15578f[_0x7599('0x2e')],'type':_0x15578f['type'][_0x7599('0x2f')]};});_0x46d1cd[_0x7599('0x30')]=_[_0x7599('0x2d')](_0x5d9b5d,_0x7599('0x2b'));_0x46d1cd[_0x7599('0x31')]=_['keys'](_0x4e4492[_0x7599('0x31')]);_0x46d1cd[_0x7599('0x32')]=_[_0x7599('0x33')](_0x46d1cd['model'],_0x46d1cd[_0x7599('0x31')]);_0x1022e6[_0x7599('0x34')]=_[_0x7599('0x33')](_0x46d1cd[_0x7599('0x30')],qs[_0x7599('0x35')](_0x4e4492[_0x7599('0x31')][_0x7599('0x35')]));_0x1022e6[_0x7599('0x34')]=_0x1022e6[_0x7599('0x34')]['length']?_0x1022e6[_0x7599('0x34')]:_0x46d1cd[_0x7599('0x30')];if(!_0x4e4492[_0x7599('0x31')][_0x7599('0x36')]('nolimit')){_0x1022e6[_0x7599('0x20')]=qs[_0x7599('0x20')](_0x4e4492[_0x7599('0x31')][_0x7599('0x20')]);_0x1022e6[_0x7599('0x1e')]=qs['offset'](_0x4e4492[_0x7599('0x31')][_0x7599('0x1e')]);}_0x1022e6[_0x7599('0x37')]=qs[_0x7599('0x38')](_0x4e4492['query'][_0x7599('0x38')]);_0x1022e6[_0x7599('0x39')]=qs[_0x7599('0x32')](_[_0x7599('0x3a')](_0x4e4492[_0x7599('0x31')],_0x46d1cd['filters']),_0x5d9b5d);if(_0x4e4492[_0x7599('0x31')][_0x7599('0x3b')]){_0x1022e6[_0x7599('0x39')]=_[_0x7599('0x3c')](_0x1022e6['where'],{'$or':_['map'](_0x5d9b5d,function(_0x14ae1d){if(_0x14ae1d[_0x7599('0x3d')]!==_0x7599('0x3e')){var _0x45e4d4={};_0x45e4d4[_0x14ae1d[_0x7599('0x2b')]]={'$like':'%'+_0x4e4492['query'][_0x7599('0x3b')]+'%'};return _0x45e4d4;}})});}_0x1022e6=_['merge']({},_0x1022e6,_0x4e4492['options']);var _0x118438={'where':_0x1022e6[_0x7599('0x39')]};return db[_0x7599('0x3f')][_0x7599('0x21')](_0x118438)[_0x7599('0x27')](function(_0x4ad6c0){_0x11fd80[_0x7599('0x21')]=_0x4ad6c0;if(_0x4e4492['query']['includeAll']){_0x1022e6[_0x7599('0x40')]=[{'all':!![]}];}return db[_0x7599('0x3f')][_0x7599('0x41')](_0x1022e6);})[_0x7599('0x27')](function(_0x1877fd){_0x11fd80[_0x7599('0x42')]=_0x1877fd;return _0x11fd80;})[_0x7599('0x27')](respondWithFilteredResult(_0x825330,_0x1022e6))[_0x7599('0x43')](handleError(_0x825330,null));};exports['show']=function(_0x4410b1,_0x20e11c){var _0xa70e6c={'raw':![],'where':{'id':_0x4410b1['params']['id']}},_0x493c35={};_0x493c35['model']=_['keys'](db['SalesforceAccount'][_0x7599('0x44')]);_0x493c35[_0x7599('0x31')]=_[_0x7599('0x45')](_0x4410b1[_0x7599('0x31')]);_0x493c35[_0x7599('0x32')]=_[_0x7599('0x33')](_0x493c35[_0x7599('0x30')],_0x493c35[_0x7599('0x31')]);_0xa70e6c[_0x7599('0x34')]=_[_0x7599('0x33')](_0x493c35[_0x7599('0x30')],qs[_0x7599('0x35')](_0x4410b1['query'][_0x7599('0x35')]));_0xa70e6c['attributes']=_0xa70e6c[_0x7599('0x34')][_0x7599('0x46')]?_0xa70e6c[_0x7599('0x34')]:_0x493c35[_0x7599('0x30')];if(_0x4410b1[_0x7599('0x31')]['includeAll']){_0xa70e6c['include']=[{'all':!![]}];}_0xa70e6c=_[_0x7599('0x3c')]({},_0xa70e6c,_0x4410b1[_0x7599('0x47')]);return db[_0x7599('0x3f')][_0x7599('0x48')](_0xa70e6c)[_0x7599('0x27')](handleEntityNotFound(_0x20e11c,null))[_0x7599('0x27')](respondWithResult(_0x20e11c,null))['catch'](handleError(_0x20e11c,null));};exports[_0x7599('0x49')]=function(_0x381727,_0x479a18){return db[_0x7599('0x3f')][_0x7599('0x49')](_0x381727['body'],{})[_0x7599('0x27')](respondWithResult(_0x479a18,0xc9))['catch'](handleError(_0x479a18,null));};exports[_0x7599('0x26')]=function(_0x44f59a,_0x5b882f){if(_0x44f59a[_0x7599('0x4a')]['id']){delete _0x44f59a[_0x7599('0x4a')]['id'];}return db[_0x7599('0x3f')][_0x7599('0x48')]({'where':{'id':_0x44f59a[_0x7599('0x4b')]['id']}})[_0x7599('0x27')](handleEntityNotFound(_0x5b882f,null))['then'](saveUpdates(_0x44f59a['body'],null))[_0x7599('0x27')](respondWithResult(_0x5b882f,null))[_0x7599('0x43')](handleError(_0x5b882f,null));};exports[_0x7599('0x28')]=function(_0x4dc43b,_0x2631e6){return db[_0x7599('0x3f')][_0x7599('0x48')]({'where':{'id':_0x4dc43b[_0x7599('0x4b')]['id']}})[_0x7599('0x27')](handleEntityNotFound(_0x2631e6,null))['then'](removeEntity(_0x2631e6,null))[_0x7599('0x43')](handleError(_0x2631e6,null));};exports['getConfigurations']=function(_0x522d2f,_0x4c193d,_0xb15415){var _0x2805dc={};var _0x226067={};var _0x448324;var _0x8d7cae;return db[_0x7599('0x3f')][_0x7599('0x4c')]({'where':{'id':_0x522d2f[_0x7599('0x4b')]['id']}})[_0x7599('0x27')](handleEntityNotFound(_0x4c193d,null))[_0x7599('0x27')](function(_0x102bb5){if(_0x102bb5){_0x448324=_0x102bb5;_0x226067[_0x7599('0x30')]=_[_0x7599('0x45')](db[_0x7599('0x4d')][_0x7599('0x44')]);_0x226067[_0x7599('0x31')]=_['keys'](_0x522d2f[_0x7599('0x31')]);_0x226067[_0x7599('0x32')]=_['intersection'](_0x226067[_0x7599('0x30')],_0x226067['query']);_0x2805dc[_0x7599('0x34')]=_[_0x7599('0x33')](_0x226067[_0x7599('0x30')],qs[_0x7599('0x35')](_0x522d2f[_0x7599('0x31')][_0x7599('0x35')]));_0x2805dc['attributes']=_0x2805dc['attributes'][_0x7599('0x46')]?_0x2805dc['attributes']:_0x226067[_0x7599('0x30')];_0x2805dc[_0x7599('0x37')]=qs[_0x7599('0x38')](_0x522d2f[_0x7599('0x31')][_0x7599('0x38')]);_0x2805dc[_0x7599('0x39')]=qs[_0x7599('0x32')](_[_0x7599('0x3a')](_0x522d2f['query'],_0x226067[_0x7599('0x32')]));if(_0x522d2f[_0x7599('0x31')]['filter']){_0x2805dc['where']=_['merge'](_0x2805dc[_0x7599('0x39')],{'$or':_['map'](_0x2805dc[_0x7599('0x34')],function(_0x4cd8e7){var _0x4dbf22={};_0x4dbf22[_0x4cd8e7]={'$like':'%'+_0x522d2f['query'][_0x7599('0x3b')]+'%'};return _0x4dbf22;})});}_0x2805dc=_['merge']({},_0x2805dc,_0x522d2f[_0x7599('0x47')]);return _0x448324[_0x7599('0x4e')](_0x2805dc);}})[_0x7599('0x27')](function(_0x3b29ef){if(_0x3b29ef){_0x8d7cae=_0x3b29ef[_0x7599('0x46')];if(!_0x522d2f[_0x7599('0x31')][_0x7599('0x36')](_0x7599('0x4f'))){_0x2805dc[_0x7599('0x20')]=qs[_0x7599('0x20')](_0x522d2f[_0x7599('0x31')][_0x7599('0x20')]);_0x2805dc[_0x7599('0x1e')]=qs[_0x7599('0x1e')](_0x522d2f[_0x7599('0x31')][_0x7599('0x1e')]);}return _0x448324[_0x7599('0x4e')](_0x2805dc);}})['then'](function(_0x2625a6){if(_0x2625a6){return _0x2625a6?{'count':_0x8d7cae,'rows':_0x2625a6}:null;}})[_0x7599('0x27')](respondWithResult(_0x4c193d,null))[_0x7599('0x43')](handleError(_0x4c193d,null));};exports['addConfiguration']=function(_0x10ff7c,_0x213000,_0x4c04e3){if(_0x10ff7c[_0x7599('0x4a')]['id']){delete _0x10ff7c['body']['id'];}return db[_0x7599('0x3f')][_0x7599('0x4c')]({'where':{'id':_0x10ff7c[_0x7599('0x4b')]['id']}})[_0x7599('0x27')](handleEntityNotFound(_0x213000,null))[_0x7599('0x27')](function(_0xdb0002){if(_0xdb0002){_0x10ff7c['body'][_0x7599('0x50')]=_0xdb0002['id'];_0x10ff7c[_0x7599('0x4a')][_0x7599('0x51')]=integrations[_0x7599('0x52')](_0x10ff7c[_0x7599('0x4a')][_0x7599('0x53')],_0x10ff7c['body'][_0x7599('0x3d')]);_0x10ff7c[_0x7599('0x4a')][_0x7599('0x54')]=integrations['getDescriptions'](_0x10ff7c[_0x7599('0x4a')]['channel'],_0x10ff7c[_0x7599('0x4a')][_0x7599('0x3d')]);return db[_0x7599('0x4d')][_0x7599('0x49')](_0x10ff7c[_0x7599('0x4a')],{'include':[{'model':db[_0x7599('0x55')],'as':_0x7599('0x51')},{'model':db[_0x7599('0x55')],'as':_0x7599('0x54')}]});}return null;})[_0x7599('0x27')](respondWithResult(_0x213000,null))['catch'](handleError(_0x213000,null));};exports[_0x7599('0x56')]=function(_0x16b66b,_0x3000d8,_0x2d4fcc){var _0x55c7dd;var _0x184a3d='';var _0x4fdc1a=_0x7599('0x57');return db['SalesforceAccount']['findOne']({'where':{'id':_0x16b66b[_0x7599('0x4b')]['id']},'attributes':['id',_0x7599('0x58'),_0x7599('0x59'),_0x7599('0x5a'),_0x7599('0x5b'),_0x7599('0x5c'),'securityToken']})[_0x7599('0x27')](handleEntityNotFound(_0x3000d8,null))[_0x7599('0x27')](function(_0x14afbe){if(_0x14afbe){_0x184a3d=_0x14afbe[_0x7599('0x58')];var _0x57be6b=_0x184a3d[_0x7599('0x5d')](-0x1);if(_0x57be6b==='/'){_0x184a3d=_0x184a3d[_0x7599('0x5e')](0x0,_0x184a3d[_0x7599('0x5f')](_0x57be6b));}_0x55c7dd=new jsforce[(_0x7599('0x60'))]({'oauth2':{'loginUrl':_0x184a3d,'clientId':_0x14afbe[_0x7599('0x59')],'clientSecret':_0x14afbe[_0x7599('0x5a')]}});return _0x55c7dd['login'](_0x14afbe[_0x7599('0x5b')],_0x14afbe[_0x7599('0x5c')][_0x7599('0x61')](_0x14afbe[_0x7599('0x62')]));}})[_0x7599('0x27')](function(_0x5a45c7){if(_0x5a45c7){if(!_[_0x7599('0x63')](_0x16b66b[_0x7599('0x31')][_0x7599('0x64')])){_0x4fdc1a=_0x16b66b[_0x7599('0x31')][_0x7599('0x64')];}return _0x55c7dd[_0x7599('0x65')](_0x4fdc1a)[_0x7599('0x66')]();}})[_0x7599('0x27')](function(_0x3cdb49){var _0x1ebb8b=[_0x7599('0x67'),_0x7599('0x68'),_0x7599('0x69'),_0x7599('0x6a'),_0x7599('0x6b'),'Description'];var _0x318ea0=[_0x7599('0x6c'),_0x7599('0x6d'),_0x7599('0x6e'),_0x7599('0x6f'),_0x7599('0x70'),'textarea',_0x7599('0x71')];if(_0x3cdb49){_[_0x7599('0x72')](_0x3cdb49[_0x7599('0x35')],function(_0x5a413b){return _0x1ebb8b['includes'](_0x5a413b[_0x7599('0x2b')])||!_0x318ea0['includes'](_0x5a413b[_0x7599('0x3d')]);});return{'count':_0x3cdb49['fields']['length'],'rows':_[_0x7599('0x2d')](_0x3cdb49['fields'],function(_0x556f3e){return{'id':_0x556f3e[_0x7599('0x2b')],'name':_0x556f3e[_0x7599('0x73')],'custom':_0x556f3e[_0x7599('0x74')],'options':_0x556f3e['picklistValues']['length']>0x0?_[_0x7599('0x2d')](_0x556f3e[_0x7599('0x75')],function(_0x2c1492){return{'name':_0x2c1492[_0x7599('0x73')],'value':_0x2c1492[_0x7599('0x76')]};}):_0x556f3e[_0x7599('0x3d')]==_0x7599('0x6f')?[{'name':_0x7599('0x77'),'value':'true'},{'name':_0x7599('0x78'),'value':'false'}]:[]};})};}})[_0x7599('0x27')](respondWithResult(_0x3000d8,null))[_0x7599('0x43')](function(_0x3bd16b){var _0x109f9b=_0x16b66b['query'][_0x7599('0x79')]?0x1f4:_0x3bd16b[_0x7599('0x7a')]||0x1f4;logger['error'](_0x7599('0x7b'),_0x7599('0x56'),_0x109f9b,JSON[_0x7599('0x7c')](_0x3bd16b));delete _0x3bd16b[_0x7599('0x2b')];if(_0x109f9b===0x191){_0x109f9b=0x190;}_0x3000d8[_0x7599('0x1b')](_0x109f9b)[_0x7599('0x7d')](_0x16b66b[_0x7599('0x31')][_0x7599('0x79')]?{'message':_0x7599('0x7e'),'statusCode':_0x3bd16b['statusCode']}:_0x3bd16b);});}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index c9a6595..a2481b5 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 _0x934a=['api','moment','bluebird','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','SalesforceAccount','lodash','../../config/logger'];(function(_0x34c8ff,_0x674110){var _0x42601c=function(_0x3e2ce5){while(--_0x3e2ce5){_0x34c8ff['push'](_0x34c8ff['shift']());}};_0x42601c(++_0x674110);}(_0x934a,0x127));var _0xa934=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0x934a[_0x2e6dbf];return _0x2680e5;};'use strict';var _=require(_0xa934('0x0'));var util=require('util');var logger=require(_0xa934('0x1'))(_0xa934('0x2'));var moment=require(_0xa934('0x3'));var BPromise=require(_0xa934('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa934('0x5'));var rimraf=require(_0xa934('0x6'));var config=require(_0xa934('0x7'));var attributes=require(_0xa934('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xa934('0x9')]=function(_0x5f0e95,_0x3c2d4e){return _0x5f0e95['define'](_0xa934('0xa'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 061a963..94c06a7 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 _0x8115=['model','then','GetSalesforceAccount','find','ShowSalesforceAccount','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','SalesforceAccount','findAll','options','raw','where','attributes','limit','map','include'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x8115,0x1c0));var _0x5811=function(_0x38ea61,_0x4295b9){_0x38ea61=_0x38ea61-0x0;var _0x259204=_0x8115[_0x38ea61];return _0x259204;};'use strict';var _=require(_0x5811('0x0'));var util=require(_0x5811('0x1'));var moment=require(_0x5811('0x2'));var BPromise=require(_0x5811('0x3'));var rs=require(_0x5811('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5811('0x5'))['db'];var utils=require(_0x5811('0x6'));var logger=require(_0x5811('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5811('0x8'));var client=jayson[_0x5811('0x9')][_0x5811('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc835e1,_0x4461ea,_0x17a1f6){return new BPromise(function(_0xcdc844,_0x4a5146){return client['request'](_0xc835e1,_0x17a1f6)['then'](function(_0x769a11){logger[_0x5811('0xb')](_0x5811('0xc'),_0x4461ea,_0x5811('0xd'));logger[_0x5811('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4461ea,'request\x20sent',JSON[_0x5811('0xf')](_0x769a11));if(_0x769a11[_0x5811('0x10')]){if(_0x769a11['error']['code']===0x1f4){logger['error'](_0x5811('0xc'),_0x4461ea,_0x769a11['error']['message']);return _0x4a5146(_0x769a11[_0x5811('0x10')]['message']);}logger[_0x5811('0x10')](_0x5811('0xc'),_0x4461ea,_0x769a11['error'][_0x5811('0x11')]);return _0xcdc844(_0x769a11['error'][_0x5811('0x11')]);}else{logger[_0x5811('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x4461ea,'request\x20sent');_0xcdc844(_0x769a11[_0x5811('0x12')]['message']);}})['catch'](function(_0x4bfa28){logger['error'](_0x5811('0xc'),_0x4461ea,_0x4bfa28);_0x4a5146(_0x4bfa28);});});}exports['GetSalesforceAccount']=function(_0x285f85){var _0x4da2b9=this;return new Promise(function(_0x127ee4,_0x2bc28d){return db[_0x5811('0x13')][_0x5811('0x14')]({'raw':_0x285f85[_0x5811('0x15')]?_0x285f85[_0x5811('0x15')][_0x5811('0x16')]===undefined?!![]:![]:!![],'where':_0x285f85[_0x5811('0x15')]?_0x285f85[_0x5811('0x15')][_0x5811('0x17')]||null:null,'attributes':_0x285f85['options']?_0x285f85[_0x5811('0x15')][_0x5811('0x18')]||null:null,'limit':_0x285f85[_0x5811('0x15')]?_0x285f85['options'][_0x5811('0x19')]||null:null,'include':_0x285f85[_0x5811('0x15')]?_0x285f85[_0x5811('0x15')]['include']?_[_0x5811('0x1a')](_0x285f85[_0x5811('0x15')][_0x5811('0x1b')],function(_0x5620c3){return{'model':db[_0x5620c3['model']],'as':_0x5620c3['as'],'attributes':_0x5620c3['attributes'],'include':_0x5620c3['include']?_['map'](_0x5620c3[_0x5811('0x1b')],function(_0x1226b0){return{'model':db[_0x1226b0[_0x5811('0x1c')]],'as':_0x1226b0['as'],'attributes':_0x1226b0[_0x5811('0x18')],'include':_0x1226b0['include']?_[_0x5811('0x1a')](_0x1226b0['include'],function(_0x3fca28){return{'model':db[_0x3fca28[_0x5811('0x1c')]],'as':_0x3fca28['as'],'attributes':_0x3fca28[_0x5811('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5811('0x1d')](function(_0xc4a18b){logger[_0x5811('0xb')]('GetSalesforceAccount',_0x285f85);logger['debug']('GetSalesforceAccount',_0x285f85,JSON[_0x5811('0xf')](_0xc4a18b));_0x127ee4(_0xc4a18b);})['catch'](function(_0x2e6333){logger[_0x5811('0x10')](_0x5811('0x1e'),_0x2e6333[_0x5811('0x11')],_0x285f85);_0x2bc28d(_0x4da2b9['error'](0x1f4,_0x2e6333[_0x5811('0x11')]));});});};exports['ShowSalesforceAccount']=function(_0x626526){var _0x136772=this;return new Promise(function(_0x468c90,_0x3d8223){return db[_0x5811('0x13')][_0x5811('0x1f')]({'raw':_0x626526[_0x5811('0x15')]?_0x626526[_0x5811('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x626526[_0x5811('0x15')]?_0x626526['options'][_0x5811('0x17')]||null:null,'attributes':_0x626526[_0x5811('0x15')]?_0x626526[_0x5811('0x15')][_0x5811('0x18')]||null:null,'include':_0x626526[_0x5811('0x15')]?_0x626526[_0x5811('0x15')][_0x5811('0x1b')]?_['map'](_0x626526[_0x5811('0x15')]['include'],function(_0x1ac580){return{'model':db[_0x1ac580['model']],'as':_0x1ac580['as'],'attributes':_0x1ac580['attributes'],'include':_0x1ac580['include']?_[_0x5811('0x1a')](_0x1ac580[_0x5811('0x1b')],function(_0x15a39b){return{'model':db[_0x15a39b[_0x5811('0x1c')]],'as':_0x15a39b['as'],'attributes':_0x15a39b['attributes'],'include':_0x15a39b['include']?_['map'](_0x15a39b[_0x5811('0x1b')],function(_0x15856d){return{'model':db[_0x15856d['model']],'as':_0x15856d['as'],'attributes':_0x15856d['attributes']};}):[]};}):[]};}):[]:[]})[_0x5811('0x1d')](function(_0x356447){logger['info'](_0x5811('0x20'),_0x626526);logger[_0x5811('0xe')](_0x5811('0x20'),_0x626526,JSON['stringify'](_0x356447));_0x468c90(_0x356447);})[_0x5811('0x21')](function(_0x3d0fa1){logger[_0x5811('0x10')](_0x5811('0x20'),_0x3d0fa1[_0x5811('0x11')],_0x626526);_0x3d8223(_0x136772[_0x5811('0x10')](0x1f4,_0x3d0fa1[_0x5811('0x11')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index c4fc3d4..311f68c 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x906f4a,_0x113d01){var _0x5940b7=function(_0x4ed2f3){while(--_0x4ed2f3){_0x906f4a['push'](_0x906f4a['shift']());}};_0x5940b7(++_0x113d01);}(_0xadb5,0xad));var _0x5adb=function(_0x303327,_0x4e88f6){_0x303327=_0x303327-0x0;var _0x5ea37e=_0xadb5[_0x303327];return _0x5ea37e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +var _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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index edf582c..484c863 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 _0xc40b=['exports','STRING','ENUM','Task','Case','lead','account','contact_lead','nothing','contact','sequelize'];(function(_0x4b9881,_0x807060){var _0x897ef7=function(_0x21fdec){while(--_0x21fdec){_0x4b9881['push'](_0x4b9881['shift']());}};_0x897ef7(++_0x807060);}(_0xc40b,0x13e));var _0xbc40=function(_0x5982f1,_0x3f5689){_0x5982f1=_0x5982f1-0x0;var _0x3a1836=_0xc40b[_0x5982f1];return _0x3a1836;};'use strict';var Sequelize=require(_0xbc40('0x0'));module[_0xbc40('0x1')]={'name':{'type':Sequelize[_0xbc40('0x2')]},'description':{'type':Sequelize[_0xbc40('0x2')]},'ticketType':{'type':Sequelize[_0xbc40('0x3')](_0xbc40('0x4'),_0xbc40('0x5')),'defaultValue':_0xbc40('0x4')},'moduleSearch':{'type':Sequelize[_0xbc40('0x3')]('contact_lead','contact',_0xbc40('0x6'),'account_contact_lead',_0xbc40('0x7')),'defaultValue':_0xbc40('0x8')},'moduleCreate':{'type':Sequelize['ENUM'](_0xbc40('0x9'),_0xbc40('0xa'),_0xbc40('0x6'),'account'),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xbc40('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xbc40('0x2')]},'additionalSearchLead':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 3afeedf..eb3a1b8 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 _0xc1bf=['then','error','stack','name','index','map','SalesforceConfiguration','fieldName','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','findOne','rawAttributes','pick','getFields','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update'];(function(_0xfe470e,_0x540a26){var _0x4f1288=function(_0x286198){while(--_0x286198){_0xfe470e['push'](_0xfe470e['shift']());}};_0x4f1288(++_0x540a26);}(_0xc1bf,0x79));var _0xfc1b=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc1bf[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xfc1b('0x0'));var rimraf=require(_0xfc1b('0x1'));var zipdir=require(_0xfc1b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc1b('0x3'));var moment=require(_0xfc1b('0x4'));var BPromise=require(_0xfc1b('0x5'));var Mustache=require(_0xfc1b('0x6'));var util=require(_0xfc1b('0x7'));var path=require(_0xfc1b('0x8'));var sox=require(_0xfc1b('0x9'));var csv=require(_0xfc1b('0xa'));var ejs=require(_0xfc1b('0xb'));var fs=require('fs');var fs_extra=require(_0xfc1b('0xc'));var _=require(_0xfc1b('0xd'));var squel=require(_0xfc1b('0xe'));var crypto=require(_0xfc1b('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xfc1b('0x10'));var toCsv=require(_0xfc1b('0xa'));var querystring=require(_0xfc1b('0x11'));var Papa=require(_0xfc1b('0x12'));var Redis=require(_0xfc1b('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xfc1b('0x14'));var as=require(_0xfc1b('0x15'));var hardwareService=require(_0xfc1b('0x16'));var logger=require(_0xfc1b('0x17'))(_0xfc1b('0x18'));var utils=require(_0xfc1b('0x19'));var config=require(_0xfc1b('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5759c4,_0x2f7d18){_0x2f7d18=_0x2f7d18||0xcc;return function(_0x269404){if(_0x269404){return _0x5759c4[_0xfc1b('0x1b')](_0x2f7d18);}return _0x5759c4[_0xfc1b('0x1c')](_0x2f7d18)[_0xfc1b('0x1d')]();};}function respondWithResult(_0x25bb68,_0x505470){_0x505470=_0x505470||0xc8;return function(_0x2df518){if(_0x2df518){return _0x25bb68[_0xfc1b('0x1c')](_0x505470)['json'](_0x2df518);}};}function respondWithFilteredResult(_0x4644fd,_0x5e3d79){return function(_0x203c6d){if(_0x203c6d){var _0x1a3b5c=typeof _0x5e3d79[_0xfc1b('0x1e')]===_0xfc1b('0x1f')&&typeof _0x5e3d79[_0xfc1b('0x20')]===_0xfc1b('0x1f');var _0x3c8b12=_0x203c6d[_0xfc1b('0x21')];var _0x36d927=_0x1a3b5c?0x0:_0x5e3d79[_0xfc1b('0x1e')];var _0x2c4f11=_0x1a3b5c?_0x203c6d[_0xfc1b('0x21')]:_0x5e3d79[_0xfc1b('0x1e')]+_0x5e3d79[_0xfc1b('0x20')];var _0x202438;if(_0x2c4f11>=_0x3c8b12){_0x2c4f11=_0x3c8b12;_0x202438=0xc8;}else{_0x202438=0xce;}_0x4644fd[_0xfc1b('0x1c')](_0x202438);return _0x4644fd[_0xfc1b('0x22')](_0xfc1b('0x23'),_0x36d927+'-'+_0x2c4f11+'/'+_0x3c8b12)[_0xfc1b('0x24')](_0x203c6d);}return null;};}function patchUpdates(_0x472405){return function(_0x443a69){try{jsonpatch[_0xfc1b('0x25')](_0x443a69,_0x472405,!![]);}catch(_0x3fc56a){return BPromise[_0xfc1b('0x26')](_0x3fc56a);}return _0x443a69[_0xfc1b('0x27')]();};}function saveUpdates(_0x5f3575,_0x45f4b7){return function(_0x1d7804){if(_0x1d7804){return _0x1d7804[_0xfc1b('0x28')](_0x5f3575)['then'](function(_0x30c8b5){return _0x30c8b5;});}return null;};}function removeEntity(_0x5ef055,_0x2bb78a){return function(_0x192c49){if(_0x192c49){return _0x192c49['destroy']()[_0xfc1b('0x29')](function(){_0x5ef055[_0xfc1b('0x1c')](0xcc)[_0xfc1b('0x1d')]();});}};}function handleEntityNotFound(_0x2c7678,_0x18f010){return function(_0x480933){if(!_0x480933){_0x2c7678[_0xfc1b('0x1b')](0x194);}return _0x480933;};}function handleError(_0x43c6aa,_0xefb749){_0xefb749=_0xefb749||0x1f4;return function(_0x4859a8){logger[_0xfc1b('0x2a')](_0x4859a8[_0xfc1b('0x2b')]);if(_0x4859a8['name']){delete _0x4859a8[_0xfc1b('0x2c')];}_0x43c6aa['status'](_0xefb749)['send'](_0x4859a8);};}exports[_0xfc1b('0x2d')]=function(_0x25b55b,_0x3560f9){var _0x3d8460={},_0x24e707={},_0x8056a9={'count':0x0,'rows':[]};var _0x5598bd=_[_0xfc1b('0x2e')](db[_0xfc1b('0x2f')]['rawAttributes'],function(_0x208091){return{'name':_0x208091[_0xfc1b('0x30')],'type':_0x208091['type']['key']};});_0x24e707[_0xfc1b('0x31')]=_[_0xfc1b('0x2e')](_0x5598bd,_0xfc1b('0x2c'));_0x24e707['query']=_[_0xfc1b('0x32')](_0x25b55b[_0xfc1b('0x33')]);_0x24e707[_0xfc1b('0x34')]=_[_0xfc1b('0x35')](_0x24e707[_0xfc1b('0x31')],_0x24e707[_0xfc1b('0x33')]);_0x3d8460['attributes']=_[_0xfc1b('0x35')](_0x24e707['model'],qs['fields'](_0x25b55b[_0xfc1b('0x33')][_0xfc1b('0x36')]));_0x3d8460[_0xfc1b('0x37')]=_0x3d8460[_0xfc1b('0x37')]['length']?_0x3d8460[_0xfc1b('0x37')]:_0x24e707[_0xfc1b('0x31')];if(!_0x25b55b[_0xfc1b('0x33')][_0xfc1b('0x38')](_0xfc1b('0x39'))){_0x3d8460[_0xfc1b('0x20')]=qs[_0xfc1b('0x20')](_0x25b55b['query'][_0xfc1b('0x20')]);_0x3d8460[_0xfc1b('0x1e')]=qs['offset'](_0x25b55b[_0xfc1b('0x33')][_0xfc1b('0x1e')]);}_0x3d8460[_0xfc1b('0x3a')]=qs[_0xfc1b('0x3b')](_0x25b55b['query']['sort']);_0x3d8460[_0xfc1b('0x3c')]=qs[_0xfc1b('0x34')](_['pick'](_0x25b55b['query'],_0x24e707['filters']),_0x5598bd);if(_0x25b55b[_0xfc1b('0x33')][_0xfc1b('0x3d')]){_0x3d8460[_0xfc1b('0x3c')]=_[_0xfc1b('0x3e')](_0x3d8460['where'],{'$or':_[_0xfc1b('0x2e')](_0x5598bd,function(_0x532bf4){if(_0x532bf4['type']!=='VIRTUAL'){var _0x38221c={};_0x38221c[_0x532bf4[_0xfc1b('0x2c')]]={'$like':'%'+_0x25b55b['query'][_0xfc1b('0x3d')]+'%'};return _0x38221c;}})});}_0x3d8460=_['merge']({},_0x3d8460,_0x25b55b[_0xfc1b('0x3f')]);var _0x30fe3f={'where':_0x3d8460[_0xfc1b('0x3c')]};return db[_0xfc1b('0x2f')][_0xfc1b('0x21')](_0x30fe3f)[_0xfc1b('0x29')](function(_0x13bd17){_0x8056a9['count']=_0x13bd17;if(_0x25b55b[_0xfc1b('0x33')][_0xfc1b('0x40')]){_0x3d8460[_0xfc1b('0x41')]=[{'all':!![]}];}return db[_0xfc1b('0x2f')][_0xfc1b('0x42')](_0x3d8460);})[_0xfc1b('0x29')](function(_0x1f49f9){_0x8056a9[_0xfc1b('0x43')]=_0x1f49f9;return _0x8056a9;})['then'](respondWithFilteredResult(_0x3560f9,_0x3d8460))[_0xfc1b('0x44')](handleError(_0x3560f9,null));};exports['show']=function(_0x320ac6,_0x1bd160){var _0xb2ab06={'raw':![],'where':{'id':_0x320ac6[_0xfc1b('0x45')]['id']}},_0x1ff9bd={};_0x1ff9bd['model']=_[_0xfc1b('0x32')](db[_0xfc1b('0x2f')]['rawAttributes']);_0x1ff9bd[_0xfc1b('0x33')]=_[_0xfc1b('0x32')](_0x320ac6[_0xfc1b('0x33')]);_0x1ff9bd['filters']=_[_0xfc1b('0x35')](_0x1ff9bd[_0xfc1b('0x31')],_0x1ff9bd[_0xfc1b('0x33')]);_0xb2ab06['attributes']=_[_0xfc1b('0x35')](_0x1ff9bd['model'],qs[_0xfc1b('0x36')](_0x320ac6[_0xfc1b('0x33')][_0xfc1b('0x36')]));_0xb2ab06[_0xfc1b('0x37')]=_0xb2ab06[_0xfc1b('0x37')][_0xfc1b('0x46')]?_0xb2ab06[_0xfc1b('0x37')]:_0x1ff9bd[_0xfc1b('0x31')];if(_0x320ac6[_0xfc1b('0x33')][_0xfc1b('0x40')]){_0xb2ab06['include']=[{'all':!![]}];}_0xb2ab06=_['merge']({},_0xb2ab06,_0x320ac6[_0xfc1b('0x3f')]);return db[_0xfc1b('0x2f')][_0xfc1b('0x47')](_0xb2ab06)[_0xfc1b('0x29')](handleEntityNotFound(_0x1bd160,null))[_0xfc1b('0x29')](respondWithResult(_0x1bd160,null))[_0xfc1b('0x44')](handleError(_0x1bd160,null));};exports[_0xfc1b('0x48')]=function(_0x1c3246,_0x3b1851){return db[_0xfc1b('0x2f')]['create'](_0x1c3246[_0xfc1b('0x49')],{})['then'](respondWithResult(_0x3b1851,0xc9))[_0xfc1b('0x44')](handleError(_0x3b1851,null));};exports[_0xfc1b('0x28')]=function(_0x113df0,_0x1a8ca0){if(_0x113df0['body']['id']){delete _0x113df0[_0xfc1b('0x49')]['id'];}return db[_0xfc1b('0x2f')][_0xfc1b('0x47')]({'where':{'id':_0x113df0[_0xfc1b('0x45')]['id']}})[_0xfc1b('0x29')](handleEntityNotFound(_0x1a8ca0,null))[_0xfc1b('0x29')](saveUpdates(_0x113df0[_0xfc1b('0x49')],null))[_0xfc1b('0x29')](respondWithResult(_0x1a8ca0,null))[_0xfc1b('0x44')](handleError(_0x1a8ca0,null));};exports['destroy']=function(_0x1b9a20,_0x305ae9){return db['SalesforceConfiguration'][_0xfc1b('0x47')]({'where':{'id':_0x1b9a20[_0xfc1b('0x45')]['id']}})[_0xfc1b('0x29')](handleEntityNotFound(_0x305ae9,null))['then'](removeEntity(_0x305ae9,null))[_0xfc1b('0x44')](handleError(_0x305ae9,null));};exports['getFields']=function(_0x5a14ee,_0xca21c,_0x5a1507){var _0x6bf4c5={};var _0x4a4ded={};var _0x21fedd;var _0x5637f4;return db[_0xfc1b('0x2f')][_0xfc1b('0x4a')]({'where':{'id':_0x5a14ee[_0xfc1b('0x45')]['id']}})[_0xfc1b('0x29')](handleEntityNotFound(_0xca21c,null))['then'](function(_0x29aefa){if(_0x29aefa){_0x21fedd=_0x29aefa;_0x4a4ded['model']=_['keys'](db['SalesforceField'][_0xfc1b('0x4b')]);_0x4a4ded[_0xfc1b('0x33')]=_[_0xfc1b('0x32')](_0x5a14ee[_0xfc1b('0x33')]);_0x4a4ded[_0xfc1b('0x34')]=_[_0xfc1b('0x35')](_0x4a4ded[_0xfc1b('0x31')],_0x4a4ded[_0xfc1b('0x33')]);_0x6bf4c5[_0xfc1b('0x37')]=_[_0xfc1b('0x35')](_0x4a4ded['model'],qs[_0xfc1b('0x36')](_0x5a14ee[_0xfc1b('0x33')][_0xfc1b('0x36')]));_0x6bf4c5['attributes']=_0x6bf4c5[_0xfc1b('0x37')][_0xfc1b('0x46')]?_0x6bf4c5[_0xfc1b('0x37')]:_0x4a4ded[_0xfc1b('0x31')];_0x6bf4c5[_0xfc1b('0x3a')]=qs[_0xfc1b('0x3b')](_0x5a14ee[_0xfc1b('0x33')][_0xfc1b('0x3b')]);_0x6bf4c5[_0xfc1b('0x3c')]=qs['filters'](_[_0xfc1b('0x4c')](_0x5a14ee[_0xfc1b('0x33')],_0x4a4ded[_0xfc1b('0x34')]));if(_0x5a14ee['query'][_0xfc1b('0x3d')]){_0x6bf4c5[_0xfc1b('0x3c')]=_[_0xfc1b('0x3e')](_0x6bf4c5[_0xfc1b('0x3c')],{'$or':_['map'](_0x6bf4c5[_0xfc1b('0x37')],function(_0x2cc6d8){var _0x429a87={};_0x429a87[_0x2cc6d8]={'$like':'%'+_0x5a14ee[_0xfc1b('0x33')][_0xfc1b('0x3d')]+'%'};return _0x429a87;})});}_0x6bf4c5=_['merge']({},_0x6bf4c5,_0x5a14ee[_0xfc1b('0x3f')]);return _0x21fedd[_0xfc1b('0x4d')](_0x6bf4c5);}})['then'](function(_0x561c25){if(_0x561c25){_0x5637f4=_0x561c25[_0xfc1b('0x46')];if(!_0x5a14ee[_0xfc1b('0x33')][_0xfc1b('0x38')](_0xfc1b('0x39'))){_0x6bf4c5['limit']=qs[_0xfc1b('0x20')](_0x5a14ee[_0xfc1b('0x33')][_0xfc1b('0x20')]);_0x6bf4c5[_0xfc1b('0x1e')]=qs['offset'](_0x5a14ee[_0xfc1b('0x33')][_0xfc1b('0x1e')]);}return _0x21fedd[_0xfc1b('0x4d')](_0x6bf4c5);}})[_0xfc1b('0x29')](function(_0x1ef1d2){if(_0x1ef1d2){return _0x1ef1d2?{'count':_0x5637f4,'rows':_0x1ef1d2}:null;}})[_0xfc1b('0x29')](respondWithResult(_0xca21c,null))[_0xfc1b('0x44')](handleError(_0xca21c,null));};exports[_0xfc1b('0x4e')]=function(_0x53299e,_0x1968f5,_0x58e52a){var _0x35d171={};var _0xfd797d={};var _0x23cfb9;var _0x30a787;return db['SalesforceConfiguration'][_0xfc1b('0x4a')]({'where':{'id':_0x53299e[_0xfc1b('0x45')]['id']}})[_0xfc1b('0x29')](handleEntityNotFound(_0x1968f5,null))[_0xfc1b('0x29')](function(_0x5d4271){if(_0x5d4271){_0x23cfb9=_0x5d4271;_0xfd797d[_0xfc1b('0x31')]=_['keys'](db[_0xfc1b('0x4f')][_0xfc1b('0x4b')]);_0xfd797d[_0xfc1b('0x33')]=_[_0xfc1b('0x32')](_0x53299e[_0xfc1b('0x33')]);_0xfd797d[_0xfc1b('0x34')]=_[_0xfc1b('0x35')](_0xfd797d[_0xfc1b('0x31')],_0xfd797d[_0xfc1b('0x33')]);_0x35d171[_0xfc1b('0x37')]=_[_0xfc1b('0x35')](_0xfd797d[_0xfc1b('0x31')],qs['fields'](_0x53299e[_0xfc1b('0x33')][_0xfc1b('0x36')]));_0x35d171[_0xfc1b('0x37')]=_0x35d171[_0xfc1b('0x37')]['length']?_0x35d171[_0xfc1b('0x37')]:_0xfd797d['model'];_0x35d171['order']=qs[_0xfc1b('0x3b')](_0x53299e[_0xfc1b('0x33')]['sort']);_0x35d171[_0xfc1b('0x3c')]=qs[_0xfc1b('0x34')](_['pick'](_0x53299e[_0xfc1b('0x33')],_0xfd797d[_0xfc1b('0x34')]));if(_0x53299e['query'][_0xfc1b('0x3d')]){_0x35d171[_0xfc1b('0x3c')]=_[_0xfc1b('0x3e')](_0x35d171[_0xfc1b('0x3c')],{'$or':_[_0xfc1b('0x2e')](_0x35d171[_0xfc1b('0x37')],function(_0x4a1d88){var _0x4cd6c8={};_0x4cd6c8[_0x4a1d88]={'$like':'%'+_0x53299e[_0xfc1b('0x33')][_0xfc1b('0x3d')]+'%'};return _0x4cd6c8;})});}_0x35d171=_['merge']({},_0x35d171,_0x53299e[_0xfc1b('0x3f')]);return _0x23cfb9['getSubjects'](_0x35d171);}})['then'](function(_0x1f9b48){if(_0x1f9b48){_0x30a787=_0x1f9b48[_0xfc1b('0x46')];if(!_0x53299e[_0xfc1b('0x33')][_0xfc1b('0x38')](_0xfc1b('0x39'))){_0x35d171[_0xfc1b('0x20')]=qs[_0xfc1b('0x20')](_0x53299e['query']['limit']);_0x35d171[_0xfc1b('0x1e')]=qs[_0xfc1b('0x1e')](_0x53299e[_0xfc1b('0x33')][_0xfc1b('0x1e')]);}return _0x23cfb9[_0xfc1b('0x4e')](_0x35d171);}})['then'](function(_0x27756d){if(_0x27756d){return _0x27756d?{'count':_0x30a787,'rows':_0x27756d}:null;}})[_0xfc1b('0x29')](respondWithResult(_0x1968f5,null))[_0xfc1b('0x44')](handleError(_0x1968f5,null));};exports['getDescriptions']=function(_0x2c1626,_0x34949b,_0x5da246){var _0x15a733={};var _0x3ffd9a={};var _0x23b947;var _0x926b1;return db[_0xfc1b('0x2f')][_0xfc1b('0x4a')]({'where':{'id':_0x2c1626['params']['id']}})[_0xfc1b('0x29')](handleEntityNotFound(_0x34949b,null))['then'](function(_0x85118d){if(_0x85118d){_0x23b947=_0x85118d;_0x3ffd9a['model']=_[_0xfc1b('0x32')](db['SalesforceField'][_0xfc1b('0x4b')]);_0x3ffd9a[_0xfc1b('0x33')]=_['keys'](_0x2c1626[_0xfc1b('0x33')]);_0x3ffd9a['filters']=_[_0xfc1b('0x35')](_0x3ffd9a[_0xfc1b('0x31')],_0x3ffd9a[_0xfc1b('0x33')]);_0x15a733[_0xfc1b('0x37')]=_[_0xfc1b('0x35')](_0x3ffd9a[_0xfc1b('0x31')],qs[_0xfc1b('0x36')](_0x2c1626[_0xfc1b('0x33')][_0xfc1b('0x36')]));_0x15a733[_0xfc1b('0x37')]=_0x15a733['attributes'][_0xfc1b('0x46')]?_0x15a733[_0xfc1b('0x37')]:_0x3ffd9a[_0xfc1b('0x31')];_0x15a733[_0xfc1b('0x3a')]=qs['sort'](_0x2c1626[_0xfc1b('0x33')][_0xfc1b('0x3b')]);_0x15a733[_0xfc1b('0x3c')]=qs[_0xfc1b('0x34')](_['pick'](_0x2c1626[_0xfc1b('0x33')],_0x3ffd9a[_0xfc1b('0x34')]));if(_0x2c1626[_0xfc1b('0x33')][_0xfc1b('0x3d')]){_0x15a733['where']=_[_0xfc1b('0x3e')](_0x15a733[_0xfc1b('0x3c')],{'$or':_[_0xfc1b('0x2e')](_0x15a733[_0xfc1b('0x37')],function(_0xb10a9f){var _0x5f4446={};_0x5f4446[_0xb10a9f]={'$like':'%'+_0x2c1626[_0xfc1b('0x33')][_0xfc1b('0x3d')]+'%'};return _0x5f4446;})});}_0x15a733=_['merge']({},_0x15a733,_0x2c1626['options']);return _0x23b947[_0xfc1b('0x50')](_0x15a733);}})[_0xfc1b('0x29')](function(_0xa10b67){if(_0xa10b67){_0x926b1=_0xa10b67[_0xfc1b('0x46')];if(!_0x2c1626[_0xfc1b('0x33')][_0xfc1b('0x38')]('nolimit')){_0x15a733['limit']=qs['limit'](_0x2c1626['query'][_0xfc1b('0x20')]);_0x15a733[_0xfc1b('0x1e')]=qs[_0xfc1b('0x1e')](_0x2c1626[_0xfc1b('0x33')][_0xfc1b('0x1e')]);}return _0x23b947[_0xfc1b('0x50')](_0x15a733);}})['then'](function(_0x536443){if(_0x536443){return _0x536443?{'count':_0x926b1,'rows':_0x536443}:null;}})['then'](respondWithResult(_0x34949b,null))[_0xfc1b('0x44')](handleError(_0x34949b,null));}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 3c8abf0..ab59779 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 _0x1c2d=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x4d017f,_0x4017be){var _0x9b1c26=function(_0x19635f){while(--_0x19635f){_0x4d017f['push'](_0x4d017f['shift']());}};_0x9b1c26(++_0x4017be);}(_0x1c2d,0x1b0));var _0xd1c2=function(_0x1d68a9,_0x4cf1e9){_0x1d68a9=_0x1d68a9-0x0;var _0x4e2dea=_0x1c2d[_0x1d68a9];return _0x4e2dea;};'use strict';var _=require(_0xd1c2('0x0'));var util=require(_0xd1c2('0x1'));var logger=require(_0xd1c2('0x2'))('api');var moment=require(_0xd1c2('0x3'));var BPromise=require(_0xd1c2('0x4'));var rp=require(_0xd1c2('0x5'));var fs=require('fs');var path=require(_0xd1c2('0x6'));var rimraf=require(_0xd1c2('0x7'));var config=require(_0xd1c2('0x8'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xd1c2('0x9')]=function(_0x3913c2,_0x3292ef){return _0x3913c2[_0xd1c2('0xa')](_0xd1c2('0xb'),attributes,{'tableName':_0xd1c2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 6f0aef5..c8cf386 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 _0x45f0=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x8663e3,_0x22e33a){var _0xb155e9=function(_0x471df9){while(--_0x471df9){_0x8663e3['push'](_0x8663e3['shift']());}};_0xb155e9(++_0x22e33a);}(_0x45f0,0x16a));var _0x045f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x45f0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x045f('0x0'));var moment=require(_0x045f('0x1'));var BPromise=require(_0x045f('0x2'));var rs=require(_0x045f('0x3'));var fs=require('fs');var Redis=require(_0x045f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x045f('0x5'));var logger=require(_0x045f('0x6'))(_0x045f('0x7'));var config=require(_0x045f('0x8'));var jayson=require(_0x045f('0x9'));var client=jayson[_0x045f('0xa')][_0x045f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x34c656,_0x2bb56d,_0x3f01c0){return new BPromise(function(_0x5b041e,_0x32c256){return client[_0x045f('0xc')](_0x34c656,_0x3f01c0)[_0x045f('0xd')](function(_0x5f14a7){logger[_0x045f('0xe')](_0x045f('0xf'),_0x2bb56d,'request\x20sent');logger[_0x045f('0x10')](_0x045f('0x11'),_0x2bb56d,'request\x20sent',JSON['stringify'](_0x5f14a7));if(_0x5f14a7['error']){if(_0x5f14a7['error'][_0x045f('0x12')]===0x1f4){logger[_0x045f('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2bb56d,_0x5f14a7[_0x045f('0x13')][_0x045f('0x14')]);return _0x32c256(_0x5f14a7[_0x045f('0x13')]['message']);}logger[_0x045f('0x13')](_0x045f('0xf'),_0x2bb56d,_0x5f14a7[_0x045f('0x13')][_0x045f('0x14')]);return _0x5b041e(_0x5f14a7[_0x045f('0x13')][_0x045f('0x14')]);}else{logger[_0x045f('0xe')](_0x045f('0xf'),_0x2bb56d,'request\x20sent');_0x5b041e(_0x5f14a7[_0x045f('0x15')][_0x045f('0x14')]);}})[_0x045f('0x16')](function(_0x22a067){logger[_0x045f('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2bb56d,_0x22a067);_0x32c256(_0x22a067);});});} \ No newline at end of file +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 diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index cb391d5..f7b58d7 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 _0x8615=['update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','isAuthenticated','get','post','create','put','/:id'];(function(_0x4ffa64,_0x271035){var _0x5da001=function(_0x7d1940){while(--_0x7d1940){_0x4ffa64['push'](_0x4ffa64['shift']());}};_0x5da001(++_0x271035);}(_0x8615,0x17d));var _0x5861=function(_0x3b0866,_0x454edd){_0x3b0866=_0x3b0866-0x0;var _0x323008=_0x8615[_0x3b0866];return _0x323008;};'use strict';var multer=require(_0x5861('0x0'));var util=require('util');var path=require(_0x5861('0x1'));var timeout=require(_0x5861('0x2'));var express=require(_0x5861('0x3'));var router=express[_0x5861('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5861('0x5'));var interaction=require(_0x5861('0x6'));var config=require(_0x5861('0x7'));var controller=require(_0x5861('0x8'));router['get']('/',auth[_0x5861('0x9')](),controller['index']);router[_0x5861('0xa')]('/:id',auth[_0x5861('0x9')](),controller['show']);router[_0x5861('0xb')]('/',auth[_0x5861('0x9')](),controller[_0x5861('0xc')]);router[_0x5861('0xd')](_0x5861('0xe'),auth[_0x5861('0x9')](),controller[_0x5861('0xf')]);router[_0x5861('0x10')](_0x5861('0xe'),auth[_0x5861('0x9')](),controller[_0x5861('0x11')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index afbaeee..c6b8de7 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 _0x8ef1=['keyValue','picklist','STRING','ENUM','exports','string','variable','customVariable'];(function(_0xc8b0b8,_0x24b1fd){var _0x10b077=function(_0x4e7815){while(--_0x4e7815){_0xc8b0b8['push'](_0xc8b0b8['shift']());}};_0x10b077(++_0x24b1fd);}(_0x8ef1,0x114));var _0x18ef=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0x8ef1[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require('sequelize');module[_0x18ef('0x0')]={'type':{'type':Sequelize['ENUM'](_0x18ef('0x1'),_0x18ef('0x2'),_0x18ef('0x3'),_0x18ef('0x4'),_0x18ef('0x5')),'defaultValue':_0x18ef('0x1')},'content':{'type':Sequelize[_0x18ef('0x6')]},'key':{'type':Sequelize[_0x18ef('0x6')]},'keyType':{'type':Sequelize[_0x18ef('0x7')](_0x18ef('0x1'),_0x18ef('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x18ef('0x6')]},'idField':{'type':Sequelize[_0x18ef('0x6')]},'variableName':{'type':Sequelize[_0x18ef('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 41e139d..75b012d 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 _0x7fa1=['fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','SalesforceField','then','includeAll','include','findAll','show','params','keys','options','catch','create','body','destroy','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','end','error','stack','name','send','map','rawAttributes'];(function(_0x3240ff,_0x3b9c3d){var _0x514858=function(_0x22023a){while(--_0x22023a){_0x3240ff['push'](_0x3240ff['shift']());}};_0x514858(++_0x3b9c3d);}(_0x7fa1,0x17c));var _0x17fa=function(_0x5b15c9,_0x4b2471){_0x5b15c9=_0x5b15c9-0x0;var _0x2d68b6=_0x7fa1[_0x5b15c9];return _0x2d68b6;};'use strict';var emlformat=require(_0x17fa('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x17fa('0x1'));var moment=require(_0x17fa('0x2'));var BPromise=require(_0x17fa('0x3'));var Mustache=require(_0x17fa('0x4'));var util=require(_0x17fa('0x5'));var path=require(_0x17fa('0x6'));var sox=require(_0x17fa('0x7'));var csv=require('to-csv');var ejs=require(_0x17fa('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x17fa('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x17fa('0xa'));var toCsv=require('to-csv');var querystring=require(_0x17fa('0xb'));var Papa=require(_0x17fa('0xc'));var Redis=require(_0x17fa('0xd'));var authService=require(_0x17fa('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17fa('0xf'));var logger=require(_0x17fa('0x10'))('api');var utils=require(_0x17fa('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x17fa('0x12'));var db=require(_0x17fa('0x13'))['db'];function respondWithStatusCode(_0x24f5f5,_0xf55712){_0xf55712=_0xf55712||0xcc;return function(_0x2ec461){if(_0x2ec461){return _0x24f5f5[_0x17fa('0x14')](_0xf55712);}return _0x24f5f5[_0x17fa('0x15')](_0xf55712)['end']();};}function respondWithResult(_0x4fb31a,_0x836013){_0x836013=_0x836013||0xc8;return function(_0x5c75df){if(_0x5c75df){return _0x4fb31a['status'](_0x836013)['json'](_0x5c75df);}};}function respondWithFilteredResult(_0x116816,_0x53c326){return function(_0x1ec306){if(_0x1ec306){var _0x3621ce=typeof _0x53c326['offset']===_0x17fa('0x16')&&typeof _0x53c326['limit']===_0x17fa('0x16');var _0x2e7c49=_0x1ec306[_0x17fa('0x17')];var _0x1c9847=_0x3621ce?0x0:_0x53c326[_0x17fa('0x18')];var _0x3a5105=_0x3621ce?_0x1ec306[_0x17fa('0x17')]:_0x53c326[_0x17fa('0x18')]+_0x53c326[_0x17fa('0x19')];var _0x457549;if(_0x3a5105>=_0x2e7c49){_0x3a5105=_0x2e7c49;_0x457549=0xc8;}else{_0x457549=0xce;}_0x116816[_0x17fa('0x15')](_0x457549);return _0x116816[_0x17fa('0x1a')](_0x17fa('0x1b'),_0x1c9847+'-'+_0x3a5105+'/'+_0x2e7c49)[_0x17fa('0x1c')](_0x1ec306);}return null;};}function patchUpdates(_0xd6181){return function(_0x24a1e8){try{jsonpatch[_0x17fa('0x1d')](_0x24a1e8,_0xd6181,!![]);}catch(_0x1eeec3){return BPromise[_0x17fa('0x1e')](_0x1eeec3);}return _0x24a1e8[_0x17fa('0x1f')]();};}function saveUpdates(_0x1b2e23,_0x2db02a){return function(_0x2ca1c3){if(_0x2ca1c3){return _0x2ca1c3[_0x17fa('0x20')](_0x1b2e23)['then'](function(_0x222985){return _0x222985;});}return null;};}function removeEntity(_0x573b29,_0x30ec6d){return function(_0x2c60be){if(_0x2c60be){return _0x2c60be['destroy']()['then'](function(){_0x573b29['status'](0xcc)[_0x17fa('0x21')]();});}};}function handleEntityNotFound(_0x4fe385,_0x129583){return function(_0x35eb88){if(!_0x35eb88){_0x4fe385[_0x17fa('0x14')](0x194);}return _0x35eb88;};}function handleError(_0x4490fa,_0x400b75){_0x400b75=_0x400b75||0x1f4;return function(_0x28b1b3){logger[_0x17fa('0x22')](_0x28b1b3[_0x17fa('0x23')]);if(_0x28b1b3[_0x17fa('0x24')]){delete _0x28b1b3[_0x17fa('0x24')];}_0x4490fa[_0x17fa('0x15')](_0x400b75)[_0x17fa('0x25')](_0x28b1b3);};}exports['index']=function(_0x556afd,_0x188c18){var _0x4068df={},_0x1c995d={},_0x355c67={'count':0x0,'rows':[]};var _0x5a09ed=_[_0x17fa('0x26')](db['SalesforceField'][_0x17fa('0x27')],function(_0x26aae6){return{'name':_0x26aae6[_0x17fa('0x28')],'type':_0x26aae6[_0x17fa('0x29')][_0x17fa('0x2a')]};});_0x1c995d[_0x17fa('0x2b')]=_[_0x17fa('0x26')](_0x5a09ed,_0x17fa('0x24'));_0x1c995d[_0x17fa('0x2c')]=_['keys'](_0x556afd[_0x17fa('0x2c')]);_0x1c995d[_0x17fa('0x2d')]=_[_0x17fa('0x2e')](_0x1c995d[_0x17fa('0x2b')],_0x1c995d[_0x17fa('0x2c')]);_0x4068df[_0x17fa('0x2f')]=_['intersection'](_0x1c995d[_0x17fa('0x2b')],qs[_0x17fa('0x30')](_0x556afd[_0x17fa('0x2c')]['fields']));_0x4068df[_0x17fa('0x2f')]=_0x4068df[_0x17fa('0x2f')][_0x17fa('0x31')]?_0x4068df['attributes']:_0x1c995d['model'];if(!_0x556afd[_0x17fa('0x2c')][_0x17fa('0x32')](_0x17fa('0x33'))){_0x4068df[_0x17fa('0x19')]=qs[_0x17fa('0x19')](_0x556afd['query'][_0x17fa('0x19')]);_0x4068df[_0x17fa('0x18')]=qs['offset'](_0x556afd['query']['offset']);}_0x4068df['order']=qs[_0x17fa('0x34')](_0x556afd[_0x17fa('0x2c')]['sort']);_0x4068df['where']=qs[_0x17fa('0x2d')](_['pick'](_0x556afd[_0x17fa('0x2c')],_0x1c995d[_0x17fa('0x2d')]),_0x5a09ed);if(_0x556afd[_0x17fa('0x2c')][_0x17fa('0x35')]){_0x4068df[_0x17fa('0x36')]=_[_0x17fa('0x37')](_0x4068df['where'],{'$or':_[_0x17fa('0x26')](_0x5a09ed,function(_0x5135b9){if(_0x5135b9[_0x17fa('0x29')]!==_0x17fa('0x38')){var _0x47e666={};_0x47e666[_0x5135b9['name']]={'$like':'%'+_0x556afd['query']['filter']+'%'};return _0x47e666;}})});}_0x4068df=_[_0x17fa('0x37')]({},_0x4068df,_0x556afd['options']);var _0x13aac1={'where':_0x4068df['where']};return db[_0x17fa('0x39')]['count'](_0x13aac1)[_0x17fa('0x3a')](function(_0x2caa51){_0x355c67['count']=_0x2caa51;if(_0x556afd['query'][_0x17fa('0x3b')]){_0x4068df[_0x17fa('0x3c')]=[{'all':!![]}];}return db[_0x17fa('0x39')][_0x17fa('0x3d')](_0x4068df);})[_0x17fa('0x3a')](function(_0x922491){_0x355c67['rows']=_0x922491;return _0x355c67;})['then'](respondWithFilteredResult(_0x188c18,_0x4068df))['catch'](handleError(_0x188c18,null));};exports[_0x17fa('0x3e')]=function(_0x3541b1,_0x2a45e4){var _0x4c596e={'raw':!![],'where':{'id':_0x3541b1[_0x17fa('0x3f')]['id']}},_0x4bf3f2={};_0x4bf3f2[_0x17fa('0x2b')]=_[_0x17fa('0x40')](db[_0x17fa('0x39')][_0x17fa('0x27')]);_0x4bf3f2['query']=_[_0x17fa('0x40')](_0x3541b1[_0x17fa('0x2c')]);_0x4bf3f2[_0x17fa('0x2d')]=_[_0x17fa('0x2e')](_0x4bf3f2[_0x17fa('0x2b')],_0x4bf3f2[_0x17fa('0x2c')]);_0x4c596e[_0x17fa('0x2f')]=_[_0x17fa('0x2e')](_0x4bf3f2[_0x17fa('0x2b')],qs['fields'](_0x3541b1[_0x17fa('0x2c')][_0x17fa('0x30')]));_0x4c596e[_0x17fa('0x2f')]=_0x4c596e[_0x17fa('0x2f')][_0x17fa('0x31')]?_0x4c596e[_0x17fa('0x2f')]:_0x4bf3f2[_0x17fa('0x2b')];if(_0x3541b1['query']['includeAll']){_0x4c596e[_0x17fa('0x3c')]=[{'all':!![]}];}_0x4c596e=_[_0x17fa('0x37')]({},_0x4c596e,_0x3541b1[_0x17fa('0x41')]);return db[_0x17fa('0x39')]['find'](_0x4c596e)[_0x17fa('0x3a')](handleEntityNotFound(_0x2a45e4,null))['then'](respondWithResult(_0x2a45e4,null))[_0x17fa('0x42')](handleError(_0x2a45e4,null));};exports[_0x17fa('0x43')]=function(_0x19f7f,_0x35c3fd){return db[_0x17fa('0x39')]['create'](_0x19f7f[_0x17fa('0x44')],{})[_0x17fa('0x3a')](respondWithResult(_0x35c3fd,0xc9))['catch'](handleError(_0x35c3fd,null));};exports['update']=function(_0x4fd568,_0x332e58){if(_0x4fd568[_0x17fa('0x44')]['id']){delete _0x4fd568[_0x17fa('0x44')]['id'];}return db[_0x17fa('0x39')]['find']({'where':{'id':_0x4fd568[_0x17fa('0x3f')]['id']}})['then'](handleEntityNotFound(_0x332e58,null))[_0x17fa('0x3a')](saveUpdates(_0x4fd568[_0x17fa('0x44')],null))[_0x17fa('0x3a')](respondWithResult(_0x332e58,null))[_0x17fa('0x42')](handleError(_0x332e58,null));};exports[_0x17fa('0x45')]=function(_0x4c3250,_0x37391d){return db[_0x17fa('0x39')]['find']({'where':{'id':_0x4c3250[_0x17fa('0x3f')]['id']}})[_0x17fa('0x3a')](handleEntityNotFound(_0x37391d,null))['then'](removeEntity(_0x37391d,null))[_0x17fa('0x42')](handleError(_0x37391d,null));}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 1e493d3..e3628a8 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 _0x72e1=['./intSalesforceField.attributes','define','SalesforceField','idField','FieldId','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x57f5ba,_0x3a4db9){var _0x4abff3=function(_0x33fd7c){while(--_0x33fd7c){_0x57f5ba['push'](_0x57f5ba['shift']());}};_0x4abff3(++_0x3a4db9);}(_0x72e1,0xb9));var _0x172e=function(_0x2cb01a,_0x5e1d8b){_0x2cb01a=_0x2cb01a-0x0;var _0x5d565d=_0x72e1[_0x2cb01a];return _0x5d565d;};'use strict';var _=require('lodash');var util=require(_0x172e('0x0'));var logger=require(_0x172e('0x1'))(_0x172e('0x2'));var moment=require(_0x172e('0x3'));var BPromise=require('bluebird');var rp=require(_0x172e('0x4'));var fs=require('fs');var path=require(_0x172e('0x5'));var rimraf=require('rimraf');var config=require(_0x172e('0x6'));var attributes=require(_0x172e('0x7'));module['exports']=function(_0xcd23d0,_0x2e24cd){return _0xcd23d0[_0x172e('0x8')](_0x172e('0x9'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x172e('0xa'),_0x172e('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index dc92a56..61951de 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 _0x6d7a=['message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3369c5,_0xce66ba){var _0x10fae9=function(_0x196969){while(--_0x196969){_0x3369c5['push'](_0x3369c5['shift']());}};_0x10fae9(++_0xce66ba);}(_0x6d7a,0x14d));var _0xa6d7=function(_0x5ef055,_0x1cb5ed){_0x5ef055=_0x5ef055-0x0;var _0x4a7d1e=_0x6d7a[_0x5ef055];return _0x4a7d1e;};'use strict';var _=require(_0xa6d7('0x0'));var util=require('util');var moment=require(_0xa6d7('0x1'));var BPromise=require('bluebird');var rs=require(_0xa6d7('0x2'));var fs=require('fs');var Redis=require(_0xa6d7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xa6d7('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa6d7('0x5'));var jayson=require(_0xa6d7('0x6'));var client=jayson[_0xa6d7('0x7')][_0xa6d7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b38e3,_0x3e9c9e,_0x3eb768){return new BPromise(function(_0x14b971,_0x5dee49){return client[_0xa6d7('0x9')](_0x3b38e3,_0x3eb768)[_0xa6d7('0xa')](function(_0x2553b7){logger[_0xa6d7('0xb')](_0xa6d7('0xc'),_0x3e9c9e,_0xa6d7('0xd'));logger[_0xa6d7('0xe')](_0xa6d7('0xf'),_0x3e9c9e,_0xa6d7('0xd'),JSON[_0xa6d7('0x10')](_0x2553b7));if(_0x2553b7[_0xa6d7('0x11')]){if(_0x2553b7[_0xa6d7('0x11')][_0xa6d7('0x12')]===0x1f4){logger[_0xa6d7('0x11')](_0xa6d7('0xc'),_0x3e9c9e,_0x2553b7[_0xa6d7('0x11')][_0xa6d7('0x13')]);return _0x5dee49(_0x2553b7['error'][_0xa6d7('0x13')]);}logger[_0xa6d7('0x11')]('SalesforceField,\x20%s,\x20%s',_0x3e9c9e,_0x2553b7[_0xa6d7('0x11')]['message']);return _0x14b971(_0x2553b7[_0xa6d7('0x11')][_0xa6d7('0x13')]);}else{logger[_0xa6d7('0xb')](_0xa6d7('0xc'),_0x3e9c9e,'request\x20sent');_0x14b971(_0x2553b7[_0xa6d7('0x14')][_0xa6d7('0x13')]);}})[_0xa6d7('0x15')](function(_0x5144cf){logger[_0xa6d7('0x11')](_0xa6d7('0xc'),_0x3e9c9e,_0x5144cf);_0x5dee49(_0x5144cf);});});} \ No newline at end of file +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 diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 34aaf7f..829e2f2 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 _0x5dea=['create','put','update','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getConfigurations','getFields','post'];(function(_0x47c781,_0x429d48){var _0xa7fca0=function(_0x3cb339){while(--_0x3cb339){_0x47c781['push'](_0x47c781['shift']());}};_0xa7fca0(++_0x429d48);}(_0x5dea,0x1bc));var _0xa5de=function(_0xe484b6,_0x3b4861){_0xe484b6=_0xe484b6-0x0;var _0x56ad80=_0x5dea[_0xe484b6];return _0x56ad80;};'use strict';var multer=require(_0xa5de('0x0'));var util=require(_0xa5de('0x1'));var path=require(_0xa5de('0x2'));var timeout=require(_0xa5de('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xa5de('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa5de('0x5'));var config=require(_0xa5de('0x6'));var controller=require(_0xa5de('0x7'));router[_0xa5de('0x8')]('/',auth['isAuthenticated'](),controller[_0xa5de('0x9')]);router['get'](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller['show']);router[_0xa5de('0x8')](_0xa5de('0xc'),auth[_0xa5de('0xb')](),controller[_0xa5de('0xd')]);router[_0xa5de('0x8')]('/:id/fields',auth[_0xa5de('0xb')](),controller[_0xa5de('0xe')]);router[_0xa5de('0xf')]('/',auth[_0xa5de('0xb')](),controller[_0xa5de('0x10')]);router['post'](_0xa5de('0xc'),auth[_0xa5de('0xb')](),controller['addConfiguration']);router[_0xa5de('0x11')](_0xa5de('0xa'),auth[_0xa5de('0xb')](),controller[_0xa5de('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa5de('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index ed0f115..72d0707 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 _0x739b=['exports','STRING'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x739b,0x1e0));var _0xb739=function(_0x136119,_0x2a71b5){_0x136119=_0x136119-0x0;var _0x4153a6=_0x739b[_0x136119];return _0x4153a6;};'use strict';var Sequelize=require('sequelize');module[_0xb739('0x0')]={'name':{'type':Sequelize[_0xb739('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb739('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xb739('0x1')]},'remoteUri':{'type':Sequelize[_0xb739('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xb739('0x1')],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 08ea49b..178d5c9 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 _0x4f8a=['nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','findAll','rows','catch','show','includeAll','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','rawAttributes','hasOwnProperty','AccountId','Subjects','channel','Descriptions','type','ServicenowField','made_sla','hold_reason','knowledge','subcategory','incident_state','severity','watch_list','sys_updated_on','child_incidents','approval_history','resolved_by','sys_updated_by','opened_by','user_input','sys_created_by','calendar_stc','closed_at','cmdb_ci','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','resolved_at','work_notes','close_code','delivery_task','work_start','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','password','GET','result','log','incident\x20table\x20objects','assign','remove','includes','label','push','all','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','internalType','concat','ServiceNow\x20error:\x20','test','statusCode','send','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','ServicenowAccount','fieldName','key','query','keys','intersection','model','attributes','fields','length'];(function(_0x4b4ebe,_0x2ca980){var _0x12039f=function(_0x562296){while(--_0x562296){_0x4b4ebe['push'](_0x4b4ebe['shift']());}};_0x12039f(++_0x2ca980);}(_0x4f8a,0x1ed));var _0xa4f8=function(_0x427679,_0x441d36){_0x427679=_0x427679-0x0;var _0x558b17=_0x4f8a[_0x427679];return _0x558b17;};'use strict';var emlformat=require(_0xa4f8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4f8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa4f8('0x2'));var moment=require(_0xa4f8('0x3'));var BPromise=require(_0xa4f8('0x4'));var Mustache=require(_0xa4f8('0x5'));var util=require(_0xa4f8('0x6'));var path=require(_0xa4f8('0x7'));var sox=require('sox');var csv=require(_0xa4f8('0x8'));var ejs=require(_0xa4f8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4f8('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xa4f8('0x8'));var querystring=require(_0xa4f8('0xb'));var Papa=require(_0xa4f8('0xc'));var Redis=require(_0xa4f8('0xd'));var authService=require(_0xa4f8('0xe'));var qs=require(_0xa4f8('0xf'));var as=require(_0xa4f8('0x10'));var hardwareService=require(_0xa4f8('0x11'));var logger=require(_0xa4f8('0x12'))(_0xa4f8('0x13'));var utils=require(_0xa4f8('0x14'));var config=require(_0xa4f8('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa4f8('0x16'))['db'];var integrations=require(_0xa4f8('0x17'));function respondWithStatusCode(_0x9cbca8,_0x56288e){_0x56288e=_0x56288e||0xcc;return function(_0x4d7306){if(_0x4d7306){return _0x9cbca8[_0xa4f8('0x18')](_0x56288e);}return _0x9cbca8[_0xa4f8('0x19')](_0x56288e)[_0xa4f8('0x1a')]();};}function respondWithResult(_0x2a6f4b,_0x138a77){_0x138a77=_0x138a77||0xc8;return function(_0x3c3d3d){if(_0x3c3d3d){return _0x2a6f4b[_0xa4f8('0x19')](_0x138a77)['json'](_0x3c3d3d);}};}function respondWithFilteredResult(_0x435891,_0x2bc871){return function(_0x767264){if(_0x767264){var _0x29a497=typeof _0x2bc871['offset']===_0xa4f8('0x1b')&&typeof _0x2bc871['limit']===_0xa4f8('0x1b');var _0x32b0a0=_0x767264[_0xa4f8('0x1c')];var _0x301650=_0x29a497?0x0:_0x2bc871[_0xa4f8('0x1d')];var _0x7d8e99=_0x29a497?_0x767264[_0xa4f8('0x1c')]:_0x2bc871[_0xa4f8('0x1d')]+_0x2bc871[_0xa4f8('0x1e')];var _0x5adb5e;if(_0x7d8e99>=_0x32b0a0){_0x7d8e99=_0x32b0a0;_0x5adb5e=0xc8;}else{_0x5adb5e=0xce;}_0x435891['status'](_0x5adb5e);return _0x435891[_0xa4f8('0x1f')](_0xa4f8('0x20'),_0x301650+'-'+_0x7d8e99+'/'+_0x32b0a0)[_0xa4f8('0x21')](_0x767264);}return null;};}function patchUpdates(_0x471acb){return function(_0x4f3ba8){try{jsonpatch[_0xa4f8('0x22')](_0x4f3ba8,_0x471acb,!![]);}catch(_0x341a5d){return BPromise['reject'](_0x341a5d);}return _0x4f3ba8[_0xa4f8('0x23')]();};}function saveUpdates(_0x1ab738,_0x28592e){return function(_0x39807a){if(_0x39807a){return _0x39807a[_0xa4f8('0x24')](_0x1ab738)[_0xa4f8('0x25')](function(_0x517bfa){return _0x517bfa;});}return null;};}function removeEntity(_0x8dae43,_0x5e2115){return function(_0x3790b1){if(_0x3790b1){return _0x3790b1[_0xa4f8('0x26')]()[_0xa4f8('0x25')](function(){_0x8dae43[_0xa4f8('0x19')](0xcc)[_0xa4f8('0x1a')]();});}};}function handleEntityNotFound(_0x3bf78a,_0x36cd8f){return function(_0xda857f){if(!_0xda857f){_0x3bf78a[_0xa4f8('0x18')](0x194);}return _0xda857f;};}function handleError(_0x3a1a78,_0x48f195){_0x48f195=_0x48f195||0x1f4;return function(_0x4c136b){logger[_0xa4f8('0x27')](_0x4c136b[_0xa4f8('0x28')]);if(_0x4c136b['name']){delete _0x4c136b[_0xa4f8('0x29')];}_0x3a1a78[_0xa4f8('0x19')](_0x48f195)['send'](_0x4c136b);};}exports[_0xa4f8('0x2a')]=function(_0x2082ca,_0x26e1ea){var _0x4f888c={},_0x21479d={},_0x7a9ed7={'count':0x0,'rows':[]};var _0x27d1e9=_['map'](db[_0xa4f8('0x2b')]['rawAttributes'],function(_0xffd0a7){return{'name':_0xffd0a7[_0xa4f8('0x2c')],'type':_0xffd0a7['type'][_0xa4f8('0x2d')]};});_0x21479d['model']=_['map'](_0x27d1e9,_0xa4f8('0x29'));_0x21479d[_0xa4f8('0x2e')]=_[_0xa4f8('0x2f')](_0x2082ca['query']);_0x21479d['filters']=_[_0xa4f8('0x30')](_0x21479d[_0xa4f8('0x31')],_0x21479d[_0xa4f8('0x2e')]);_0x4f888c[_0xa4f8('0x32')]=_[_0xa4f8('0x30')](_0x21479d[_0xa4f8('0x31')],qs[_0xa4f8('0x33')](_0x2082ca['query'][_0xa4f8('0x33')]));_0x4f888c[_0xa4f8('0x32')]=_0x4f888c[_0xa4f8('0x32')][_0xa4f8('0x34')]?_0x4f888c[_0xa4f8('0x32')]:_0x21479d[_0xa4f8('0x31')];if(!_0x2082ca[_0xa4f8('0x2e')]['hasOwnProperty'](_0xa4f8('0x35'))){_0x4f888c[_0xa4f8('0x1e')]=qs[_0xa4f8('0x1e')](_0x2082ca[_0xa4f8('0x2e')]['limit']);_0x4f888c[_0xa4f8('0x1d')]=qs[_0xa4f8('0x1d')](_0x2082ca['query'][_0xa4f8('0x1d')]);}_0x4f888c[_0xa4f8('0x36')]=qs[_0xa4f8('0x37')](_0x2082ca['query'][_0xa4f8('0x37')]);_0x4f888c[_0xa4f8('0x38')]=qs['filters'](_[_0xa4f8('0x39')](_0x2082ca[_0xa4f8('0x2e')],_0x21479d[_0xa4f8('0x3a')]),_0x27d1e9);if(_0x2082ca['query'][_0xa4f8('0x3b')]){_0x4f888c[_0xa4f8('0x38')]=_[_0xa4f8('0x3c')](_0x4f888c[_0xa4f8('0x38')],{'$or':_[_0xa4f8('0x3d')](_0x27d1e9,function(_0x3bcff7){if(_0x3bcff7['type']!==_0xa4f8('0x3e')){var _0x37260f={};_0x37260f[_0x3bcff7[_0xa4f8('0x29')]]={'$like':'%'+_0x2082ca[_0xa4f8('0x2e')][_0xa4f8('0x3b')]+'%'};return _0x37260f;}})});}_0x4f888c=_[_0xa4f8('0x3c')]({},_0x4f888c,_0x2082ca[_0xa4f8('0x3f')]);var _0x4c412d={'where':_0x4f888c['where']};return db[_0xa4f8('0x2b')][_0xa4f8('0x1c')](_0x4c412d)[_0xa4f8('0x25')](function(_0x34b939){_0x7a9ed7[_0xa4f8('0x1c')]=_0x34b939;if(_0x2082ca[_0xa4f8('0x2e')]['includeAll']){_0x4f888c['include']=[{'all':!![]}];}return db[_0xa4f8('0x2b')][_0xa4f8('0x40')](_0x4f888c);})['then'](function(_0x4fd11e){_0x7a9ed7[_0xa4f8('0x41')]=_0x4fd11e;return _0x7a9ed7;})[_0xa4f8('0x25')](respondWithFilteredResult(_0x26e1ea,_0x4f888c))[_0xa4f8('0x42')](handleError(_0x26e1ea,null));};exports[_0xa4f8('0x43')]=function(_0x510e61,_0x56e733){var _0x1f5892={'raw':![],'where':{'id':_0x510e61['params']['id']}},_0x1c5574={};_0x1c5574[_0xa4f8('0x31')]=_[_0xa4f8('0x2f')](db[_0xa4f8('0x2b')]['rawAttributes']);_0x1c5574['query']=_['keys'](_0x510e61[_0xa4f8('0x2e')]);_0x1c5574[_0xa4f8('0x3a')]=_[_0xa4f8('0x30')](_0x1c5574[_0xa4f8('0x31')],_0x1c5574['query']);_0x1f5892['attributes']=_[_0xa4f8('0x30')](_0x1c5574[_0xa4f8('0x31')],qs[_0xa4f8('0x33')](_0x510e61[_0xa4f8('0x2e')][_0xa4f8('0x33')]));_0x1f5892[_0xa4f8('0x32')]=_0x1f5892['attributes'][_0xa4f8('0x34')]?_0x1f5892[_0xa4f8('0x32')]:_0x1c5574[_0xa4f8('0x31')];if(_0x510e61[_0xa4f8('0x2e')][_0xa4f8('0x44')]){_0x1f5892['include']=[{'all':!![]}];}_0x1f5892=_['merge']({},_0x1f5892,_0x510e61[_0xa4f8('0x3f')]);return db[_0xa4f8('0x2b')][_0xa4f8('0x45')](_0x1f5892)[_0xa4f8('0x25')](handleEntityNotFound(_0x56e733,null))['then'](respondWithResult(_0x56e733,null))[_0xa4f8('0x42')](handleError(_0x56e733,null));};exports['create']=function(_0x3c7db5,_0x56ec1c){return db[_0xa4f8('0x2b')][_0xa4f8('0x46')](_0x3c7db5['body'],{})[_0xa4f8('0x25')](respondWithResult(_0x56ec1c,0xc9))[_0xa4f8('0x42')](handleError(_0x56ec1c,null));};exports['update']=function(_0x4f35a4,_0x274fbf){if(_0x4f35a4[_0xa4f8('0x47')]['id']){delete _0x4f35a4[_0xa4f8('0x47')]['id'];}return db[_0xa4f8('0x2b')][_0xa4f8('0x45')]({'where':{'id':_0x4f35a4[_0xa4f8('0x48')]['id']}})[_0xa4f8('0x25')](handleEntityNotFound(_0x274fbf,null))[_0xa4f8('0x25')](saveUpdates(_0x4f35a4[_0xa4f8('0x47')],null))[_0xa4f8('0x25')](respondWithResult(_0x274fbf,null))[_0xa4f8('0x42')](handleError(_0x274fbf,null));};exports[_0xa4f8('0x26')]=function(_0x18198f,_0x20b439){return db[_0xa4f8('0x2b')]['find']({'where':{'id':_0x18198f[_0xa4f8('0x48')]['id']}})[_0xa4f8('0x25')](handleEntityNotFound(_0x20b439,null))['then'](removeEntity(_0x20b439,null))[_0xa4f8('0x42')](handleError(_0x20b439,null));};exports[_0xa4f8('0x49')]=function(_0x4d280d,_0x39aa70,_0xa2046c){var _0xe06cd1={};var _0x8223f9={};var _0x310c1b;var _0x4784e2;return db[_0xa4f8('0x2b')][_0xa4f8('0x4a')]({'where':{'id':_0x4d280d['params']['id']}})[_0xa4f8('0x25')](handleEntityNotFound(_0x39aa70,null))[_0xa4f8('0x25')](function(_0x44ae85){if(_0x44ae85){_0x310c1b=_0x44ae85;_0x8223f9[_0xa4f8('0x31')]=_[_0xa4f8('0x2f')](db[_0xa4f8('0x4b')][_0xa4f8('0x4c')]);_0x8223f9[_0xa4f8('0x2e')]=_[_0xa4f8('0x2f')](_0x4d280d['query']);_0x8223f9[_0xa4f8('0x3a')]=_[_0xa4f8('0x30')](_0x8223f9[_0xa4f8('0x31')],_0x8223f9[_0xa4f8('0x2e')]);_0xe06cd1[_0xa4f8('0x32')]=_['intersection'](_0x8223f9[_0xa4f8('0x31')],qs[_0xa4f8('0x33')](_0x4d280d[_0xa4f8('0x2e')][_0xa4f8('0x33')]));_0xe06cd1[_0xa4f8('0x32')]=_0xe06cd1[_0xa4f8('0x32')][_0xa4f8('0x34')]?_0xe06cd1[_0xa4f8('0x32')]:_0x8223f9[_0xa4f8('0x31')];_0xe06cd1[_0xa4f8('0x36')]=qs[_0xa4f8('0x37')](_0x4d280d[_0xa4f8('0x2e')][_0xa4f8('0x37')]);_0xe06cd1['where']=qs[_0xa4f8('0x3a')](_['pick'](_0x4d280d[_0xa4f8('0x2e')],_0x8223f9[_0xa4f8('0x3a')]));if(_0x4d280d['query'][_0xa4f8('0x3b')]){_0xe06cd1[_0xa4f8('0x38')]=_[_0xa4f8('0x3c')](_0xe06cd1[_0xa4f8('0x38')],{'$or':_['map'](_0xe06cd1[_0xa4f8('0x32')],function(_0x122b77){var _0x224be5={};_0x224be5[_0x122b77]={'$like':'%'+_0x4d280d[_0xa4f8('0x2e')][_0xa4f8('0x3b')]+'%'};return _0x224be5;})});}_0xe06cd1=_[_0xa4f8('0x3c')]({},_0xe06cd1,_0x4d280d[_0xa4f8('0x3f')]);return _0x310c1b['getConfigurations'](_0xe06cd1);}})['then'](function(_0x10336e){if(_0x10336e){_0x4784e2=_0x10336e[_0xa4f8('0x34')];if(!_0x4d280d['query'][_0xa4f8('0x4d')](_0xa4f8('0x35'))){_0xe06cd1[_0xa4f8('0x1e')]=qs['limit'](_0x4d280d[_0xa4f8('0x2e')][_0xa4f8('0x1e')]);_0xe06cd1[_0xa4f8('0x1d')]=qs['offset'](_0x4d280d['query'][_0xa4f8('0x1d')]);}return _0x310c1b['getConfigurations'](_0xe06cd1);}})[_0xa4f8('0x25')](function(_0x1e5429){if(_0x1e5429){return _0x1e5429?{'count':_0x4784e2,'rows':_0x1e5429}:null;}})[_0xa4f8('0x25')](respondWithResult(_0x39aa70,null))['catch'](handleError(_0x39aa70,null));};exports['addConfiguration']=function(_0x1cf8a5,_0x1fca90,_0x2732ce){if(_0x1cf8a5['body']['id']){delete _0x1cf8a5[_0xa4f8('0x47')]['id'];}return db[_0xa4f8('0x2b')][_0xa4f8('0x4a')]({'where':{'id':_0x1cf8a5[_0xa4f8('0x48')]['id']}})[_0xa4f8('0x25')](handleEntityNotFound(_0x1fca90,null))[_0xa4f8('0x25')](function(_0x466c38){if(_0x466c38){_0x1cf8a5[_0xa4f8('0x47')][_0xa4f8('0x4e')]=_0x466c38['id'];_0x1cf8a5[_0xa4f8('0x47')][_0xa4f8('0x4f')]=integrations['getSubjects'](_0x1cf8a5[_0xa4f8('0x47')][_0xa4f8('0x50')],_0x1cf8a5[_0xa4f8('0x47')]['type']);_0x1cf8a5[_0xa4f8('0x47')][_0xa4f8('0x51')]=integrations['getDescriptions'](_0x1cf8a5[_0xa4f8('0x47')][_0xa4f8('0x50')],_0x1cf8a5[_0xa4f8('0x47')][_0xa4f8('0x52')]);return db['ServicenowConfiguration'][_0xa4f8('0x46')](_0x1cf8a5[_0xa4f8('0x47')],{'include':[{'model':db[_0xa4f8('0x53')],'as':_0xa4f8('0x4f')},{'model':db[_0xa4f8('0x53')],'as':_0xa4f8('0x51')}]});}return null;})[_0xa4f8('0x25')](respondWithResult(_0x1fca90,null))[_0xa4f8('0x42')](handleError(_0x1fca90,null));};exports['getFields']=function(_0x3c81af,_0xa59e6c,_0x49fb41){var _0x4e2840=[_0xa4f8('0x54'),_0xa4f8('0x55'),_0xa4f8('0x56'),_0xa4f8('0x57'),'close_code','notify',_0xa4f8('0x58'),_0xa4f8('0x59'),'category'];var _0x23f421=['parent',_0xa4f8('0x54'),'caused_by',_0xa4f8('0x5a'),'upon_reject',_0xa4f8('0x5b'),_0xa4f8('0x5c'),_0xa4f8('0x55'),_0xa4f8('0x5d'),'number',_0xa4f8('0x5e'),_0xa4f8('0x5f'),_0xa4f8('0x60'),_0xa4f8('0x61'),'sys_created_on','sys_domain','state',_0xa4f8('0x62'),_0xa4f8('0x56'),'order',_0xa4f8('0x63'),_0xa4f8('0x64'),_0xa4f8('0x65'),'delivery_plan','impact',_0xa4f8('0x66'),_0xa4f8('0x67'),_0xa4f8('0x68'),_0xa4f8('0x69'),_0xa4f8('0x6a'),_0xa4f8('0x6b'),_0xa4f8('0x6c'),_0xa4f8('0x6d'),_0xa4f8('0x6e'),_0xa4f8('0x6f'),'group_list',_0xa4f8('0x70'),'reopened_time',_0xa4f8('0x71'),'caller_id','approval_set','subcategory',_0xa4f8('0x72'),'short_description',_0xa4f8('0x73'),'correlation_display',_0xa4f8('0x74'),_0xa4f8('0x75'),'assignment_group',_0xa4f8('0x76'),_0xa4f8('0x77'),_0xa4f8('0x78'),_0xa4f8('0x79'),_0xa4f8('0x7a'),_0xa4f8('0x7b'),'close_notes',_0xa4f8('0x7c'),_0xa4f8('0x7d'),_0xa4f8('0x7e'),_0xa4f8('0x7f'),_0xa4f8('0x80'),_0xa4f8('0x81'),_0xa4f8('0x58'),'urgency',_0xa4f8('0x82'),_0xa4f8('0x83'),_0xa4f8('0x84'),_0xa4f8('0x85'),_0xa4f8('0x86'),_0xa4f8('0x59'),_0xa4f8('0x87'),_0xa4f8('0x88'),_0xa4f8('0x89'),_0xa4f8('0x8a'),_0xa4f8('0x8b'),_0xa4f8('0x8c'),_0xa4f8('0x8d'),'sys_tags',_0xa4f8('0x8e'),_0xa4f8('0x8f'),_0xa4f8('0x90'),_0xa4f8('0x91'),'category'];var _0x5d30be='';var _0x2d5b8f='';var _0x14b360=[];var _0x255b4a='';var _0xddbfd='';var _0x22e79b=[];var _0xeadca3='';var _0x1fef93='';var _0xfc9719={};var _0x290da1='';return db[_0xa4f8('0x2b')]['findOne']({'where':{'id':_0x3c81af[_0xa4f8('0x48')]['id']},'attributes':['id',_0xa4f8('0x92'),'password',_0xa4f8('0x93'),_0xa4f8('0x94'),_0xa4f8('0x95')]})[_0xa4f8('0x25')](handleEntityNotFound(_0xa59e6c,null))[_0xa4f8('0x25')](function(_0x5ec6f1){if(_0x5ec6f1){_0x290da1=_0x5ec6f1[_0xa4f8('0x94')];var _0x1d216d=_0x290da1[_0xa4f8('0x96')](-0x1);if(_0x1d216d==='/'){_0x290da1=_0x290da1['substring'](0x0,_0x290da1[_0xa4f8('0x97')](_0x1d216d));}_0x1fef93=util[_0xa4f8('0x98')](_0xa4f8('0x99'),_0x290da1);_0xeadca3=util[_0xa4f8('0x98')]('%s/api/now/table/',_0x290da1);_0xfc9719={'user':_0x5ec6f1['username'],'pass':_0x5ec6f1[_0xa4f8('0x9a')]};var _0x4e279e={'method':_0xa4f8('0x9b'),'uri':_0x1fef93+'incident?sysparm_display_value=all','auth':_0xfc9719,'json':!![]};return rp(_0x4e279e);}})[_0xa4f8('0x25')](function(_0x264942){if(_0x264942['result'][_0xa4f8('0x34')]>0x0){_0x5d30be=_0x264942[_0xa4f8('0x9c')];}console[_0xa4f8('0x9d')](_0xa4f8('0x9e'),_0x5d30be);_0x22e79b=[];_0x2d5b8f=Object[_0xa4f8('0x9f')]([],_0x5d30be);_[_0xa4f8('0xa0')](_0x2d5b8f,function(_0x4dae18){return!_0x4e2840[_0xa4f8('0xa1')](_0x4dae18[_0xa4f8('0x29')]);});_0x2d5b8f['forEach'](function(_0x4b0f9b){var _0x14f1b1=createFieldObject(_0xeadca3,_0xfc9719,_0x4b0f9b['internalType'],_0x4b0f9b[_0xa4f8('0x29')],_0x4b0f9b[_0xa4f8('0xa2')],![]);_0x22e79b[_0xa4f8('0xa3')](_0x14f1b1);});return Promise[_0xa4f8('0xa4')](_0x22e79b);})[_0xa4f8('0x25')](function(_0x1ff0a7){_0x14b360=_0x1ff0a7;_0x255b4a=Object[_0xa4f8('0x9f')]([],_0x5d30be);console[_0xa4f8('0x9d')](_0xa4f8('0xa5'),_0x5d30be);_[_0xa4f8('0xa0')](_0x255b4a,function(_0xfd22dc){return _0x23f421['includes'](_0xfd22dc[_0xa4f8('0x29')]);});console[_0xa4f8('0x9d')](_0xa4f8('0xa6'),_0x255b4a);_0x22e79b=[];_0x255b4a[_0xa4f8('0xa7')](function(_0xe2949f){var _0x49fbb0=createFieldObject(_0xeadca3,_0xfc9719,_0xe2949f[_0xa4f8('0xa8')],_0xe2949f['name'],_0xe2949f['label'],!![]);_0x22e79b[_0xa4f8('0xa3')](_0x49fbb0);});return Promise[_0xa4f8('0xa4')](_0x22e79b);})[_0xa4f8('0x25')](function(_0x29cfe6){_0xddbfd=_0x29cfe6;var _0x14887d=_0x14b360[_0xa4f8('0xa9')](_0xddbfd);return{'count':_0x14887d['length'],'rows':_0x14887d};})[_0xa4f8('0x25')](respondWithResult(_0xa59e6c,null))[_0xa4f8('0x42')](function(_0x4e44d6){console[_0xa4f8('0x9d')](_0xa4f8('0xaa')+_0x4e44d6);var _0x10ac3c=_0x3c81af['query'][_0xa4f8('0xab')]?0x1f4:_0x4e44d6[_0xa4f8('0xac')]||0x1f4;logger['error'](_0x4e44d6[_0xa4f8('0x28')]);delete _0x4e44d6[_0xa4f8('0x29')];if(_0x10ac3c===0x191){_0x10ac3c=0x190;}_0xa59e6c[_0xa4f8('0x19')](_0x10ac3c)[_0xa4f8('0xad')](_0x3c81af['query'][_0xa4f8('0xab')]?{'message':_0xa4f8('0xae'),'statusCode':_0x4e44d6[_0xa4f8('0xac')]}:_0x4e44d6);});};function createFieldObject(_0x554c99,_0x2c2c7f,_0x5e99a7,_0x1bf0e5,_0x189898,_0x25efb1){return new Promise(function(_0x223996,_0x21319d){var _0x4edea9={'id':_0x1bf0e5,'name':_0x189898,'custom':_0x25efb1};if(_0x5e99a7===_0xa4f8('0xaf')){_0x4edea9[_0xa4f8('0x3f')]=[{'name':_0xa4f8('0xb0'),'value':_0xa4f8('0xb1')},{'name':_0xa4f8('0xb2'),'value':_0xa4f8('0xb3')}];_0x223996(_0x4edea9);}else{var _0x385cf5={'method':'GET','uri':_0x554c99+_0xa4f8('0xb4')+_0x1bf0e5,'auth':_0x2c2c7f,'json':!![]};return rp(_0x385cf5)['then'](function(_0x1b1933){var _0x2b864c=[];if(_0x1b1933[_0xa4f8('0x9c')][_0xa4f8('0x34')]>0x0){_0x1b1933[_0xa4f8('0x9c')][_0xa4f8('0xa7')](function(_0x96beb8){if(_0x96beb8['inactive']===_0xa4f8('0xb3')){var _0x37676c={'name':_0x96beb8[_0xa4f8('0xa2')],'value':_0x96beb8[_0xa4f8('0xb5')]};_0x2b864c[_0xa4f8('0xa3')](_0x37676c);}});}_0x4edea9['options']=_0x2b864c;if(_0x4edea9[_0xa4f8('0x3f')][_0xa4f8('0x34')]>0x0){_0x223996(_0x4edea9);}else{if(_0x25efb1==![]){_0x223996();}else{_0x223996(_0x4edea9);}}});}});} \ No newline at end of file +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 diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index b015647..d353e05 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 _0x5496=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','ServicenowAccount','int_servicenow_accounts','lodash'];(function(_0x352e09,_0x37a7da){var _0x1b7094=function(_0x561074){while(--_0x561074){_0x352e09['push'](_0x352e09['shift']());}};_0x1b7094(++_0x37a7da);}(_0x5496,0x175));var _0x6549=function(_0x306b31,_0x54ecef){_0x306b31=_0x306b31-0x0;var _0x8bdc83=_0x5496[_0x306b31];return _0x8bdc83;};'use strict';var _=require(_0x6549('0x0'));var util=require(_0x6549('0x1'));var logger=require(_0x6549('0x2'))(_0x6549('0x3'));var moment=require(_0x6549('0x4'));var BPromise=require('bluebird');var rp=require(_0x6549('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6549('0x6'));var config=require(_0x6549('0x7'));var attributes=require(_0x6549('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x43cb17,_0x1d8cea){return _0x43cb17['define'](_0x6549('0x9'),attributes,{'tableName':_0x6549('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 9e5a500..99624e3 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 _0x9423=['../../config/environment','jayson/promise','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','map','include','model','catch','ShowServicenowAccount','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x33d0f1,_0x2fc8b3){var _0x2b7902=function(_0xaa4e6){while(--_0xaa4e6){_0x33d0f1['push'](_0x33d0f1['shift']());}};_0x2b7902(++_0x2fc8b3);}(_0x9423,0x1e3));var _0x3942=function(_0x1f3ac6,_0x52d7d0){_0x1f3ac6=_0x1f3ac6-0x0;var _0x5e7682=_0x9423[_0x1f3ac6];return _0x5e7682;};'use strict';var _=require(_0x3942('0x0'));var util=require('util');var moment=require(_0x3942('0x1'));var BPromise=require(_0x3942('0x2'));var rs=require(_0x3942('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3942('0x4'));var logger=require(_0x3942('0x5'))(_0x3942('0x6'));var config=require(_0x3942('0x7'));var jayson=require(_0x3942('0x8'));var client=jayson['client'][_0x3942('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bd419,_0x85621c,_0xeaeba2){return new BPromise(function(_0x4761c7,_0x3eff78){return client[_0x3942('0xa')](_0x1bd419,_0xeaeba2)[_0x3942('0xb')](function(_0x3140e8){logger[_0x3942('0xc')](_0x3942('0xd'),_0x85621c,_0x3942('0xe'));logger[_0x3942('0xf')](_0x3942('0x10'),_0x85621c,'request\x20sent',JSON[_0x3942('0x11')](_0x3140e8));if(_0x3140e8[_0x3942('0x12')]){if(_0x3140e8[_0x3942('0x12')][_0x3942('0x13')]===0x1f4){logger[_0x3942('0x12')](_0x3942('0xd'),_0x85621c,_0x3140e8[_0x3942('0x12')][_0x3942('0x14')]);return _0x3eff78(_0x3140e8[_0x3942('0x12')][_0x3942('0x14')]);}logger[_0x3942('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x85621c,_0x3140e8[_0x3942('0x12')][_0x3942('0x14')]);return _0x4761c7(_0x3140e8['error'][_0x3942('0x14')]);}else{logger['info'](_0x3942('0xd'),_0x85621c,_0x3942('0xe'));_0x4761c7(_0x3140e8[_0x3942('0x15')]['message']);}})['catch'](function(_0x230803){logger['error'](_0x3942('0xd'),_0x85621c,_0x230803);_0x3eff78(_0x230803);});});}exports[_0x3942('0x16')]=function(_0x360265){var _0xe0ce4=this;return new Promise(function(_0x5d1c4e,_0xbab208){return db[_0x3942('0x17')][_0x3942('0x18')]({'raw':_0x360265[_0x3942('0x19')]?_0x360265[_0x3942('0x19')][_0x3942('0x1a')]===undefined?!![]:![]:!![],'where':_0x360265[_0x3942('0x19')]?_0x360265[_0x3942('0x19')][_0x3942('0x1b')]||null:null,'attributes':_0x360265[_0x3942('0x19')]?_0x360265['options'][_0x3942('0x1c')]||null:null,'limit':_0x360265[_0x3942('0x19')]?_0x360265['options'][_0x3942('0x1d')]||null:null,'include':_0x360265[_0x3942('0x19')]?_0x360265[_0x3942('0x19')]['include']?_[_0x3942('0x1e')](_0x360265[_0x3942('0x19')][_0x3942('0x1f')],function(_0x4c70b8){return{'model':db[_0x4c70b8[_0x3942('0x20')]],'as':_0x4c70b8['as'],'attributes':_0x4c70b8[_0x3942('0x1c')],'include':_0x4c70b8[_0x3942('0x1f')]?_[_0x3942('0x1e')](_0x4c70b8[_0x3942('0x1f')],function(_0x539844){return{'model':db[_0x539844[_0x3942('0x20')]],'as':_0x539844['as'],'attributes':_0x539844['attributes'],'include':_0x539844[_0x3942('0x1f')]?_['map'](_0x539844[_0x3942('0x1f')],function(_0x3c3013){return{'model':db[_0x3c3013['model']],'as':_0x3c3013['as'],'attributes':_0x3c3013[_0x3942('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3942('0xb')](function(_0x2c2d2a){logger[_0x3942('0xc')](_0x3942('0x16'),_0x360265);logger['debug'](_0x3942('0x16'),_0x360265,JSON[_0x3942('0x11')](_0x2c2d2a));_0x5d1c4e(_0x2c2d2a);})[_0x3942('0x21')](function(_0xc7c636){logger['error']('GetServicenowAccount',_0xc7c636[_0x3942('0x14')],_0x360265);_0xbab208(_0xe0ce4[_0x3942('0x12')](0x1f4,_0xc7c636['message']));});});};exports[_0x3942('0x22')]=function(_0x376a42){var _0x2eaa46=this;return new Promise(function(_0x28655c,_0x30f72d){return db[_0x3942('0x17')]['find']({'raw':_0x376a42[_0x3942('0x19')]?_0x376a42[_0x3942('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x376a42[_0x3942('0x19')]?_0x376a42[_0x3942('0x19')][_0x3942('0x1b')]||null:null,'attributes':_0x376a42[_0x3942('0x19')]?_0x376a42[_0x3942('0x19')][_0x3942('0x1c')]||null:null,'include':_0x376a42[_0x3942('0x19')]?_0x376a42[_0x3942('0x19')]['include']?_[_0x3942('0x1e')](_0x376a42[_0x3942('0x19')][_0x3942('0x1f')],function(_0x1305b9){return{'model':db[_0x1305b9[_0x3942('0x20')]],'as':_0x1305b9['as'],'attributes':_0x1305b9[_0x3942('0x1c')],'include':_0x1305b9['include']?_[_0x3942('0x1e')](_0x1305b9['include'],function(_0x35b3d8){return{'model':db[_0x35b3d8[_0x3942('0x20')]],'as':_0x35b3d8['as'],'attributes':_0x35b3d8[_0x3942('0x1c')],'include':_0x35b3d8['include']?_[_0x3942('0x1e')](_0x35b3d8[_0x3942('0x1f')],function(_0x1c0da0){return{'model':db[_0x1c0da0[_0x3942('0x20')]],'as':_0x1c0da0['as'],'attributes':_0x1c0da0[_0x3942('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3942('0xb')](function(_0x283a01){logger[_0x3942('0xc')]('ShowServicenowAccount',_0x376a42);logger[_0x3942('0xf')](_0x3942('0x22'),_0x376a42,JSON['stringify'](_0x283a01));_0x28655c(_0x283a01);})[_0x3942('0x21')](function(_0x5bb9a0){logger[_0x3942('0x12')]('ShowServicenowAccount',_0x5bb9a0['message'],_0x376a42);_0x30f72d(_0x2eaa46['error'](0x1f4,_0x5bb9a0[_0x3942('0x14')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index b92392b..6e86c6a 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 _0xf7b5=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','index','/:id','isAuthenticated','show'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xf7b5,0x88));var _0x5f7b=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xf7b5[_0x21549c];return _0x426cbd;};'use strict';var multer=require('multer');var util=require(_0x5f7b('0x0'));var path=require(_0x5f7b('0x1'));var timeout=require(_0x5f7b('0x2'));var express=require(_0x5f7b('0x3'));var router=express['Router']();var fs_extra=require(_0x5f7b('0x4'));var auth=require(_0x5f7b('0x5'));var interaction=require(_0x5f7b('0x6'));var config=require(_0x5f7b('0x7'));var controller=require(_0x5f7b('0x8'));router[_0x5f7b('0x9')]('/',auth['isAuthenticated'](),controller[_0x5f7b('0xa')]);router[_0x5f7b('0x9')](_0x5f7b('0xb'),auth[_0x5f7b('0xc')](),controller[_0x5f7b('0xd')]);router[_0x5f7b('0x9')](_0x5f7b('0xe'),auth[_0x5f7b('0xc')](),controller[_0x5f7b('0xf')]);router[_0x5f7b('0x9')](_0x5f7b('0x10'),auth[_0x5f7b('0xc')](),controller[_0x5f7b('0x11')]);router[_0x5f7b('0x9')](_0x5f7b('0x12'),auth[_0x5f7b('0xc')](),controller['getDescriptions']);router[_0x5f7b('0x13')]('/',auth[_0x5f7b('0xc')](),controller[_0x5f7b('0x14')]);router[_0x5f7b('0x15')]('/:id',auth[_0x5f7b('0xc')](),controller[_0x5f7b('0x16')]);router[_0x5f7b('0x17')](_0x5f7b('0xb'),auth[_0x5f7b('0xc')](),controller[_0x5f7b('0x18')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 6889fc7..feaed48 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 _0x9db6=['STRING','exports'];(function(_0x3cca7a,_0x109a23){var _0x34e717=function(_0x19a41f){while(--_0x19a41f){_0x3cca7a['push'](_0x3cca7a['shift']());}};_0x34e717(++_0x109a23);}(_0x9db6,0x9b));var _0x69db=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x9db6[_0x474d97];return _0x1edf25;};'use strict';var Sequelize=require('sequelize');module[_0x69db('0x0')]={'name':{'type':Sequelize[_0x69db('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index b16d86d..f8197a6 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 _0x37fc=['../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','then','error','stack','name','map','rawAttributes','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','ServicenowConfiguration','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','getFields','ServicenowField','hasOwnProperty','nolimit','getSubjects','getDescriptions','findOne','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util'];(function(_0x3cfe76,_0x1d9d61){var _0x1f6f12=function(_0x1f2148){while(--_0x1f2148){_0x3cfe76['push'](_0x3cfe76['shift']());}};_0x1f6f12(++_0x1d9d61);}(_0x37fc,0x86));var _0xc37f=function(_0x1dc08f,_0x3d82c9){_0x1dc08f=_0x1dc08f-0x0;var _0x2080aa=_0x37fc[_0x1dc08f];return _0x2080aa;};'use strict';var emlformat=require(_0xc37f('0x0'));var rimraf=require(_0xc37f('0x1'));var zipdir=require(_0xc37f('0x2'));var jsonpatch=require(_0xc37f('0x3'));var rp=require(_0xc37f('0x4'));var moment=require(_0xc37f('0x5'));var BPromise=require(_0xc37f('0x6'));var Mustache=require('mustache');var util=require(_0xc37f('0x7'));var path=require(_0xc37f('0x8'));var sox=require(_0xc37f('0x9'));var csv=require(_0xc37f('0xa'));var ejs=require(_0xc37f('0xb'));var fs=require('fs');var fs_extra=require(_0xc37f('0xc'));var _=require(_0xc37f('0xd'));var squel=require(_0xc37f('0xe'));var crypto=require(_0xc37f('0xf'));var jsforce=require(_0xc37f('0x10'));var deskjs=require(_0xc37f('0x11'));var toCsv=require(_0xc37f('0xa'));var querystring=require('querystring');var Papa=require(_0xc37f('0x12'));var Redis=require(_0xc37f('0x13'));var authService=require(_0xc37f('0x14'));var qs=require(_0xc37f('0x15'));var as=require(_0xc37f('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc37f('0x17'))('api');var utils=require(_0xc37f('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc37f('0x19'));var db=require(_0xc37f('0x1a'))['db'];function respondWithStatusCode(_0x296673,_0x255b29){_0x255b29=_0x255b29||0xcc;return function(_0x324838){if(_0x324838){return _0x296673['sendStatus'](_0x255b29);}return _0x296673[_0xc37f('0x1b')](_0x255b29)[_0xc37f('0x1c')]();};}function respondWithResult(_0x4f5b9d,_0x348f27){_0x348f27=_0x348f27||0xc8;return function(_0x427005){if(_0x427005){return _0x4f5b9d[_0xc37f('0x1b')](_0x348f27)[_0xc37f('0x1d')](_0x427005);}};}function respondWithFilteredResult(_0x4e150c,_0x32a465){return function(_0x3ca121){if(_0x3ca121){var _0x1b13a2=typeof _0x32a465['offset']===_0xc37f('0x1e')&&typeof _0x32a465[_0xc37f('0x1f')]==='undefined';var _0x53ca1e=_0x3ca121[_0xc37f('0x20')];var _0x38c19e=_0x1b13a2?0x0:_0x32a465['offset'];var _0x2b37f5=_0x1b13a2?_0x3ca121['count']:_0x32a465[_0xc37f('0x21')]+_0x32a465[_0xc37f('0x1f')];var _0x1176e3;if(_0x2b37f5>=_0x53ca1e){_0x2b37f5=_0x53ca1e;_0x1176e3=0xc8;}else{_0x1176e3=0xce;}_0x4e150c[_0xc37f('0x1b')](_0x1176e3);return _0x4e150c[_0xc37f('0x22')](_0xc37f('0x23'),_0x38c19e+'-'+_0x2b37f5+'/'+_0x53ca1e)['json'](_0x3ca121);}return null;};}function patchUpdates(_0x48db05){return function(_0x9f3906){try{jsonpatch['apply'](_0x9f3906,_0x48db05,!![]);}catch(_0x3ac9bb){return BPromise['reject'](_0x3ac9bb);}return _0x9f3906[_0xc37f('0x24')]();};}function saveUpdates(_0x16ba7a,_0x42f476){return function(_0x4208e5){if(_0x4208e5){return _0x4208e5[_0xc37f('0x25')](_0x16ba7a)[_0xc37f('0x26')](function(_0x6a145a){return _0x6a145a;});}return null;};}function removeEntity(_0x408f2e,_0x2facee){return function(_0x1e02e1){if(_0x1e02e1){return _0x1e02e1['destroy']()['then'](function(){_0x408f2e['status'](0xcc)[_0xc37f('0x1c')]();});}};}function handleEntityNotFound(_0x377ff6,_0x335da5){return function(_0x75d64b){if(!_0x75d64b){_0x377ff6['sendStatus'](0x194);}return _0x75d64b;};}function handleError(_0x5a2867,_0x219f1c){_0x219f1c=_0x219f1c||0x1f4;return function(_0x1bb0bb){logger[_0xc37f('0x27')](_0x1bb0bb[_0xc37f('0x28')]);if(_0x1bb0bb['name']){delete _0x1bb0bb[_0xc37f('0x29')];}_0x5a2867[_0xc37f('0x1b')](_0x219f1c)['send'](_0x1bb0bb);};}exports['index']=function(_0x397e76,_0x1e6eaf){var _0x88b5d4={},_0x231022={},_0x18bfdb={'count':0x0,'rows':[]};var _0x24cd11=_[_0xc37f('0x2a')](db['ServicenowConfiguration'][_0xc37f('0x2b')],function(_0x1343f7){return{'name':_0x1343f7['fieldName'],'type':_0x1343f7['type']['key']};});_0x231022[_0xc37f('0x2c')]=_[_0xc37f('0x2a')](_0x24cd11,_0xc37f('0x29'));_0x231022[_0xc37f('0x2d')]=_[_0xc37f('0x2e')](_0x397e76[_0xc37f('0x2d')]);_0x231022['filters']=_[_0xc37f('0x2f')](_0x231022[_0xc37f('0x2c')],_0x231022[_0xc37f('0x2d')]);_0x88b5d4[_0xc37f('0x30')]=_[_0xc37f('0x2f')](_0x231022[_0xc37f('0x2c')],qs[_0xc37f('0x31')](_0x397e76[_0xc37f('0x2d')][_0xc37f('0x31')]));_0x88b5d4[_0xc37f('0x30')]=_0x88b5d4[_0xc37f('0x30')][_0xc37f('0x32')]?_0x88b5d4[_0xc37f('0x30')]:_0x231022['model'];if(!_0x397e76[_0xc37f('0x2d')]['hasOwnProperty']('nolimit')){_0x88b5d4['limit']=qs['limit'](_0x397e76[_0xc37f('0x2d')][_0xc37f('0x1f')]);_0x88b5d4[_0xc37f('0x21')]=qs[_0xc37f('0x21')](_0x397e76[_0xc37f('0x2d')][_0xc37f('0x21')]);}_0x88b5d4[_0xc37f('0x33')]=qs[_0xc37f('0x34')](_0x397e76[_0xc37f('0x2d')][_0xc37f('0x34')]);_0x88b5d4[_0xc37f('0x35')]=qs[_0xc37f('0x36')](_[_0xc37f('0x37')](_0x397e76[_0xc37f('0x2d')],_0x231022[_0xc37f('0x36')]),_0x24cd11);if(_0x397e76[_0xc37f('0x2d')][_0xc37f('0x38')]){_0x88b5d4[_0xc37f('0x35')]=_[_0xc37f('0x39')](_0x88b5d4[_0xc37f('0x35')],{'$or':_[_0xc37f('0x2a')](_0x24cd11,function(_0x4fd100){if(_0x4fd100[_0xc37f('0x3a')]!==_0xc37f('0x3b')){var _0x4c85b0={};_0x4c85b0[_0x4fd100[_0xc37f('0x29')]]={'$like':'%'+_0x397e76['query'][_0xc37f('0x38')]+'%'};return _0x4c85b0;}})});}_0x88b5d4=_[_0xc37f('0x39')]({},_0x88b5d4,_0x397e76[_0xc37f('0x3c')]);var _0x281260={'where':_0x88b5d4[_0xc37f('0x35')]};return db[_0xc37f('0x3d')][_0xc37f('0x20')](_0x281260)[_0xc37f('0x26')](function(_0xe1a47e){_0x18bfdb[_0xc37f('0x20')]=_0xe1a47e;if(_0x397e76[_0xc37f('0x2d')]['includeAll']){_0x88b5d4[_0xc37f('0x3e')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xc37f('0x3f')](_0x88b5d4);})['then'](function(_0x4ad908){_0x18bfdb[_0xc37f('0x40')]=_0x4ad908;return _0x18bfdb;})[_0xc37f('0x26')](respondWithFilteredResult(_0x1e6eaf,_0x88b5d4))[_0xc37f('0x41')](handleError(_0x1e6eaf,null));};exports[_0xc37f('0x42')]=function(_0x4683bd,_0x3f251b){var _0x253851={'raw':![],'where':{'id':_0x4683bd[_0xc37f('0x43')]['id']}},_0x41a933={};_0x41a933[_0xc37f('0x2c')]=_['keys'](db[_0xc37f('0x3d')]['rawAttributes']);_0x41a933['query']=_[_0xc37f('0x2e')](_0x4683bd['query']);_0x41a933[_0xc37f('0x36')]=_['intersection'](_0x41a933['model'],_0x41a933['query']);_0x253851[_0xc37f('0x30')]=_[_0xc37f('0x2f')](_0x41a933[_0xc37f('0x2c')],qs[_0xc37f('0x31')](_0x4683bd[_0xc37f('0x2d')][_0xc37f('0x31')]));_0x253851[_0xc37f('0x30')]=_0x253851['attributes'][_0xc37f('0x32')]?_0x253851[_0xc37f('0x30')]:_0x41a933[_0xc37f('0x2c')];if(_0x4683bd[_0xc37f('0x2d')][_0xc37f('0x44')]){_0x253851[_0xc37f('0x3e')]=[{'all':!![]}];}_0x253851=_[_0xc37f('0x39')]({},_0x253851,_0x4683bd[_0xc37f('0x3c')]);return db[_0xc37f('0x3d')][_0xc37f('0x45')](_0x253851)[_0xc37f('0x26')](handleEntityNotFound(_0x3f251b,null))[_0xc37f('0x26')](respondWithResult(_0x3f251b,null))[_0xc37f('0x41')](handleError(_0x3f251b,null));};exports[_0xc37f('0x46')]=function(_0x1870bd,_0x2f6602){return db[_0xc37f('0x3d')][_0xc37f('0x46')](_0x1870bd['body'],{})[_0xc37f('0x26')](respondWithResult(_0x2f6602,0xc9))['catch'](handleError(_0x2f6602,null));};exports[_0xc37f('0x25')]=function(_0x4de781,_0x17b774){if(_0x4de781[_0xc37f('0x47')]['id']){delete _0x4de781[_0xc37f('0x47')]['id'];}return db[_0xc37f('0x3d')][_0xc37f('0x45')]({'where':{'id':_0x4de781[_0xc37f('0x43')]['id']}})[_0xc37f('0x26')](handleEntityNotFound(_0x17b774,null))[_0xc37f('0x26')](saveUpdates(_0x4de781[_0xc37f('0x47')],null))[_0xc37f('0x26')](respondWithResult(_0x17b774,null))[_0xc37f('0x41')](handleError(_0x17b774,null));};exports[_0xc37f('0x48')]=function(_0x1b3530,_0x4886ce){return db['ServicenowConfiguration'][_0xc37f('0x45')]({'where':{'id':_0x1b3530['params']['id']}})['then'](handleEntityNotFound(_0x4886ce,null))['then'](removeEntity(_0x4886ce,null))['catch'](handleError(_0x4886ce,null));};exports[_0xc37f('0x49')]=function(_0x64e24d,_0x220838,_0x32204e){var _0x4d357d={};var _0x3de24a={};var _0x1d7ad1;var _0x53fd86;return db[_0xc37f('0x3d')]['findOne']({'where':{'id':_0x64e24d[_0xc37f('0x43')]['id']}})['then'](handleEntityNotFound(_0x220838,null))[_0xc37f('0x26')](function(_0x497104){if(_0x497104){_0x1d7ad1=_0x497104;_0x3de24a[_0xc37f('0x2c')]=_[_0xc37f('0x2e')](db[_0xc37f('0x4a')][_0xc37f('0x2b')]);_0x3de24a[_0xc37f('0x2d')]=_[_0xc37f('0x2e')](_0x64e24d[_0xc37f('0x2d')]);_0x3de24a['filters']=_['intersection'](_0x3de24a['model'],_0x3de24a['query']);_0x4d357d[_0xc37f('0x30')]=_['intersection'](_0x3de24a['model'],qs['fields'](_0x64e24d[_0xc37f('0x2d')][_0xc37f('0x31')]));_0x4d357d[_0xc37f('0x30')]=_0x4d357d[_0xc37f('0x30')][_0xc37f('0x32')]?_0x4d357d[_0xc37f('0x30')]:_0x3de24a[_0xc37f('0x2c')];_0x4d357d[_0xc37f('0x33')]=qs['sort'](_0x64e24d['query']['sort']);_0x4d357d[_0xc37f('0x35')]=qs[_0xc37f('0x36')](_[_0xc37f('0x37')](_0x64e24d[_0xc37f('0x2d')],_0x3de24a[_0xc37f('0x36')]));if(_0x64e24d['query'][_0xc37f('0x38')]){_0x4d357d[_0xc37f('0x35')]=_[_0xc37f('0x39')](_0x4d357d[_0xc37f('0x35')],{'$or':_[_0xc37f('0x2a')](_0x4d357d[_0xc37f('0x30')],function(_0x548dca){var _0x30c32={};_0x30c32[_0x548dca]={'$like':'%'+_0x64e24d[_0xc37f('0x2d')]['filter']+'%'};return _0x30c32;})});}_0x4d357d=_[_0xc37f('0x39')]({},_0x4d357d,_0x64e24d[_0xc37f('0x3c')]);return _0x1d7ad1[_0xc37f('0x49')](_0x4d357d);}})[_0xc37f('0x26')](function(_0x48b626){if(_0x48b626){_0x53fd86=_0x48b626[_0xc37f('0x32')];if(!_0x64e24d[_0xc37f('0x2d')][_0xc37f('0x4b')](_0xc37f('0x4c'))){_0x4d357d[_0xc37f('0x1f')]=qs[_0xc37f('0x1f')](_0x64e24d['query']['limit']);_0x4d357d[_0xc37f('0x21')]=qs[_0xc37f('0x21')](_0x64e24d[_0xc37f('0x2d')][_0xc37f('0x21')]);}return _0x1d7ad1[_0xc37f('0x49')](_0x4d357d);}})[_0xc37f('0x26')](function(_0x98a2ee){if(_0x98a2ee){return _0x98a2ee?{'count':_0x53fd86,'rows':_0x98a2ee}:null;}})['then'](respondWithResult(_0x220838,null))[_0xc37f('0x41')](handleError(_0x220838,null));};exports['getSubjects']=function(_0x4009fa,_0x4907a0,_0x5cfdfb){var _0x33dd9a={};var _0xa912d7={};var _0x353abc;var _0x1d3706;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x4009fa[_0xc37f('0x43')]['id']}})[_0xc37f('0x26')](handleEntityNotFound(_0x4907a0,null))[_0xc37f('0x26')](function(_0x33be2a){if(_0x33be2a){_0x353abc=_0x33be2a;_0xa912d7[_0xc37f('0x2c')]=_[_0xc37f('0x2e')](db['ServicenowField'][_0xc37f('0x2b')]);_0xa912d7[_0xc37f('0x2d')]=_[_0xc37f('0x2e')](_0x4009fa['query']);_0xa912d7[_0xc37f('0x36')]=_[_0xc37f('0x2f')](_0xa912d7[_0xc37f('0x2c')],_0xa912d7[_0xc37f('0x2d')]);_0x33dd9a[_0xc37f('0x30')]=_[_0xc37f('0x2f')](_0xa912d7[_0xc37f('0x2c')],qs[_0xc37f('0x31')](_0x4009fa['query'][_0xc37f('0x31')]));_0x33dd9a[_0xc37f('0x30')]=_0x33dd9a['attributes'][_0xc37f('0x32')]?_0x33dd9a[_0xc37f('0x30')]:_0xa912d7[_0xc37f('0x2c')];_0x33dd9a['order']=qs['sort'](_0x4009fa[_0xc37f('0x2d')]['sort']);_0x33dd9a[_0xc37f('0x35')]=qs[_0xc37f('0x36')](_['pick'](_0x4009fa[_0xc37f('0x2d')],_0xa912d7['filters']));if(_0x4009fa[_0xc37f('0x2d')][_0xc37f('0x38')]){_0x33dd9a[_0xc37f('0x35')]=_[_0xc37f('0x39')](_0x33dd9a[_0xc37f('0x35')],{'$or':_['map'](_0x33dd9a[_0xc37f('0x30')],function(_0x35bfdd){var _0x45c913={};_0x45c913[_0x35bfdd]={'$like':'%'+_0x4009fa[_0xc37f('0x2d')][_0xc37f('0x38')]+'%'};return _0x45c913;})});}_0x33dd9a=_[_0xc37f('0x39')]({},_0x33dd9a,_0x4009fa[_0xc37f('0x3c')]);return _0x353abc[_0xc37f('0x4d')](_0x33dd9a);}})[_0xc37f('0x26')](function(_0x4b0c6a){if(_0x4b0c6a){_0x1d3706=_0x4b0c6a[_0xc37f('0x32')];if(!_0x4009fa[_0xc37f('0x2d')][_0xc37f('0x4b')]('nolimit')){_0x33dd9a[_0xc37f('0x1f')]=qs[_0xc37f('0x1f')](_0x4009fa['query'][_0xc37f('0x1f')]);_0x33dd9a[_0xc37f('0x21')]=qs[_0xc37f('0x21')](_0x4009fa[_0xc37f('0x2d')]['offset']);}return _0x353abc[_0xc37f('0x4d')](_0x33dd9a);}})['then'](function(_0x4343d1){if(_0x4343d1){return _0x4343d1?{'count':_0x1d3706,'rows':_0x4343d1}:null;}})[_0xc37f('0x26')](respondWithResult(_0x4907a0,null))[_0xc37f('0x41')](handleError(_0x4907a0,null));};exports[_0xc37f('0x4e')]=function(_0x1a7688,_0x318720,_0x5b0af0){var _0x19cc91={};var _0x46a75f={};var _0x4aa5e5;var _0xb2761a;return db[_0xc37f('0x3d')][_0xc37f('0x4f')]({'where':{'id':_0x1a7688[_0xc37f('0x43')]['id']}})[_0xc37f('0x26')](handleEntityNotFound(_0x318720,null))['then'](function(_0x40107d){if(_0x40107d){_0x4aa5e5=_0x40107d;_0x46a75f[_0xc37f('0x2c')]=_[_0xc37f('0x2e')](db[_0xc37f('0x4a')][_0xc37f('0x2b')]);_0x46a75f[_0xc37f('0x2d')]=_[_0xc37f('0x2e')](_0x1a7688[_0xc37f('0x2d')]);_0x46a75f['filters']=_[_0xc37f('0x2f')](_0x46a75f[_0xc37f('0x2c')],_0x46a75f[_0xc37f('0x2d')]);_0x19cc91[_0xc37f('0x30')]=_[_0xc37f('0x2f')](_0x46a75f[_0xc37f('0x2c')],qs[_0xc37f('0x31')](_0x1a7688[_0xc37f('0x2d')][_0xc37f('0x31')]));_0x19cc91[_0xc37f('0x30')]=_0x19cc91[_0xc37f('0x30')][_0xc37f('0x32')]?_0x19cc91[_0xc37f('0x30')]:_0x46a75f[_0xc37f('0x2c')];_0x19cc91[_0xc37f('0x33')]=qs[_0xc37f('0x34')](_0x1a7688[_0xc37f('0x2d')]['sort']);_0x19cc91['where']=qs[_0xc37f('0x36')](_[_0xc37f('0x37')](_0x1a7688[_0xc37f('0x2d')],_0x46a75f['filters']));if(_0x1a7688['query'][_0xc37f('0x38')]){_0x19cc91[_0xc37f('0x35')]=_[_0xc37f('0x39')](_0x19cc91[_0xc37f('0x35')],{'$or':_[_0xc37f('0x2a')](_0x19cc91['attributes'],function(_0x48fa70){var _0x108b67={};_0x108b67[_0x48fa70]={'$like':'%'+_0x1a7688[_0xc37f('0x2d')][_0xc37f('0x38')]+'%'};return _0x108b67;})});}_0x19cc91=_[_0xc37f('0x39')]({},_0x19cc91,_0x1a7688['options']);return _0x4aa5e5['getDescriptions'](_0x19cc91);}})[_0xc37f('0x26')](function(_0x187377){if(_0x187377){_0xb2761a=_0x187377[_0xc37f('0x32')];if(!_0x1a7688[_0xc37f('0x2d')][_0xc37f('0x4b')]('nolimit')){_0x19cc91[_0xc37f('0x1f')]=qs[_0xc37f('0x1f')](_0x1a7688[_0xc37f('0x2d')][_0xc37f('0x1f')]);_0x19cc91['offset']=qs['offset'](_0x1a7688[_0xc37f('0x2d')][_0xc37f('0x21')]);}return _0x4aa5e5[_0xc37f('0x4e')](_0x19cc91);}})['then'](function(_0x12cc59){if(_0x12cc59){return _0x12cc59?{'count':_0xb2761a,'rows':_0x12cc59}:null;}})['then'](respondWithResult(_0x318720,null))[_0xc37f('0x41')](handleError(_0x318720,null));}; \ No newline at end of file +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 diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index db1fcfc..6ee5e32 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 _0x6e6c=['moment','path','../../config/environment','exports','define','ServicenowConfiguration','lodash','util','api'];(function(_0x457b80,_0x4ca30a){var _0x47c154=function(_0x3495ae){while(--_0x3495ae){_0x457b80['push'](_0x457b80['shift']());}};_0x47c154(++_0x4ca30a);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6e6c[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xc6e6('0x0'));var util=require(_0xc6e6('0x1'));var logger=require('../../config/logger')(_0xc6e6('0x2'));var moment=require(_0xc6e6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc6e6('0x4'));var rimraf=require('rimraf');var config=require(_0xc6e6('0x5'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xc6e6('0x6')]=function(_0x1182c7,_0x4bf906){return _0x1182c7[_0xc6e6('0x7')](_0xc6e6('0x8'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index a99ad40..6d5f4c1 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 _0x019b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x5c9266,_0x3736c3){var _0x39d3ef=function(_0x439ccf){while(--_0x439ccf){_0x5c9266['push'](_0x5c9266['shift']());}};_0x39d3ef(++_0x3736c3);}(_0x019b,0xa6));var _0xb019=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x019b[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xb019('0x0'));var util=require(_0xb019('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb019('0x2'));var db=require(_0xb019('0x3'))['db'];var utils=require(_0xb019('0x4'));var logger=require(_0xb019('0x5'))(_0xb019('0x6'));var config=require(_0xb019('0x7'));var jayson=require(_0xb019('0x8'));var client=jayson[_0xb019('0x9')][_0xb019('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x150b05,_0x2a9cea,_0x396c31){return new BPromise(function(_0xbdd372,_0x4531ee){return client[_0xb019('0xb')](_0x150b05,_0x396c31)[_0xb019('0xc')](function(_0xf4329a){logger[_0xb019('0xd')](_0xb019('0xe'),_0x2a9cea,_0xb019('0xf'));logger[_0xb019('0x10')](_0xb019('0x11'),_0x2a9cea,_0xb019('0xf'),JSON[_0xb019('0x12')](_0xf4329a));if(_0xf4329a[_0xb019('0x13')]){if(_0xf4329a['error'][_0xb019('0x14')]===0x1f4){logger['error'](_0xb019('0xe'),_0x2a9cea,_0xf4329a['error'][_0xb019('0x15')]);return _0x4531ee(_0xf4329a[_0xb019('0x13')][_0xb019('0x15')]);}logger[_0xb019('0x13')](_0xb019('0xe'),_0x2a9cea,_0xf4329a[_0xb019('0x13')][_0xb019('0x15')]);return _0xbdd372(_0xf4329a['error'][_0xb019('0x15')]);}else{logger[_0xb019('0xd')](_0xb019('0xe'),_0x2a9cea,_0xb019('0xf'));_0xbdd372(_0xf4329a[_0xb019('0x16')][_0xb019('0x15')]);}})[_0xb019('0x17')](function(_0x2b8dcf){logger[_0xb019('0x13')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2a9cea,_0x2b8dcf);_0x4531ee(_0x2b8dcf);});});} \ No newline at end of file +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 diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index c4c218b..3f2e423 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 _0xc850=['isAuthenticated','/:id','post','create','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc850,0x98));var _0x0c85=function(_0x3ff3fe,_0x22b6ba){_0x3ff3fe=_0x3ff3fe-0x0;var _0x46186b=_0xc850[_0x3ff3fe];return _0x46186b;};'use strict';var multer=require('multer');var util=require(_0x0c85('0x0'));var path=require(_0x0c85('0x1'));var timeout=require(_0x0c85('0x2'));var express=require('express');var router=express[_0x0c85('0x3')]();var fs_extra=require(_0x0c85('0x4'));var auth=require(_0x0c85('0x5'));var interaction=require(_0x0c85('0x6'));var config=require(_0x0c85('0x7'));var controller=require(_0x0c85('0x8'));router[_0x0c85('0x9')]('/',auth[_0x0c85('0xa')](),controller['index']);router[_0x0c85('0x9')](_0x0c85('0xb'),auth[_0x0c85('0xa')](),controller['show']);router[_0x0c85('0xc')]('/',auth[_0x0c85('0xa')](),controller[_0x0c85('0xd')]);router['put'](_0x0c85('0xb'),auth[_0x0c85('0xa')](),controller[_0x0c85('0xe')]);router[_0x0c85('0xf')](_0x0c85('0xb'),auth[_0x0c85('0xa')](),controller[_0x0c85('0x10')]);module[_0x0c85('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 4ac1529..51fe6b4 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 _0x4090=['customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x2480bf,_0x4397ba){var _0x5a339c=function(_0x404930){while(--_0x404930){_0x2480bf['push'](_0x2480bf['shift']());}};_0x5a339c(++_0x4397ba);}(_0x4090,0x1b4));var _0x0409=function(_0x4bad8e,_0x400acd){_0x4bad8e=_0x4bad8e-0x0;var _0x53d87e=_0x4090[_0x4bad8e];return _0x53d87e;};'use strict';var Sequelize=require(_0x0409('0x0'));module[_0x0409('0x1')]={'type':{'type':Sequelize['ENUM'](_0x0409('0x2'),_0x0409('0x3'),_0x0409('0x4'),_0x0409('0x5'),_0x0409('0x6')),'defaultValue':_0x0409('0x2')},'content':{'type':Sequelize[_0x0409('0x7')]},'key':{'type':Sequelize[_0x0409('0x7')]},'keyType':{'type':Sequelize[_0x0409('0x8')](_0x0409('0x2'),_0x0409('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0409('0x7')]},'idField':{'type':Sequelize[_0x0409('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x0409('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0409('0x7')]}}; \ No newline at end of file +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 diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 77e5adb..d050423 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 _0x91a2=['options','find','create','body','params','destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','stack','name','index','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','catch','show'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x91a2,0x9a));var _0x291a=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0x91a2[_0x1f8053];return _0x174fd8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x291a('0x0'));var zipdir=require(_0x291a('0x1'));var jsonpatch=require(_0x291a('0x2'));var rp=require('request-promise');var moment=require(_0x291a('0x3'));var BPromise=require(_0x291a('0x4'));var Mustache=require(_0x291a('0x5'));var util=require(_0x291a('0x6'));var path=require(_0x291a('0x7'));var sox=require('sox');var csv=require(_0x291a('0x8'));var ejs=require(_0x291a('0x9'));var fs=require('fs');var fs_extra=require(_0x291a('0xa'));var _=require(_0x291a('0xb'));var squel=require(_0x291a('0xc'));var crypto=require(_0x291a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x291a('0xe'));var toCsv=require(_0x291a('0x8'));var querystring=require(_0x291a('0xf'));var Papa=require(_0x291a('0x10'));var Redis=require('ioredis');var authService=require(_0x291a('0x11'));var qs=require(_0x291a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x291a('0x13'));var logger=require(_0x291a('0x14'))(_0x291a('0x15'));var utils=require(_0x291a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x291a('0x17'));var db=require(_0x291a('0x18'))['db'];function respondWithStatusCode(_0x663782,_0x32774d){_0x32774d=_0x32774d||0xcc;return function(_0x2fa26a){if(_0x2fa26a){return _0x663782[_0x291a('0x19')](_0x32774d);}return _0x663782[_0x291a('0x1a')](_0x32774d)[_0x291a('0x1b')]();};}function respondWithResult(_0x2e11c4,_0x51e843){_0x51e843=_0x51e843||0xc8;return function(_0x27eddf){if(_0x27eddf){return _0x2e11c4[_0x291a('0x1a')](_0x51e843)[_0x291a('0x1c')](_0x27eddf);}};}function respondWithFilteredResult(_0x2341cc,_0xc8b4bb){return function(_0xb84f42){if(_0xb84f42){var _0x1ed3ee=typeof _0xc8b4bb[_0x291a('0x1d')]===_0x291a('0x1e')&&typeof _0xc8b4bb[_0x291a('0x1f')]===_0x291a('0x1e');var _0x531af2=_0xb84f42[_0x291a('0x20')];var _0x325bab=_0x1ed3ee?0x0:_0xc8b4bb[_0x291a('0x1d')];var _0x34f474=_0x1ed3ee?_0xb84f42[_0x291a('0x20')]:_0xc8b4bb['offset']+_0xc8b4bb[_0x291a('0x1f')];var _0x3b8d15;if(_0x34f474>=_0x531af2){_0x34f474=_0x531af2;_0x3b8d15=0xc8;}else{_0x3b8d15=0xce;}_0x2341cc['status'](_0x3b8d15);return _0x2341cc['set'](_0x291a('0x21'),_0x325bab+'-'+_0x34f474+'/'+_0x531af2)['json'](_0xb84f42);}return null;};}function patchUpdates(_0x112de3){return function(_0x31f6ae){try{jsonpatch[_0x291a('0x22')](_0x31f6ae,_0x112de3,!![]);}catch(_0x98c624){return BPromise[_0x291a('0x23')](_0x98c624);}return _0x31f6ae['save']();};}function saveUpdates(_0x2d8e43,_0x40457d){return function(_0x173b03){if(_0x173b03){return _0x173b03[_0x291a('0x24')](_0x2d8e43)[_0x291a('0x25')](function(_0xcd655d){return _0xcd655d;});}return null;};}function removeEntity(_0x27559b,_0x260874){return function(_0x2aecac){if(_0x2aecac){return _0x2aecac['destroy']()[_0x291a('0x25')](function(){_0x27559b[_0x291a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d77c,_0x11e492){return function(_0x3d86e3){if(!_0x3d86e3){_0x30d77c[_0x291a('0x19')](0x194);}return _0x3d86e3;};}function handleError(_0x5080fc,_0x53da2a){_0x53da2a=_0x53da2a||0x1f4;return function(_0x12934d){logger[_0x291a('0x26')](_0x12934d[_0x291a('0x27')]);if(_0x12934d['name']){delete _0x12934d[_0x291a('0x28')];}_0x5080fc[_0x291a('0x1a')](_0x53da2a)['send'](_0x12934d);};}exports[_0x291a('0x29')]=function(_0xf5e7b8,_0x5d9f79){var _0xeeadf0={},_0x2a2266={},_0x3af0e1={'count':0x0,'rows':[]};var _0x32c53b=_[_0x291a('0x2a')](db[_0x291a('0x2b')][_0x291a('0x2c')],function(_0x11543f){return{'name':_0x11543f[_0x291a('0x2d')],'type':_0x11543f[_0x291a('0x2e')][_0x291a('0x2f')]};});_0x2a2266[_0x291a('0x30')]=_[_0x291a('0x2a')](_0x32c53b,_0x291a('0x28'));_0x2a2266['query']=_[_0x291a('0x31')](_0xf5e7b8[_0x291a('0x32')]);_0x2a2266[_0x291a('0x33')]=_[_0x291a('0x34')](_0x2a2266['model'],_0x2a2266[_0x291a('0x32')]);_0xeeadf0[_0x291a('0x35')]=_[_0x291a('0x34')](_0x2a2266[_0x291a('0x30')],qs[_0x291a('0x36')](_0xf5e7b8[_0x291a('0x32')][_0x291a('0x36')]));_0xeeadf0[_0x291a('0x35')]=_0xeeadf0['attributes'][_0x291a('0x37')]?_0xeeadf0[_0x291a('0x35')]:_0x2a2266[_0x291a('0x30')];if(!_0xf5e7b8[_0x291a('0x32')][_0x291a('0x38')]('nolimit')){_0xeeadf0[_0x291a('0x1f')]=qs[_0x291a('0x1f')](_0xf5e7b8[_0x291a('0x32')][_0x291a('0x1f')]);_0xeeadf0[_0x291a('0x1d')]=qs['offset'](_0xf5e7b8[_0x291a('0x32')][_0x291a('0x1d')]);}_0xeeadf0[_0x291a('0x39')]=qs[_0x291a('0x3a')](_0xf5e7b8[_0x291a('0x32')][_0x291a('0x3a')]);_0xeeadf0[_0x291a('0x3b')]=qs[_0x291a('0x33')](_[_0x291a('0x3c')](_0xf5e7b8['query'],_0x2a2266[_0x291a('0x33')]),_0x32c53b);if(_0xf5e7b8['query'][_0x291a('0x3d')]){_0xeeadf0['where']=_['merge'](_0xeeadf0[_0x291a('0x3b')],{'$or':_[_0x291a('0x2a')](_0x32c53b,function(_0x7de1c){if(_0x7de1c['type']!==_0x291a('0x3e')){var _0x43c919={};_0x43c919[_0x7de1c[_0x291a('0x28')]]={'$like':'%'+_0xf5e7b8[_0x291a('0x32')][_0x291a('0x3d')]+'%'};return _0x43c919;}})});}_0xeeadf0=_['merge']({},_0xeeadf0,_0xf5e7b8['options']);var _0xafcb86={'where':_0xeeadf0[_0x291a('0x3b')]};return db[_0x291a('0x2b')]['count'](_0xafcb86)['then'](function(_0x4d4d0e){_0x3af0e1[_0x291a('0x20')]=_0x4d4d0e;if(_0xf5e7b8[_0x291a('0x32')][_0x291a('0x3f')]){_0xeeadf0[_0x291a('0x40')]=[{'all':!![]}];}return db[_0x291a('0x2b')]['findAll'](_0xeeadf0);})['then'](function(_0x389d59){_0x3af0e1[_0x291a('0x41')]=_0x389d59;return _0x3af0e1;})[_0x291a('0x25')](respondWithFilteredResult(_0x5d9f79,_0xeeadf0))[_0x291a('0x42')](handleError(_0x5d9f79,null));};exports[_0x291a('0x43')]=function(_0x381371,_0x24e7b4){var _0x2b8715={'raw':!![],'where':{'id':_0x381371['params']['id']}},_0x34ea67={};_0x34ea67['model']=_['keys'](db[_0x291a('0x2b')][_0x291a('0x2c')]);_0x34ea67[_0x291a('0x32')]=_[_0x291a('0x31')](_0x381371[_0x291a('0x32')]);_0x34ea67[_0x291a('0x33')]=_[_0x291a('0x34')](_0x34ea67[_0x291a('0x30')],_0x34ea67[_0x291a('0x32')]);_0x2b8715[_0x291a('0x35')]=_[_0x291a('0x34')](_0x34ea67['model'],qs['fields'](_0x381371[_0x291a('0x32')][_0x291a('0x36')]));_0x2b8715['attributes']=_0x2b8715[_0x291a('0x35')][_0x291a('0x37')]?_0x2b8715[_0x291a('0x35')]:_0x34ea67[_0x291a('0x30')];if(_0x381371[_0x291a('0x32')][_0x291a('0x3f')]){_0x2b8715[_0x291a('0x40')]=[{'all':!![]}];}_0x2b8715=_['merge']({},_0x2b8715,_0x381371[_0x291a('0x44')]);return db[_0x291a('0x2b')][_0x291a('0x45')](_0x2b8715)[_0x291a('0x25')](handleEntityNotFound(_0x24e7b4,null))[_0x291a('0x25')](respondWithResult(_0x24e7b4,null))['catch'](handleError(_0x24e7b4,null));};exports[_0x291a('0x46')]=function(_0x272304,_0x47c4f8){return db[_0x291a('0x2b')]['create'](_0x272304[_0x291a('0x47')],{})[_0x291a('0x25')](respondWithResult(_0x47c4f8,0xc9))[_0x291a('0x42')](handleError(_0x47c4f8,null));};exports[_0x291a('0x24')]=function(_0x2d7f0f,_0x3cfc95){if(_0x2d7f0f[_0x291a('0x47')]['id']){delete _0x2d7f0f['body']['id'];}return db[_0x291a('0x2b')]['find']({'where':{'id':_0x2d7f0f[_0x291a('0x48')]['id']}})['then'](handleEntityNotFound(_0x3cfc95,null))[_0x291a('0x25')](saveUpdates(_0x2d7f0f[_0x291a('0x47')],null))[_0x291a('0x25')](respondWithResult(_0x3cfc95,null))[_0x291a('0x42')](handleError(_0x3cfc95,null));};exports[_0x291a('0x49')]=function(_0x1d6c5c,_0xe434fd){return db[_0x291a('0x2b')][_0x291a('0x45')]({'where':{'id':_0x1d6c5c[_0x291a('0x48')]['id']}})[_0x291a('0x25')](handleEntityNotFound(_0xe434fd,null))[_0x291a('0x25')](removeEntity(_0xe434fd,null))['catch'](handleError(_0xe434fd,null));}; \ No newline at end of file +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 diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index ef01b2f..1cc99ea 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 _0xedf7=['define','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports'];(function(_0x3005c7,_0x39d5a5){var _0x17d49c=function(_0x485108){while(--_0x485108){_0x3005c7['push'](_0x3005c7['shift']());}};_0x17d49c(++_0x39d5a5);}(_0xedf7,0x66));var _0x7edf=function(_0x27cdb1,_0x3b3126){_0x27cdb1=_0x27cdb1-0x0;var _0x55f408=_0xedf7[_0x27cdb1];return _0x55f408;};'use strict';var _=require(_0x7edf('0x0'));var util=require(_0x7edf('0x1'));var logger=require('../../config/logger')(_0x7edf('0x2'));var moment=require(_0x7edf('0x3'));var BPromise=require(_0x7edf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7edf('0x5'));var rimraf=require(_0x7edf('0x6'));var config=require(_0x7edf('0x7'));var attributes=require(_0x7edf('0x8'));module[_0x7edf('0x9')]=function(_0x32cd36,_0x12119e){return _0x32cd36[_0x7edf('0xa')](_0x7edf('0xb'),attributes,{'tableName':_0x7edf('0xc'),'paranoid':![],'indexes':[{'name':_0x7edf('0xd'),'fields':[_0x7edf('0xe'),_0x7edf('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 0e9a6a2..57c23cc 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 _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x505a68,_0xa297b7){_0x505a68=_0x505a68-0x0;var _0x4caac6=_0xbdb7[_0x505a68];return _0x4caac6;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file +var _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_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 diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ea52669..73dc726 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x1ba6b2,_0x47dd82){var _0x5d6cef=function(_0x2f91e8){while(--_0x2f91e8){_0x1ba6b2['push'](_0x1ba6b2['shift']());}};_0x5d6cef(++_0x47dd82);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index a38fb61..6ce015c 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(_0x4ca090,_0x2ee3a4){var _0xf519cd=function(_0x56088c){while(--_0x56088c){_0x4ca090['push'](_0x4ca090['shift']());}};_0xf519cd(++_0x2ee3a4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index bcef911..d651e4b 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 _0x883f=['limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','SugarcrmAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','include','find','create','body','params','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','SugarcrmField','assigned_user_id','created_by','description','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','get_module_fields','values','module_fields','remove','includes','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','rimraf','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined'];(function(_0x2e2720,_0x1ae995){var _0x3f9d2d=function(_0x5067a2){while(--_0x5067a2){_0x2e2720['push'](_0x2e2720['shift']());}};_0x3f9d2d(++_0x1ae995);}(_0x883f,0x147));var _0xf883=function(_0x1e5cc3,_0x238a87){_0x1e5cc3=_0x1e5cc3-0x0;var _0x15c596=_0x883f[_0x1e5cc3];return _0x15c596;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf883('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf883('0x1'));var rp=require('request-promise');var moment=require(_0xf883('0x2'));var BPromise=require(_0xf883('0x3'));var Mustache=require('mustache');var util=require(_0xf883('0x4'));var path=require(_0xf883('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf883('0x6'));var fs=require('fs');var fs_extra=require(_0xf883('0x7'));var _=require(_0xf883('0x8'));var squel=require(_0xf883('0x9'));var crypto=require(_0xf883('0xa'));var jsforce=require(_0xf883('0xb'));var deskjs=require(_0xf883('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf883('0xd'));var Papa=require(_0xf883('0xe'));var Redis=require('ioredis');var authService=require(_0xf883('0xf'));var qs=require(_0xf883('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf883('0x11'));var logger=require(_0xf883('0x12'))(_0xf883('0x13'));var utils=require(_0xf883('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xf883('0x15'));var db=require(_0xf883('0x16'))['db'];var integrations=require(_0xf883('0x17'));function respondWithStatusCode(_0x58fed5,_0x46ec98){_0x46ec98=_0x46ec98||0xcc;return function(_0x52e1fb){if(_0x52e1fb){return _0x58fed5[_0xf883('0x18')](_0x46ec98);}return _0x58fed5[_0xf883('0x19')](_0x46ec98)[_0xf883('0x1a')]();};}function respondWithResult(_0x9efc35,_0x461e49){_0x461e49=_0x461e49||0xc8;return function(_0x418b4d){if(_0x418b4d){return _0x9efc35[_0xf883('0x19')](_0x461e49)[_0xf883('0x1b')](_0x418b4d);}};}function respondWithFilteredResult(_0x4ac377,_0xca8595){return function(_0x1242c9){if(_0x1242c9){var _0x1044b8=typeof _0xca8595[_0xf883('0x1c')]===_0xf883('0x1d')&&typeof _0xca8595[_0xf883('0x1e')]===_0xf883('0x1d');var _0x322bb3=_0x1242c9['count'];var _0x570073=_0x1044b8?0x0:_0xca8595[_0xf883('0x1c')];var _0x45c7c9=_0x1044b8?_0x1242c9['count']:_0xca8595[_0xf883('0x1c')]+_0xca8595['limit'];var _0x2f9102;if(_0x45c7c9>=_0x322bb3){_0x45c7c9=_0x322bb3;_0x2f9102=0xc8;}else{_0x2f9102=0xce;}_0x4ac377[_0xf883('0x19')](_0x2f9102);return _0x4ac377[_0xf883('0x1f')](_0xf883('0x20'),_0x570073+'-'+_0x45c7c9+'/'+_0x322bb3)[_0xf883('0x1b')](_0x1242c9);}return null;};}function patchUpdates(_0x567677){return function(_0x17f5df){try{jsonpatch[_0xf883('0x21')](_0x17f5df,_0x567677,!![]);}catch(_0x27466f){return BPromise[_0xf883('0x22')](_0x27466f);}return _0x17f5df[_0xf883('0x23')]();};}function saveUpdates(_0x56c374,_0x1e4b99){return function(_0x8827a){if(_0x8827a){return _0x8827a[_0xf883('0x24')](_0x56c374)[_0xf883('0x25')](function(_0x30e931){return _0x30e931;});}return null;};}function removeEntity(_0x400a45,_0x30bf58){return function(_0x2012d0){if(_0x2012d0){return _0x2012d0[_0xf883('0x26')]()[_0xf883('0x25')](function(){_0x400a45['status'](0xcc)[_0xf883('0x1a')]();});}};}function handleEntityNotFound(_0x1d1aff,_0x5dbb80){return function(_0xc8985f){if(!_0xc8985f){_0x1d1aff[_0xf883('0x18')](0x194);}return _0xc8985f;};}function handleError(_0x4d825c,_0x575312){_0x575312=_0x575312||0x1f4;return function(_0x42be9f){logger[_0xf883('0x27')](_0x42be9f[_0xf883('0x28')]);if(_0x42be9f['name']){delete _0x42be9f[_0xf883('0x29')];}_0x4d825c[_0xf883('0x19')](_0x575312)['send'](_0x42be9f);};}exports[_0xf883('0x2a')]=function(_0x527c67,_0x14a349){var _0x32a6f7={},_0x52989f={},_0x364b9d={'count':0x0,'rows':[]};var _0x242ea1=_[_0xf883('0x2b')](db[_0xf883('0x2c')][_0xf883('0x2d')],function(_0x23ff8d){return{'name':_0x23ff8d[_0xf883('0x2e')],'type':_0x23ff8d[_0xf883('0x2f')]['key']};});_0x52989f[_0xf883('0x30')]=_[_0xf883('0x2b')](_0x242ea1,'name');_0x52989f[_0xf883('0x31')]=_[_0xf883('0x32')](_0x527c67[_0xf883('0x31')]);_0x52989f[_0xf883('0x33')]=_[_0xf883('0x34')](_0x52989f[_0xf883('0x30')],_0x52989f[_0xf883('0x31')]);_0x32a6f7['attributes']=_['intersection'](_0x52989f[_0xf883('0x30')],qs[_0xf883('0x35')](_0x527c67[_0xf883('0x31')][_0xf883('0x35')]));_0x32a6f7[_0xf883('0x36')]=_0x32a6f7['attributes'][_0xf883('0x37')]?_0x32a6f7[_0xf883('0x36')]:_0x52989f[_0xf883('0x30')];if(!_0x527c67[_0xf883('0x31')][_0xf883('0x38')](_0xf883('0x39'))){_0x32a6f7['limit']=qs['limit'](_0x527c67[_0xf883('0x31')][_0xf883('0x1e')]);_0x32a6f7[_0xf883('0x1c')]=qs[_0xf883('0x1c')](_0x527c67[_0xf883('0x31')][_0xf883('0x1c')]);}_0x32a6f7[_0xf883('0x3a')]=qs[_0xf883('0x3b')](_0x527c67[_0xf883('0x31')][_0xf883('0x3b')]);_0x32a6f7[_0xf883('0x3c')]=qs[_0xf883('0x33')](_[_0xf883('0x3d')](_0x527c67[_0xf883('0x31')],_0x52989f[_0xf883('0x33')]),_0x242ea1);if(_0x527c67[_0xf883('0x31')][_0xf883('0x3e')]){_0x32a6f7[_0xf883('0x3c')]=_[_0xf883('0x3f')](_0x32a6f7[_0xf883('0x3c')],{'$or':_[_0xf883('0x2b')](_0x242ea1,function(_0x1ddd61){if(_0x1ddd61['type']!==_0xf883('0x40')){var _0x217886={};_0x217886[_0x1ddd61[_0xf883('0x29')]]={'$like':'%'+_0x527c67[_0xf883('0x31')][_0xf883('0x3e')]+'%'};return _0x217886;}})});}_0x32a6f7=_[_0xf883('0x3f')]({},_0x32a6f7,_0x527c67[_0xf883('0x41')]);var _0x3c8e67={'where':_0x32a6f7['where']};return db['SugarcrmAccount'][_0xf883('0x42')](_0x3c8e67)[_0xf883('0x25')](function(_0x43b033){_0x364b9d['count']=_0x43b033;if(_0x527c67[_0xf883('0x31')][_0xf883('0x43')]){_0x32a6f7['include']=[{'all':!![]}];}return db[_0xf883('0x2c')][_0xf883('0x44')](_0x32a6f7);})[_0xf883('0x25')](function(_0xc6bb83){_0x364b9d[_0xf883('0x45')]=_0xc6bb83;return _0x364b9d;})['then'](respondWithFilteredResult(_0x14a349,_0x32a6f7))[_0xf883('0x46')](handleError(_0x14a349,null));};exports['show']=function(_0x1a18cf,_0x13011a){var _0x508683={'raw':![],'where':{'id':_0x1a18cf['params']['id']}},_0x2a1be5={};_0x2a1be5[_0xf883('0x30')]=_[_0xf883('0x32')](db['SugarcrmAccount'][_0xf883('0x2d')]);_0x2a1be5[_0xf883('0x31')]=_[_0xf883('0x32')](_0x1a18cf[_0xf883('0x31')]);_0x2a1be5[_0xf883('0x33')]=_[_0xf883('0x34')](_0x2a1be5['model'],_0x2a1be5[_0xf883('0x31')]);_0x508683[_0xf883('0x36')]=_['intersection'](_0x2a1be5[_0xf883('0x30')],qs['fields'](_0x1a18cf[_0xf883('0x31')]['fields']));_0x508683[_0xf883('0x36')]=_0x508683['attributes'][_0xf883('0x37')]?_0x508683[_0xf883('0x36')]:_0x2a1be5['model'];if(_0x1a18cf[_0xf883('0x31')][_0xf883('0x43')]){_0x508683[_0xf883('0x47')]=[{'all':!![]}];}_0x508683=_['merge']({},_0x508683,_0x1a18cf[_0xf883('0x41')]);return db[_0xf883('0x2c')][_0xf883('0x48')](_0x508683)[_0xf883('0x25')](handleEntityNotFound(_0x13011a,null))[_0xf883('0x25')](respondWithResult(_0x13011a,null))[_0xf883('0x46')](handleError(_0x13011a,null));};exports[_0xf883('0x49')]=function(_0x499620,_0x26bc26){return db[_0xf883('0x2c')][_0xf883('0x49')](_0x499620[_0xf883('0x4a')],{})[_0xf883('0x25')](respondWithResult(_0x26bc26,0xc9))[_0xf883('0x46')](handleError(_0x26bc26,null));};exports[_0xf883('0x24')]=function(_0x3c8680,_0x3530be){if(_0x3c8680[_0xf883('0x4a')]['id']){delete _0x3c8680[_0xf883('0x4a')]['id'];}return db[_0xf883('0x2c')][_0xf883('0x48')]({'where':{'id':_0x3c8680[_0xf883('0x4b')]['id']}})[_0xf883('0x25')](handleEntityNotFound(_0x3530be,null))[_0xf883('0x25')](saveUpdates(_0x3c8680['body'],null))[_0xf883('0x25')](respondWithResult(_0x3530be,null))[_0xf883('0x46')](handleError(_0x3530be,null));};exports[_0xf883('0x26')]=function(_0x4c6ab9,_0x117d68){return db['SugarcrmAccount'][_0xf883('0x48')]({'where':{'id':_0x4c6ab9['params']['id']}})[_0xf883('0x25')](handleEntityNotFound(_0x117d68,null))[_0xf883('0x25')](removeEntity(_0x117d68,null))['catch'](handleError(_0x117d68,null));};exports[_0xf883('0x4c')]=function(_0x43b1e8,_0x3e691d,_0x183f12){var _0x18e2c2={};var _0x10fdca={};var _0x137261;var _0x1effb4;return db[_0xf883('0x2c')]['findOne']({'where':{'id':_0x43b1e8[_0xf883('0x4b')]['id']}})[_0xf883('0x25')](handleEntityNotFound(_0x3e691d,null))['then'](function(_0x1fdfa1){if(_0x1fdfa1){_0x137261=_0x1fdfa1;_0x10fdca['model']=_[_0xf883('0x32')](db[_0xf883('0x4d')][_0xf883('0x2d')]);_0x10fdca['query']=_[_0xf883('0x32')](_0x43b1e8[_0xf883('0x31')]);_0x10fdca[_0xf883('0x33')]=_[_0xf883('0x34')](_0x10fdca[_0xf883('0x30')],_0x10fdca[_0xf883('0x31')]);_0x18e2c2[_0xf883('0x36')]=_[_0xf883('0x34')](_0x10fdca['model'],qs[_0xf883('0x35')](_0x43b1e8[_0xf883('0x31')]['fields']));_0x18e2c2[_0xf883('0x36')]=_0x18e2c2['attributes'][_0xf883('0x37')]?_0x18e2c2[_0xf883('0x36')]:_0x10fdca[_0xf883('0x30')];_0x18e2c2[_0xf883('0x3a')]=qs[_0xf883('0x3b')](_0x43b1e8[_0xf883('0x31')][_0xf883('0x3b')]);_0x18e2c2['where']=qs['filters'](_[_0xf883('0x3d')](_0x43b1e8[_0xf883('0x31')],_0x10fdca[_0xf883('0x33')]));if(_0x43b1e8[_0xf883('0x31')][_0xf883('0x3e')]){_0x18e2c2['where']=_[_0xf883('0x3f')](_0x18e2c2[_0xf883('0x3c')],{'$or':_[_0xf883('0x2b')](_0x18e2c2[_0xf883('0x36')],function(_0x217087){var _0x38d34b={};_0x38d34b[_0x217087]={'$like':'%'+_0x43b1e8[_0xf883('0x31')]['filter']+'%'};return _0x38d34b;})});}_0x18e2c2=_['merge']({},_0x18e2c2,_0x43b1e8[_0xf883('0x41')]);return _0x137261[_0xf883('0x4c')](_0x18e2c2);}})[_0xf883('0x25')](function(_0x3fe31a){if(_0x3fe31a){_0x1effb4=_0x3fe31a['length'];if(!_0x43b1e8[_0xf883('0x31')][_0xf883('0x38')](_0xf883('0x39'))){_0x18e2c2[_0xf883('0x1e')]=qs[_0xf883('0x1e')](_0x43b1e8[_0xf883('0x31')][_0xf883('0x1e')]);_0x18e2c2[_0xf883('0x1c')]=qs['offset'](_0x43b1e8[_0xf883('0x31')][_0xf883('0x1c')]);}return _0x137261[_0xf883('0x4c')](_0x18e2c2);}})[_0xf883('0x25')](function(_0x56c108){if(_0x56c108){return _0x56c108?{'count':_0x1effb4,'rows':_0x56c108}:null;}})[_0xf883('0x25')](respondWithResult(_0x3e691d,null))[_0xf883('0x46')](handleError(_0x3e691d,null));};exports[_0xf883('0x4e')]=function(_0x428de5,_0x43543b,_0x4a60cd){if(_0x428de5[_0xf883('0x4a')]['id']){delete _0x428de5[_0xf883('0x4a')]['id'];}return db[_0xf883('0x2c')][_0xf883('0x4f')]({'where':{'id':_0x428de5[_0xf883('0x4b')]['id']}})['then'](handleEntityNotFound(_0x43543b,null))['then'](function(_0x1e33fc){if(_0x1e33fc){_0x428de5[_0xf883('0x4a')][_0xf883('0x50')]=_0x1e33fc['id'];_0x428de5[_0xf883('0x4a')][_0xf883('0x51')]=integrations[_0xf883('0x52')](_0x428de5[_0xf883('0x4a')]['channel'],_0x428de5[_0xf883('0x4a')][_0xf883('0x2f')]);_0x428de5['body'][_0xf883('0x53')]=integrations[_0xf883('0x54')](_0x428de5[_0xf883('0x4a')]['channel'],_0x428de5[_0xf883('0x4a')]['type']);return db[_0xf883('0x4d')][_0xf883('0x49')](_0x428de5[_0xf883('0x4a')],{'include':[{'model':db[_0xf883('0x55')],'as':_0xf883('0x51')},{'model':db[_0xf883('0x55')],'as':_0xf883('0x53')}]});}return null;})[_0xf883('0x25')](respondWithResult(_0x43543b,null))[_0xf883('0x46')](handleError(_0x43543b,null));};exports['getFields']=function(_0x41a524,_0x1976d6,_0x5c9f6e){var _0x714880='';var _0x58d3a0=['id','name',_0xf883('0x56'),_0xf883('0x57'),_0xf883('0x58'),_0xf883('0x59'),_0xf883('0x5a'),_0xf883('0x5b'),_0xf883('0x5c'),_0xf883('0x5d'),_0xf883('0x5e'),'direction'];return db[_0xf883('0x2c')][_0xf883('0x4f')]({'where':{'id':_0x41a524['params']['id']},'attributes':['id',_0xf883('0x5f'),_0xf883('0x60'),_0xf883('0x61')]})['then'](handleEntityNotFound(_0x1976d6,null))[_0xf883('0x25')](function(_0x4feed6){if(_0x4feed6){_0x714880=_0x4feed6[_0xf883('0x61')];var _0x31faa0=_0x714880[_0xf883('0x62')](-0x1);if(_0x31faa0==='/'){_0x714880=_0x714880[_0xf883('0x63')](0x0,_0x714880['lastIndexOf'](_0x31faa0));}return rp({'method':_0xf883('0x64'),'uri':util[_0xf883('0x65')](_0xf883('0x66'),_0x714880,_0xf883('0x67')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0xf883('0x68'),'rest_data':JSON[_0xf883('0x69')]({'user_auth':{'user_name':_0x4feed6['username'],'password':_0x4feed6[_0xf883('0x60')],'encryption':'PLAIN'},'application':_0xf883('0x6a')})}});}})[_0xf883('0x25')](function(_0x3f2f2c){if(_0x3f2f2c&&_0x3f2f2c[_0xf883('0x29')]!=='Invalid\x20Login'&&_0x3f2f2c[_0xf883('0x29')]!=='Password\x20Expired'){return rp({'method':_0xf883('0x64'),'uri':util[_0xf883('0x65')](_0xf883('0x66'),_0x714880,_0xf883('0x67')),'json':!![],'form':{'method':_0xf883('0x6b'),'input_type':_0xf883('0x68'),'response_type':_0xf883('0x68'),'rest_data':JSON[_0xf883('0x69')]({'session':_0x3f2f2c['id'],'module_name':'Calls'})}})[_0xf883('0x25')](function(_0x427ae8){if(_0x427ae8){var _0x4a1e47=_[_0xf883('0x6c')](_0x427ae8[_0xf883('0x6d')]);_[_0xf883('0x6e')](_0x4a1e47,function(_0x5cbd42){return _0x58d3a0[_0xf883('0x6f')](_0x5cbd42['name']);});return{'count':_0x4a1e47[_0xf883('0x37')],'rows':_[_0xf883('0x2b')](_0x4a1e47,function(_0x2e2231){return{'id':_0x2e2231[_0xf883('0x29')],'name':_0x2e2231[_0xf883('0x70')],'custom':_['endsWith'](_0x2e2231[_0xf883('0x29')],'_c')?!![]:![],'options':_0x2e2231['options']?_['map'](_[_0xf883('0x6c')](_0x2e2231['options']),function(_0x307343){return{'name':_0x307343[_0xf883('0x71')],'value':_0x307343[_0xf883('0x29')]};}):[]};})};}})[_0xf883('0x25')](respondWithResult(_0x1976d6,null))['catch'](function(_0x4ecac9){var _0x88faef=_0x41a524[_0xf883('0x31')][_0xf883('0x72')]?0x1f4:_0x4ecac9[_0xf883('0x73')]||0x1f4;logger[_0xf883('0x27')](_0xf883('0x74'),'getFields',_0x88faef,JSON[_0xf883('0x69')](_0x4ecac9));delete _0x4ecac9[_0xf883('0x29')];if(_0x88faef===0x191){_0x88faef=0x190;}_0x1976d6[_0xf883('0x19')](_0x88faef)[_0xf883('0x75')](_0x41a524[_0xf883('0x31')][_0xf883('0x72')]?{'message':_0xf883('0x76'),'statusCode':_0x4ecac9[_0xf883('0x73')]}:_0x4ecac9);});}else{var _0xb31d31=0x1f4;_0x1976d6[_0xf883('0x19')](_0xb31d31)[_0xf883('0x75')]({'message':_0xf883('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 1939c8d..d4e9001 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 _0x9048=['lodash','../../config/logger','request-promise','path','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x450b0b,_0x7dc40f){var _0x49144b=function(_0x5b50b9){while(--_0x5b50b9){_0x450b0b['push'](_0x450b0b['shift']());}};_0x49144b(++_0x7dc40f);}(_0x9048,0xf2));var _0x8904=function(_0x441605,_0x28460d){_0x441605=_0x441605-0x0;var _0x1eedcf=_0x9048[_0x441605];return _0x1eedcf;};'use strict';var _=require(_0x8904('0x0'));var util=require('util');var logger=require(_0x8904('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8904('0x2'));var fs=require('fs');var path=require(_0x8904('0x3'));var rimraf=require('rimraf');var config=require(_0x8904('0x4'));var attributes=require(_0x8904('0x5'));var integrations=require(_0x8904('0x6'));module[_0x8904('0x7')]=function(_0x3662b0,_0x4613a7){return _0x3662b0[_0x8904('0x8')](_0x8904('0x9'),attributes,{'tableName':_0x8904('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index cbe22df..df7b4ea 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 _0xf032=['ShowSugarcrmAccount','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','code','error','message','result','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','stringify','catch'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf032,0x64));var _0x2f03=function(_0x19a522,_0x53c8ea){_0x19a522=_0x19a522-0x0;var _0x4b0f4e=_0xf032[_0x19a522];return _0x4b0f4e;};'use strict';var _=require(_0x2f03('0x0'));var util=require('util');var moment=require(_0x2f03('0x1'));var BPromise=require(_0x2f03('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2f03('0x3'));var db=require(_0x2f03('0x4'))['db'];var utils=require(_0x2f03('0x5'));var logger=require(_0x2f03('0x6'))(_0x2f03('0x7'));var config=require('../../config/environment');var jayson=require(_0x2f03('0x8'));var client=jayson[_0x2f03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4daf1a,_0x12a465,_0x1a90d4){return new BPromise(function(_0x11391d,_0xc309dd){return client['request'](_0x4daf1a,_0x1a90d4)[_0x2f03('0xa')](function(_0x3b6b95){logger[_0x2f03('0xb')](_0x2f03('0xc'),_0x12a465,'request\x20sent');logger[_0x2f03('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x12a465,_0x2f03('0xe'),JSON['stringify'](_0x3b6b95));if(_0x3b6b95['error']){if(_0x3b6b95['error'][_0x2f03('0xf')]===0x1f4){logger['error'](_0x2f03('0xc'),_0x12a465,_0x3b6b95[_0x2f03('0x10')][_0x2f03('0x11')]);return _0xc309dd(_0x3b6b95[_0x2f03('0x10')][_0x2f03('0x11')]);}logger[_0x2f03('0x10')](_0x2f03('0xc'),_0x12a465,_0x3b6b95[_0x2f03('0x10')][_0x2f03('0x11')]);return _0x11391d(_0x3b6b95[_0x2f03('0x10')]['message']);}else{logger[_0x2f03('0xb')](_0x2f03('0xc'),_0x12a465,_0x2f03('0xe'));_0x11391d(_0x3b6b95[_0x2f03('0x12')][_0x2f03('0x11')]);}})['catch'](function(_0x18424a){logger[_0x2f03('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x12a465,_0x18424a);_0xc309dd(_0x18424a);});});}exports[_0x2f03('0x13')]=function(_0x258f9b){var _0x357594=this;return new Promise(function(_0x3025b6,_0x51487c){return db[_0x2f03('0x14')][_0x2f03('0x15')]({'raw':_0x258f9b[_0x2f03('0x16')]?_0x258f9b['options'][_0x2f03('0x17')]===undefined?!![]:![]:!![],'where':_0x258f9b[_0x2f03('0x16')]?_0x258f9b['options'][_0x2f03('0x18')]||null:null,'attributes':_0x258f9b[_0x2f03('0x16')]?_0x258f9b[_0x2f03('0x16')][_0x2f03('0x19')]||null:null,'limit':_0x258f9b['options']?_0x258f9b['options'][_0x2f03('0x1a')]||null:null,'include':_0x258f9b[_0x2f03('0x16')]?_0x258f9b[_0x2f03('0x16')][_0x2f03('0x1b')]?_[_0x2f03('0x1c')](_0x258f9b['options'][_0x2f03('0x1b')],function(_0x8cdd90){return{'model':db[_0x8cdd90['model']],'as':_0x8cdd90['as'],'attributes':_0x8cdd90[_0x2f03('0x19')],'include':_0x8cdd90[_0x2f03('0x1b')]?_[_0x2f03('0x1c')](_0x8cdd90[_0x2f03('0x1b')],function(_0x37adef){return{'model':db[_0x37adef[_0x2f03('0x1d')]],'as':_0x37adef['as'],'attributes':_0x37adef[_0x2f03('0x19')],'include':_0x37adef[_0x2f03('0x1b')]?_[_0x2f03('0x1c')](_0x37adef[_0x2f03('0x1b')],function(_0x400d87){return{'model':db[_0x400d87[_0x2f03('0x1d')]],'as':_0x400d87['as'],'attributes':_0x400d87['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x6cffc7){logger[_0x2f03('0xb')](_0x2f03('0x13'),_0x258f9b);logger[_0x2f03('0xd')](_0x2f03('0x13'),_0x258f9b,JSON[_0x2f03('0x1e')](_0x6cffc7));_0x3025b6(_0x6cffc7);})[_0x2f03('0x1f')](function(_0x3ab573){logger[_0x2f03('0x10')]('GetSugarcrmAccount',_0x3ab573['message'],_0x258f9b);_0x51487c(_0x357594['error'](0x1f4,_0x3ab573[_0x2f03('0x11')]));});});};exports['ShowSugarcrmAccount']=function(_0x470d8b){var _0x3b81c3=this;return new Promise(function(_0x3e0406,_0x22c858){return db[_0x2f03('0x14')]['find']({'raw':_0x470d8b[_0x2f03('0x16')]?_0x470d8b['options'][_0x2f03('0x17')]===undefined?!![]:![]:!![],'where':_0x470d8b[_0x2f03('0x16')]?_0x470d8b[_0x2f03('0x16')][_0x2f03('0x18')]||null:null,'attributes':_0x470d8b[_0x2f03('0x16')]?_0x470d8b[_0x2f03('0x16')][_0x2f03('0x19')]||null:null,'include':_0x470d8b[_0x2f03('0x16')]?_0x470d8b[_0x2f03('0x16')][_0x2f03('0x1b')]?_[_0x2f03('0x1c')](_0x470d8b[_0x2f03('0x16')]['include'],function(_0x43cdb7){return{'model':db[_0x43cdb7[_0x2f03('0x1d')]],'as':_0x43cdb7['as'],'attributes':_0x43cdb7[_0x2f03('0x19')],'include':_0x43cdb7[_0x2f03('0x1b')]?_[_0x2f03('0x1c')](_0x43cdb7[_0x2f03('0x1b')],function(_0x2423d8){return{'model':db[_0x2423d8[_0x2f03('0x1d')]],'as':_0x2423d8['as'],'attributes':_0x2423d8[_0x2f03('0x19')],'include':_0x2423d8[_0x2f03('0x1b')]?_[_0x2f03('0x1c')](_0x2423d8['include'],function(_0x1e2882){return{'model':db[_0x1e2882['model']],'as':_0x1e2882['as'],'attributes':_0x1e2882[_0x2f03('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2f03('0xa')](function(_0x267714){logger[_0x2f03('0xb')](_0x2f03('0x20'),_0x470d8b);logger[_0x2f03('0xd')](_0x2f03('0x20'),_0x470d8b,JSON['stringify'](_0x267714));_0x3e0406(_0x267714);})[_0x2f03('0x1f')](function(_0x4d31b5){logger[_0x2f03('0x10')]('ShowSugarcrmAccount',_0x4d31b5[_0x2f03('0x11')],_0x470d8b);_0x22c858(_0x3b81c3['error'](0x1f4,_0x4d31b5['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 8ce3baa..20e69ec 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 _0xbeff=['getDescriptions','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getSubjects'];(function(_0x3d734f,_0x17e4fa){var _0x21c6a3=function(_0x2e06d6){while(--_0x2e06d6){_0x3d734f['push'](_0x3d734f['shift']());}};_0x21c6a3(++_0x17e4fa);}(_0xbeff,0x9a));var _0xfbef=function(_0x3bba4c,_0x256ce3){_0x3bba4c=_0x3bba4c-0x0;var _0x4303de=_0xbeff[_0x3bba4c];return _0x4303de;};'use strict';var multer=require(_0xfbef('0x0'));var util=require(_0xfbef('0x1'));var path=require('path');var timeout=require(_0xfbef('0x2'));var express=require(_0xfbef('0x3'));var router=express['Router']();var fs_extra=require(_0xfbef('0x4'));var auth=require(_0xfbef('0x5'));var interaction=require(_0xfbef('0x6'));var config=require('../../config/environment');var controller=require(_0xfbef('0x7'));router[_0xfbef('0x8')]('/',auth[_0xfbef('0x9')](),controller[_0xfbef('0xa')]);router[_0xfbef('0x8')]('/:id',auth[_0xfbef('0x9')](),controller[_0xfbef('0xb')]);router[_0xfbef('0x8')](_0xfbef('0xc'),auth[_0xfbef('0x9')](),controller['getFields']);router[_0xfbef('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xfbef('0xd')]);router[_0xfbef('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xfbef('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfbef('0xf')]);router['put'](_0xfbef('0x10'),auth[_0xfbef('0x9')](),controller[_0xfbef('0x11')]);router[_0xfbef('0x12')](_0xfbef('0x10'),auth[_0xfbef('0x9')](),controller[_0xfbef('0x13')]);module[_0xfbef('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 116cf6e..822388a 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 _0x00ba=['sequelize','STRING'];(function(_0x4051d6,_0x277bd1){var _0x356f1e=function(_0xcc5c2b){while(--_0xcc5c2b){_0x4051d6['push'](_0x4051d6['shift']());}};_0x356f1e(++_0x277bd1);}(_0x00ba,0x1ba));var _0xa00b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x00ba[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xa00b('0x0'));module['exports']={'name':{'type':Sequelize[_0xa00b('0x1')]},'description':{'type':Sequelize[_0xa00b('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index d1b2b00..d1c5f3e 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 _0xc334=['../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','reject','update','then','error','stack','send','SugarcrmConfiguration','fieldName','type','model','map','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','merge','filter','options','findAll','rows','show','params','rawAttributes','keys','includeAll','create','body','find','catch','destroy','getFields','findOne','SugarcrmField','length','pick','getSubjects','order','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x15468b,_0x37eda6){var _0x409019=function(_0x25bddb){while(--_0x25bddb){_0x15468b['push'](_0x15468b['shift']());}};_0x409019(++_0x37eda6);}(_0xc334,0x1c5));var _0x4c33=function(_0x20e5c3,_0x41470c){_0x20e5c3=_0x20e5c3-0x0;var _0x401520=_0xc334[_0x20e5c3];return _0x401520;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4c33('0x0'));var zipdir=require(_0x4c33('0x1'));var jsonpatch=require(_0x4c33('0x2'));var rp=require(_0x4c33('0x3'));var moment=require(_0x4c33('0x4'));var BPromise=require(_0x4c33('0x5'));var Mustache=require(_0x4c33('0x6'));var util=require(_0x4c33('0x7'));var path=require(_0x4c33('0x8'));var sox=require('sox');var csv=require(_0x4c33('0x9'));var ejs=require(_0x4c33('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4c33('0xb'));var crypto=require(_0x4c33('0xc'));var jsforce=require(_0x4c33('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4c33('0x9'));var querystring=require(_0x4c33('0xe'));var Papa=require(_0x4c33('0xf'));var Redis=require(_0x4c33('0x10'));var authService=require(_0x4c33('0x11'));var qs=require(_0x4c33('0x12'));var as=require(_0x4c33('0x13'));var hardwareService=require(_0x4c33('0x14'));var logger=require(_0x4c33('0x15'))(_0x4c33('0x16'));var utils=require('../../config/utils');var config=require(_0x4c33('0x17'));var licenseUtil=require(_0x4c33('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a84a0,_0x23f10c){_0x23f10c=_0x23f10c||0xcc;return function(_0x2040d7){if(_0x2040d7){return _0x1a84a0[_0x4c33('0x19')](_0x23f10c);}return _0x1a84a0[_0x4c33('0x1a')](_0x23f10c)[_0x4c33('0x1b')]();};}function respondWithResult(_0x483ed9,_0x3a43fb){_0x3a43fb=_0x3a43fb||0xc8;return function(_0x2b006f){if(_0x2b006f){return _0x483ed9[_0x4c33('0x1a')](_0x3a43fb)['json'](_0x2b006f);}};}function respondWithFilteredResult(_0x2f2840,_0xb29e7){return function(_0x59e7e5){if(_0x59e7e5){var _0x116c81=typeof _0xb29e7[_0x4c33('0x1c')]===_0x4c33('0x1d')&&typeof _0xb29e7['limit']==='undefined';var _0x253c0c=_0x59e7e5[_0x4c33('0x1e')];var _0x482d4a=_0x116c81?0x0:_0xb29e7['offset'];var _0x10906a=_0x116c81?_0x59e7e5[_0x4c33('0x1e')]:_0xb29e7[_0x4c33('0x1c')]+_0xb29e7['limit'];var _0x297802;if(_0x10906a>=_0x253c0c){_0x10906a=_0x253c0c;_0x297802=0xc8;}else{_0x297802=0xce;}_0x2f2840['status'](_0x297802);return _0x2f2840[_0x4c33('0x1f')](_0x4c33('0x20'),_0x482d4a+'-'+_0x10906a+'/'+_0x253c0c)[_0x4c33('0x21')](_0x59e7e5);}return null;};}function patchUpdates(_0x59a621){return function(_0x5c3e11){try{jsonpatch['apply'](_0x5c3e11,_0x59a621,!![]);}catch(_0x2c4a87){return BPromise[_0x4c33('0x22')](_0x2c4a87);}return _0x5c3e11['save']();};}function saveUpdates(_0x47a514,_0x5d86c6){return function(_0x210bc7){if(_0x210bc7){return _0x210bc7[_0x4c33('0x23')](_0x47a514)[_0x4c33('0x24')](function(_0x4c544e){return _0x4c544e;});}return null;};}function removeEntity(_0x50a442,_0x22bdca){return function(_0x196851){if(_0x196851){return _0x196851['destroy']()[_0x4c33('0x24')](function(){_0x50a442[_0x4c33('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c82d9,_0x5bad2d){return function(_0x4fbca0){if(!_0x4fbca0){_0x2c82d9[_0x4c33('0x19')](0x194);}return _0x4fbca0;};}function handleError(_0x54f80a,_0x58372a){_0x58372a=_0x58372a||0x1f4;return function(_0x29ce7e){logger[_0x4c33('0x25')](_0x29ce7e[_0x4c33('0x26')]);if(_0x29ce7e['name']){delete _0x29ce7e['name'];}_0x54f80a[_0x4c33('0x1a')](_0x58372a)[_0x4c33('0x27')](_0x29ce7e);};}exports['index']=function(_0xd22609,_0x3997c6){var _0x5f5ab1={},_0x49e79b={},_0x1cafa9={'count':0x0,'rows':[]};var _0x346a94=_['map'](db[_0x4c33('0x28')]['rawAttributes'],function(_0x59d98d){return{'name':_0x59d98d[_0x4c33('0x29')],'type':_0x59d98d[_0x4c33('0x2a')]['key']};});_0x49e79b[_0x4c33('0x2b')]=_[_0x4c33('0x2c')](_0x346a94,_0x4c33('0x2d'));_0x49e79b[_0x4c33('0x2e')]=_['keys'](_0xd22609['query']);_0x49e79b[_0x4c33('0x2f')]=_[_0x4c33('0x30')](_0x49e79b[_0x4c33('0x2b')],_0x49e79b['query']);_0x5f5ab1[_0x4c33('0x31')]=_[_0x4c33('0x30')](_0x49e79b[_0x4c33('0x2b')],qs[_0x4c33('0x32')](_0xd22609['query'][_0x4c33('0x32')]));_0x5f5ab1['attributes']=_0x5f5ab1[_0x4c33('0x31')]['length']?_0x5f5ab1[_0x4c33('0x31')]:_0x49e79b[_0x4c33('0x2b')];if(!_0xd22609[_0x4c33('0x2e')][_0x4c33('0x33')](_0x4c33('0x34'))){_0x5f5ab1['limit']=qs['limit'](_0xd22609[_0x4c33('0x2e')][_0x4c33('0x35')]);_0x5f5ab1[_0x4c33('0x1c')]=qs['offset'](_0xd22609[_0x4c33('0x2e')]['offset']);}_0x5f5ab1['order']=qs[_0x4c33('0x36')](_0xd22609[_0x4c33('0x2e')][_0x4c33('0x36')]);_0x5f5ab1[_0x4c33('0x37')]=qs[_0x4c33('0x2f')](_['pick'](_0xd22609[_0x4c33('0x2e')],_0x49e79b[_0x4c33('0x2f')]),_0x346a94);if(_0xd22609[_0x4c33('0x2e')]['filter']){_0x5f5ab1[_0x4c33('0x37')]=_[_0x4c33('0x38')](_0x5f5ab1[_0x4c33('0x37')],{'$or':_['map'](_0x346a94,function(_0x1f4c84){if(_0x1f4c84[_0x4c33('0x2a')]!=='VIRTUAL'){var _0x1df07d={};_0x1df07d[_0x1f4c84['name']]={'$like':'%'+_0xd22609[_0x4c33('0x2e')][_0x4c33('0x39')]+'%'};return _0x1df07d;}})});}_0x5f5ab1=_[_0x4c33('0x38')]({},_0x5f5ab1,_0xd22609[_0x4c33('0x3a')]);var _0x5e42e1={'where':_0x5f5ab1['where']};return db[_0x4c33('0x28')][_0x4c33('0x1e')](_0x5e42e1)['then'](function(_0x454b37){_0x1cafa9['count']=_0x454b37;if(_0xd22609[_0x4c33('0x2e')]['includeAll']){_0x5f5ab1['include']=[{'all':!![]}];}return db[_0x4c33('0x28')][_0x4c33('0x3b')](_0x5f5ab1);})[_0x4c33('0x24')](function(_0x54962d){_0x1cafa9[_0x4c33('0x3c')]=_0x54962d;return _0x1cafa9;})[_0x4c33('0x24')](respondWithFilteredResult(_0x3997c6,_0x5f5ab1))['catch'](handleError(_0x3997c6,null));};exports[_0x4c33('0x3d')]=function(_0x5ef5b9,_0x461cbd){var _0x4cac4e={'raw':![],'where':{'id':_0x5ef5b9[_0x4c33('0x3e')]['id']}},_0x4308f1={};_0x4308f1[_0x4c33('0x2b')]=_['keys'](db[_0x4c33('0x28')][_0x4c33('0x3f')]);_0x4308f1[_0x4c33('0x2e')]=_[_0x4c33('0x40')](_0x5ef5b9[_0x4c33('0x2e')]);_0x4308f1[_0x4c33('0x2f')]=_['intersection'](_0x4308f1['model'],_0x4308f1[_0x4c33('0x2e')]);_0x4cac4e[_0x4c33('0x31')]=_[_0x4c33('0x30')](_0x4308f1[_0x4c33('0x2b')],qs[_0x4c33('0x32')](_0x5ef5b9[_0x4c33('0x2e')][_0x4c33('0x32')]));_0x4cac4e[_0x4c33('0x31')]=_0x4cac4e[_0x4c33('0x31')]['length']?_0x4cac4e[_0x4c33('0x31')]:_0x4308f1[_0x4c33('0x2b')];if(_0x5ef5b9[_0x4c33('0x2e')][_0x4c33('0x41')]){_0x4cac4e['include']=[{'all':!![]}];}_0x4cac4e=_[_0x4c33('0x38')]({},_0x4cac4e,_0x5ef5b9[_0x4c33('0x3a')]);return db[_0x4c33('0x28')]['find'](_0x4cac4e)[_0x4c33('0x24')](handleEntityNotFound(_0x461cbd,null))[_0x4c33('0x24')](respondWithResult(_0x461cbd,null))['catch'](handleError(_0x461cbd,null));};exports[_0x4c33('0x42')]=function(_0x1d8bf3,_0x21e42e){return db[_0x4c33('0x28')][_0x4c33('0x42')](_0x1d8bf3[_0x4c33('0x43')],{})[_0x4c33('0x24')](respondWithResult(_0x21e42e,0xc9))['catch'](handleError(_0x21e42e,null));};exports[_0x4c33('0x23')]=function(_0x5dd2ad,_0x340c33){if(_0x5dd2ad[_0x4c33('0x43')]['id']){delete _0x5dd2ad[_0x4c33('0x43')]['id'];}return db[_0x4c33('0x28')][_0x4c33('0x44')]({'where':{'id':_0x5dd2ad['params']['id']}})['then'](handleEntityNotFound(_0x340c33,null))[_0x4c33('0x24')](saveUpdates(_0x5dd2ad[_0x4c33('0x43')],null))[_0x4c33('0x24')](respondWithResult(_0x340c33,null))[_0x4c33('0x45')](handleError(_0x340c33,null));};exports[_0x4c33('0x46')]=function(_0x4aba12,_0x27d7f7){return db['SugarcrmConfiguration'][_0x4c33('0x44')]({'where':{'id':_0x4aba12[_0x4c33('0x3e')]['id']}})[_0x4c33('0x24')](handleEntityNotFound(_0x27d7f7,null))[_0x4c33('0x24')](removeEntity(_0x27d7f7,null))[_0x4c33('0x45')](handleError(_0x27d7f7,null));};exports[_0x4c33('0x47')]=function(_0x41d385,_0x177286,_0x2fefd5){var _0x2c5e90={};var _0x59b3d1={};var _0x55f47b;var _0x2dfcd5;return db[_0x4c33('0x28')][_0x4c33('0x48')]({'where':{'id':_0x41d385['params']['id']}})[_0x4c33('0x24')](handleEntityNotFound(_0x177286,null))[_0x4c33('0x24')](function(_0x1fe44c){if(_0x1fe44c){_0x55f47b=_0x1fe44c;_0x59b3d1['model']=_[_0x4c33('0x40')](db[_0x4c33('0x49')]['rawAttributes']);_0x59b3d1[_0x4c33('0x2e')]=_[_0x4c33('0x40')](_0x41d385[_0x4c33('0x2e')]);_0x59b3d1[_0x4c33('0x2f')]=_['intersection'](_0x59b3d1['model'],_0x59b3d1[_0x4c33('0x2e')]);_0x2c5e90[_0x4c33('0x31')]=_['intersection'](_0x59b3d1['model'],qs[_0x4c33('0x32')](_0x41d385['query'][_0x4c33('0x32')]));_0x2c5e90[_0x4c33('0x31')]=_0x2c5e90['attributes'][_0x4c33('0x4a')]?_0x2c5e90['attributes']:_0x59b3d1[_0x4c33('0x2b')];_0x2c5e90['order']=qs['sort'](_0x41d385['query'][_0x4c33('0x36')]);_0x2c5e90[_0x4c33('0x37')]=qs[_0x4c33('0x2f')](_[_0x4c33('0x4b')](_0x41d385['query'],_0x59b3d1[_0x4c33('0x2f')]));if(_0x41d385[_0x4c33('0x2e')][_0x4c33('0x39')]){_0x2c5e90[_0x4c33('0x37')]=_[_0x4c33('0x38')](_0x2c5e90[_0x4c33('0x37')],{'$or':_[_0x4c33('0x2c')](_0x2c5e90['attributes'],function(_0x59dac7){var _0x49fc1e={};_0x49fc1e[_0x59dac7]={'$like':'%'+_0x41d385[_0x4c33('0x2e')][_0x4c33('0x39')]+'%'};return _0x49fc1e;})});}_0x2c5e90=_[_0x4c33('0x38')]({},_0x2c5e90,_0x41d385[_0x4c33('0x3a')]);return _0x55f47b[_0x4c33('0x47')](_0x2c5e90);}})[_0x4c33('0x24')](function(_0x40255e){if(_0x40255e){_0x2dfcd5=_0x40255e[_0x4c33('0x4a')];if(!_0x41d385[_0x4c33('0x2e')]['hasOwnProperty'](_0x4c33('0x34'))){_0x2c5e90[_0x4c33('0x35')]=qs['limit'](_0x41d385[_0x4c33('0x2e')]['limit']);_0x2c5e90[_0x4c33('0x1c')]=qs['offset'](_0x41d385[_0x4c33('0x2e')][_0x4c33('0x1c')]);}return _0x55f47b[_0x4c33('0x47')](_0x2c5e90);}})[_0x4c33('0x24')](function(_0x5b5f1c){if(_0x5b5f1c){return _0x5b5f1c?{'count':_0x2dfcd5,'rows':_0x5b5f1c}:null;}})[_0x4c33('0x24')](respondWithResult(_0x177286,null))['catch'](handleError(_0x177286,null));};exports[_0x4c33('0x4c')]=function(_0x4ed140,_0x2bf038,_0x123dc3){var _0x352eec={};var _0x354532={};var _0xf03600;var _0x1fff24;return db[_0x4c33('0x28')][_0x4c33('0x48')]({'where':{'id':_0x4ed140[_0x4c33('0x3e')]['id']}})[_0x4c33('0x24')](handleEntityNotFound(_0x2bf038,null))[_0x4c33('0x24')](function(_0x30a6ae){if(_0x30a6ae){_0xf03600=_0x30a6ae;_0x354532[_0x4c33('0x2b')]=_[_0x4c33('0x40')](db['SugarcrmField']['rawAttributes']);_0x354532['query']=_[_0x4c33('0x40')](_0x4ed140['query']);_0x354532['filters']=_[_0x4c33('0x30')](_0x354532[_0x4c33('0x2b')],_0x354532[_0x4c33('0x2e')]);_0x352eec[_0x4c33('0x31')]=_[_0x4c33('0x30')](_0x354532[_0x4c33('0x2b')],qs[_0x4c33('0x32')](_0x4ed140[_0x4c33('0x2e')]['fields']));_0x352eec['attributes']=_0x352eec[_0x4c33('0x31')][_0x4c33('0x4a')]?_0x352eec['attributes']:_0x354532['model'];_0x352eec[_0x4c33('0x4d')]=qs['sort'](_0x4ed140['query'][_0x4c33('0x36')]);_0x352eec[_0x4c33('0x37')]=qs[_0x4c33('0x2f')](_[_0x4c33('0x4b')](_0x4ed140[_0x4c33('0x2e')],_0x354532[_0x4c33('0x2f')]));if(_0x4ed140[_0x4c33('0x2e')]['filter']){_0x352eec[_0x4c33('0x37')]=_[_0x4c33('0x38')](_0x352eec['where'],{'$or':_[_0x4c33('0x2c')](_0x352eec[_0x4c33('0x31')],function(_0x44a98a){var _0x496ced={};_0x496ced[_0x44a98a]={'$like':'%'+_0x4ed140[_0x4c33('0x2e')][_0x4c33('0x39')]+'%'};return _0x496ced;})});}_0x352eec=_[_0x4c33('0x38')]({},_0x352eec,_0x4ed140['options']);return _0xf03600['getSubjects'](_0x352eec);}})[_0x4c33('0x24')](function(_0x16a47a){if(_0x16a47a){_0x1fff24=_0x16a47a[_0x4c33('0x4a')];if(!_0x4ed140[_0x4c33('0x2e')][_0x4c33('0x33')](_0x4c33('0x34'))){_0x352eec['limit']=qs['limit'](_0x4ed140[_0x4c33('0x2e')]['limit']);_0x352eec[_0x4c33('0x1c')]=qs[_0x4c33('0x1c')](_0x4ed140[_0x4c33('0x2e')]['offset']);}return _0xf03600[_0x4c33('0x4c')](_0x352eec);}})['then'](function(_0x13c44f){if(_0x13c44f){return _0x13c44f?{'count':_0x1fff24,'rows':_0x13c44f}:null;}})['then'](respondWithResult(_0x2bf038,null))[_0x4c33('0x45')](handleError(_0x2bf038,null));};exports['getDescriptions']=function(_0x3ef3ce,_0x189f2f,_0xcf27cb){var _0x1aadb7={};var _0x3779ab={};var _0xe91b9f;var _0xdf903a;return db[_0x4c33('0x28')][_0x4c33('0x48')]({'where':{'id':_0x3ef3ce[_0x4c33('0x3e')]['id']}})['then'](handleEntityNotFound(_0x189f2f,null))[_0x4c33('0x24')](function(_0x508f5a){if(_0x508f5a){_0xe91b9f=_0x508f5a;_0x3779ab[_0x4c33('0x2b')]=_[_0x4c33('0x40')](db[_0x4c33('0x49')]['rawAttributes']);_0x3779ab[_0x4c33('0x2e')]=_['keys'](_0x3ef3ce[_0x4c33('0x2e')]);_0x3779ab[_0x4c33('0x2f')]=_['intersection'](_0x3779ab['model'],_0x3779ab[_0x4c33('0x2e')]);_0x1aadb7[_0x4c33('0x31')]=_[_0x4c33('0x30')](_0x3779ab[_0x4c33('0x2b')],qs[_0x4c33('0x32')](_0x3ef3ce[_0x4c33('0x2e')]['fields']));_0x1aadb7[_0x4c33('0x31')]=_0x1aadb7[_0x4c33('0x31')][_0x4c33('0x4a')]?_0x1aadb7[_0x4c33('0x31')]:_0x3779ab['model'];_0x1aadb7['order']=qs[_0x4c33('0x36')](_0x3ef3ce[_0x4c33('0x2e')]['sort']);_0x1aadb7[_0x4c33('0x37')]=qs['filters'](_[_0x4c33('0x4b')](_0x3ef3ce[_0x4c33('0x2e')],_0x3779ab[_0x4c33('0x2f')]));if(_0x3ef3ce[_0x4c33('0x2e')]['filter']){_0x1aadb7[_0x4c33('0x37')]=_[_0x4c33('0x38')](_0x1aadb7[_0x4c33('0x37')],{'$or':_[_0x4c33('0x2c')](_0x1aadb7[_0x4c33('0x31')],function(_0x58e14c){var _0x39485c={};_0x39485c[_0x58e14c]={'$like':'%'+_0x3ef3ce[_0x4c33('0x2e')]['filter']+'%'};return _0x39485c;})});}_0x1aadb7=_[_0x4c33('0x38')]({},_0x1aadb7,_0x3ef3ce[_0x4c33('0x3a')]);return _0xe91b9f[_0x4c33('0x4e')](_0x1aadb7);}})[_0x4c33('0x24')](function(_0x373244){if(_0x373244){_0xdf903a=_0x373244[_0x4c33('0x4a')];if(!_0x3ef3ce['query']['hasOwnProperty']('nolimit')){_0x1aadb7[_0x4c33('0x35')]=qs[_0x4c33('0x35')](_0x3ef3ce['query'][_0x4c33('0x35')]);_0x1aadb7[_0x4c33('0x1c')]=qs[_0x4c33('0x1c')](_0x3ef3ce[_0x4c33('0x2e')][_0x4c33('0x1c')]);}return _0xe91b9f[_0x4c33('0x4e')](_0x1aadb7);}})[_0x4c33('0x24')](function(_0x51a791){if(_0x51a791){return _0x51a791?{'count':_0xdf903a,'rows':_0x51a791}:null;}})[_0x4c33('0x24')](respondWithResult(_0x189f2f,null))[_0x4c33('0x45')](handleError(_0x189f2f,null));}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 28a3e46..7274843 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 _0x0353=['path','rimraf','./intSugarcrmConfiguration.attributes','SugarcrmConfiguration','int_sugarcrm_configurations','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x54fbdb,_0x2043bf){var _0x4aebf2=function(_0x2eba9e){while(--_0x2eba9e){_0x54fbdb['push'](_0x54fbdb['shift']());}};_0x4aebf2(++_0x2043bf);}(_0x0353,0xd6));var _0x3035=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x0353[_0x334841];return _0x5beb4b;};'use strict';var _=require('lodash');var util=require(_0x3035('0x0'));var logger=require(_0x3035('0x1'))(_0x3035('0x2'));var moment=require(_0x3035('0x3'));var BPromise=require(_0x3035('0x4'));var rp=require(_0x3035('0x5'));var fs=require('fs');var path=require(_0x3035('0x6'));var rimraf=require(_0x3035('0x7'));var config=require('../../config/environment');var attributes=require(_0x3035('0x8'));module['exports']=function(_0x1ac979,_0x326a0d){return _0x1ac979['define'](_0x3035('0x9'),attributes,{'tableName':_0x3035('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index d5448cd..53bda94 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 _0x46a6=['../../config/utils','../../config/logger','rpc','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x50bc62,_0x4c1800){var _0x3c11c4=function(_0x59bfd9){while(--_0x59bfd9){_0x50bc62['push'](_0x50bc62['shift']());}};_0x3c11c4(++_0x4c1800);}(_0x46a6,0x69));var _0x646a=function(_0xdad237,_0x361a1d){_0xdad237=_0xdad237-0x0;var _0x15c575=_0x46a6[_0xdad237];return _0x15c575;};'use strict';var _=require(_0x646a('0x0'));var util=require(_0x646a('0x1'));var moment=require('moment');var BPromise=require(_0x646a('0x2'));var rs=require(_0x646a('0x3'));var fs=require('fs');var Redis=require(_0x646a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x646a('0x5'));var logger=require(_0x646a('0x6'))(_0x646a('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x646a('0x8')][_0x646a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ddcd9,_0x9bfe9a,_0x2973d9){return new BPromise(function(_0x7f486d,_0x2c702a){return client[_0x646a('0xa')](_0x5ddcd9,_0x2973d9)[_0x646a('0xb')](function(_0x11df64){logger[_0x646a('0xc')](_0x646a('0xd'),_0x9bfe9a,'request\x20sent');logger[_0x646a('0xe')](_0x646a('0xf'),_0x9bfe9a,_0x646a('0x10'),JSON[_0x646a('0x11')](_0x11df64));if(_0x11df64[_0x646a('0x12')]){if(_0x11df64[_0x646a('0x12')]['code']===0x1f4){logger['error'](_0x646a('0xd'),_0x9bfe9a,_0x11df64[_0x646a('0x12')]['message']);return _0x2c702a(_0x11df64[_0x646a('0x12')][_0x646a('0x13')]);}logger[_0x646a('0x12')](_0x646a('0xd'),_0x9bfe9a,_0x11df64[_0x646a('0x12')][_0x646a('0x13')]);return _0x7f486d(_0x11df64[_0x646a('0x12')][_0x646a('0x13')]);}else{logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x9bfe9a,_0x646a('0x10'));_0x7f486d(_0x11df64[_0x646a('0x14')]['message']);}})[_0x646a('0x15')](function(_0xbb000b){logger[_0x646a('0x12')](_0x646a('0xd'),_0x9bfe9a,_0xbb000b);_0x2c702a(_0xbb000b);});});} \ No newline at end of file +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 diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 8859566..68b12b0 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 _0x739d=['put','delete','/:id','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0x739d,0x161));var _0xd739=function(_0x4f5633,_0x3ba792){_0x4f5633=_0x4f5633-0x0;var _0x1139d3=_0x739d[_0x4f5633];return _0x1139d3;};'use strict';var multer=require(_0xd739('0x0'));var util=require(_0xd739('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd739('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd739('0x3'));var interaction=require(_0xd739('0x4'));var config=require(_0xd739('0x5'));var controller=require('./intSugarcrmField.controller');router[_0xd739('0x6')]('/',auth['isAuthenticated'](),controller[_0xd739('0x7')]);router[_0xd739('0x6')]('/:id',auth[_0xd739('0x8')](),controller[_0xd739('0x9')]);router[_0xd739('0xa')]('/',auth[_0xd739('0x8')](),controller['create']);router[_0xd739('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd739('0xc')](_0xd739('0xd'),auth[_0xd739('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 1fb3fab..fd48b29 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 _0x6280=['sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING','BOOLEAN'];(function(_0x29344b,_0x1b23b0){var _0xadedf6=function(_0x1fb174){while(--_0x1fb174){_0x29344b['push'](_0x29344b['shift']());}};_0xadedf6(++_0x1b23b0);}(_0x6280,0x14d));var _0x0628=function(_0x4dfca3,_0x47a241){_0x4dfca3=_0x4dfca3-0x0;var _0x592213=_0x6280[_0x4dfca3];return _0x592213;};'use strict';var Sequelize=require(_0x0628('0x0'));module[_0x0628('0x1')]={'type':{'type':Sequelize[_0x0628('0x2')]('string',_0x0628('0x3'),_0x0628('0x4'),'keyValue',_0x0628('0x5')),'defaultValue':_0x0628('0x6')},'content':{'type':Sequelize[_0x0628('0x7')]},'key':{'type':Sequelize[_0x0628('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x0628('0x6'),_0x0628('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x0628('0x7')]},'idField':{'type':Sequelize[_0x0628('0x7')]},'nameField':{'type':Sequelize[_0x0628('0x7')]},'customField':{'type':Sequelize[_0x0628('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0628('0x7')]}}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 205a38b..2c80917 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 _0x8b7f=['ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','undefined','limit','count','offset','json','apply','reject','update','then','end','error','name','send','index','map','SugarcrmField','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x54efe7,_0x1f58bd){var _0x401930=function(_0x1cb9d5){while(--_0x1cb9d5){_0x54efe7['push'](_0x54efe7['shift']());}};_0x401930(++_0x1f58bd);}(_0x8b7f,0x11e));var _0xf8b7=function(_0x51e86f,_0x5960bf){_0x51e86f=_0x51e86f-0x0;var _0x1390af=_0x8b7f[_0x51e86f];return _0x1390af;};'use strict';var emlformat=require(_0xf8b7('0x0'));var rimraf=require(_0xf8b7('0x1'));var zipdir=require(_0xf8b7('0x2'));var jsonpatch=require(_0xf8b7('0x3'));var rp=require(_0xf8b7('0x4'));var moment=require(_0xf8b7('0x5'));var BPromise=require(_0xf8b7('0x6'));var Mustache=require('mustache');var util=require(_0xf8b7('0x7'));var path=require('path');var sox=require(_0xf8b7('0x8'));var csv=require(_0xf8b7('0x9'));var ejs=require(_0xf8b7('0xa'));var fs=require('fs');var fs_extra=require(_0xf8b7('0xb'));var _=require('lodash');var squel=require(_0xf8b7('0xc'));var crypto=require(_0xf8b7('0xd'));var jsforce=require(_0xf8b7('0xe'));var deskjs=require(_0xf8b7('0xf'));var toCsv=require(_0xf8b7('0x9'));var querystring=require(_0xf8b7('0x10'));var Papa=require('papaparse');var Redis=require(_0xf8b7('0x11'));var authService=require(_0xf8b7('0x12'));var qs=require(_0xf8b7('0x13'));var as=require(_0xf8b7('0x14'));var hardwareService=require(_0xf8b7('0x15'));var logger=require(_0xf8b7('0x16'))(_0xf8b7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf8b7('0x18'))['db'];function respondWithStatusCode(_0x5731fb,_0x4d37aa){_0x4d37aa=_0x4d37aa||0xcc;return function(_0x508739){if(_0x508739){return _0x5731fb[_0xf8b7('0x19')](_0x4d37aa);}return _0x5731fb[_0xf8b7('0x1a')](_0x4d37aa)['end']();};}function respondWithResult(_0x19adcd,_0x323b46){_0x323b46=_0x323b46||0xc8;return function(_0x2966a4){if(_0x2966a4){return _0x19adcd[_0xf8b7('0x1a')](_0x323b46)['json'](_0x2966a4);}};}function respondWithFilteredResult(_0x50261d,_0x2d0302){return function(_0x11315d){if(_0x11315d){var _0x5c30d6=typeof _0x2d0302['offset']===_0xf8b7('0x1b')&&typeof _0x2d0302[_0xf8b7('0x1c')]===_0xf8b7('0x1b');var _0x356d4b=_0x11315d[_0xf8b7('0x1d')];var _0x13ffb6=_0x5c30d6?0x0:_0x2d0302[_0xf8b7('0x1e')];var _0xf717f7=_0x5c30d6?_0x11315d['count']:_0x2d0302[_0xf8b7('0x1e')]+_0x2d0302[_0xf8b7('0x1c')];var _0x52fca7;if(_0xf717f7>=_0x356d4b){_0xf717f7=_0x356d4b;_0x52fca7=0xc8;}else{_0x52fca7=0xce;}_0x50261d[_0xf8b7('0x1a')](_0x52fca7);return _0x50261d['set']('Content-Range',_0x13ffb6+'-'+_0xf717f7+'/'+_0x356d4b)[_0xf8b7('0x1f')](_0x11315d);}return null;};}function patchUpdates(_0x302a03){return function(_0x24c053){try{jsonpatch[_0xf8b7('0x20')](_0x24c053,_0x302a03,!![]);}catch(_0x516a14){return BPromise[_0xf8b7('0x21')](_0x516a14);}return _0x24c053['save']();};}function saveUpdates(_0x1c8b49,_0xd386aa){return function(_0x1a8116){if(_0x1a8116){return _0x1a8116[_0xf8b7('0x22')](_0x1c8b49)[_0xf8b7('0x23')](function(_0x4f7d85){return _0x4f7d85;});}return null;};}function removeEntity(_0x88a12,_0x6c95ef){return function(_0x2b8b00){if(_0x2b8b00){return _0x2b8b00['destroy']()[_0xf8b7('0x23')](function(){_0x88a12[_0xf8b7('0x1a')](0xcc)[_0xf8b7('0x24')]();});}};}function handleEntityNotFound(_0xba39d0,_0x4fd901){return function(_0x9f33fc){if(!_0x9f33fc){_0xba39d0[_0xf8b7('0x19')](0x194);}return _0x9f33fc;};}function handleError(_0x326949,_0x31b27f){_0x31b27f=_0x31b27f||0x1f4;return function(_0x4c0522){logger[_0xf8b7('0x25')](_0x4c0522['stack']);if(_0x4c0522[_0xf8b7('0x26')]){delete _0x4c0522[_0xf8b7('0x26')];}_0x326949[_0xf8b7('0x1a')](_0x31b27f)[_0xf8b7('0x27')](_0x4c0522);};}exports[_0xf8b7('0x28')]=function(_0xed1379,_0x1f6508){var _0x1596aa={},_0xcd7f7d={},_0x5d3232={'count':0x0,'rows':[]};var _0x7f0709=_[_0xf8b7('0x29')](db[_0xf8b7('0x2a')][_0xf8b7('0x2b')],function(_0x3a4e18){return{'name':_0x3a4e18[_0xf8b7('0x2c')],'type':_0x3a4e18['type'][_0xf8b7('0x2d')]};});_0xcd7f7d['model']=_[_0xf8b7('0x29')](_0x7f0709,_0xf8b7('0x26'));_0xcd7f7d[_0xf8b7('0x2e')]=_[_0xf8b7('0x2f')](_0xed1379[_0xf8b7('0x2e')]);_0xcd7f7d[_0xf8b7('0x30')]=_[_0xf8b7('0x31')](_0xcd7f7d[_0xf8b7('0x32')],_0xcd7f7d['query']);_0x1596aa[_0xf8b7('0x33')]=_[_0xf8b7('0x31')](_0xcd7f7d[_0xf8b7('0x32')],qs[_0xf8b7('0x34')](_0xed1379['query']['fields']));_0x1596aa[_0xf8b7('0x33')]=_0x1596aa[_0xf8b7('0x33')][_0xf8b7('0x35')]?_0x1596aa[_0xf8b7('0x33')]:_0xcd7f7d[_0xf8b7('0x32')];if(!_0xed1379['query'][_0xf8b7('0x36')](_0xf8b7('0x37'))){_0x1596aa[_0xf8b7('0x1c')]=qs[_0xf8b7('0x1c')](_0xed1379[_0xf8b7('0x2e')][_0xf8b7('0x1c')]);_0x1596aa[_0xf8b7('0x1e')]=qs[_0xf8b7('0x1e')](_0xed1379['query'][_0xf8b7('0x1e')]);}_0x1596aa['order']=qs[_0xf8b7('0x38')](_0xed1379[_0xf8b7('0x2e')][_0xf8b7('0x38')]);_0x1596aa['where']=qs[_0xf8b7('0x30')](_[_0xf8b7('0x39')](_0xed1379[_0xf8b7('0x2e')],_0xcd7f7d[_0xf8b7('0x30')]),_0x7f0709);if(_0xed1379[_0xf8b7('0x2e')]['filter']){_0x1596aa[_0xf8b7('0x3a')]=_[_0xf8b7('0x3b')](_0x1596aa[_0xf8b7('0x3a')],{'$or':_['map'](_0x7f0709,function(_0x521d8c){if(_0x521d8c[_0xf8b7('0x3c')]!=='VIRTUAL'){var _0x4914b0={};_0x4914b0[_0x521d8c['name']]={'$like':'%'+_0xed1379['query'][_0xf8b7('0x3d')]+'%'};return _0x4914b0;}})});}_0x1596aa=_[_0xf8b7('0x3b')]({},_0x1596aa,_0xed1379['options']);var _0x30bb79={'where':_0x1596aa[_0xf8b7('0x3a')]};return db[_0xf8b7('0x2a')][_0xf8b7('0x1d')](_0x30bb79)[_0xf8b7('0x23')](function(_0x3c7d22){_0x5d3232[_0xf8b7('0x1d')]=_0x3c7d22;if(_0xed1379[_0xf8b7('0x2e')][_0xf8b7('0x3e')]){_0x1596aa[_0xf8b7('0x3f')]=[{'all':!![]}];}return db[_0xf8b7('0x2a')][_0xf8b7('0x40')](_0x1596aa);})['then'](function(_0x256426){_0x5d3232[_0xf8b7('0x41')]=_0x256426;return _0x5d3232;})[_0xf8b7('0x23')](respondWithFilteredResult(_0x1f6508,_0x1596aa))[_0xf8b7('0x42')](handleError(_0x1f6508,null));};exports[_0xf8b7('0x43')]=function(_0x333884,_0x518d4a){var _0x345ebf={'raw':!![],'where':{'id':_0x333884[_0xf8b7('0x44')]['id']}},_0x22870e={};_0x22870e[_0xf8b7('0x32')]=_[_0xf8b7('0x2f')](db[_0xf8b7('0x2a')][_0xf8b7('0x2b')]);_0x22870e[_0xf8b7('0x2e')]=_[_0xf8b7('0x2f')](_0x333884[_0xf8b7('0x2e')]);_0x22870e[_0xf8b7('0x30')]=_[_0xf8b7('0x31')](_0x22870e['model'],_0x22870e['query']);_0x345ebf[_0xf8b7('0x33')]=_[_0xf8b7('0x31')](_0x22870e[_0xf8b7('0x32')],qs['fields'](_0x333884[_0xf8b7('0x2e')]['fields']));_0x345ebf[_0xf8b7('0x33')]=_0x345ebf['attributes'][_0xf8b7('0x35')]?_0x345ebf['attributes']:_0x22870e[_0xf8b7('0x32')];if(_0x333884[_0xf8b7('0x2e')][_0xf8b7('0x3e')]){_0x345ebf[_0xf8b7('0x3f')]=[{'all':!![]}];}_0x345ebf=_['merge']({},_0x345ebf,_0x333884[_0xf8b7('0x45')]);return db['SugarcrmField']['find'](_0x345ebf)['then'](handleEntityNotFound(_0x518d4a,null))[_0xf8b7('0x23')](respondWithResult(_0x518d4a,null))[_0xf8b7('0x42')](handleError(_0x518d4a,null));};exports[_0xf8b7('0x46')]=function(_0x268588,_0x14254e){return db[_0xf8b7('0x2a')][_0xf8b7('0x46')](_0x268588[_0xf8b7('0x47')],{})[_0xf8b7('0x23')](respondWithResult(_0x14254e,0xc9))['catch'](handleError(_0x14254e,null));};exports['update']=function(_0x941b96,_0x540391){if(_0x941b96[_0xf8b7('0x47')]['id']){delete _0x941b96[_0xf8b7('0x47')]['id'];}return db[_0xf8b7('0x2a')][_0xf8b7('0x48')]({'where':{'id':_0x941b96[_0xf8b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x540391,null))['then'](saveUpdates(_0x941b96['body'],null))[_0xf8b7('0x23')](respondWithResult(_0x540391,null))[_0xf8b7('0x42')](handleError(_0x540391,null));};exports[_0xf8b7('0x49')]=function(_0x254f81,_0x3c03cb){return db[_0xf8b7('0x2a')][_0xf8b7('0x48')]({'where':{'id':_0x254f81[_0xf8b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c03cb,null))[_0xf8b7('0x23')](removeEntity(_0x3c03cb,null))['catch'](handleError(_0x3c03cb,null));}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 4405a2b..78676fc 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 _0xba54=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','SugarcrmField','sugarcrm_unique_index','idField','FieldId','lodash'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xba54,0x187));var _0x4ba5=function(_0x1bd7a1,_0x3f00b3){_0x1bd7a1=_0x1bd7a1-0x0;var _0x16f003=_0xba54[_0x1bd7a1];return _0x16f003;};'use strict';var _=require(_0x4ba5('0x0'));var util=require(_0x4ba5('0x1'));var logger=require(_0x4ba5('0x2'))(_0x4ba5('0x3'));var moment=require(_0x4ba5('0x4'));var BPromise=require(_0x4ba5('0x5'));var rp=require(_0x4ba5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba5('0x7'));var config=require(_0x4ba5('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x4ba5('0x9')]=function(_0x5deef6,_0x4d9404){return _0x5deef6['define'](_0x4ba5('0xa'),attributes,{'tableName':'int_sugarcrm_fields','paranoid':![],'indexes':[{'name':_0x4ba5('0xb'),'fields':[_0x4ba5('0xc'),_0x4ba5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index c2b3fbe..8cf66e9 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 _0x4383=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x4687f1,_0x732fe6){var _0x3f0f15=function(_0x14839d){while(--_0x14839d){_0x4687f1['push'](_0x4687f1['shift']());}};_0x3f0f15(++_0x732fe6);}(_0x4383,0x1da));var _0x3438=function(_0x4f8d28,_0x1a3969){_0x4f8d28=_0x4f8d28-0x0;var _0x39e8aa=_0x4383[_0x4f8d28];return _0x39e8aa;};'use strict';var _=require(_0x3438('0x0'));var util=require(_0x3438('0x1'));var moment=require(_0x3438('0x2'));var BPromise=require(_0x3438('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3438('0x4'));var db=require(_0x3438('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3438('0x6'))(_0x3438('0x7'));var config=require('../../config/environment');var jayson=require(_0x3438('0x8'));var client=jayson['client'][_0x3438('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21108d,_0x1147e3,_0x350e67){return new BPromise(function(_0x50479d,_0xe11395){return client[_0x3438('0xa')](_0x21108d,_0x350e67)[_0x3438('0xb')](function(_0x55e647){logger[_0x3438('0xc')](_0x3438('0xd'),_0x1147e3,_0x3438('0xe'));logger[_0x3438('0xf')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1147e3,_0x3438('0xe'),JSON[_0x3438('0x10')](_0x55e647));if(_0x55e647[_0x3438('0x11')]){if(_0x55e647[_0x3438('0x11')][_0x3438('0x12')]===0x1f4){logger[_0x3438('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1147e3,_0x55e647['error'][_0x3438('0x13')]);return _0xe11395(_0x55e647[_0x3438('0x11')][_0x3438('0x13')]);}logger[_0x3438('0x11')](_0x3438('0xd'),_0x1147e3,_0x55e647['error'][_0x3438('0x13')]);return _0x50479d(_0x55e647[_0x3438('0x11')]['message']);}else{logger[_0x3438('0xc')](_0x3438('0xd'),_0x1147e3,_0x3438('0xe'));_0x50479d(_0x55e647[_0x3438('0x14')]['message']);}})[_0x3438('0x15')](function(_0x1c38a8){logger[_0x3438('0x11')](_0x3438('0xd'),_0x1147e3,_0x1c38a8);_0xe11395(_0x1c38a8);});});} \ No newline at end of file +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 diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index f82a40e..eebfb64 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 _0xa348=['show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','destroy','exports','multer','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x5b844e,_0x4cda8b){var _0x29f228=function(_0x258630){while(--_0x258630){_0x5b844e['push'](_0x5b844e['shift']());}};_0x29f228(++_0x4cda8b);}(_0xa348,0xb2));var _0x8a34=function(_0x3d0d67,_0x500387){_0x3d0d67=_0x3d0d67-0x0;var _0x3a33b0=_0xa348[_0x3d0d67];return _0x3a33b0;};'use strict';var multer=require(_0x8a34('0x0'));var util=require('util');var path=require(_0x8a34('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8a34('0x2'));var auth=require(_0x8a34('0x3'));var interaction=require(_0x8a34('0x4'));var config=require(_0x8a34('0x5'));var controller=require(_0x8a34('0x6'));router[_0x8a34('0x7')]('/',auth[_0x8a34('0x8')](),controller[_0x8a34('0x9')]);router[_0x8a34('0x7')](_0x8a34('0xa'),auth['isAuthenticated'](),controller[_0x8a34('0xb')]);router[_0x8a34('0x7')](_0x8a34('0xc'),auth[_0x8a34('0x8')](),controller['getConfigurations']);router[_0x8a34('0x7')](_0x8a34('0xd'),auth['isAuthenticated'](),controller[_0x8a34('0xe')]);router[_0x8a34('0xf')]('/',auth[_0x8a34('0x8')](),controller[_0x8a34('0x10')]);router[_0x8a34('0xf')](_0x8a34('0xc'),auth[_0x8a34('0x8')](),controller[_0x8a34('0x11')]);router['put']('/:id',auth[_0x8a34('0x8')](),controller[_0x8a34('0x12')]);router['delete'](_0x8a34('0xa'),auth[_0x8a34('0x8')](),controller[_0x8a34('0x13')]);module[_0x8a34('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 092f90a..9b0f5df 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 _0x04eb=['exports','STRING','sequelize'];(function(_0x18eeaa,_0x4380b6){var _0x23d240=function(_0x864c98){while(--_0x864c98){_0x18eeaa['push'](_0x18eeaa['shift']());}};_0x23d240(++_0x4380b6);}(_0x04eb,0x18b));var _0xb04e=function(_0x388cc5,_0x3adcf7){_0x388cc5=_0x388cc5-0x0;var _0xc9b22f=_0x04eb[_0x388cc5];return _0xc9b22f;};'use strict';var Sequelize=require(_0xb04e('0x0'));module[_0xb04e('0x1')]={'name':{'type':Sequelize[_0xb04e('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb04e('0x2')]},'username':{'type':Sequelize[_0xb04e('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xb04e('0x2')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0xb04e('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xb04e('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xb04e('0x2')],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index a1f4830..7c50ec5 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 _0x887f=['length','nolimit','order','sort','where','pick','map','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','findOne','VtigerConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','username','description','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','login','result','token','success','describe','sessionName','autogenerated','reference','owner','includes','editable','picklist','picklistValues','label','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','status','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','VtigerAccount','fieldName','type','model','keys','query','filters','intersection','fields','attributes'];(function(_0xab084b,_0x39e360){var _0xce0f53=function(_0x3fa5a1){while(--_0x3fa5a1){_0xab084b['push'](_0xab084b['shift']());}};_0xce0f53(++_0x39e360);}(_0x887f,0xb2));var _0xf887=function(_0x3be968,_0x414dee){_0x3be968=_0x3be968-0x0;var _0x1ba38d=_0x887f[_0x3be968];return _0x1ba38d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf887('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf887('0x1'));var rp=require(_0xf887('0x2'));var moment=require(_0xf887('0x3'));var BPromise=require(_0xf887('0x4'));var Mustache=require(_0xf887('0x5'));var util=require(_0xf887('0x6'));var path=require(_0xf887('0x7'));var sox=require(_0xf887('0x8'));var csv=require(_0xf887('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf887('0xa'));var _=require(_0xf887('0xb'));var squel=require(_0xf887('0xc'));var crypto=require(_0xf887('0xd'));var jsforce=require(_0xf887('0xe'));var deskjs=require(_0xf887('0xf'));var toCsv=require(_0xf887('0x9'));var querystring=require(_0xf887('0x10'));var Papa=require(_0xf887('0x11'));var Redis=require(_0xf887('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf887('0x13'));var as=require(_0xf887('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf887('0x15'))(_0xf887('0x16'));var utils=require(_0xf887('0x17'));var config=require(_0xf887('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf887('0x19'));function respondWithStatusCode(_0x3bfe24,_0x23671e){_0x23671e=_0x23671e||0xcc;return function(_0x34f5c3){if(_0x34f5c3){return _0x3bfe24['sendStatus'](_0x23671e);}return _0x3bfe24[_0xf887('0x1a')](_0x23671e)['end']();};}function respondWithResult(_0x156db5,_0x3ff9b4){_0x3ff9b4=_0x3ff9b4||0xc8;return function(_0x3297a4){if(_0x3297a4){return _0x156db5[_0xf887('0x1a')](_0x3ff9b4)[_0xf887('0x1b')](_0x3297a4);}};}function respondWithFilteredResult(_0x309dbb,_0x8636d6){return function(_0x5d5fb4){if(_0x5d5fb4){var _0x51b588=typeof _0x8636d6['offset']==='undefined'&&typeof _0x8636d6[_0xf887('0x1c')]===_0xf887('0x1d');var _0x2e9c12=_0x5d5fb4['count'];var _0xb5fe1d=_0x51b588?0x0:_0x8636d6[_0xf887('0x1e')];var _0x2263a7=_0x51b588?_0x5d5fb4[_0xf887('0x1f')]:_0x8636d6[_0xf887('0x1e')]+_0x8636d6['limit'];var _0x382dc7;if(_0x2263a7>=_0x2e9c12){_0x2263a7=_0x2e9c12;_0x382dc7=0xc8;}else{_0x382dc7=0xce;}_0x309dbb[_0xf887('0x1a')](_0x382dc7);return _0x309dbb[_0xf887('0x20')](_0xf887('0x21'),_0xb5fe1d+'-'+_0x2263a7+'/'+_0x2e9c12)['json'](_0x5d5fb4);}return null;};}function patchUpdates(_0x5bad99){return function(_0x292955){try{jsonpatch[_0xf887('0x22')](_0x292955,_0x5bad99,!![]);}catch(_0x3fa8ab){return BPromise[_0xf887('0x23')](_0x3fa8ab);}return _0x292955[_0xf887('0x24')]();};}function saveUpdates(_0x2e8562,_0x38626a){return function(_0x633a88){if(_0x633a88){return _0x633a88[_0xf887('0x25')](_0x2e8562)[_0xf887('0x26')](function(_0x32062a){return _0x32062a;});}return null;};}function removeEntity(_0x44249,_0x902fde){return function(_0x3ff3a3){if(_0x3ff3a3){return _0x3ff3a3[_0xf887('0x27')]()['then'](function(){_0x44249[_0xf887('0x1a')](0xcc)[_0xf887('0x28')]();});}};}function handleEntityNotFound(_0x4264ba,_0x229fbd){return function(_0x4a633c){if(!_0x4a633c){_0x4264ba[_0xf887('0x29')](0x194);}return _0x4a633c;};}function handleError(_0x22eedd,_0x3d006c){_0x3d006c=_0x3d006c||0x1f4;return function(_0x43d853){logger[_0xf887('0x2a')](_0x43d853['stack']);if(_0x43d853['name']){delete _0x43d853[_0xf887('0x2b')];}_0x22eedd['status'](_0x3d006c)[_0xf887('0x2c')](_0x43d853);};}exports[_0xf887('0x2d')]=function(_0x4b5c2e,_0x543cf8){var _0x18c284={},_0x2dcca9={},_0x416e5b={'count':0x0,'rows':[]};var _0x54a171=_['map'](db[_0xf887('0x2e')]['rawAttributes'],function(_0x52fea6){return{'name':_0x52fea6[_0xf887('0x2f')],'type':_0x52fea6[_0xf887('0x30')]['key']};});_0x2dcca9[_0xf887('0x31')]=_['map'](_0x54a171,_0xf887('0x2b'));_0x2dcca9['query']=_[_0xf887('0x32')](_0x4b5c2e[_0xf887('0x33')]);_0x2dcca9[_0xf887('0x34')]=_[_0xf887('0x35')](_0x2dcca9[_0xf887('0x31')],_0x2dcca9[_0xf887('0x33')]);_0x18c284['attributes']=_['intersection'](_0x2dcca9[_0xf887('0x31')],qs[_0xf887('0x36')](_0x4b5c2e['query'][_0xf887('0x36')]));_0x18c284[_0xf887('0x37')]=_0x18c284[_0xf887('0x37')][_0xf887('0x38')]?_0x18c284[_0xf887('0x37')]:_0x2dcca9[_0xf887('0x31')];if(!_0x4b5c2e['query']['hasOwnProperty'](_0xf887('0x39'))){_0x18c284[_0xf887('0x1c')]=qs[_0xf887('0x1c')](_0x4b5c2e['query']['limit']);_0x18c284[_0xf887('0x1e')]=qs['offset'](_0x4b5c2e[_0xf887('0x33')][_0xf887('0x1e')]);}_0x18c284[_0xf887('0x3a')]=qs[_0xf887('0x3b')](_0x4b5c2e['query'][_0xf887('0x3b')]);_0x18c284[_0xf887('0x3c')]=qs[_0xf887('0x34')](_[_0xf887('0x3d')](_0x4b5c2e[_0xf887('0x33')],_0x2dcca9['filters']),_0x54a171);if(_0x4b5c2e[_0xf887('0x33')]['filter']){_0x18c284['where']=_['merge'](_0x18c284['where'],{'$or':_[_0xf887('0x3e')](_0x54a171,function(_0x273862){if(_0x273862[_0xf887('0x30')]!=='VIRTUAL'){var _0x1466d6={};_0x1466d6[_0x273862[_0xf887('0x2b')]]={'$like':'%'+_0x4b5c2e[_0xf887('0x33')][_0xf887('0x3f')]+'%'};return _0x1466d6;}})});}_0x18c284=_[_0xf887('0x40')]({},_0x18c284,_0x4b5c2e[_0xf887('0x41')]);var _0x349494={'where':_0x18c284[_0xf887('0x3c')]};return db[_0xf887('0x2e')][_0xf887('0x1f')](_0x349494)[_0xf887('0x26')](function(_0x523f9e){_0x416e5b[_0xf887('0x1f')]=_0x523f9e;if(_0x4b5c2e[_0xf887('0x33')][_0xf887('0x42')]){_0x18c284[_0xf887('0x43')]=[{'all':!![]}];}return db[_0xf887('0x2e')][_0xf887('0x44')](_0x18c284);})[_0xf887('0x26')](function(_0x350561){_0x416e5b[_0xf887('0x45')]=_0x350561;return _0x416e5b;})[_0xf887('0x26')](respondWithFilteredResult(_0x543cf8,_0x18c284))[_0xf887('0x46')](handleError(_0x543cf8,null));};exports['show']=function(_0x44c9af,_0x5ed880){var _0xfb19ac={'raw':![],'where':{'id':_0x44c9af[_0xf887('0x47')]['id']}},_0x348739={};_0x348739[_0xf887('0x31')]=_[_0xf887('0x32')](db['VtigerAccount'][_0xf887('0x48')]);_0x348739['query']=_[_0xf887('0x32')](_0x44c9af[_0xf887('0x33')]);_0x348739[_0xf887('0x34')]=_[_0xf887('0x35')](_0x348739[_0xf887('0x31')],_0x348739[_0xf887('0x33')]);_0xfb19ac[_0xf887('0x37')]=_[_0xf887('0x35')](_0x348739[_0xf887('0x31')],qs[_0xf887('0x36')](_0x44c9af[_0xf887('0x33')][_0xf887('0x36')]));_0xfb19ac[_0xf887('0x37')]=_0xfb19ac[_0xf887('0x37')][_0xf887('0x38')]?_0xfb19ac[_0xf887('0x37')]:_0x348739['model'];if(_0x44c9af['query'][_0xf887('0x42')]){_0xfb19ac[_0xf887('0x43')]=[{'all':!![]}];}_0xfb19ac=_[_0xf887('0x40')]({},_0xfb19ac,_0x44c9af[_0xf887('0x41')]);return db[_0xf887('0x2e')][_0xf887('0x49')](_0xfb19ac)[_0xf887('0x26')](handleEntityNotFound(_0x5ed880,null))[_0xf887('0x26')](respondWithResult(_0x5ed880,null))[_0xf887('0x46')](handleError(_0x5ed880,null));};exports[_0xf887('0x4a')]=function(_0x1084a8,_0x18382b){return db[_0xf887('0x2e')][_0xf887('0x4a')](_0x1084a8[_0xf887('0x4b')],{})['then'](respondWithResult(_0x18382b,0xc9))[_0xf887('0x46')](handleError(_0x18382b,null));};exports[_0xf887('0x25')]=function(_0x23f0ff,_0x243ab7){if(_0x23f0ff['body']['id']){delete _0x23f0ff['body']['id'];}return db[_0xf887('0x2e')][_0xf887('0x49')]({'where':{'id':_0x23f0ff[_0xf887('0x47')]['id']}})['then'](handleEntityNotFound(_0x243ab7,null))[_0xf887('0x26')](saveUpdates(_0x23f0ff[_0xf887('0x4b')],null))[_0xf887('0x26')](respondWithResult(_0x243ab7,null))[_0xf887('0x46')](handleError(_0x243ab7,null));};exports['destroy']=function(_0x2544a3,_0x373973){return db[_0xf887('0x2e')]['find']({'where':{'id':_0x2544a3[_0xf887('0x47')]['id']}})[_0xf887('0x26')](handleEntityNotFound(_0x373973,null))[_0xf887('0x26')](removeEntity(_0x373973,null))[_0xf887('0x46')](handleError(_0x373973,null));};exports['getConfigurations']=function(_0xc53407,_0xc56c18,_0x4fac53){var _0x112166={};var _0x1efeb2={};var _0x454431;var _0x1c6864;return db[_0xf887('0x2e')][_0xf887('0x4c')]({'where':{'id':_0xc53407[_0xf887('0x47')]['id']}})[_0xf887('0x26')](handleEntityNotFound(_0xc56c18,null))[_0xf887('0x26')](function(_0x18f7ed){if(_0x18f7ed){_0x454431=_0x18f7ed;_0x1efeb2[_0xf887('0x31')]=_[_0xf887('0x32')](db[_0xf887('0x4d')]['rawAttributes']);_0x1efeb2[_0xf887('0x33')]=_[_0xf887('0x32')](_0xc53407['query']);_0x1efeb2[_0xf887('0x34')]=_[_0xf887('0x35')](_0x1efeb2['model'],_0x1efeb2[_0xf887('0x33')]);_0x112166[_0xf887('0x37')]=_[_0xf887('0x35')](_0x1efeb2[_0xf887('0x31')],qs[_0xf887('0x36')](_0xc53407[_0xf887('0x33')][_0xf887('0x36')]));_0x112166['attributes']=_0x112166[_0xf887('0x37')][_0xf887('0x38')]?_0x112166[_0xf887('0x37')]:_0x1efeb2[_0xf887('0x31')];_0x112166[_0xf887('0x3a')]=qs[_0xf887('0x3b')](_0xc53407['query'][_0xf887('0x3b')]);_0x112166[_0xf887('0x3c')]=qs[_0xf887('0x34')](_[_0xf887('0x3d')](_0xc53407['query'],_0x1efeb2['filters']));if(_0xc53407[_0xf887('0x33')][_0xf887('0x3f')]){_0x112166['where']=_[_0xf887('0x40')](_0x112166['where'],{'$or':_['map'](_0x112166[_0xf887('0x37')],function(_0x434177){var _0x2dbcf2={};_0x2dbcf2[_0x434177]={'$like':'%'+_0xc53407[_0xf887('0x33')][_0xf887('0x3f')]+'%'};return _0x2dbcf2;})});}_0x112166=_[_0xf887('0x40')]({},_0x112166,_0xc53407['options']);return _0x454431[_0xf887('0x4e')](_0x112166);}})[_0xf887('0x26')](function(_0x354f3b){if(_0x354f3b){_0x1c6864=_0x354f3b[_0xf887('0x38')];if(!_0xc53407[_0xf887('0x33')][_0xf887('0x4f')]('nolimit')){_0x112166[_0xf887('0x1c')]=qs[_0xf887('0x1c')](_0xc53407[_0xf887('0x33')][_0xf887('0x1c')]);_0x112166['offset']=qs[_0xf887('0x1e')](_0xc53407[_0xf887('0x33')]['offset']);}return _0x454431[_0xf887('0x4e')](_0x112166);}})[_0xf887('0x26')](function(_0x1543bd){if(_0x1543bd){return _0x1543bd?{'count':_0x1c6864,'rows':_0x1543bd}:null;}})['then'](respondWithResult(_0xc56c18,null))[_0xf887('0x46')](handleError(_0xc56c18,null));};exports[_0xf887('0x50')]=function(_0x409ecf,_0x42e026,_0x5329fd){if(_0x409ecf[_0xf887('0x4b')]['id']){delete _0x409ecf[_0xf887('0x4b')]['id'];}return db[_0xf887('0x2e')]['findOne']({'where':{'id':_0x409ecf[_0xf887('0x47')]['id']}})[_0xf887('0x26')](handleEntityNotFound(_0x42e026,null))[_0xf887('0x26')](function(_0x4b9b4a){if(_0x4b9b4a){_0x409ecf[_0xf887('0x4b')][_0xf887('0x51')]=_0x4b9b4a['id'];_0x409ecf[_0xf887('0x4b')][_0xf887('0x52')]=integrations[_0xf887('0x53')](_0x409ecf['body'][_0xf887('0x54')],_0x409ecf[_0xf887('0x4b')]['type']);_0x409ecf[_0xf887('0x4b')]['Descriptions']=integrations[_0xf887('0x55')](_0x409ecf[_0xf887('0x4b')][_0xf887('0x54')],_0x409ecf[_0xf887('0x4b')][_0xf887('0x30')]);return db['VtigerConfiguration'][_0xf887('0x4a')](_0x409ecf[_0xf887('0x4b')],{'include':[{'model':db['VtigerField'],'as':_0xf887('0x52')},{'model':db[_0xf887('0x56')],'as':'Descriptions'}]});}return null;})[_0xf887('0x26')](respondWithResult(_0x42e026,null))[_0xf887('0x46')](handleError(_0x42e026,null));};var md5=require(_0xf887('0x57'));exports['getFields']=function(_0x441d0a,_0x5de4f4,_0x4df4d1){var _0x2c4d6c=null;var _0x372bfe=null;var _0x451fe7=null;var _0x4101d3=null;var _0x2a7c45='';return db[_0xf887('0x2e')][_0xf887('0x4c')]({'where':{'id':_0x441d0a[_0xf887('0x47')]['id']},'attributes':['id',_0xf887('0x2b'),_0xf887('0x58'),_0xf887('0x59'),_0xf887('0x5a'),_0xf887('0x5b'),'serverUrl',_0xf887('0x5c')]})[_0xf887('0x26')](handleEntityNotFound(_0x5de4f4,null))['then'](function(_0x5b9c54){if(_0x5b9c54){_0x2c4d6c=_0x5b9c54['username'];_0x372bfe=_0x5b9c54[_0xf887('0x5c')];_0x451fe7=_0x5b9c54['moduleName'];_0x2a7c45=_0x5b9c54[_0xf887('0x5b')];var _0x5a0ef5=_0x2a7c45[_0xf887('0x5d')](-0x1);if(_0x5a0ef5==='/'){_0x2a7c45=_0x2a7c45[_0xf887('0x5e')](0x0,_0x2a7c45[_0xf887('0x5f')](_0x5a0ef5));}_0x4101d3=util[_0xf887('0x60')](_0xf887('0x61'),_0x2a7c45);var _0x261a86={'method':_0xf887('0x62'),'uri':_0x4101d3,'qs':{'operation':'getchallenge','username':_0x5b9c54[_0xf887('0x58')]},'json':!![]};return rp(_0x261a86);}})[_0xf887('0x26')](function(_0x33e08e){if(_0x33e08e['success']){var _0x3af413={'method':'POST','uri':_0x4101d3,'form':{'operation':_0xf887('0x63'),'username':_0x2c4d6c,'accessKey':md5(_0x33e08e[_0xf887('0x64')][_0xf887('0x65')]+_0x372bfe)},'json':!![]};return rp(_0x3af413);}})[_0xf887('0x26')](function(_0x21335f){if(_0x21335f[_0xf887('0x66')]){var _0xf68d68={'method':_0xf887('0x62'),'uri':_0x4101d3,'qs':{'operation':_0xf887('0x67'),'username':_0x2c4d6c,'sessionName':_0x21335f[_0xf887('0x64')][_0xf887('0x68')],'elementType':_0x451fe7},'json':!![]};return rp(_0xf68d68);}})[_0xf887('0x26')](function(_0x4c4c3b){if(_0x4c4c3b[_0xf887('0x66')]){var _0x2b9a7f=[_0xf887('0x69'),_0xf887('0x6a'),_0xf887('0x6b')];_['remove'](_0x4c4c3b[_0xf887('0x64')]['fields'],function(_0x5442e1){return _0x2b9a7f[_0xf887('0x6c')](_0x5442e1[_0xf887('0x30')]['name']);});_['remove'](_0x4c4c3b[_0xf887('0x64')][_0xf887('0x36')],function(_0x4911){return _0x4911[_0xf887('0x6d')]==='false';});return{'count':_0x4c4c3b[_0xf887('0x64')]['fields']['length'],'rows':_[_0xf887('0x3e')](_0x4c4c3b['result']['fields'],function(_0x4b0322){return{'id':_0x4b0322['name'],'name':_0x4b0322['label'],'custom':_['startsWith'](_0x4b0322['name'],'cf_')?!![]:![],'options':_0x4b0322[_0xf887('0x30')][_0xf887('0x2b')]===_0xf887('0x6e')&&_0x4b0322[_0xf887('0x30')][_0xf887('0x6f')][_0xf887('0x38')]>0x0?_[_0xf887('0x3e')](_0x4b0322[_0xf887('0x30')][_0xf887('0x6f')],function(_0x5946ec){return{'name':_0x5946ec[_0xf887('0x70')],'value':_0x5946ec[_0xf887('0x71')]};}):[]};})};}})[_0xf887('0x26')](respondWithResult(_0x5de4f4,null))[_0xf887('0x46')](function(_0x266fc4){console['log']('vTiger\x20error:\x20'+_0x266fc4);var _0x1844a4=_0x441d0a['query'][_0xf887('0x72')]?0x1f4:_0x266fc4[_0xf887('0x73')]||0x1f4;logger[_0xf887('0x2a')](_0xf887('0x74'),'getFields',_0x1844a4,JSON['stringify'](_0x266fc4));delete _0x266fc4[_0xf887('0x2b')];if(_0x1844a4===0x191){_0x1844a4=0x190;}_0x5de4f4[_0xf887('0x1a')](_0x1844a4)['send'](_0x441d0a[_0xf887('0x33')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x266fc4[_0xf887('0x73')]}:_0x266fc4);});}; \ No newline at end of file +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 diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 1c28f1c..19ed860 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 _0xd5c6=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','util','../../config/logger','moment','bluebird'];(function(_0x4695ba,_0x5a7f2a){var _0x524b7d=function(_0xfc9707){while(--_0xfc9707){_0x4695ba['push'](_0x4695ba['shift']());}};_0x524b7d(++_0x5a7f2a);}(_0xd5c6,0xb2));var _0x6d5c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xd5c6[_0x21a9d9];return _0x46adce;};'use strict';var _=require('lodash');var util=require(_0x6d5c('0x0'));var logger=require(_0x6d5c('0x1'))('api');var moment=require(_0x6d5c('0x2'));var BPromise=require(_0x6d5c('0x3'));var rp=require(_0x6d5c('0x4'));var fs=require('fs');var path=require(_0x6d5c('0x5'));var rimraf=require(_0x6d5c('0x6'));var config=require(_0x6d5c('0x7'));var attributes=require(_0x6d5c('0x8'));var integrations=require(_0x6d5c('0x9'));module[_0x6d5c('0xa')]=function(_0x1d2a60,_0x38ca01){return _0x1d2a60[_0x6d5c('0xb')](_0x6d5c('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 4929774..ef40ac1 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 _0xde2c=['findAll','options','raw','where','limit','include','model','attributes','GetVtigerAccount','stringify','find','map','ShowVtigerAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','VtigerAccount'];(function(_0x3aff64,_0x55b017){var _0x1343d9=function(_0x7d5bd0){while(--_0x7d5bd0){_0x3aff64['push'](_0x3aff64['shift']());}};_0x1343d9(++_0x55b017);}(_0xde2c,0x7f));var _0xcde2=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xde2c[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});}exports['GetVtigerAccount']=function(_0x4fd5aa){var _0x4fe586=this;return new Promise(function(_0x2b4468,_0x582e84){return db[_0xcde2('0x18')][_0xcde2('0x19')]({'raw':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options'][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1c')]||null:null,'attributes':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa['options']['attributes']||null:null,'limit':_0x4fd5aa['options']?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1d')]||null:null,'include':_0x4fd5aa[_0xcde2('0x1a')]?_0x4fd5aa[_0xcde2('0x1a')][_0xcde2('0x1e')]?_['map'](_0x4fd5aa[_0xcde2('0x1a')]['include'],function(_0x280d8c){return{'model':db[_0x280d8c[_0xcde2('0x1f')]],'as':_0x280d8c['as'],'attributes':_0x280d8c[_0xcde2('0x20')],'include':_0x280d8c['include']?_['map'](_0x280d8c[_0xcde2('0x1e')],function(_0x207a12){return{'model':db[_0x207a12[_0xcde2('0x1f')]],'as':_0x207a12['as'],'attributes':_0x207a12[_0xcde2('0x20')],'include':_0x207a12[_0xcde2('0x1e')]?_['map'](_0x207a12[_0xcde2('0x1e')],function(_0x45275a){return{'model':db[_0x45275a[_0xcde2('0x1f')]],'as':_0x45275a['as'],'attributes':_0x45275a['attributes']};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x348ca1){logger[_0xcde2('0x15')](_0xcde2('0x21'),_0x4fd5aa);logger[_0xcde2('0x10')](_0xcde2('0x21'),_0x4fd5aa,JSON[_0xcde2('0x22')](_0x348ca1));_0x2b4468(_0x348ca1);})[_0xcde2('0x17')](function(_0x5bf1e6){logger[_0xcde2('0x12')]('GetVtigerAccount',_0x5bf1e6[_0xcde2('0x14')],_0x4fd5aa);_0x582e84(_0x4fe586[_0xcde2('0x12')](0x1f4,_0x5bf1e6[_0xcde2('0x14')]));});});};exports['ShowVtigerAccount']=function(_0xae46dc){var _0x28fedd=this;return new Promise(function(_0x58afb1,_0x26ec42){return db[_0xcde2('0x18')][_0xcde2('0x23')]({'raw':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1b')]===undefined?!![]:![]:!![],'where':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')]['where']||null:null,'attributes':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x20')]||null:null,'include':_0xae46dc[_0xcde2('0x1a')]?_0xae46dc['options'][_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xae46dc[_0xcde2('0x1a')][_0xcde2('0x1e')],function(_0x498339){return{'model':db[_0x498339[_0xcde2('0x1f')]],'as':_0x498339['as'],'attributes':_0x498339[_0xcde2('0x20')],'include':_0x498339[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0x498339['include'],function(_0xb9c8d2){return{'model':db[_0xb9c8d2[_0xcde2('0x1f')]],'as':_0xb9c8d2['as'],'attributes':_0xb9c8d2[_0xcde2('0x20')],'include':_0xb9c8d2[_0xcde2('0x1e')]?_[_0xcde2('0x24')](_0xb9c8d2['include'],function(_0x2cd313){return{'model':db[_0x2cd313[_0xcde2('0x1f')]],'as':_0x2cd313['as'],'attributes':_0x2cd313[_0xcde2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xcde2('0xd')](function(_0x4a64c1){logger['info'](_0xcde2('0x25'),_0xae46dc);logger[_0xcde2('0x10')](_0xcde2('0x25'),_0xae46dc,JSON[_0xcde2('0x22')](_0x4a64c1));_0x58afb1(_0x4a64c1);})[_0xcde2('0x17')](function(_0x45af6e){logger[_0xcde2('0x12')](_0xcde2('0x25'),_0x45af6e[_0xcde2('0x14')],_0xae46dc);_0x26ec42(_0x28fedd['error'](0x1f4,_0x45af6e[_0xcde2('0x14')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 0e43837..a84d2f2 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 _0x6bec=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','put','update','delete','destroy','exports','multer','util'];(function(_0x4d8cee,_0x1964a9){var _0x3bf21f=function(_0x1d3b8a){while(--_0x1d3b8a){_0x4d8cee['push'](_0x4d8cee['shift']());}};_0x3bf21f(++_0x1964a9);}(_0x6bec,0xfb));var _0xc6be=function(_0x9bacc2,_0x3444fc){_0x9bacc2=_0x9bacc2-0x0;var _0x147fc8=_0x6bec[_0x9bacc2];return _0x147fc8;};'use strict';var multer=require(_0xc6be('0x0'));var util=require(_0xc6be('0x1'));var path=require(_0xc6be('0x2'));var timeout=require(_0xc6be('0x3'));var express=require(_0xc6be('0x4'));var router=express[_0xc6be('0x5')]();var fs_extra=require(_0xc6be('0x6'));var auth=require(_0xc6be('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xc6be('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6be('0x8')](_0xc6be('0x9'),auth[_0xc6be('0xa')](),controller[_0xc6be('0xb')]);router[_0xc6be('0x8')](_0xc6be('0xc'),auth[_0xc6be('0xa')](),controller[_0xc6be('0xd')]);router[_0xc6be('0x8')](_0xc6be('0xe'),auth[_0xc6be('0xa')](),controller[_0xc6be('0xf')]);router[_0xc6be('0x8')](_0xc6be('0x10'),auth[_0xc6be('0xa')](),controller['getDescriptions']);router[_0xc6be('0x11')]('/',auth[_0xc6be('0xa')](),controller['create']);router[_0xc6be('0x12')]('/:id',auth[_0xc6be('0xa')](),controller[_0xc6be('0x13')]);router[_0xc6be('0x14')](_0xc6be('0x9'),auth[_0xc6be('0xa')](),controller[_0xc6be('0x15')]);module[_0xc6be('0x16')]=router; \ No newline at end of file +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 diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 726e734..1bdd1dc 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 _0x0222=['exports','STRING','sequelize'];(function(_0x311312,_0xd94ff5){var _0x32a095=function(_0x56b3b7){while(--_0x56b3b7){_0x311312['push'](_0x311312['shift']());}};_0x32a095(++_0xd94ff5);}(_0x0222,0x18b));var _0x2022=function(_0x16a917,_0x2b1619){_0x16a917=_0x16a917-0x0;var _0x1c9795=_0x0222[_0x16a917];return _0x1c9795;};'use strict';var Sequelize=require(_0x2022('0x0'));module[_0x2022('0x1')]={'name':{'type':Sequelize[_0x2022('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index e6d2ffb..0e2f807 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 _0xae8d=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','map','VtigerConfiguration','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','length','create','body','find','destroy','getFields','order','getSubjects','findOne','VtigerField','rawAttributes','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0xdad237,_0x361a1d){var _0x15c575=function(_0x8db2f6){while(--_0x8db2f6){_0xdad237['push'](_0xdad237['shift']());}};_0x15c575(++_0x361a1d);}(_0xae8d,0x94));var _0xdae8=function(_0x3f786e,_0x4b3a55){_0x3f786e=_0x3f786e-0x0;var _0x340b50=_0xae8d[_0x3f786e];return _0x340b50;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xdae8('0x0'));var jsonpatch=require(_0xdae8('0x1'));var rp=require(_0xdae8('0x2'));var moment=require(_0xdae8('0x3'));var BPromise=require(_0xdae8('0x4'));var Mustache=require(_0xdae8('0x5'));var util=require(_0xdae8('0x6'));var path=require(_0xdae8('0x7'));var sox=require(_0xdae8('0x8'));var csv=require(_0xdae8('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdae8('0xa'));var _=require(_0xdae8('0xb'));var squel=require(_0xdae8('0xc'));var crypto=require('crypto');var jsforce=require(_0xdae8('0xd'));var deskjs=require(_0xdae8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdae8('0xf'));var Papa=require(_0xdae8('0x10'));var Redis=require(_0xdae8('0x11'));var authService=require(_0xdae8('0x12'));var qs=require(_0xdae8('0x13'));var as=require(_0xdae8('0x14'));var hardwareService=require(_0xdae8('0x15'));var logger=require(_0xdae8('0x16'))(_0xdae8('0x17'));var utils=require(_0xdae8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xdae8('0x19'));var db=require(_0xdae8('0x1a'))['db'];function respondWithStatusCode(_0x3872f8,_0x39bf2c){_0x39bf2c=_0x39bf2c||0xcc;return function(_0x2d0783){if(_0x2d0783){return _0x3872f8['sendStatus'](_0x39bf2c);}return _0x3872f8[_0xdae8('0x1b')](_0x39bf2c)[_0xdae8('0x1c')]();};}function respondWithResult(_0x31784e,_0x46a6ea){_0x46a6ea=_0x46a6ea||0xc8;return function(_0x1a20f5){if(_0x1a20f5){return _0x31784e[_0xdae8('0x1b')](_0x46a6ea)[_0xdae8('0x1d')](_0x1a20f5);}};}function respondWithFilteredResult(_0x2d1ab6,_0x301f67){return function(_0x5016af){if(_0x5016af){var _0x58e9ed=typeof _0x301f67[_0xdae8('0x1e')]===_0xdae8('0x1f')&&typeof _0x301f67[_0xdae8('0x20')]===_0xdae8('0x1f');var _0x13e266=_0x5016af[_0xdae8('0x21')];var _0x1a7d42=_0x58e9ed?0x0:_0x301f67[_0xdae8('0x1e')];var _0x1b4225=_0x58e9ed?_0x5016af['count']:_0x301f67[_0xdae8('0x1e')]+_0x301f67['limit'];var _0x514f5e;if(_0x1b4225>=_0x13e266){_0x1b4225=_0x13e266;_0x514f5e=0xc8;}else{_0x514f5e=0xce;}_0x2d1ab6[_0xdae8('0x1b')](_0x514f5e);return _0x2d1ab6['set'](_0xdae8('0x22'),_0x1a7d42+'-'+_0x1b4225+'/'+_0x13e266)[_0xdae8('0x1d')](_0x5016af);}return null;};}function patchUpdates(_0x3413c2){return function(_0x57e69c){try{jsonpatch['apply'](_0x57e69c,_0x3413c2,!![]);}catch(_0x2d7030){return BPromise[_0xdae8('0x23')](_0x2d7030);}return _0x57e69c[_0xdae8('0x24')]();};}function saveUpdates(_0x2aa4ac,_0x55945e){return function(_0x1d8003){if(_0x1d8003){return _0x1d8003[_0xdae8('0x25')](_0x2aa4ac)[_0xdae8('0x26')](function(_0x4986dd){return _0x4986dd;});}return null;};}function removeEntity(_0x11a090,_0x1293c4){return function(_0x461ca3){if(_0x461ca3){return _0x461ca3['destroy']()[_0xdae8('0x26')](function(){_0x11a090[_0xdae8('0x1b')](0xcc)[_0xdae8('0x1c')]();});}};}function handleEntityNotFound(_0x2c3831,_0x38de0b){return function(_0xadd91f){if(!_0xadd91f){_0x2c3831[_0xdae8('0x27')](0x194);}return _0xadd91f;};}function handleError(_0x1be877,_0x1fa137){_0x1fa137=_0x1fa137||0x1f4;return function(_0x1ce801){logger[_0xdae8('0x28')](_0x1ce801[_0xdae8('0x29')]);if(_0x1ce801[_0xdae8('0x2a')]){delete _0x1ce801[_0xdae8('0x2a')];}_0x1be877[_0xdae8('0x1b')](_0x1fa137)[_0xdae8('0x2b')](_0x1ce801);};}exports[_0xdae8('0x2c')]=function(_0x3f9401,_0x447246){var _0x2076c2={},_0x582f3a={},_0x487d24={'count':0x0,'rows':[]};var _0x4010b4=_[_0xdae8('0x2d')](db[_0xdae8('0x2e')]['rawAttributes'],function(_0x168c47){return{'name':_0x168c47[_0xdae8('0x2f')],'type':_0x168c47['type'][_0xdae8('0x30')]};});_0x582f3a[_0xdae8('0x31')]=_['map'](_0x4010b4,'name');_0x582f3a[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x3f9401[_0xdae8('0x32')]);_0x582f3a['filters']=_['intersection'](_0x582f3a[_0xdae8('0x31')],_0x582f3a['query']);_0x2076c2[_0xdae8('0x34')]=_[_0xdae8('0x35')](_0x582f3a[_0xdae8('0x31')],qs['fields'](_0x3f9401['query'][_0xdae8('0x36')]));_0x2076c2[_0xdae8('0x34')]=_0x2076c2[_0xdae8('0x34')]['length']?_0x2076c2['attributes']:_0x582f3a[_0xdae8('0x31')];if(!_0x3f9401['query'][_0xdae8('0x37')](_0xdae8('0x38'))){_0x2076c2['limit']=qs['limit'](_0x3f9401[_0xdae8('0x32')][_0xdae8('0x20')]);_0x2076c2['offset']=qs[_0xdae8('0x1e')](_0x3f9401[_0xdae8('0x32')][_0xdae8('0x1e')]);}_0x2076c2['order']=qs[_0xdae8('0x39')](_0x3f9401[_0xdae8('0x32')]['sort']);_0x2076c2[_0xdae8('0x3a')]=qs[_0xdae8('0x3b')](_[_0xdae8('0x3c')](_0x3f9401[_0xdae8('0x32')],_0x582f3a[_0xdae8('0x3b')]),_0x4010b4);if(_0x3f9401['query'][_0xdae8('0x3d')]){_0x2076c2['where']=_[_0xdae8('0x3e')](_0x2076c2[_0xdae8('0x3a')],{'$or':_['map'](_0x4010b4,function(_0x3ae529){if(_0x3ae529['type']!==_0xdae8('0x3f')){var _0x13eaa9={};_0x13eaa9[_0x3ae529[_0xdae8('0x2a')]]={'$like':'%'+_0x3f9401['query'][_0xdae8('0x3d')]+'%'};return _0x13eaa9;}})});}_0x2076c2=_['merge']({},_0x2076c2,_0x3f9401[_0xdae8('0x40')]);var _0x381b8a={'where':_0x2076c2[_0xdae8('0x3a')]};return db[_0xdae8('0x2e')][_0xdae8('0x21')](_0x381b8a)[_0xdae8('0x26')](function(_0x2cd7cf){_0x487d24[_0xdae8('0x21')]=_0x2cd7cf;if(_0x3f9401[_0xdae8('0x32')][_0xdae8('0x41')]){_0x2076c2[_0xdae8('0x42')]=[{'all':!![]}];}return db[_0xdae8('0x2e')]['findAll'](_0x2076c2);})[_0xdae8('0x26')](function(_0x51caed){_0x487d24['rows']=_0x51caed;return _0x487d24;})[_0xdae8('0x26')](respondWithFilteredResult(_0x447246,_0x2076c2))[_0xdae8('0x43')](handleError(_0x447246,null));};exports[_0xdae8('0x44')]=function(_0x5cc52d,_0x1dabc5){var _0x313691={'raw':![],'where':{'id':_0x5cc52d[_0xdae8('0x45')]['id']}},_0x2f8f69={};_0x2f8f69[_0xdae8('0x31')]=_[_0xdae8('0x33')](db[_0xdae8('0x2e')]['rawAttributes']);_0x2f8f69[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x5cc52d['query']);_0x2f8f69['filters']=_['intersection'](_0x2f8f69[_0xdae8('0x31')],_0x2f8f69['query']);_0x313691['attributes']=_[_0xdae8('0x35')](_0x2f8f69[_0xdae8('0x31')],qs['fields'](_0x5cc52d['query']['fields']));_0x313691[_0xdae8('0x34')]=_0x313691['attributes'][_0xdae8('0x46')]?_0x313691['attributes']:_0x2f8f69[_0xdae8('0x31')];if(_0x5cc52d[_0xdae8('0x32')][_0xdae8('0x41')]){_0x313691[_0xdae8('0x42')]=[{'all':!![]}];}_0x313691=_['merge']({},_0x313691,_0x5cc52d[_0xdae8('0x40')]);return db['VtigerConfiguration']['find'](_0x313691)[_0xdae8('0x26')](handleEntityNotFound(_0x1dabc5,null))[_0xdae8('0x26')](respondWithResult(_0x1dabc5,null))['catch'](handleError(_0x1dabc5,null));};exports[_0xdae8('0x47')]=function(_0x4598f5,_0x1559fe){return db['VtigerConfiguration'][_0xdae8('0x47')](_0x4598f5[_0xdae8('0x48')],{})[_0xdae8('0x26')](respondWithResult(_0x1559fe,0xc9))[_0xdae8('0x43')](handleError(_0x1559fe,null));};exports[_0xdae8('0x25')]=function(_0x2d0e50,_0x4ccaf9){if(_0x2d0e50[_0xdae8('0x48')]['id']){delete _0x2d0e50[_0xdae8('0x48')]['id'];}return db[_0xdae8('0x2e')][_0xdae8('0x49')]({'where':{'id':_0x2d0e50['params']['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0x4ccaf9,null))['then'](saveUpdates(_0x2d0e50[_0xdae8('0x48')],null))['then'](respondWithResult(_0x4ccaf9,null))[_0xdae8('0x43')](handleError(_0x4ccaf9,null));};exports[_0xdae8('0x4a')]=function(_0x3f13a9,_0x596663){return db[_0xdae8('0x2e')][_0xdae8('0x49')]({'where':{'id':_0x3f13a9[_0xdae8('0x45')]['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0x596663,null))['then'](removeEntity(_0x596663,null))[_0xdae8('0x43')](handleError(_0x596663,null));};exports[_0xdae8('0x4b')]=function(_0x39a9e0,_0x10572c,_0x101c7f){var _0x4baf3a={};var _0x53b3c9={};var _0x2e0883;var _0x5b0be6;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x39a9e0[_0xdae8('0x45')]['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0x10572c,null))['then'](function(_0x56f707){if(_0x56f707){_0x2e0883=_0x56f707;_0x53b3c9['model']=_[_0xdae8('0x33')](db['VtigerField']['rawAttributes']);_0x53b3c9[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x39a9e0[_0xdae8('0x32')]);_0x53b3c9[_0xdae8('0x3b')]=_[_0xdae8('0x35')](_0x53b3c9[_0xdae8('0x31')],_0x53b3c9['query']);_0x4baf3a[_0xdae8('0x34')]=_[_0xdae8('0x35')](_0x53b3c9[_0xdae8('0x31')],qs[_0xdae8('0x36')](_0x39a9e0[_0xdae8('0x32')]['fields']));_0x4baf3a[_0xdae8('0x34')]=_0x4baf3a[_0xdae8('0x34')][_0xdae8('0x46')]?_0x4baf3a[_0xdae8('0x34')]:_0x53b3c9[_0xdae8('0x31')];_0x4baf3a[_0xdae8('0x4c')]=qs[_0xdae8('0x39')](_0x39a9e0[_0xdae8('0x32')]['sort']);_0x4baf3a[_0xdae8('0x3a')]=qs[_0xdae8('0x3b')](_[_0xdae8('0x3c')](_0x39a9e0[_0xdae8('0x32')],_0x53b3c9['filters']));if(_0x39a9e0[_0xdae8('0x32')][_0xdae8('0x3d')]){_0x4baf3a['where']=_['merge'](_0x4baf3a[_0xdae8('0x3a')],{'$or':_[_0xdae8('0x2d')](_0x4baf3a[_0xdae8('0x34')],function(_0x2dccdf){var _0x2bc20d={};_0x2bc20d[_0x2dccdf]={'$like':'%'+_0x39a9e0[_0xdae8('0x32')][_0xdae8('0x3d')]+'%'};return _0x2bc20d;})});}_0x4baf3a=_[_0xdae8('0x3e')]({},_0x4baf3a,_0x39a9e0[_0xdae8('0x40')]);return _0x2e0883[_0xdae8('0x4b')](_0x4baf3a);}})[_0xdae8('0x26')](function(_0x3738d5){if(_0x3738d5){_0x5b0be6=_0x3738d5[_0xdae8('0x46')];if(!_0x39a9e0[_0xdae8('0x32')][_0xdae8('0x37')](_0xdae8('0x38'))){_0x4baf3a[_0xdae8('0x20')]=qs['limit'](_0x39a9e0[_0xdae8('0x32')][_0xdae8('0x20')]);_0x4baf3a['offset']=qs['offset'](_0x39a9e0[_0xdae8('0x32')][_0xdae8('0x1e')]);}return _0x2e0883[_0xdae8('0x4b')](_0x4baf3a);}})['then'](function(_0x4b8d1c){if(_0x4b8d1c){return _0x4b8d1c?{'count':_0x5b0be6,'rows':_0x4b8d1c}:null;}})['then'](respondWithResult(_0x10572c,null))[_0xdae8('0x43')](handleError(_0x10572c,null));};exports[_0xdae8('0x4d')]=function(_0x2f1656,_0xc8d2ce,_0x583490){var _0x4af336={};var _0x5f1dbe={};var _0x1d66d1;var _0x2d02a5;return db[_0xdae8('0x2e')][_0xdae8('0x4e')]({'where':{'id':_0x2f1656['params']['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0xc8d2ce,null))[_0xdae8('0x26')](function(_0x1dfd7e){if(_0x1dfd7e){_0x1d66d1=_0x1dfd7e;_0x5f1dbe['model']=_[_0xdae8('0x33')](db[_0xdae8('0x4f')][_0xdae8('0x50')]);_0x5f1dbe[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x2f1656[_0xdae8('0x32')]);_0x5f1dbe[_0xdae8('0x3b')]=_[_0xdae8('0x35')](_0x5f1dbe[_0xdae8('0x31')],_0x5f1dbe[_0xdae8('0x32')]);_0x4af336[_0xdae8('0x34')]=_[_0xdae8('0x35')](_0x5f1dbe[_0xdae8('0x31')],qs[_0xdae8('0x36')](_0x2f1656[_0xdae8('0x32')][_0xdae8('0x36')]));_0x4af336[_0xdae8('0x34')]=_0x4af336[_0xdae8('0x34')][_0xdae8('0x46')]?_0x4af336['attributes']:_0x5f1dbe[_0xdae8('0x31')];_0x4af336[_0xdae8('0x4c')]=qs[_0xdae8('0x39')](_0x2f1656['query'][_0xdae8('0x39')]);_0x4af336[_0xdae8('0x3a')]=qs[_0xdae8('0x3b')](_[_0xdae8('0x3c')](_0x2f1656[_0xdae8('0x32')],_0x5f1dbe[_0xdae8('0x3b')]));if(_0x2f1656['query']['filter']){_0x4af336[_0xdae8('0x3a')]=_[_0xdae8('0x3e')](_0x4af336[_0xdae8('0x3a')],{'$or':_[_0xdae8('0x2d')](_0x4af336[_0xdae8('0x34')],function(_0x271ce7){var _0x5c2d8e={};_0x5c2d8e[_0x271ce7]={'$like':'%'+_0x2f1656['query'][_0xdae8('0x3d')]+'%'};return _0x5c2d8e;})});}_0x4af336=_['merge']({},_0x4af336,_0x2f1656[_0xdae8('0x40')]);return _0x1d66d1[_0xdae8('0x4d')](_0x4af336);}})[_0xdae8('0x26')](function(_0x700f97){if(_0x700f97){_0x2d02a5=_0x700f97['length'];if(!_0x2f1656[_0xdae8('0x32')][_0xdae8('0x37')](_0xdae8('0x38'))){_0x4af336[_0xdae8('0x20')]=qs[_0xdae8('0x20')](_0x2f1656['query'][_0xdae8('0x20')]);_0x4af336['offset']=qs['offset'](_0x2f1656[_0xdae8('0x32')][_0xdae8('0x1e')]);}return _0x1d66d1[_0xdae8('0x4d')](_0x4af336);}})['then'](function(_0xfae803){if(_0xfae803){return _0xfae803?{'count':_0x2d02a5,'rows':_0xfae803}:null;}})[_0xdae8('0x26')](respondWithResult(_0xc8d2ce,null))[_0xdae8('0x43')](handleError(_0xc8d2ce,null));};exports[_0xdae8('0x51')]=function(_0x594c28,_0x24ad45,_0x55fea4){var _0x1fbfa2={};var _0x55d420={};var _0x450d3d;var _0x36cba3;return db[_0xdae8('0x2e')]['findOne']({'where':{'id':_0x594c28[_0xdae8('0x45')]['id']}})[_0xdae8('0x26')](handleEntityNotFound(_0x24ad45,null))[_0xdae8('0x26')](function(_0x3d899a){if(_0x3d899a){_0x450d3d=_0x3d899a;_0x55d420[_0xdae8('0x31')]=_[_0xdae8('0x33')](db[_0xdae8('0x4f')][_0xdae8('0x50')]);_0x55d420[_0xdae8('0x32')]=_[_0xdae8('0x33')](_0x594c28[_0xdae8('0x32')]);_0x55d420['filters']=_['intersection'](_0x55d420[_0xdae8('0x31')],_0x55d420[_0xdae8('0x32')]);_0x1fbfa2[_0xdae8('0x34')]=_[_0xdae8('0x35')](_0x55d420['model'],qs[_0xdae8('0x36')](_0x594c28[_0xdae8('0x32')][_0xdae8('0x36')]));_0x1fbfa2[_0xdae8('0x34')]=_0x1fbfa2[_0xdae8('0x34')][_0xdae8('0x46')]?_0x1fbfa2[_0xdae8('0x34')]:_0x55d420['model'];_0x1fbfa2[_0xdae8('0x4c')]=qs[_0xdae8('0x39')](_0x594c28['query'][_0xdae8('0x39')]);_0x1fbfa2[_0xdae8('0x3a')]=qs[_0xdae8('0x3b')](_['pick'](_0x594c28[_0xdae8('0x32')],_0x55d420[_0xdae8('0x3b')]));if(_0x594c28['query']['filter']){_0x1fbfa2[_0xdae8('0x3a')]=_[_0xdae8('0x3e')](_0x1fbfa2[_0xdae8('0x3a')],{'$or':_['map'](_0x1fbfa2[_0xdae8('0x34')],function(_0x218c81){var _0x45d052={};_0x45d052[_0x218c81]={'$like':'%'+_0x594c28[_0xdae8('0x32')][_0xdae8('0x3d')]+'%'};return _0x45d052;})});}_0x1fbfa2=_[_0xdae8('0x3e')]({},_0x1fbfa2,_0x594c28[_0xdae8('0x40')]);return _0x450d3d[_0xdae8('0x51')](_0x1fbfa2);}})[_0xdae8('0x26')](function(_0x12e263){if(_0x12e263){_0x36cba3=_0x12e263['length'];if(!_0x594c28[_0xdae8('0x32')][_0xdae8('0x37')](_0xdae8('0x38'))){_0x1fbfa2[_0xdae8('0x20')]=qs['limit'](_0x594c28[_0xdae8('0x32')][_0xdae8('0x20')]);_0x1fbfa2[_0xdae8('0x1e')]=qs[_0xdae8('0x1e')](_0x594c28[_0xdae8('0x32')][_0xdae8('0x1e')]);}return _0x450d3d[_0xdae8('0x51')](_0x1fbfa2);}})[_0xdae8('0x26')](function(_0x5a08f4){if(_0x5a08f4){return _0x5a08f4?{'count':_0x36cba3,'rows':_0x5a08f4}:null;}})[_0xdae8('0x26')](respondWithResult(_0x24ad45,null))['catch'](handleError(_0x24ad45,null));}; \ No newline at end of file +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 diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index bb6da18..e5a5f1c 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 _0xc99a=['VtigerConfiguration','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./intVtigerConfiguration.attributes','exports'];(function(_0x187f71,_0xf40f00){var _0xdf027a=function(_0x127e87){while(--_0x127e87){_0x187f71['push'](_0x187f71['shift']());}};_0xdf027a(++_0xf40f00);}(_0xc99a,0x18d));var _0xac99=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc99a[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xac99('0x0'));var util=require(_0xac99('0x1'));var logger=require(_0xac99('0x2'))(_0xac99('0x3'));var moment=require(_0xac99('0x4'));var BPromise=require('bluebird');var rp=require(_0xac99('0x5'));var fs=require('fs');var path=require(_0xac99('0x6'));var rimraf=require(_0xac99('0x7'));var config=require('../../config/environment');var attributes=require(_0xac99('0x8'));module[_0xac99('0x9')]=function(_0x4a373b,_0xd03b2c){return _0x4a373b['define'](_0xac99('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 6f1eed4..b608a30 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 _0xcac4=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http'];(function(_0x1bb2c5,_0x5a3a8f){var _0x50782b=function(_0x59ede6){while(--_0x59ede6){_0x1bb2c5['push'](_0x1bb2c5['shift']());}};_0x50782b(++_0x5a3a8f);}(_0xcac4,0x14c));var _0x4cac=function(_0x34eb31,_0x8f0f70){_0x34eb31=_0x34eb31-0x0;var _0x254994=_0xcac4[_0x34eb31];return _0x254994;};'use strict';var _=require(_0x4cac('0x0'));var util=require('util');var moment=require(_0x4cac('0x1'));var BPromise=require(_0x4cac('0x2'));var rs=require(_0x4cac('0x3'));var fs=require('fs');var Redis=require(_0x4cac('0x4'));var db=require(_0x4cac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cac('0x6'))(_0x4cac('0x7'));var config=require('../../config/environment');var jayson=require(_0x4cac('0x8'));var client=jayson['client'][_0x4cac('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x564483,_0x55c198,_0x408faa){return new BPromise(function(_0x2b74c2,_0x252663){return client['request'](_0x564483,_0x408faa)[_0x4cac('0xa')](function(_0x23e285){logger[_0x4cac('0xb')](_0x4cac('0xc'),_0x55c198,_0x4cac('0xd'));logger[_0x4cac('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x55c198,_0x4cac('0xd'),JSON['stringify'](_0x23e285));if(_0x23e285['error']){if(_0x23e285[_0x4cac('0xf')][_0x4cac('0x10')]===0x1f4){logger[_0x4cac('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x55c198,_0x23e285[_0x4cac('0xf')][_0x4cac('0x11')]);return _0x252663(_0x23e285[_0x4cac('0xf')]['message']);}logger[_0x4cac('0xf')](_0x4cac('0xc'),_0x55c198,_0x23e285[_0x4cac('0xf')][_0x4cac('0x11')]);return _0x2b74c2(_0x23e285[_0x4cac('0xf')][_0x4cac('0x11')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x55c198,_0x4cac('0xd'));_0x2b74c2(_0x23e285['result'][_0x4cac('0x11')]);}})[_0x4cac('0x12')](function(_0x37757b){logger[_0x4cac('0xf')](_0x4cac('0xc'),_0x55c198,_0x37757b);_0x252663(_0x37757b);});});} \ No newline at end of file +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 diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 8146d9b..d785981 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 _0x3119=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy','multer','connect-timeout'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3119,0x11e));var _0x9311=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x3119[_0x4b73a2];return _0x383c66;};'use strict';var multer=require(_0x9311('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9311('0x1'));var express=require(_0x9311('0x2'));var router=express[_0x9311('0x3')]();var fs_extra=require(_0x9311('0x4'));var auth=require(_0x9311('0x5'));var interaction=require(_0x9311('0x6'));var config=require(_0x9311('0x7'));var controller=require(_0x9311('0x8'));router[_0x9311('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x9311('0xa')](),controller[_0x9311('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9311('0xc')]);router[_0x9311('0xd')](_0x9311('0xe'),auth[_0x9311('0xa')](),controller[_0x9311('0xf')]);router[_0x9311('0x10')](_0x9311('0xe'),auth[_0x9311('0xa')](),controller[_0x9311('0x11')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 52ff2d0..cf6e915 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 _0x852e=['string','variable','STRING','exports','ENUM'];(function(_0x1ca29f,_0x318ac5){var _0x576c3b=function(_0x40caab){while(--_0x40caab){_0x1ca29f['push'](_0x1ca29f['shift']());}};_0x576c3b(++_0x318ac5);}(_0x852e,0x1c5));var _0xe852=function(_0x578368,_0x1c94d3){_0x578368=_0x578368-0x0;var _0x5e2de8=_0x852e[_0x578368];return _0x5e2de8;};'use strict';var Sequelize=require('sequelize');module[_0xe852('0x0')]={'type':{'type':Sequelize[_0xe852('0x1')](_0xe852('0x2'),_0xe852('0x3'),'customVariable','keyValue','picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xe852('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe852('0x1')]('string',_0xe852('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xe852('0x4')]},'idField':{'type':Sequelize[_0xe852('0x4')]},'nameField':{'type':Sequelize[_0xe852('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe852('0x4')]}}; \ No newline at end of file +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 diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 7fdb4f2..ab3f238 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 _0x42dc=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','rows','catch','show','params','includeAll','find','create','body','destroy','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x42dc,0x15f));var _0xc42d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x42dc[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc42d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc42d('0x1'));var moment=require(_0xc42d('0x2'));var BPromise=require(_0xc42d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc42d('0x4'));var sox=require(_0xc42d('0x5'));var csv=require(_0xc42d('0x6'));var ejs=require(_0xc42d('0x7'));var fs=require('fs');var fs_extra=require(_0xc42d('0x8'));var _=require(_0xc42d('0x9'));var squel=require(_0xc42d('0xa'));var crypto=require(_0xc42d('0xb'));var jsforce=require(_0xc42d('0xc'));var deskjs=require(_0xc42d('0xd'));var toCsv=require(_0xc42d('0x6'));var querystring=require(_0xc42d('0xe'));var Papa=require(_0xc42d('0xf'));var Redis=require(_0xc42d('0x10'));var authService=require(_0xc42d('0x11'));var qs=require(_0xc42d('0x12'));var as=require(_0xc42d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc42d('0x14'))(_0xc42d('0x15'));var utils=require(_0xc42d('0x16'));var config=require(_0xc42d('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc42d('0x18'))['db'];function respondWithStatusCode(_0xcc37e0,_0x15449b){_0x15449b=_0x15449b||0xcc;return function(_0x415102){if(_0x415102){return _0xcc37e0[_0xc42d('0x19')](_0x15449b);}return _0xcc37e0[_0xc42d('0x1a')](_0x15449b)[_0xc42d('0x1b')]();};}function respondWithResult(_0x25c956,_0x5036c1){_0x5036c1=_0x5036c1||0xc8;return function(_0x15f8a1){if(_0x15f8a1){return _0x25c956[_0xc42d('0x1a')](_0x5036c1)['json'](_0x15f8a1);}};}function respondWithFilteredResult(_0x1df502,_0x1984f6){return function(_0x50b1ed){if(_0x50b1ed){var _0xe0dd8=typeof _0x1984f6[_0xc42d('0x1c')]===_0xc42d('0x1d')&&typeof _0x1984f6['limit']==='undefined';var _0xb7ac41=_0x50b1ed['count'];var _0x1d2f2c=_0xe0dd8?0x0:_0x1984f6[_0xc42d('0x1c')];var _0x164776=_0xe0dd8?_0x50b1ed[_0xc42d('0x1e')]:_0x1984f6[_0xc42d('0x1c')]+_0x1984f6[_0xc42d('0x1f')];var _0x531c5d;if(_0x164776>=_0xb7ac41){_0x164776=_0xb7ac41;_0x531c5d=0xc8;}else{_0x531c5d=0xce;}_0x1df502[_0xc42d('0x1a')](_0x531c5d);return _0x1df502['set'](_0xc42d('0x20'),_0x1d2f2c+'-'+_0x164776+'/'+_0xb7ac41)[_0xc42d('0x21')](_0x50b1ed);}return null;};}function patchUpdates(_0x3ebc8f){return function(_0x4700de){try{jsonpatch['apply'](_0x4700de,_0x3ebc8f,!![]);}catch(_0x4bd4ee){return BPromise[_0xc42d('0x22')](_0x4bd4ee);}return _0x4700de[_0xc42d('0x23')]();};}function saveUpdates(_0x3a6ec1,_0x111448){return function(_0x6cba90){if(_0x6cba90){return _0x6cba90[_0xc42d('0x24')](_0x3a6ec1)['then'](function(_0x54d756){return _0x54d756;});}return null;};}function removeEntity(_0x5e280c,_0xd9b4d5){return function(_0x489e48){if(_0x489e48){return _0x489e48['destroy']()[_0xc42d('0x25')](function(){_0x5e280c[_0xc42d('0x1a')](0xcc)[_0xc42d('0x1b')]();});}};}function handleEntityNotFound(_0xc70648,_0x2aa47c){return function(_0x356311){if(!_0x356311){_0xc70648[_0xc42d('0x19')](0x194);}return _0x356311;};}function handleError(_0x29e0f3,_0x4884c3){_0x4884c3=_0x4884c3||0x1f4;return function(_0x24ff31){logger[_0xc42d('0x26')](_0x24ff31[_0xc42d('0x27')]);if(_0x24ff31[_0xc42d('0x28')]){delete _0x24ff31['name'];}_0x29e0f3[_0xc42d('0x1a')](_0x4884c3)[_0xc42d('0x29')](_0x24ff31);};}exports[_0xc42d('0x2a')]=function(_0x2a7285,_0x89a811){var _0x52fc76={},_0x3d3956={},_0x506fb3={'count':0x0,'rows':[]};var _0x1d0d16=_[_0xc42d('0x2b')](db[_0xc42d('0x2c')][_0xc42d('0x2d')],function(_0x5b7496){return{'name':_0x5b7496[_0xc42d('0x2e')],'type':_0x5b7496[_0xc42d('0x2f')][_0xc42d('0x30')]};});_0x3d3956[_0xc42d('0x31')]=_[_0xc42d('0x2b')](_0x1d0d16,'name');_0x3d3956['query']=_[_0xc42d('0x32')](_0x2a7285[_0xc42d('0x33')]);_0x3d3956[_0xc42d('0x34')]=_['intersection'](_0x3d3956[_0xc42d('0x31')],_0x3d3956['query']);_0x52fc76[_0xc42d('0x35')]=_[_0xc42d('0x36')](_0x3d3956['model'],qs[_0xc42d('0x37')](_0x2a7285[_0xc42d('0x33')][_0xc42d('0x37')]));_0x52fc76[_0xc42d('0x35')]=_0x52fc76[_0xc42d('0x35')][_0xc42d('0x38')]?_0x52fc76[_0xc42d('0x35')]:_0x3d3956['model'];if(!_0x2a7285['query'][_0xc42d('0x39')](_0xc42d('0x3a'))){_0x52fc76[_0xc42d('0x1f')]=qs['limit'](_0x2a7285['query'][_0xc42d('0x1f')]);_0x52fc76[_0xc42d('0x1c')]=qs['offset'](_0x2a7285[_0xc42d('0x33')]['offset']);}_0x52fc76['order']=qs[_0xc42d('0x3b')](_0x2a7285['query']['sort']);_0x52fc76[_0xc42d('0x3c')]=qs[_0xc42d('0x34')](_['pick'](_0x2a7285[_0xc42d('0x33')],_0x3d3956[_0xc42d('0x34')]),_0x1d0d16);if(_0x2a7285[_0xc42d('0x33')][_0xc42d('0x3d')]){_0x52fc76[_0xc42d('0x3c')]=_[_0xc42d('0x3e')](_0x52fc76[_0xc42d('0x3c')],{'$or':_[_0xc42d('0x2b')](_0x1d0d16,function(_0xec8a4d){if(_0xec8a4d['type']!=='VIRTUAL'){var _0x38114e={};_0x38114e[_0xec8a4d[_0xc42d('0x28')]]={'$like':'%'+_0x2a7285['query']['filter']+'%'};return _0x38114e;}})});}_0x52fc76=_[_0xc42d('0x3e')]({},_0x52fc76,_0x2a7285[_0xc42d('0x3f')]);var _0x18b52a={'where':_0x52fc76[_0xc42d('0x3c')]};return db[_0xc42d('0x2c')][_0xc42d('0x1e')](_0x18b52a)[_0xc42d('0x25')](function(_0x5da6d8){_0x506fb3['count']=_0x5da6d8;if(_0x2a7285[_0xc42d('0x33')]['includeAll']){_0x52fc76[_0xc42d('0x40')]=[{'all':!![]}];}return db[_0xc42d('0x2c')]['findAll'](_0x52fc76);})[_0xc42d('0x25')](function(_0x223e81){_0x506fb3[_0xc42d('0x41')]=_0x223e81;return _0x506fb3;})[_0xc42d('0x25')](respondWithFilteredResult(_0x89a811,_0x52fc76))[_0xc42d('0x42')](handleError(_0x89a811,null));};exports[_0xc42d('0x43')]=function(_0x589cd5,_0x3fa0ff){var _0x186be6={'raw':!![],'where':{'id':_0x589cd5[_0xc42d('0x44')]['id']}},_0x36ef68={};_0x36ef68[_0xc42d('0x31')]=_[_0xc42d('0x32')](db[_0xc42d('0x2c')][_0xc42d('0x2d')]);_0x36ef68[_0xc42d('0x33')]=_[_0xc42d('0x32')](_0x589cd5[_0xc42d('0x33')]);_0x36ef68[_0xc42d('0x34')]=_[_0xc42d('0x36')](_0x36ef68[_0xc42d('0x31')],_0x36ef68['query']);_0x186be6[_0xc42d('0x35')]=_[_0xc42d('0x36')](_0x36ef68[_0xc42d('0x31')],qs[_0xc42d('0x37')](_0x589cd5['query'][_0xc42d('0x37')]));_0x186be6['attributes']=_0x186be6[_0xc42d('0x35')][_0xc42d('0x38')]?_0x186be6[_0xc42d('0x35')]:_0x36ef68[_0xc42d('0x31')];if(_0x589cd5['query'][_0xc42d('0x45')]){_0x186be6['include']=[{'all':!![]}];}_0x186be6=_[_0xc42d('0x3e')]({},_0x186be6,_0x589cd5['options']);return db[_0xc42d('0x2c')][_0xc42d('0x46')](_0x186be6)[_0xc42d('0x25')](handleEntityNotFound(_0x3fa0ff,null))[_0xc42d('0x25')](respondWithResult(_0x3fa0ff,null))[_0xc42d('0x42')](handleError(_0x3fa0ff,null));};exports[_0xc42d('0x47')]=function(_0x38f010,_0xd5069f){return db[_0xc42d('0x2c')][_0xc42d('0x47')](_0x38f010[_0xc42d('0x48')],{})[_0xc42d('0x25')](respondWithResult(_0xd5069f,0xc9))[_0xc42d('0x42')](handleError(_0xd5069f,null));};exports[_0xc42d('0x24')]=function(_0x9f149c,_0xcc2d51){if(_0x9f149c[_0xc42d('0x48')]['id']){delete _0x9f149c[_0xc42d('0x48')]['id'];}return db[_0xc42d('0x2c')][_0xc42d('0x46')]({'where':{'id':_0x9f149c['params']['id']}})['then'](handleEntityNotFound(_0xcc2d51,null))[_0xc42d('0x25')](saveUpdates(_0x9f149c['body'],null))[_0xc42d('0x25')](respondWithResult(_0xcc2d51,null))[_0xc42d('0x42')](handleError(_0xcc2d51,null));};exports[_0xc42d('0x49')]=function(_0x13f55f,_0x5f33ab){return db['VtigerField'][_0xc42d('0x46')]({'where':{'id':_0x13f55f[_0xc42d('0x44')]['id']}})[_0xc42d('0x25')](handleEntityNotFound(_0x5f33ab,null))[_0xc42d('0x25')](removeEntity(_0x5f33ab,null))[_0xc42d('0x42')](handleError(_0x5f33ab,null));}; \ No newline at end of file +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 diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 80d3a5c..6f384e4 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 _0x7ac2=['api','moment','request-promise','path','rimraf','./intVtigerField.attributes','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x2ff739,_0x1c8e0f){var _0x12dc13=function(_0x26fc97){while(--_0x26fc97){_0x2ff739['push'](_0x2ff739['shift']());}};_0x12dc13(++_0x1c8e0f);}(_0x7ac2,0x12a));var _0x27ac=function(_0x308817,_0x269bbb){_0x308817=_0x308817-0x0;var _0x2992b8=_0x7ac2[_0x308817];return _0x2992b8;};'use strict';var _=require(_0x27ac('0x0'));var util=require('util');var logger=require(_0x27ac('0x1'))(_0x27ac('0x2'));var moment=require(_0x27ac('0x3'));var BPromise=require('bluebird');var rp=require(_0x27ac('0x4'));var fs=require('fs');var path=require(_0x27ac('0x5'));var rimraf=require(_0x27ac('0x6'));var config=require('../../config/environment');var attributes=require(_0x27ac('0x7'));module[_0x27ac('0x8')]=function(_0x5c2b86,_0x3fdce9){return _0x5c2b86[_0x27ac('0x9')](_0x27ac('0xa'),attributes,{'tableName':_0x27ac('0xb'),'paranoid':![],'indexes':[{'name':_0x27ac('0xc'),'fields':[_0x27ac('0xd'),_0x27ac('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 9c14d98..18adf72 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 _0xc9cc=['client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x35c762,_0x55cb13){var _0x1f0ae3=function(_0x515fd3){while(--_0x515fd3){_0x35c762['push'](_0x35c762['shift']());}};_0x1f0ae3(++_0x55cb13);}(_0xc9cc,0x162));var _0xcc9c=function(_0x15ed84,_0x589521){_0x15ed84=_0x15ed84-0x0;var _0x426d2b=_0xc9cc[_0x15ed84];return _0x426d2b;};'use strict';var _=require('lodash');var util=require(_0xcc9c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcc9c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc9c('0x2'))['db'];var utils=require(_0xcc9c('0x3'));var logger=require(_0xcc9c('0x4'))(_0xcc9c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc9c('0x6')][_0xcc9c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x360166,_0x4b4369,_0x559aad){return new BPromise(function(_0x22a083,_0x19418e){return client[_0xcc9c('0x8')](_0x360166,_0x559aad)[_0xcc9c('0x9')](function(_0x2d6af7){logger[_0xcc9c('0xa')](_0xcc9c('0xb'),_0x4b4369,_0xcc9c('0xc'));logger['debug'](_0xcc9c('0xd'),_0x4b4369,'request\x20sent',JSON[_0xcc9c('0xe')](_0x2d6af7));if(_0x2d6af7[_0xcc9c('0xf')]){if(_0x2d6af7['error']['code']===0x1f4){logger[_0xcc9c('0xf')](_0xcc9c('0xb'),_0x4b4369,_0x2d6af7['error'][_0xcc9c('0x10')]);return _0x19418e(_0x2d6af7[_0xcc9c('0xf')][_0xcc9c('0x10')]);}logger[_0xcc9c('0xf')]('VtigerField,\x20%s,\x20%s',_0x4b4369,_0x2d6af7['error']['message']);return _0x22a083(_0x2d6af7[_0xcc9c('0xf')][_0xcc9c('0x10')]);}else{logger[_0xcc9c('0xa')](_0xcc9c('0xb'),_0x4b4369,'request\x20sent');_0x22a083(_0x2d6af7['result'][_0xcc9c('0x10')]);}})[_0xcc9c('0x11')](function(_0x2ae6aa){logger['error'](_0xcc9c('0xb'),_0x4b4369,_0x2ae6aa);_0x19418e(_0x2ae6aa);});});} \ No newline at end of file +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 diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index e0dc2c4..58669e3 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 _0x33b5=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','/:id','destroy'];(function(_0x8a217e,_0x450bfc){var _0x3fc350=function(_0x55ed99){while(--_0x55ed99){_0x8a217e['push'](_0x8a217e['shift']());}};_0x3fc350(++_0x450bfc);}(_0x33b5,0x1cf));var _0x533b=function(_0x5116d3,_0x386d0b){_0x5116d3=_0x5116d3-0x0;var _0x552302=_0x33b5[_0x5116d3];return _0x552302;};'use strict';var multer=require('multer');var util=require(_0x533b('0x0'));var path=require(_0x533b('0x1'));var timeout=require(_0x533b('0x2'));var express=require('express');var router=express[_0x533b('0x3')]();var fs_extra=require(_0x533b('0x4'));var auth=require(_0x533b('0x5'));var interaction=require(_0x533b('0x6'));var config=require(_0x533b('0x7'));var controller=require(_0x533b('0x8'));router[_0x533b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x533b('0x9')]('/:id',auth[_0x533b('0xa')](),controller[_0x533b('0xb')]);router['get'](_0x533b('0xc'),auth[_0x533b('0xa')](),controller[_0x533b('0xd')]);router[_0x533b('0x9')](_0x533b('0xe'),auth[_0x533b('0xa')](),controller[_0x533b('0xf')]);router[_0x533b('0x10')]('/',auth[_0x533b('0xa')](),controller[_0x533b('0x11')]);router[_0x533b('0x10')](_0x533b('0xc'),auth[_0x533b('0xa')](),controller['addConfiguration']);router['put']('/:id',auth[_0x533b('0xa')](),controller[_0x533b('0x12')]);router['delete'](_0x533b('0x13'),auth[_0x533b('0xa')](),controller[_0x533b('0x14')]);module[_0x533b('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index cc0bd0f..91f8390 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 _0x66fa=['sequelize','exports','STRING','username','remoteUri','token','password','ENUM','integrationTab'];(function(_0x1ca917,_0x2bfbe7){var _0x3274ab=function(_0x19ef03){while(--_0x19ef03){_0x1ca917['push'](_0x1ca917['shift']());}};_0x3274ab(++_0x2bfbe7);}(_0x66fa,0x117));var _0xa66f=function(_0x34dbb7,_0x22e8a8){_0x34dbb7=_0x34dbb7-0x0;var _0x3669c4=_0x66fa[_0x34dbb7];return _0x3669c4;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa66f('0x2')]},'username':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x3')},'password':{'type':Sequelize[_0xa66f('0x2')]},'token':{'type':Sequelize[_0xa66f('0x2')]},'remoteUri':{'type':Sequelize[_0xa66f('0x2')],'unique':_0xa66f('0x4')},'authType':{'type':Sequelize['ENUM']('password',_0xa66f('0x5')),'defaultValue':_0xa66f('0x6')},'serverUrl':{'type':Sequelize[_0xa66f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa66f('0x7')](_0xa66f('0x8'),'newTab'),'defaultValue':_0xa66f('0x8')}}; \ No newline at end of file +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 diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index fd57d90..1f3c763 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 _0xcb91=['ZendeskAccount','rawAttributes','fieldName','key','map','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','findAll','rows','show','includeAll','include','find','create','body','params','catch','destroy','getConfigurations','keys','ZendeskConfiguration','addConfiguration','AccountId','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','findOne','username','password','token','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','%s/token:%s','base64','ValidationError','subject','group','assignee','remove','includes','position','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','update','then','error','stack','name','send','index'];(function(_0x5baed9,_0x409757){var _0x43aad3=function(_0x4e6713){while(--_0x4e6713){_0x5baed9['push'](_0x5baed9['shift']());}};_0x43aad3(++_0x409757);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x19e928,_0x26a0e4){_0x19e928=_0x19e928-0x0;var _0x4e941f=_0xcb91[_0x19e928];return _0x4e941f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5e3c19,_0x59dec3){_0x59dec3=_0x59dec3||0xcc;return function(_0x358866){if(_0x358866){return _0x5e3c19[_0x1cb9('0x16')](_0x59dec3);}return _0x5e3c19[_0x1cb9('0x17')](_0x59dec3)[_0x1cb9('0x18')]();};}function respondWithResult(_0x56884d,_0x397727){_0x397727=_0x397727||0xc8;return function(_0x6ef389){if(_0x6ef389){return _0x56884d[_0x1cb9('0x17')](_0x397727)[_0x1cb9('0x19')](_0x6ef389);}};}function respondWithFilteredResult(_0x3e2d11,_0x5806d8){return function(_0x5572cb){if(_0x5572cb){var _0xd446a3=typeof _0x5806d8[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x5806d8[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0xf22920=_0x5572cb[_0x1cb9('0x1d')];var _0x4e1340=_0xd446a3?0x0:_0x5806d8['offset'];var _0x1b2fa6=_0xd446a3?_0x5572cb[_0x1cb9('0x1d')]:_0x5806d8[_0x1cb9('0x1a')]+_0x5806d8[_0x1cb9('0x1c')];var _0x280a84;if(_0x1b2fa6>=_0xf22920){_0x1b2fa6=_0xf22920;_0x280a84=0xc8;}else{_0x280a84=0xce;}_0x3e2d11[_0x1cb9('0x17')](_0x280a84);return _0x3e2d11[_0x1cb9('0x1e')]('Content-Range',_0x4e1340+'-'+_0x1b2fa6+'/'+_0xf22920)['json'](_0x5572cb);}return null;};}function patchUpdates(_0x1a5a72){return function(_0x5dbfae){try{jsonpatch[_0x1cb9('0x1f')](_0x5dbfae,_0x1a5a72,!![]);}catch(_0x2265ea){return BPromise['reject'](_0x2265ea);}return _0x5dbfae['save']();};}function saveUpdates(_0x2e3854,_0x325637){return function(_0x103a63){if(_0x103a63){return _0x103a63[_0x1cb9('0x20')](_0x2e3854)[_0x1cb9('0x21')](function(_0x27db16){return _0x27db16;});}return null;};}function removeEntity(_0x59ebea,_0x55b232){return function(_0x6c6f61){if(_0x6c6f61){return _0x6c6f61['destroy']()[_0x1cb9('0x21')](function(){_0x59ebea[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x44d3c4,_0x43a100){return function(_0x53f9fa){if(!_0x53f9fa){_0x44d3c4[_0x1cb9('0x16')](0x194);}return _0x53f9fa;};}function handleError(_0x9df250,_0x4c8d76){_0x4c8d76=_0x4c8d76||0x1f4;return function(_0xd6891c){logger[_0x1cb9('0x22')](_0xd6891c[_0x1cb9('0x23')]);if(_0xd6891c[_0x1cb9('0x24')]){delete _0xd6891c[_0x1cb9('0x24')];}_0x9df250[_0x1cb9('0x17')](_0x4c8d76)[_0x1cb9('0x25')](_0xd6891c);};}exports[_0x1cb9('0x26')]=function(_0x41e5c2,_0x9de64b){var _0x48888d={},_0x405a2f={},_0x536635={'count':0x0,'rows':[]};var _0x110282=_['map'](db[_0x1cb9('0x27')][_0x1cb9('0x28')],function(_0x3cd7f5){return{'name':_0x3cd7f5[_0x1cb9('0x29')],'type':_0x3cd7f5['type'][_0x1cb9('0x2a')]};});_0x405a2f['model']=_[_0x1cb9('0x2b')](_0x110282,_0x1cb9('0x24'));_0x405a2f[_0x1cb9('0x2c')]=_['keys'](_0x41e5c2[_0x1cb9('0x2c')]);_0x405a2f['filters']=_[_0x1cb9('0x2d')](_0x405a2f['model'],_0x405a2f[_0x1cb9('0x2c')]);_0x48888d[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x405a2f[_0x1cb9('0x2f')],qs['fields'](_0x41e5c2[_0x1cb9('0x2c')][_0x1cb9('0x30')]));_0x48888d[_0x1cb9('0x2e')]=_0x48888d[_0x1cb9('0x2e')][_0x1cb9('0x31')]?_0x48888d[_0x1cb9('0x2e')]:_0x405a2f[_0x1cb9('0x2f')];if(!_0x41e5c2[_0x1cb9('0x2c')][_0x1cb9('0x32')](_0x1cb9('0x33'))){_0x48888d[_0x1cb9('0x1c')]=qs[_0x1cb9('0x1c')](_0x41e5c2[_0x1cb9('0x2c')]['limit']);_0x48888d['offset']=qs[_0x1cb9('0x1a')](_0x41e5c2[_0x1cb9('0x2c')][_0x1cb9('0x1a')]);}_0x48888d[_0x1cb9('0x34')]=qs[_0x1cb9('0x35')](_0x41e5c2[_0x1cb9('0x2c')][_0x1cb9('0x35')]);_0x48888d[_0x1cb9('0x36')]=qs['filters'](_[_0x1cb9('0x37')](_0x41e5c2[_0x1cb9('0x2c')],_0x405a2f[_0x1cb9('0x38')]),_0x110282);if(_0x41e5c2['query'][_0x1cb9('0x39')]){_0x48888d['where']=_[_0x1cb9('0x3a')](_0x48888d['where'],{'$or':_[_0x1cb9('0x2b')](_0x110282,function(_0x13d4fd){if(_0x13d4fd[_0x1cb9('0x3b')]!==_0x1cb9('0x3c')){var _0x34ada2={};_0x34ada2[_0x13d4fd[_0x1cb9('0x24')]]={'$like':'%'+_0x41e5c2[_0x1cb9('0x2c')]['filter']+'%'};return _0x34ada2;}})});}_0x48888d=_['merge']({},_0x48888d,_0x41e5c2[_0x1cb9('0x3d')]);var _0x1d2723={'where':_0x48888d[_0x1cb9('0x36')]};return db[_0x1cb9('0x27')][_0x1cb9('0x1d')](_0x1d2723)[_0x1cb9('0x21')](function(_0x32130b){_0x536635['count']=_0x32130b;if(_0x41e5c2[_0x1cb9('0x2c')]['includeAll']){_0x48888d['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x1cb9('0x3e')](_0x48888d);})[_0x1cb9('0x21')](function(_0x1bf51c){_0x536635[_0x1cb9('0x3f')]=_0x1bf51c;return _0x536635;})[_0x1cb9('0x21')](respondWithFilteredResult(_0x9de64b,_0x48888d))['catch'](handleError(_0x9de64b,null));};exports[_0x1cb9('0x40')]=function(_0x523866,_0x91121){var _0x71db9d={'raw':![],'where':{'id':_0x523866['params']['id']}},_0x38d973={};_0x38d973[_0x1cb9('0x2f')]=_['keys'](db[_0x1cb9('0x27')][_0x1cb9('0x28')]);_0x38d973['query']=_['keys'](_0x523866[_0x1cb9('0x2c')]);_0x38d973[_0x1cb9('0x38')]=_[_0x1cb9('0x2d')](_0x38d973[_0x1cb9('0x2f')],_0x38d973[_0x1cb9('0x2c')]);_0x71db9d['attributes']=_[_0x1cb9('0x2d')](_0x38d973['model'],qs['fields'](_0x523866['query'][_0x1cb9('0x30')]));_0x71db9d[_0x1cb9('0x2e')]=_0x71db9d[_0x1cb9('0x2e')][_0x1cb9('0x31')]?_0x71db9d[_0x1cb9('0x2e')]:_0x38d973[_0x1cb9('0x2f')];if(_0x523866[_0x1cb9('0x2c')][_0x1cb9('0x41')]){_0x71db9d[_0x1cb9('0x42')]=[{'all':!![]}];}_0x71db9d=_[_0x1cb9('0x3a')]({},_0x71db9d,_0x523866[_0x1cb9('0x3d')]);return db['ZendeskAccount'][_0x1cb9('0x43')](_0x71db9d)[_0x1cb9('0x21')](handleEntityNotFound(_0x91121,null))[_0x1cb9('0x21')](respondWithResult(_0x91121,null))['catch'](handleError(_0x91121,null));};exports[_0x1cb9('0x44')]=function(_0x57251,_0x3c6044){return db[_0x1cb9('0x27')][_0x1cb9('0x44')](_0x57251['body'],{})[_0x1cb9('0x21')](respondWithResult(_0x3c6044,0xc9))['catch'](handleError(_0x3c6044,null));};exports[_0x1cb9('0x20')]=function(_0x4ac483,_0x1cf2ee){if(_0x4ac483[_0x1cb9('0x45')]['id']){delete _0x4ac483[_0x1cb9('0x45')]['id'];}return db[_0x1cb9('0x27')]['find']({'where':{'id':_0x4ac483[_0x1cb9('0x46')]['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x1cf2ee,null))[_0x1cb9('0x21')](saveUpdates(_0x4ac483[_0x1cb9('0x45')],null))[_0x1cb9('0x21')](respondWithResult(_0x1cf2ee,null))[_0x1cb9('0x47')](handleError(_0x1cf2ee,null));};exports[_0x1cb9('0x48')]=function(_0x3b6a92,_0xbb500e){return db[_0x1cb9('0x27')]['find']({'where':{'id':_0x3b6a92['params']['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0xbb500e,null))[_0x1cb9('0x21')](removeEntity(_0xbb500e,null))[_0x1cb9('0x47')](handleError(_0xbb500e,null));};exports[_0x1cb9('0x49')]=function(_0x20b253,_0x2d076b,_0x367dd7){var _0x1c4ff6={};var _0x36c53a={};var _0x166ca2;var _0x4a4b87;return db[_0x1cb9('0x27')]['findOne']({'where':{'id':_0x20b253[_0x1cb9('0x46')]['id']}})['then'](handleEntityNotFound(_0x2d076b,null))[_0x1cb9('0x21')](function(_0x53c002){if(_0x53c002){_0x166ca2=_0x53c002;_0x36c53a['model']=_[_0x1cb9('0x4a')](db[_0x1cb9('0x4b')][_0x1cb9('0x28')]);_0x36c53a['query']=_[_0x1cb9('0x4a')](_0x20b253[_0x1cb9('0x2c')]);_0x36c53a['filters']=_['intersection'](_0x36c53a[_0x1cb9('0x2f')],_0x36c53a[_0x1cb9('0x2c')]);_0x1c4ff6[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x36c53a[_0x1cb9('0x2f')],qs[_0x1cb9('0x30')](_0x20b253[_0x1cb9('0x2c')]['fields']));_0x1c4ff6[_0x1cb9('0x2e')]=_0x1c4ff6[_0x1cb9('0x2e')][_0x1cb9('0x31')]?_0x1c4ff6['attributes']:_0x36c53a[_0x1cb9('0x2f')];_0x1c4ff6[_0x1cb9('0x34')]=qs[_0x1cb9('0x35')](_0x20b253[_0x1cb9('0x2c')][_0x1cb9('0x35')]);_0x1c4ff6[_0x1cb9('0x36')]=qs['filters'](_[_0x1cb9('0x37')](_0x20b253[_0x1cb9('0x2c')],_0x36c53a[_0x1cb9('0x38')]));if(_0x20b253[_0x1cb9('0x2c')][_0x1cb9('0x39')]){_0x1c4ff6[_0x1cb9('0x36')]=_[_0x1cb9('0x3a')](_0x1c4ff6[_0x1cb9('0x36')],{'$or':_[_0x1cb9('0x2b')](_0x1c4ff6[_0x1cb9('0x2e')],function(_0x370c97){var _0x55fb51={};_0x55fb51[_0x370c97]={'$like':'%'+_0x20b253[_0x1cb9('0x2c')][_0x1cb9('0x39')]+'%'};return _0x55fb51;})});}_0x1c4ff6=_[_0x1cb9('0x3a')]({},_0x1c4ff6,_0x20b253[_0x1cb9('0x3d')]);return _0x166ca2['getConfigurations'](_0x1c4ff6);}})['then'](function(_0x319358){if(_0x319358){_0x4a4b87=_0x319358[_0x1cb9('0x31')];if(!_0x20b253[_0x1cb9('0x2c')][_0x1cb9('0x32')](_0x1cb9('0x33'))){_0x1c4ff6[_0x1cb9('0x1c')]=qs[_0x1cb9('0x1c')](_0x20b253[_0x1cb9('0x2c')]['limit']);_0x1c4ff6['offset']=qs[_0x1cb9('0x1a')](_0x20b253['query']['offset']);}return _0x166ca2['getConfigurations'](_0x1c4ff6);}})['then'](function(_0x5d349b){if(_0x5d349b){return _0x5d349b?{'count':_0x4a4b87,'rows':_0x5d349b}:null;}})[_0x1cb9('0x21')](respondWithResult(_0x2d076b,null))[_0x1cb9('0x47')](handleError(_0x2d076b,null));};exports[_0x1cb9('0x4c')]=function(_0x43bafc,_0x23d435,_0xccbee3){if(_0x43bafc['body']['id']){delete _0x43bafc[_0x1cb9('0x45')]['id'];}return db[_0x1cb9('0x27')]['findOne']({'where':{'id':_0x43bafc['params']['id']}})[_0x1cb9('0x21')](handleEntityNotFound(_0x23d435,null))[_0x1cb9('0x21')](function(_0x2e818f){if(_0x2e818f){_0x43bafc[_0x1cb9('0x45')][_0x1cb9('0x4d')]=_0x2e818f['id'];_0x43bafc['body']['Subjects']=integrations['getSubjects'](_0x43bafc[_0x1cb9('0x45')][_0x1cb9('0x4e')],_0x43bafc[_0x1cb9('0x45')][_0x1cb9('0x3b')]);_0x43bafc[_0x1cb9('0x45')]['Descriptions']=integrations[_0x1cb9('0x4f')](_0x43bafc[_0x1cb9('0x45')]['channel'],_0x43bafc['body'][_0x1cb9('0x3b')]);return db['ZendeskConfiguration'][_0x1cb9('0x44')](_0x43bafc[_0x1cb9('0x45')],{'include':[{'model':db[_0x1cb9('0x50')],'as':_0x1cb9('0x51')},{'model':db[_0x1cb9('0x50')],'as':_0x1cb9('0x52')}]});}return null;})['then'](respondWithResult(_0x23d435,null))[_0x1cb9('0x47')](handleError(_0x23d435,null));};exports[_0x1cb9('0x53')]=function(_0x330fc1,_0x17c361,_0x5b5f0d){var _0x520d98='';return db[_0x1cb9('0x27')][_0x1cb9('0x54')]({'where':{'id':_0x330fc1[_0x1cb9('0x46')]['id']},'attributes':['id',_0x1cb9('0x55'),_0x1cb9('0x56'),_0x1cb9('0x57'),'authType',_0x1cb9('0x58')]})['then'](handleEntityNotFound(_0x17c361,null))[_0x1cb9('0x21')](function(_0x26dae9){if(_0x26dae9){_0x520d98=_0x26dae9['remoteUri'];var _0xf5b006=_0x520d98[_0x1cb9('0x59')](-0x1);if(_0xf5b006==='/'){_0x520d98=_0x520d98[_0x1cb9('0x5a')](0x0,_0x520d98['lastIndexOf'](_0xf5b006));}var _0x1b4878={'method':_0x1cb9('0x5b'),'uri':util[_0x1cb9('0x5c')](_0x1cb9('0x5d'),_0x520d98,_0x1cb9('0x5e')),'json':!![]};switch(_0x26dae9[_0x1cb9('0x5f')]){case'password':_0x1b4878[_0x1cb9('0x60')]={'Authorization':util[_0x1cb9('0x5c')](_0x1cb9('0x61'),new Buffer(util[_0x1cb9('0x5c')](_0x1cb9('0x62'),_0x26dae9[_0x1cb9('0x55')],_0x26dae9[_0x1cb9('0x56')]))[_0x1cb9('0x63')]('base64'))};break;case _0x1cb9('0x57'):_0x1b4878[_0x1cb9('0x60')]={'Authorization':util['format'](_0x1cb9('0x61'),new Buffer(util['format'](_0x1cb9('0x64'),_0x26dae9['username'],_0x26dae9['token']))[_0x1cb9('0x63')](_0x1cb9('0x65')))};break;default:throw new db['Sequelize'][(_0x1cb9('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x1b4878);}})[_0x1cb9('0x21')](function(_0x7ecb4e){if(_0x7ecb4e){var _0x399986=[_0x1cb9('0x67'),'description',_0x1cb9('0x68'),_0x1cb9('0x69')];_[_0x1cb9('0x6a')](_0x7ecb4e[_0x1cb9('0x5e')],function(_0x4f8d74){return _0x399986[_0x1cb9('0x6b')](_0x4f8d74['type']);});return{'count':_0x7ecb4e[_0x1cb9('0x5e')][_0x1cb9('0x31')],'rows':_[_0x1cb9('0x2b')](_0x7ecb4e[_0x1cb9('0x5e')],function(_0x102f2c){return{'id':_0x102f2c['id'],'name':_0x102f2c[_0x1cb9('0x6c')]>0x7?_0x102f2c['title']:_0x102f2c[_0x1cb9('0x3b')],'custom':_0x102f2c[_0x1cb9('0x6c')]>0x7?!![]:![],'options':_0x102f2c['system_field_options']?_0x102f2c[_0x1cb9('0x6d')]:_0x102f2c[_0x1cb9('0x6e')]?_0x102f2c[_0x1cb9('0x6e')]:[]};})};}})[_0x1cb9('0x21')](respondWithResult(_0x17c361,null))[_0x1cb9('0x47')](function(_0x209dc7){var _0x423aae=_0x330fc1['query'][_0x1cb9('0x6f')]?0x1f4:_0x209dc7['statusCode']||0x1f4;logger[_0x1cb9('0x22')](_0x1cb9('0x70'),'getFields',_0x423aae,JSON[_0x1cb9('0x71')](_0x209dc7));delete _0x209dc7[_0x1cb9('0x24')];if(_0x423aae===0x191){_0x423aae=0x190;}_0x17c361[_0x1cb9('0x17')](_0x423aae)[_0x1cb9('0x25')](_0x330fc1['query'][_0x1cb9('0x6f')]?{'message':_0x1cb9('0x72'),'statusCode':_0x209dc7[_0x1cb9('0x73')]}:_0x209dc7);});}; \ No newline at end of file +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 diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 304c326..0077ec2 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 _0x8ea2=['request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x221840,_0x2a5fb7){var _0x4706e3=function(_0x342cee){while(--_0x342cee){_0x221840['push'](_0x221840['shift']());}};_0x4706e3(++_0x2a5fb7);}(_0x8ea2,0xea));var _0x28ea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ea2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28ea('0x0'));var util=require(_0x28ea('0x1'));var logger=require(_0x28ea('0x2'))(_0x28ea('0x3'));var moment=require(_0x28ea('0x4'));var BPromise=require(_0x28ea('0x5'));var rp=require(_0x28ea('0x6'));var fs=require('fs');var path=require(_0x28ea('0x7'));var rimraf=require(_0x28ea('0x8'));var config=require(_0x28ea('0x9'));var attributes=require(_0x28ea('0xa'));var integrations=require(_0x28ea('0xb'));module['exports']=function(_0x275026,_0x4870b2){return _0x275026[_0x28ea('0xc')](_0x28ea('0xd'),attributes,{'tableName':_0x28ea('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index 7161b7e..cee4bbf 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 _0xb664=['request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetZendeskAccount','ShowZendeskAccount','ZendeskAccount','find','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZendeskAccount,\x20%s,\x20%s'];(function(_0xa3463d,_0x32f8da){var _0x50fd67=function(_0xb984fd){while(--_0xb984fd){_0xa3463d['push'](_0xa3463d['shift']());}};_0x50fd67(++_0x32f8da);}(_0xb664,0x151));var _0x4b66=function(_0x585d40,_0x17a75e){_0x585d40=_0x585d40-0x0;var _0xd1dc8a=_0xb664[_0x585d40];return _0xd1dc8a;};'use strict';var _=require('lodash');var util=require(_0x4b66('0x0'));var moment=require('moment');var BPromise=require(_0x4b66('0x1'));var rs=require(_0x4b66('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4b66('0x3'))['db'];var utils=require(_0x4b66('0x4'));var logger=require(_0x4b66('0x5'))(_0x4b66('0x6'));var config=require(_0x4b66('0x7'));var jayson=require(_0x4b66('0x8'));var client=jayson['client'][_0x4b66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x482a51,_0x20fb5d,_0x2e8200){return new BPromise(function(_0x507e8c,_0x56159e){return client[_0x4b66('0xa')](_0x482a51,_0x2e8200)[_0x4b66('0xb')](function(_0x42c3f9){logger['info'](_0x4b66('0xc'),_0x20fb5d,_0x4b66('0xd'));logger[_0x4b66('0xe')](_0x4b66('0xf'),_0x20fb5d,_0x4b66('0xd'),JSON[_0x4b66('0x10')](_0x42c3f9));if(_0x42c3f9[_0x4b66('0x11')]){if(_0x42c3f9[_0x4b66('0x11')][_0x4b66('0x12')]===0x1f4){logger[_0x4b66('0x11')](_0x4b66('0xc'),_0x20fb5d,_0x42c3f9[_0x4b66('0x11')][_0x4b66('0x13')]);return _0x56159e(_0x42c3f9[_0x4b66('0x11')][_0x4b66('0x13')]);}logger[_0x4b66('0x11')](_0x4b66('0xc'),_0x20fb5d,_0x42c3f9['error']['message']);return _0x507e8c(_0x42c3f9[_0x4b66('0x11')]['message']);}else{logger[_0x4b66('0x14')](_0x4b66('0xc'),_0x20fb5d,_0x4b66('0xd'));_0x507e8c(_0x42c3f9['result'][_0x4b66('0x13')]);}})[_0x4b66('0x15')](function(_0x55e1be){logger[_0x4b66('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x20fb5d,_0x55e1be);_0x56159e(_0x55e1be);});});}exports['GetZendeskAccount']=function(_0x4e9bb2){var _0x18a41d=this;return new Promise(function(_0x1b56f8,_0x4c5fbf){return db['ZendeskAccount'][_0x4b66('0x16')]({'raw':_0x4e9bb2[_0x4b66('0x17')]?_0x4e9bb2['options'][_0x4b66('0x18')]===undefined?!![]:![]:!![],'where':_0x4e9bb2['options']?_0x4e9bb2[_0x4b66('0x17')][_0x4b66('0x19')]||null:null,'attributes':_0x4e9bb2['options']?_0x4e9bb2[_0x4b66('0x17')]['attributes']||null:null,'limit':_0x4e9bb2['options']?_0x4e9bb2[_0x4b66('0x17')][_0x4b66('0x1a')]||null:null,'include':_0x4e9bb2[_0x4b66('0x17')]?_0x4e9bb2[_0x4b66('0x17')][_0x4b66('0x1b')]?_[_0x4b66('0x1c')](_0x4e9bb2['options'][_0x4b66('0x1b')],function(_0x11fd52){return{'model':db[_0x11fd52[_0x4b66('0x1d')]],'as':_0x11fd52['as'],'attributes':_0x11fd52[_0x4b66('0x1e')],'include':_0x11fd52[_0x4b66('0x1b')]?_[_0x4b66('0x1c')](_0x11fd52['include'],function(_0x4e03ee){return{'model':db[_0x4e03ee['model']],'as':_0x4e03ee['as'],'attributes':_0x4e03ee[_0x4b66('0x1e')],'include':_0x4e03ee[_0x4b66('0x1b')]?_[_0x4b66('0x1c')](_0x4e03ee[_0x4b66('0x1b')],function(_0x459982){return{'model':db[_0x459982[_0x4b66('0x1d')]],'as':_0x459982['as'],'attributes':_0x459982[_0x4b66('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b66('0xb')](function(_0xc09c19){logger['info'](_0x4b66('0x1f'),_0x4e9bb2);logger[_0x4b66('0xe')](_0x4b66('0x1f'),_0x4e9bb2,JSON[_0x4b66('0x10')](_0xc09c19));_0x1b56f8(_0xc09c19);})['catch'](function(_0x3d6c6a){logger[_0x4b66('0x11')]('GetZendeskAccount',_0x3d6c6a[_0x4b66('0x13')],_0x4e9bb2);_0x4c5fbf(_0x18a41d[_0x4b66('0x11')](0x1f4,_0x3d6c6a[_0x4b66('0x13')]));});});};exports[_0x4b66('0x20')]=function(_0x46ec79){var _0x29498f=this;return new Promise(function(_0x20f850,_0x167c03){return db[_0x4b66('0x21')][_0x4b66('0x22')]({'raw':_0x46ec79[_0x4b66('0x17')]?_0x46ec79[_0x4b66('0x17')][_0x4b66('0x18')]===undefined?!![]:![]:!![],'where':_0x46ec79[_0x4b66('0x17')]?_0x46ec79[_0x4b66('0x17')][_0x4b66('0x19')]||null:null,'attributes':_0x46ec79[_0x4b66('0x17')]?_0x46ec79[_0x4b66('0x17')][_0x4b66('0x1e')]||null:null,'include':_0x46ec79['options']?_0x46ec79[_0x4b66('0x17')][_0x4b66('0x1b')]?_[_0x4b66('0x1c')](_0x46ec79['options']['include'],function(_0x32e431){return{'model':db[_0x32e431[_0x4b66('0x1d')]],'as':_0x32e431['as'],'attributes':_0x32e431[_0x4b66('0x1e')],'include':_0x32e431[_0x4b66('0x1b')]?_['map'](_0x32e431[_0x4b66('0x1b')],function(_0x17b7ae){return{'model':db[_0x17b7ae[_0x4b66('0x1d')]],'as':_0x17b7ae['as'],'attributes':_0x17b7ae['attributes'],'include':_0x17b7ae['include']?_[_0x4b66('0x1c')](_0x17b7ae['include'],function(_0x511db5){return{'model':db[_0x511db5[_0x4b66('0x1d')]],'as':_0x511db5['as'],'attributes':_0x511db5[_0x4b66('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4b66('0xb')](function(_0x45660d){logger[_0x4b66('0x14')]('ShowZendeskAccount',_0x46ec79);logger[_0x4b66('0xe')](_0x4b66('0x20'),_0x46ec79,JSON[_0x4b66('0x10')](_0x45660d));_0x20f850(_0x45660d);})[_0x4b66('0x15')](function(_0x129e8a){logger['error'](_0x4b66('0x20'),_0x129e8a[_0x4b66('0x13')],_0x46ec79);_0x167c03(_0x29498f[_0x4b66('0x11')](0x1f4,_0x129e8a['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 3030ecf..4563056 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 _0x91a7=['util','path','connect-timeout','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','put','update','destroy','exports'];(function(_0x1f05cd,_0x266976){var _0x15a402=function(_0xa8681c){while(--_0xa8681c){_0x1f05cd['push'](_0x1f05cd['shift']());}};_0x15a402(++_0x266976);}(_0x91a7,0xe7));var _0x791a=function(_0x3031b3,_0x94535b){_0x3031b3=_0x3031b3-0x0;var _0x3618f2=_0x91a7[_0x3031b3];return _0x3618f2;};'use strict';var multer=require('multer');var util=require(_0x791a('0x0'));var path=require(_0x791a('0x1'));var timeout=require(_0x791a('0x2'));var express=require('express');var router=express[_0x791a('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x791a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x791a('0x5'));router[_0x791a('0x6')]('/',auth['isAuthenticated'](),controller[_0x791a('0x7')]);router['get'](_0x791a('0x8'),auth[_0x791a('0x9')](),controller['show']);router[_0x791a('0x6')](_0x791a('0xa'),auth[_0x791a('0x9')](),controller[_0x791a('0xb')]);router[_0x791a('0x6')]('/:id/subjects',auth[_0x791a('0x9')](),controller[_0x791a('0xc')]);router['get'](_0x791a('0xd'),auth[_0x791a('0x9')](),controller[_0x791a('0xe')]);router[_0x791a('0x6')](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['getTags']);router['post']('/',auth[_0x791a('0x9')](),controller[_0x791a('0x10')]);router['post'](_0x791a('0xf'),auth[_0x791a('0x9')](),controller['setTags']);router[_0x791a('0x11')](_0x791a('0x8'),auth[_0x791a('0x9')](),controller[_0x791a('0x12')]);router['delete'](_0x791a('0x8'),auth['isAuthenticated'](),controller[_0x791a('0x13')]);module[_0x791a('0x14')]=router; \ No newline at end of file +var _0xea28=['Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index a69c14c..fb1bcbb 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 _0xdf67=['STRING','sequelize','exports'];(function(_0x67bb02,_0x52174d){var _0x1ca085=function(_0xf6ecbd){while(--_0xf6ecbd){_0x67bb02['push'](_0x67bb02['shift']());}};_0x1ca085(++_0x52174d);}(_0xdf67,0x1a5));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x7df6('0x0'));module[_0x7df6('0x1')]={'name':{'type':Sequelize[_0x7df6('0x2')]},'description':{'type':Sequelize[_0x7df6('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 4728eb0..f805c78 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 _0x0554=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','then','include','rows','show','params','includeAll','find','catch','create','body','getFields','findOne','ZendeskField','merge','nolimit','getSubjects','getDescriptions','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','reject','save','update','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x0554,0x16c));var _0x4055=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x0554[_0x5c351c];return _0x26f3b3;};'use strict';var emlformat=require(_0x4055('0x0'));var rimraf=require(_0x4055('0x1'));var zipdir=require(_0x4055('0x2'));var jsonpatch=require(_0x4055('0x3'));var rp=require('request-promise');var moment=require(_0x4055('0x4'));var BPromise=require(_0x4055('0x5'));var Mustache=require(_0x4055('0x6'));var util=require(_0x4055('0x7'));var path=require(_0x4055('0x8'));var sox=require(_0x4055('0x9'));var csv=require(_0x4055('0xa'));var ejs=require(_0x4055('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4055('0xc'));var squel=require(_0x4055('0xd'));var crypto=require(_0x4055('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4055('0xf'));var toCsv=require(_0x4055('0xa'));var querystring=require(_0x4055('0x10'));var Papa=require(_0x4055('0x11'));var Redis=require('ioredis');var authService=require(_0x4055('0x12'));var qs=require(_0x4055('0x13'));var as=require(_0x4055('0x14'));var hardwareService=require(_0x4055('0x15'));var logger=require(_0x4055('0x16'))(_0x4055('0x17'));var utils=require('../../config/utils');var config=require(_0x4055('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4055('0x19'))['db'];function respondWithStatusCode(_0x1c4997,_0x27f8df){_0x27f8df=_0x27f8df||0xcc;return function(_0x18fafb){if(_0x18fafb){return _0x1c4997[_0x4055('0x1a')](_0x27f8df);}return _0x1c4997[_0x4055('0x1b')](_0x27f8df)[_0x4055('0x1c')]();};}function respondWithResult(_0x3e730c,_0x317b75){_0x317b75=_0x317b75||0xc8;return function(_0x354478){if(_0x354478){return _0x3e730c['status'](_0x317b75)['json'](_0x354478);}};}function respondWithFilteredResult(_0x927d86,_0x5baa5e){return function(_0x166123){if(_0x166123){var _0x1979be=typeof _0x5baa5e[_0x4055('0x1d')]===_0x4055('0x1e')&&typeof _0x5baa5e[_0x4055('0x1f')]===_0x4055('0x1e');var _0x3deff9=_0x166123['count'];var _0x47d174=_0x1979be?0x0:_0x5baa5e[_0x4055('0x1d')];var _0x36f539=_0x1979be?_0x166123[_0x4055('0x20')]:_0x5baa5e[_0x4055('0x1d')]+_0x5baa5e[_0x4055('0x1f')];var _0x54554c;if(_0x36f539>=_0x3deff9){_0x36f539=_0x3deff9;_0x54554c=0xc8;}else{_0x54554c=0xce;}_0x927d86['status'](_0x54554c);return _0x927d86['set']('Content-Range',_0x47d174+'-'+_0x36f539+'/'+_0x3deff9)['json'](_0x166123);}return null;};}function patchUpdates(_0xa4c19){return function(_0xd6eda9){try{jsonpatch['apply'](_0xd6eda9,_0xa4c19,!![]);}catch(_0x16b615){return BPromise[_0x4055('0x21')](_0x16b615);}return _0xd6eda9[_0x4055('0x22')]();};}function saveUpdates(_0x90ba8f,_0x3470f2){return function(_0x4e7f24){if(_0x4e7f24){return _0x4e7f24[_0x4055('0x23')](_0x90ba8f)['then'](function(_0x85ec80){return _0x85ec80;});}return null;};}function removeEntity(_0x157bc6,_0x3f040b){return function(_0x1e0584){if(_0x1e0584){return _0x1e0584[_0x4055('0x24')]()['then'](function(){_0x157bc6[_0x4055('0x1b')](0xcc)[_0x4055('0x1c')]();});}};}function handleEntityNotFound(_0x2ed801,_0x2f098b){return function(_0x10b1b3){if(!_0x10b1b3){_0x2ed801['sendStatus'](0x194);}return _0x10b1b3;};}function handleError(_0xc3caed,_0x176b08){_0x176b08=_0x176b08||0x1f4;return function(_0x8a4481){logger[_0x4055('0x25')](_0x8a4481[_0x4055('0x26')]);if(_0x8a4481[_0x4055('0x27')]){delete _0x8a4481[_0x4055('0x27')];}_0xc3caed[_0x4055('0x1b')](_0x176b08)[_0x4055('0x28')](_0x8a4481);};}exports[_0x4055('0x29')]=function(_0x3813e2,_0x5c7595){var _0x37611c={},_0x56713b={},_0x24a09f={'count':0x0,'rows':[]};var _0x135372=_[_0x4055('0x2a')](db[_0x4055('0x2b')][_0x4055('0x2c')],function(_0x47cd7c){return{'name':_0x47cd7c[_0x4055('0x2d')],'type':_0x47cd7c['type'][_0x4055('0x2e')]};});_0x56713b[_0x4055('0x2f')]=_[_0x4055('0x2a')](_0x135372,_0x4055('0x27'));_0x56713b['query']=_[_0x4055('0x30')](_0x3813e2[_0x4055('0x31')]);_0x56713b[_0x4055('0x32')]=_[_0x4055('0x33')](_0x56713b[_0x4055('0x2f')],_0x56713b[_0x4055('0x31')]);_0x37611c[_0x4055('0x34')]=_[_0x4055('0x33')](_0x56713b[_0x4055('0x2f')],qs['fields'](_0x3813e2[_0x4055('0x31')][_0x4055('0x35')]));_0x37611c[_0x4055('0x34')]=_0x37611c[_0x4055('0x34')][_0x4055('0x36')]?_0x37611c[_0x4055('0x34')]:_0x56713b['model'];if(!_0x3813e2[_0x4055('0x31')][_0x4055('0x37')]('nolimit')){_0x37611c['limit']=qs['limit'](_0x3813e2['query'][_0x4055('0x1f')]);_0x37611c[_0x4055('0x1d')]=qs['offset'](_0x3813e2[_0x4055('0x31')][_0x4055('0x1d')]);}_0x37611c[_0x4055('0x38')]=qs[_0x4055('0x39')](_0x3813e2[_0x4055('0x31')][_0x4055('0x39')]);_0x37611c[_0x4055('0x3a')]=qs[_0x4055('0x32')](_[_0x4055('0x3b')](_0x3813e2[_0x4055('0x31')],_0x56713b[_0x4055('0x32')]),_0x135372);if(_0x3813e2[_0x4055('0x31')][_0x4055('0x3c')]){_0x37611c[_0x4055('0x3a')]=_['merge'](_0x37611c[_0x4055('0x3a')],{'$or':_['map'](_0x135372,function(_0xcc4e23){if(_0xcc4e23['type']!==_0x4055('0x3d')){var _0x5b1a1e={};_0x5b1a1e[_0xcc4e23['name']]={'$like':'%'+_0x3813e2['query'][_0x4055('0x3c')]+'%'};return _0x5b1a1e;}})});}_0x37611c=_['merge']({},_0x37611c,_0x3813e2[_0x4055('0x3e')]);var _0x473234={'where':_0x37611c[_0x4055('0x3a')]};return db[_0x4055('0x2b')][_0x4055('0x20')](_0x473234)[_0x4055('0x3f')](function(_0x2b9541){_0x24a09f['count']=_0x2b9541;if(_0x3813e2[_0x4055('0x31')]['includeAll']){_0x37611c[_0x4055('0x40')]=[{'all':!![]}];}return db[_0x4055('0x2b')]['findAll'](_0x37611c);})['then'](function(_0x53ca5a){_0x24a09f[_0x4055('0x41')]=_0x53ca5a;return _0x24a09f;})['then'](respondWithFilteredResult(_0x5c7595,_0x37611c))['catch'](handleError(_0x5c7595,null));};exports[_0x4055('0x42')]=function(_0x2396ca,_0x156e62){var _0x316bef={'raw':![],'where':{'id':_0x2396ca[_0x4055('0x43')]['id']}},_0x3122c9={};_0x3122c9[_0x4055('0x2f')]=_[_0x4055('0x30')](db['ZendeskConfiguration'][_0x4055('0x2c')]);_0x3122c9[_0x4055('0x31')]=_['keys'](_0x2396ca[_0x4055('0x31')]);_0x3122c9[_0x4055('0x32')]=_['intersection'](_0x3122c9[_0x4055('0x2f')],_0x3122c9[_0x4055('0x31')]);_0x316bef[_0x4055('0x34')]=_[_0x4055('0x33')](_0x3122c9[_0x4055('0x2f')],qs[_0x4055('0x35')](_0x2396ca[_0x4055('0x31')][_0x4055('0x35')]));_0x316bef['attributes']=_0x316bef[_0x4055('0x34')][_0x4055('0x36')]?_0x316bef['attributes']:_0x3122c9[_0x4055('0x2f')];if(_0x2396ca[_0x4055('0x31')][_0x4055('0x44')]){_0x316bef['include']=[{'all':!![]}];}_0x316bef=_['merge']({},_0x316bef,_0x2396ca[_0x4055('0x3e')]);return db[_0x4055('0x2b')][_0x4055('0x45')](_0x316bef)[_0x4055('0x3f')](handleEntityNotFound(_0x156e62,null))['then'](respondWithResult(_0x156e62,null))[_0x4055('0x46')](handleError(_0x156e62,null));};exports[_0x4055('0x47')]=function(_0x413072,_0x2ffb8f){return db[_0x4055('0x2b')][_0x4055('0x47')](_0x413072[_0x4055('0x48')],{})[_0x4055('0x3f')](respondWithResult(_0x2ffb8f,0xc9))[_0x4055('0x46')](handleError(_0x2ffb8f,null));};exports[_0x4055('0x23')]=function(_0x4831e2,_0x305317){if(_0x4831e2['body']['id']){delete _0x4831e2[_0x4055('0x48')]['id'];}return db[_0x4055('0x2b')][_0x4055('0x45')]({'where':{'id':_0x4831e2['params']['id']}})[_0x4055('0x3f')](handleEntityNotFound(_0x305317,null))[_0x4055('0x3f')](saveUpdates(_0x4831e2[_0x4055('0x48')],null))[_0x4055('0x3f')](respondWithResult(_0x305317,null))[_0x4055('0x46')](handleError(_0x305317,null));};exports[_0x4055('0x24')]=function(_0x3bbaf1,_0x1ec76e){return db[_0x4055('0x2b')][_0x4055('0x45')]({'where':{'id':_0x3bbaf1[_0x4055('0x43')]['id']}})[_0x4055('0x3f')](handleEntityNotFound(_0x1ec76e,null))[_0x4055('0x3f')](removeEntity(_0x1ec76e,null))[_0x4055('0x46')](handleError(_0x1ec76e,null));};exports[_0x4055('0x49')]=function(_0x565227,_0x1be082,_0x25e4a8){var _0x4bdd8c={};var _0x27bcf6={};var _0x7a65a8;var _0x58bdd6;return db[_0x4055('0x2b')][_0x4055('0x4a')]({'where':{'id':_0x565227[_0x4055('0x43')]['id']}})[_0x4055('0x3f')](handleEntityNotFound(_0x1be082,null))[_0x4055('0x3f')](function(_0x480a9c){if(_0x480a9c){_0x7a65a8=_0x480a9c;_0x27bcf6[_0x4055('0x2f')]=_['keys'](db[_0x4055('0x4b')][_0x4055('0x2c')]);_0x27bcf6[_0x4055('0x31')]=_[_0x4055('0x30')](_0x565227[_0x4055('0x31')]);_0x27bcf6[_0x4055('0x32')]=_[_0x4055('0x33')](_0x27bcf6[_0x4055('0x2f')],_0x27bcf6['query']);_0x4bdd8c[_0x4055('0x34')]=_['intersection'](_0x27bcf6[_0x4055('0x2f')],qs[_0x4055('0x35')](_0x565227['query'][_0x4055('0x35')]));_0x4bdd8c[_0x4055('0x34')]=_0x4bdd8c[_0x4055('0x34')][_0x4055('0x36')]?_0x4bdd8c[_0x4055('0x34')]:_0x27bcf6[_0x4055('0x2f')];_0x4bdd8c[_0x4055('0x38')]=qs[_0x4055('0x39')](_0x565227['query'][_0x4055('0x39')]);_0x4bdd8c[_0x4055('0x3a')]=qs[_0x4055('0x32')](_[_0x4055('0x3b')](_0x565227[_0x4055('0x31')],_0x27bcf6[_0x4055('0x32')]));if(_0x565227[_0x4055('0x31')][_0x4055('0x3c')]){_0x4bdd8c[_0x4055('0x3a')]=_[_0x4055('0x4c')](_0x4bdd8c[_0x4055('0x3a')],{'$or':_[_0x4055('0x2a')](_0x4bdd8c[_0x4055('0x34')],function(_0x41bc5d){var _0x58b180={};_0x58b180[_0x41bc5d]={'$like':'%'+_0x565227[_0x4055('0x31')]['filter']+'%'};return _0x58b180;})});}_0x4bdd8c=_[_0x4055('0x4c')]({},_0x4bdd8c,_0x565227[_0x4055('0x3e')]);return _0x7a65a8[_0x4055('0x49')](_0x4bdd8c);}})[_0x4055('0x3f')](function(_0x3a8597){if(_0x3a8597){_0x58bdd6=_0x3a8597[_0x4055('0x36')];if(!_0x565227[_0x4055('0x31')][_0x4055('0x37')](_0x4055('0x4d'))){_0x4bdd8c[_0x4055('0x1f')]=qs['limit'](_0x565227['query'][_0x4055('0x1f')]);_0x4bdd8c[_0x4055('0x1d')]=qs[_0x4055('0x1d')](_0x565227[_0x4055('0x31')][_0x4055('0x1d')]);}return _0x7a65a8[_0x4055('0x49')](_0x4bdd8c);}})[_0x4055('0x3f')](function(_0x5daee1){if(_0x5daee1){return _0x5daee1?{'count':_0x58bdd6,'rows':_0x5daee1}:null;}})[_0x4055('0x3f')](respondWithResult(_0x1be082,null))[_0x4055('0x46')](handleError(_0x1be082,null));};exports['getSubjects']=function(_0x40023c,_0x347bbd,_0x5c259a){var _0x39eadb={};var _0x36fe49={};var _0x3e9eda;var _0xe98ff5;return db[_0x4055('0x2b')]['findOne']({'where':{'id':_0x40023c[_0x4055('0x43')]['id']}})[_0x4055('0x3f')](handleEntityNotFound(_0x347bbd,null))[_0x4055('0x3f')](function(_0x22f2ac){if(_0x22f2ac){_0x3e9eda=_0x22f2ac;_0x36fe49[_0x4055('0x2f')]=_[_0x4055('0x30')](db['ZendeskField'][_0x4055('0x2c')]);_0x36fe49[_0x4055('0x31')]=_[_0x4055('0x30')](_0x40023c[_0x4055('0x31')]);_0x36fe49[_0x4055('0x32')]=_[_0x4055('0x33')](_0x36fe49[_0x4055('0x2f')],_0x36fe49[_0x4055('0x31')]);_0x39eadb[_0x4055('0x34')]=_['intersection'](_0x36fe49[_0x4055('0x2f')],qs[_0x4055('0x35')](_0x40023c[_0x4055('0x31')][_0x4055('0x35')]));_0x39eadb[_0x4055('0x34')]=_0x39eadb['attributes']['length']?_0x39eadb['attributes']:_0x36fe49[_0x4055('0x2f')];_0x39eadb[_0x4055('0x38')]=qs[_0x4055('0x39')](_0x40023c[_0x4055('0x31')][_0x4055('0x39')]);_0x39eadb[_0x4055('0x3a')]=qs[_0x4055('0x32')](_[_0x4055('0x3b')](_0x40023c[_0x4055('0x31')],_0x36fe49[_0x4055('0x32')]));if(_0x40023c[_0x4055('0x31')]['filter']){_0x39eadb[_0x4055('0x3a')]=_['merge'](_0x39eadb[_0x4055('0x3a')],{'$or':_[_0x4055('0x2a')](_0x39eadb[_0x4055('0x34')],function(_0x532907){var _0x541e1d={};_0x541e1d[_0x532907]={'$like':'%'+_0x40023c[_0x4055('0x31')][_0x4055('0x3c')]+'%'};return _0x541e1d;})});}_0x39eadb=_[_0x4055('0x4c')]({},_0x39eadb,_0x40023c[_0x4055('0x3e')]);return _0x3e9eda[_0x4055('0x4e')](_0x39eadb);}})['then'](function(_0x161c02){if(_0x161c02){_0xe98ff5=_0x161c02['length'];if(!_0x40023c['query'][_0x4055('0x37')](_0x4055('0x4d'))){_0x39eadb[_0x4055('0x1f')]=qs[_0x4055('0x1f')](_0x40023c['query']['limit']);_0x39eadb[_0x4055('0x1d')]=qs['offset'](_0x40023c[_0x4055('0x31')]['offset']);}return _0x3e9eda[_0x4055('0x4e')](_0x39eadb);}})[_0x4055('0x3f')](function(_0x3ae843){if(_0x3ae843){return _0x3ae843?{'count':_0xe98ff5,'rows':_0x3ae843}:null;}})[_0x4055('0x3f')](respondWithResult(_0x347bbd,null))['catch'](handleError(_0x347bbd,null));};exports[_0x4055('0x4f')]=function(_0x7626d2,_0x27b931,_0x3a8981){var _0x2f7ac2={};var _0x430c5d={};var _0x4e6b1e;var _0xa4917c;return db['ZendeskConfiguration'][_0x4055('0x4a')]({'where':{'id':_0x7626d2[_0x4055('0x43')]['id']}})[_0x4055('0x3f')](handleEntityNotFound(_0x27b931,null))[_0x4055('0x3f')](function(_0x50ac67){if(_0x50ac67){_0x4e6b1e=_0x50ac67;_0x430c5d['model']=_[_0x4055('0x30')](db['ZendeskField'][_0x4055('0x2c')]);_0x430c5d['query']=_[_0x4055('0x30')](_0x7626d2['query']);_0x430c5d[_0x4055('0x32')]=_[_0x4055('0x33')](_0x430c5d[_0x4055('0x2f')],_0x430c5d[_0x4055('0x31')]);_0x2f7ac2[_0x4055('0x34')]=_[_0x4055('0x33')](_0x430c5d[_0x4055('0x2f')],qs[_0x4055('0x35')](_0x7626d2['query'][_0x4055('0x35')]));_0x2f7ac2[_0x4055('0x34')]=_0x2f7ac2[_0x4055('0x34')][_0x4055('0x36')]?_0x2f7ac2[_0x4055('0x34')]:_0x430c5d[_0x4055('0x2f')];_0x2f7ac2[_0x4055('0x38')]=qs[_0x4055('0x39')](_0x7626d2[_0x4055('0x31')]['sort']);_0x2f7ac2['where']=qs['filters'](_['pick'](_0x7626d2[_0x4055('0x31')],_0x430c5d[_0x4055('0x32')]));if(_0x7626d2[_0x4055('0x31')][_0x4055('0x3c')]){_0x2f7ac2[_0x4055('0x3a')]=_[_0x4055('0x4c')](_0x2f7ac2['where'],{'$or':_[_0x4055('0x2a')](_0x2f7ac2[_0x4055('0x34')],function(_0x1c8cbf){var _0x36ceaa={};_0x36ceaa[_0x1c8cbf]={'$like':'%'+_0x7626d2['query'][_0x4055('0x3c')]+'%'};return _0x36ceaa;})});}_0x2f7ac2=_[_0x4055('0x4c')]({},_0x2f7ac2,_0x7626d2[_0x4055('0x3e')]);return _0x4e6b1e[_0x4055('0x4f')](_0x2f7ac2);}})[_0x4055('0x3f')](function(_0x55f983){if(_0x55f983){_0xa4917c=_0x55f983['length'];if(!_0x7626d2[_0x4055('0x31')]['hasOwnProperty'](_0x4055('0x4d'))){_0x2f7ac2[_0x4055('0x1f')]=qs[_0x4055('0x1f')](_0x7626d2[_0x4055('0x31')]['limit']);_0x2f7ac2['offset']=qs[_0x4055('0x1d')](_0x7626d2[_0x4055('0x31')][_0x4055('0x1d')]);}return _0x4e6b1e['getDescriptions'](_0x2f7ac2);}})['then'](function(_0x1f9fbb){if(_0x1f9fbb){return _0x1f9fbb?{'count':_0xa4917c,'rows':_0x1f9fbb}:null;}})[_0x4055('0x3f')](respondWithResult(_0x27b931,null))[_0x4055('0x46')](handleError(_0x27b931,null));};exports['getTags']=function(_0x1e0da8,_0x3e091b,_0x573c4e){var _0x4d1918={};var _0xa030be={};var _0x186a39;var _0x3e5220;return db['ZendeskConfiguration'][_0x4055('0x4a')]({'where':{'id':_0x1e0da8[_0x4055('0x43')]['id']}})['then'](handleEntityNotFound(_0x3e091b,null))[_0x4055('0x3f')](function(_0x14d9b7){if(_0x14d9b7){_0x186a39=_0x14d9b7;_0xa030be[_0x4055('0x2f')]=_[_0x4055('0x30')](db[_0x4055('0x50')][_0x4055('0x2c')]);_0xa030be[_0x4055('0x31')]=_[_0x4055('0x30')](_0x1e0da8[_0x4055('0x31')]);_0xa030be[_0x4055('0x32')]=_[_0x4055('0x33')](_0xa030be[_0x4055('0x2f')],_0xa030be['query']);_0x4d1918[_0x4055('0x34')]=_[_0x4055('0x33')](_0xa030be['model'],qs[_0x4055('0x35')](_0x1e0da8[_0x4055('0x31')]['fields']));_0x4d1918[_0x4055('0x34')]=_0x4d1918[_0x4055('0x34')][_0x4055('0x36')]?_0x4d1918['attributes']:_0xa030be['model'];_0x4d1918[_0x4055('0x38')]=qs[_0x4055('0x39')](_0x1e0da8[_0x4055('0x31')]['sort']);_0x4d1918[_0x4055('0x3a')]=qs['filters'](_[_0x4055('0x3b')](_0x1e0da8[_0x4055('0x31')],_0xa030be['filters']));if(_0x1e0da8[_0x4055('0x31')][_0x4055('0x3c')]){_0x4d1918['where']=_['merge'](_0x4d1918[_0x4055('0x3a')],{'$or':_[_0x4055('0x2a')](_0x4d1918[_0x4055('0x34')],function(_0x97ac5d){var _0x57fd03={};_0x57fd03[_0x97ac5d]={'$like':'%'+_0x1e0da8[_0x4055('0x31')][_0x4055('0x3c')]+'%'};return _0x57fd03;})});}_0x4d1918=_[_0x4055('0x4c')]({},_0x4d1918,_0x1e0da8[_0x4055('0x3e')]);return _0x186a39['getTags'](_0x4d1918);}})[_0x4055('0x3f')](function(_0x512096){if(_0x512096){_0x3e5220=_0x512096[_0x4055('0x36')];if(!_0x1e0da8['query'][_0x4055('0x37')](_0x4055('0x4d'))){_0x4d1918[_0x4055('0x1f')]=qs[_0x4055('0x1f')](_0x1e0da8['query'][_0x4055('0x1f')]);_0x4d1918[_0x4055('0x1d')]=qs['offset'](_0x1e0da8[_0x4055('0x31')][_0x4055('0x1d')]);}return _0x186a39['getTags'](_0x4d1918);}})[_0x4055('0x3f')](function(_0x9e1316){if(_0x9e1316){return _0x9e1316?{'count':_0x3e5220,'rows':_0x9e1316}:null;}})[_0x4055('0x3f')](respondWithResult(_0x3e091b,null))[_0x4055('0x46')](handleError(_0x3e091b,null));};exports[_0x4055('0x51')]=function(_0x492395,_0x4126a8,_0x169d5b){if(_0x492395[_0x4055('0x48')]['id']){delete _0x492395['body']['id'];}return db[_0x4055('0x2b')][_0x4055('0x4a')]({'where':{'id':_0x492395[_0x4055('0x43')]['id']}})[_0x4055('0x3f')](handleEntityNotFound(_0x4126a8,null))['then'](function(_0x3c7626){if(_0x3c7626){return _0x3c7626[_0x4055('0x51')](_0x492395['body']['ids']||[]);}return null;})[_0x4055('0x3f')](respondWithResult(_0x4126a8,null))[_0x4055('0x46')](handleError(_0x4126a8,null));}; \ No newline at end of file +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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 58d8a08..9a06746 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 _0x28f2=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations'];(function(_0x41d74f,_0x3fa41b){var _0x442077=function(_0x49562e){while(--_0x49562e){_0x41d74f['push'](_0x41d74f['shift']());}};_0x442077(++_0x3fa41b);}(_0x28f2,0x193));var _0x228f=function(_0x3a4a21,_0x552b17){_0x3a4a21=_0x3a4a21-0x0;var _0x3d3145=_0x28f2[_0x3a4a21];return _0x3d3145;};'use strict';var _=require(_0x228f('0x0'));var util=require(_0x228f('0x1'));var logger=require(_0x228f('0x2'))(_0x228f('0x3'));var moment=require(_0x228f('0x4'));var BPromise=require('bluebird');var rp=require(_0x228f('0x5'));var fs=require('fs');var path=require(_0x228f('0x6'));var rimraf=require(_0x228f('0x7'));var config=require(_0x228f('0x8'));var attributes=require(_0x228f('0x9'));module[_0x228f('0xa')]=function(_0x32c5c3,_0x485423){return _0x32c5c3[_0x228f('0xb')]('ZendeskConfiguration',attributes,{'tableName':_0x228f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 667ad70..aa3ac5a 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 _0x68b9=['rpc','../../config/environment','jayson/promise','http','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x68b9,0x1f2));var _0x968b=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x68b9[_0x235563];return _0x219be0;};'use strict';var _=require('lodash');var util=require(_0x968b('0x0'));var moment=require(_0x968b('0x1'));var BPromise=require(_0x968b('0x2'));var rs=require(_0x968b('0x3'));var fs=require('fs');var Redis=require(_0x968b('0x4'));var db=require(_0x968b('0x5'))['db'];var utils=require(_0x968b('0x6'));var logger=require(_0x968b('0x7'))(_0x968b('0x8'));var config=require(_0x968b('0x9'));var jayson=require(_0x968b('0xa'));var client=jayson['client'][_0x968b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x29ae11,_0x4d42f6,_0x1f0a7c){return new BPromise(function(_0x13049f,_0x54ee64){return client['request'](_0x29ae11,_0x1f0a7c)['then'](function(_0x5aeb0a){logger[_0x968b('0xc')](_0x968b('0xd'),_0x4d42f6,_0x968b('0xe'));logger['debug'](_0x968b('0xf'),_0x4d42f6,'request\x20sent',JSON[_0x968b('0x10')](_0x5aeb0a));if(_0x5aeb0a['error']){if(_0x5aeb0a[_0x968b('0x11')][_0x968b('0x12')]===0x1f4){logger[_0x968b('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d42f6,_0x5aeb0a['error'][_0x968b('0x13')]);return _0x54ee64(_0x5aeb0a[_0x968b('0x11')][_0x968b('0x13')]);}logger[_0x968b('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x4d42f6,_0x5aeb0a[_0x968b('0x11')][_0x968b('0x13')]);return _0x13049f(_0x5aeb0a[_0x968b('0x11')][_0x968b('0x13')]);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x4d42f6,_0x968b('0xe'));_0x13049f(_0x5aeb0a[_0x968b('0x14')]['message']);}})[_0x968b('0x15')](function(_0x3eb6fb){logger[_0x968b('0x11')](_0x968b('0xd'),_0x4d42f6,_0x3eb6fb);_0x54ee64(_0x3eb6fb);});});} \ No newline at end of file +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 diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 507fc95..af8d23c 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 _0x761e=['get','isAuthenticated','show','post','create','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','./intZendeskField.controller','index'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x761e,0x19a));var _0xe761=function(_0x148879,_0x5b4c11){_0x148879=_0x148879-0x0;var _0x4f7027=_0x761e[_0x148879];return _0x4f7027;};'use strict';var multer=require(_0xe761('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe761('0x1'));var express=require('express');var router=express[_0xe761('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe761('0x3'));var config=require('../../config/environment');var controller=require(_0xe761('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xe761('0x5')]);router[_0xe761('0x6')]('/:id',auth[_0xe761('0x7')](),controller[_0xe761('0x8')]);router[_0xe761('0x9')]('/',auth[_0xe761('0x7')](),controller[_0xe761('0xa')]);router['put'](_0xe761('0xb'),auth[_0xe761('0x7')](),controller[_0xe761('0xc')]);router[_0xe761('0xd')](_0xe761('0xb'),auth[_0xe761('0x7')](),controller[_0xe761('0xe')]);module[_0xe761('0xf')]=router; \ No newline at end of file +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 diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 841a31a..16f28e1 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 _0x5556=['variable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5556,0x84));var _0x6555=function(_0x169e53,_0x46be55){_0x169e53=_0x169e53-0x0;var _0x252bb3=_0x5556[_0x169e53];return _0x252bb3;};'use strict';var Sequelize=require(_0x6555('0x0'));module[_0x6555('0x1')]={'type':{'type':Sequelize[_0x6555('0x2')](_0x6555('0x3'),_0x6555('0x4'),'customVariable',_0x6555('0x5'),'picklist'),'defaultValue':_0x6555('0x3')},'content':{'type':Sequelize[_0x6555('0x6')]},'key':{'type':Sequelize[_0x6555('0x6')]},'keyType':{'type':Sequelize[_0x6555('0x2')]('string',_0x6555('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x6555('0x6')]},'idField':{'type':Sequelize[_0x6555('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6555('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 90cd461..a672038 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 _0x5aa1=['includeAll','create','body','find','params','destroy','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','end','sendStatus','error','stack','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','catch'];(function(_0x25c5f6,_0xbc454d){var _0x4e1906=function(_0x2627b7){while(--_0x2627b7){_0x25c5f6['push'](_0x25c5f6['shift']());}};_0x4e1906(++_0xbc454d);}(_0x5aa1,0x12a));var _0x15aa=function(_0x524939,_0x61e869){_0x524939=_0x524939-0x0;var _0x1aabdb=_0x5aa1[_0x524939];return _0x1aabdb;};'use strict';var emlformat=require(_0x15aa('0x0'));var rimraf=require(_0x15aa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15aa('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x15aa('0x3'));var Mustache=require(_0x15aa('0x4'));var util=require(_0x15aa('0x5'));var path=require(_0x15aa('0x6'));var sox=require(_0x15aa('0x7'));var csv=require(_0x15aa('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15aa('0x9'));var _=require('lodash');var squel=require(_0x15aa('0xa'));var crypto=require(_0x15aa('0xb'));var jsforce=require(_0x15aa('0xc'));var deskjs=require(_0x15aa('0xd'));var toCsv=require(_0x15aa('0x8'));var querystring=require(_0x15aa('0xe'));var Papa=require(_0x15aa('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x15aa('0x10'));var as=require(_0x15aa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x15aa('0x12'))(_0x15aa('0x13'));var utils=require(_0x15aa('0x14'));var config=require(_0x15aa('0x15'));var licenseUtil=require(_0x15aa('0x16'));var db=require(_0x15aa('0x17'))['db'];function respondWithStatusCode(_0x40e686,_0xc7dadc){_0xc7dadc=_0xc7dadc||0xcc;return function(_0x1d75c4){if(_0x1d75c4){return _0x40e686['sendStatus'](_0xc7dadc);}return _0x40e686[_0x15aa('0x18')](_0xc7dadc)['end']();};}function respondWithResult(_0x20e72f,_0x112470){_0x112470=_0x112470||0xc8;return function(_0x2a7a6c){if(_0x2a7a6c){return _0x20e72f[_0x15aa('0x18')](_0x112470)[_0x15aa('0x19')](_0x2a7a6c);}};}function respondWithFilteredResult(_0xfeffb4,_0x7c7934){return function(_0x2041ca){if(_0x2041ca){var _0x112924=typeof _0x7c7934[_0x15aa('0x1a')]==='undefined'&&typeof _0x7c7934['limit']===_0x15aa('0x1b');var _0x1e8283=_0x2041ca['count'];var _0x272fe2=_0x112924?0x0:_0x7c7934[_0x15aa('0x1a')];var _0x5e291d=_0x112924?_0x2041ca[_0x15aa('0x1c')]:_0x7c7934['offset']+_0x7c7934[_0x15aa('0x1d')];var _0x25bde1;if(_0x5e291d>=_0x1e8283){_0x5e291d=_0x1e8283;_0x25bde1=0xc8;}else{_0x25bde1=0xce;}_0xfeffb4[_0x15aa('0x18')](_0x25bde1);return _0xfeffb4['set'](_0x15aa('0x1e'),_0x272fe2+'-'+_0x5e291d+'/'+_0x1e8283)[_0x15aa('0x19')](_0x2041ca);}return null;};}function patchUpdates(_0x344980){return function(_0x1bbeb5){try{jsonpatch[_0x15aa('0x1f')](_0x1bbeb5,_0x344980,!![]);}catch(_0x1948b6){return BPromise[_0x15aa('0x20')](_0x1948b6);}return _0x1bbeb5[_0x15aa('0x21')]();};}function saveUpdates(_0x224f27,_0x296cc9){return function(_0x2ba11d){if(_0x2ba11d){return _0x2ba11d[_0x15aa('0x22')](_0x224f27)['then'](function(_0xb58d87){return _0xb58d87;});}return null;};}function removeEntity(_0x2f1a36,_0x360d0d){return function(_0x530e65){if(_0x530e65){return _0x530e65['destroy']()[_0x15aa('0x23')](function(){_0x2f1a36[_0x15aa('0x18')](0xcc)[_0x15aa('0x24')]();});}};}function handleEntityNotFound(_0x333857,_0x5b938a){return function(_0x489460){if(!_0x489460){_0x333857[_0x15aa('0x25')](0x194);}return _0x489460;};}function handleError(_0x213cbb,_0x5842d6){_0x5842d6=_0x5842d6||0x1f4;return function(_0x227be7){logger[_0x15aa('0x26')](_0x227be7[_0x15aa('0x27')]);if(_0x227be7['name']){delete _0x227be7['name'];}_0x213cbb['status'](_0x5842d6)[_0x15aa('0x28')](_0x227be7);};}exports['index']=function(_0x17d54c,_0x524576){var _0x251ff2={},_0x1bedf7={},_0x549b17={'count':0x0,'rows':[]};var _0x3dbd48=_[_0x15aa('0x29')](db[_0x15aa('0x2a')][_0x15aa('0x2b')],function(_0x10c975){return{'name':_0x10c975[_0x15aa('0x2c')],'type':_0x10c975[_0x15aa('0x2d')][_0x15aa('0x2e')]};});_0x1bedf7[_0x15aa('0x2f')]=_['map'](_0x3dbd48,_0x15aa('0x30'));_0x1bedf7['query']=_[_0x15aa('0x31')](_0x17d54c[_0x15aa('0x32')]);_0x1bedf7['filters']=_['intersection'](_0x1bedf7['model'],_0x1bedf7[_0x15aa('0x32')]);_0x251ff2['attributes']=_[_0x15aa('0x33')](_0x1bedf7[_0x15aa('0x2f')],qs['fields'](_0x17d54c['query'][_0x15aa('0x34')]));_0x251ff2['attributes']=_0x251ff2[_0x15aa('0x35')][_0x15aa('0x36')]?_0x251ff2[_0x15aa('0x35')]:_0x1bedf7['model'];if(!_0x17d54c['query']['hasOwnProperty'](_0x15aa('0x37'))){_0x251ff2[_0x15aa('0x1d')]=qs['limit'](_0x17d54c[_0x15aa('0x32')][_0x15aa('0x1d')]);_0x251ff2['offset']=qs['offset'](_0x17d54c[_0x15aa('0x32')][_0x15aa('0x1a')]);}_0x251ff2[_0x15aa('0x38')]=qs[_0x15aa('0x39')](_0x17d54c[_0x15aa('0x32')]['sort']);_0x251ff2[_0x15aa('0x3a')]=qs[_0x15aa('0x3b')](_['pick'](_0x17d54c[_0x15aa('0x32')],_0x1bedf7[_0x15aa('0x3b')]),_0x3dbd48);if(_0x17d54c[_0x15aa('0x32')][_0x15aa('0x3c')]){_0x251ff2[_0x15aa('0x3a')]=_[_0x15aa('0x3d')](_0x251ff2['where'],{'$or':_[_0x15aa('0x29')](_0x3dbd48,function(_0x118d5c){if(_0x118d5c['type']!==_0x15aa('0x3e')){var _0x2c3c27={};_0x2c3c27[_0x118d5c['name']]={'$like':'%'+_0x17d54c['query'][_0x15aa('0x3c')]+'%'};return _0x2c3c27;}})});}_0x251ff2=_[_0x15aa('0x3d')]({},_0x251ff2,_0x17d54c[_0x15aa('0x3f')]);var _0x5ab073={'where':_0x251ff2[_0x15aa('0x3a')]};return db[_0x15aa('0x2a')][_0x15aa('0x1c')](_0x5ab073)['then'](function(_0x3d74b9){_0x549b17[_0x15aa('0x1c')]=_0x3d74b9;if(_0x17d54c[_0x15aa('0x32')]['includeAll']){_0x251ff2[_0x15aa('0x40')]=[{'all':!![]}];}return db[_0x15aa('0x2a')][_0x15aa('0x41')](_0x251ff2);})[_0x15aa('0x23')](function(_0x5c6e25){_0x549b17['rows']=_0x5c6e25;return _0x549b17;})[_0x15aa('0x23')](respondWithFilteredResult(_0x524576,_0x251ff2))[_0x15aa('0x42')](handleError(_0x524576,null));};exports['show']=function(_0x34462c,_0x40154d){var _0xa7f2fe={'raw':!![],'where':{'id':_0x34462c['params']['id']}},_0x3a19b2={};_0x3a19b2[_0x15aa('0x2f')]=_[_0x15aa('0x31')](db[_0x15aa('0x2a')][_0x15aa('0x2b')]);_0x3a19b2[_0x15aa('0x32')]=_[_0x15aa('0x31')](_0x34462c[_0x15aa('0x32')]);_0x3a19b2[_0x15aa('0x3b')]=_[_0x15aa('0x33')](_0x3a19b2[_0x15aa('0x2f')],_0x3a19b2[_0x15aa('0x32')]);_0xa7f2fe[_0x15aa('0x35')]=_[_0x15aa('0x33')](_0x3a19b2[_0x15aa('0x2f')],qs['fields'](_0x34462c['query']['fields']));_0xa7f2fe[_0x15aa('0x35')]=_0xa7f2fe[_0x15aa('0x35')][_0x15aa('0x36')]?_0xa7f2fe[_0x15aa('0x35')]:_0x3a19b2[_0x15aa('0x2f')];if(_0x34462c['query'][_0x15aa('0x43')]){_0xa7f2fe[_0x15aa('0x40')]=[{'all':!![]}];}_0xa7f2fe=_[_0x15aa('0x3d')]({},_0xa7f2fe,_0x34462c[_0x15aa('0x3f')]);return db[_0x15aa('0x2a')]['find'](_0xa7f2fe)[_0x15aa('0x23')](handleEntityNotFound(_0x40154d,null))[_0x15aa('0x23')](respondWithResult(_0x40154d,null))[_0x15aa('0x42')](handleError(_0x40154d,null));};exports[_0x15aa('0x44')]=function(_0x5e4c68,_0x3b2a70){return db[_0x15aa('0x2a')][_0x15aa('0x44')](_0x5e4c68[_0x15aa('0x45')],{})[_0x15aa('0x23')](respondWithResult(_0x3b2a70,0xc9))[_0x15aa('0x42')](handleError(_0x3b2a70,null));};exports[_0x15aa('0x22')]=function(_0x47ff0c,_0x329c04){if(_0x47ff0c[_0x15aa('0x45')]['id']){delete _0x47ff0c[_0x15aa('0x45')]['id'];}return db[_0x15aa('0x2a')][_0x15aa('0x46')]({'where':{'id':_0x47ff0c[_0x15aa('0x47')]['id']}})[_0x15aa('0x23')](handleEntityNotFound(_0x329c04,null))[_0x15aa('0x23')](saveUpdates(_0x47ff0c[_0x15aa('0x45')],null))[_0x15aa('0x23')](respondWithResult(_0x329c04,null))[_0x15aa('0x42')](handleError(_0x329c04,null));};exports[_0x15aa('0x48')]=function(_0x60c07a,_0x4bb05a){return db['ZendeskField']['find']({'where':{'id':_0x60c07a[_0x15aa('0x47')]['id']}})[_0x15aa('0x23')](handleEntityNotFound(_0x4bb05a,null))[_0x15aa('0x23')](removeEntity(_0x4bb05a,null))[_0x15aa('0x42')](handleError(_0x4bb05a,null));}; \ No newline at end of file +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 diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 20184f5..10b2fdb 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 _0x3c51=['rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x44497f,_0x528bdc){var _0x37a190=function(_0x2d4df7){while(--_0x2d4df7){_0x44497f['push'](_0x44497f['shift']());}};_0x37a190(++_0x528bdc);}(_0x3c51,0x79));var _0x13c5=function(_0xaa0bef,_0x11c463){_0xaa0bef=_0xaa0bef-0x0;var _0x56391c=_0x3c51[_0xaa0bef];return _0x56391c;};'use strict';var _=require(_0x13c5('0x0'));var util=require(_0x13c5('0x1'));var logger=require(_0x13c5('0x2'))(_0x13c5('0x3'));var moment=require('moment');var BPromise=require(_0x13c5('0x4'));var rp=require(_0x13c5('0x5'));var fs=require('fs');var path=require(_0x13c5('0x6'));var rimraf=require(_0x13c5('0x7'));var config=require(_0x13c5('0x8'));var attributes=require(_0x13c5('0x9'));module[_0x13c5('0xa')]=function(_0x354d2a,_0x5e8b0c){return _0x354d2a[_0x13c5('0xb')](_0x13c5('0xc'),attributes,{'tableName':_0x13c5('0xd'),'paranoid':![],'indexes':[{'name':_0x13c5('0xe'),'fields':['idField',_0x13c5('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 7470b56..68cfdd4 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 _0x35b0=['ZendeskField,\x20%s,\x20%s,\x20%s','error','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','client','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent'];(function(_0x205a12,_0x5d1d07){var _0x2ae9cc=function(_0x3b2e01){while(--_0x3b2e01){_0x205a12['push'](_0x205a12['shift']());}};_0x2ae9cc(++_0x5d1d07);}(_0x35b0,0x137));var _0x035b=function(_0x497950,_0x2dff73){_0x497950=_0x497950-0x0;var _0x5d7cea=_0x35b0[_0x497950];return _0x5d7cea;};'use strict';var _=require(_0x035b('0x0'));var util=require(_0x035b('0x1'));var moment=require(_0x035b('0x2'));var BPromise=require(_0x035b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x035b('0x4'));var db=require(_0x035b('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x035b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x592b63,_0x57bbdb,_0x9a3901){return new BPromise(function(_0x43ee2e,_0x2447d2){return client['request'](_0x592b63,_0x9a3901)[_0x035b('0x7')](function(_0x2f5dab){logger[_0x035b('0x8')](_0x035b('0x9'),_0x57bbdb,_0x035b('0xa'));logger['debug'](_0x035b('0xb'),_0x57bbdb,'request\x20sent',JSON['stringify'](_0x2f5dab));if(_0x2f5dab[_0x035b('0xc')]){if(_0x2f5dab[_0x035b('0xc')]['code']===0x1f4){logger[_0x035b('0xc')](_0x035b('0x9'),_0x57bbdb,_0x2f5dab['error'][_0x035b('0xd')]);return _0x2447d2(_0x2f5dab[_0x035b('0xc')][_0x035b('0xd')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x57bbdb,_0x2f5dab[_0x035b('0xc')][_0x035b('0xd')]);return _0x43ee2e(_0x2f5dab[_0x035b('0xc')][_0x035b('0xd')]);}else{logger[_0x035b('0x8')](_0x035b('0x9'),_0x57bbdb,_0x035b('0xa'));_0x43ee2e(_0x2f5dab['result']['message']);}})['catch'](function(_0x55a90f){logger[_0x035b('0xc')](_0x035b('0x9'),_0x57bbdb,_0x55a90f);_0x2447d2(_0x55a90f);});});} \ No newline at end of file +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 diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 61452ac..97b2bad 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 _0xedfe=['/:id/fields','getFields','post','create','addConfiguration','/:id','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/configurations'];(function(_0x418549,_0x11b13d){var _0x288826=function(_0x3c0411){while(--_0x3c0411){_0x418549['push'](_0x418549['shift']());}};_0x288826(++_0x11b13d);}(_0xedfe,0x182));var _0xeedf=function(_0x5a0f44,_0x1669d1){_0x5a0f44=_0x5a0f44-0x0;var _0x2cb162=_0xedfe[_0x5a0f44];return _0x2cb162;};'use strict';var multer=require(_0xeedf('0x0'));var util=require(_0xeedf('0x1'));var path=require(_0xeedf('0x2'));var timeout=require('connect-timeout');var express=require(_0xeedf('0x3'));var router=express[_0xeedf('0x4')]();var fs_extra=require(_0xeedf('0x5'));var auth=require(_0xeedf('0x6'));var interaction=require(_0xeedf('0x7'));var config=require(_0xeedf('0x8'));var controller=require('./intZohoAccount.controller');router[_0xeedf('0x9')]('/',auth[_0xeedf('0xa')](),controller[_0xeedf('0xb')]);router[_0xeedf('0x9')]('/:id',auth[_0xeedf('0xa')](),controller['show']);router[_0xeedf('0x9')](_0xeedf('0xc'),auth[_0xeedf('0xa')](),controller['getConfigurations']);router[_0xeedf('0x9')](_0xeedf('0xd'),auth['isAuthenticated'](),controller[_0xeedf('0xe')]);router[_0xeedf('0xf')]('/',auth[_0xeedf('0xa')](),controller[_0xeedf('0x10')]);router['post'](_0xeedf('0xc'),auth['isAuthenticated'](),controller[_0xeedf('0x11')]);router['put'](_0xeedf('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xeedf('0x13')]('/:id',auth[_0xeedf('0xa')](),controller[_0xeedf('0x14')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d874aac..2c69acf 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 _0xf109=['exports','STRING','sequelize'];(function(_0x26d43d,_0x4a7d61){var _0x25674f=function(_0x4eebb8){while(--_0x4eebb8){_0x26d43d['push'](_0x26d43d['shift']());}};_0x25674f(++_0x4a7d61);}(_0xf109,0xce));var _0x9f10=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xf109[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x9f10('0x2')]},'clientSecret':{'type':Sequelize[_0x9f10('0x2')]},'serverUrl':{'type':Sequelize[_0x9f10('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x9f10('0x2')]},'refreshToken':{'type':Sequelize[_0x9f10('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 6ddabb0..9c84964 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 _0xe9cb=['offset','count','set','Content-Range','reject','save','then','error','stack','name','send','index','rawAttributes','key','map','keys','query','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','type','VIRTUAL','filter','ZohoAccount','includeAll','findAll','rows','show','include','catch','create','body','update','find','destroy','params','getConfigurations','findOne','ZohoConfiguration','order','options','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','serverUrl','code','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','Owner','Subject','Description','WhoId','Call_Result','Call_Type','remove','includes','system_mandatory','push','display_label','custom_field','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0xbd97a6,_0x2d11dd){var _0x23e137=function(_0x5ac604){while(--_0x5ac604){_0xbd97a6['push'](_0xbd97a6['shift']());}};_0x23e137(++_0x2d11dd);}(_0xe9cb,0x160));var _0xbe9c=function(_0x3ea0cd,_0x5910a1){_0x3ea0cd=_0x3ea0cd-0x0;var _0xad2212=_0xe9cb[_0x3ea0cd];return _0xad2212;};'use strict';var emlformat=require(_0xbe9c('0x0'));var rimraf=require(_0xbe9c('0x1'));var zipdir=require(_0xbe9c('0x2'));var jsonpatch=require(_0xbe9c('0x3'));var rp=require('request-promise');var moment=require(_0xbe9c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbe9c('0x5'));var path=require('path');var sox=require(_0xbe9c('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbe9c('0x7'));var _=require(_0xbe9c('0x8'));var squel=require('squel');var crypto=require(_0xbe9c('0x9'));var jsforce=require(_0xbe9c('0xa'));var deskjs=require(_0xbe9c('0xb'));var toCsv=require('to-csv');var querystring=require(_0xbe9c('0xc'));var Papa=require(_0xbe9c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbe9c('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe9c('0xf'));var logger=require(_0xbe9c('0x10'))(_0xbe9c('0x11'));var utils=require(_0xbe9c('0x12'));var config=require(_0xbe9c('0x13'));var licenseUtil=require(_0xbe9c('0x14'));var db=require(_0xbe9c('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5cb303,_0x1d9a77){_0x1d9a77=_0x1d9a77||0xcc;return function(_0x18f123){if(_0x18f123){return _0x5cb303[_0xbe9c('0x16')](_0x1d9a77);}return _0x5cb303[_0xbe9c('0x17')](_0x1d9a77)[_0xbe9c('0x18')]();};}function respondWithResult(_0x74f46d,_0x36d252){_0x36d252=_0x36d252||0xc8;return function(_0x119b67){if(_0x119b67){return _0x74f46d[_0xbe9c('0x17')](_0x36d252)[_0xbe9c('0x19')](_0x119b67);}};}function respondWithFilteredResult(_0x310c46,_0x846d45){return function(_0x408170){if(_0x408170){var _0x34b0ba=typeof _0x846d45[_0xbe9c('0x1a')]==='undefined'&&typeof _0x846d45['limit']==='undefined';var _0x2edea3=_0x408170[_0xbe9c('0x1b')];var _0x459ee5=_0x34b0ba?0x0:_0x846d45[_0xbe9c('0x1a')];var _0x3857b7=_0x34b0ba?_0x408170[_0xbe9c('0x1b')]:_0x846d45['offset']+_0x846d45['limit'];var _0x20816d;if(_0x3857b7>=_0x2edea3){_0x3857b7=_0x2edea3;_0x20816d=0xc8;}else{_0x20816d=0xce;}_0x310c46[_0xbe9c('0x17')](_0x20816d);return _0x310c46[_0xbe9c('0x1c')](_0xbe9c('0x1d'),_0x459ee5+'-'+_0x3857b7+'/'+_0x2edea3)[_0xbe9c('0x19')](_0x408170);}return null;};}function patchUpdates(_0x3bbaff){return function(_0xed50b){try{jsonpatch['apply'](_0xed50b,_0x3bbaff,!![]);}catch(_0x5797ed){return BPromise[_0xbe9c('0x1e')](_0x5797ed);}return _0xed50b[_0xbe9c('0x1f')]();};}function saveUpdates(_0x3a1470,_0x38f2ea){return function(_0x28f40b){if(_0x28f40b){return _0x28f40b['update'](_0x3a1470)['then'](function(_0x28e3a4){return _0x28e3a4;});}return null;};}function removeEntity(_0x319e09,_0x7b2c8e){return function(_0x5319ec){if(_0x5319ec){return _0x5319ec['destroy']()[_0xbe9c('0x20')](function(){_0x319e09[_0xbe9c('0x17')](0xcc)[_0xbe9c('0x18')]();});}};}function handleEntityNotFound(_0x3a4d53,_0x41b14e){return function(_0x43a12f){if(!_0x43a12f){_0x3a4d53['sendStatus'](0x194);}return _0x43a12f;};}function handleError(_0x37c1c9,_0x5e165f){_0x5e165f=_0x5e165f||0x1f4;return function(_0x2ede0a){logger[_0xbe9c('0x21')](_0x2ede0a[_0xbe9c('0x22')]);if(_0x2ede0a[_0xbe9c('0x23')]){delete _0x2ede0a[_0xbe9c('0x23')];}_0x37c1c9[_0xbe9c('0x17')](_0x5e165f)[_0xbe9c('0x24')](_0x2ede0a);};}exports[_0xbe9c('0x25')]=function(_0x52ee7f,_0x243192){var _0x4efa28={},_0x2cb055={},_0x2c6b4e={'count':0x0,'rows':[]};var _0x46f338=_['map'](db['ZohoAccount'][_0xbe9c('0x26')],function(_0x1b8806){return{'name':_0x1b8806['fieldName'],'type':_0x1b8806['type'][_0xbe9c('0x27')]};});_0x2cb055['model']=_[_0xbe9c('0x28')](_0x46f338,'name');_0x2cb055['query']=_[_0xbe9c('0x29')](_0x52ee7f['query']);_0x2cb055['filters']=_['intersection'](_0x2cb055['model'],_0x2cb055[_0xbe9c('0x2a')]);_0x4efa28[_0xbe9c('0x2b')]=_[_0xbe9c('0x2c')](_0x2cb055[_0xbe9c('0x2d')],qs[_0xbe9c('0x2e')](_0x52ee7f[_0xbe9c('0x2a')][_0xbe9c('0x2e')]));_0x4efa28[_0xbe9c('0x2b')]=_0x4efa28[_0xbe9c('0x2b')][_0xbe9c('0x2f')]?_0x4efa28[_0xbe9c('0x2b')]:_0x2cb055['model'];if(!_0x52ee7f[_0xbe9c('0x2a')][_0xbe9c('0x30')](_0xbe9c('0x31'))){_0x4efa28['limit']=qs[_0xbe9c('0x32')](_0x52ee7f['query'][_0xbe9c('0x32')]);_0x4efa28[_0xbe9c('0x1a')]=qs['offset'](_0x52ee7f['query'][_0xbe9c('0x1a')]);}_0x4efa28['order']=qs[_0xbe9c('0x33')](_0x52ee7f[_0xbe9c('0x2a')][_0xbe9c('0x33')]);_0x4efa28[_0xbe9c('0x34')]=qs[_0xbe9c('0x35')](_[_0xbe9c('0x36')](_0x52ee7f[_0xbe9c('0x2a')],_0x2cb055['filters']),_0x46f338);if(_0x52ee7f[_0xbe9c('0x2a')]['filter']){_0x4efa28['where']=_[_0xbe9c('0x37')](_0x4efa28[_0xbe9c('0x34')],{'$or':_[_0xbe9c('0x28')](_0x46f338,function(_0x42efee){if(_0x42efee[_0xbe9c('0x38')]!==_0xbe9c('0x39')){var _0x1b03b5={};_0x1b03b5[_0x42efee[_0xbe9c('0x23')]]={'$like':'%'+_0x52ee7f['query'][_0xbe9c('0x3a')]+'%'};return _0x1b03b5;}})});}_0x4efa28=_[_0xbe9c('0x37')]({},_0x4efa28,_0x52ee7f['options']);var _0x15c6df={'where':_0x4efa28['where']};return db[_0xbe9c('0x3b')][_0xbe9c('0x1b')](_0x15c6df)[_0xbe9c('0x20')](function(_0x2e625c){_0x2c6b4e[_0xbe9c('0x1b')]=_0x2e625c;if(_0x52ee7f[_0xbe9c('0x2a')][_0xbe9c('0x3c')]){_0x4efa28['include']=[{'all':!![]}];}return db['ZohoAccount'][_0xbe9c('0x3d')](_0x4efa28);})[_0xbe9c('0x20')](function(_0x5f3339){_0x2c6b4e[_0xbe9c('0x3e')]=_0x5f3339;return _0x2c6b4e;})[_0xbe9c('0x20')](respondWithFilteredResult(_0x243192,_0x4efa28))['catch'](handleError(_0x243192,null));};exports[_0xbe9c('0x3f')]=function(_0x53725e,_0x1f529b){var _0x4d4e4e={'raw':![],'where':{'id':_0x53725e['params']['id']}},_0x4ffd7c={};_0x4ffd7c[_0xbe9c('0x2d')]=_[_0xbe9c('0x29')](db[_0xbe9c('0x3b')][_0xbe9c('0x26')]);_0x4ffd7c['query']=_['keys'](_0x53725e[_0xbe9c('0x2a')]);_0x4ffd7c[_0xbe9c('0x35')]=_[_0xbe9c('0x2c')](_0x4ffd7c[_0xbe9c('0x2d')],_0x4ffd7c['query']);_0x4d4e4e['attributes']=_[_0xbe9c('0x2c')](_0x4ffd7c[_0xbe9c('0x2d')],qs[_0xbe9c('0x2e')](_0x53725e[_0xbe9c('0x2a')][_0xbe9c('0x2e')]));_0x4d4e4e[_0xbe9c('0x2b')]=_0x4d4e4e[_0xbe9c('0x2b')][_0xbe9c('0x2f')]?_0x4d4e4e[_0xbe9c('0x2b')]:_0x4ffd7c[_0xbe9c('0x2d')];if(_0x53725e['query'][_0xbe9c('0x3c')]){_0x4d4e4e[_0xbe9c('0x40')]=[{'all':!![]}];}_0x4d4e4e=_[_0xbe9c('0x37')]({},_0x4d4e4e,_0x53725e['options']);return db[_0xbe9c('0x3b')]['find'](_0x4d4e4e)[_0xbe9c('0x20')](handleEntityNotFound(_0x1f529b,null))[_0xbe9c('0x20')](respondWithResult(_0x1f529b,null))[_0xbe9c('0x41')](handleError(_0x1f529b,null));};exports[_0xbe9c('0x42')]=function(_0x4c5ef0,_0x2c282b){return db['ZohoAccount']['create'](_0x4c5ef0[_0xbe9c('0x43')],{})[_0xbe9c('0x20')](respondWithResult(_0x2c282b,0xc9))[_0xbe9c('0x41')](handleError(_0x2c282b,null));};exports[_0xbe9c('0x44')]=function(_0x18f09c,_0x56854b){if(_0x18f09c[_0xbe9c('0x43')]['id']){delete _0x18f09c['body']['id'];}return db[_0xbe9c('0x3b')][_0xbe9c('0x45')]({'where':{'id':_0x18f09c['params']['id']}})[_0xbe9c('0x20')](handleEntityNotFound(_0x56854b,null))['then'](saveUpdates(_0x18f09c[_0xbe9c('0x43')],null))['then'](respondWithResult(_0x56854b,null))[_0xbe9c('0x41')](handleError(_0x56854b,null));};exports[_0xbe9c('0x46')]=function(_0x4cd074,_0x382c52){return db[_0xbe9c('0x3b')][_0xbe9c('0x45')]({'where':{'id':_0x4cd074[_0xbe9c('0x47')]['id']}})[_0xbe9c('0x20')](handleEntityNotFound(_0x382c52,null))[_0xbe9c('0x20')](removeEntity(_0x382c52,null))[_0xbe9c('0x41')](handleError(_0x382c52,null));};exports[_0xbe9c('0x48')]=function(_0x330e95,_0x282263,_0x5c2968){var _0x133a97={};var _0x4a231e={};var _0x354c8f;var _0x50d73c;return db['ZohoAccount'][_0xbe9c('0x49')]({'where':{'id':_0x330e95['params']['id']}})[_0xbe9c('0x20')](handleEntityNotFound(_0x282263,null))[_0xbe9c('0x20')](function(_0x39e24a){if(_0x39e24a){_0x354c8f=_0x39e24a;_0x4a231e[_0xbe9c('0x2d')]=_[_0xbe9c('0x29')](db[_0xbe9c('0x4a')][_0xbe9c('0x26')]);_0x4a231e['query']=_[_0xbe9c('0x29')](_0x330e95[_0xbe9c('0x2a')]);_0x4a231e[_0xbe9c('0x35')]=_[_0xbe9c('0x2c')](_0x4a231e[_0xbe9c('0x2d')],_0x4a231e[_0xbe9c('0x2a')]);_0x133a97[_0xbe9c('0x2b')]=_['intersection'](_0x4a231e[_0xbe9c('0x2d')],qs[_0xbe9c('0x2e')](_0x330e95['query'][_0xbe9c('0x2e')]));_0x133a97['attributes']=_0x133a97[_0xbe9c('0x2b')][_0xbe9c('0x2f')]?_0x133a97[_0xbe9c('0x2b')]:_0x4a231e['model'];_0x133a97[_0xbe9c('0x4b')]=qs['sort'](_0x330e95[_0xbe9c('0x2a')][_0xbe9c('0x33')]);_0x133a97[_0xbe9c('0x34')]=qs[_0xbe9c('0x35')](_[_0xbe9c('0x36')](_0x330e95[_0xbe9c('0x2a')],_0x4a231e['filters']));if(_0x330e95[_0xbe9c('0x2a')]['filter']){_0x133a97[_0xbe9c('0x34')]=_[_0xbe9c('0x37')](_0x133a97[_0xbe9c('0x34')],{'$or':_['map'](_0x133a97['attributes'],function(_0x566bed){var _0x2183b6={};_0x2183b6[_0x566bed]={'$like':'%'+_0x330e95[_0xbe9c('0x2a')]['filter']+'%'};return _0x2183b6;})});}_0x133a97=_[_0xbe9c('0x37')]({},_0x133a97,_0x330e95[_0xbe9c('0x4c')]);return _0x354c8f[_0xbe9c('0x48')](_0x133a97);}})[_0xbe9c('0x20')](function(_0x467cf3){if(_0x467cf3){_0x50d73c=_0x467cf3[_0xbe9c('0x2f')];if(!_0x330e95['query']['hasOwnProperty'](_0xbe9c('0x31'))){_0x133a97['limit']=qs[_0xbe9c('0x32')](_0x330e95[_0xbe9c('0x2a')][_0xbe9c('0x32')]);_0x133a97[_0xbe9c('0x1a')]=qs['offset'](_0x330e95[_0xbe9c('0x2a')][_0xbe9c('0x1a')]);}return _0x354c8f['getConfigurations'](_0x133a97);}})[_0xbe9c('0x20')](function(_0x1dcbdf){if(_0x1dcbdf){return _0x1dcbdf?{'count':_0x50d73c,'rows':_0x1dcbdf}:null;}})[_0xbe9c('0x20')](respondWithResult(_0x282263,null))['catch'](handleError(_0x282263,null));};exports['addConfiguration']=function(_0x2c3570,_0xb5cded,_0xffb05a){if(_0x2c3570[_0xbe9c('0x43')]['id']){delete _0x2c3570[_0xbe9c('0x43')]['id'];}return db[_0xbe9c('0x3b')][_0xbe9c('0x49')]({'where':{'id':_0x2c3570[_0xbe9c('0x47')]['id']}})['then'](handleEntityNotFound(_0xb5cded,null))[_0xbe9c('0x20')](function(_0x48371d){if(_0x48371d){_0x2c3570[_0xbe9c('0x43')][_0xbe9c('0x4d')]=_0x48371d['id'];_0x2c3570[_0xbe9c('0x43')][_0xbe9c('0x4e')]=integrations[_0xbe9c('0x4f')](_0x2c3570[_0xbe9c('0x43')]['channel'],_0x2c3570[_0xbe9c('0x43')][_0xbe9c('0x38')]);_0x2c3570['body'][_0xbe9c('0x50')]=integrations[_0xbe9c('0x51')](_0x2c3570[_0xbe9c('0x43')]['channel'],_0x2c3570['body'][_0xbe9c('0x38')]);return db[_0xbe9c('0x4a')][_0xbe9c('0x42')](_0x2c3570[_0xbe9c('0x43')],{'include':[{'model':db[_0xbe9c('0x52')],'as':_0xbe9c('0x4e')},{'model':db[_0xbe9c('0x52')],'as':_0xbe9c('0x50')}]});}return null;})[_0xbe9c('0x20')](respondWithResult(_0xb5cded,null))[_0xbe9c('0x41')](handleError(_0xb5cded,null));};function getAccessToken(_0x47f4ec){return new Promise(function(_0x2d33d6,_0x4566da){var _0x871f68;switch(_0x47f4ec[_0xbe9c('0x53')]){case'US':_0x871f68=_0xbe9c('0x54');break;case'AU':_0x871f68=_0xbe9c('0x55');break;case'EU':_0x871f68=_0xbe9c('0x56');break;case'IN':_0x871f68=_0xbe9c('0x57');break;case'CN':_0x871f68=_0xbe9c('0x58');break;default:_0x871f68=_0xbe9c('0x56');break;}var _0x2fcf0b={'method':_0xbe9c('0x59'),'uri':_0x871f68+'/oauth/v2/token','qs':{'refresh_token':_0x47f4ec[_0xbe9c('0x5a')],'client_id':_0x47f4ec[_0xbe9c('0x5b')],'client_secret':_0x47f4ec['clientSecret'],'grant_type':_0xbe9c('0x5c')},'json':!![]};return rp(_0x2fcf0b)['then'](function(_0x3dec0e){if(_0x3dec0e[_0xbe9c('0x5d')]){_0x2d33d6(_0x3dec0e[_0xbe9c('0x5d')]);}else{_0x4566da(_0xbe9c('0x5e'));}})[_0xbe9c('0x41')](function(_0x38ec61){_0x4566da(_0x38ec61);});});}exports['getFields']=function(_0x455302,_0x1c4dd3,_0xceabe3){var _0x38b449,_0x570066,_0x18580d,_0x3e14f0,_0xee848e;return db['ZohoAccount']['findOne']({'where':{'id':_0x455302['params']['id']},'attributes':['id',_0xbe9c('0x5f'),_0xbe9c('0x53'),_0xbe9c('0x5b'),'clientSecret',_0xbe9c('0x60'),_0xbe9c('0x61'),_0xbe9c('0x5a')]})['then'](handleEntityNotFound(_0x1c4dd3,null))['then'](function(_0xca83b3){_0xee848e=_0xca83b3;_0x38b449=_0xee848e['host'];_0x570066=_0x38b449===_0xbe9c('0x62')?'eu':_0xbe9c('0x63');_0x18580d=_0xee848e[_0xbe9c('0x60')];var _0x4c33c1=_0x18580d[_0xbe9c('0x64')](-0x1);if(_0x4c33c1==='/'||_0x4c33c1==='\x5c'||_0x4c33c1===':'){_0x18580d=_0x18580d['substring'](0x0,_0x18580d[_0xbe9c('0x65')](_0x4c33c1));}if(!_0xee848e[_0xbe9c('0x5a')]){throw new Error(_0xbe9c('0x66'));}return getAccessToken(_0xee848e);})[_0xbe9c('0x20')](function(_0x305d10){if(_0x305d10){return rp({'method':_0xbe9c('0x67'),'uri':util['format'](_0xbe9c('0x68'),_0x570066),'qs':{'module':_0xbe9c('0x69')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x305d10},'json':!![]});}})[_0xbe9c('0x20')](function(_0x48ab42){if(_0x48ab42){if(_0x48ab42[_0xbe9c('0x6a')]&&_0x48ab42['response'][_0xbe9c('0x21')]){throw new Error(_0x48ab42[_0xbe9c('0x6a')][_0xbe9c('0x21')]['message']);}var _0x363a80=[];var _0x38e2a7=[];var _0x4c9b61=[_0xbe9c('0x6b'),_0xbe9c('0x6c'),_0xbe9c('0x6d'),_0xbe9c('0x6e'),'Call_Duration',_0xbe9c('0x6f'),'Call_Start_Time',_0xbe9c('0x70')];_0x38e2a7=_[_0xbe9c('0x71')](_0x48ab42[_0xbe9c('0x2e')],function(_0x347312){return _0x4c9b61[_0xbe9c('0x72')](_0x347312['api_name']);});for(var _0x58ce79=0x0;_0x58ce79<_0x38e2a7[_0xbe9c('0x2f')];_0x58ce79++){if(_0x38e2a7[_0x58ce79][_0xbe9c('0x73')]===![]){_0x363a80[_0xbe9c('0x74')]({'id':_0x38e2a7[_0x58ce79]['id'],'name':_0x38e2a7[_0x58ce79][_0xbe9c('0x75')],'custom':_0x38e2a7[_0x58ce79][_0xbe9c('0x76')],'options':_0x38e2a7[_0x58ce79]['data_type']==='picklist'&&_0x38e2a7[_0x58ce79][_0xbe9c('0x77')][_0xbe9c('0x2f')]>-0x1?_['map'](_0x38e2a7[_0x58ce79][_0xbe9c('0x77')],function(_0x3db1a6){return{'name':_0x3db1a6,'value':_0x3db1a6};}):[]});}}return{'count':_0x363a80[_0xbe9c('0x2f')],'rows':_0x363a80};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x1c4dd3,null))[_0xbe9c('0x41')](function(_0x249a55){var _0x223c8e=_0x455302[_0xbe9c('0x2a')][_0xbe9c('0x78')]?0x1f4:_0x249a55[_0xbe9c('0x79')]||0x1f4;logger[_0xbe9c('0x21')](_0xbe9c('0x7a'),_0xbe9c('0x7b'),_0x223c8e,JSON[_0xbe9c('0x7c')](_0x249a55));delete _0x249a55[_0xbe9c('0x23')];if(_0x223c8e===0x191){_0x223c8e=0x190;}_0x1c4dd3['status'](_0x223c8e)[_0xbe9c('0x24')](_0x455302[_0xbe9c('0x2a')][_0xbe9c('0x78')]?{'message':_0xbe9c('0x7d'),'statusCode':_0x249a55['statusCode']}:_0x249a55);});}; \ No newline at end of file +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 diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index fc392b2..e4bc6a4 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 _0x7a22=['https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','util','api','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','clientId','clientSecret','code','host','serverUrl','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn'];(function(_0x39ea6b,_0xaa1328){var _0xdc9fe3=function(_0x809a95){while(--_0x809a95){_0x39ea6b['push'](_0x39ea6b['shift']());}};_0xdc9fe3(++_0xaa1328);}(_0x7a22,0x140));var _0x27a2=function(_0x5b78ba,_0x344bcf){_0x5b78ba=_0x5b78ba-0x0;var _0x5e406f=_0x7a22[_0x5b78ba];return _0x5e406f;};'use strict';var _=require('lodash');var util=require(_0x27a2('0x0'));var logger=require('../../config/logger')(_0x27a2('0x1'));var moment=require(_0x27a2('0x2'));var BPromise=require(_0x27a2('0x3'));var rp=require(_0x27a2('0x4'));var fs=require('fs');var path=require(_0x27a2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x27a2('0x6'));module[_0x27a2('0x7')]=function(_0x5619ac,_0xa7ec47){return _0x5619ac[_0x27a2('0x8')](_0x27a2('0x9'),attributes,{'tableName':_0x27a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2c2f48,_0x4c3c27,_0x238e3c){if(_0x2c2f48[_0x27a2('0xb')](_0x27a2('0xc'))||_0x2c2f48[_0x27a2('0xb')]('serverUrl')||_0x2c2f48[_0x27a2('0xb')](_0x27a2('0xd'))||_0x2c2f48[_0x27a2('0xb')](_0x27a2('0xe'))||_0x2c2f48[_0x27a2('0xb')](_0x27a2('0xf'))||_0x2c2f48['changed'](_0x27a2('0x10'))){var _0x39de43,_0x34acfa;_0x39de43=_0x2c2f48[_0x27a2('0x11')];var _0xf908a1=_0x39de43[_0x27a2('0x12')](-0x1);if(_0xf908a1==='/'||_0xf908a1==='\x5c'||_0xf908a1===':'){_0x39de43=_0x39de43['substring'](0x0,_0x39de43[_0x27a2('0x13')](_0xf908a1));}switch(_0x2c2f48[_0x27a2('0xc')]){case'US':_0x34acfa='https://accounts.zoho.com';break;case'AU':_0x34acfa=_0x27a2('0x14');break;case'IN':_0x34acfa='https://accounts.zoho.in';break;case'CN':_0x34acfa=_0x27a2('0x15');break;default:_0x34acfa=_0x27a2('0x16');break;}var _0x55fa1a={'method':'POST','uri':_0x34acfa+_0x27a2('0x17'),'form':{'grant_type':_0x27a2('0x18'),'client_id':_0x2c2f48[_0x27a2('0xd')],'client_secret':_0x2c2f48['clientSecret'],'redirect_uri':_0x2c2f48[_0x27a2('0x11')],'code':_0x2c2f48[_0x27a2('0xf')]},'headers':{'Content-Type':_0x27a2('0x19')}};return rp(_0x55fa1a)[_0x27a2('0x1a')](function(_0x5ace22){var _0x271196=JSON[_0x27a2('0x1b')](_0x5ace22);if(_0x271196['refresh_token']){_0x2c2f48[_0x27a2('0x1c')]=_0x271196[_0x27a2('0x1d')];logger[_0x27a2('0x1e')](util[_0x27a2('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2c2f48['name'],_0x2c2f48['id']));}else{logger['error'](util['format'](_0x27a2('0x20'),_0x2c2f48[_0x27a2('0x21')],_0x2c2f48['id']),util[_0x27a2('0x22')](_0x271196,{'showHidden':![],'depth':null}));}return _0x238e3c(null,_0x4c3c27);})[_0x27a2('0x23')](function(_0x1ce773){logger['error'](util[_0x27a2('0x1f')](_0x27a2('0x20'),_0x2c2f48[_0x27a2('0x21')],_0x2c2f48['id']),util[_0x27a2('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x238e3c(_0x1ce773);});}else{return _0x238e3c(null,_0x4c3c27);}},'beforeUpdate':function(_0x134f32,_0x27fac7,_0x15462f){if(_0x134f32[_0x27a2('0xb')](_0x27a2('0xc'))||_0x134f32[_0x27a2('0xb')](_0x27a2('0x11'))||_0x134f32[_0x27a2('0xb')](_0x27a2('0xd'))||_0x134f32[_0x27a2('0xb')]('clientSecret')||_0x134f32[_0x27a2('0xb')]('code')||_0x134f32[_0x27a2('0xb')](_0x27a2('0x10'))){var _0x1fabc9,_0x14746e;_0x1fabc9=_0x134f32[_0x27a2('0x11')];var _0x3f71be=_0x1fabc9[_0x27a2('0x12')](-0x1);if(_0x3f71be==='/'||_0x3f71be==='\x5c'||_0x3f71be===':'){_0x1fabc9=_0x1fabc9['substring'](0x0,_0x1fabc9['lastIndexOf'](_0x3f71be));}switch(_0x134f32[_0x27a2('0xc')]){case'US':_0x14746e='https://accounts.zoho.com';break;case'AU':_0x14746e=_0x27a2('0x14');break;case'IN':_0x14746e='https://accounts.zoho.in';break;case'CN':_0x14746e=_0x27a2('0x15');break;default:_0x14746e='https://accounts.zoho.eu';break;}var _0x394670={'method':'POST','uri':_0x14746e+'/oauth/v2/token','form':{'grant_type':_0x27a2('0x18'),'client_id':_0x134f32[_0x27a2('0xd')],'client_secret':_0x134f32['clientSecret'],'redirect_uri':_0x134f32['serverUrl'],'code':_0x134f32[_0x27a2('0xf')]},'headers':{'Content-Type':_0x27a2('0x19')}};return rp(_0x394670)['then'](function(_0x2da228){var _0x3cb629=JSON[_0x27a2('0x1b')](_0x2da228);if(_0x3cb629[_0x27a2('0x1d')]){_0x134f32[_0x27a2('0x1c')]=_0x3cb629['refresh_token'];logger['info'](util[_0x27a2('0x1f')](_0x27a2('0x24'),_0x134f32['name'],_0x134f32['id']));}else{logger[_0x27a2('0x25')](util['format'](_0x27a2('0x20'),_0x134f32['name'],_0x134f32['id']),util[_0x27a2('0x22')](_0x3cb629,{'showHidden':![],'depth':null}));}return _0x15462f(null,_0x27fac7);})[_0x27a2('0x23')](function(_0x28e373){logger[_0x27a2('0x25')](util[_0x27a2('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x134f32[_0x27a2('0x21')],_0x134f32['id']),util[_0x27a2('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x15462f(_0x28e373);});}else{return _0x15462f(null,_0x27fac7);}}}});}; \ No newline at end of file +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 diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 048b593..74e4795 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 _0x27eb=['stringify','find','where','ShowZohoAccount','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetZohoAccount','ZohoAccount','options','attributes','limit','include','model','map'];(function(_0xdd7bb4,_0xeab42b){var _0x43d717=function(_0xd3992f){while(--_0xd3992f){_0xdd7bb4['push'](_0xdd7bb4['shift']());}};_0x43d717(++_0xeab42b);}(_0x27eb,0xd0));var _0xb27e=function(_0x4126b4,_0x450239){_0x4126b4=_0x4126b4-0x0;var _0x573a31=_0x27eb[_0x4126b4];return _0x573a31;};'use strict';var _=require(_0xb27e('0x0'));var util=require(_0xb27e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb27e('0x2'));var fs=require('fs');var Redis=require(_0xb27e('0x3'));var db=require(_0xb27e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb27e('0x5'))(_0xb27e('0x6'));var config=require(_0xb27e('0x7'));var jayson=require(_0xb27e('0x8'));var client=jayson['client'][_0xb27e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x333512,_0x1e76db,_0x45c0ea){return new BPromise(function(_0x3b0cb4,_0x4c3857){return client[_0xb27e('0xa')](_0x333512,_0x45c0ea)[_0xb27e('0xb')](function(_0x694d26){logger[_0xb27e('0xc')](_0xb27e('0xd'),_0x1e76db,'request\x20sent');logger[_0xb27e('0xe')](_0xb27e('0xf'),_0x1e76db,'request\x20sent',JSON['stringify'](_0x694d26));if(_0x694d26[_0xb27e('0x10')]){if(_0x694d26['error'][_0xb27e('0x11')]===0x1f4){logger[_0xb27e('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x1e76db,_0x694d26['error']['message']);return _0x4c3857(_0x694d26[_0xb27e('0x10')]['message']);}logger[_0xb27e('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x1e76db,_0x694d26[_0xb27e('0x10')]['message']);return _0x3b0cb4(_0x694d26[_0xb27e('0x10')][_0xb27e('0x12')]);}else{logger[_0xb27e('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1e76db,_0xb27e('0x13'));_0x3b0cb4(_0x694d26[_0xb27e('0x14')][_0xb27e('0x12')]);}})[_0xb27e('0x15')](function(_0x240767){logger[_0xb27e('0x10')](_0xb27e('0xd'),_0x1e76db,_0x240767);_0x4c3857(_0x240767);});});}exports[_0xb27e('0x16')]=function(_0x317f4e){var _0x48b70f=this;return new Promise(function(_0x8be243,_0x165295){return db[_0xb27e('0x17')]['findAll']({'raw':_0x317f4e[_0xb27e('0x18')]?_0x317f4e['options']['raw']===undefined?!![]:![]:!![],'where':_0x317f4e[_0xb27e('0x18')]?_0x317f4e[_0xb27e('0x18')]['where']||null:null,'attributes':_0x317f4e[_0xb27e('0x18')]?_0x317f4e[_0xb27e('0x18')][_0xb27e('0x19')]||null:null,'limit':_0x317f4e[_0xb27e('0x18')]?_0x317f4e['options'][_0xb27e('0x1a')]||null:null,'include':_0x317f4e['options']?_0x317f4e[_0xb27e('0x18')][_0xb27e('0x1b')]?_['map'](_0x317f4e['options'][_0xb27e('0x1b')],function(_0xfbc258){return{'model':db[_0xfbc258[_0xb27e('0x1c')]],'as':_0xfbc258['as'],'attributes':_0xfbc258[_0xb27e('0x19')],'include':_0xfbc258[_0xb27e('0x1b')]?_['map'](_0xfbc258[_0xb27e('0x1b')],function(_0x4cba0b){return{'model':db[_0x4cba0b[_0xb27e('0x1c')]],'as':_0x4cba0b['as'],'attributes':_0x4cba0b[_0xb27e('0x19')],'include':_0x4cba0b[_0xb27e('0x1b')]?_[_0xb27e('0x1d')](_0x4cba0b[_0xb27e('0x1b')],function(_0x4dab95){return{'model':db[_0x4dab95[_0xb27e('0x1c')]],'as':_0x4dab95['as'],'attributes':_0x4dab95['attributes']};}):[]};}):[]};}):[]:[]})[_0xb27e('0xb')](function(_0x2f44f3){logger[_0xb27e('0xc')](_0xb27e('0x16'),_0x317f4e);logger[_0xb27e('0xe')](_0xb27e('0x16'),_0x317f4e,JSON[_0xb27e('0x1e')](_0x2f44f3));_0x8be243(_0x2f44f3);})[_0xb27e('0x15')](function(_0x42c5de){logger['error'](_0xb27e('0x16'),_0x42c5de[_0xb27e('0x12')],_0x317f4e);_0x165295(_0x48b70f[_0xb27e('0x10')](0x1f4,_0x42c5de[_0xb27e('0x12')]));});});};exports['ShowZohoAccount']=function(_0x1ba773){var _0x28927a=this;return new Promise(function(_0xbcc473,_0x3dccaa){return db[_0xb27e('0x17')][_0xb27e('0x1f')]({'raw':_0x1ba773[_0xb27e('0x18')]?_0x1ba773['options']['raw']===undefined?!![]:![]:!![],'where':_0x1ba773[_0xb27e('0x18')]?_0x1ba773['options'][_0xb27e('0x20')]||null:null,'attributes':_0x1ba773['options']?_0x1ba773[_0xb27e('0x18')][_0xb27e('0x19')]||null:null,'include':_0x1ba773[_0xb27e('0x18')]?_0x1ba773[_0xb27e('0x18')][_0xb27e('0x1b')]?_[_0xb27e('0x1d')](_0x1ba773['options'][_0xb27e('0x1b')],function(_0x5042c4){return{'model':db[_0x5042c4[_0xb27e('0x1c')]],'as':_0x5042c4['as'],'attributes':_0x5042c4['attributes'],'include':_0x5042c4[_0xb27e('0x1b')]?_['map'](_0x5042c4[_0xb27e('0x1b')],function(_0x292315){return{'model':db[_0x292315['model']],'as':_0x292315['as'],'attributes':_0x292315['attributes'],'include':_0x292315[_0xb27e('0x1b')]?_['map'](_0x292315['include'],function(_0x58fb5b){return{'model':db[_0x58fb5b[_0xb27e('0x1c')]],'as':_0x58fb5b['as'],'attributes':_0x58fb5b[_0xb27e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa6ff7b){logger[_0xb27e('0xc')]('ShowZohoAccount',_0x1ba773);logger['debug'](_0xb27e('0x21'),_0x1ba773,JSON['stringify'](_0xa6ff7b));_0xbcc473(_0xa6ff7b);})[_0xb27e('0x15')](function(_0x551038){logger[_0xb27e('0x10')](_0xb27e('0x21'),_0x551038[_0xb27e('0x12')],_0x1ba773);_0x3dccaa(_0x28927a[_0xb27e('0x10')](0x1f4,_0x551038[_0xb27e('0x12')]));});});}; \ No newline at end of file +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 diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 2f9db65..f6a449a 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 _0xddfd=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','destroy','exports'];(function(_0x50fcfe,_0x3ab8f2){var _0xb19b8b=function(_0x2b5bd7){while(--_0x2b5bd7){_0x50fcfe['push'](_0x50fcfe['shift']());}};_0xb19b8b(++_0x3ab8f2);}(_0xddfd,0x6e));var _0xdddf=function(_0xe7d958,_0x42e24c){_0xe7d958=_0xe7d958-0x0;var _0x35a07c=_0xddfd[_0xe7d958];return _0x35a07c;};'use strict';var multer=require(_0xdddf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdddf('0x1'));var express=require(_0xdddf('0x2'));var router=express[_0xdddf('0x3')]();var fs_extra=require(_0xdddf('0x4'));var auth=require(_0xdddf('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xdddf('0x6'));router[_0xdddf('0x7')]('/',auth[_0xdddf('0x8')](),controller[_0xdddf('0x9')]);router[_0xdddf('0x7')](_0xdddf('0xa'),auth[_0xdddf('0x8')](),controller['show']);router['get'](_0xdddf('0xb'),auth[_0xdddf('0x8')](),controller[_0xdddf('0xc')]);router[_0xdddf('0x7')](_0xdddf('0xd'),auth[_0xdddf('0x8')](),controller[_0xdddf('0xe')]);router[_0xdddf('0x7')]('/:id/descriptions',auth[_0xdddf('0x8')](),controller[_0xdddf('0xf')]);router[_0xdddf('0x10')]('/',auth[_0xdddf('0x8')](),controller[_0xdddf('0x11')]);router[_0xdddf('0x12')](_0xdddf('0xa'),auth[_0xdddf('0x8')](),controller['update']);router[_0xdddf('0x13')](_0xdddf('0xa'),auth['isAuthenticated'](),controller[_0xdddf('0x14')]);module[_0xdddf('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 0956234..d74ef31 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 _0xc0bd=['lead','contact','nothing','contact_lead','sequelize','exports','STRING','ENUM'];(function(_0x2d01c0,_0x2fbee3){var _0x27a815=function(_0x1d3854){while(--_0x1d3854){_0x2d01c0['push'](_0x2d01c0['shift']());}};_0x27a815(++_0x2fbee3);}(_0xc0bd,0x18c));var _0xdc0b=function(_0x2e3a02,_0x5a7eda){_0x2e3a02=_0x2e3a02-0x0;var _0x344db9=_0xc0bd[_0x2e3a02];return _0x344db9;};'use strict';var Sequelize=require(_0xdc0b('0x0'));module[_0xdc0b('0x1')]={'name':{'type':Sequelize[_0xdc0b('0x2')]},'moduleCreate':{'type':Sequelize[_0xdc0b('0x3')](_0xdc0b('0x4'),_0xdc0b('0x5'),_0xdc0b('0x6')),'defaultValue':_0xdc0b('0x4')},'moduleSearch':{'type':Sequelize[_0xdc0b('0x3')](_0xdc0b('0x7'),'contact',_0xdc0b('0x4')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0xdc0b('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 4c606ca..1926c28 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 _0xdce6=['params','options','find','create','body','getFields','findOne','ZohoField','rawAttributes','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ZohoConfiguration','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch'];(function(_0x9ad4bb,_0x1f610d){var _0x1848c1=function(_0x2ea54c){while(--_0x2ea54c){_0x9ad4bb['push'](_0x9ad4bb['shift']());}};_0x1848c1(++_0x1f610d);}(_0xdce6,0x153));var _0x6dce=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xdce6[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require(_0x6dce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dce('0x1'));var jsonpatch=require(_0x6dce('0x2'));var rp=require('request-promise');var moment=require(_0x6dce('0x3'));var BPromise=require(_0x6dce('0x4'));var Mustache=require(_0x6dce('0x5'));var util=require('util');var path=require('path');var sox=require(_0x6dce('0x6'));var csv=require(_0x6dce('0x7'));var ejs=require(_0x6dce('0x8'));var fs=require('fs');var fs_extra=require(_0x6dce('0x9'));var _=require(_0x6dce('0xa'));var squel=require(_0x6dce('0xb'));var crypto=require(_0x6dce('0xc'));var jsforce=require(_0x6dce('0xd'));var deskjs=require(_0x6dce('0xe'));var toCsv=require(_0x6dce('0x7'));var querystring=require(_0x6dce('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6dce('0x10'));var qs=require(_0x6dce('0x11'));var as=require(_0x6dce('0x12'));var hardwareService=require(_0x6dce('0x13'));var logger=require(_0x6dce('0x14'))(_0x6dce('0x15'));var utils=require(_0x6dce('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6dce('0x17'))['db'];function respondWithStatusCode(_0x157e94,_0x3bb87b){_0x3bb87b=_0x3bb87b||0xcc;return function(_0xf745ac){if(_0xf745ac){return _0x157e94['sendStatus'](_0x3bb87b);}return _0x157e94[_0x6dce('0x18')](_0x3bb87b)[_0x6dce('0x19')]();};}function respondWithResult(_0x24f54e,_0x3f3c84){_0x3f3c84=_0x3f3c84||0xc8;return function(_0xff376a){if(_0xff376a){return _0x24f54e['status'](_0x3f3c84)[_0x6dce('0x1a')](_0xff376a);}};}function respondWithFilteredResult(_0x359588,_0xc5dc36){return function(_0x4993d4){if(_0x4993d4){var _0x3b1f21=typeof _0xc5dc36[_0x6dce('0x1b')]==='undefined'&&typeof _0xc5dc36[_0x6dce('0x1c')]===_0x6dce('0x1d');var _0x131505=_0x4993d4[_0x6dce('0x1e')];var _0x2176dc=_0x3b1f21?0x0:_0xc5dc36[_0x6dce('0x1b')];var _0x491f2d=_0x3b1f21?_0x4993d4[_0x6dce('0x1e')]:_0xc5dc36[_0x6dce('0x1b')]+_0xc5dc36[_0x6dce('0x1c')];var _0x2996ca;if(_0x491f2d>=_0x131505){_0x491f2d=_0x131505;_0x2996ca=0xc8;}else{_0x2996ca=0xce;}_0x359588[_0x6dce('0x18')](_0x2996ca);return _0x359588[_0x6dce('0x1f')](_0x6dce('0x20'),_0x2176dc+'-'+_0x491f2d+'/'+_0x131505)[_0x6dce('0x1a')](_0x4993d4);}return null;};}function patchUpdates(_0x2aa1dc){return function(_0x308c72){try{jsonpatch['apply'](_0x308c72,_0x2aa1dc,!![]);}catch(_0x4c0210){return BPromise[_0x6dce('0x21')](_0x4c0210);}return _0x308c72[_0x6dce('0x22')]();};}function saveUpdates(_0x489637,_0x90a575){return function(_0x2e514c){if(_0x2e514c){return _0x2e514c[_0x6dce('0x23')](_0x489637)[_0x6dce('0x24')](function(_0x38db38){return _0x38db38;});}return null;};}function removeEntity(_0x489218,_0x27f09c){return function(_0x3c44e5){if(_0x3c44e5){return _0x3c44e5[_0x6dce('0x25')]()[_0x6dce('0x24')](function(){_0x489218['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a37ce,_0x1b8eb1){return function(_0xcf582e){if(!_0xcf582e){_0x4a37ce[_0x6dce('0x26')](0x194);}return _0xcf582e;};}function handleError(_0x44b3c8,_0x524107){_0x524107=_0x524107||0x1f4;return function(_0x4be70d){logger[_0x6dce('0x27')](_0x4be70d[_0x6dce('0x28')]);if(_0x4be70d[_0x6dce('0x29')]){delete _0x4be70d[_0x6dce('0x29')];}_0x44b3c8['status'](_0x524107)[_0x6dce('0x2a')](_0x4be70d);};}exports[_0x6dce('0x2b')]=function(_0x4dc53f,_0x274e2d){var _0x254a0c={},_0x3c2b49={},_0x3eaeb6={'count':0x0,'rows':[]};var _0x22f636=_[_0x6dce('0x2c')](db[_0x6dce('0x2d')]['rawAttributes'],function(_0x1df7a1){return{'name':_0x1df7a1[_0x6dce('0x2e')],'type':_0x1df7a1['type'][_0x6dce('0x2f')]};});_0x3c2b49[_0x6dce('0x30')]=_[_0x6dce('0x2c')](_0x22f636,_0x6dce('0x29'));_0x3c2b49[_0x6dce('0x31')]=_[_0x6dce('0x32')](_0x4dc53f[_0x6dce('0x31')]);_0x3c2b49[_0x6dce('0x33')]=_[_0x6dce('0x34')](_0x3c2b49[_0x6dce('0x30')],_0x3c2b49['query']);_0x254a0c[_0x6dce('0x35')]=_[_0x6dce('0x34')](_0x3c2b49['model'],qs[_0x6dce('0x36')](_0x4dc53f[_0x6dce('0x31')]['fields']));_0x254a0c['attributes']=_0x254a0c[_0x6dce('0x35')][_0x6dce('0x37')]?_0x254a0c[_0x6dce('0x35')]:_0x3c2b49[_0x6dce('0x30')];if(!_0x4dc53f['query'][_0x6dce('0x38')](_0x6dce('0x39'))){_0x254a0c[_0x6dce('0x1c')]=qs[_0x6dce('0x1c')](_0x4dc53f[_0x6dce('0x31')][_0x6dce('0x1c')]);_0x254a0c[_0x6dce('0x1b')]=qs[_0x6dce('0x1b')](_0x4dc53f[_0x6dce('0x31')][_0x6dce('0x1b')]);}_0x254a0c[_0x6dce('0x3a')]=qs[_0x6dce('0x3b')](_0x4dc53f[_0x6dce('0x31')][_0x6dce('0x3b')]);_0x254a0c[_0x6dce('0x3c')]=qs[_0x6dce('0x33')](_[_0x6dce('0x3d')](_0x4dc53f[_0x6dce('0x31')],_0x3c2b49['filters']),_0x22f636);if(_0x4dc53f[_0x6dce('0x31')][_0x6dce('0x3e')]){_0x254a0c[_0x6dce('0x3c')]=_[_0x6dce('0x3f')](_0x254a0c[_0x6dce('0x3c')],{'$or':_[_0x6dce('0x2c')](_0x22f636,function(_0xf26652){if(_0xf26652[_0x6dce('0x40')]!==_0x6dce('0x41')){var _0x5183eb={};_0x5183eb[_0xf26652[_0x6dce('0x29')]]={'$like':'%'+_0x4dc53f[_0x6dce('0x31')][_0x6dce('0x3e')]+'%'};return _0x5183eb;}})});}_0x254a0c=_[_0x6dce('0x3f')]({},_0x254a0c,_0x4dc53f['options']);var _0xccd8f={'where':_0x254a0c[_0x6dce('0x3c')]};return db['ZohoConfiguration'][_0x6dce('0x1e')](_0xccd8f)[_0x6dce('0x24')](function(_0x30079e){_0x3eaeb6[_0x6dce('0x1e')]=_0x30079e;if(_0x4dc53f[_0x6dce('0x31')][_0x6dce('0x42')]){_0x254a0c[_0x6dce('0x43')]=[{'all':!![]}];}return db[_0x6dce('0x2d')][_0x6dce('0x44')](_0x254a0c);})[_0x6dce('0x24')](function(_0x685c96){_0x3eaeb6[_0x6dce('0x45')]=_0x685c96;return _0x3eaeb6;})[_0x6dce('0x24')](respondWithFilteredResult(_0x274e2d,_0x254a0c))[_0x6dce('0x46')](handleError(_0x274e2d,null));};exports['show']=function(_0x54ba00,_0x58059f){var _0x3c3c24={'raw':![],'where':{'id':_0x54ba00[_0x6dce('0x47')]['id']}},_0x1685c0={};_0x1685c0[_0x6dce('0x30')]=_[_0x6dce('0x32')](db[_0x6dce('0x2d')]['rawAttributes']);_0x1685c0[_0x6dce('0x31')]=_['keys'](_0x54ba00[_0x6dce('0x31')]);_0x1685c0[_0x6dce('0x33')]=_['intersection'](_0x1685c0['model'],_0x1685c0['query']);_0x3c3c24[_0x6dce('0x35')]=_['intersection'](_0x1685c0[_0x6dce('0x30')],qs[_0x6dce('0x36')](_0x54ba00[_0x6dce('0x31')][_0x6dce('0x36')]));_0x3c3c24[_0x6dce('0x35')]=_0x3c3c24['attributes']['length']?_0x3c3c24['attributes']:_0x1685c0['model'];if(_0x54ba00[_0x6dce('0x31')][_0x6dce('0x42')]){_0x3c3c24['include']=[{'all':!![]}];}_0x3c3c24=_[_0x6dce('0x3f')]({},_0x3c3c24,_0x54ba00[_0x6dce('0x48')]);return db[_0x6dce('0x2d')][_0x6dce('0x49')](_0x3c3c24)['then'](handleEntityNotFound(_0x58059f,null))[_0x6dce('0x24')](respondWithResult(_0x58059f,null))[_0x6dce('0x46')](handleError(_0x58059f,null));};exports[_0x6dce('0x4a')]=function(_0x4427df,_0x3c710c){return db[_0x6dce('0x2d')][_0x6dce('0x4a')](_0x4427df[_0x6dce('0x4b')],{})[_0x6dce('0x24')](respondWithResult(_0x3c710c,0xc9))[_0x6dce('0x46')](handleError(_0x3c710c,null));};exports[_0x6dce('0x23')]=function(_0x326dcd,_0x18361a){if(_0x326dcd[_0x6dce('0x4b')]['id']){delete _0x326dcd[_0x6dce('0x4b')]['id'];}return db['ZohoConfiguration']['find']({'where':{'id':_0x326dcd[_0x6dce('0x47')]['id']}})[_0x6dce('0x24')](handleEntityNotFound(_0x18361a,null))['then'](saveUpdates(_0x326dcd[_0x6dce('0x4b')],null))[_0x6dce('0x24')](respondWithResult(_0x18361a,null))[_0x6dce('0x46')](handleError(_0x18361a,null));};exports[_0x6dce('0x25')]=function(_0x2d6a9c,_0x5e9b5d){return db[_0x6dce('0x2d')][_0x6dce('0x49')]({'where':{'id':_0x2d6a9c['params']['id']}})[_0x6dce('0x24')](handleEntityNotFound(_0x5e9b5d,null))[_0x6dce('0x24')](removeEntity(_0x5e9b5d,null))[_0x6dce('0x46')](handleError(_0x5e9b5d,null));};exports[_0x6dce('0x4c')]=function(_0x5211b7,_0x510685,_0x3d16e7){var _0x16417b={};var _0x577bc6={};var _0x245bac;var _0x5883b0;return db[_0x6dce('0x2d')][_0x6dce('0x4d')]({'where':{'id':_0x5211b7['params']['id']}})['then'](handleEntityNotFound(_0x510685,null))['then'](function(_0x55b5e9){if(_0x55b5e9){_0x245bac=_0x55b5e9;_0x577bc6[_0x6dce('0x30')]=_[_0x6dce('0x32')](db[_0x6dce('0x4e')][_0x6dce('0x4f')]);_0x577bc6[_0x6dce('0x31')]=_[_0x6dce('0x32')](_0x5211b7['query']);_0x577bc6[_0x6dce('0x33')]=_['intersection'](_0x577bc6[_0x6dce('0x30')],_0x577bc6[_0x6dce('0x31')]);_0x16417b[_0x6dce('0x35')]=_[_0x6dce('0x34')](_0x577bc6[_0x6dce('0x30')],qs[_0x6dce('0x36')](_0x5211b7[_0x6dce('0x31')][_0x6dce('0x36')]));_0x16417b[_0x6dce('0x35')]=_0x16417b[_0x6dce('0x35')][_0x6dce('0x37')]?_0x16417b[_0x6dce('0x35')]:_0x577bc6[_0x6dce('0x30')];_0x16417b[_0x6dce('0x3a')]=qs[_0x6dce('0x3b')](_0x5211b7[_0x6dce('0x31')][_0x6dce('0x3b')]);_0x16417b[_0x6dce('0x3c')]=qs[_0x6dce('0x33')](_[_0x6dce('0x3d')](_0x5211b7[_0x6dce('0x31')],_0x577bc6[_0x6dce('0x33')]));if(_0x5211b7[_0x6dce('0x31')][_0x6dce('0x3e')]){_0x16417b['where']=_['merge'](_0x16417b[_0x6dce('0x3c')],{'$or':_[_0x6dce('0x2c')](_0x16417b[_0x6dce('0x35')],function(_0x3d8520){var _0x2d3502={};_0x2d3502[_0x3d8520]={'$like':'%'+_0x5211b7[_0x6dce('0x31')][_0x6dce('0x3e')]+'%'};return _0x2d3502;})});}_0x16417b=_[_0x6dce('0x3f')]({},_0x16417b,_0x5211b7[_0x6dce('0x48')]);return _0x245bac[_0x6dce('0x4c')](_0x16417b);}})['then'](function(_0x297bc7){if(_0x297bc7){_0x5883b0=_0x297bc7[_0x6dce('0x37')];if(!_0x5211b7[_0x6dce('0x31')][_0x6dce('0x38')](_0x6dce('0x39'))){_0x16417b['limit']=qs['limit'](_0x5211b7[_0x6dce('0x31')][_0x6dce('0x1c')]);_0x16417b[_0x6dce('0x1b')]=qs[_0x6dce('0x1b')](_0x5211b7[_0x6dce('0x31')][_0x6dce('0x1b')]);}return _0x245bac[_0x6dce('0x4c')](_0x16417b);}})[_0x6dce('0x24')](function(_0x4654e8){if(_0x4654e8){return _0x4654e8?{'count':_0x5883b0,'rows':_0x4654e8}:null;}})['then'](respondWithResult(_0x510685,null))[_0x6dce('0x46')](handleError(_0x510685,null));};exports[_0x6dce('0x50')]=function(_0x2a2554,_0x35b811,_0x2597f3){var _0x4fbf3c={};var _0x10e927={};var _0x523e90;var _0x1a18d0;return db[_0x6dce('0x2d')][_0x6dce('0x4d')]({'where':{'id':_0x2a2554[_0x6dce('0x47')]['id']}})[_0x6dce('0x24')](handleEntityNotFound(_0x35b811,null))[_0x6dce('0x24')](function(_0x3d0b30){if(_0x3d0b30){_0x523e90=_0x3d0b30;_0x10e927['model']=_[_0x6dce('0x32')](db['ZohoField'][_0x6dce('0x4f')]);_0x10e927[_0x6dce('0x31')]=_[_0x6dce('0x32')](_0x2a2554[_0x6dce('0x31')]);_0x10e927[_0x6dce('0x33')]=_[_0x6dce('0x34')](_0x10e927[_0x6dce('0x30')],_0x10e927['query']);_0x4fbf3c['attributes']=_[_0x6dce('0x34')](_0x10e927[_0x6dce('0x30')],qs[_0x6dce('0x36')](_0x2a2554[_0x6dce('0x31')][_0x6dce('0x36')]));_0x4fbf3c[_0x6dce('0x35')]=_0x4fbf3c[_0x6dce('0x35')][_0x6dce('0x37')]?_0x4fbf3c['attributes']:_0x10e927[_0x6dce('0x30')];_0x4fbf3c[_0x6dce('0x3a')]=qs['sort'](_0x2a2554['query']['sort']);_0x4fbf3c[_0x6dce('0x3c')]=qs[_0x6dce('0x33')](_['pick'](_0x2a2554[_0x6dce('0x31')],_0x10e927[_0x6dce('0x33')]));if(_0x2a2554[_0x6dce('0x31')]['filter']){_0x4fbf3c['where']=_['merge'](_0x4fbf3c['where'],{'$or':_[_0x6dce('0x2c')](_0x4fbf3c[_0x6dce('0x35')],function(_0x301a42){var _0x59e336={};_0x59e336[_0x301a42]={'$like':'%'+_0x2a2554[_0x6dce('0x31')]['filter']+'%'};return _0x59e336;})});}_0x4fbf3c=_[_0x6dce('0x3f')]({},_0x4fbf3c,_0x2a2554[_0x6dce('0x48')]);return _0x523e90['getSubjects'](_0x4fbf3c);}})[_0x6dce('0x24')](function(_0x260a73){if(_0x260a73){_0x1a18d0=_0x260a73[_0x6dce('0x37')];if(!_0x2a2554['query'][_0x6dce('0x38')](_0x6dce('0x39'))){_0x4fbf3c['limit']=qs['limit'](_0x2a2554[_0x6dce('0x31')][_0x6dce('0x1c')]);_0x4fbf3c[_0x6dce('0x1b')]=qs['offset'](_0x2a2554[_0x6dce('0x31')]['offset']);}return _0x523e90[_0x6dce('0x50')](_0x4fbf3c);}})['then'](function(_0x2f9a27){if(_0x2f9a27){return _0x2f9a27?{'count':_0x1a18d0,'rows':_0x2f9a27}:null;}})['then'](respondWithResult(_0x35b811,null))[_0x6dce('0x46')](handleError(_0x35b811,null));};exports['getDescriptions']=function(_0x1f551b,_0x33196d,_0x20f667){var _0x3a675d={};var _0x172d86={};var _0x3f1a29;var _0x518260;return db[_0x6dce('0x2d')][_0x6dce('0x4d')]({'where':{'id':_0x1f551b[_0x6dce('0x47')]['id']}})[_0x6dce('0x24')](handleEntityNotFound(_0x33196d,null))[_0x6dce('0x24')](function(_0x210e8f){if(_0x210e8f){_0x3f1a29=_0x210e8f;_0x172d86['model']=_['keys'](db[_0x6dce('0x4e')]['rawAttributes']);_0x172d86[_0x6dce('0x31')]=_[_0x6dce('0x32')](_0x1f551b[_0x6dce('0x31')]);_0x172d86[_0x6dce('0x33')]=_['intersection'](_0x172d86[_0x6dce('0x30')],_0x172d86[_0x6dce('0x31')]);_0x3a675d['attributes']=_['intersection'](_0x172d86[_0x6dce('0x30')],qs[_0x6dce('0x36')](_0x1f551b[_0x6dce('0x31')][_0x6dce('0x36')]));_0x3a675d[_0x6dce('0x35')]=_0x3a675d[_0x6dce('0x35')]['length']?_0x3a675d[_0x6dce('0x35')]:_0x172d86[_0x6dce('0x30')];_0x3a675d[_0x6dce('0x3a')]=qs[_0x6dce('0x3b')](_0x1f551b[_0x6dce('0x31')]['sort']);_0x3a675d[_0x6dce('0x3c')]=qs[_0x6dce('0x33')](_[_0x6dce('0x3d')](_0x1f551b[_0x6dce('0x31')],_0x172d86[_0x6dce('0x33')]));if(_0x1f551b[_0x6dce('0x31')][_0x6dce('0x3e')]){_0x3a675d[_0x6dce('0x3c')]=_['merge'](_0x3a675d[_0x6dce('0x3c')],{'$or':_['map'](_0x3a675d[_0x6dce('0x35')],function(_0x287c72){var _0x9bb0fe={};_0x9bb0fe[_0x287c72]={'$like':'%'+_0x1f551b[_0x6dce('0x31')][_0x6dce('0x3e')]+'%'};return _0x9bb0fe;})});}_0x3a675d=_['merge']({},_0x3a675d,_0x1f551b[_0x6dce('0x48')]);return _0x3f1a29[_0x6dce('0x51')](_0x3a675d);}})[_0x6dce('0x24')](function(_0x188063){if(_0x188063){_0x518260=_0x188063[_0x6dce('0x37')];if(!_0x1f551b[_0x6dce('0x31')][_0x6dce('0x38')](_0x6dce('0x39'))){_0x3a675d[_0x6dce('0x1c')]=qs[_0x6dce('0x1c')](_0x1f551b[_0x6dce('0x31')]['limit']);_0x3a675d['offset']=qs[_0x6dce('0x1b')](_0x1f551b[_0x6dce('0x31')][_0x6dce('0x1b')]);}return _0x3f1a29[_0x6dce('0x51')](_0x3a675d);}})[_0x6dce('0x24')](function(_0x32dc96){if(_0x32dc96){return _0x32dc96?{'count':_0x518260,'rows':_0x32dc96}:null;}})['then'](respondWithResult(_0x33196d,null))['catch'](handleError(_0x33196d,null));}; \ No newline at end of file +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 diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index c1dbf81..1362a07 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 _0xca5a=['int_zoho_configurations','lodash','util','../../config/logger','api','request-promise','rimraf','./intZohoConfiguration.attributes','exports'];(function(_0x4c6cf1,_0x453d0d){var _0x56e813=function(_0x3e8319){while(--_0x3e8319){_0x4c6cf1['push'](_0x4c6cf1['shift']());}};_0x56e813(++_0x453d0d);}(_0xca5a,0xd0));var _0xaca5=function(_0x20453a,_0x1314ac){_0x20453a=_0x20453a-0x0;var _0x591e98=_0xca5a[_0x20453a];return _0x591e98;};'use strict';var _=require(_0xaca5('0x0'));var util=require(_0xaca5('0x1'));var logger=require(_0xaca5('0x2'))(_0xaca5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xaca5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaca5('0x5'));var config=require('../../config/environment');var attributes=require(_0xaca5('0x6'));module[_0xaca5('0x7')]=function(_0x19f778,_0x1139d7){return _0x19f778['define']('ZohoConfiguration',attributes,{'tableName':_0xaca5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 36dc177..4de29c7 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 _0xf4b7=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf4b7,0x1a8));var _0x7f4b=function(_0x5bc860,_0x19b495){_0x5bc860=_0x5bc860-0x0;var _0x44905c=_0xf4b7[_0x5bc860];return _0x44905c;};'use strict';var _=require(_0x7f4b('0x0'));var util=require(_0x7f4b('0x1'));var moment=require(_0x7f4b('0x2'));var BPromise=require(_0x7f4b('0x3'));var rs=require(_0x7f4b('0x4'));var fs=require('fs');var Redis=require(_0x7f4b('0x5'));var db=require(_0x7f4b('0x6'))['db'];var utils=require(_0x7f4b('0x7'));var logger=require(_0x7f4b('0x8'))(_0x7f4b('0x9'));var config=require(_0x7f4b('0xa'));var jayson=require(_0x7f4b('0xb'));var client=jayson[_0x7f4b('0xc')][_0x7f4b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x198c2a,_0x71619c,_0xc7fcf8){return new BPromise(function(_0x2551a1,_0x59e9db){return client[_0x7f4b('0xe')](_0x198c2a,_0xc7fcf8)[_0x7f4b('0xf')](function(_0x47a746){logger[_0x7f4b('0x10')](_0x7f4b('0x11'),_0x71619c,'request\x20sent');logger['debug'](_0x7f4b('0x12'),_0x71619c,_0x7f4b('0x13'),JSON['stringify'](_0x47a746));if(_0x47a746[_0x7f4b('0x14')]){if(_0x47a746[_0x7f4b('0x14')]['code']===0x1f4){logger[_0x7f4b('0x14')]('ZohoConfiguration,\x20%s,\x20%s',_0x71619c,_0x47a746['error']['message']);return _0x59e9db(_0x47a746[_0x7f4b('0x14')][_0x7f4b('0x15')]);}logger[_0x7f4b('0x14')](_0x7f4b('0x11'),_0x71619c,_0x47a746['error']['message']);return _0x2551a1(_0x47a746[_0x7f4b('0x14')][_0x7f4b('0x15')]);}else{logger['info'](_0x7f4b('0x11'),_0x71619c,_0x7f4b('0x13'));_0x2551a1(_0x47a746[_0x7f4b('0x16')][_0x7f4b('0x15')]);}})[_0x7f4b('0x17')](function(_0x161823){logger['error'](_0x7f4b('0x11'),_0x71619c,_0x161823);_0x59e9db(_0x161823);});});} \ No newline at end of file +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 diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index c2b8bda..ee0db04 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 _0xf364=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0xf364,0x78));var _0x4f36=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xf364[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0x4f36('0x0'));var util=require('util');var path=require(_0x4f36('0x1'));var timeout=require(_0x4f36('0x2'));var express=require(_0x4f36('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4f36('0x4'));var interaction=require(_0x4f36('0x5'));var config=require(_0x4f36('0x6'));var controller=require('./intZohoField.controller');router[_0x4f36('0x7')]('/',auth[_0x4f36('0x8')](),controller[_0x4f36('0x9')]);router[_0x4f36('0x7')](_0x4f36('0xa'),auth[_0x4f36('0x8')](),controller[_0x4f36('0xb')]);router[_0x4f36('0xc')]('/',auth[_0x4f36('0x8')](),controller['create']);router[_0x4f36('0xd')](_0x4f36('0xa'),auth[_0x4f36('0x8')](),controller[_0x4f36('0xe')]);router['delete'](_0x4f36('0xa'),auth[_0x4f36('0x8')](),controller[_0x4f36('0xf')]);module[_0x4f36('0x10')]=router; \ No newline at end of file +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 diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 1b3f863..8b99839 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 _0xbb79=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0x1527b6,_0x4dd9bd){var _0x4b5a3c=function(_0x2615c0){while(--_0x2615c0){_0x1527b6['push'](_0x1527b6['shift']());}};_0x4b5a3c(++_0x4dd9bd);}(_0xbb79,0x7d));var _0x9bb7=function(_0x5978b7,_0x4d2291){_0x5978b7=_0x5978b7-0x0;var _0x3e12f9=_0xbb79[_0x5978b7];return _0x3e12f9;};'use strict';var Sequelize=require(_0x9bb7('0x0'));module[_0x9bb7('0x1')]={'type':{'type':Sequelize[_0x9bb7('0x2')](_0x9bb7('0x3'),_0x9bb7('0x4'),_0x9bb7('0x5'),'keyValue',_0x9bb7('0x6')),'defaultValue':_0x9bb7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9bb7('0x7')]},'keyType':{'type':Sequelize[_0x9bb7('0x2')](_0x9bb7('0x3'),'variable',_0x9bb7('0x5'))},'keyContent':{'type':Sequelize[_0x9bb7('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x9bb7('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9bb7('0x7')]}}; \ No newline at end of file +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 diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 6bc0f62..aff462d 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 _0x1b89=['rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','then','end','error','stack','name','send','index','map','ZohoField'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1b89,0x1d4));var _0x91b8=function(_0x2b7b9d,_0x89a529){_0x2b7b9d=_0x2b7b9d-0x0;var _0x57e721=_0x1b89[_0x2b7b9d];return _0x57e721;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x91b8('0x0'));var zipdir=require(_0x91b8('0x1'));var jsonpatch=require(_0x91b8('0x2'));var rp=require(_0x91b8('0x3'));var moment=require(_0x91b8('0x4'));var BPromise=require(_0x91b8('0x5'));var Mustache=require(_0x91b8('0x6'));var util=require('util');var path=require(_0x91b8('0x7'));var sox=require('sox');var csv=require(_0x91b8('0x8'));var ejs=require(_0x91b8('0x9'));var fs=require('fs');var fs_extra=require(_0x91b8('0xa'));var _=require(_0x91b8('0xb'));var squel=require(_0x91b8('0xc'));var crypto=require(_0x91b8('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x91b8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x91b8('0xf'));var Papa=require(_0x91b8('0x10'));var Redis=require('ioredis');var authService=require(_0x91b8('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x91b8('0x12'));var hardwareService=require(_0x91b8('0x13'));var logger=require(_0x91b8('0x14'))(_0x91b8('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x91b8('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34f080,_0xef987e){_0xef987e=_0xef987e||0xcc;return function(_0x293bdd){if(_0x293bdd){return _0x34f080[_0x91b8('0x17')](_0xef987e);}return _0x34f080[_0x91b8('0x18')](_0xef987e)['end']();};}function respondWithResult(_0x552b95,_0x563435){_0x563435=_0x563435||0xc8;return function(_0x2df572){if(_0x2df572){return _0x552b95['status'](_0x563435)[_0x91b8('0x19')](_0x2df572);}};}function respondWithFilteredResult(_0x2c919d,_0x278b77){return function(_0xd17ae0){if(_0xd17ae0){var _0x777f01=typeof _0x278b77[_0x91b8('0x1a')]==='undefined'&&typeof _0x278b77[_0x91b8('0x1b')]===_0x91b8('0x1c');var _0x10e5f8=_0xd17ae0['count'];var _0x525fba=_0x777f01?0x0:_0x278b77[_0x91b8('0x1a')];var _0x4b76bf=_0x777f01?_0xd17ae0[_0x91b8('0x1d')]:_0x278b77['offset']+_0x278b77[_0x91b8('0x1b')];var _0x2f7239;if(_0x4b76bf>=_0x10e5f8){_0x4b76bf=_0x10e5f8;_0x2f7239=0xc8;}else{_0x2f7239=0xce;}_0x2c919d[_0x91b8('0x18')](_0x2f7239);return _0x2c919d[_0x91b8('0x1e')]('Content-Range',_0x525fba+'-'+_0x4b76bf+'/'+_0x10e5f8)['json'](_0xd17ae0);}return null;};}function patchUpdates(_0x2173f3){return function(_0x315e2b){try{jsonpatch[_0x91b8('0x1f')](_0x315e2b,_0x2173f3,!![]);}catch(_0x578d6a){return BPromise[_0x91b8('0x20')](_0x578d6a);}return _0x315e2b[_0x91b8('0x21')]();};}function saveUpdates(_0x177b43,_0x34e8e0){return function(_0x286ced){if(_0x286ced){return _0x286ced['update'](_0x177b43)[_0x91b8('0x22')](function(_0x592642){return _0x592642;});}return null;};}function removeEntity(_0x46a933,_0x181df0){return function(_0x7b8893){if(_0x7b8893){return _0x7b8893['destroy']()[_0x91b8('0x22')](function(){_0x46a933[_0x91b8('0x18')](0xcc)[_0x91b8('0x23')]();});}};}function handleEntityNotFound(_0x3e4e3f,_0x4e2871){return function(_0x5c9a3d){if(!_0x5c9a3d){_0x3e4e3f[_0x91b8('0x17')](0x194);}return _0x5c9a3d;};}function handleError(_0x5ba486,_0x26d355){_0x26d355=_0x26d355||0x1f4;return function(_0x516ed7){logger[_0x91b8('0x24')](_0x516ed7[_0x91b8('0x25')]);if(_0x516ed7[_0x91b8('0x26')]){delete _0x516ed7[_0x91b8('0x26')];}_0x5ba486[_0x91b8('0x18')](_0x26d355)[_0x91b8('0x27')](_0x516ed7);};}exports[_0x91b8('0x28')]=function(_0x4608c1,_0xc0e68c){var _0x354128={},_0xcbe0b={},_0x596071={'count':0x0,'rows':[]};var _0x271254=_[_0x91b8('0x29')](db[_0x91b8('0x2a')][_0x91b8('0x2b')],function(_0x828166){return{'name':_0x828166[_0x91b8('0x2c')],'type':_0x828166[_0x91b8('0x2d')][_0x91b8('0x2e')]};});_0xcbe0b['model']=_[_0x91b8('0x29')](_0x271254,_0x91b8('0x26'));_0xcbe0b[_0x91b8('0x2f')]=_[_0x91b8('0x30')](_0x4608c1[_0x91b8('0x2f')]);_0xcbe0b[_0x91b8('0x31')]=_['intersection'](_0xcbe0b[_0x91b8('0x32')],_0xcbe0b[_0x91b8('0x2f')]);_0x354128[_0x91b8('0x33')]=_[_0x91b8('0x34')](_0xcbe0b[_0x91b8('0x32')],qs[_0x91b8('0x35')](_0x4608c1[_0x91b8('0x2f')][_0x91b8('0x35')]));_0x354128[_0x91b8('0x33')]=_0x354128[_0x91b8('0x33')]['length']?_0x354128['attributes']:_0xcbe0b[_0x91b8('0x32')];if(!_0x4608c1[_0x91b8('0x2f')][_0x91b8('0x36')](_0x91b8('0x37'))){_0x354128[_0x91b8('0x1b')]=qs[_0x91b8('0x1b')](_0x4608c1[_0x91b8('0x2f')][_0x91b8('0x1b')]);_0x354128[_0x91b8('0x1a')]=qs['offset'](_0x4608c1[_0x91b8('0x2f')][_0x91b8('0x1a')]);}_0x354128['order']=qs[_0x91b8('0x38')](_0x4608c1[_0x91b8('0x2f')]['sort']);_0x354128[_0x91b8('0x39')]=qs[_0x91b8('0x31')](_[_0x91b8('0x3a')](_0x4608c1[_0x91b8('0x2f')],_0xcbe0b['filters']),_0x271254);if(_0x4608c1['query'][_0x91b8('0x3b')]){_0x354128[_0x91b8('0x39')]=_['merge'](_0x354128['where'],{'$or':_[_0x91b8('0x29')](_0x271254,function(_0x3858e2){if(_0x3858e2[_0x91b8('0x2d')]!==_0x91b8('0x3c')){var _0x433d6b={};_0x433d6b[_0x3858e2[_0x91b8('0x26')]]={'$like':'%'+_0x4608c1['query'][_0x91b8('0x3b')]+'%'};return _0x433d6b;}})});}_0x354128=_[_0x91b8('0x3d')]({},_0x354128,_0x4608c1[_0x91b8('0x3e')]);var _0x512720={'where':_0x354128['where']};return db['ZohoField'][_0x91b8('0x1d')](_0x512720)['then'](function(_0x3c0dbd){_0x596071[_0x91b8('0x1d')]=_0x3c0dbd;if(_0x4608c1['query']['includeAll']){_0x354128[_0x91b8('0x3f')]=[{'all':!![]}];}return db[_0x91b8('0x2a')][_0x91b8('0x40')](_0x354128);})[_0x91b8('0x22')](function(_0x1e10e9){_0x596071[_0x91b8('0x41')]=_0x1e10e9;return _0x596071;})[_0x91b8('0x22')](respondWithFilteredResult(_0xc0e68c,_0x354128))[_0x91b8('0x42')](handleError(_0xc0e68c,null));};exports['show']=function(_0x1db079,_0x573816){var _0x24c0cd={'raw':!![],'where':{'id':_0x1db079[_0x91b8('0x43')]['id']}},_0x3e442c={};_0x3e442c['model']=_[_0x91b8('0x30')](db[_0x91b8('0x2a')]['rawAttributes']);_0x3e442c[_0x91b8('0x2f')]=_[_0x91b8('0x30')](_0x1db079[_0x91b8('0x2f')]);_0x3e442c['filters']=_[_0x91b8('0x34')](_0x3e442c['model'],_0x3e442c[_0x91b8('0x2f')]);_0x24c0cd[_0x91b8('0x33')]=_['intersection'](_0x3e442c['model'],qs[_0x91b8('0x35')](_0x1db079[_0x91b8('0x2f')]['fields']));_0x24c0cd[_0x91b8('0x33')]=_0x24c0cd[_0x91b8('0x33')][_0x91b8('0x44')]?_0x24c0cd[_0x91b8('0x33')]:_0x3e442c[_0x91b8('0x32')];if(_0x1db079[_0x91b8('0x2f')][_0x91b8('0x45')]){_0x24c0cd[_0x91b8('0x3f')]=[{'all':!![]}];}_0x24c0cd=_[_0x91b8('0x3d')]({},_0x24c0cd,_0x1db079[_0x91b8('0x3e')]);return db[_0x91b8('0x2a')][_0x91b8('0x46')](_0x24c0cd)[_0x91b8('0x22')](handleEntityNotFound(_0x573816,null))[_0x91b8('0x22')](respondWithResult(_0x573816,null))[_0x91b8('0x42')](handleError(_0x573816,null));};exports['create']=function(_0x3d4aa5,_0x2346eb){return db['ZohoField'][_0x91b8('0x47')](_0x3d4aa5[_0x91b8('0x48')],{})[_0x91b8('0x22')](respondWithResult(_0x2346eb,0xc9))[_0x91b8('0x42')](handleError(_0x2346eb,null));};exports['update']=function(_0x244635,_0x41bfc4){if(_0x244635[_0x91b8('0x48')]['id']){delete _0x244635[_0x91b8('0x48')]['id'];}return db[_0x91b8('0x2a')][_0x91b8('0x46')]({'where':{'id':_0x244635[_0x91b8('0x43')]['id']}})[_0x91b8('0x22')](handleEntityNotFound(_0x41bfc4,null))[_0x91b8('0x22')](saveUpdates(_0x244635[_0x91b8('0x48')],null))['then'](respondWithResult(_0x41bfc4,null))['catch'](handleError(_0x41bfc4,null));};exports['destroy']=function(_0x5cd17e,_0x1d144f){return db['ZohoField'][_0x91b8('0x46')]({'where':{'id':_0x5cd17e['params']['id']}})[_0x91b8('0x22')](handleEntityNotFound(_0x1d144f,null))[_0x91b8('0x22')](removeEntity(_0x1d144f,null))['catch'](handleError(_0x1d144f,null));}; \ No newline at end of file +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 diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 5ad13ec..f2845e0 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 _0xdf55=['define','ZohoField','int_zoho_fields','zoho_unique_index','FieldId','lodash','util','api','moment','request-promise','path','rimraf','./intZohoField.attributes','exports'];(function(_0x37a442,_0x3e0d6a){var _0x3f736b=function(_0x1e7ea9){while(--_0x1e7ea9){_0x37a442['push'](_0x37a442['shift']());}};_0x3f736b(++_0x3e0d6a);}(_0xdf55,0x83));var _0x5df5=function(_0x4557a4,_0x36f89c){_0x4557a4=_0x4557a4-0x0;var _0x4ceb15=_0xdf55[_0x4557a4];return _0x4ceb15;};'use strict';var _=require(_0x5df5('0x0'));var util=require(_0x5df5('0x1'));var logger=require('../../config/logger')(_0x5df5('0x2'));var moment=require(_0x5df5('0x3'));var BPromise=require('bluebird');var rp=require(_0x5df5('0x4'));var fs=require('fs');var path=require(_0x5df5('0x5'));var rimraf=require(_0x5df5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5df5('0x7'));module[_0x5df5('0x8')]=function(_0x27ec86,_0x476e21){return _0x27ec86[_0x5df5('0x9')](_0x5df5('0xa'),attributes,{'tableName':_0x5df5('0xb'),'paranoid':![],'indexes':[{'name':_0x5df5('0xc'),'fields':['idField',_0x5df5('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 3532f83..4f8a109 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 _0xc7df=['error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x354afe,_0x2a46aa){var _0x21442f=function(_0x230002){while(--_0x230002){_0x354afe['push'](_0x354afe['shift']());}};_0x21442f(++_0x2a46aa);}(_0xc7df,0xca));var _0xfc7d=function(_0x52c53f,_0x26b4df){_0x52c53f=_0x52c53f-0x0;var _0x573e3b=_0xc7df[_0x52c53f];return _0x573e3b;};'use strict';var _=require(_0xfc7d('0x0'));var util=require(_0xfc7d('0x1'));var moment=require('moment');var BPromise=require(_0xfc7d('0x2'));var rs=require(_0xfc7d('0x3'));var fs=require('fs');var Redis=require(_0xfc7d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xfc7d('0x5'));var logger=require(_0xfc7d('0x6'))(_0xfc7d('0x7'));var config=require('../../config/environment');var jayson=require(_0xfc7d('0x8'));var client=jayson[_0xfc7d('0x9')][_0xfc7d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21d878,_0x1a93e7,_0xfdb0ff){return new BPromise(function(_0x4a501c,_0x4c7b15){return client[_0xfc7d('0xb')](_0x21d878,_0xfdb0ff)[_0xfc7d('0xc')](function(_0x202e63){logger[_0xfc7d('0xd')](_0xfc7d('0xe'),_0x1a93e7,_0xfc7d('0xf'));logger['debug'](_0xfc7d('0x10'),_0x1a93e7,_0xfc7d('0xf'),JSON[_0xfc7d('0x11')](_0x202e63));if(_0x202e63['error']){if(_0x202e63[_0xfc7d('0x12')][_0xfc7d('0x13')]===0x1f4){logger[_0xfc7d('0x12')](_0xfc7d('0xe'),_0x1a93e7,_0x202e63[_0xfc7d('0x12')][_0xfc7d('0x14')]);return _0x4c7b15(_0x202e63[_0xfc7d('0x12')][_0xfc7d('0x14')]);}logger[_0xfc7d('0x12')](_0xfc7d('0xe'),_0x1a93e7,_0x202e63['error'][_0xfc7d('0x14')]);return _0x4a501c(_0x202e63['error'][_0xfc7d('0x14')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0x1a93e7,'request\x20sent');_0x4a501c(_0x202e63['result'][_0xfc7d('0x14')]);}})[_0xfc7d('0x15')](function(_0xd783c){logger[_0xfc7d('0x12')](_0xfc7d('0xe'),_0x1a93e7,_0xd783c);_0x4c7b15(_0xd783c);});});} \ No newline at end of file +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 diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 433c078..ae9a5db 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x53d60d,_0x10347b){var _0x5d4e57=function(_0x2346a1){while(--_0x2346a1){_0x53d60d['push'](_0x53d60d['shift']());}};_0x5d4e57(++_0x10347b);}(_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 +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 diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 5f79bde..428413e 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 _0x0404=['exports','STRING','unique_name_and_version','INTEGER'];(function(_0x2dd615,_0x18099c){var _0x5255a4=function(_0x3f4c54){while(--_0x3f4c54){_0x2dd615['push'](_0x2dd615['shift']());}};_0x5255a4(++_0x18099c);}(_0x0404,0xf4));var _0x4040=function(_0x20e7e3,_0x1529be){_0x20e7e3=_0x20e7e3-0x0;var _0x14b9de=_0x0404[_0x20e7e3];return _0x14b9de;};'use strict';var Sequelize=require('sequelize');module[_0x4040('0x0')]={'name':{'type':Sequelize[_0x4040('0x1')],'allowNull':![],'unique':_0x4040('0x2')},'version':{'type':Sequelize[_0x4040('0x1')],'allowNull':![],'unique':_0x4040('0x2')},'main':{'type':Sequelize[_0x4040('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x4040('0x1')]},'path':{'type':Sequelize[_0x4040('0x1')]},'type':{'type':Sequelize[_0x4040('0x1')]},'size':{'type':Sequelize[_0x4040('0x3')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x4040('0x1')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x4040('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x4040('0x1')]},'remoteUri':{'type':Sequelize[_0x4040('0x1')]},'link':{'type':Sequelize[_0x4040('0x1')],'defaultValue':'#'}}; \ No newline at end of file +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 diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 75430d0..1256f13 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 _0x9582=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','json','reject','save','update','then','destroy','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format'];(function(_0x1c1b8c,_0x4c253d){var _0x1ee4c4=function(_0xb9bff5){while(--_0xb9bff5){_0x1c1b8c['push'](_0x1c1b8c['shift']());}};_0x1ee4c4(++_0x4c253d);}(_0x9582,0x95));var _0x2958=function(_0x5222eb,_0x360611){_0x5222eb=_0x5222eb-0x0;var _0x436d10=_0x9582[_0x5222eb];return _0x436d10;};'use strict';var emlformat=require(_0x2958('0x0'));var rimraf=require(_0x2958('0x1'));var zipdir=require(_0x2958('0x2'));var jsonpatch=require(_0x2958('0x3'));var rp=require(_0x2958('0x4'));var moment=require(_0x2958('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2958('0x6'));var util=require(_0x2958('0x7'));var path=require(_0x2958('0x8'));var sox=require(_0x2958('0x9'));var csv=require(_0x2958('0xa'));var ejs=require(_0x2958('0xb'));var fs=require('fs');var fs_extra=require(_0x2958('0xc'));var _=require(_0x2958('0xd'));var squel=require(_0x2958('0xe'));var crypto=require(_0x2958('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2958('0xa'));var querystring=require('querystring');var Papa=require(_0x2958('0x10'));var Redis=require('ioredis');var authService=require(_0x2958('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2958('0x12'));var hardwareService=require(_0x2958('0x13'));var logger=require(_0x2958('0x14'))(_0x2958('0x15'));var utils=require(_0x2958('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2958('0x17'));var db=require(_0x2958('0x18'))['db'];function respondWithStatusCode(_0x33a13a,_0x20e06a){_0x20e06a=_0x20e06a||0xcc;return function(_0x47067d){if(_0x47067d){return _0x33a13a[_0x2958('0x19')](_0x20e06a);}return _0x33a13a[_0x2958('0x1a')](_0x20e06a)[_0x2958('0x1b')]();};}function respondWithResult(_0x5bd520,_0x42e976){_0x42e976=_0x42e976||0xc8;return function(_0x2e12d4){if(_0x2e12d4){return _0x5bd520['status'](_0x42e976)['json'](_0x2e12d4);}};}function respondWithFilteredResult(_0x21ed6c,_0x38e724){return function(_0x5f06b1){if(_0x5f06b1){var _0x3bef50=typeof _0x38e724['offset']==='undefined'&&typeof _0x38e724[_0x2958('0x1c')]===_0x2958('0x1d');var _0x55e261=_0x5f06b1['count'];var _0x28a92c=_0x3bef50?0x0:_0x38e724[_0x2958('0x1e')];var _0x310d07=_0x3bef50?_0x5f06b1[_0x2958('0x1f')]:_0x38e724[_0x2958('0x1e')]+_0x38e724['limit'];var _0x19a614;if(_0x310d07>=_0x55e261){_0x310d07=_0x55e261;_0x19a614=0xc8;}else{_0x19a614=0xce;}_0x21ed6c[_0x2958('0x1a')](_0x19a614);return _0x21ed6c[_0x2958('0x20')]('Content-Range',_0x28a92c+'-'+_0x310d07+'/'+_0x55e261)[_0x2958('0x21')](_0x5f06b1);}return null;};}function patchUpdates(_0x53b100){return function(_0x1da684){try{jsonpatch['apply'](_0x1da684,_0x53b100,!![]);}catch(_0x5eaf36){return BPromise[_0x2958('0x22')](_0x5eaf36);}return _0x1da684[_0x2958('0x23')]();};}function saveUpdates(_0x2a02a4,_0x26c5a5){return function(_0x2202f8){if(_0x2202f8){return _0x2202f8[_0x2958('0x24')](_0x2a02a4)[_0x2958('0x25')](function(_0x2b9818){return _0x2b9818;});}return null;};}function removeEntity(_0x330763,_0x2aa514){return function(_0xaf5547){if(_0xaf5547){return _0xaf5547[_0x2958('0x26')]()[_0x2958('0x25')](function(){_0x330763[_0x2958('0x1a')](0xcc)[_0x2958('0x1b')]();});}};}function handleEntityNotFound(_0x4f811a,_0x574df5){return function(_0x3c1155){if(!_0x3c1155){_0x4f811a[_0x2958('0x19')](0x194);}return _0x3c1155;};}function handleError(_0x28c1f5,_0x43cf73){_0x43cf73=_0x43cf73||0x1f4;return function(_0x52bd32){logger[_0x2958('0x27')](_0x52bd32['stack']);if(_0x52bd32[_0x2958('0x28')]){delete _0x52bd32[_0x2958('0x28')];}_0x28c1f5[_0x2958('0x1a')](_0x43cf73)[_0x2958('0x29')](_0x52bd32);};}exports[_0x2958('0x2a')]=function(_0x36e2a5,_0x153958){var _0x5d1dfc={},_0x21b919={},_0x5053d0={'count':0x0,'rows':[]};var _0x48650d=_[_0x2958('0x2b')](db[_0x2958('0x2c')][_0x2958('0x2d')],function(_0x34e56e){return{'name':_0x34e56e[_0x2958('0x2e')],'type':_0x34e56e[_0x2958('0x2f')][_0x2958('0x30')]};});_0x21b919[_0x2958('0x31')]=_['map'](_0x48650d,_0x2958('0x28'));_0x21b919[_0x2958('0x32')]=_['keys'](_0x36e2a5[_0x2958('0x32')]);_0x21b919['filters']=_[_0x2958('0x33')](_0x21b919['model'],_0x21b919[_0x2958('0x32')]);_0x5d1dfc['attributes']=_[_0x2958('0x33')](_0x21b919[_0x2958('0x31')],qs[_0x2958('0x34')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x34')]));_0x5d1dfc[_0x2958('0x35')]=_0x5d1dfc[_0x2958('0x35')][_0x2958('0x36')]?_0x5d1dfc[_0x2958('0x35')]:_0x21b919['model'];if(!_0x36e2a5[_0x2958('0x32')]['hasOwnProperty'](_0x2958('0x37'))){_0x5d1dfc['limit']=qs[_0x2958('0x1c')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1c')]);_0x5d1dfc[_0x2958('0x1e')]=qs[_0x2958('0x1e')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x1e')]);}_0x5d1dfc[_0x2958('0x38')]=qs[_0x2958('0x39')](_0x36e2a5[_0x2958('0x32')][_0x2958('0x39')]);_0x5d1dfc[_0x2958('0x3a')]=qs[_0x2958('0x3b')](_['pick'](_0x36e2a5[_0x2958('0x32')],_0x21b919[_0x2958('0x3b')]),_0x48650d);if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]){_0x5d1dfc['where']=_[_0x2958('0x3d')](_0x5d1dfc[_0x2958('0x3a')],{'$or':_[_0x2958('0x2b')](_0x48650d,function(_0x3f7e27){if(_0x3f7e27[_0x2958('0x2f')]!==_0x2958('0x3e')){var _0x1ed89b={};_0x1ed89b[_0x3f7e27[_0x2958('0x28')]]={'$like':'%'+_0x36e2a5[_0x2958('0x32')][_0x2958('0x3c')]+'%'};return _0x1ed89b;}})});}_0x5d1dfc=_[_0x2958('0x3d')]({},_0x5d1dfc,_0x36e2a5[_0x2958('0x3f')]);var _0x319243={'where':_0x5d1dfc['where']};return db[_0x2958('0x2c')][_0x2958('0x1f')](_0x319243)['then'](function(_0x4fe061){_0x5053d0[_0x2958('0x1f')]=_0x4fe061;if(_0x36e2a5[_0x2958('0x32')][_0x2958('0x40')]){_0x5d1dfc[_0x2958('0x41')]=[{'all':!![]}];}return db[_0x2958('0x2c')][_0x2958('0x42')](_0x5d1dfc);})[_0x2958('0x25')](function(_0x13be6d){_0x5053d0[_0x2958('0x43')]=_0x13be6d;return _0x5053d0;})[_0x2958('0x25')](respondWithFilteredResult(_0x153958,_0x5d1dfc))[_0x2958('0x44')](handleError(_0x153958,null));};exports[_0x2958('0x45')]=function(_0xe33c56,_0x5a58ea){var _0x645b66={'raw':![],'where':{'id':_0xe33c56[_0x2958('0x46')]['id']}},_0x112256={};_0x112256[_0x2958('0x31')]=_['keys'](db[_0x2958('0x2c')]['rawAttributes']);_0x112256['query']=_[_0x2958('0x47')](_0xe33c56[_0x2958('0x32')]);_0x112256[_0x2958('0x3b')]=_[_0x2958('0x33')](_0x112256[_0x2958('0x31')],_0x112256[_0x2958('0x32')]);_0x645b66['attributes']=_[_0x2958('0x33')](_0x112256['model'],qs['fields'](_0xe33c56[_0x2958('0x32')]['fields']));_0x645b66[_0x2958('0x35')]=_0x645b66[_0x2958('0x35')][_0x2958('0x36')]?_0x645b66[_0x2958('0x35')]:_0x112256[_0x2958('0x31')];if(_0xe33c56[_0x2958('0x32')][_0x2958('0x40')]){_0x645b66[_0x2958('0x41')]=[{'all':!![]}];}_0x645b66=_['merge']({},_0x645b66,_0xe33c56[_0x2958('0x3f')]);return db[_0x2958('0x2c')][_0x2958('0x48')](_0x645b66)[_0x2958('0x25')](handleEntityNotFound(_0x5a58ea,null))['then'](respondWithResult(_0x5a58ea,null))[_0x2958('0x44')](handleError(_0x5a58ea,null));};exports[_0x2958('0x49')]=function(_0x4a51b1,_0x1b6829){return db[_0x2958('0x2c')][_0x2958('0x49')](_0x4a51b1[_0x2958('0x4a')],{})[_0x2958('0x25')](respondWithResult(_0x1b6829,0xc9))[_0x2958('0x44')](handleError(_0x1b6829,null));};exports['update']=function(_0x1fff2a,_0x38b551){if(_0x1fff2a[_0x2958('0x4a')]['id']){delete _0x1fff2a[_0x2958('0x4a')]['id'];}return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x1fff2a[_0x2958('0x46')]['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x38b551,null))[_0x2958('0x25')](saveUpdates(_0x1fff2a[_0x2958('0x4a')],null))[_0x2958('0x25')](respondWithResult(_0x38b551,null))[_0x2958('0x44')](handleError(_0x38b551,null));};exports[_0x2958('0x26')]=function(_0x3f7bc1,_0x1bb780){return db[_0x2958('0x2c')][_0x2958('0x48')]({'where':{'id':_0x3f7bc1['params']['id']}})[_0x2958('0x25')](handleEntityNotFound(_0x1bb780,null))['then'](removeEntity(_0x1bb780,null))[_0x2958('0x44')](handleError(_0x1bb780,null));}; \ No newline at end of file +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 diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 16ace56..b75d017 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 _0xf45f=['request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf45f,0x144));var _0xff45=function(_0xfae01c,_0x4ef153){_0xfae01c=_0xfae01c-0x0;var _0x442ea7=_0xf45f[_0xfae01c];return _0x442ea7;};'use strict';var _=require(_0xff45('0x0'));var util=require(_0xff45('0x1'));var logger=require(_0xff45('0x2'))(_0xff45('0x3'));var moment=require(_0xff45('0x4'));var BPromise=require(_0xff45('0x5'));var rp=require(_0xff45('0x6'));var fs=require('fs');var path=require(_0xff45('0x7'));var rimraf=require(_0xff45('0x8'));var config=require(_0xff45('0x9'));var attributes=require(_0xff45('0xa'));module[_0xff45('0xb')]=function(_0x6b0aa0,_0x33d497){return _0x6b0aa0[_0xff45('0xc')](_0xff45('0xd'),attributes,{'tableName':_0xff45('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index d14dc1b..251ebd9 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x13ce0f,_0x354d4c){var _0x1beae8=function(_0x25a40b){while(--_0x25a40b){_0x13ce0f['push'](_0x13ce0f['shift']());}};_0x1beae8(++_0x354d4c);}(_0xda2d,0x102));var _0xdda2=function(_0x28a408,_0x571d43){_0x28a408=_0x28a408-0x0;var _0x560dd7=_0xda2d[_0x28a408];return _0x560dd7;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('Integration,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_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 diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 3480733..5a8b306 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 _0xadb5=['delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update'];(function(_0x41d902,_0x29d0b){var _0x360fb1=function(_0x2517ae){while(--_0x2517ae){_0x41d902['push'](_0x41d902['shift']());}};_0x360fb1(++_0x29d0b);}(_0xadb5,0xad));var _0x5adb=function(_0x1e5389,_0x383f4c){_0x1e5389=_0x1e5389-0x0;var _0x1482ce=_0xadb5[_0x1e5389];return _0x1482ce;};'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('./integrationReport.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')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0xf')]);router['put']('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller['destroy']);module[_0x5adb('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index 03ea5ac..d92cd62 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 _0x5605=['RECEIVED','STRING','INTEGER','BOOLEAN','DATE','TEXT','ENUM','SENT','SENDING'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x5605,0x133));var _0x5560=function(_0x5d5ead,_0x4034ac){_0x5d5ead=_0x5d5ead-0x0;var _0x4eb7ba=_0x5605[_0x5d5ead];return _0x4eb7ba;};'use strict';var Sequelize=require('sequelize');module['exports']={'integration':{'type':Sequelize[_0x5560('0x0')]},'eventChannel':{'type':Sequelize[_0x5560('0x0')]},'exitStatus':{'type':Sequelize[_0x5560('0x0')]},'ticketId':{'type':Sequelize[_0x5560('0x0')]},'integrationId':{'type':Sequelize[_0x5560('0x1')]},'contacts':{'type':Sequelize[_0x5560('0x0')]},'uniqueid':{'type':Sequelize[_0x5560('0x0')]},'calleridnum':{'type':Sequelize[_0x5560('0x0')]},'calleridname':{'type':Sequelize[_0x5560('0x0')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5560('0x0')]},'membername':{'type':Sequelize[_0x5560('0x0')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5560('0x1')]},'agentcomplete':{'type':Sequelize[_0x5560('0x2')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5560('0x3')]},'talktime':{'type':Sequelize[_0x5560('0x1')]},'agentacw':{'type':Sequelize[_0x5560('0x2')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x5560('0x0')]},'agentringnoanswer':{'type':Sequelize[_0x5560('0x2')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5560('0x3')]},'agentdump':{'type':Sequelize[_0x5560('0x2')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x5560('0x0')]},'channel':{'type':Sequelize[_0x5560('0x0')]},'channelstate':{'type':Sequelize[_0x5560('0x1')]},'channelstatedesc':{'type':Sequelize[_0x5560('0x0')]},'connectedlinenum':{'type':Sequelize[_0x5560('0x0')]},'connectedlinename':{'type':Sequelize[_0x5560('0x0')]},'language':{'type':Sequelize[_0x5560('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x5560('0x0')]},'exten':{'type':Sequelize[_0x5560('0x0')]},'priority':{'type':Sequelize[_0x5560('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x5560('0x0')]},'destcalleridnum':{'type':Sequelize[_0x5560('0x0')]},'destcalleridname':{'type':Sequelize[_0x5560('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x5560('0x0')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x5560('0x0')]},'destcontext':{'type':Sequelize[_0x5560('0x0')]},'destexten':{'type':Sequelize[_0x5560('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x5560('0x0')]},'inReplyTo':{'type':Sequelize[_0x5560('0x0')]},'subject':{'type':Sequelize[_0x5560('0x0')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x5560('0x0')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x5560('0x4')]},'status':{'type':Sequelize[_0x5560('0x5')](_0x5560('0x6'),_0x5560('0x7'),_0x5560('0x8'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5560('0x0')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x5560('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 8cd1941..d195a53 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 _0x5be2=['merge','VIRTUAL','filter','options','include','findAll','catch','params','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','jsforce','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','status','send','map','IntegrationReport','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4cd21c,_0x35fa45){var _0x5d8e5e=function(_0x3af223){while(--_0x3af223){_0x4cd21c['push'](_0x4cd21c['shift']());}};_0x5d8e5e(++_0x35fa45);}(_0x5be2,0xe0));var _0x25be=function(_0x77b278,_0x4d13a3){_0x77b278=_0x77b278-0x0;var _0x5ecaaf=_0x5be2[_0x77b278];return _0x5ecaaf;};'use strict';var emlformat=require(_0x25be('0x0'));var rimraf=require(_0x25be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x25be('0x2'));var rp=require(_0x25be('0x3'));var moment=require(_0x25be('0x4'));var BPromise=require(_0x25be('0x5'));var Mustache=require(_0x25be('0x6'));var util=require(_0x25be('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x25be('0x8'));var ejs=require(_0x25be('0x9'));var fs=require('fs');var fs_extra=require(_0x25be('0xa'));var _=require('lodash');var squel=require(_0x25be('0xb'));var crypto=require('crypto');var jsforce=require(_0x25be('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x25be('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x25be('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x25be('0xe'));var hardwareService=require(_0x25be('0xf'));var logger=require(_0x25be('0x10'))(_0x25be('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x25be('0x12'));var db=require(_0x25be('0x13'))['db'];function respondWithStatusCode(_0x1398d0,_0x2cb2fb){_0x2cb2fb=_0x2cb2fb||0xcc;return function(_0x66af3){if(_0x66af3){return _0x1398d0[_0x25be('0x14')](_0x2cb2fb);}return _0x1398d0['status'](_0x2cb2fb)['end']();};}function respondWithResult(_0x466953,_0x5ebb2d){_0x5ebb2d=_0x5ebb2d||0xc8;return function(_0x3f6f8c){if(_0x3f6f8c){return _0x466953['status'](_0x5ebb2d)[_0x25be('0x15')](_0x3f6f8c);}};}function respondWithFilteredResult(_0x305c43,_0x15d44e){return function(_0x116c7b){if(_0x116c7b){var _0x16261d=typeof _0x15d44e[_0x25be('0x16')]===_0x25be('0x17')&&typeof _0x15d44e['limit']===_0x25be('0x17');var _0x59c2f7=_0x116c7b[_0x25be('0x18')];var _0x33918e=_0x16261d?0x0:_0x15d44e[_0x25be('0x16')];var _0x1d96ca=_0x16261d?_0x116c7b[_0x25be('0x18')]:_0x15d44e['offset']+_0x15d44e[_0x25be('0x19')];var _0x19f20c;if(_0x1d96ca>=_0x59c2f7){_0x1d96ca=_0x59c2f7;_0x19f20c=0xc8;}else{_0x19f20c=0xce;}_0x305c43['status'](_0x19f20c);return _0x305c43[_0x25be('0x1a')](_0x25be('0x1b'),_0x33918e+'-'+_0x1d96ca+'/'+_0x59c2f7)[_0x25be('0x15')](_0x116c7b);}return null;};}function patchUpdates(_0x2254b8){return function(_0x19414e){try{jsonpatch[_0x25be('0x1c')](_0x19414e,_0x2254b8,!![]);}catch(_0xd9659b){return BPromise[_0x25be('0x1d')](_0xd9659b);}return _0x19414e['save']();};}function saveUpdates(_0x45c396,_0x2ffd28){return function(_0x3dfa4b){if(_0x3dfa4b){return _0x3dfa4b[_0x25be('0x1e')](_0x45c396)[_0x25be('0x1f')](function(_0x34f55c){return _0x34f55c;});}return null;};}function removeEntity(_0x132744,_0x36dd64){return function(_0x49c392){if(_0x49c392){return _0x49c392['destroy']()[_0x25be('0x1f')](function(){_0x132744['status'](0xcc)[_0x25be('0x20')]();});}};}function handleEntityNotFound(_0x27ef56,_0x394153){return function(_0x3b7ac6){if(!_0x3b7ac6){_0x27ef56['sendStatus'](0x194);}return _0x3b7ac6;};}function handleError(_0x4856c4,_0x427ad7){_0x427ad7=_0x427ad7||0x1f4;return function(_0x1bf6d5){logger[_0x25be('0x21')](_0x1bf6d5[_0x25be('0x22')]);if(_0x1bf6d5[_0x25be('0x23')]){delete _0x1bf6d5[_0x25be('0x23')];}_0x4856c4[_0x25be('0x24')](_0x427ad7)[_0x25be('0x25')](_0x1bf6d5);};}exports['index']=function(_0x1a1f0d,_0xc922a0){var _0x5389ef={},_0x26e078={},_0x949956={'count':0x0,'rows':[]};var _0x38a9d7=_[_0x25be('0x26')](db[_0x25be('0x27')]['rawAttributes'],function(_0x2fe4e9){return{'name':_0x2fe4e9[_0x25be('0x28')],'type':_0x2fe4e9[_0x25be('0x29')][_0x25be('0x2a')]};});_0x26e078[_0x25be('0x2b')]=_['map'](_0x38a9d7,_0x25be('0x23'));_0x26e078['query']=_[_0x25be('0x2c')](_0x1a1f0d['query']);_0x26e078[_0x25be('0x2d')]=_['intersection'](_0x26e078['model'],_0x26e078[_0x25be('0x2e')]);_0x5389ef[_0x25be('0x2f')]=_[_0x25be('0x30')](_0x26e078[_0x25be('0x2b')],qs[_0x25be('0x31')](_0x1a1f0d[_0x25be('0x2e')][_0x25be('0x31')]));_0x5389ef['attributes']=_0x5389ef[_0x25be('0x2f')]['length']?_0x5389ef[_0x25be('0x2f')]:_0x26e078[_0x25be('0x2b')];if(!_0x1a1f0d[_0x25be('0x2e')][_0x25be('0x32')](_0x25be('0x33'))){_0x5389ef[_0x25be('0x19')]=qs[_0x25be('0x19')](_0x1a1f0d[_0x25be('0x2e')][_0x25be('0x19')]);_0x5389ef['offset']=qs['offset'](_0x1a1f0d[_0x25be('0x2e')][_0x25be('0x16')]);}_0x5389ef[_0x25be('0x34')]=qs[_0x25be('0x35')](_0x1a1f0d['query'][_0x25be('0x35')]);_0x5389ef[_0x25be('0x36')]=qs[_0x25be('0x2d')](_[_0x25be('0x37')](_0x1a1f0d[_0x25be('0x2e')],_0x26e078[_0x25be('0x2d')]),_0x38a9d7);if(_0x1a1f0d['query']['filter']){_0x5389ef[_0x25be('0x36')]=_[_0x25be('0x38')](_0x5389ef[_0x25be('0x36')],{'$or':_[_0x25be('0x26')](_0x38a9d7,function(_0xf367aa){if(_0xf367aa['type']!==_0x25be('0x39')){var _0x497ad0={};_0x497ad0[_0xf367aa[_0x25be('0x23')]]={'$like':'%'+_0x1a1f0d[_0x25be('0x2e')][_0x25be('0x3a')]+'%'};return _0x497ad0;}})});}_0x5389ef=_[_0x25be('0x38')]({},_0x5389ef,_0x1a1f0d[_0x25be('0x3b')]);var _0x303785={'where':_0x5389ef[_0x25be('0x36')]};return db[_0x25be('0x27')][_0x25be('0x18')](_0x303785)['then'](function(_0x34b2de){_0x949956[_0x25be('0x18')]=_0x34b2de;if(_0x1a1f0d[_0x25be('0x2e')]['includeAll']){_0x5389ef[_0x25be('0x3c')]=[{'all':!![]}];}return db[_0x25be('0x27')][_0x25be('0x3d')](_0x5389ef);})[_0x25be('0x1f')](function(_0x2ff247){_0x949956['rows']=_0x2ff247;return _0x949956;})['then'](respondWithFilteredResult(_0xc922a0,_0x5389ef))[_0x25be('0x3e')](handleError(_0xc922a0,null));};exports['show']=function(_0xcf9a71,_0x134e07){var _0x151ee5={'raw':![],'where':{'id':_0xcf9a71[_0x25be('0x3f')]['id']}},_0x461555={};_0x461555[_0x25be('0x2b')]=_[_0x25be('0x2c')](db[_0x25be('0x27')]['rawAttributes']);_0x461555[_0x25be('0x2e')]=_[_0x25be('0x2c')](_0xcf9a71[_0x25be('0x2e')]);_0x461555[_0x25be('0x2d')]=_[_0x25be('0x30')](_0x461555[_0x25be('0x2b')],_0x461555['query']);_0x151ee5[_0x25be('0x2f')]=_[_0x25be('0x30')](_0x461555['model'],qs[_0x25be('0x31')](_0xcf9a71[_0x25be('0x2e')][_0x25be('0x31')]));_0x151ee5[_0x25be('0x2f')]=_0x151ee5[_0x25be('0x2f')]['length']?_0x151ee5[_0x25be('0x2f')]:_0x461555['model'];if(_0xcf9a71[_0x25be('0x2e')][_0x25be('0x40')]){_0x151ee5[_0x25be('0x3c')]=[{'all':!![]}];}_0x151ee5=_[_0x25be('0x38')]({},_0x151ee5,_0xcf9a71[_0x25be('0x3b')]);return db[_0x25be('0x27')][_0x25be('0x41')](_0x151ee5)[_0x25be('0x1f')](handleEntityNotFound(_0x134e07,null))[_0x25be('0x1f')](respondWithResult(_0x134e07,null))[_0x25be('0x3e')](handleError(_0x134e07,null));};exports[_0x25be('0x42')]=function(_0x3be353,_0x366df8){return db[_0x25be('0x27')][_0x25be('0x42')](_0x3be353['body'],{})[_0x25be('0x1f')](respondWithResult(_0x366df8,0xc9))[_0x25be('0x3e')](handleError(_0x366df8,null));};exports['update']=function(_0x542d2d,_0x533178){if(_0x542d2d[_0x25be('0x43')]['id']){delete _0x542d2d[_0x25be('0x43')]['id'];}return db[_0x25be('0x27')][_0x25be('0x41')]({'where':{'id':_0x542d2d[_0x25be('0x3f')]['id']}})[_0x25be('0x1f')](handleEntityNotFound(_0x533178,null))[_0x25be('0x1f')](saveUpdates(_0x542d2d[_0x25be('0x43')],null))[_0x25be('0x1f')](respondWithResult(_0x533178,null))[_0x25be('0x3e')](handleError(_0x533178,null));};exports[_0x25be('0x44')]=function(_0x19b00a,_0x38033f){return db[_0x25be('0x27')]['find']({'where':{'id':_0x19b00a[_0x25be('0x3f')]['id']}})[_0x25be('0x1f')](handleEntityNotFound(_0x38033f,null))[_0x25be('0x1f')](removeEntity(_0x38033f,null))[_0x25be('0x3e')](handleError(_0x38033f,null));};exports['describe']=function(_0x276676,_0x58c056){return db['IntegrationReport'][_0x25be('0x45')]()[_0x25be('0x1f')](respondWithResult(_0x58c056,null))[_0x25be('0x3e')](handleError(_0x58c056,null));}; \ No newline at end of file +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 diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index fc975d4..feeab47 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 _0x47e5=['define','IntegrationReport','report_integration','lodash','util','api','moment','request-promise','rimraf','exports'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x47e5,0x1c5));var _0x547e=function(_0x406fbb,_0x1093e5){_0x406fbb=_0x406fbb-0x0;var _0x8e921d=_0x47e5[_0x406fbb];return _0x8e921d;};'use strict';var _=require(_0x547e('0x0'));var util=require(_0x547e('0x1'));var logger=require('../../config/logger')(_0x547e('0x2'));var moment=require(_0x547e('0x3'));var BPromise=require('bluebird');var rp=require(_0x547e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x547e('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x547e('0x6')]=function(_0xd776e2,_0x1f2105){return _0xd776e2[_0x547e('0x7')](_0x547e('0x8'),attributes,{'tableName':_0x547e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 41835fa..ca93a1a 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x40faee,_0xa53a37){var _0x25358b=function(_0x128e62){while(--_0x128e62){_0x40faee['push'](_0x40faee['shift']());}};_0x25358b(++_0xa53a37);}(_0x187d,0x93));var _0xd187=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x187d[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('IntegrationReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ 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','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 diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 1250fcf..5dc6872 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 _0x8ce1=['isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','addIntervals','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index'];(function(_0x1aaa70,_0xda9291){var _0x85093=function(_0x2bc3d8){while(--_0x2bc3d8){_0x1aaa70['push'](_0x1aaa70['shift']());}};_0x85093(++_0xda9291);}(_0x8ce1,0x152));var _0x18ce=function(_0x4cf37a,_0x1bb670){_0x4cf37a=_0x4cf37a-0x0;var _0x29907f=_0x8ce1[_0x4cf37a];return _0x29907f;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth['isAuthenticated'](),controller[_0x18ce('0xb')]);router[_0x18ce('0xa')]('/:id',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router['get'](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0x10')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x11')]);router[_0x18ce('0x10')]('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x18ce('0x12')]);router['post']('/:id/sub_intervals/create_many',auth[_0x18ce('0xc')](),controller[_0x18ce('0x13')]);router[_0x18ce('0x14')](_0x18ce('0x15'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x16')]);router['delete'](_0x18ce('0x15'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x17')]);module[_0x18ce('0x18')]=router; \ No newline at end of file +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 diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 6ea7194..661d61e 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 _0xa413=['STRING','sequelize','exports'];(function(_0x50b1d2,_0x3bdf9a){var _0x1637d9=function(_0x3c58b1){while(--_0x3c58b1){_0x50b1d2['push'](_0x50b1d2['shift']());}};_0x1637d9(++_0x3bdf9a);}(_0xa413,0x175));var _0x3a41=function(_0x4dded9,_0x37ab98){_0x4dded9=_0x4dded9-0x0;var _0x2aef4a=_0xa413[_0x4dded9];return _0x2aef4a;};'use strict';var Sequelize=require(_0x3a41('0x0'));module[_0x3a41('0x1')]={'name':{'type':Sequelize[_0x3a41('0x2')]},'description':{'type':Sequelize[_0x3a41('0x2')]},'interval':{'type':Sequelize[_0x3a41('0x2')],'allowNull':!![]}}; \ No newline at end of file +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 diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index eed0f83..ced5502 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 _0xbfbf=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','error','name','send','index','map','Interval','rawAttributes','type','key','model','query','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','VIRTUAL','filter','merge','options','includeAll','findAll','catch','show','params','keys','attributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','userProfileId','autoAssociation','addInterval','IntervalId','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','ioredis','../../components/auth/service'];(function(_0xf3cbb5,_0x2a040f){var _0x5a9464=function(_0x21471a){while(--_0x21471a){_0xf3cbb5['push'](_0xf3cbb5['shift']());}};_0x5a9464(++_0x2a040f);}(_0xbfbf,0xfa));var _0xfbfb=function(_0x1f5a52,_0x221571){_0x1f5a52=_0x1f5a52-0x0;var _0x42bd31=_0xbfbf[_0x1f5a52];return _0x42bd31;};'use strict';var emlformat=require(_0xfbfb('0x0'));var rimraf=require(_0xfbfb('0x1'));var zipdir=require(_0xfbfb('0x2'));var jsonpatch=require(_0xfbfb('0x3'));var rp=require(_0xfbfb('0x4'));var moment=require(_0xfbfb('0x5'));var BPromise=require(_0xfbfb('0x6'));var Mustache=require(_0xfbfb('0x7'));var util=require(_0xfbfb('0x8'));var path=require('path');var sox=require(_0xfbfb('0x9'));var csv=require(_0xfbfb('0xa'));var ejs=require(_0xfbfb('0xb'));var fs=require('fs');var fs_extra=require(_0xfbfb('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xfbfb('0xd'));var jsforce=require(_0xfbfb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xfbfb('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfbfb('0xf'));var authService=require(_0xfbfb('0x10'));var qs=require(_0xfbfb('0x11'));var as=require(_0xfbfb('0x12'));var hardwareService=require(_0xfbfb('0x13'));var logger=require(_0xfbfb('0x14'))(_0xfbfb('0x15'));var utils=require(_0xfbfb('0x16'));var config=require(_0xfbfb('0x17'));var licenseUtil=require(_0xfbfb('0x18'));var db=require(_0xfbfb('0x19'))['db'];var extensions=require(_0xfbfb('0x1a'));function respondWithStatusCode(_0x3234f8,_0x56907e){_0x56907e=_0x56907e||0xcc;return function(_0x5d48b8){if(_0x5d48b8){return _0x3234f8['sendStatus'](_0x56907e);}return _0x3234f8[_0xfbfb('0x1b')](_0x56907e)[_0xfbfb('0x1c')]();};}function respondWithResult(_0x42067c,_0x5d245a){_0x5d245a=_0x5d245a||0xc8;return function(_0x2768c1){if(_0x2768c1){return _0x42067c[_0xfbfb('0x1b')](_0x5d245a)['json'](_0x2768c1);}};}function respondWithFilteredResult(_0x3db70f,_0x53ffe5){return function(_0x35d6d2){if(_0x35d6d2){var _0xef2672=typeof _0x53ffe5['offset']===_0xfbfb('0x1d')&&typeof _0x53ffe5[_0xfbfb('0x1e')]==='undefined';var _0x4f6b2f=_0x35d6d2[_0xfbfb('0x1f')];var _0x295d75=_0xef2672?0x0:_0x53ffe5[_0xfbfb('0x20')];var _0x5902a9=_0xef2672?_0x35d6d2[_0xfbfb('0x1f')]:_0x53ffe5[_0xfbfb('0x20')]+_0x53ffe5[_0xfbfb('0x1e')];var _0x2edeea;if(_0x5902a9>=_0x4f6b2f){_0x5902a9=_0x4f6b2f;_0x2edeea=0xc8;}else{_0x2edeea=0xce;}_0x3db70f['status'](_0x2edeea);return _0x3db70f['set'](_0xfbfb('0x21'),_0x295d75+'-'+_0x5902a9+'/'+_0x4f6b2f)[_0xfbfb('0x22')](_0x35d6d2);}return null;};}function patchUpdates(_0x408612){return function(_0x4d42c7){try{jsonpatch[_0xfbfb('0x23')](_0x4d42c7,_0x408612,!![]);}catch(_0x375735){return BPromise[_0xfbfb('0x24')](_0x375735);}return _0x4d42c7[_0xfbfb('0x25')]();};}function saveUpdates(_0x58a264,_0x5cd1f3){return function(_0x14762d){if(_0x14762d){return _0x14762d[_0xfbfb('0x26')](_0x58a264)[_0xfbfb('0x27')](function(_0x585963){return _0x585963;});}return null;};}function removeEntity(_0x3c299e,_0x518de0){return function(_0x5eb247){if(_0x5eb247){return _0x5eb247[_0xfbfb('0x28')]()[_0xfbfb('0x27')](function(){var _0x29ee78=_0x5eb247['get']({'plain':!![]});var _0x3e9579='Intervals';return db[_0xfbfb('0x29')][_0xfbfb('0x28')]({'where':{'type':_0x3e9579,'resourceId':_0x29ee78['id']}})[_0xfbfb('0x27')](function(){return _0x5eb247;});})[_0xfbfb('0x27')](function(){_0x3c299e[_0xfbfb('0x1b')](0xcc)[_0xfbfb('0x1c')]();});}};}function handleEntityNotFound(_0x5b9148,_0x55015c){return function(_0x2b3d71){if(!_0x2b3d71){_0x5b9148[_0xfbfb('0x2a')](0x194);}return _0x2b3d71;};}function handleError(_0x7985d4,_0x57bbe0){_0x57bbe0=_0x57bbe0||0x1f4;return function(_0x5ebed6){logger[_0xfbfb('0x2b')](_0x5ebed6['stack']);if(_0x5ebed6[_0xfbfb('0x2c')]){delete _0x5ebed6['name'];}_0x7985d4[_0xfbfb('0x1b')](_0x57bbe0)[_0xfbfb('0x2d')](_0x5ebed6);};}exports[_0xfbfb('0x2e')]=function(_0x2c56f0,_0x307fe6){var _0x42362a={},_0x475775={},_0x40a438={'count':0x0,'rows':[]};var _0x5eadbc=_[_0xfbfb('0x2f')](db[_0xfbfb('0x30')][_0xfbfb('0x31')],function(_0x454a78){return{'name':_0x454a78['fieldName'],'type':_0x454a78[_0xfbfb('0x32')][_0xfbfb('0x33')]};});_0x475775[_0xfbfb('0x34')]=_[_0xfbfb('0x2f')](_0x5eadbc,_0xfbfb('0x2c'));_0x475775[_0xfbfb('0x35')]=_['keys'](_0x2c56f0['query']);_0x475775['filters']=_[_0xfbfb('0x36')](_0x475775[_0xfbfb('0x34')],_0x475775[_0xfbfb('0x35')]);_0x42362a['attributes']=_[_0xfbfb('0x36')](_0x475775['model'],qs[_0xfbfb('0x37')](_0x2c56f0[_0xfbfb('0x35')][_0xfbfb('0x37')]));_0x42362a['attributes']=_0x42362a['attributes'][_0xfbfb('0x38')]?_0x42362a['attributes']:_0x475775['model'];if(!_0x2c56f0['query'][_0xfbfb('0x39')](_0xfbfb('0x3a'))){_0x42362a[_0xfbfb('0x1e')]=qs[_0xfbfb('0x1e')](_0x2c56f0[_0xfbfb('0x35')]['limit']);_0x42362a[_0xfbfb('0x20')]=qs[_0xfbfb('0x20')](_0x2c56f0[_0xfbfb('0x35')][_0xfbfb('0x20')]);}_0x42362a[_0xfbfb('0x3b')]=qs[_0xfbfb('0x3c')](_0x2c56f0['query'][_0xfbfb('0x3c')]);_0x42362a[_0xfbfb('0x3d')]=qs['filters'](_[_0xfbfb('0x3e')](_0x2c56f0[_0xfbfb('0x35')],_0x475775[_0xfbfb('0x3f')]),_0x5eadbc);if(_0x2c56f0[_0xfbfb('0x35')]['filter']){_0x42362a[_0xfbfb('0x3d')]=_['merge'](_0x42362a[_0xfbfb('0x3d')],{'$or':_[_0xfbfb('0x2f')](_0x5eadbc,function(_0x50b3ae){if(_0x50b3ae[_0xfbfb('0x32')]!==_0xfbfb('0x40')){var _0x5676ca={};_0x5676ca[_0x50b3ae['name']]={'$like':'%'+_0x2c56f0[_0xfbfb('0x35')][_0xfbfb('0x41')]+'%'};return _0x5676ca;}})});}_0x42362a=_[_0xfbfb('0x42')]({},_0x42362a,_0x2c56f0[_0xfbfb('0x43')]);var _0x2d94e0={'where':_0x42362a[_0xfbfb('0x3d')]};return db[_0xfbfb('0x30')][_0xfbfb('0x1f')](_0x2d94e0)[_0xfbfb('0x27')](function(_0x2aeae3){_0x40a438[_0xfbfb('0x1f')]=_0x2aeae3;if(_0x2c56f0[_0xfbfb('0x35')][_0xfbfb('0x44')]){_0x42362a['include']=[{'all':!![]}];}return db[_0xfbfb('0x30')][_0xfbfb('0x45')](_0x42362a);})['then'](function(_0x377de0){_0x40a438['rows']=_0x377de0;return _0x40a438;})[_0xfbfb('0x27')](respondWithFilteredResult(_0x307fe6,_0x42362a))[_0xfbfb('0x46')](handleError(_0x307fe6,null));};exports[_0xfbfb('0x47')]=function(_0xd10df3,_0x101f10){var _0xc41de4={'raw':!![],'where':{'id':_0xd10df3[_0xfbfb('0x48')]['id']}},_0x276151={};_0x276151['model']=_[_0xfbfb('0x49')](db[_0xfbfb('0x30')][_0xfbfb('0x31')]);_0x276151[_0xfbfb('0x35')]=_[_0xfbfb('0x49')](_0xd10df3['query']);_0x276151[_0xfbfb('0x3f')]=_[_0xfbfb('0x36')](_0x276151[_0xfbfb('0x34')],_0x276151[_0xfbfb('0x35')]);_0xc41de4[_0xfbfb('0x4a')]=_[_0xfbfb('0x36')](_0x276151[_0xfbfb('0x34')],qs[_0xfbfb('0x37')](_0xd10df3[_0xfbfb('0x35')]['fields']));_0xc41de4[_0xfbfb('0x4a')]=_0xc41de4[_0xfbfb('0x4a')][_0xfbfb('0x38')]?_0xc41de4[_0xfbfb('0x4a')]:_0x276151[_0xfbfb('0x34')];if(_0xd10df3[_0xfbfb('0x35')]['includeAll']){_0xc41de4['include']=[{'all':!![]}];}_0xc41de4=_[_0xfbfb('0x42')]({},_0xc41de4,_0xd10df3[_0xfbfb('0x43')]);return db['Interval'][_0xfbfb('0x4b')](_0xc41de4)[_0xfbfb('0x27')](handleEntityNotFound(_0x101f10,null))[_0xfbfb('0x27')](respondWithResult(_0x101f10,null))['catch'](handleError(_0x101f10,null));};exports[_0xfbfb('0x4c')]=function(_0x342e16,_0xc84fb9){return db[_0xfbfb('0x30')]['create'](_0x342e16[_0xfbfb('0x4d')],{})[_0xfbfb('0x27')](function(_0x27e65e){var _0x18fa51=_0x342e16[_0xfbfb('0x4e')][_0xfbfb('0x4f')]({'plain':!![]});if(!_0x18fa51)throw new Error(_0xfbfb('0x50'));if(_0x18fa51['role']===_0xfbfb('0x4e')){var _0x26c3a9=_0x27e65e[_0xfbfb('0x4f')]({'plain':!![]});var _0x7819f6=_0xfbfb('0x51');return db['UserProfileSection'][_0xfbfb('0x4b')]({'where':{'name':_0x7819f6,'userProfileId':_0x18fa51[_0xfbfb('0x52')]},'raw':!![]})[_0xfbfb('0x27')](function(_0x355c93){if(_0x355c93&&_0x355c93[_0xfbfb('0x53')]===0x0){return db[_0xfbfb('0x29')]['create']({'name':_0x26c3a9[_0xfbfb('0x2c')],'resourceId':_0x26c3a9['id'],'type':_0x355c93[_0xfbfb('0x2c')],'sectionId':_0x355c93['id']},{})['then'](function(){return _0x27e65e;});}else{return _0x27e65e;}})[_0xfbfb('0x46')](function(_0xe71315){logger[_0xfbfb('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe71315);throw _0xe71315;});}return _0x27e65e;})[_0xfbfb('0x27')](respondWithResult(_0xc84fb9,0xc9))[_0xfbfb('0x46')](handleError(_0xc84fb9,null));};exports[_0xfbfb('0x26')]=function(_0x27247e,_0x4ad488){if(_0x27247e['body']['id']){delete _0x27247e[_0xfbfb('0x4d')]['id'];}return db['Interval'][_0xfbfb('0x4b')]({'where':{'id':_0x27247e[_0xfbfb('0x48')]['id']}})['then'](handleEntityNotFound(_0x4ad488,null))[_0xfbfb('0x27')](saveUpdates(_0x27247e['body'],null))['then'](respondWithResult(_0x4ad488,null))[_0xfbfb('0x46')](handleError(_0x4ad488,null));};exports[_0xfbfb('0x28')]=function(_0x208d01,_0x58bbea){return db['Interval'][_0xfbfb('0x4b')]({'where':{'id':_0x208d01[_0xfbfb('0x48')]['id']}})[_0xfbfb('0x27')](handleEntityNotFound(_0x58bbea,null))[_0xfbfb('0x27')](removeEntity(_0x58bbea,null))[_0xfbfb('0x46')](handleError(_0x58bbea,null));};exports[_0xfbfb('0x54')]=function(_0x1e8ad5,_0x4c3699,_0x9e08ec){if(_0x1e8ad5[_0xfbfb('0x4d')]['id']){delete _0x1e8ad5[_0xfbfb('0x4d')]['id'];}return db[_0xfbfb('0x30')][_0xfbfb('0x4b')]({'where':{'id':_0x1e8ad5[_0xfbfb('0x48')]['id']}})[_0xfbfb('0x27')](handleEntityNotFound(_0x4c3699,null))[_0xfbfb('0x27')](function(_0x450fe1){if(_0x450fe1){_0x1e8ad5[_0xfbfb('0x4d')][_0xfbfb('0x55')]=_0x450fe1['id'];return db[_0xfbfb('0x30')][_0xfbfb('0x4c')](_0x1e8ad5[_0xfbfb('0x4d')]);}})[_0xfbfb('0x27')](respondWithResult(_0x4c3699,null))['catch'](handleError(_0x4c3699,null));};exports['getIntervals']=function(_0x11c66e,_0x54d0fa,_0x403bb4){var _0x30a525={};var _0x3eb2a1={};var _0x46c2d8;var _0x967295;return db[_0xfbfb('0x30')]['findOne']({'where':{'id':_0x11c66e[_0xfbfb('0x48')]['id']}})[_0xfbfb('0x27')](handleEntityNotFound(_0x54d0fa,null))[_0xfbfb('0x27')](function(_0xcc613e){if(_0xcc613e){_0x46c2d8=_0xcc613e;_0x3eb2a1['model']=_[_0xfbfb('0x49')](db['Interval']['rawAttributes']);_0x3eb2a1[_0xfbfb('0x35')]=_[_0xfbfb('0x49')](_0x11c66e[_0xfbfb('0x35')]);_0x3eb2a1[_0xfbfb('0x3f')]=_[_0xfbfb('0x36')](_0x3eb2a1[_0xfbfb('0x34')],_0x3eb2a1[_0xfbfb('0x35')]);_0x30a525['attributes']=_[_0xfbfb('0x36')](_0x3eb2a1['model'],qs[_0xfbfb('0x37')](_0x11c66e[_0xfbfb('0x35')][_0xfbfb('0x37')]));_0x30a525[_0xfbfb('0x4a')]=_0x30a525[_0xfbfb('0x4a')]['length']?_0x30a525[_0xfbfb('0x4a')]:_0x3eb2a1['model'];_0x30a525[_0xfbfb('0x3b')]=qs[_0xfbfb('0x3c')](_0x11c66e[_0xfbfb('0x35')][_0xfbfb('0x3c')]);_0x30a525[_0xfbfb('0x3d')]=qs[_0xfbfb('0x3f')](_['pick'](_0x11c66e[_0xfbfb('0x35')],_0x3eb2a1[_0xfbfb('0x3f')]));if(_0x11c66e[_0xfbfb('0x35')][_0xfbfb('0x41')]){_0x30a525[_0xfbfb('0x3d')]=_['merge'](_0x30a525['where'],{'$or':_[_0xfbfb('0x2f')](_0x30a525[_0xfbfb('0x4a')],function(_0x44d1aa){var _0x237fb3={};_0x237fb3[_0x44d1aa]={'$like':'%'+_0x11c66e[_0xfbfb('0x35')][_0xfbfb('0x41')]+'%'};return _0x237fb3;})});}_0x30a525=_[_0xfbfb('0x42')]({},_0x30a525,_0x11c66e[_0xfbfb('0x43')]);return _0x46c2d8['getIntervals'](_0x30a525);}})['then'](function(_0x41522e){if(_0x41522e){_0x967295=_0x41522e['length'];if(!_0x11c66e[_0xfbfb('0x35')][_0xfbfb('0x39')](_0xfbfb('0x3a'))){_0x30a525[_0xfbfb('0x1e')]=qs['limit'](_0x11c66e['query']['limit']);_0x30a525[_0xfbfb('0x20')]=qs[_0xfbfb('0x20')](_0x11c66e[_0xfbfb('0x35')][_0xfbfb('0x20')]);}return _0x46c2d8['getIntervals'](_0x30a525);}})[_0xfbfb('0x27')](function(_0x1a0107){if(_0x1a0107){return _0x1a0107?{'count':_0x967295,'rows':_0x1a0107}:null;}})[_0xfbfb('0x27')](respondWithResult(_0x54d0fa,null))[_0xfbfb('0x46')](handleError(_0x54d0fa,null));};exports['addIntervals']=function(_0x54c5dd,_0x5537f7,_0x430f59){return db[_0xfbfb('0x30')]['findOne']({'where':{'id':_0x54c5dd[_0xfbfb('0x48')]['id']}})[_0xfbfb('0x27')](handleEntityNotFound(_0x5537f7,null))[_0xfbfb('0x27')](function(_0x4759af){if(_0x4759af){return db[_0xfbfb('0x56')][_0xfbfb('0x57')](function(_0x462344){return db[_0xfbfb('0x30')][_0xfbfb('0x28')]({'where':{'IntervalId':_0x54c5dd[_0xfbfb('0x48')]['id']},'transaction':_0x462344})[_0xfbfb('0x27')](function(_0x4a8532){var _0x2b5628=_[_0xfbfb('0x2f')](_0x54c5dd[_0xfbfb('0x4d')],function(_0xd8cd57){delete _0xd8cd57['id'];_0xd8cd57[_0xfbfb('0x55')]=_0x54c5dd[_0xfbfb('0x48')]['id'];return _0xd8cd57;});return db[_0xfbfb('0x30')][_0xfbfb('0x58')](_0x2b5628,{'transaction':_0x462344});});})[_0xfbfb('0x27')](function(){return db[_0xfbfb('0x30')]['findAll']({'where':{'IntervalId':_0x54c5dd[_0xfbfb('0x48')]['id']}});});}})[_0xfbfb('0x27')](respondWithResult(_0x5537f7,null))[_0xfbfb('0x46')](handleError(_0x5537f7,null));}; \ No newline at end of file +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 diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 7976854..0603337 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 _0xf224=['bluebird','request-promise','path','../../config/environment','../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','api','moment'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0xf224,0xb2));var _0x4f22=function(_0x3befd1,_0x500135){_0x3befd1=_0x3befd1-0x0;var _0x80e3e1=_0xf224[_0x3befd1];return _0x80e3e1;};'use strict';var _=require(_0x4f22('0x0'));var util=require(_0x4f22('0x1'));var logger=require('../../config/logger')(_0x4f22('0x2'));var moment=require(_0x4f22('0x3'));var BPromise=require(_0x4f22('0x4'));var rp=require(_0x4f22('0x5'));var fs=require('fs');var path=require(_0x4f22('0x6'));var rimraf=require('rimraf');var config=require(_0x4f22('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0x4f22('0x8'));module[_0x4f22('0x9')]=function(_0x53a5f0,_0xea7f73){return _0x53a5f0[_0x4f22('0xa')]('Interval',attributes,{'tableName':_0x4f22('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xf8dde1,_0x4bc20d){extensions[_0x4f22('0xc')](_0x53a5f0,_0xf8dde1);},'afterBulkCreate':function(_0x415464,_0x1595b7,_0x26fa5a){_0x26fa5a();extensions['rewrite'](_0x53a5f0,_0x415464[0x0]);},'afterUpdate':function(_0x30adcb,_0xea5310){extensions[_0x4f22('0xc')](_0x53a5f0,_0x30adcb);},'afterDestroy':function(_0x5aa841,_0x4efe36){extensions[_0x4f22('0xc')](_0x53a5f0,_0x5aa841);}}});}; \ No newline at end of file +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 diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 2e61fea..3db6234 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(_0x4d6ac0,_0x201628){var _0x5296c4=function(_0x3d0b3d){while(--_0x3d0b3d){_0x4d6ac0['push'](_0x4d6ac0['shift']());}};_0x5296c4(++_0x201628);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_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 diff --git a/server/api/jira/index.js b/server/api/jira/index.js index e6070a2..93b6171 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 _0x0b0e=['exports','express','../../components/auth/service','post','isAuthenticated','send'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34473f,_0x2b9c5c){_0x34473f=_0x34473f-0x0;var _0x25cf6f=_0x0b0e[_0x34473f];return _0x25cf6f;};'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 +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 diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index e81d6a0..10583c1 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 _0x7680=['Bug','customfield_11500','email','fields','customfield_11501','oldToken','newToken','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','Basic\x20','toString','utf8','data','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','send','body','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','support','key','MOTGUI','\x20from\x20','description','stringify'];(function(_0x1acc01,_0x5cb80c){var _0x5603f1=function(_0x5e7558){while(--_0x5e7558){_0x1acc01['push'](_0x1acc01['shift']());}};_0x5603f1(++_0x5cb80c);}(_0x7680,0x67));var _0x0768=function(_0x130d34,_0xb829c2){_0x130d34=_0x130d34-0x0;var _0x3bf5d2=_0x7680[_0x130d34];return _0x3bf5d2;};'use strict';var BPromise=require(_0x0768('0x0'));var https=require(_0x0768('0x1'));var logger=require('../../config/logger')('api');var USERNAME=_0x0768('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5e514c,_0x52c691){var _0x5c80af={'fields':{'project':{'key':_0x5e514c[_0x0768('0x3')]||_0x0768('0x4')},'summary':(_0x5e514c['summary']||'Report')+_0x0768('0x5')+_0x5e514c['ip'],'description':_0x5e514c[_0x0768('0x6')]||JSON[_0x0768('0x7')](_0x5e514c),'issuetype':{'name':_0x5e514c['issuetype']||_0x0768('0x8')}}};_0x5c80af['fields'][_0x0768('0x9')]=_0x5e514c[_0x0768('0xa')];_0x5c80af[_0x0768('0xb')][_0x0768('0xc')]=_0x5e514c[_0x0768('0xd')];_0x5c80af['fields']['customfield_11502']=_0x5e514c[_0x0768('0xe')];_0x5c80af[_0x0768('0xb')]['customfield_11503']=_0x5e514c['name'];_0x5c80af[_0x0768('0xb')]['customfield_11504']=_0x5e514c['reason'];_0x5c80af[_0x0768('0xb')][_0x0768('0xf')]=_0x5e514c['ip'];var _0xf48915={'host':_0x0768('0x10'),'port':0x1bb,'path':_0x0768('0x11'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':'application/json','Authorization':_0x0768('0x12')+new Buffer(USERNAME+':'+PASSWORD)[_0x0768('0x13')]('base64')}};var _0x197f02=JSON[_0x0768('0x7')](_0x5c80af);var _0x42cec3=https['request'](_0xf48915,function(_0x39484f){_0x39484f['setEncoding'](_0x0768('0x14'));var _0x4fe11c='';_0x39484f['on'](_0x0768('0x15'),function(_0x164b8c){_0x4fe11c+=_0x164b8c;});_0x39484f['on']('end',function(){if(_0x52c691){return _0x52c691[_0x0768('0x16')](_0x39484f[_0x0768('0x17')])[_0x0768('0x18')](JSON[_0x0768('0x19')](_0x4fe11c));}});});_0x42cec3['on'](_0x0768('0x1a'),function(_0x48e807){if(_0x52c691){return _0x52c691[_0x0768('0x16')](0x1f4)[_0x0768('0x18')]({'errors':[{'message':_0x0768('0x1b'),'type':_0x0768('0x1c')}]});}});_0x42cec3[_0x0768('0x1d')](_0x197f02);_0x42cec3[_0x0768('0x1e')]();}exports['openIssue']=openIssue;exports[_0x0768('0x1f')]=function(_0x451dab,_0x568df0){_0x451dab[_0x0768('0x20')]['ip']=_0x451dab['headers'][_0x0768('0x21')]||_0x451dab[_0x0768('0x22')][_0x0768('0x23')]||_0x451dab[_0x0768('0x24')][_0x0768('0x23')]||_0x451dab[_0x0768('0x22')][_0x0768('0x24')][_0x0768('0x23')];return openIssue(_0x451dab['body'],_0x568df0);}; \ No newline at end of file +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 diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 165d335..39e2abc 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 _0xec56=['put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x2c1f8b,_0x512bd7){var _0x6b9b38=function(_0x574a4b){while(--_0x574a4b){_0x2c1f8b['push'](_0x2c1f8b['shift']());}};_0x6b9b38(++_0x512bd7);}(_0xec56,0x1bd));var _0x6ec5=function(_0x3855a9,_0x4374b6){_0x3855a9=_0x3855a9-0x0;var _0x3388b5=_0xec56[_0x3855a9];return _0x3388b5;};'use strict';var multer=require(_0x6ec5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6ec5('0x1'));var express=require(_0x6ec5('0x2'));var router=express[_0x6ec5('0x3')]();var fs_extra=require(_0x6ec5('0x4'));var auth=require(_0x6ec5('0x5'));var interaction=require(_0x6ec5('0x6'));var config=require(_0x6ec5('0x7'));var controller=require(_0x6ec5('0x8'));router[_0x6ec5('0x9')]('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xb')]);router[_0x6ec5('0x9')](_0x6ec5('0xc'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xd')]);router[_0x6ec5('0x9')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0xf')]);router['post']('/',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x10')]);router[_0x6ec5('0x11')](_0x6ec5('0xe'),auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x12')]);router[_0x6ec5('0x13')]('/:id',auth[_0x6ec5('0xa')](),controller[_0x6ec5('0x14')]);module[_0x6ec5('0x15')]=router; \ No newline at end of file +var _0x9c44=['update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put'];(function(_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 diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 513bfc5..8dea6c8 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(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x7a54,0x106));var _0x47a5=function(_0x52d52e,_0x2fd927){_0x52d52e=_0x52d52e-0x0;var _0x55c63e=_0x7a54[_0x52d52e];return _0x55c63e;};'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(_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 diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 704f6f3..6a63dec 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 _0x363e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','JscriptyAnswerReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','rawAttributes','length','create','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x416d41,_0x3b804b){var _0x3f66a6=function(_0xc33553){while(--_0xc33553){_0x416d41['push'](_0x416d41['shift']());}};_0x3f66a6(++_0x3b804b);}(_0x363e,0x179));var _0xe363=function(_0x23c3ef,_0x360af0){_0x23c3ef=_0x23c3ef-0x0;var _0x28aa9a=_0x363e[_0x23c3ef];return _0x28aa9a;};'use strict';var emlformat=require(_0xe363('0x0'));var rimraf=require(_0xe363('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe363('0x2'));var rp=require(_0xe363('0x3'));var moment=require(_0xe363('0x4'));var BPromise=require(_0xe363('0x5'));var Mustache=require(_0xe363('0x6'));var util=require(_0xe363('0x7'));var path=require(_0xe363('0x8'));var sox=require(_0xe363('0x9'));var csv=require(_0xe363('0xa'));var ejs=require(_0xe363('0xb'));var fs=require('fs');var fs_extra=require(_0xe363('0xc'));var _=require('lodash');var squel=require(_0xe363('0xd'));var crypto=require(_0xe363('0xe'));var jsforce=require(_0xe363('0xf'));var deskjs=require(_0xe363('0x10'));var toCsv=require('to-csv');var querystring=require(_0xe363('0x11'));var Papa=require(_0xe363('0x12'));var Redis=require(_0xe363('0x13'));var authService=require(_0xe363('0x14'));var qs=require(_0xe363('0x15'));var as=require(_0xe363('0x16'));var hardwareService=require(_0xe363('0x17'));var logger=require('../../config/logger')(_0xe363('0x18'));var utils=require(_0xe363('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xe363('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e1fb0,_0x8b6974){_0x8b6974=_0x8b6974||0xcc;return function(_0x21cb92){if(_0x21cb92){return _0x4e1fb0[_0xe363('0x1b')](_0x8b6974);}return _0x4e1fb0[_0xe363('0x1c')](_0x8b6974)[_0xe363('0x1d')]();};}function respondWithResult(_0x563fbf,_0x17ff61){_0x17ff61=_0x17ff61||0xc8;return function(_0x22b227){if(_0x22b227){return _0x563fbf['status'](_0x17ff61)[_0xe363('0x1e')](_0x22b227);}};}function respondWithFilteredResult(_0x2ad0e9,_0x52e6c6){return function(_0x3c74f9){if(_0x3c74f9){var _0x73ef9a=typeof _0x52e6c6['offset']===_0xe363('0x1f')&&typeof _0x52e6c6[_0xe363('0x20')]==='undefined';var _0xecbe2c=_0x3c74f9[_0xe363('0x21')];var _0x2f2c20=_0x73ef9a?0x0:_0x52e6c6['offset'];var _0x287104=_0x73ef9a?_0x3c74f9[_0xe363('0x21')]:_0x52e6c6['offset']+_0x52e6c6[_0xe363('0x20')];var _0x110e59;if(_0x287104>=_0xecbe2c){_0x287104=_0xecbe2c;_0x110e59=0xc8;}else{_0x110e59=0xce;}_0x2ad0e9[_0xe363('0x1c')](_0x110e59);return _0x2ad0e9[_0xe363('0x22')](_0xe363('0x23'),_0x2f2c20+'-'+_0x287104+'/'+_0xecbe2c)[_0xe363('0x1e')](_0x3c74f9);}return null;};}function patchUpdates(_0x4ee855){return function(_0x3bed39){try{jsonpatch[_0xe363('0x24')](_0x3bed39,_0x4ee855,!![]);}catch(_0x14ff95){return BPromise[_0xe363('0x25')](_0x14ff95);}return _0x3bed39[_0xe363('0x26')]();};}function saveUpdates(_0x42928e,_0x24199a){return function(_0xaff56f){if(_0xaff56f){return _0xaff56f[_0xe363('0x27')](_0x42928e)[_0xe363('0x28')](function(_0x1de673){return _0x1de673;});}return null;};}function removeEntity(_0x441b94,_0x11556d){return function(_0x388223){if(_0x388223){return _0x388223[_0xe363('0x29')]()[_0xe363('0x28')](function(){_0x441b94[_0xe363('0x1c')](0xcc)[_0xe363('0x1d')]();});}};}function handleEntityNotFound(_0x19c7b4,_0x3e24ad){return function(_0x312d75){if(!_0x312d75){_0x19c7b4[_0xe363('0x1b')](0x194);}return _0x312d75;};}function handleError(_0x5b2b3d,_0xbdfae9){_0xbdfae9=_0xbdfae9||0x1f4;return function(_0x12358b){logger[_0xe363('0x2a')](_0x12358b[_0xe363('0x2b')]);if(_0x12358b[_0xe363('0x2c')]){delete _0x12358b['name'];}_0x5b2b3d[_0xe363('0x1c')](_0xbdfae9)[_0xe363('0x2d')](_0x12358b);};}exports['index']=function(_0x3cc130,_0x5a790c){var _0x3ed3e1={},_0x45d664={},_0x4c739d={'count':0x0,'rows':[]};var _0x357b6f=_[_0xe363('0x2e')](db[_0xe363('0x2f')]['rawAttributes'],function(_0x40671e){return{'name':_0x40671e[_0xe363('0x30')],'type':_0x40671e[_0xe363('0x31')][_0xe363('0x32')]};});_0x45d664['model']=_[_0xe363('0x2e')](_0x357b6f,_0xe363('0x2c'));_0x45d664[_0xe363('0x33')]=_[_0xe363('0x34')](_0x3cc130[_0xe363('0x33')]);_0x45d664[_0xe363('0x35')]=_[_0xe363('0x36')](_0x45d664[_0xe363('0x37')],_0x45d664[_0xe363('0x33')]);_0x3ed3e1[_0xe363('0x38')]=_['intersection'](_0x45d664['model'],qs[_0xe363('0x39')](_0x3cc130[_0xe363('0x33')]['fields']));_0x3ed3e1[_0xe363('0x38')]=_0x3ed3e1[_0xe363('0x38')]['length']?_0x3ed3e1[_0xe363('0x38')]:_0x45d664[_0xe363('0x37')];if(!_0x3cc130[_0xe363('0x33')][_0xe363('0x3a')]('nolimit')){_0x3ed3e1['limit']=qs[_0xe363('0x20')](_0x3cc130['query']['limit']);_0x3ed3e1[_0xe363('0x3b')]=qs[_0xe363('0x3b')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3b')]);}_0x3ed3e1[_0xe363('0x3c')]=qs[_0xe363('0x3d')](_0x3cc130[_0xe363('0x33')][_0xe363('0x3d')]);_0x3ed3e1[_0xe363('0x3e')]=qs[_0xe363('0x35')](_[_0xe363('0x3f')](_0x3cc130[_0xe363('0x33')],_0x45d664['filters']),_0x357b6f);if(_0x3cc130['query'][_0xe363('0x40')]){_0x3ed3e1[_0xe363('0x3e')]=_[_0xe363('0x41')](_0x3ed3e1['where'],{'$or':_['map'](_0x357b6f,function(_0x815550){if(_0x815550[_0xe363('0x31')]!==_0xe363('0x42')){var _0x199c78={};_0x199c78[_0x815550['name']]={'$like':'%'+_0x3cc130[_0xe363('0x33')]['filter']+'%'};return _0x199c78;}})});}_0x3ed3e1=_[_0xe363('0x41')]({},_0x3ed3e1,_0x3cc130[_0xe363('0x43')]);var _0xbca95f={'where':_0x3ed3e1[_0xe363('0x3e')]};return db[_0xe363('0x2f')][_0xe363('0x21')](_0xbca95f)[_0xe363('0x28')](function(_0x44f03c){_0x4c739d[_0xe363('0x21')]=_0x44f03c;if(_0x3cc130['query']['includeAll']){_0x3ed3e1[_0xe363('0x44')]=[{'all':!![]}];}return db[_0xe363('0x2f')][_0xe363('0x45')](_0x3ed3e1);})[_0xe363('0x28')](function(_0x2fc2f0){_0x4c739d[_0xe363('0x46')]=_0x2fc2f0;return _0x4c739d;})[_0xe363('0x28')](respondWithFilteredResult(_0x5a790c,_0x3ed3e1))[_0xe363('0x47')](handleError(_0x5a790c,null));};exports[_0xe363('0x48')]=function(_0x4b8238,_0x3da5ba){var _0x58b837={'raw':!![],'where':{'id':_0x4b8238['params']['id']}},_0x41a87c={};_0x41a87c[_0xe363('0x37')]=_[_0xe363('0x34')](db['JscriptyAnswerReport'][_0xe363('0x49')]);_0x41a87c[_0xe363('0x33')]=_[_0xe363('0x34')](_0x4b8238[_0xe363('0x33')]);_0x41a87c[_0xe363('0x35')]=_[_0xe363('0x36')](_0x41a87c['model'],_0x41a87c[_0xe363('0x33')]);_0x58b837[_0xe363('0x38')]=_[_0xe363('0x36')](_0x41a87c[_0xe363('0x37')],qs[_0xe363('0x39')](_0x4b8238['query'][_0xe363('0x39')]));_0x58b837[_0xe363('0x38')]=_0x58b837[_0xe363('0x38')][_0xe363('0x4a')]?_0x58b837[_0xe363('0x38')]:_0x41a87c[_0xe363('0x37')];if(_0x4b8238[_0xe363('0x33')]['includeAll']){_0x58b837['include']=[{'all':!![]}];}_0x58b837=_[_0xe363('0x41')]({},_0x58b837,_0x4b8238[_0xe363('0x43')]);return db[_0xe363('0x2f')]['find'](_0x58b837)[_0xe363('0x28')](handleEntityNotFound(_0x3da5ba,null))[_0xe363('0x28')](respondWithResult(_0x3da5ba,null))['catch'](handleError(_0x3da5ba,null));};exports['create']=function(_0x2a7b42,_0x34e08b){return db[_0xe363('0x2f')][_0xe363('0x4b')](_0x2a7b42['body'],{})[_0xe363('0x28')](respondWithResult(_0x34e08b,0xc9))[_0xe363('0x47')](handleError(_0x34e08b,null));};exports['update']=function(_0x4fbdbb,_0x306afd){if(_0x4fbdbb[_0xe363('0x4c')]['id']){delete _0x4fbdbb['body']['id'];}return db[_0xe363('0x2f')]['find']({'where':{'id':_0x4fbdbb[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x306afd,null))['then'](saveUpdates(_0x4fbdbb[_0xe363('0x4c')],null))[_0xe363('0x28')](respondWithResult(_0x306afd,null))['catch'](handleError(_0x306afd,null));};exports[_0xe363('0x29')]=function(_0x43ee23,_0x55f0e6){return db[_0xe363('0x2f')]['find']({'where':{'id':_0x43ee23[_0xe363('0x4d')]['id']}})[_0xe363('0x28')](handleEntityNotFound(_0x55f0e6,null))[_0xe363('0x28')](removeEntity(_0x55f0e6,null))[_0xe363('0x47')](handleError(_0x55f0e6,null));};exports['describe']=function(_0x2ff064,_0x225a43){return db[_0xe363('0x2f')]['describe']()[_0xe363('0x28')](respondWithResult(_0x225a43,null))[_0xe363('0x47')](handleError(_0x225a43,null));}; \ No newline at end of file +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 diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 7542580..358ca29 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 _0xfa3b=['api','bluebird','request-promise','rimraf','../../config/environment','define','util','../../config/logger'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0xfa3b,0x8e));var _0xbfa3=function(_0x1b5a05,_0x2c80de){_0x1b5a05=_0x1b5a05-0x0;var _0x347931=_0xfa3b[_0x1b5a05];return _0x347931;};'use strict';var _=require('lodash');var util=require(_0xbfa3('0x0'));var logger=require(_0xbfa3('0x1'))(_0xbfa3('0x2'));var moment=require('moment');var BPromise=require(_0xbfa3('0x3'));var rp=require(_0xbfa3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfa3('0x5'));var config=require(_0xbfa3('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module['exports']=function(_0x3199c3,_0x2b04ae){return _0x3199c3[_0xbfa3('0x7')]('JscriptyAnswerReport',attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index fc54068..6dfa413 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 _0x877e=['JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x877e,0xd8));var _0xe877=function(_0x23ea41,_0x58a0c0){_0x23ea41=_0x23ea41-0x0;var _0x179aa7=_0x877e[_0x23ea41];return _0x179aa7;};'use strict';var _=require(_0xe877('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe877('0x1'));var rs=require(_0xe877('0x2'));var fs=require('fs');var Redis=require(_0xe877('0x3'));var db=require(_0xe877('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe877('0x5'))(_0xe877('0x6'));var config=require(_0xe877('0x7'));var jayson=require(_0xe877('0x8'));var client=jayson[_0xe877('0x9')][_0xe877('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40479a,_0x13b1ab,_0x32415c){return new BPromise(function(_0x3d2b8a,_0x28de81){return client[_0xe877('0xb')](_0x40479a,_0x32415c)[_0xe877('0xc')](function(_0x534a1c){logger['info'](_0xe877('0xd'),_0x13b1ab,_0xe877('0xe'));logger['debug'](_0xe877('0xf'),_0x13b1ab,_0xe877('0xe'),JSON[_0xe877('0x10')](_0x534a1c));if(_0x534a1c[_0xe877('0x11')]){if(_0x534a1c[_0xe877('0x11')][_0xe877('0x12')]===0x1f4){logger[_0xe877('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x13b1ab,_0x534a1c[_0xe877('0x11')][_0xe877('0x13')]);return _0x28de81(_0x534a1c[_0xe877('0x11')][_0xe877('0x13')]);}logger[_0xe877('0x11')](_0xe877('0xd'),_0x13b1ab,_0x534a1c[_0xe877('0x11')]['message']);return _0x3d2b8a(_0x534a1c[_0xe877('0x11')][_0xe877('0x13')]);}else{logger['info'](_0xe877('0xd'),_0x13b1ab,_0xe877('0xe'));_0x3d2b8a(_0x534a1c['result'][_0xe877('0x13')]);}})[_0xe877('0x14')](function(_0x44d5fb){logger[_0xe877('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x13b1ab,_0x44d5fb);_0x28de81(_0x44d5fb);});});} \ No newline at end of file +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 diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 97c0ead..833dca7 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 _0xb1b5=['../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','getSessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0xb1b5,0x1a9));var _0x5b1b=function(_0x3d517e,_0x2f4b2a){_0x3d517e=_0x3d517e-0x0;var _0x1f0fd3=_0xb1b5[_0x3d517e];return _0x1f0fd3;};'use strict';var multer=require(_0x5b1b('0x0'));var util=require(_0x5b1b('0x1'));var path=require(_0x5b1b('0x2'));var timeout=require(_0x5b1b('0x3'));var express=require(_0x5b1b('0x4'));var router=express[_0x5b1b('0x5')]();var fs_extra=require(_0x5b1b('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b1b('0x7'));var config=require(_0x5b1b('0x8'));var controller=require('./jscriptyProject.controller');router[_0x5b1b('0x9')]('/',auth['isAuthenticated'](),controller[_0x5b1b('0xa')]);router[_0x5b1b('0x9')](_0x5b1b('0xb'),auth[_0x5b1b('0xc')](),controller['show']);router[_0x5b1b('0x9')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x5b1b('0xd')]);router[_0x5b1b('0x9')](_0x5b1b('0xe'),auth[_0x5b1b('0xc')](),controller[_0x5b1b('0xf')]);router[_0x5b1b('0x9')](_0x5b1b('0x10'),auth[_0x5b1b('0xc')](),timeout(_0x5b1b('0x11')),controller[_0x5b1b('0x12')]);router['post']('/',auth[_0x5b1b('0xc')](),controller[_0x5b1b('0x13')]);router[_0x5b1b('0x14')]('/:id/clone',auth[_0x5b1b('0xc')](),controller[_0x5b1b('0x15')]);router[_0x5b1b('0x16')]('/:id',auth[_0x5b1b('0xc')](),controller[_0x5b1b('0x17')]);router[_0x5b1b('0x18')](_0x5b1b('0xb'),auth[_0x5b1b('0xc')](),controller[_0x5b1b('0x19')]);module[_0x5b1b('0x1a')]=router; \ No newline at end of file +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 diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b3ded21..f1a0079 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 _0xafd1=['exports','STRING','name','TEXT','long','formData','isString','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util'];(function(_0x873c6b,_0x4e9a60){var _0x2da337=function(_0x22dcfc){while(--_0x22dcfc){_0x873c6b['push'](_0x873c6b['shift']());}};_0x2da337(++_0x4e9a60);}(_0xafd1,0xcd));var _0x1afd=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xafd1[_0x4c06a3];return _0x7ff53c;};'use strict';var Sequelize=require(_0x1afd('0x0'));var _=require(_0x1afd('0x1'));var util=require(_0x1afd('0x2'));module[_0x1afd('0x3')]={'name':{'type':Sequelize[_0x1afd('0x4')],'unique':_0x1afd('0x5')},'description':{'type':Sequelize[_0x1afd('0x4')]},'formData':{'type':Sequelize[_0x1afd('0x6')](_0x1afd('0x7')),'set':function(_0x12b68b){if(_['isObjectLike'](_0x12b68b)){this['setDataValue'](_0x1afd('0x8'),JSON['stringify'](_0x12b68b));}else if(_[_0x1afd('0x9')](_0x12b68b)){this[_0x1afd('0xa')](_0x1afd('0x8'),_0x12b68b);}else{this[_0x1afd('0xa')]('formData',util[_0x1afd('0xb')](_0x1afd('0xc'),this[_0x1afd('0xd')]('name')||'',this[_0x1afd('0xd')](_0x1afd('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x1afd('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x1afd('0xf')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index b92709d..9daa528 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 _0x97db=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','reject','update','then','destroy','Projects','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','sort','where','filter','merge','options','JscriptyProject','includeAll','include','findAll','rows','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','params','omit','createdAt','updatedAt','body','getSessions','findOne','JscriptySessionReport','hasOwnProperty','pick','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','apply','toString','indexOf','replace','starttime','startTime','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','download','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1fecf4,_0x2f6060){var _0x3a095a=function(_0x3d17a0){while(--_0x3d17a0){_0x1fecf4['push'](_0x1fecf4['shift']());}};_0x3a095a(++_0x2f6060);}(_0x97db,0x1b4));var _0xb97d=function(_0x431a80,_0x278704){_0x431a80=_0x431a80-0x0;var _0x30e5e6=_0x97db[_0x431a80];return _0x30e5e6;};'use strict';var emlformat=require(_0xb97d('0x0'));var rimraf=require(_0xb97d('0x1'));var zipdir=require(_0xb97d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb97d('0x3'));var BPromise=require(_0xb97d('0x4'));var Mustache=require(_0xb97d('0x5'));var util=require(_0xb97d('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb97d('0x7'));var ejs=require(_0xb97d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb97d('0x9'));var crypto=require('crypto');var jsforce=require(_0xb97d('0xa'));var deskjs=require(_0xb97d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xb97d('0xc'));var Papa=require(_0xb97d('0xd'));var Redis=require(_0xb97d('0xe'));var authService=require(_0xb97d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb97d('0x10'));var hardwareService=require(_0xb97d('0x11'));var logger=require(_0xb97d('0x12'))(_0xb97d('0x13'));var utils=require(_0xb97d('0x14'));var config=require(_0xb97d('0x15'));var licenseUtil=require(_0xb97d('0x16'));var db=require(_0xb97d('0x17'))['db'];function respondWithStatusCode(_0xa31bc3,_0x412655){_0x412655=_0x412655||0xcc;return function(_0xb3abc1){if(_0xb3abc1){return _0xa31bc3[_0xb97d('0x18')](_0x412655);}return _0xa31bc3[_0xb97d('0x19')](_0x412655)[_0xb97d('0x1a')]();};}function respondWithResult(_0x1d70f9,_0x2f73ec){_0x2f73ec=_0x2f73ec||0xc8;return function(_0x117bfe){if(_0x117bfe){return _0x1d70f9[_0xb97d('0x19')](_0x2f73ec)['json'](_0x117bfe);}};}function respondWithFilteredResult(_0x41a47c,_0x1a71de){return function(_0x35ea35){if(_0x35ea35){var _0x170a07=typeof _0x1a71de[_0xb97d('0x1b')]==='undefined'&&typeof _0x1a71de[_0xb97d('0x1c')]===_0xb97d('0x1d');var _0xea4e95=_0x35ea35['count'];var _0x50cd63=_0x170a07?0x0:_0x1a71de[_0xb97d('0x1b')];var _0x2285bc=_0x170a07?_0x35ea35[_0xb97d('0x1e')]:_0x1a71de[_0xb97d('0x1b')]+_0x1a71de[_0xb97d('0x1c')];var _0x3cd261;if(_0x2285bc>=_0xea4e95){_0x2285bc=_0xea4e95;_0x3cd261=0xc8;}else{_0x3cd261=0xce;}_0x41a47c[_0xb97d('0x19')](_0x3cd261);return _0x41a47c['set']('Content-Range',_0x50cd63+'-'+_0x2285bc+'/'+_0xea4e95)['json'](_0x35ea35);}return null;};}function patchUpdates(_0x49b857){return function(_0x395e6b){try{jsonpatch['apply'](_0x395e6b,_0x49b857,!![]);}catch(_0x3c0d42){return BPromise[_0xb97d('0x1f')](_0x3c0d42);}return _0x395e6b['save']();};}function saveUpdates(_0x52af79,_0x5b2a19){return function(_0xd77fee){if(_0xd77fee){return _0xd77fee[_0xb97d('0x20')](_0x52af79)[_0xb97d('0x21')](function(_0x453741){return _0x453741;});}return null;};}function removeEntity(_0x20df11,_0x3f7704){return function(_0x270cc5){if(_0x270cc5){return _0x270cc5[_0xb97d('0x22')]()[_0xb97d('0x21')](function(){var _0x207575=_0x270cc5['get']({'plain':!![]});var _0x14a8eb=_0xb97d('0x23');return db[_0xb97d('0x24')][_0xb97d('0x22')]({'where':{'type':_0x14a8eb,'resourceId':_0x207575['id']}})['then'](function(){return _0x270cc5;});})[_0xb97d('0x21')](function(){_0x20df11['status'](0xcc)[_0xb97d('0x1a')]();});}};}function handleEntityNotFound(_0xee6a00,_0x29b7e2){return function(_0x29508a){if(!_0x29508a){_0xee6a00[_0xb97d('0x18')](0x194);}return _0x29508a;};}function handleError(_0x121765,_0xa5fbed){_0xa5fbed=_0xa5fbed||0x1f4;return function(_0x26886a){logger[_0xb97d('0x25')](_0x26886a[_0xb97d('0x26')]);if(_0x26886a['name']){delete _0x26886a[_0xb97d('0x27')];}_0x121765[_0xb97d('0x19')](_0xa5fbed)[_0xb97d('0x28')](_0x26886a);};}exports['index']=function(_0x1a519a,_0x949dd1){var _0x50da08={},_0x499b2c={},_0x5d51bf={'count':0x0,'rows':[]};var _0x2227ed=_[_0xb97d('0x29')](db['JscriptyProject'][_0xb97d('0x2a')],function(_0x577da6){return{'name':_0x577da6['fieldName'],'type':_0x577da6[_0xb97d('0x2b')][_0xb97d('0x2c')]};});_0x499b2c[_0xb97d('0x2d')]=_[_0xb97d('0x29')](_0x2227ed,'name');_0x499b2c[_0xb97d('0x2e')]=_[_0xb97d('0x2f')](_0x1a519a[_0xb97d('0x2e')]);_0x499b2c[_0xb97d('0x30')]=_[_0xb97d('0x31')](_0x499b2c[_0xb97d('0x2d')],_0x499b2c[_0xb97d('0x2e')]);_0x50da08[_0xb97d('0x32')]=_[_0xb97d('0x31')](_0x499b2c['model'],qs[_0xb97d('0x33')](_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x50da08[_0xb97d('0x32')]=_0x50da08[_0xb97d('0x32')]['length']?_0x50da08[_0xb97d('0x32')]:_0x499b2c[_0xb97d('0x2d')];if(!_0x1a519a['query']['hasOwnProperty'](_0xb97d('0x34'))){_0x50da08['limit']=qs[_0xb97d('0x1c')](_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x1c')]);_0x50da08[_0xb97d('0x1b')]=qs['offset'](_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x1b')]);}_0x50da08['order']=qs[_0xb97d('0x35')](_0x1a519a[_0xb97d('0x2e')]['sort']);_0x50da08[_0xb97d('0x36')]=qs[_0xb97d('0x30')](_['pick'](_0x1a519a[_0xb97d('0x2e')],_0x499b2c[_0xb97d('0x30')]),_0x2227ed);if(_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x37')]){_0x50da08[_0xb97d('0x36')]=_[_0xb97d('0x38')](_0x50da08['where'],{'$or':_[_0xb97d('0x29')](_0x2227ed,function(_0x5b313a){if(_0x5b313a[_0xb97d('0x2b')]!=='VIRTUAL'){var _0xf5a069={};_0xf5a069[_0x5b313a[_0xb97d('0x27')]]={'$like':'%'+_0x1a519a['query'][_0xb97d('0x37')]+'%'};return _0xf5a069;}})});}_0x50da08=_[_0xb97d('0x38')]({},_0x50da08,_0x1a519a[_0xb97d('0x39')]);var _0x118824={'where':_0x50da08['where']};return db[_0xb97d('0x3a')]['count'](_0x118824)[_0xb97d('0x21')](function(_0x5967e4){_0x5d51bf['count']=_0x5967e4;if(_0x1a519a[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x50da08[_0xb97d('0x3c')]=[{'all':!![]}];}return db[_0xb97d('0x3a')][_0xb97d('0x3d')](_0x50da08);})[_0xb97d('0x21')](function(_0xa3b813){_0x5d51bf[_0xb97d('0x3e')]=_0xa3b813;return _0x5d51bf;})[_0xb97d('0x21')](respondWithFilteredResult(_0x949dd1,_0x50da08))['catch'](handleError(_0x949dd1,null));};exports['show']=function(_0x3d5372,_0x244cb9){var _0x6c07b5={'raw':![],'where':{'id':_0x3d5372['params']['id']}},_0x1e5162={};_0x1e5162[_0xb97d('0x2d')]=_[_0xb97d('0x2f')](db[_0xb97d('0x3a')]['rawAttributes']);_0x1e5162[_0xb97d('0x2e')]=_[_0xb97d('0x2f')](_0x3d5372[_0xb97d('0x2e')]);_0x1e5162[_0xb97d('0x30')]=_[_0xb97d('0x31')](_0x1e5162[_0xb97d('0x2d')],_0x1e5162[_0xb97d('0x2e')]);_0x6c07b5['attributes']=_[_0xb97d('0x31')](_0x1e5162[_0xb97d('0x2d')],qs[_0xb97d('0x33')](_0x3d5372[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x6c07b5[_0xb97d('0x32')]=_0x6c07b5[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x6c07b5[_0xb97d('0x32')]:_0x1e5162[_0xb97d('0x2d')];if(_0x3d5372[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x6c07b5[_0xb97d('0x3c')]=[{'all':!![]}];}_0x6c07b5=_[_0xb97d('0x38')]({},_0x6c07b5,_0x3d5372['options']);return db[_0xb97d('0x3a')][_0xb97d('0x40')](_0x6c07b5)[_0xb97d('0x21')](handleEntityNotFound(_0x244cb9,null))['then'](respondWithResult(_0x244cb9,null))['catch'](handleError(_0x244cb9,null));};exports[_0xb97d('0x41')]=function(_0x24bddf,_0x481cb4){return db[_0xb97d('0x3a')][_0xb97d('0x41')](_0x24bddf['body'],{})[_0xb97d('0x21')](function(_0x1336d3){var _0x3cfe00=_0x24bddf['user']['get']({'plain':!![]});if(!_0x3cfe00)throw new Error(_0xb97d('0x42'));if(_0x3cfe00[_0xb97d('0x43')]===_0xb97d('0x44')){var _0x4e5ae7=_0x1336d3[_0xb97d('0x45')]({'plain':!![]});var _0x4ca0fe=_0xb97d('0x23');return db[_0xb97d('0x46')]['find']({'where':{'name':_0x4ca0fe,'userProfileId':_0x3cfe00[_0xb97d('0x47')]},'raw':!![]})[_0xb97d('0x21')](function(_0x386b91){if(_0x386b91&&_0x386b91[_0xb97d('0x48')]===0x0){return db['UserProfileResource'][_0xb97d('0x41')]({'name':_0x4e5ae7['name'],'resourceId':_0x4e5ae7['id'],'type':_0x386b91[_0xb97d('0x27')],'sectionId':_0x386b91['id']},{})[_0xb97d('0x21')](function(){return _0x1336d3;});}else{return _0x1336d3;}})['catch'](function(_0x55919f){logger[_0xb97d('0x25')](_0xb97d('0x49'),_0x55919f);throw _0x55919f;});}return _0x1336d3;})[_0xb97d('0x21')](respondWithResult(_0x481cb4,0xc9))[_0xb97d('0x4a')](handleError(_0x481cb4,null));};exports[_0xb97d('0x4b')]=function(_0x5f4e37,_0x3ca690){var _0x298fff={'where':{'id':_0x5f4e37[_0xb97d('0x4c')]['id']}},_0x228209={};_0x228209[_0xb97d('0x2d')]=_[_0xb97d('0x2f')](db[_0xb97d('0x3a')][_0xb97d('0x2a')]);_0x298fff[_0xb97d('0x32')]=_[_0xb97d('0x31')](_0x228209[_0xb97d('0x2d')],qs['fields'](_0x5f4e37[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x298fff[_0xb97d('0x32')]=_0x298fff[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x298fff['attributes']:_0x228209['model'];if(_0x5f4e37[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x298fff[_0xb97d('0x3c')]=[{'all':!![]}];}_0x298fff=_[_0xb97d('0x38')]({},_0x298fff,_0x5f4e37[_0xb97d('0x39')]);return db[_0xb97d('0x3a')]['find'](_0x298fff)[_0xb97d('0x21')](handleEntityNotFound(_0x3ca690,null))[_0xb97d('0x21')](function(_0x454067){if(_0x454067){var _0x58f8b3=_0x454067[_0xb97d('0x45')]({'plain':!![]});_0x58f8b3=qs[_0xb97d('0x4d')](_0x58f8b3,['id',_0xb97d('0x4e'),_0xb97d('0x4f')]);_0x5f4e37[_0xb97d('0x50')]=_[_0xb97d('0x4d')](_0x5f4e37[_0xb97d('0x50')],['id',_0xb97d('0x4e'),_0xb97d('0x4f')]);return db[_0xb97d('0x3a')]['create'](_[_0xb97d('0x38')](_0x58f8b3,_0x5f4e37[_0xb97d('0x50')]),{'include':_0x5f4e37[_0xb97d('0x2e')][_0xb97d('0x3b')]?[{'all':!![]}]:undefined})['then'](function(_0x68ce48){var _0x411744=_0x5f4e37['user'][_0xb97d('0x45')]({'plain':!![]});if(!_0x411744)throw new Error(_0xb97d('0x42'));if(_0x411744['role']==='user'){var _0xa270b5=_0x68ce48['get']({'plain':!![]});var _0x574546=_0xb97d('0x23');return db[_0xb97d('0x46')][_0xb97d('0x40')]({'where':{'name':_0x574546,'userProfileId':_0x411744['userProfileId']},'raw':!![]})[_0xb97d('0x21')](function(_0x653d86){if(_0x653d86&&_0x653d86['autoAssociation']===0x0){return db[_0xb97d('0x24')][_0xb97d('0x41')]({'name':_0xa270b5[_0xb97d('0x27')],'resourceId':_0xa270b5['id'],'type':_0x653d86['name'],'sectionId':_0x653d86['id']},{})[_0xb97d('0x21')](function(){return _0x68ce48;});}else{return _0x68ce48;}})[_0xb97d('0x4a')](function(_0x173da2){logger['error'](_0xb97d('0x49'),_0x173da2);throw _0x173da2;});}return _0x68ce48;});}})[_0xb97d('0x21')](respondWithResult(_0x3ca690,0xc9))[_0xb97d('0x4a')](handleError(_0x3ca690,null));};exports[_0xb97d('0x20')]=function(_0x114c23,_0x30291b){if(_0x114c23['body']['id']){delete _0x114c23[_0xb97d('0x50')]['id'];}return db['JscriptyProject'][_0xb97d('0x40')]({'where':{'id':_0x114c23[_0xb97d('0x4c')]['id']}})[_0xb97d('0x21')](handleEntityNotFound(_0x30291b,null))[_0xb97d('0x21')](saveUpdates(_0x114c23['body'],null))[_0xb97d('0x21')](respondWithResult(_0x30291b,null))[_0xb97d('0x4a')](handleError(_0x30291b,null));};exports[_0xb97d('0x22')]=function(_0x1eed10,_0x21c461){return db[_0xb97d('0x3a')][_0xb97d('0x40')]({'where':{'id':_0x1eed10[_0xb97d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x21c461,null))[_0xb97d('0x21')](removeEntity(_0x21c461,null))[_0xb97d('0x4a')](handleError(_0x21c461,null));};exports[_0xb97d('0x51')]=function(_0x4fd322,_0x1a0a11,_0x233ba9){var _0x127f55={'raw':!![],'where':{}};var _0xce0b29={};var _0x40675b={'count':0x0,'rows':[]};return db[_0xb97d('0x3a')][_0xb97d('0x52')]({'where':{'id':_0x4fd322[_0xb97d('0x4c')]['id']}})[_0xb97d('0x21')](handleEntityNotFound(_0x1a0a11,null))[_0xb97d('0x21')](function(_0x5e4376){if(_0x5e4376){_0xce0b29[_0xb97d('0x2d')]=_['keys'](db[_0xb97d('0x53')]['rawAttributes']);_0xce0b29['query']=_[_0xb97d('0x2f')](_0x4fd322[_0xb97d('0x2e')]);_0xce0b29[_0xb97d('0x30')]=_[_0xb97d('0x31')](_0xce0b29[_0xb97d('0x2d')],_0xce0b29['query']);_0x127f55['attributes']=_[_0xb97d('0x31')](_0xce0b29[_0xb97d('0x2d')],qs['fields'](_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x127f55[_0xb97d('0x32')]=_0x127f55[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x127f55[_0xb97d('0x32')]:_0xce0b29[_0xb97d('0x2d')];if(!_0x4fd322['query'][_0xb97d('0x54')]('nolimit')){_0x127f55[_0xb97d('0x1c')]=qs[_0xb97d('0x1c')](_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x1c')]);_0x127f55[_0xb97d('0x1b')]=qs[_0xb97d('0x1b')](_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x1b')]);}_0x127f55['order']=qs[_0xb97d('0x35')](_0x4fd322['query'][_0xb97d('0x35')]);_0x127f55[_0xb97d('0x36')]=qs[_0xb97d('0x30')](_[_0xb97d('0x55')](_0x4fd322[_0xb97d('0x2e')],_0xce0b29[_0xb97d('0x30')]));_0x127f55[_0xb97d('0x36')][_0xb97d('0x56')]=_0x5e4376['id'];if(_0x4fd322['query']['filter']){_0x127f55['where']=_[_0xb97d('0x38')](_0x127f55['where'],{'$or':_['map'](_0x127f55[_0xb97d('0x32')],function(_0x22262d){var _0x2e70df={};_0x2e70df[_0x22262d]={'$like':'%'+_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x37')]+'%'};return _0x2e70df;})});}_0x127f55=_['merge']({},_0x127f55,_0x4fd322[_0xb97d('0x39')]);return db['JscriptySessionReport'][_0xb97d('0x1e')]({'where':_0x127f55[_0xb97d('0x36')]})[_0xb97d('0x21')](function(_0x5b77d2){_0x40675b['count']=_0x5b77d2;if(_0x4fd322[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x127f55[_0xb97d('0x3c')]=[{'all':!![]}];}return db[_0xb97d('0x53')][_0xb97d('0x3d')](_0x127f55);})[_0xb97d('0x21')](function(_0x1fa78a){_0x40675b['rows']=_0x1fa78a;return _0x40675b;});}})[_0xb97d('0x21')](respondWithFilteredResult(_0x1a0a11,_0x127f55))['catch'](handleError(_0x1a0a11,null));};exports[_0xb97d('0x57')]=function(_0x25c890,_0x1ff63a,_0x4ee1aa){var _0x536452={'raw':!![],'where':{}};var _0x26ede1={};var _0x1aaba7={'count':0x0,'rows':[]};return db[_0xb97d('0x3a')][_0xb97d('0x52')]({'where':{'id':_0x25c890[_0xb97d('0x4c')]['id']}})[_0xb97d('0x21')](handleEntityNotFound(_0x1ff63a,null))[_0xb97d('0x21')](function(_0x50d5c9){if(_0x50d5c9){_0x26ede1[_0xb97d('0x2d')]=_['keys'](db[_0xb97d('0x58')][_0xb97d('0x2a')]);_0x26ede1['query']=_[_0xb97d('0x2f')](_0x25c890['query']);_0x26ede1['filters']=_['intersection'](_0x26ede1[_0xb97d('0x2d')],_0x26ede1['query']);_0x536452[_0xb97d('0x32')]=_[_0xb97d('0x31')](_0x26ede1['model'],qs['fields'](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x33')]));_0x536452[_0xb97d('0x32')]=_0x536452[_0xb97d('0x32')][_0xb97d('0x3f')]?_0x536452[_0xb97d('0x32')]:_0x26ede1[_0xb97d('0x2d')];if(!_0x25c890[_0xb97d('0x2e')][_0xb97d('0x54')](_0xb97d('0x34'))){_0x536452['limit']=qs[_0xb97d('0x1c')](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x1c')]);_0x536452['offset']=qs['offset'](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x1b')]);}_0x536452['order']=qs[_0xb97d('0x35')](_0x25c890[_0xb97d('0x2e')][_0xb97d('0x35')]);_0x536452[_0xb97d('0x36')]=qs['filters'](_[_0xb97d('0x55')](_0x25c890[_0xb97d('0x2e')],_0x26ede1[_0xb97d('0x30')]));_0x536452['where'][_0xb97d('0x56')]=_0x50d5c9['id'];if(_0x25c890['query']['filter']){_0x536452[_0xb97d('0x36')]=_['merge'](_0x536452[_0xb97d('0x36')],{'$or':_[_0xb97d('0x29')](_0x536452[_0xb97d('0x32')],function(_0x53e142){var _0x4d15ba={};_0x4d15ba[_0x53e142]={'$like':'%'+_0x25c890['query'][_0xb97d('0x37')]+'%'};return _0x4d15ba;})});}_0x536452=_[_0xb97d('0x38')]({},_0x536452,_0x25c890[_0xb97d('0x39')]);return db[_0xb97d('0x58')][_0xb97d('0x1e')]({'where':_0x536452[_0xb97d('0x36')]})['then'](function(_0x3d2f90){_0x1aaba7[_0xb97d('0x1e')]=_0x3d2f90;if(_0x25c890[_0xb97d('0x2e')][_0xb97d('0x3b')]){_0x536452['include']=[{'all':!![]}];}return db[_0xb97d('0x58')]['findAll'](_0x536452);})[_0xb97d('0x21')](function(_0x1b63f4){_0x1aaba7[_0xb97d('0x3e')]=_0x1b63f4;return _0x1aaba7;});}})[_0xb97d('0x21')](respondWithFilteredResult(_0x1ff63a,_0x536452))['catch'](handleError(_0x1ff63a,null));};function char(_0x3dbbf4){return _0xb97d('0x59')===typeof _0x3dbbf4?String[_0xb97d('0x5a')][_0xb97d('0x5b')](null,arguments):_0x3dbbf4;}function needsEncapsulation(_0x3743a0){return!!_0x3743a0&&(_0x3743a0[_0xb97d('0x5c')]()[_0xb97d('0x5d')](char(0xd))>=0x0||_0x3743a0[_0xb97d('0x5c')]()[_0xb97d('0x5d')](char(0xa))>=0x0||_0x3743a0['toString']()[_0xb97d('0x5d')](char(0x2c))>=0x0||_0x3743a0['toString']()[_0xb97d('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x5500e8){var _0x3b7ac7=char(0x22),_0x41cdf9='\x5c'+char(0x22),_0xba43b5=_0x5500e8[_0xb97d('0x5c')]()[_0xb97d('0x5e')](new RegExp(_0x3b7ac7,'g'),_0x41cdf9);return _0x3b7ac7+_0xba43b5+_0x3b7ac7;}exports['getSummary']=function(_0x4d1552,_0x1a5d85,_0x59a518){var _0x4aab4f,_0x57957a;var _0x6f0066={'where':{'ProjectId':_0x4d1552[_0xb97d('0x4c')]['id']}};if(_0x4d1552[_0xb97d('0x2e')]['startTime']){_0x6f0066[_0xb97d('0x36')][_0xb97d('0x5f')]=JSON['parse'](_0x4d1552[_0xb97d('0x2e')][_0xb97d('0x60')]);}return db[_0xb97d('0x53')][_0xb97d('0x3d')](_0x6f0066)[_0xb97d('0x21')](handleEntityNotFound(_0x1a5d85,null))[_0xb97d('0x21')](function(_0x537be3){if(_0x537be3){_0x4aab4f=_0x537be3;return db['JscriptyQuestionReport'][_0xb97d('0x3d')]({'where':{'SessionId':{'$in':_[_0xb97d('0x29')](_0x4aab4f,'id')},'ProjectId':_0x4d1552[_0xb97d('0x4c')]['id']},'order':_0xb97d('0x61')});}})[_0xb97d('0x21')](handleEntityNotFound(_0x1a5d85,null))[_0xb97d('0x21')](function(_0x41d537){if(_0x41d537){_0x57957a=_0x41d537;var _0x489ffa={};for(var _0x34d3d4=0x0,_0x3be837=_0x57957a[_0xb97d('0x3f')];_0x34d3d4<_0x3be837;_0x34d3d4++){if(!_0x489ffa[_0xb97d('0x54')](_0x57957a[_0x34d3d4][_0xb97d('0x62')])){_0x489ffa[_0x57957a[_0x34d3d4]['questionId']]=needsEncapsulation(_0x57957a[_0x34d3d4][_0xb97d('0x63')])?encapsulate(_0x57957a[_0x34d3d4]['question']):_0x57957a[_0x34d3d4][_0xb97d('0x63')];}}var _0x45176a=[],_0xdb6d22={};for(var _0x320a7d=0x0,_0x3876a8=_0x4aab4f[_0xb97d('0x3f')];_0x320a7d<_0x3876a8;_0x320a7d++){_0xdb6d22={'ProjectId':_0x4d1552[_0xb97d('0x4c')]['id'],'SessionId':_0x4aab4f[_0x320a7d]['id'],'StartTime':moment(_0x4aab4f[_0x320a7d][_0xb97d('0x5f')])[_0xb97d('0x64')](_0xb97d('0x65'))};for(var _0xa9f55d=0x0,_0x3d28e9=_0x57957a[_0xb97d('0x3f')];_0xa9f55d<_0x3d28e9;_0xa9f55d++){if(_0x57957a[_0xa9f55d][_0xb97d('0x66')]==_0x4aab4f[_0x320a7d]['id']&&_0x489ffa['hasOwnProperty'](_0x57957a[_0xa9f55d][_0xb97d('0x62')])){_0xdb6d22[_0x489ffa[_0x57957a[_0xa9f55d][_0xb97d('0x62')]]]=_0x57957a[_0xa9f55d][_0xb97d('0x67')];}}for(var _0x1d389c in _0x489ffa){if(!_0xdb6d22['hasOwnProperty'](_0x489ffa[_0x1d389c])){_0xdb6d22[_0x489ffa[_0x1d389c]]=null;}}_0x45176a[_0xb97d('0x68')](_0xdb6d22);}return _0x45176a;}})[_0xb97d('0x21')](function(_0xb74d87){if(!_['isEmpty'](_0xb74d87)){var _0x30fd45=toCsv(_0xb74d87);var _0x3f9fb0=Date[_0xb97d('0x69')]();fs[_0xb97d('0x6a')](util[_0xb97d('0x64')](_0xb97d('0x6b'),_0x4d1552[_0xb97d('0x4c')]['id'],_0x3f9fb0),_0x30fd45);_0x1a5d85[_0xb97d('0x6c')](_0xb97d('0x6d'),_0xb97d('0x6e')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4d1552[_0xb97d('0x4c')]['id'],_0x3f9fb0));_0x1a5d85[_0xb97d('0x6c')](_0xb97d('0x6f'),_0xb97d('0x70'));return _0x1a5d85[_0xb97d('0x71')](util[_0xb97d('0x64')](_0xb97d('0x6b'),_0x4d1552[_0xb97d('0x4c')]['id'],_0x3f9fb0));}else{return _0x1a5d85[_0xb97d('0x18')](0xcc);}})[_0xb97d('0x4a')](handleError(_0x1a5d85,null));}; \ No newline at end of file +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 diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 95c9345..436a60b 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 _0xfd0f=['bluebird','path','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','util','api','moment'];(function(_0x3f2302,_0x3c3363){var _0x55fed4=function(_0x14d32e){while(--_0x14d32e){_0x3f2302['push'](_0x3f2302['shift']());}};_0x55fed4(++_0x3c3363);}(_0xfd0f,0x1b8));var _0xffd0=function(_0xae596a,_0x5ed8d6){_0xae596a=_0xae596a-0x0;var _0x59bc6d=_0xfd0f[_0xae596a];return _0x59bc6d;};'use strict';var _=require(_0xffd0('0x0'));var util=require(_0xffd0('0x1'));var logger=require('../../config/logger')(_0xffd0('0x2'));var moment=require(_0xffd0('0x3'));var BPromise=require(_0xffd0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xffd0('0x5'));var rimraf=require('rimraf');var config=require(_0xffd0('0x6'));var attributes=require(_0xffd0('0x7'));module[_0xffd0('0x8')]=function(_0x9e9c1f,_0xd7f075){return _0x9e9c1f[_0xffd0('0x9')](_0xffd0('0xa'),attributes,{'tableName':_0xffd0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index c9e9693..dfd55fb 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x14c912,_0x50827d){var _0x16771d=function(_0x3568eb){while(--_0x3568eb){_0x14c912['push'](_0x14c912['shift']());}};_0x16771d(++_0x50827d);}(_0x9c44,0x178));var _0x49c4=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x9c44[_0x2d7f0e];return _0x110b07;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 4e394b7..e1627a2 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 _0x40a7=['../../components/auth/service','../../components/interaction/service','../../config/environment','/describe','isAuthenticated','get','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0x40a7,0x19d));var _0x740a=function(_0x2cb368,_0x131312){_0x2cb368=_0x2cb368-0x0;var _0x44b4d6=_0x40a7[_0x2cb368];return _0x44b4d6;};'use strict';var multer=require(_0x740a('0x0'));var util=require(_0x740a('0x1'));var path=require(_0x740a('0x2'));var timeout=require(_0x740a('0x3'));var express=require('express');var router=express[_0x740a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x740a('0x5'));var interaction=require(_0x740a('0x6'));var config=require(_0x740a('0x7'));var controller=require('./jscriptyQuestionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x740a('0x8'),auth[_0x740a('0x9')](),controller['describe']);router[_0x740a('0xa')](_0x740a('0xb'),auth[_0x740a('0x9')](),controller[_0x740a('0xc')]);router[_0x740a('0xd')]('/',auth['isAuthenticated'](),controller[_0x740a('0xe')]);router[_0x740a('0xf')](_0x740a('0xb'),auth[_0x740a('0x9')](),controller['update']);router[_0x740a('0x10')](_0x740a('0xb'),auth[_0x740a('0x9')](),controller[_0x740a('0x11')]);module[_0x740a('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 94f3e58..36a93f4 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(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x7a54,0x106));var _0x47a5=function(_0x8d519c,_0xf6a023){_0x8d519c=_0x8d519c-0x0;var _0x2ce180=_0x7a54[_0x8d519c];return _0x2ce180;};'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(_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 diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index b2d494e..e2aa6bd 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 _0x3f97=['squel','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','stack','name','map','JscriptyQuestionReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','merge','where','type','VIRTUAL','options','includeAll','rows','show','params','keys','include','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','fs-extra','lodash'];(function(_0x1dbe00,_0x3a2ce2){var _0x1143b7=function(_0x1e3059){while(--_0x1e3059){_0x1dbe00['push'](_0x1dbe00['shift']());}};_0x1143b7(++_0x3a2ce2);}(_0x3f97,0xc1));var _0x73f9=function(_0x595f6d,_0x209553){_0x595f6d=_0x595f6d-0x0;var _0x4fbb09=_0x3f97[_0x595f6d];return _0x4fbb09;};'use strict';var emlformat=require(_0x73f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x73f9('0x1'));var jsonpatch=require(_0x73f9('0x2'));var rp=require(_0x73f9('0x3'));var moment=require('moment');var BPromise=require(_0x73f9('0x4'));var Mustache=require('mustache');var util=require(_0x73f9('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x73f9('0x6'));var _=require(_0x73f9('0x7'));var squel=require(_0x73f9('0x8'));var crypto=require(_0x73f9('0x9'));var jsforce=require(_0x73f9('0xa'));var deskjs=require(_0x73f9('0xb'));var toCsv=require(_0x73f9('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x73f9('0xd'));var as=require(_0x73f9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73f9('0xf'))(_0x73f9('0x10'));var utils=require(_0x73f9('0x11'));var config=require(_0x73f9('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x73f9('0x13'))['db'];function respondWithStatusCode(_0x359ca7,_0x5f04f9){_0x5f04f9=_0x5f04f9||0xcc;return function(_0x2bc7c0){if(_0x2bc7c0){return _0x359ca7[_0x73f9('0x14')](_0x5f04f9);}return _0x359ca7[_0x73f9('0x15')](_0x5f04f9)[_0x73f9('0x16')]();};}function respondWithResult(_0x283c7e,_0x1a7896){_0x1a7896=_0x1a7896||0xc8;return function(_0x3fcddf){if(_0x3fcddf){return _0x283c7e[_0x73f9('0x15')](_0x1a7896)['json'](_0x3fcddf);}};}function respondWithFilteredResult(_0x359ea3,_0x57f038){return function(_0x3c2f4d){if(_0x3c2f4d){var _0x5f3600=typeof _0x57f038[_0x73f9('0x17')]===_0x73f9('0x18')&&typeof _0x57f038[_0x73f9('0x19')]===_0x73f9('0x18');var _0x3e472b=_0x3c2f4d[_0x73f9('0x1a')];var _0x419fe5=_0x5f3600?0x0:_0x57f038[_0x73f9('0x17')];var _0x4f518c=_0x5f3600?_0x3c2f4d[_0x73f9('0x1a')]:_0x57f038[_0x73f9('0x17')]+_0x57f038[_0x73f9('0x19')];var _0x436e08;if(_0x4f518c>=_0x3e472b){_0x4f518c=_0x3e472b;_0x436e08=0xc8;}else{_0x436e08=0xce;}_0x359ea3[_0x73f9('0x15')](_0x436e08);return _0x359ea3['set'](_0x73f9('0x1b'),_0x419fe5+'-'+_0x4f518c+'/'+_0x3e472b)[_0x73f9('0x1c')](_0x3c2f4d);}return null;};}function patchUpdates(_0x838192){return function(_0x1c24c8){try{jsonpatch['apply'](_0x1c24c8,_0x838192,!![]);}catch(_0x234def){return BPromise[_0x73f9('0x1d')](_0x234def);}return _0x1c24c8[_0x73f9('0x1e')]();};}function saveUpdates(_0x30c9f9,_0x8206b8){return function(_0x581877){if(_0x581877){return _0x581877[_0x73f9('0x1f')](_0x30c9f9)[_0x73f9('0x20')](function(_0x4ebba3){return _0x4ebba3;});}return null;};}function removeEntity(_0x13ff92,_0x363456){return function(_0x231979){if(_0x231979){return _0x231979[_0x73f9('0x21')]()[_0x73f9('0x20')](function(){_0x13ff92[_0x73f9('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fb845,_0x5e38c2){return function(_0x253657){if(!_0x253657){_0x1fb845[_0x73f9('0x14')](0x194);}return _0x253657;};}function handleError(_0x596193,_0x5e25d0){_0x5e25d0=_0x5e25d0||0x1f4;return function(_0x1e431f){logger['error'](_0x1e431f[_0x73f9('0x22')]);if(_0x1e431f['name']){delete _0x1e431f[_0x73f9('0x23')];}_0x596193[_0x73f9('0x15')](_0x5e25d0)['send'](_0x1e431f);};}exports['index']=function(_0x5d5570,_0x3c3047){var _0x3700ab={},_0x4f12b4={},_0x2f4b91={'count':0x0,'rows':[]};var _0x19c315=_[_0x73f9('0x24')](db[_0x73f9('0x25')][_0x73f9('0x26')],function(_0x76f74e){return{'name':_0x76f74e[_0x73f9('0x27')],'type':_0x76f74e['type'][_0x73f9('0x28')]};});_0x4f12b4[_0x73f9('0x29')]=_[_0x73f9('0x24')](_0x19c315,_0x73f9('0x23'));_0x4f12b4[_0x73f9('0x2a')]=_['keys'](_0x5d5570[_0x73f9('0x2a')]);_0x4f12b4[_0x73f9('0x2b')]=_[_0x73f9('0x2c')](_0x4f12b4[_0x73f9('0x29')],_0x4f12b4[_0x73f9('0x2a')]);_0x3700ab[_0x73f9('0x2d')]=_[_0x73f9('0x2c')](_0x4f12b4[_0x73f9('0x29')],qs[_0x73f9('0x2e')](_0x5d5570[_0x73f9('0x2a')][_0x73f9('0x2e')]));_0x3700ab[_0x73f9('0x2d')]=_0x3700ab['attributes'][_0x73f9('0x2f')]?_0x3700ab['attributes']:_0x4f12b4[_0x73f9('0x29')];if(!_0x5d5570[_0x73f9('0x2a')][_0x73f9('0x30')]('nolimit')){_0x3700ab[_0x73f9('0x19')]=qs[_0x73f9('0x19')](_0x5d5570[_0x73f9('0x2a')][_0x73f9('0x19')]);_0x3700ab['offset']=qs[_0x73f9('0x17')](_0x5d5570[_0x73f9('0x2a')]['offset']);}_0x3700ab['order']=qs[_0x73f9('0x31')](_0x5d5570['query'][_0x73f9('0x31')]);_0x3700ab['where']=qs[_0x73f9('0x2b')](_['pick'](_0x5d5570[_0x73f9('0x2a')],_0x4f12b4[_0x73f9('0x2b')]),_0x19c315);if(_0x5d5570[_0x73f9('0x2a')][_0x73f9('0x32')]){_0x3700ab['where']=_[_0x73f9('0x33')](_0x3700ab[_0x73f9('0x34')],{'$or':_[_0x73f9('0x24')](_0x19c315,function(_0x5790df){if(_0x5790df[_0x73f9('0x35')]!==_0x73f9('0x36')){var _0x248b14={};_0x248b14[_0x5790df['name']]={'$like':'%'+_0x5d5570['query'][_0x73f9('0x32')]+'%'};return _0x248b14;}})});}_0x3700ab=_['merge']({},_0x3700ab,_0x5d5570[_0x73f9('0x37')]);var _0x593d58={'where':_0x3700ab[_0x73f9('0x34')]};return db[_0x73f9('0x25')]['count'](_0x593d58)['then'](function(_0x42f74f){_0x2f4b91[_0x73f9('0x1a')]=_0x42f74f;if(_0x5d5570['query'][_0x73f9('0x38')]){_0x3700ab['include']=[{'all':!![]}];}return db[_0x73f9('0x25')]['findAll'](_0x3700ab);})[_0x73f9('0x20')](function(_0x4917eb){_0x2f4b91[_0x73f9('0x39')]=_0x4917eb;return _0x2f4b91;})[_0x73f9('0x20')](respondWithFilteredResult(_0x3c3047,_0x3700ab))['catch'](handleError(_0x3c3047,null));};exports[_0x73f9('0x3a')]=function(_0x3f626b,_0x4271af){var _0x255e0e={'raw':!![],'where':{'id':_0x3f626b[_0x73f9('0x3b')]['id']}},_0x3fe8a0={};_0x3fe8a0[_0x73f9('0x29')]=_[_0x73f9('0x3c')](db['JscriptyQuestionReport']['rawAttributes']);_0x3fe8a0['query']=_[_0x73f9('0x3c')](_0x3f626b[_0x73f9('0x2a')]);_0x3fe8a0[_0x73f9('0x2b')]=_[_0x73f9('0x2c')](_0x3fe8a0[_0x73f9('0x29')],_0x3fe8a0[_0x73f9('0x2a')]);_0x255e0e[_0x73f9('0x2d')]=_[_0x73f9('0x2c')](_0x3fe8a0['model'],qs[_0x73f9('0x2e')](_0x3f626b[_0x73f9('0x2a')][_0x73f9('0x2e')]));_0x255e0e[_0x73f9('0x2d')]=_0x255e0e[_0x73f9('0x2d')][_0x73f9('0x2f')]?_0x255e0e['attributes']:_0x3fe8a0[_0x73f9('0x29')];if(_0x3f626b[_0x73f9('0x2a')][_0x73f9('0x38')]){_0x255e0e[_0x73f9('0x3d')]=[{'all':!![]}];}_0x255e0e=_['merge']({},_0x255e0e,_0x3f626b['options']);return db[_0x73f9('0x25')][_0x73f9('0x3e')](_0x255e0e)[_0x73f9('0x20')](handleEntityNotFound(_0x4271af,null))[_0x73f9('0x20')](respondWithResult(_0x4271af,null))[_0x73f9('0x3f')](handleError(_0x4271af,null));};exports[_0x73f9('0x40')]=function(_0x4e4e7a,_0x4d5146){return db['JscriptyQuestionReport']['create'](_0x4e4e7a[_0x73f9('0x41')],{})['then'](respondWithResult(_0x4d5146,0xc9))[_0x73f9('0x3f')](handleError(_0x4d5146,null));};exports[_0x73f9('0x1f')]=function(_0x4d9705,_0xce5a8d){if(_0x4d9705[_0x73f9('0x41')]['id']){delete _0x4d9705[_0x73f9('0x41')]['id'];}return db[_0x73f9('0x25')]['find']({'where':{'id':_0x4d9705[_0x73f9('0x3b')]['id']}})[_0x73f9('0x20')](handleEntityNotFound(_0xce5a8d,null))[_0x73f9('0x20')](saveUpdates(_0x4d9705[_0x73f9('0x41')],null))['then'](respondWithResult(_0xce5a8d,null))[_0x73f9('0x3f')](handleError(_0xce5a8d,null));};exports['destroy']=function(_0x4cc718,_0x349c0a){return db['JscriptyQuestionReport'][_0x73f9('0x3e')]({'where':{'id':_0x4cc718[_0x73f9('0x3b')]['id']}})[_0x73f9('0x20')](handleEntityNotFound(_0x349c0a,null))['then'](removeEntity(_0x349c0a,null))['catch'](handleError(_0x349c0a,null));};exports[_0x73f9('0x42')]=function(_0x6a9164,_0x4a6c89){return db[_0x73f9('0x25')][_0x73f9('0x42')]()[_0x73f9('0x20')](respondWithResult(_0x4a6c89,null))[_0x73f9('0x3f')](handleError(_0x4a6c89,null));}; \ No newline at end of file +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 diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 2cb1aa8..b545cd7 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 _0x02e9=['./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','moment','request-promise','path','rimraf'];(function(_0x2aed09,_0x165d4a){var _0x2ea9c4=function(_0x154fe8){while(--_0x154fe8){_0x2aed09['push'](_0x2aed09['shift']());}};_0x2ea9c4(++_0x165d4a);}(_0x02e9,0xec));var _0x902e=function(_0xa2531c,_0x3a6fc3){_0xa2531c=_0xa2531c-0x0;var _0x352bdd=_0x02e9[_0xa2531c];return _0x352bdd;};'use strict';var _=require(_0x902e('0x0'));var util=require(_0x902e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x902e('0x2'));var BPromise=require('bluebird');var rp=require(_0x902e('0x3'));var fs=require('fs');var path=require(_0x902e('0x4'));var rimraf=require(_0x902e('0x5'));var config=require('../../config/environment');var attributes=require(_0x902e('0x6'));module[_0x902e('0x7')]=function(_0x31f985,_0x3672c0){return _0x31f985[_0x902e('0x8')](_0x902e('0x9'),attributes,{'tableName':_0x902e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 2a4ea6a..9884539 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 _0xfdf8=['request','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfdf8,0x198));var _0x8fdf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfdf8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8fdf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8fdf('0x1'));var fs=require('fs');var Redis=require(_0x8fdf('0x2'));var db=require(_0x8fdf('0x3'))['db'];var utils=require(_0x8fdf('0x4'));var logger=require('../../config/logger')(_0x8fdf('0x5'));var config=require(_0x8fdf('0x6'));var jayson=require(_0x8fdf('0x7'));var client=jayson[_0x8fdf('0x8')][_0x8fdf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb91194,_0x305ec9,_0x53d068){return new BPromise(function(_0x2902f2,_0x45c36d){return client[_0x8fdf('0xa')](_0xb91194,_0x53d068)[_0x8fdf('0xb')](function(_0x4a0c7f){logger['info'](_0x8fdf('0xc'),_0x305ec9,_0x8fdf('0xd'));logger[_0x8fdf('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x305ec9,_0x8fdf('0xd'),JSON[_0x8fdf('0xf')](_0x4a0c7f));if(_0x4a0c7f[_0x8fdf('0x10')]){if(_0x4a0c7f[_0x8fdf('0x10')][_0x8fdf('0x11')]===0x1f4){logger[_0x8fdf('0x10')](_0x8fdf('0xc'),_0x305ec9,_0x4a0c7f['error'][_0x8fdf('0x12')]);return _0x45c36d(_0x4a0c7f[_0x8fdf('0x10')][_0x8fdf('0x12')]);}logger[_0x8fdf('0x10')](_0x8fdf('0xc'),_0x305ec9,_0x4a0c7f['error'][_0x8fdf('0x12')]);return _0x2902f2(_0x4a0c7f['error']['message']);}else{logger[_0x8fdf('0x13')](_0x8fdf('0xc'),_0x305ec9,_0x8fdf('0xd'));_0x2902f2(_0x4a0c7f[_0x8fdf('0x14')][_0x8fdf('0x12')]);}})[_0x8fdf('0x15')](function(_0x2c5579){logger[_0x8fdf('0x10')](_0x8fdf('0xc'),_0x305ec9,_0x2c5579);_0x45c36d(_0x2c5579);});});} \ No newline at end of file +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 diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 63a54b3..a88e77d 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 _0xfbfe=['util','path','express','../../components/auth/service','../../config/environment','./jscriptySessionReport.controller','get','index','/describe','isAuthenticated','show','/:id/questions','getQuestions','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x384947,_0x28c53c){var _0x3aa557=function(_0xa2e35d){while(--_0xa2e35d){_0x384947['push'](_0x384947['shift']());}};_0x3aa557(++_0x28c53c);}(_0xfbfe,0x149));var _0xefbf=function(_0x3fa77d,_0x2983e1){_0x3fa77d=_0x3fa77d-0x0;var _0x5edf08=_0xfbfe[_0x3fa77d];return _0x5edf08;};'use strict';var multer=require(_0xefbf('0x0'));var util=require(_0xefbf('0x1'));var path=require(_0xefbf('0x2'));var timeout=require('connect-timeout');var express=require(_0xefbf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xefbf('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xefbf('0x5'));var controller=require(_0xefbf('0x6'));router[_0xefbf('0x7')]('/',auth['isAuthenticated'](),controller[_0xefbf('0x8')]);router['get'](_0xefbf('0x9'),auth[_0xefbf('0xa')](),controller['describe']);router[_0xefbf('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xefbf('0xb')]);router[_0xefbf('0x7')](_0xefbf('0xc'),auth[_0xefbf('0xa')](),controller[_0xefbf('0xd')]);router[_0xefbf('0xe')]('/',auth[_0xefbf('0xa')](),controller[_0xefbf('0xf')]);router[_0xefbf('0x10')]('/:id',auth[_0xefbf('0xa')](),controller[_0xefbf('0x11')]);router[_0xefbf('0x12')](_0xefbf('0x13'),auth[_0xefbf('0xa')](),controller[_0xefbf('0x14')]);module[_0xefbf('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index e8e0dbd..d490f00 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 _0xf25b=['sequelize','DATE','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x59f3df,_0x9cd973){var _0x5abf84=function(_0x7f8d70){while(--_0x7f8d70){_0x59f3df['push'](_0x59f3df['shift']());}};_0x5abf84(++_0x9cd973);}(_0xf25b,0x196));var _0xbf25=function(_0x5619f7,_0x1f8997){_0x5619f7=_0x5619f7-0x0;var _0x2fb5af=_0xf25b[_0x5619f7];return _0x2fb5af;};'use strict';var moment=require('moment');var Sequelize=require(_0xbf25('0x0'));module['exports']={'starttime':{'type':Sequelize[_0xbf25('0x1')],'set':function(_0x533702){this[_0xbf25('0x2')]('starttime',_0x533702);this[_0xbf25('0x2')](_0xbf25('0x3'),moment()['format'](_0xbf25('0x4')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xbf25('0x5')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbf25('0x5')]},'calleridnum':{'type':Sequelize[_0xbf25('0x5')]},'completed':{'type':Sequelize[_0xbf25('0x6')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 57e2797..e99d131 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 _0x1c37=['merge','options','includeAll','include','rows','catch','params','find','create','body','destroy','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL'];(function(_0x3b2c83,_0x13f538){var _0x4ff9cb=function(_0x424c3a){while(--_0x424c3a){_0x3b2c83['push'](_0x3b2c83['shift']());}};_0x4ff9cb(++_0x13f538);}(_0x1c37,0x157));var _0x71c3=function(_0xd093e1,_0x13c785){_0xd093e1=_0xd093e1-0x0;var _0x6e5988=_0x1c37[_0xd093e1];return _0x6e5988;};'use strict';var emlformat=require(_0x71c3('0x0'));var rimraf=require(_0x71c3('0x1'));var zipdir=require(_0x71c3('0x2'));var jsonpatch=require(_0x71c3('0x3'));var rp=require(_0x71c3('0x4'));var moment=require(_0x71c3('0x5'));var BPromise=require(_0x71c3('0x6'));var Mustache=require(_0x71c3('0x7'));var util=require(_0x71c3('0x8'));var path=require(_0x71c3('0x9'));var sox=require(_0x71c3('0xa'));var csv=require('to-csv');var ejs=require(_0x71c3('0xb'));var fs=require('fs');var fs_extra=require(_0x71c3('0xc'));var _=require('lodash');var squel=require(_0x71c3('0xd'));var crypto=require(_0x71c3('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x71c3('0xf'));var toCsv=require(_0x71c3('0x10'));var querystring=require(_0x71c3('0x11'));var Papa=require(_0x71c3('0x12'));var Redis=require('ioredis');var authService=require(_0x71c3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x71c3('0x14'));var hardwareService=require(_0x71c3('0x15'));var logger=require(_0x71c3('0x16'))(_0x71c3('0x17'));var utils=require('../../config/utils');var config=require(_0x71c3('0x18'));var licenseUtil=require(_0x71c3('0x19'));var db=require(_0x71c3('0x1a'))['db'];function respondWithStatusCode(_0x566e61,_0x22d36f){_0x22d36f=_0x22d36f||0xcc;return function(_0x298b07){if(_0x298b07){return _0x566e61[_0x71c3('0x1b')](_0x22d36f);}return _0x566e61[_0x71c3('0x1c')](_0x22d36f)[_0x71c3('0x1d')]();};}function respondWithResult(_0x2ee4cb,_0x298f95){_0x298f95=_0x298f95||0xc8;return function(_0x3e9397){if(_0x3e9397){return _0x2ee4cb[_0x71c3('0x1c')](_0x298f95)[_0x71c3('0x1e')](_0x3e9397);}};}function respondWithFilteredResult(_0x3fa6cc,_0x46c0ec){return function(_0x7c05e6){if(_0x7c05e6){var _0x42b5b8=typeof _0x46c0ec['offset']===_0x71c3('0x1f')&&typeof _0x46c0ec['limit']===_0x71c3('0x1f');var _0x35ab85=_0x7c05e6[_0x71c3('0x20')];var _0x1cbd72=_0x42b5b8?0x0:_0x46c0ec[_0x71c3('0x21')];var _0x35a7be=_0x42b5b8?_0x7c05e6[_0x71c3('0x20')]:_0x46c0ec[_0x71c3('0x21')]+_0x46c0ec[_0x71c3('0x22')];var _0x54a59a;if(_0x35a7be>=_0x35ab85){_0x35a7be=_0x35ab85;_0x54a59a=0xc8;}else{_0x54a59a=0xce;}_0x3fa6cc['status'](_0x54a59a);return _0x3fa6cc['set'](_0x71c3('0x23'),_0x1cbd72+'-'+_0x35a7be+'/'+_0x35ab85)[_0x71c3('0x1e')](_0x7c05e6);}return null;};}function patchUpdates(_0x5cbc90){return function(_0xbb742e){try{jsonpatch[_0x71c3('0x24')](_0xbb742e,_0x5cbc90,!![]);}catch(_0x20a0ba){return BPromise[_0x71c3('0x25')](_0x20a0ba);}return _0xbb742e[_0x71c3('0x26')]();};}function saveUpdates(_0x49e6ae,_0x1612ec){return function(_0x394733){if(_0x394733){return _0x394733[_0x71c3('0x27')](_0x49e6ae)[_0x71c3('0x28')](function(_0x256d58){return _0x256d58;});}return null;};}function removeEntity(_0x47384e,_0x75f6a6){return function(_0x4d0cd7){if(_0x4d0cd7){return _0x4d0cd7['destroy']()[_0x71c3('0x28')](function(){_0x47384e[_0x71c3('0x1c')](0xcc)[_0x71c3('0x1d')]();});}};}function handleEntityNotFound(_0x2e46a0,_0x432bfc){return function(_0x34349d){if(!_0x34349d){_0x2e46a0[_0x71c3('0x1b')](0x194);}return _0x34349d;};}function handleError(_0x2d169e,_0x1f5bfe){_0x1f5bfe=_0x1f5bfe||0x1f4;return function(_0x26ada2){logger[_0x71c3('0x29')](_0x26ada2[_0x71c3('0x2a')]);if(_0x26ada2[_0x71c3('0x2b')]){delete _0x26ada2[_0x71c3('0x2b')];}_0x2d169e[_0x71c3('0x1c')](_0x1f5bfe)[_0x71c3('0x2c')](_0x26ada2);};}exports[_0x71c3('0x2d')]=function(_0x10f901,_0x325920){var _0x5b8e2f={},_0x4e2195={},_0x2a1657={'count':0x0,'rows':[]};var _0x364b37=_[_0x71c3('0x2e')](db[_0x71c3('0x2f')][_0x71c3('0x30')],function(_0x5c7281){return{'name':_0x5c7281[_0x71c3('0x31')],'type':_0x5c7281[_0x71c3('0x32')][_0x71c3('0x33')]};});_0x4e2195[_0x71c3('0x34')]=_[_0x71c3('0x2e')](_0x364b37,'name');_0x4e2195[_0x71c3('0x35')]=_[_0x71c3('0x36')](_0x10f901['query']);_0x4e2195[_0x71c3('0x37')]=_['intersection'](_0x4e2195['model'],_0x4e2195[_0x71c3('0x35')]);_0x5b8e2f[_0x71c3('0x38')]=_[_0x71c3('0x39')](_0x4e2195[_0x71c3('0x34')],qs[_0x71c3('0x3a')](_0x10f901[_0x71c3('0x35')]['fields']));_0x5b8e2f[_0x71c3('0x38')]=_0x5b8e2f['attributes'][_0x71c3('0x3b')]?_0x5b8e2f[_0x71c3('0x38')]:_0x4e2195[_0x71c3('0x34')];if(!_0x10f901[_0x71c3('0x35')][_0x71c3('0x3c')]('nolimit')){_0x5b8e2f[_0x71c3('0x22')]=qs[_0x71c3('0x22')](_0x10f901[_0x71c3('0x35')]['limit']);_0x5b8e2f[_0x71c3('0x21')]=qs[_0x71c3('0x21')](_0x10f901[_0x71c3('0x35')][_0x71c3('0x21')]);}_0x5b8e2f[_0x71c3('0x3d')]=qs['sort'](_0x10f901[_0x71c3('0x35')][_0x71c3('0x3e')]);_0x5b8e2f[_0x71c3('0x3f')]=qs[_0x71c3('0x37')](_[_0x71c3('0x40')](_0x10f901[_0x71c3('0x35')],_0x4e2195['filters']),_0x364b37);if(_0x10f901[_0x71c3('0x35')][_0x71c3('0x41')]){_0x5b8e2f['where']=_['merge'](_0x5b8e2f['where'],{'$or':_[_0x71c3('0x2e')](_0x364b37,function(_0x58a5ea){if(_0x58a5ea['type']!==_0x71c3('0x42')){var _0x20bb8a={};_0x20bb8a[_0x58a5ea[_0x71c3('0x2b')]]={'$like':'%'+_0x10f901[_0x71c3('0x35')][_0x71c3('0x41')]+'%'};return _0x20bb8a;}})});}_0x5b8e2f=_[_0x71c3('0x43')]({},_0x5b8e2f,_0x10f901[_0x71c3('0x44')]);var _0x421350={'where':_0x5b8e2f['where']};return db[_0x71c3('0x2f')]['count'](_0x421350)[_0x71c3('0x28')](function(_0x1c0651){_0x2a1657[_0x71c3('0x20')]=_0x1c0651;if(_0x10f901['query'][_0x71c3('0x45')]){_0x5b8e2f[_0x71c3('0x46')]=[{'all':!![]}];}return db[_0x71c3('0x2f')]['findAll'](_0x5b8e2f);})[_0x71c3('0x28')](function(_0x407297){_0x2a1657[_0x71c3('0x47')]=_0x407297;return _0x2a1657;})[_0x71c3('0x28')](respondWithFilteredResult(_0x325920,_0x5b8e2f))[_0x71c3('0x48')](handleError(_0x325920,null));};exports['show']=function(_0x1e69c6,_0x2748f5){var _0x2b4d3c={'raw':!![],'where':{'id':_0x1e69c6[_0x71c3('0x49')]['id']}},_0x21cb44={};_0x21cb44[_0x71c3('0x34')]=_[_0x71c3('0x36')](db['JscriptySessionReport'][_0x71c3('0x30')]);_0x21cb44[_0x71c3('0x35')]=_[_0x71c3('0x36')](_0x1e69c6[_0x71c3('0x35')]);_0x21cb44[_0x71c3('0x37')]=_[_0x71c3('0x39')](_0x21cb44['model'],_0x21cb44['query']);_0x2b4d3c['attributes']=_['intersection'](_0x21cb44['model'],qs[_0x71c3('0x3a')](_0x1e69c6[_0x71c3('0x35')]['fields']));_0x2b4d3c['attributes']=_0x2b4d3c['attributes'][_0x71c3('0x3b')]?_0x2b4d3c[_0x71c3('0x38')]:_0x21cb44['model'];if(_0x1e69c6[_0x71c3('0x35')][_0x71c3('0x45')]){_0x2b4d3c[_0x71c3('0x46')]=[{'all':!![]}];}_0x2b4d3c=_[_0x71c3('0x43')]({},_0x2b4d3c,_0x1e69c6[_0x71c3('0x44')]);return db['JscriptySessionReport'][_0x71c3('0x4a')](_0x2b4d3c)[_0x71c3('0x28')](handleEntityNotFound(_0x2748f5,null))[_0x71c3('0x28')](respondWithResult(_0x2748f5,null))[_0x71c3('0x48')](handleError(_0x2748f5,null));};exports['create']=function(_0x5799dd,_0xe1e650){return db[_0x71c3('0x2f')][_0x71c3('0x4b')](_0x5799dd[_0x71c3('0x4c')],{})[_0x71c3('0x28')](respondWithResult(_0xe1e650,0xc9))[_0x71c3('0x48')](handleError(_0xe1e650,null));};exports[_0x71c3('0x27')]=function(_0x587292,_0x330480){if(_0x587292[_0x71c3('0x4c')]['id']){delete _0x587292[_0x71c3('0x4c')]['id'];}return db[_0x71c3('0x2f')][_0x71c3('0x4a')]({'where':{'id':_0x587292['params']['id']}})[_0x71c3('0x28')](handleEntityNotFound(_0x330480,null))['then'](saveUpdates(_0x587292[_0x71c3('0x4c')],null))['then'](respondWithResult(_0x330480,null))[_0x71c3('0x48')](handleError(_0x330480,null));};exports[_0x71c3('0x4d')]=function(_0x402ecc,_0x318d4f){return db[_0x71c3('0x2f')][_0x71c3('0x4a')]({'where':{'id':_0x402ecc['params']['id']}})[_0x71c3('0x28')](handleEntityNotFound(_0x318d4f,null))[_0x71c3('0x28')](removeEntity(_0x318d4f,null))['catch'](handleError(_0x318d4f,null));};exports['describe']=function(_0x517311,_0x211255){return db[_0x71c3('0x2f')]['describe']()[_0x71c3('0x28')](respondWithResult(_0x211255,null))[_0x71c3('0x48')](handleError(_0x211255,null));};exports[_0x71c3('0x4e')]=function(_0x54119b,_0x1eac33,_0x5322a9){var _0x1401a1={'raw':!![],'where':{}};var _0x375c2e={};var _0x11895e={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x71c3('0x4f')]({'where':{'id':_0x54119b[_0x71c3('0x49')]['id']}})[_0x71c3('0x28')](handleEntityNotFound(_0x1eac33,null))['then'](function(_0x28a00e){if(_0x28a00e){_0x375c2e['model']=_['keys'](db[_0x71c3('0x50')]['rawAttributes']);_0x375c2e['query']=_[_0x71c3('0x36')](_0x54119b[_0x71c3('0x35')]);_0x375c2e[_0x71c3('0x37')]=_[_0x71c3('0x39')](_0x375c2e['model'],_0x375c2e[_0x71c3('0x35')]);_0x1401a1[_0x71c3('0x38')]=_[_0x71c3('0x39')](_0x375c2e[_0x71c3('0x34')],qs[_0x71c3('0x3a')](_0x54119b['query'][_0x71c3('0x3a')]));_0x1401a1[_0x71c3('0x38')]=_0x1401a1[_0x71c3('0x38')]['length']?_0x1401a1[_0x71c3('0x38')]:_0x375c2e['model'];if(!_0x54119b[_0x71c3('0x35')][_0x71c3('0x3c')]('nolimit')){_0x1401a1['limit']=qs[_0x71c3('0x22')](_0x54119b[_0x71c3('0x35')][_0x71c3('0x22')]);_0x1401a1[_0x71c3('0x21')]=qs[_0x71c3('0x21')](_0x54119b[_0x71c3('0x35')][_0x71c3('0x21')]);}_0x1401a1[_0x71c3('0x3d')]=qs[_0x71c3('0x3e')](_0x54119b[_0x71c3('0x35')][_0x71c3('0x3e')]);_0x1401a1[_0x71c3('0x3f')]=qs[_0x71c3('0x37')](_[_0x71c3('0x40')](_0x54119b[_0x71c3('0x35')],_0x375c2e[_0x71c3('0x37')]));_0x1401a1['where'][_0x71c3('0x51')]=_0x28a00e['id'];if(_0x54119b[_0x71c3('0x35')]['filter']){_0x1401a1[_0x71c3('0x3f')]=_['merge'](_0x1401a1[_0x71c3('0x3f')],{'$or':_[_0x71c3('0x2e')](_0x1401a1[_0x71c3('0x38')],function(_0x4a8413){var _0x5a96c7={};_0x5a96c7[_0x4a8413]={'$like':'%'+_0x54119b[_0x71c3('0x35')]['filter']+'%'};return _0x5a96c7;})});}_0x1401a1=_[_0x71c3('0x43')]({},_0x1401a1,_0x54119b[_0x71c3('0x44')]);return db[_0x71c3('0x50')][_0x71c3('0x20')]({'where':_0x1401a1[_0x71c3('0x3f')]})[_0x71c3('0x28')](function(_0x169ae8){_0x11895e['count']=_0x169ae8;if(_0x54119b['query']['includeAll']){_0x1401a1[_0x71c3('0x46')]=[{'all':!![]}];}return db[_0x71c3('0x50')]['findAll'](_0x1401a1);})[_0x71c3('0x28')](function(_0x1edd67){_0x11895e[_0x71c3('0x47')]=_0x1edd67;return _0x11895e;});}})[_0x71c3('0x28')](respondWithFilteredResult(_0x1eac33,_0x1401a1))[_0x71c3('0x48')](handleError(_0x1eac33,null));}; \ No newline at end of file +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 diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index ee7a259..a87fb20 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 _0x687b=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','request-promise','path'];(function(_0x37e848,_0x418405){var _0x512fe7=function(_0x1652c3){while(--_0x1652c3){_0x37e848['push'](_0x37e848['shift']());}};_0x512fe7(++_0x418405);}(_0x687b,0x14a));var _0xb687=function(_0x305cb0,_0x124dbf){_0x305cb0=_0x305cb0-0x0;var _0x5b4133=_0x687b[_0x305cb0];return _0x5b4133;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 3eed040..802d465 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 _0x187d=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch'];(function(_0x32fd84,_0x301302){var _0x51dd32=function(_0x165d25){while(--_0x165d25){_0x32fd84['push'](_0x32fd84['shift']());}};_0x51dd32(++_0x301302);}(_0x187d,0x93));var _0xd187=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x187d[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var moment=require(_0xd187('0x1'));var BPromise=require(_0xd187('0x2'));var rs=require(_0xd187('0x3'));var fs=require('fs');var Redis=require(_0xd187('0x4'));var db=require(_0xd187('0x5'))['db'];var utils=require(_0xd187('0x6'));var logger=require('../../config/logger')(_0xd187('0x7'));var config=require(_0xd187('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd187('0x9')][_0xd187('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x444a60,_0x1d3fe4,_0x28ce2f){return new BPromise(function(_0x2d6992,_0x358c45){return client[_0xd187('0xb')](_0x444a60,_0x28ce2f)['then'](function(_0x342539){logger[_0xd187('0xc')](_0xd187('0xd'),_0x1d3fe4,_0xd187('0xe'));logger[_0xd187('0xf')](_0xd187('0x10'),_0x1d3fe4,'request\x20sent',JSON[_0xd187('0x11')](_0x342539));if(_0x342539[_0xd187('0x12')]){if(_0x342539[_0xd187('0x12')]['code']===0x1f4){logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539[_0xd187('0x12')]['message']);return _0x358c45(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}logger[_0xd187('0x12')](_0xd187('0xd'),_0x1d3fe4,_0x342539['error'][_0xd187('0x13')]);return _0x2d6992(_0x342539[_0xd187('0x12')][_0xd187('0x13')]);}else{logger[_0xd187('0xc')]('JscriptySessionReport,\x20%s,\x20%s',_0x1d3fe4,_0xd187('0xe'));_0x2d6992(_0x342539['result']['message']);}})[_0xd187('0x14')](function(_0x5a4986){logger['error'](_0xd187('0xd'),_0x1d3fe4,_0x5a4986);_0x358c45(_0x5a4986);});});} \ No newline at end of file +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 diff --git a/server/api/license/index.js b/server/api/license/index.js index 522a56b..ba03b99 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./license.controller','get','index','put','/:id','isAuthenticated','exports','multer','util','path'];(function(_0x4a1e96,_0x143e6b){var _0x5acea9=function(_0x1e1677){while(--_0x1e1677){_0x4a1e96['push'](_0x4a1e96['shift']());}};_0x5acea9(++_0x143e6b);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',controller[_0x7995('0xa')]);router[_0x7995('0xb')](_0x7995('0xc'),auth[_0x7995('0xd')](),controller['update']);module[_0x7995('0xe')]=router; \ No newline at end of file +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 diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 5acce3d..76e5250 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 _0x7498=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x7c60de,_0xfb5b97){var _0x28a51b=function(_0x2c42e3){while(--_0x2c42e3){_0x7c60de['push'](_0x7c60de['shift']());}};_0x28a51b(++_0xfb5b97);}(_0x7498,0x127));var _0x8749=function(_0x8a4814,_0x20d2a4){_0x8a4814=_0x8a4814-0x0;var _0x3e0ba8=_0x7498[_0x8a4814];return _0x3e0ba8;};'use strict';var Sequelize=require(_0x8749('0x0'));module[_0x8749('0x1')]={'license':{'type':Sequelize[_0x8749('0x2')]},'data1':{'type':Sequelize[_0x8749('0x3')]},'data2':{'type':Sequelize[_0x8749('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x8749('0x4')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index c708447..7f078b7 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 _0xadb5=['query','filters','intersection','attributes','merge','getLicense','body','find','params','key','catch','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','model','keys','License'];(function(_0x55de5e,_0x173951){var _0x16bc2a=function(_0x20db03){while(--_0x20db03){_0x55de5e['push'](_0x55de5e['shift']());}};_0x16bc2a(++_0x173951);}(_0xadb5,0xad));var _0x5adb=function(_0x242a69,_0x180bc4){_0x242a69=_0x242a69-0x0;var _0x570f12=_0xadb5[_0x242a69];return _0x570f12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}var utilLicense=require(_0x5adb('0x17'));exports['index']=function(_0x49992e,_0x5d457e){var _0x39bddd={'raw':!![],'where':{'id':0x1}},_0x1eac55={};_0x1eac55[_0x5adb('0x28')]=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes']);_0x1eac55[_0x5adb('0x2b')]=_[_0x5adb('0x29')](_0x49992e[_0x5adb('0x2b')]);_0x1eac55[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](_0x1eac55[_0x5adb('0x28')],_0x1eac55[_0x5adb('0x2b')]);_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x2d')](_0x1eac55[_0x5adb('0x28')],qs['fields'](_0x49992e[_0x5adb('0x2b')]['fields']));_0x39bddd[_0x5adb('0x2e')]=_0x39bddd[_0x5adb('0x2e')]['length']?_0x39bddd[_0x5adb('0x2e')]:_0x1eac55[_0x5adb('0x28')];_0x39bddd=_[_0x5adb('0x2f')]({},_0x39bddd,_0x49992e['options']);return utilLicense[_0x5adb('0x30')](_0x39bddd)[_0x5adb('0x22')](respondWithResult(_0x5d457e,null))['catch'](handleError(_0x5d457e,null));};exports['update']=function(_0x1ed9ea,_0x49dd03){if(_0x1ed9ea[_0x5adb('0x31')]['id']){delete _0x1ed9ea[_0x5adb('0x31')]['id'];}return db[_0x5adb('0x2a')][_0x5adb('0x32')]({'where':{'id':_0x1ed9ea[_0x5adb('0x33')]['id']}})['then'](handleEntityNotFound(_0x49dd03,null))[_0x5adb('0x22')](function(_0x215b88){var _0x1c3a5c=_0x215b88['get']({'plain':!![]});return utilLicense['checkLicense'](_0x1c3a5c,_0x1ed9ea[_0x5adb('0x31')][_0x5adb('0x34')]);})['then'](function(_0x2355bc){if(!_0x2355bc['demo']){return saveUpdates(_0x1ed9ea[_0x5adb('0x31')],null);}return _0x2355bc;})['then'](respondWithResult(_0x49dd03,null))[_0x5adb('0x35')](handleError(_0x49dd03,null));}; \ No newline at end of file +var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_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 diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 8c43ef6..496c02a 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 _0x8051=['../../config/environment','./license.attributes','exports','License','license','lodash','api','request-promise'];(function(_0x2998db,_0x3424f1){var _0x115fea=function(_0x3b493c){while(--_0x3b493c){_0x2998db['push'](_0x2998db['shift']());}};_0x115fea(++_0x3424f1);}(_0x8051,0x11d));var _0x1805=function(_0x10c95b,_0x33d4a4){_0x10c95b=_0x10c95b-0x0;var _0x1d59d1=_0x8051[_0x10c95b];return _0x1d59d1;};'use strict';var _=require(_0x1805('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x1805('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1805('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1805('0x3'));var attributes=require(_0x1805('0x4'));module[_0x1805('0x5')]=function(_0x381be6,_0x5734d7){return _0x381be6['define'](_0x1805('0x6'),attributes,{'tableName':_0x1805('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index 442b032..abf4153 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 _0xe0a9=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xdac076,_0x2e2bff){var _0x1815b9=function(_0x3dba22){while(--_0x3dba22){_0xdac076['push'](_0xdac076['shift']());}};_0x1815b9(++_0x2e2bff);}(_0xe0a9,0xdf));var _0x9e0a=function(_0x4f1a01,_0x42ff0c){_0x4f1a01=_0x4f1a01-0x0;var _0x1220db=_0xe0a9[_0x4f1a01];return _0x1220db;};'use strict';var _=require(_0x9e0a('0x0'));var util=require('util');var moment=require(_0x9e0a('0x1'));var BPromise=require(_0x9e0a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e0a('0x3'));var db=require(_0x9e0a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9e0a('0x5'))(_0x9e0a('0x6'));var config=require(_0x9e0a('0x7'));var jayson=require(_0x9e0a('0x8'));var client=jayson[_0x9e0a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43a72e,_0x27a295,_0x163558){return new BPromise(function(_0x491eac,_0x2542e0){return client['request'](_0x43a72e,_0x163558)[_0x9e0a('0xa')](function(_0x56ff62){logger[_0x9e0a('0xb')](_0x9e0a('0xc'),_0x27a295,_0x9e0a('0xd'));logger[_0x9e0a('0xe')](_0x9e0a('0xf'),_0x27a295,_0x9e0a('0xd'),JSON[_0x9e0a('0x10')](_0x56ff62));if(_0x56ff62[_0x9e0a('0x11')]){if(_0x56ff62[_0x9e0a('0x11')]['code']===0x1f4){logger['error'](_0x9e0a('0xc'),_0x27a295,_0x56ff62[_0x9e0a('0x11')][_0x9e0a('0x12')]);return _0x2542e0(_0x56ff62[_0x9e0a('0x11')][_0x9e0a('0x12')]);}logger[_0x9e0a('0x11')]('License,\x20%s,\x20%s',_0x27a295,_0x56ff62[_0x9e0a('0x11')]['message']);return _0x491eac(_0x56ff62[_0x9e0a('0x11')][_0x9e0a('0x12')]);}else{logger[_0x9e0a('0xb')](_0x9e0a('0xc'),_0x27a295,_0x9e0a('0xd'));_0x491eac(_0x56ff62['result']['message']);}})['catch'](function(_0x2b3f1b){logger[_0x9e0a('0x11')](_0x9e0a('0xc'),_0x27a295,_0x2b3f1b);_0x2542e0(_0x2b3f1b);});});} \ No newline at end of file +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 diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 4e62afd..20a6df0 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 _0x6e5f=['show','/:id/dispositions','getAnswers','/:id/in_servers','getImap','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','/:id/canned_answers','addAnswer','create','addImap','addSmtp','addApplications','send','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','/:id','destroy','removeAgents','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3f2911,_0x4cce6f){var _0x15bf21=function(_0x1c9d2b){while(--_0x1c9d2b){_0x3f2911['push'](_0x3f2911['shift']());}};_0x15bf21(++_0x4cce6f);}(_0x6e5f,0x16a));var _0xf6e5=function(_0x57d388,_0x24b5bb){_0x57d388=_0x57d388-0x0;var _0x3e644c=_0x6e5f[_0x57d388];return _0x3e644c;};'use strict';var multer=require('multer');var util=require(_0xf6e5('0x0'));var path=require(_0xf6e5('0x1'));var timeout=require(_0xf6e5('0x2'));var express=require('express');var router=express[_0xf6e5('0x3')]();var fs_extra=require(_0xf6e5('0x4'));var auth=require(_0xf6e5('0x5'));var interaction=require(_0xf6e5('0x6'));var config=require(_0xf6e5('0x7'));var controller=require(_0xf6e5('0x8'));router[_0xf6e5('0x9')]('/',auth[_0xf6e5('0xa')](),controller[_0xf6e5('0xb')]);router[_0xf6e5('0x9')](_0xf6e5('0xc'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0xd')]);router[_0xf6e5('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xf6e5('0xe')]);router['get'](_0xf6e5('0xf'),auth[_0xf6e5('0xa')](),controller['getDispositions']);router[_0xf6e5('0x9')]('/:id/canned_answers',auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x10')]);router[_0xf6e5('0x9')](_0xf6e5('0x11'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x12')]);router[_0xf6e5('0x9')]('/:id/out_servers',auth[_0xf6e5('0xa')](),controller['getSmtp']);router[_0xf6e5('0x9')](_0xf6e5('0x13'),auth[_0xf6e5('0xa')](),controller['getInteractions']);router[_0xf6e5('0x9')](_0xf6e5('0x14'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x15')]);router[_0xf6e5('0x9')](_0xf6e5('0x16'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x17')]);router['get'](_0xf6e5('0x18'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x19')]);router[_0xf6e5('0x9')](_0xf6e5('0x1a'),auth[_0xf6e5('0xa')](),controller['getAgents']);router[_0xf6e5('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf6e5('0x1c')]);router[_0xf6e5('0x1b')](_0xf6e5('0x1d'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x1e')]);router[_0xf6e5('0x1b')]('/',auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x1f')]);router['post'](_0xf6e5('0x11'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x20')]);router['post']('/:id/out_servers',auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x21')]);router[_0xf6e5('0x1b')](_0xf6e5('0x13'),auth[_0xf6e5('0xa')](),controller['addInteraction']);router[_0xf6e5('0x1b')](_0xf6e5('0x14'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x22')]);router[_0xf6e5('0x1b')]('/:id/send',auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x23')]);router[_0xf6e5('0x1b')](_0xf6e5('0x1a'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x24')]);router[_0xf6e5('0x25')]('/:id',auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x26')]);router[_0xf6e5('0x27')](_0xf6e5('0xf'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x28')]);router[_0xf6e5('0x27')](_0xf6e5('0x1d'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x29')]);router[_0xf6e5('0x27')](_0xf6e5('0x11'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x2a')]);router[_0xf6e5('0x27')](_0xf6e5('0x2b'),auth[_0xf6e5('0xa')](),controller['removeSmtp']);router[_0xf6e5('0x27')](_0xf6e5('0x2c'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x2d')]);router['delete'](_0xf6e5('0x1a'),auth[_0xf6e5('0xa')](),controller[_0xf6e5('0x2e')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 932a81f..396297a 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 _0x0689=['setDataValue','mandatoryDispositionPauseId','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'];(function(_0x178856,_0x41f045){var _0x3c7fe7=function(_0x4d9ce4){while(--_0x4d9ce4){_0x178856['push'](_0x178856['shift']());}};_0x3c7fe7(++_0x41f045);}(_0x0689,0x161));var _0x9068=function(_0x10ab33,_0x2baf3d){_0x10ab33=_0x10ab33-0x0;var _0x1b6f44=_0x0689[_0x10ab33];return _0x1b6f44;};'use strict';var Sequelize=require('sequelize');module[_0x9068('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9068('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x9068('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x9068('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9068('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9068('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x9068('0x3')]},'markAsUnread':{'type':Sequelize[_0x9068('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9068('0x1')],'allowNull':![],'defaultValue':_0x9068('0x4')},'fontSize':{'type':Sequelize[_0x9068('0x5')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9068('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[_0x9068('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9068('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x9068('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9068('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9068('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9068('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9068('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x9068('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x9068('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x364bd5){if(!_0x364bd5)this[_0x9068('0x7')](_0x9068('0x8'),null);this[_0x9068('0x7')]('mandatoryDisposition',_0x364bd5);}}}; \ No newline at end of file +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 diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index d219b4a..df9fadc 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 _0xc85a=['then','destroy','get','stack','name','send','index','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','MailServerIn','find','catch','body','describe','addDisposition','MailAccountId','create','findOne','Disposition','hasOwnProperty','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','key','email','active','isNil','cservice','cauthentication','user','pass','cpassword','authentication','host','port','service','cuser','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','READ_COMMITTED','MailApplication','bulkCreate','finally','getApplications','getMessages','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','split','List','Contacts','updatedAt','from','attachments','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','jsforce','desk.js','querystring','html-to-text','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update'];(function(_0x137bc6,_0x4ba9a3){var _0x32c976=function(_0x14b5e2){while(--_0x14b5e2){_0x137bc6['push'](_0x137bc6['shift']());}};_0x32c976(++_0x4ba9a3);}(_0xc85a,0x90));var _0xac85=function(_0x26212b,_0x16ab47){_0x26212b=_0x26212b-0x0;var _0x48d075=_0xc85a[_0x26212b];return _0x48d075;};'use strict';var emlformat=require(_0xac85('0x0'));var rimraf=require(_0xac85('0x1'));var zipdir=require(_0xac85('0x2'));var jsonpatch=require(_0xac85('0x3'));var rp=require(_0xac85('0x4'));var moment=require(_0xac85('0x5'));var BPromise=require(_0xac85('0x6'));var Mustache=require('mustache');var util=require(_0xac85('0x7'));var path=require(_0xac85('0x8'));var sox=require(_0xac85('0x9'));var csv=require(_0xac85('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac85('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xac85('0xc'));var deskjs=require(_0xac85('0xd'));var toCsv=require(_0xac85('0xa'));var querystring=require(_0xac85('0xe'));var Papa=require('papaparse');var htmlToText=require(_0xac85('0xf'));var juice=require(_0xac85('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xac85('0x11'));var as=require(_0xac85('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac85('0x13'))(_0xac85('0x14'));var utils=require('../../config/utils');var config=require(_0xac85('0x15'));var licenseUtil=require(_0xac85('0x16'));var db=require(_0xac85('0x17'))['db'];config['redis']=_[_0xac85('0x18')](config[_0xac85('0x19')],{'host':_0xac85('0x1a'),'port':0x18eb});var socket=require(_0xac85('0x1b'))(new Redis(config[_0xac85('0x19')]));require(_0xac85('0x1c'))[_0xac85('0x1d')](socket);var jayson=require(_0xac85('0x1e'));var client=jayson[_0xac85('0x1f')][_0xac85('0x20')]({'port':0x232b});function respondWithRpcPromise(_0x4cfa0e,_0x214bd1,_0x104afa,_0x53c957){return new BPromise(function(_0x1bc491,_0x2630e8){var _0x423cdf=_0x53c957||client;return _0x423cdf['request'](_0x4cfa0e,_0x104afa)['then'](function(_0x1f44d0){logger[_0xac85('0x21')](_0xac85('0x22'),_0x214bd1,_0xac85('0x23'));logger[_0xac85('0x24')](_0xac85('0x25'),_0x214bd1,'request\x20sent',JSON[_0xac85('0x26')](_0x1f44d0));if(_0x1f44d0[_0xac85('0x27')]){if(_0x1f44d0[_0xac85('0x27')][_0xac85('0x28')]===0x1f4){logger[_0xac85('0x27')](_0xac85('0x22'),_0x214bd1,_0x1f44d0[_0xac85('0x27')][_0xac85('0x29')]);return _0x2630e8(_0x1f44d0[_0xac85('0x27')][_0xac85('0x29')]);}logger[_0xac85('0x27')](_0xac85('0x22'),_0x214bd1,_0x1f44d0['error']['message']);return _0x1bc491(_0x1f44d0['error'][_0xac85('0x29')]);}else{logger[_0xac85('0x21')](_0xac85('0x22'),_0x214bd1,_0xac85('0x23'));_0x1bc491(_0x1f44d0['result'][_0xac85('0x29')]);}})['catch'](function(_0x1876a5){logger[_0xac85('0x27')]('MailAccount,\x20%s,\x20%s',_0x214bd1,_0x1876a5);_0x2630e8(_0x1876a5);});});}function respondWithStatusCode(_0x1f6f2f,_0x26adab){_0x26adab=_0x26adab||0xcc;return function(_0x289ef8){if(_0x289ef8){return _0x1f6f2f[_0xac85('0x2a')](_0x26adab);}return _0x1f6f2f[_0xac85('0x2b')](_0x26adab)[_0xac85('0x2c')]();};}function respondWithResult(_0x175c86,_0x1de1c2){_0x1de1c2=_0x1de1c2||0xc8;return function(_0x44354a){if(_0x44354a){return _0x175c86[_0xac85('0x2b')](_0x1de1c2)[_0xac85('0x2d')](_0x44354a);}};}function respondWithFilteredResult(_0x3241fe,_0x5a9c57){return function(_0x6b23a4){if(_0x6b23a4){var _0x201ef8=typeof _0x5a9c57[_0xac85('0x2e')]===_0xac85('0x2f')&&typeof _0x5a9c57[_0xac85('0x30')]==='undefined';var _0x4c94db=_0x6b23a4[_0xac85('0x31')];var _0x29e3b1=_0x201ef8?0x0:_0x5a9c57[_0xac85('0x2e')];var _0x3e8ef7=_0x201ef8?_0x6b23a4[_0xac85('0x31')]:_0x5a9c57['offset']+_0x5a9c57[_0xac85('0x30')];var _0x272227;if(_0x3e8ef7>=_0x4c94db){_0x3e8ef7=_0x4c94db;_0x272227=0xc8;}else{_0x272227=0xce;}_0x3241fe['status'](_0x272227);return _0x3241fe[_0xac85('0x32')](_0xac85('0x33'),_0x29e3b1+'-'+_0x3e8ef7+'/'+_0x4c94db)[_0xac85('0x2d')](_0x6b23a4);}return null;};}function patchUpdates(_0x73601){return function(_0x561b99){try{jsonpatch['apply'](_0x561b99,_0x73601,!![]);}catch(_0x357aa0){return BPromise[_0xac85('0x34')](_0x357aa0);}return _0x561b99['save']();};}function saveUpdates(_0x168ef1,_0xd510a1){return function(_0x443c1f){if(_0x443c1f){return _0x443c1f[_0xac85('0x35')](_0x168ef1)[_0xac85('0x36')](function(_0x3d05ca){return _0x3d05ca;});}return null;};}function removeEntity(_0x38db0b,_0x5363f6){return function(_0x1954b6){if(_0x1954b6){return _0x1954b6[_0xac85('0x37')]()[_0xac85('0x36')](function(){var _0x28c93a=_0x1954b6[_0xac85('0x38')]({'plain':!![]});var _0x257c7e='MailAccounts';return db['UserProfileResource'][_0xac85('0x37')]({'where':{'type':_0x257c7e,'resourceId':_0x28c93a['id']}})['then'](function(){return _0x1954b6;});})[_0xac85('0x36')](function(){_0x38db0b['status'](0xcc)[_0xac85('0x2c')]();});}};}function handleEntityNotFound(_0x17abb2,_0x1ac763){return function(_0x5a465e){if(!_0x5a465e){_0x17abb2[_0xac85('0x2a')](0x194);}return _0x5a465e;};}function handleError(_0xad78a4,_0x4cbf66){_0x4cbf66=_0x4cbf66||0x1f4;return function(_0x29596a){logger['error'](_0x29596a[_0xac85('0x39')]);if(_0x29596a[_0xac85('0x3a')]){delete _0x29596a['name'];}_0xad78a4[_0xac85('0x2b')](_0x4cbf66)[_0xac85('0x3b')](_0x29596a);};}exports[_0xac85('0x3c')]=function(_0x1b03ad,_0x29f2d3){var _0x29add1={'include':[{'model':db['MailServerIn'],'as':_0xac85('0x3d')},{'model':db[_0xac85('0x3e')],'as':_0xac85('0x3f')},{'model':db[_0xac85('0x40')],'as':_0xac85('0x41')}]},_0x2b2fc8={},_0x279414={'count':0x0,'rows':[]};var _0x592de1=_[_0xac85('0x42')](db[_0xac85('0x43')][_0xac85('0x44')],function(_0x560662){return{'name':_0x560662[_0xac85('0x45')],'type':_0x560662[_0xac85('0x46')]['key']};});_0x2b2fc8[_0xac85('0x47')]=_['map'](_0x592de1,_0xac85('0x3a'));_0x2b2fc8[_0xac85('0x48')]=_[_0xac85('0x49')](_0x1b03ad['query']);_0x2b2fc8[_0xac85('0x4a')]=_[_0xac85('0x4b')](_0x2b2fc8[_0xac85('0x47')],_0x2b2fc8[_0xac85('0x48')]);_0x29add1[_0xac85('0x4c')]=_[_0xac85('0x4b')](_0x2b2fc8[_0xac85('0x47')],qs[_0xac85('0x4d')](_0x1b03ad['query']['fields']));_0x29add1[_0xac85('0x4c')]=_0x29add1['attributes'][_0xac85('0x4e')]?_0x29add1[_0xac85('0x4c')]:_0x2b2fc8[_0xac85('0x47')];if(!_0x1b03ad['query']['hasOwnProperty'](_0xac85('0x4f'))){_0x29add1[_0xac85('0x30')]=qs[_0xac85('0x30')](_0x1b03ad['query'][_0xac85('0x30')]);_0x29add1[_0xac85('0x2e')]=qs[_0xac85('0x2e')](_0x1b03ad[_0xac85('0x48')][_0xac85('0x2e')]);}_0x29add1['order']=qs[_0xac85('0x50')](_0x1b03ad[_0xac85('0x48')][_0xac85('0x50')]);_0x29add1[_0xac85('0x51')]=qs[_0xac85('0x4a')](_[_0xac85('0x52')](_0x1b03ad[_0xac85('0x48')],_0x2b2fc8[_0xac85('0x4a')]),_0x592de1);if(_0x1b03ad['query']['filter']){_0x29add1['where']=_['merge'](_0x29add1[_0xac85('0x51')],{'$or':_[_0xac85('0x42')](_0x592de1,function(_0x50795d){if(_0x50795d['type']!==_0xac85('0x53')){var _0x48b078={};_0x48b078[_0x50795d['name']]={'$like':'%'+_0x1b03ad[_0xac85('0x48')][_0xac85('0x54')]+'%'};return _0x48b078;}})});}_0x29add1=_[_0xac85('0x55')]({},_0x29add1,_0x1b03ad[_0xac85('0x56')]);var _0x2081e8={'where':_0x29add1[_0xac85('0x51')]};return db['MailAccount'][_0xac85('0x31')](_0x2081e8)['then'](function(_0x2b898c){_0x279414[_0xac85('0x31')]=_0x2b898c;if(_0x1b03ad[_0xac85('0x48')][_0xac85('0x57')]){_0x29add1[_0xac85('0x58')]=[{'all':!![]}];}return db[_0xac85('0x43')][_0xac85('0x59')](_0x29add1);})['then'](function(_0x1c0808){_0x279414[_0xac85('0x5a')]=_0x1c0808;return _0x279414;})[_0xac85('0x36')](respondWithFilteredResult(_0x29f2d3,_0x29add1))['catch'](handleError(_0x29f2d3,null));};exports[_0xac85('0x5b')]=function(_0x546474,_0x40507d){var _0x31e690={'raw':![],'where':{'id':_0x546474[_0xac85('0x5c')]['id']},'include':[{'model':db[_0xac85('0x5d')],'as':_0xac85('0x3d')},{'model':db[_0xac85('0x3e')],'as':'Smtp'},{'model':db['Pause'],'as':_0xac85('0x41')}]},_0x20f336={};_0x20f336[_0xac85('0x47')]=_[_0xac85('0x49')](db[_0xac85('0x43')][_0xac85('0x44')]);_0x20f336[_0xac85('0x48')]=_[_0xac85('0x49')](_0x546474[_0xac85('0x48')]);_0x20f336[_0xac85('0x4a')]=_[_0xac85('0x4b')](_0x20f336[_0xac85('0x47')],_0x20f336[_0xac85('0x48')]);_0x31e690[_0xac85('0x4c')]=_[_0xac85('0x4b')](_0x20f336[_0xac85('0x47')],qs[_0xac85('0x4d')](_0x546474['query'][_0xac85('0x4d')]));_0x31e690[_0xac85('0x4c')]=_0x31e690[_0xac85('0x4c')][_0xac85('0x4e')]?_0x31e690[_0xac85('0x4c')]:_0x20f336[_0xac85('0x47')];if(_0x546474[_0xac85('0x48')][_0xac85('0x57')]){_0x31e690[_0xac85('0x58')]=[{'all':!![]}];}_0x31e690=_[_0xac85('0x55')]({},_0x31e690,_0x546474['options']);return db[_0xac85('0x43')][_0xac85('0x5e')](_0x31e690)[_0xac85('0x36')](handleEntityNotFound(_0x40507d,null))[_0xac85('0x36')](respondWithResult(_0x40507d,null))[_0xac85('0x5f')](handleError(_0x40507d,null));};exports[_0xac85('0x35')]=function(_0x24aa68,_0x5839c4){if(_0x24aa68[_0xac85('0x60')]['id']){delete _0x24aa68[_0xac85('0x60')]['id'];}return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x24aa68[_0xac85('0x5c')]['id']},'include':[{'model':db[_0xac85('0x5d')],'as':_0xac85('0x3d')},{'model':db[_0xac85('0x3e')],'as':_0xac85('0x3f')},{'model':db['Pause'],'as':_0xac85('0x41')}]})[_0xac85('0x36')](handleEntityNotFound(_0x5839c4,null))[_0xac85('0x36')](saveUpdates(_0x24aa68[_0xac85('0x60')],null))['then'](function(_0x520aa3){if(_0x520aa3&&_0x24aa68[_0xac85('0x60')]['Imap']){return db['MailServerIn'][_0xac85('0x35')](_0x24aa68[_0xac85('0x60')][_0xac85('0x3d')],{'where':{'MailAccountId':_0x520aa3['id']}})[_0xac85('0x36')](function(){return _0x520aa3;});}return _0x520aa3;})[_0xac85('0x36')](function(_0x3fcaaa){if(_0x3fcaaa&&_0x24aa68[_0xac85('0x60')][_0xac85('0x3f')]){return db[_0xac85('0x3e')]['update'](_0x24aa68[_0xac85('0x60')][_0xac85('0x3f')],{'where':{'MailAccountId':_0x3fcaaa['id']}})[_0xac85('0x36')](function(){return _0x3fcaaa;});}return _0x3fcaaa;})[_0xac85('0x36')](respondWithResult(_0x5839c4,null))[_0xac85('0x5f')](handleError(_0x5839c4,null));};exports[_0xac85('0x61')]=function(_0x4efe87,_0x462cdd){return db[_0xac85('0x43')]['describe']()[_0xac85('0x36')](respondWithResult(_0x462cdd,null))['catch'](handleError(_0x462cdd,null));};exports[_0xac85('0x62')]=function(_0x1f3156,_0x3f6a0f,_0x2236f0){if(_0x1f3156[_0xac85('0x60')]['id']){delete _0x1f3156[_0xac85('0x60')]['id'];}return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x1f3156[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x3f6a0f,null))[_0xac85('0x36')](function(_0x35fefe){if(_0x35fefe){_0x1f3156[_0xac85('0x60')][_0xac85('0x63')]=_0x35fefe['id'];return db['Disposition'][_0xac85('0x64')](_0x1f3156[_0xac85('0x60')]);}})[_0xac85('0x36')](respondWithResult(_0x3f6a0f,null))['catch'](handleError(_0x3f6a0f,null));};exports['getDispositions']=function(_0x40842c,_0x21ca65,_0x5c11c2){var _0x5c186c={'raw':![],'where':{}};var _0xb4b305={};var _0x20d850={'count':0x0,'rows':[]};return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0x40842c[_0xac85('0x5c')]['id']}})['then'](handleEntityNotFound(_0x21ca65,null))[_0xac85('0x36')](function(_0x34b459){if(_0x34b459){_0xb4b305[_0xac85('0x47')]=_[_0xac85('0x49')](db[_0xac85('0x66')][_0xac85('0x44')]);_0xb4b305['query']=_[_0xac85('0x49')](_0x40842c[_0xac85('0x48')]);_0xb4b305[_0xac85('0x4a')]=_[_0xac85('0x4b')](_0xb4b305[_0xac85('0x47')],_0xb4b305['query']);_0x5c186c[_0xac85('0x4c')]=_['intersection'](_0xb4b305[_0xac85('0x47')],qs['fields'](_0x40842c['query'][_0xac85('0x4d')]));_0x5c186c[_0xac85('0x4c')]=_0x5c186c[_0xac85('0x4c')]['length']?_0x5c186c['attributes']:_0xb4b305[_0xac85('0x47')];if(!_0x40842c[_0xac85('0x48')][_0xac85('0x67')]('nolimit')){_0x5c186c['limit']=qs[_0xac85('0x30')](_0x40842c[_0xac85('0x48')]['limit']);_0x5c186c[_0xac85('0x2e')]=qs[_0xac85('0x2e')](_0x40842c[_0xac85('0x48')][_0xac85('0x2e')]);}_0x5c186c[_0xac85('0x68')]=qs[_0xac85('0x50')](_0x40842c[_0xac85('0x48')][_0xac85('0x50')]);_0x5c186c[_0xac85('0x51')]=qs[_0xac85('0x4a')](_[_0xac85('0x52')](_0x40842c[_0xac85('0x48')],_0xb4b305[_0xac85('0x4a')]));_0x5c186c[_0xac85('0x51')]['MailAccountId']=_0x34b459['id'];if(_0x40842c['query'][_0xac85('0x54')]){_0x5c186c[_0xac85('0x51')]=_['merge'](_0x5c186c[_0xac85('0x51')],{'$or':_[_0xac85('0x42')](_0x5c186c['attributes'],function(_0x2d0666){var _0xecaa43={};_0xecaa43[_0x2d0666]={'$like':'%'+_0x40842c[_0xac85('0x48')][_0xac85('0x54')]+'%'};return _0xecaa43;})});}_0x5c186c=_[_0xac85('0x55')]({},_0x5c186c,_0x40842c[_0xac85('0x56')]);return db['Disposition']['count']({'where':_0x5c186c[_0xac85('0x51')]})[_0xac85('0x36')](function(_0x4bbdc7){_0x20d850['count']=_0x4bbdc7;if(_0x40842c[_0xac85('0x48')][_0xac85('0x57')]){_0x5c186c[_0xac85('0x58')]=[{'all':!![]}];}return db[_0xac85('0x66')]['findAll'](_0x5c186c);})[_0xac85('0x36')](function(_0x4b0c4c){_0x20d850[_0xac85('0x5a')]=_0x4b0c4c;return _0x20d850;});}})['then'](respondWithFilteredResult(_0x21ca65,_0x5c186c))['catch'](handleError(_0x21ca65,null));};exports['removeDispositions']=function(_0x579a09,_0x8200b3,_0x4cd68e){return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x579a09[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x8200b3,null))[_0xac85('0x36')](function(_0x23c019){if(_0x23c019){return _0x23c019[_0xac85('0x69')](_0x579a09['query'][_0xac85('0x6a')]);}})[_0xac85('0x36')](respondWithStatusCode(_0x8200b3,null))[_0xac85('0x5f')](handleError(_0x8200b3,null));};exports[_0xac85('0x6b')]=function(_0x56e0f3,_0x300ca2,_0x358240){if(_0x56e0f3[_0xac85('0x60')]['id']){delete _0x56e0f3[_0xac85('0x60')]['id'];}return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x56e0f3[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x300ca2,null))[_0xac85('0x36')](function(_0x1eab07){if(_0x1eab07){_0x56e0f3[_0xac85('0x60')][_0xac85('0x63')]=_0x1eab07['id'];return db[_0xac85('0x6c')]['create'](_0x56e0f3[_0xac85('0x60')]);}})[_0xac85('0x36')](respondWithResult(_0x300ca2,null))[_0xac85('0x5f')](handleError(_0x300ca2,null));};exports[_0xac85('0x6d')]=function(_0x17724c,_0x3794f9,_0x4cd88a){var _0x17f3fe={'raw':![],'where':{}};var _0x2b4881={};var _0x2f140a={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x17724c['params']['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x3794f9,null))[_0xac85('0x36')](function(_0x19b4e9){if(_0x19b4e9){_0x2b4881['model']=_[_0xac85('0x49')](db['CannedAnswer'][_0xac85('0x44')]);_0x2b4881[_0xac85('0x48')]=_[_0xac85('0x49')](_0x17724c[_0xac85('0x48')]);_0x2b4881[_0xac85('0x4a')]=_[_0xac85('0x4b')](_0x2b4881[_0xac85('0x47')],_0x2b4881[_0xac85('0x48')]);_0x17f3fe[_0xac85('0x4c')]=_[_0xac85('0x4b')](_0x2b4881[_0xac85('0x47')],qs[_0xac85('0x4d')](_0x17724c['query'][_0xac85('0x4d')]));_0x17f3fe[_0xac85('0x4c')]=_0x17f3fe[_0xac85('0x4c')][_0xac85('0x4e')]?_0x17f3fe[_0xac85('0x4c')]:_0x2b4881[_0xac85('0x47')];if(!_0x17724c['query'][_0xac85('0x67')](_0xac85('0x4f'))){_0x17f3fe[_0xac85('0x30')]=qs[_0xac85('0x30')](_0x17724c[_0xac85('0x48')][_0xac85('0x30')]);_0x17f3fe[_0xac85('0x2e')]=qs[_0xac85('0x2e')](_0x17724c['query'][_0xac85('0x2e')]);}_0x17f3fe['order']=qs[_0xac85('0x50')](_0x17724c[_0xac85('0x48')][_0xac85('0x50')]);_0x17f3fe[_0xac85('0x51')]=qs[_0xac85('0x4a')](_[_0xac85('0x52')](_0x17724c[_0xac85('0x48')],_0x2b4881[_0xac85('0x4a')]));_0x17f3fe['where'][_0xac85('0x63')]=_0x19b4e9['id'];if(_0x17724c[_0xac85('0x48')][_0xac85('0x54')]){_0x17f3fe[_0xac85('0x51')]=_['merge'](_0x17f3fe[_0xac85('0x51')],{'$or':_[_0xac85('0x42')](_0x17f3fe[_0xac85('0x4c')],function(_0x49709d){var _0x36948e={};_0x36948e[_0x49709d]={'$like':'%'+_0x17724c[_0xac85('0x48')][_0xac85('0x54')]+'%'};return _0x36948e;})});}_0x17f3fe=_[_0xac85('0x55')]({},_0x17f3fe,_0x17724c[_0xac85('0x56')]);return db['CannedAnswer'][_0xac85('0x31')]({'where':_0x17f3fe[_0xac85('0x51')]})[_0xac85('0x36')](function(_0x4ef074){_0x2f140a[_0xac85('0x31')]=_0x4ef074;if(_0x17724c[_0xac85('0x48')][_0xac85('0x57')]){_0x17f3fe[_0xac85('0x58')]=[{'all':!![]}];}return db[_0xac85('0x6c')][_0xac85('0x59')](_0x17f3fe);})[_0xac85('0x36')](function(_0x393ef5){_0x2f140a['rows']=_0x393ef5;return _0x2f140a;});}})['then'](respondWithFilteredResult(_0x3794f9,_0x17f3fe))[_0xac85('0x5f')](handleError(_0x3794f9,null));};exports['removeAnswers']=function(_0x1e3159,_0x199905,_0x23e0ad){return db['MailAccount'][_0xac85('0x5e')]({'where':{'id':_0x1e3159[_0xac85('0x5c')]['id']}})['then'](handleEntityNotFound(_0x199905,null))['then'](function(_0x292225){if(_0x292225){return _0x292225[_0xac85('0x6e')](_0x1e3159[_0xac85('0x48')][_0xac85('0x6a')]);}})[_0xac85('0x36')](respondWithStatusCode(_0x199905,null))[_0xac85('0x5f')](handleError(_0x199905,null));};exports['create']=function(_0x94adf3,_0x58edde){var _0x5eb2a6={'name':_0x94adf3[_0xac85('0x60')][_0xac85('0x3a')],'key':_0x94adf3['body'][_0xac85('0x6f')],'email':_0x94adf3[_0xac85('0x60')][_0xac85('0x70')],'ListId':_0x94adf3['body']['ListId'],'active':!_['isNil'](_0x94adf3[_0xac85('0x60')][_0xac85('0x71')])?_0x94adf3['body']['active']:!![],'description':_0x94adf3['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0xac85('0x72')](_0x94adf3[_0xac85('0x60')][_0xac85('0x73')])){if(_0x94adf3['body'][_0xac85('0x74')]){_0x5eb2a6['Imap'][_0xac85('0x75')]=_0x5eb2a6[_0xac85('0x3f')][_0xac85('0x75')]=_0x94adf3[_0xac85('0x60')]['cuser'];_0x5eb2a6[_0xac85('0x3d')]['password']=_0x5eb2a6['Smtp'][_0xac85('0x76')]=_0x94adf3[_0xac85('0x60')][_0xac85('0x77')];}else{_0x5eb2a6['Imap'][_0xac85('0x78')]=_0x5eb2a6[_0xac85('0x3f')][_0xac85('0x78')]=![];}_0x5eb2a6[_0xac85('0x3d')][_0xac85('0x79')]=_0x94adf3['body'][_0xac85('0x3d')]['host'];_0x5eb2a6['Imap']['port']=_0x94adf3['body'][_0xac85('0x3d')]['port'];_0x5eb2a6['Smtp']['host']=_0x94adf3['body']['Smtp'][_0xac85('0x79')];_0x5eb2a6[_0xac85('0x3f')][_0xac85('0x7a')]=_0x94adf3[_0xac85('0x60')][_0xac85('0x3f')][_0xac85('0x7a')];}else{_0x5eb2a6[_0xac85('0x3d')]['service']=_0x5eb2a6[_0xac85('0x3f')][_0xac85('0x7b')]=_0x94adf3[_0xac85('0x60')][_0xac85('0x73')];_0x5eb2a6[_0xac85('0x3d')][_0xac85('0x75')]=_0x5eb2a6[_0xac85('0x3f')][_0xac85('0x75')]=_0x94adf3['body'][_0xac85('0x7c')];_0x5eb2a6[_0xac85('0x3d')]['password']=_0x5eb2a6['Smtp'][_0xac85('0x76')]=_0x94adf3[_0xac85('0x60')][_0xac85('0x77')];}return db[_0xac85('0x43')][_0xac85('0x64')](_0x5eb2a6,{'include':[{'model':db[_0xac85('0x3e')],'as':'Smtp'},{'model':db[_0xac85('0x5d')],'as':'Imap'}]})[_0xac85('0x36')](function(_0x34303a){var _0x594549=_0x94adf3['user'][_0xac85('0x38')]({'plain':!![]});if(!_0x594549)throw new Error(_0xac85('0x7d'));if(_0x594549['role']===_0xac85('0x75')){var _0x57049a=_0x34303a[_0xac85('0x38')]({'plain':!![]});return db[_0xac85('0x7e')][_0xac85('0x5e')]({'where':{'name':_0xac85('0x7f'),'userProfileId':_0x594549[_0xac85('0x80')]},'raw':!![]})[_0xac85('0x36')](function(_0x427a66){if(_0x427a66&&_0x427a66[_0xac85('0x81')]===0x0){return db[_0xac85('0x82')][_0xac85('0x64')]({'name':_0x57049a[_0xac85('0x3a')],'resourceId':_0x57049a['id'],'type':_0x427a66['name'],'sectionId':_0x427a66['id']},{})['then'](function(){return _0x34303a;});}else{return _0x34303a;}})[_0xac85('0x5f')](function(_0x1dc8ae){logger[_0xac85('0x27')](_0xac85('0x83'),_0x1dc8ae);throw _0x1dc8ae;});}return _0x34303a;})[_0xac85('0x36')](respondWithResult(_0x58edde,0xc9))['catch'](handleError(_0x58edde,null));};exports[_0xac85('0x84')]=function(_0x20e999,_0x42b394,_0x16cb6d){return db[_0xac85('0x43')]['findOne']({'where':{'id':_0x20e999[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x42b394,null))[_0xac85('0x36')](function(_0x9eec50){if(_0x9eec50){return _0x9eec50[_0xac85('0x84')]();}return null;})[_0xac85('0x36')](respondWithResult(_0x42b394,null))[_0xac85('0x5f')](handleError(_0x42b394,null));};exports['addImap']=function(_0x32939c,_0x3018d7,_0x55e495){if(_0x32939c[_0xac85('0x60')]['id']){delete _0x32939c['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x32939c[_0xac85('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3018d7,null))[_0xac85('0x36')](function(_0x1f375c){if(_0x1f375c){_0x32939c[_0xac85('0x60')][_0xac85('0x63')]=_0x1f375c['id'];return db['MailServerIn'][_0xac85('0x64')](_0x32939c['body']);}})[_0xac85('0x36')](respondWithResult(_0x3018d7,null))[_0xac85('0x5f')](handleError(_0x3018d7,null));};exports[_0xac85('0x85')]=function(_0x3b637b,_0xfaad8,_0x34a262){return db[_0xac85('0x43')]['findOne']({'where':{'id':_0x3b637b[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0xfaad8,null))[_0xac85('0x36')](function(_0x2b1025){if(_0x2b1025){return _0x2b1025[_0xac85('0x86')](null);}return null;})[_0xac85('0x36')](respondWithStatusCode(_0xfaad8,null))['catch'](handleError(_0xfaad8,null));};exports[_0xac85('0x87')]=function(_0x544ac3,_0x13e545,_0x1366bf){return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0x544ac3[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x13e545,null))[_0xac85('0x36')](function(_0x25a33f){if(_0x25a33f){return _0x25a33f['getSmtp']();}return null;})['then'](respondWithResult(_0x13e545,null))['catch'](handleError(_0x13e545,null));};exports['addSmtp']=function(_0x53224d,_0x42bc0c,_0x7949b2){if(_0x53224d[_0xac85('0x60')]['id']){delete _0x53224d[_0xac85('0x60')]['id'];}return db[_0xac85('0x43')]['find']({'where':{'id':_0x53224d['params']['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x42bc0c,null))[_0xac85('0x36')](function(_0x31d542){if(_0x31d542){_0x53224d['body'][_0xac85('0x63')]=_0x31d542['id'];return db['MailServerOut'][_0xac85('0x64')](_0x53224d[_0xac85('0x60')]);}})['then'](respondWithResult(_0x42bc0c,null))[_0xac85('0x5f')](handleError(_0x42bc0c,null));};exports[_0xac85('0x88')]=function(_0x5b6545,_0x385a45,_0x4d29d1){return db[_0xac85('0x43')]['findOne']({'where':{'id':_0x5b6545[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x385a45,null))['then'](function(_0x563080){if(_0x563080){return _0x563080[_0xac85('0x89')](null);}return null;})[_0xac85('0x36')](respondWithStatusCode(_0x385a45,null))[_0xac85('0x5f')](handleError(_0x385a45,null));};exports[_0xac85('0x8a')]=function(_0x7ad8d1,_0xe6cd8e,_0x3fc6ab){return db[_0xac85('0x8b')][_0xac85('0x5e')]({'where':{'id':_0x7ad8d1[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0xe6cd8e,null))[_0xac85('0x36')](function(_0x529b96){if(_0x529b96){return _0x529b96['addInteraction'](_0x7ad8d1['body']['ids'],_[_0xac85('0x8c')](_0x7ad8d1[_0xac85('0x60')],[_0xac85('0x6a'),'id'])||{});}})[_0xac85('0x36')](respondWithResult(_0xe6cd8e,null))['catch'](handleError(_0xe6cd8e,null));};exports[_0xac85('0x8d')]=function(_0xbb290c,_0x2d7e04,_0x39dcdf){var _0x4d45e5={'raw':![],'where':{}};var _0x25b5eb={};var _0x4a93db={'count':0x0,'rows':[]};return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0xbb290c[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x2d7e04,null))[_0xac85('0x36')](function(_0x348e0d){if(_0x348e0d){_0x25b5eb[_0xac85('0x47')]=_[_0xac85('0x49')](db[_0xac85('0x8b')][_0xac85('0x44')]);_0x25b5eb[_0xac85('0x48')]=_[_0xac85('0x49')](_0xbb290c[_0xac85('0x48')]);_0x25b5eb[_0xac85('0x4a')]=_[_0xac85('0x4b')](_0x25b5eb[_0xac85('0x47')],_0x25b5eb[_0xac85('0x48')]);_0x4d45e5[_0xac85('0x4c')]=_[_0xac85('0x4b')](_0x25b5eb['model'],qs[_0xac85('0x4d')](_0xbb290c['query'][_0xac85('0x4d')]));_0x4d45e5[_0xac85('0x4c')]=_0x4d45e5['attributes']['length']?_0x4d45e5[_0xac85('0x4c')]:_0x25b5eb['model'];if(!_0xbb290c['query'][_0xac85('0x67')](_0xac85('0x4f'))){_0x4d45e5[_0xac85('0x30')]=qs[_0xac85('0x30')](_0xbb290c[_0xac85('0x48')][_0xac85('0x30')]);_0x4d45e5[_0xac85('0x2e')]=qs['offset'](_0xbb290c['query'][_0xac85('0x2e')]);}_0x4d45e5['order']=qs['sort'](_0xbb290c[_0xac85('0x48')]['sort']);_0x4d45e5[_0xac85('0x51')]=qs['filters'](_[_0xac85('0x52')](_0xbb290c['query'],_0x25b5eb[_0xac85('0x4a')]));_0x4d45e5[_0xac85('0x51')]['MailAccountId']=_0x348e0d['id'];if(_0xbb290c['query'][_0xac85('0x54')]){_0x4d45e5[_0xac85('0x51')]=_[_0xac85('0x55')](_0x4d45e5['where'],{'$or':_['map'](_0x4d45e5[_0xac85('0x4c')],function(_0x638ca6){var _0x182301={};_0x182301[_0x638ca6]={'$like':'%'+_0xbb290c[_0xac85('0x48')][_0xac85('0x54')]+'%'};return _0x182301;})});}_0x4d45e5=_[_0xac85('0x55')]({},_0x4d45e5,_0xbb290c[_0xac85('0x56')]);return db[_0xac85('0x8b')][_0xac85('0x31')]({'where':_0x4d45e5[_0xac85('0x51')]})['then'](function(_0x329831){_0x4a93db['count']=_0x329831;if(_0xbb290c[_0xac85('0x48')][_0xac85('0x57')]){_0x4d45e5[_0xac85('0x58')]=[{'model':db[_0xac85('0x8e')],'as':_0xac85('0x8f'),'required':![]},{'model':db[_0xac85('0x90')],'as':_0xac85('0x91'),'attributes':['name',_0xac85('0x92'),_0xac85('0x93')],'required':![]},{'model':db[_0xac85('0x94')],'as':_0xac85('0x95'),'attributes':['id','name',_0xac85('0x96')],'where':_0xbb290c[_0xac85('0x48')]['tag']?{'id':_0xbb290c[_0xac85('0x48')]['tag']}:undefined,'required':_0xbb290c[_0xac85('0x48')][_0xac85('0x97')]?!![]:![]}];}return db[_0xac85('0x8b')][_0xac85('0x59')](_0x4d45e5);})['then'](function(_0x27ad0b){_0x4a93db[_0xac85('0x5a')]=_0x27ad0b;return _0x4a93db;});}})[_0xac85('0x36')](respondWithFilteredResult(_0x2d7e04,_0x4d45e5))['catch'](handleError(_0x2d7e04,null));};exports['addApplications']=function addApplications(_0x397eb8,_0x21a624){var _0x13f21f=_0x397eb8[_0xac85('0x5c')]['id'];var _0x225556=_0x397eb8[_0xac85('0x60')];var _0x83d5=0xc8;var _0x6cafed=null;return db[_0xac85('0x98')]['transaction']({'isolationLevel':db[_0xac85('0x98')]['Transaction']['ISOLATION_LEVELS'][_0xac85('0x99')]},function(_0x188904){return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0x13f21f},'transaction':_0x188904})[_0xac85('0x36')](function(_0x2eb01f){if(_0x2eb01f){return db[_0xac85('0x9a')][_0xac85('0x37')]({'where':{'MailAccountId':_0x13f21f},'transaction':_0x188904})['then'](function(){var _0x21d8b4=_[_0xac85('0x42')](_0x225556,function(_0x40695c){_0x40695c[_0xac85('0x63')]=_0x13f21f;return _0x40695c;});return db[_0xac85('0x9a')][_0xac85('0x9b')](_0x21d8b4,{'transaction':_0x188904});});}else{_0x83d5=0x194;_0x6cafed=[];}});})[_0xac85('0x36')](function(){if(_0x83d5!==0x194){return db[_0xac85('0x9a')]['findAndCountAll']({'where':{'MailAccountId':_0x13f21f},'order':'priority'})[_0xac85('0x36')](function(_0x1cca0d){_0x6cafed=_0x1cca0d;});}})['catch'](function(_0x12bd81){_0x83d5=0x1f4;logger[_0xac85('0x27')](_0x12bd81['stack']);if(_0x12bd81[_0xac85('0x3a')]){delete _0x12bd81[_0xac85('0x3a')];}_0x6cafed=_0x12bd81;})[_0xac85('0x9c')](function(){if(_0x6cafed===null){_0x21a624['sendStatus'](_0x83d5);}else{if(_0x83d5===0x1f4){_0x21a624[_0xac85('0x2b')](_0x83d5)[_0xac85('0x3b')](_0x6cafed);}else{_0x21a624[_0xac85('0x2b')](_0x83d5)[_0xac85('0x2d')](_0x6cafed);}}});};exports[_0xac85('0x9d')]=function(_0x3dc806,_0x54338a,_0x5ceae3){var _0x1ee30e={};var _0x12d552={};var _0x41d7c7;var _0x595a4f;return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0x3dc806['params']['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x54338a,null))[_0xac85('0x36')](function(_0x5dfaa1){if(_0x5dfaa1){_0x41d7c7=_0x5dfaa1;_0x12d552['model']=_[_0xac85('0x49')](db[_0xac85('0x9a')][_0xac85('0x44')]);_0x12d552[_0xac85('0x48')]=_[_0xac85('0x49')](_0x3dc806[_0xac85('0x48')]);_0x12d552[_0xac85('0x4a')]=_[_0xac85('0x4b')](_0x12d552['model'],_0x12d552[_0xac85('0x48')]);_0x1ee30e[_0xac85('0x4c')]=_[_0xac85('0x4b')](_0x12d552[_0xac85('0x47')],qs[_0xac85('0x4d')](_0x3dc806[_0xac85('0x48')][_0xac85('0x4d')]));_0x1ee30e[_0xac85('0x4c')]=_0x1ee30e[_0xac85('0x4c')][_0xac85('0x4e')]?_0x1ee30e[_0xac85('0x4c')]:_0x12d552[_0xac85('0x47')];_0x1ee30e[_0xac85('0x68')]=qs[_0xac85('0x50')](_0x3dc806[_0xac85('0x48')][_0xac85('0x50')]);_0x1ee30e[_0xac85('0x51')]=qs[_0xac85('0x4a')](_['pick'](_0x3dc806[_0xac85('0x48')],_0x12d552[_0xac85('0x4a')]));if(_0x3dc806[_0xac85('0x48')][_0xac85('0x54')]){_0x1ee30e[_0xac85('0x51')]=_[_0xac85('0x55')](_0x1ee30e['where'],{'$or':_[_0xac85('0x42')](_0x1ee30e['attributes'],function(_0x43491a){var _0x2f2c3a={};_0x2f2c3a[_0x43491a]={'$like':'%'+_0x3dc806[_0xac85('0x48')]['filter']+'%'};return _0x2f2c3a;})});}_0x1ee30e=_[_0xac85('0x55')]({},_0x1ee30e,_0x3dc806[_0xac85('0x56')]);return _0x41d7c7['getApplications'](_0x1ee30e);}})[_0xac85('0x36')](function(_0x56524f){if(_0x56524f){_0x595a4f=_0x56524f[_0xac85('0x4e')];if(!_0x3dc806[_0xac85('0x48')][_0xac85('0x67')](_0xac85('0x4f'))){_0x1ee30e[_0xac85('0x30')]=qs[_0xac85('0x30')](_0x3dc806['query'][_0xac85('0x30')]);_0x1ee30e['offset']=qs[_0xac85('0x2e')](_0x3dc806[_0xac85('0x48')][_0xac85('0x2e')]);}return _0x41d7c7[_0xac85('0x9d')](_0x1ee30e);}})['then'](function(_0x1729dc){if(_0x1729dc){return _0x1729dc?{'count':_0x595a4f,'rows':_0x1729dc}:null;}})['then'](respondWithResult(_0x54338a,null))[_0xac85('0x5f')](handleError(_0x54338a,null));};exports[_0xac85('0x9e')]=function(_0x674408,_0x430e65,_0x19c5e8){var _0x2782fb={'raw':!![],'where':{}};var _0x435cd0={};var _0x4bd99a={'count':0x0,'rows':[]};return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0x674408[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x430e65,null))[_0xac85('0x36')](function(_0x3698b4){if(_0x3698b4){_0x435cd0[_0xac85('0x47')]=_[_0xac85('0x49')](db[_0xac85('0x9f')][_0xac85('0x44')]);_0x435cd0[_0xac85('0x48')]=_[_0xac85('0x49')](_0x674408['query']);_0x435cd0[_0xac85('0x4a')]=_['intersection'](_0x435cd0['model'],_0x435cd0[_0xac85('0x48')]);_0x2782fb[_0xac85('0x4c')]=_[_0xac85('0x4b')](_0x435cd0[_0xac85('0x47')],qs['fields'](_0x674408[_0xac85('0x48')]['fields']));_0x2782fb[_0xac85('0x4c')]=_0x2782fb['attributes'][_0xac85('0x4e')]?_0x2782fb[_0xac85('0x4c')]:_0x435cd0[_0xac85('0x47')];if(!_0x674408['query'][_0xac85('0x67')]('nolimit')){_0x2782fb[_0xac85('0x30')]=qs[_0xac85('0x30')](_0x674408['query'][_0xac85('0x30')]);_0x2782fb[_0xac85('0x2e')]=qs[_0xac85('0x2e')](_0x674408[_0xac85('0x48')][_0xac85('0x2e')]);}_0x2782fb[_0xac85('0x68')]=qs[_0xac85('0x50')](_0x674408[_0xac85('0x48')][_0xac85('0x50')]);_0x2782fb['where']=qs[_0xac85('0x4a')](_[_0xac85('0x52')](_0x674408[_0xac85('0x48')],_0x435cd0[_0xac85('0x4a')]));_0x2782fb[_0xac85('0x51')][_0xac85('0x63')]=_0x3698b4['id'];if(_0x674408['query'][_0xac85('0x54')]){_0x2782fb[_0xac85('0x51')]=_[_0xac85('0x55')](_0x2782fb[_0xac85('0x51')],{'$or':_['map'](_0x2782fb['attributes'],function(_0x3ce792){var _0x33c7f6={};_0x33c7f6[_0x3ce792]={'$like':'%'+_0x674408[_0xac85('0x48')][_0xac85('0x54')]+'%'};return _0x33c7f6;})});}if(_0x674408[_0xac85('0x48')]['$gte']){var _0x3e22d4=_0x674408[_0xac85('0x48')][_0xac85('0xa0')]['split'](',');var _0x3a43f4={};_0x3a43f4[_0x3e22d4[0x0]]={'$gte':moment(_0x3e22d4[0x1])[_0xac85('0xa1')](_0xac85('0xa2'))};_0x2782fb[_0xac85('0x51')]=_['merge'](_0x2782fb['where'],_0x3a43f4);}_0x2782fb=_[_0xac85('0x55')]({},_0x2782fb,_0x674408['options']);return db[_0xac85('0x9f')][_0xac85('0x31')]({'where':_0x2782fb[_0xac85('0x51')]})[_0xac85('0x36')](function(_0x88489e){_0x4bd99a[_0xac85('0x31')]=_0x88489e;if(_0x674408[_0xac85('0x48')][_0xac85('0x57')]){_0x2782fb['include']=[{'all':!![]}];}return db['MailMessage'][_0xac85('0x59')](_0x2782fb);})[_0xac85('0x36')](function(_0x5b6b76){if(_0x674408[_0xac85('0x48')][_0xac85('0xa3')]===_0xac85('0xa4')){for(var _0x550418=0x0;_0x550418<_0x5b6b76['length'];_0x550418++){_0x5b6b76[_0x550418][_0xac85('0x60')]=juice(_0x5b6b76[_0x550418][_0xac85('0x60')]);}}_0x4bd99a[_0xac85('0x5a')]=_0x5b6b76;return _0x4bd99a;});}})[_0xac85('0x36')](respondWithFilteredResult(_0x430e65,_0x2782fb))['catch'](handleError(_0x430e65,null));};exports[_0xac85('0x3b')]=function(_0x48ff81,_0x57a616,_0x934d16){var _0x2643a6,_0x2ce7e1={},_0x4f79e0;if(_0x48ff81['body']['to']){_0x4f79e0=_0x48ff81[_0xac85('0x60')]['to'][_0xac85('0xa5')](',')[0x0];}return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x48ff81[_0xac85('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0xac85('0xa6'),'include':[{'model':db[_0xac85('0x8e')],'as':_0xac85('0xa7'),'where':{'email':_0x4f79e0},'limit':0x1,'order':[[_0xac85('0xa8'),'DESC']]}]},{'model':db[_0xac85('0x3e')],'as':_0xac85('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x57a616,null))[_0xac85('0x36')](function(_0x14a672){if(_0x14a672){_0x2643a6=_0x14a672;if(_0x14a672[_0xac85('0x3f')]){if(_[_0xac85('0x72')](_0x48ff81[_0xac85('0x60')][_0xac85('0xa9')])){_0x48ff81[_0xac85('0x60')][_0xac85('0xa9')]=util[_0xac85('0xa1')]('%s\x20<%s>',_0x14a672[_0xac85('0x3a')],_0x14a672[_0xac85('0x70')]||_0x14a672[_0xac85('0x3f')][_0xac85('0x75')]);}if(_0x48ff81[_0xac85('0x60')][_0xac85('0xaa')]&&_0x48ff81[_0xac85('0x60')][_0xac85('0xaa')][_0xac85('0x4e')]){for(var _0x11dd3b=0x0;_0x11dd3b<_0x48ff81[_0xac85('0x60')]['attachments'][_0xac85('0x4e')];_0x11dd3b+=0x1){_0x48ff81[_0xac85('0x60')]['attachments'][_0x11dd3b]={'filename':_0x48ff81[_0xac85('0x60')]['attachments'][_0x11dd3b][_0xac85('0x3a')],'path':path['join'](config[_0xac85('0xab')],_0xac85('0xac'),_0x48ff81[_0xac85('0x60')][_0xac85('0xaa')][_0x11dd3b][_0xac85('0xad')])};}}var _0x310f25={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x14a672[_0xac85('0x3f')][_0xac85('0x7b')])){if(_0x14a672[_0xac85('0x3f')][_0xac85('0x78')]){_0x310f25[_0xac85('0xae')]={'user':_0x14a672[_0xac85('0x3f')][_0xac85('0x75')],'pass':_0x14a672['Smtp'][_0xac85('0x76')]};}_0x310f25[_0xac85('0x79')]=_0x14a672['Smtp'][_0xac85('0x79')];_0x310f25[_0xac85('0x7a')]=_0x14a672['Smtp'][_0xac85('0x7a')];_0x310f25[_0xac85('0xaf')]=_0x14a672[_0xac85('0x3f')][_0xac85('0xaf')];}else{_0x310f25['service']=_0x14a672[_0xac85('0x3f')][_0xac85('0x7b')];_0x310f25['auth']={'user':_0x14a672[_0xac85('0x3f')][_0xac85('0x75')],'pass':_0x14a672['Smtp'][_0xac85('0x76')]};}return respondWithRpcPromise(_0xac85('0xb0'),_0xac85('0xb1'),{'account':_0x310f25,'message':_0x48ff81[_0xac85('0x60')]});}else{throw new Error(_0xac85('0xb2'));}}})[_0xac85('0x36')](function(_0xa6d2ed){if(_0xa6d2ed){_0x2ce7e1=_0xa6d2ed;if(_0x2643a6[_0xac85('0xa6')]){if(_0x2643a6[_0xac85('0xa6')]['Contacts'][_0xac85('0x4e')]){return _0x2643a6['List']['Contacts'][0x0];}else{return db[_0xac85('0x8e')][_0xac85('0x64')](_['defaults'](_0x48ff81['body'],{'firstName':_0x48ff81[_0xac85('0x60')]['to'],'email':_0x48ff81[_0xac85('0x60')]['to'],'phone':_0x48ff81['body']['to'],'ListId':_0x2643a6[_0xac85('0xb3')]}));}}else{throw new Error(_0xac85('0xb2'));}}})[_0xac85('0x36')](function(_0x423a3a){if(_0x423a3a){var _0x3cc2f8={'UserId':_0x48ff81[_0xac85('0x75')]['id'],'ContactId':_0x423a3a['id'],'MailAccountId':_0x2643a6['id'],'inReplyTo':_0x2ce7e1[_0xac85('0xb4')],'to':_0x48ff81[_0xac85('0x60')][_0xac85('0xa9')],'cc':_0x48ff81[_0xac85('0x60')]['cc'],'subject':_0x48ff81['body'][_0xac85('0xb5')],'attach':_0x48ff81['body'][_0xac85('0xb6')],'firstMsgDirection':_0xac85('0xb7'),'lastMsgAt':moment()[_0xac85('0xa1')](_0xac85('0xa2')),'lastMsgDirection':_0xac85('0xb7'),'Messages':[_[_0xac85('0x55')](_0x48ff81[_0xac85('0x60')],{'messageId':_0x2ce7e1[_0xac85('0xb4')],'sentAt':moment()[_0xac85('0xa1')](_0xac85('0xa2')),'read':!![],'MailAccountId':_0x2643a6['id'],'UserId':_0x48ff81[_0xac85('0x75')]['id'],'ContactId':_0x423a3a['id']})]};if(_0x48ff81[_0xac85('0x60')][_0xac85('0xb8')]){_0x3cc2f8=_[_0xac85('0x55')](_0x3cc2f8,_0x48ff81[_0xac85('0x60')][_0xac85('0xb8')]);}return db[_0xac85('0x8b')]['create'](_0x3cc2f8,{'include':[{'model':db['MailMessage'],'as':_0xac85('0xb9')}]});}})[_0xac85('0x36')](respondWithResult(_0x57a616,null))[_0xac85('0x5f')](handleError(_0x57a616,null));};exports[_0xac85('0xba')]=function(_0x2315da,_0x403174,_0x3ab817){return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x2315da[_0xac85('0x5c')]['id']},'include':[{'model':db[_0xac85('0x3e')],'as':'Smtp','raw':!![]}]})[_0xac85('0x36')](handleEntityNotFound(_0x403174,null))[_0xac85('0x36')](function(_0x239072){if(_0x239072&&_0x239072[_0xac85('0x3f')]){var _0xf0ae09={'id':_0x239072['id'],'tls':{'rejectUnauthorized':![]}};if(_0x239072[_0xac85('0x3f')][_0xac85('0x7b')]){_0xf0ae09[_0xac85('0x7b')]=_0x239072[_0xac85('0x3f')]['service'];}else{_0xf0ae09['host']=_0x239072['Smtp'][_0xac85('0x79')];_0xf0ae09[_0xac85('0x7a')]=_0x239072[_0xac85('0x3f')]['port'];_0xf0ae09['secure']=_0x239072[_0xac85('0x3f')][_0xac85('0xaf')];}if(_0x239072[_0xac85('0x3f')][_0xac85('0x78')]){_0xf0ae09[_0xac85('0xae')]={'user':_0x239072['Smtp']['user'],'pass':_0x239072[_0xac85('0x3f')][_0xac85('0x76')]};}return respondWithRpcPromise(_0xac85('0xbb'),_0xac85('0xba'),{'account':_0xf0ae09});}})[_0xac85('0x36')](respondWithResult(_0x403174,null))[_0xac85('0x5f')](handleError(_0x403174,null));};exports[_0xac85('0x37')]=function(_0x4ba3a5,_0x49a548){return db['MailAccount']['find']({'where':{'id':_0x4ba3a5[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x49a548,null))[_0xac85('0x36')](function(_0x44a661){if(_0x44a661&&_0x44a661[_0xac85('0x7b')]){throw new db[(_0xac85('0xbc'))][(_0xac85('0xbd'))](_0xac85('0xbe'));}return _0x44a661;})[_0xac85('0x36')](removeEntity(_0x49a548,null))[_0xac85('0x5f')](handleError(_0x49a548,null));};exports[_0xac85('0xbf')]=function(_0x40752f,_0x2d9ea5,_0x1ee161){return db[_0xac85('0x43')][_0xac85('0x5e')]({'where':{'id':_0x40752f[_0xac85('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2d9ea5,null))['then'](function(_0x2cea9e){if(_0x2cea9e){return _0x2cea9e[_0xac85('0xbf')](_0x40752f[_0xac85('0x60')][_0xac85('0x6a')],_[_0xac85('0x8c')](_0x40752f[_0xac85('0x60')],[_0xac85('0x6a'),'id'])||{})['spread'](function(_0x2970c7){for(var _0xc320ee=0x0;_0xc320ee<_0x40752f['body']['ids'][_0xac85('0x4e')];_0xc320ee+=0x1){socket[_0xac85('0xc0')](_0xac85('0xc1'),{'UserId':Number(_0x40752f[_0xac85('0x60')]['ids'][_0xc320ee]),'MailAccountId':Number(_0x40752f[_0xac85('0x5c')]['id'])});}return _0x2970c7;});}})[_0xac85('0x36')](respondWithResult(_0x2d9ea5,null))[_0xac85('0x5f')](handleError(_0x2d9ea5,null));};exports['removeAgents']=function(_0x4960ee,_0x2a3e8e,_0x84d26f){return db[_0xac85('0x43')]['find']({'where':{'id':_0x4960ee[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x2a3e8e,null))['then'](function(_0x1bd21b){if(_0x1bd21b){return _0x1bd21b[_0xac85('0xc2')](_0x4960ee[_0xac85('0x48')][_0xac85('0x6a')])[_0xac85('0x36')](function(){if(_[_0xac85('0xc3')](_0x4960ee[_0xac85('0x48')]['ids'])){for(var _0x18835f=0x0;_0x18835f<_0x4960ee[_0xac85('0x48')]['ids'][_0xac85('0x4e')];_0x18835f+=0x1){socket['emit'](_0xac85('0xc4'),{'UserId':Number(_0x4960ee['query']['ids'][_0x18835f]),'MailAccountId':Number(_0x4960ee[_0xac85('0x5c')]['id'])});}}else{socket['emit'](_0xac85('0xc4'),{'UserId':Number(_0x4960ee['query'][_0xac85('0x6a')]),'MailAccountId':Number(_0x4960ee[_0xac85('0x5c')]['id'])});}});}})[_0xac85('0x36')](respondWithStatusCode(_0x2a3e8e,null))[_0xac85('0x5f')](handleError(_0x2a3e8e,null));};exports['getAgents']=function(_0x4f723a,_0x1c25c1,_0x582608){var _0x3dfa0d={};var _0x77f5ed={};var _0x4d580e;var _0x4e9b76;return db[_0xac85('0x43')][_0xac85('0x65')]({'where':{'id':_0x4f723a[_0xac85('0x5c')]['id']}})[_0xac85('0x36')](handleEntityNotFound(_0x1c25c1,null))[_0xac85('0x36')](function(_0x4d0c48){if(_0x4d0c48){_0x4d580e=_0x4d0c48;_0x77f5ed[_0xac85('0x47')]=_['keys'](db[_0xac85('0x90')][_0xac85('0x44')]);_0x77f5ed['query']=_['keys'](_0x4f723a[_0xac85('0x48')]);_0x77f5ed[_0xac85('0x4a')]=_['intersection'](_0x77f5ed[_0xac85('0x47')],_0x77f5ed[_0xac85('0x48')]);_0x3dfa0d['attributes']=_[_0xac85('0x4b')](_0x77f5ed[_0xac85('0x47')],qs[_0xac85('0x4d')](_0x4f723a[_0xac85('0x48')]['fields']));_0x3dfa0d['attributes']=_0x3dfa0d['attributes']['length']?_0x3dfa0d['attributes']:_0x77f5ed['model'];_0x3dfa0d['order']=qs[_0xac85('0x50')](_0x4f723a[_0xac85('0x48')][_0xac85('0x50')]);_0x3dfa0d[_0xac85('0x51')]=qs[_0xac85('0x4a')](_[_0xac85('0x52')](_0x4f723a[_0xac85('0x48')],_0x77f5ed[_0xac85('0x4a')]));if(_0x4f723a[_0xac85('0x48')][_0xac85('0x54')]){_0x3dfa0d[_0xac85('0x51')]=_[_0xac85('0x55')](_0x3dfa0d[_0xac85('0x51')],{'$or':_[_0xac85('0x42')](_0x3dfa0d['attributes'],function(_0x460485){var _0x10863c={};_0x10863c[_0x460485]={'$like':'%'+_0x4f723a[_0xac85('0x48')][_0xac85('0x54')]+'%'};return _0x10863c;})});}_0x3dfa0d=_[_0xac85('0x55')]({},_0x3dfa0d,_0x4f723a[_0xac85('0x56')]);return _0x4d580e[_0xac85('0xc5')](_0x3dfa0d);}})['then'](function(_0x58163e){if(_0x58163e){_0x4e9b76=_0x58163e[_0xac85('0x4e')];if(!_0x4f723a[_0xac85('0x48')][_0xac85('0x67')](_0xac85('0x4f'))){_0x3dfa0d[_0xac85('0x30')]=qs[_0xac85('0x30')](_0x4f723a[_0xac85('0x48')][_0xac85('0x30')]);_0x3dfa0d['offset']=qs[_0xac85('0x2e')](_0x4f723a[_0xac85('0x48')][_0xac85('0x2e')]);}return _0x4d580e[_0xac85('0xc5')](_0x3dfa0d);}})['then'](function(_0x43be46){if(_0x43be46){return _0x43be46?{'count':_0x4e9b76,'rows':_0x43be46}:null;}})[_0xac85('0x36')](respondWithResult(_0x1c25c1,null))['catch'](handleError(_0x1c25c1,null));}; \ No newline at end of file +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 diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index c685d7b..5d2edcd 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 _0xe6e9=['../../mysqldb','MailAccount','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x36d8ff,_0x224895){var _0x906ef5=function(_0x2c21f1){while(--_0x2c21f1){_0x36d8ff['push'](_0x36d8ff['shift']());}};_0x906ef5(++_0x224895);}(_0xe6e9,0x182));var _0x9e6e=function(_0x5c470c,_0x14c042){_0x5c470c=_0x5c470c-0x0;var _0x55281d=_0xe6e9[_0x5c470c];return _0x55281d;};'use strict';var EventEmitter=require(_0x9e6e('0x0'));var MailAccount=require(_0x9e6e('0x1'))['db'][_0x9e6e('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e6e('0x3'),'afterUpdate':_0x9e6e('0x4'),'afterDestroy':_0x9e6e('0x5')};function emitEvent(_0x3313dc){return function(_0x1f6d79,_0x5f4c0b,_0x1f64e8){MailAccountEvents[_0x9e6e('0x6')](_0x3313dc+':'+_0x1f6d79['id'],_0x1f6d79);MailAccountEvents[_0x9e6e('0x6')](_0x3313dc,_0x1f6d79);_0x1f64e8(null);};}for(var e in events){if(events[_0x9e6e('0x7')](e)){var event=events[e];MailAccount[_0x9e6e('0x8')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file +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 diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 9fe8695..c717c1c 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 _0x9ee1=['api','moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','define','mail_accounts','../../config/logger'];(function(_0x1073ad,_0x44bf0b){var _0x528474=function(_0x3450f7){while(--_0x3450f7){_0x1073ad['push'](_0x1073ad['shift']());}};_0x528474(++_0x44bf0b);}(_0x9ee1,0x167));var _0x19ee=function(_0x30877b,_0x4674a3){_0x30877b=_0x30877b-0x0;var _0x1169c5=_0x9ee1[_0x30877b];return _0x1169c5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x19ee('0x0'))(_0x19ee('0x1'));var moment=require(_0x19ee('0x2'));var BPromise=require('bluebird');var rp=require(_0x19ee('0x3'));var fs=require('fs');var path=require(_0x19ee('0x4'));var rimraf=require(_0x19ee('0x5'));var config=require(_0x19ee('0x6'));var attributes=require(_0x19ee('0x7'));module['exports']=function(_0x70bdaf,_0x1457d6){return _0x70bdaf[_0x19ee('0x8')]('MailAccount',attributes,{'tableName':_0x19ee('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index e349749..0222012 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 _0x3189=['startRouting','Start','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','MailAccount,\x20%s,\x20%s','message','result','catch','MailAccount','findAll','options','raw','limit','map','include','model','attributes','GetMailAccount','stringify','ShowMailAccount','find','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','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','account','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','applications','list','asc','push','length','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','Messages','MailInteraction','Contact\x20not\x20found','interaction','created','MailMessage','attachments','originCc','bcc','ChatWebsiteId','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','agent','waitForTheAssignedAgent'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3189,0x68));var _0x9318=function(_0x238ee7,_0x29f9c2){_0x238ee7=_0x238ee7-0x0;var _0x35f5ea=_0x3189[_0x238ee7];return _0x35f5ea;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var moment=require('moment');var BPromise=require(_0x9318('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9318('0x3'));var db=require(_0x9318('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9318('0x5'))(_0x9318('0x6'));var config=require(_0x9318('0x7'));var jayson=require(_0x9318('0x8'));var client=jayson[_0x9318('0x9')][_0x9318('0xa')]({'port':0x232c});config['redis']=_[_0x9318('0xb')](config['redis'],{'host':_0x9318('0xc'),'port':0x18eb});var socket=require(_0x9318('0xd'))(new Redis(config['redis']));require(_0x9318('0xe'))[_0x9318('0xf')](socket);function respondWithRpcPromise(_0x38b107,_0x1b3019,_0x692c1a){return new BPromise(function(_0x5528fb,_0x5421eb){return client[_0x9318('0x10')](_0x38b107,_0x692c1a)[_0x9318('0x11')](function(_0x188601){logger[_0x9318('0x12')]('MailAccount,\x20%s,\x20%s',_0x1b3019,_0x9318('0x13'));logger[_0x9318('0x14')](_0x9318('0x15'),_0x1b3019,_0x9318('0x13'),JSON['stringify'](_0x188601));if(_0x188601[_0x9318('0x16')]){if(_0x188601[_0x9318('0x16')]['code']===0x1f4){logger[_0x9318('0x16')](_0x9318('0x17'),_0x1b3019,_0x188601[_0x9318('0x16')][_0x9318('0x18')]);return _0x5421eb(_0x188601[_0x9318('0x16')][_0x9318('0x18')]);}logger[_0x9318('0x16')](_0x9318('0x17'),_0x1b3019,_0x188601[_0x9318('0x16')][_0x9318('0x18')]);return _0x5528fb(_0x188601['error'][_0x9318('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x1b3019,_0x9318('0x13'));_0x5528fb(_0x188601[_0x9318('0x19')][_0x9318('0x18')]);}})[_0x9318('0x1a')](function(_0x308012){logger[_0x9318('0x16')](_0x9318('0x17'),_0x1b3019,_0x308012);_0x5421eb(_0x308012);});});}exports['GetMailAccount']=function(_0x4c440c){var _0x59c19e=this;return new Promise(function(_0x11c559,_0x2c5d82){return db[_0x9318('0x1b')][_0x9318('0x1c')]({'raw':_0x4c440c[_0x9318('0x1d')]?_0x4c440c['options'][_0x9318('0x1e')]===undefined?!![]:![]:!![],'where':_0x4c440c['options']?_0x4c440c[_0x9318('0x1d')]['where']||null:null,'attributes':_0x4c440c[_0x9318('0x1d')]?_0x4c440c[_0x9318('0x1d')]['attributes']||null:null,'limit':_0x4c440c['options']?_0x4c440c[_0x9318('0x1d')][_0x9318('0x1f')]||null:null,'include':_0x4c440c[_0x9318('0x1d')]?_0x4c440c[_0x9318('0x1d')]['include']?_[_0x9318('0x20')](_0x4c440c[_0x9318('0x1d')][_0x9318('0x21')],function(_0x40e64b){return{'model':db[_0x40e64b[_0x9318('0x22')]],'as':_0x40e64b['as'],'attributes':_0x40e64b['attributes'],'include':_0x40e64b['include']?_[_0x9318('0x20')](_0x40e64b['include'],function(_0x2b67fc){return{'model':db[_0x2b67fc['model']],'as':_0x2b67fc['as'],'attributes':_0x2b67fc[_0x9318('0x23')],'include':_0x2b67fc['include']?_[_0x9318('0x20')](_0x2b67fc[_0x9318('0x21')],function(_0x1240ee){return{'model':db[_0x1240ee[_0x9318('0x22')]],'as':_0x1240ee['as'],'attributes':_0x1240ee[_0x9318('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9318('0x11')](function(_0x1e5348){logger[_0x9318('0x12')](_0x9318('0x24'),_0x4c440c);logger[_0x9318('0x14')](_0x9318('0x24'),_0x4c440c,JSON[_0x9318('0x25')](_0x1e5348));_0x11c559(_0x1e5348);})[_0x9318('0x1a')](function(_0x514d78){logger['error'](_0x9318('0x24'),_0x514d78[_0x9318('0x18')],_0x4c440c);_0x2c5d82(_0x59c19e[_0x9318('0x16')](0x1f4,_0x514d78['message']));});});};exports[_0x9318('0x26')]=function(_0x2de64b){var _0x3f4025=this;return new Promise(function(_0x4f5cb1,_0xbaa8e3){return db[_0x9318('0x1b')][_0x9318('0x27')]({'raw':_0x2de64b[_0x9318('0x1d')]?_0x2de64b[_0x9318('0x1d')][_0x9318('0x1e')]===undefined?!![]:![]:!![],'where':_0x2de64b['options']?_0x2de64b[_0x9318('0x1d')]['where']||null:null,'attributes':_0x2de64b[_0x9318('0x1d')]?_0x2de64b[_0x9318('0x1d')][_0x9318('0x23')]||null:null,'include':_0x2de64b[_0x9318('0x1d')]?_0x2de64b[_0x9318('0x1d')]['include']?_[_0x9318('0x20')](_0x2de64b[_0x9318('0x1d')][_0x9318('0x21')],function(_0x4fddf9){return{'model':db[_0x4fddf9['model']],'as':_0x4fddf9['as'],'attributes':_0x4fddf9[_0x9318('0x23')],'include':_0x4fddf9[_0x9318('0x21')]?_[_0x9318('0x20')](_0x4fddf9[_0x9318('0x21')],function(_0x3e0f75){return{'model':db[_0x3e0f75[_0x9318('0x22')]],'as':_0x3e0f75['as'],'attributes':_0x3e0f75[_0x9318('0x23')],'include':_0x3e0f75[_0x9318('0x21')]?_[_0x9318('0x20')](_0x3e0f75[_0x9318('0x21')],function(_0x15e4dd){return{'model':db[_0x15e4dd[_0x9318('0x22')]],'as':_0x15e4dd['as'],'attributes':_0x15e4dd[_0x9318('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x385000){logger[_0x9318('0x12')]('ShowMailAccount',_0x2de64b);logger[_0x9318('0x14')]('ShowMailAccount',_0x2de64b,JSON[_0x9318('0x25')](_0x385000));_0x4f5cb1(_0x385000);})['catch'](function(_0x27611b){logger['error'](_0x9318('0x26'),_0x27611b['message'],_0x2de64b);_0xbaa8e3(_0x3f4025[_0x9318('0x16')](0x1f4,_0x27611b[_0x9318('0x18')]));});});};exports[_0x9318('0x28')]=function(_0x5a65ae){var _0x168194=this;return new Promise(function(_0x4e9953,_0x12da67){var _0x90bd88={'body':_0x5a65ae[_0x9318('0x29')],'channel':_0x9318('0x2a')};var _0x527c67=_[_0x9318('0x2b')](_[_0x9318('0x2c')](db[_0x9318('0x2d')][_0x9318('0x2e')]),[_0x9318('0x2f'),_0x9318('0x30'),_0x9318('0x31'),_0x9318('0x32')]);var _0x46ce50=![];if(_0x5a65ae['body']['id']){delete _0x5a65ae[_0x9318('0x29')]['id'];}if(_[_0x9318('0x33')](_0x5a65ae[_0x9318('0x29')][_0x9318('0x34')])){return _0x12da67(_0x168194[_0x9318('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x9318('0x33')](_0x5a65ae[_0x9318('0x29')][_0x9318('0x29')])||_0x5a65ae[_0x9318('0x29')]['body']===''){return _0x12da67(_0x168194['error'](0x1f4,_0x9318('0x35')));}if(_[_0x9318('0x33')](_0x5a65ae[_0x9318('0x29')]['mapKey'])){return _0x12da67(_0x168194[_0x9318('0x16')](0x1f4,_0x9318('0x36')+_0x527c67));}if(!_[_0x9318('0x37')](_0x527c67,_0x5a65ae[_0x9318('0x29')][_0x9318('0x38')])){return _0x12da67(_0x168194[_0x9318('0x16')](0x1f4,_0x9318('0x39')+_0x527c67));}var _0x25af32={};_0x25af32[_0x5a65ae[_0x9318('0x29')][_0x9318('0x38')]]=_0x5a65ae[_0x9318('0x29')]['from'];return db[_0x9318('0x1b')][_0x9318('0x27')]({'where':{'id':_0x5a65ae[_0x9318('0x3a')]['id']},'include':[{'model':db[_0x9318('0x3b')],'as':_0x9318('0x3c'),'include':[{'model':db[_0x9318('0x2d')],'as':_0x9318('0x3d'),'where':_0x25af32,'limit':0x1,'order':[[_0x9318('0x30'),_0x9318('0x3e')]]}]},{'model':db[_0x9318('0x3f')],'as':_0x9318('0x40')},{'model':db[_0x9318('0x41')],'as':_0x9318('0x42')}]})[_0x9318('0x11')](function(_0x5ae5a2){if(_0x5ae5a2&&_0x5ae5a2[_0x9318('0x3c')]){var _0x54e644=_0x5ae5a2['get']({'plain':!![]});_0x90bd88[_0x9318('0x3a')]=_['omit'](_0x54e644,[_0x9318('0x40'),'List']);_0x90bd88[_0x9318('0x43')]=_0x54e644[_0x9318('0x40')];_0x90bd88[_0x9318('0x44')]=_0x54e644[_0x9318('0x3c')];_0x90bd88[_0x9318('0x43')]=_['orderBy'](_0x90bd88[_0x9318('0x43')],['priority'],[_0x9318('0x45')]);if(_0x90bd88[_0x9318('0x3a')]&&_0x90bd88[_0x9318('0x3a')]['autoclose']){_0x90bd88['applications'][_0x9318('0x46')]({'id':0x0,'priority':_0x90bd88[_0x9318('0x43')][_0x9318('0x47')]+0x1,'app':'close','appdata':'autoclose','interval':_0x9318('0x48')});}if(_0x90bd88[_0x9318('0x3a')][_0x9318('0x40')]){delete _0x90bd88[_0x9318('0x3a')]['Applications'];}if(_0x90bd88[_0x9318('0x3a')]['List']){delete _0x90bd88[_0x9318('0x3a')][_0x9318('0x3c')];}if(_0x54e644[_0x9318('0x3c')][_0x9318('0x3d')][_0x9318('0x47')]){return _0x54e644['List'][_0x9318('0x3d')][0x0];}var _0x48514e=_[_0x9318('0xb')](_0x5a65ae[_0x9318('0x29')],{'firstName':_0x5a65ae[_0x9318('0x29')]['from'],'ListId':_0x54e644[_0x9318('0x32')]});_0x48514e[_0x5a65ae['body'][_0x9318('0x38')]]=_0x5a65ae[_0x9318('0x29')][_0x9318('0x34')];return db['CmContact'][_0x9318('0x49')](_0x48514e);}else{throw new Error(_0x9318('0x4a'));}})['then'](function(_0x309ae8){_0x90bd88[_0x9318('0x4b')]=_0x309ae8;if(_0x309ae8){if(!_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x4c')]){_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x4c')]=rs[_0x9318('0x4d')]()+'\x20'+_0x5a65ae[_0x9318('0x29')]['message'][_0x9318('0x34')];}var _0x4f4bb8={'ContactId':_0x309ae8['id'],'MailAccountId':_0x5a65ae[_0x9318('0x3a')]['id'],'inReplyTo':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x4c')],'to':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['from'],'cc':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['cc'],'subject':_0x5a65ae['body'][_0x9318('0x18')][_0x9318('0x4e')],'attach':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x4f')],'lastMsgAt':moment()[_0x9318('0x50')](_0x9318('0x51')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x9318('0x27')]({'where':{'closed':![],'MailAccountId':_0x5a65ae[_0x9318('0x3a')]['id']},'include':[{'model':db['MailMessage'],'as':_0x9318('0x52'),'attributes':[_0x9318('0x4c')],'where':{'messageId':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['inReplyTo']}}]})['then'](function(_0x3cf94d){if(_0x3cf94d){return[_0x3cf94d,![]];}return db[_0x9318('0x53')][_0x9318('0x49')](_0x4f4bb8)['then'](function(_0x2473bd){return[_0x2473bd,!![]];});});}else{throw new Error(_0x9318('0x54'));}})['spread'](function(_0x2a264b,_0x3ecbed){if(_0x2a264b){_0x46ce50=_0x3ecbed;if(!_0x3ecbed){return _0x2a264b['update']({'inReplyTo':_0x5a65ae[_0x9318('0x29')]['message']['messageId'],'to':_0x5a65ae['body'][_0x9318('0x18')][_0x9318('0x34')],'cc':_0x5a65ae[_0x9318('0x29')]['message']['cc'],'subject':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['subject'],'attach':_0x2a264b[_0x9318('0x4f')]?_0x2a264b[_0x9318('0x4f')]:_0x5a65ae[_0x9318('0x29')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0x9318('0x50')](_0x9318('0x51')),'lastMsgAt':moment()[_0x9318('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x2a264b;}}})[_0x9318('0x11')](function(_0x31155b){_0x90bd88[_0x9318('0x55')]=_0x31155b['get']({'plain':!![]});_0x90bd88['interaction'][_0x9318('0x56')]=_0x46ce50;return db[_0x9318('0x57')][_0x9318('0x49')]({'body':_0x5a65ae['body']['body'],'MailAccountId':_0x5a65ae[_0x9318('0x3a')]['id'],'MailInteractionId':_0x31155b['id'],'direction':'in','ContactId':_0x90bd88[_0x9318('0x4b')]['id'],'messageId':_0x5a65ae[_0x9318('0x29')]['message'][_0x9318('0x4c')],'from':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x34')],'to':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['to'],'cc':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['cc'],'subject':_0x5a65ae[_0x9318('0x29')]['message'][_0x9318('0x4e')],'attach':_0x5a65ae[_0x9318('0x29')]['message'][_0x9318('0x4f')],'Attachments':_0x5a65ae[_0x9318('0x29')]['message'][_0x9318('0x58')],'originTo':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['originTo'],'originCc':_0x5a65ae['body'][_0x9318('0x18')][_0x9318('0x59')],'bcc':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x5a')],'ChatWebsiteId':_0x5a65ae[_0x9318('0x29')]['message'][_0x9318('0x5b')]||null,'originChannel':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')]['originChannel']||_0x9318('0x5c'),'ChatOfflineMessageId':_0x5a65ae[_0x9318('0x29')][_0x9318('0x18')][_0x9318('0x5d')]||null},{'include':[{'model':db[_0x9318('0x5e')],'as':_0x9318('0x5f')}]});})[_0x9318('0x11')](function(_0x21208c){_0x90bd88['message']=_0x21208c;if(_0x90bd88[_0x9318('0x55')][_0x9318('0x60')]){return db['User'][_0x9318('0x27')]({'attributes':['id',_0x9318('0x61')],'where':{'id':_0x90bd88['interaction'][_0x9318('0x60')]}})[_0x9318('0x11')](function(_0x19e23b){if(_0x19e23b){_0x90bd88['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x9318('0x62'),'appdata':_0x19e23b['name']+','+(_0x90bd88['account'][_0x9318('0x63')]||0xa),'interval':_0x9318('0x48')});}return respondWithRpcPromise('Start',_0x9318('0x64'),_0x90bd88);});}return respondWithRpcPromise(_0x9318('0x65'),_0x9318('0x64'),_0x90bd88);})['then'](function(_0x2b2618){_0x4e9953(_0x2b2618);})[_0x9318('0x1a')](function(_0x547aab){_0x12da67(_0x168194['error'](0x1f4,_0x547aab[_0x9318('0x18')]));});});}; \ No newline at end of file +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 diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index f679f99..251b3a5 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 _0xafe9=['update','emit','removeListener','length','mailAccount:'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xafe9,0x1ea));var _0x9afe=function(_0xed970b,_0x174c58){_0xed970b=_0xed970b-0x0;var _0x50fd51=_0xafe9[_0xed970b];return _0x50fd51;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save','remove',_0x9afe('0x0')];function createListener(_0x256836,_0x339d00){return function(_0xb26d5e){_0x339d00[_0x9afe('0x1')](_0x256836,_0xb26d5e);};}function removeListener(_0x14ab5a,_0x337c95){return function(){MailAccountEvents[_0x9afe('0x2')](_0x14ab5a,_0x337c95);};}exports['register']=function(_0x49dcfa){for(var _0x4bf518=0x0,_0x86b484=events[_0x9afe('0x3')];_0x4bf518<_0x86b484;_0x4bf518++){var _0x19c209=events[_0x4bf518];var _0x216211=createListener(_0x9afe('0x4')+_0x19c209,_0x49dcfa);MailAccountEvents['on'](_0x19c209,_0x216211);}}; \ No newline at end of file +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 diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index d013067..cface91 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 _0xf521=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./mailApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x1120c7,_0x18f931){var _0x436f8a=function(_0x19f1dd){while(--_0x19f1dd){_0x1120c7['push'](_0x1120c7['shift']());}};_0x436f8a(++_0x18f931);}(_0xf521,0x1ba));var _0x1f52=function(_0x2f4311,_0xd2d511){_0x2f4311=_0x2f4311-0x0;var _0x309ccb=_0xf521[_0x2f4311];return _0x309ccb;};'use strict';var multer=require(_0x1f52('0x0'));var util=require(_0x1f52('0x1'));var path=require(_0x1f52('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f52('0x3')]();var fs_extra=require(_0x1f52('0x4'));var auth=require(_0x1f52('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1f52('0x6'));var controller=require(_0x1f52('0x7'));router[_0x1f52('0x8')]('/:id',auth[_0x1f52('0x9')](),controller[_0x1f52('0xa')]);router[_0x1f52('0xb')](_0x1f52('0xc'),auth[_0x1f52('0x9')](),controller[_0x1f52('0xd')]);router[_0x1f52('0xe')](_0x1f52('0xc'),auth['isAuthenticated'](),controller[_0x1f52('0xf')]);module[_0x1f52('0x10')]=router; \ No newline at end of file +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 diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 99d6c49..5b49a99 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 _0x785e=['STRING','noop','TEXT','sequelize','exports'];(function(_0x241d05,_0x1168f7){var _0x268896=function(_0x1c1c3f){while(--_0x1c1c3f){_0x241d05['push'](_0x241d05['shift']());}};_0x268896(++_0x1168f7);}(_0x785e,0x116));var _0xe785=function(_0x53b7cf,_0x5c3e0f){_0x53b7cf=_0x53b7cf-0x0;var _0x21a92b=_0x785e[_0x53b7cf];return _0x21a92b;};'use strict';var Sequelize=require(_0xe785('0x0'));module[_0xe785('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xe785('0x2')],'allowNull':![],'defaultValue':_0xe785('0x3')},'appdata':{'type':Sequelize[_0xe785('0x4')]()},'description':{'type':Sequelize[_0xe785('0x2')]},'interval':{'type':Sequelize[_0xe785('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +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 diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index b3133e2..2d33a92 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 _0xaa88=['limit','count','set','apply','reject','then','stack','name','send','params','model','keys','MailApplication','query','filters','intersection','attributes','fields','length','include','merge','options','find','update','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa88,0x137));var _0x8aa8=function(_0x3cb30b,_0x504b3e){_0x3cb30b=_0x3cb30b-0x0;var _0x2ca717=_0xaa88[_0x3cb30b];return _0x2ca717;};'use strict';var emlformat=require(_0x8aa8('0x0'));var rimraf=require(_0x8aa8('0x1'));var zipdir=require(_0x8aa8('0x2'));var jsonpatch=require(_0x8aa8('0x3'));var rp=require('request-promise');var moment=require(_0x8aa8('0x4'));var BPromise=require(_0x8aa8('0x5'));var Mustache=require(_0x8aa8('0x6'));var util=require(_0x8aa8('0x7'));var path=require(_0x8aa8('0x8'));var sox=require(_0x8aa8('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8aa8('0xa'));var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8aa8('0x18'))['db'];function respondWithStatusCode(_0xa691d6,_0x28132f){_0x28132f=_0x28132f||0xcc;return function(_0x535aa0){if(_0x535aa0){return _0xa691d6[_0x8aa8('0x19')](_0x28132f);}return _0xa691d6[_0x8aa8('0x1a')](_0x28132f)[_0x8aa8('0x1b')]();};}function respondWithResult(_0x4b686e,_0x391642){_0x391642=_0x391642||0xc8;return function(_0x4af534){if(_0x4af534){return _0x4b686e['status'](_0x391642)[_0x8aa8('0x1c')](_0x4af534);}};}function respondWithFilteredResult(_0x200662,_0xae81a0){return function(_0xa6c2af){if(_0xa6c2af){var _0x42a6a4=typeof _0xae81a0[_0x8aa8('0x1d')]===_0x8aa8('0x1e')&&typeof _0xae81a0[_0x8aa8('0x1f')]===_0x8aa8('0x1e');var _0x4e8ce3=_0xa6c2af['count'];var _0x2c1b9a=_0x42a6a4?0x0:_0xae81a0['offset'];var _0x557adc=_0x42a6a4?_0xa6c2af[_0x8aa8('0x20')]:_0xae81a0['offset']+_0xae81a0[_0x8aa8('0x1f')];var _0x41092b;if(_0x557adc>=_0x4e8ce3){_0x557adc=_0x4e8ce3;_0x41092b=0xc8;}else{_0x41092b=0xce;}_0x200662[_0x8aa8('0x1a')](_0x41092b);return _0x200662[_0x8aa8('0x21')]('Content-Range',_0x2c1b9a+'-'+_0x557adc+'/'+_0x4e8ce3)[_0x8aa8('0x1c')](_0xa6c2af);}return null;};}function patchUpdates(_0x36c445){return function(_0x2825fd){try{jsonpatch[_0x8aa8('0x22')](_0x2825fd,_0x36c445,!![]);}catch(_0x4c754e){return BPromise[_0x8aa8('0x23')](_0x4c754e);}return _0x2825fd['save']();};}function saveUpdates(_0x26cf63,_0x4cc455){return function(_0x1fdadd){if(_0x1fdadd){return _0x1fdadd['update'](_0x26cf63)[_0x8aa8('0x24')](function(_0x557e4e){return _0x557e4e;});}return null;};}function removeEntity(_0x65945b,_0x40adb5){return function(_0x3ca7dc){if(_0x3ca7dc){return _0x3ca7dc['destroy']()[_0x8aa8('0x24')](function(){_0x65945b[_0x8aa8('0x1a')](0xcc)[_0x8aa8('0x1b')]();});}};}function handleEntityNotFound(_0x547a7b,_0x57acd2){return function(_0x2d1508){if(!_0x2d1508){_0x547a7b[_0x8aa8('0x19')](0x194);}return _0x2d1508;};}function handleError(_0x2f91f3,_0x3a3c7a){_0x3a3c7a=_0x3a3c7a||0x1f4;return function(_0x24143e){logger['error'](_0x24143e[_0x8aa8('0x25')]);if(_0x24143e['name']){delete _0x24143e[_0x8aa8('0x26')];}_0x2f91f3[_0x8aa8('0x1a')](_0x3a3c7a)[_0x8aa8('0x27')](_0x24143e);};}exports['show']=function(_0x4c5c5c,_0x10810d){var _0x5e96c9={'raw':!![],'where':{'id':_0x4c5c5c[_0x8aa8('0x28')]['id']}},_0x385208={};_0x385208[_0x8aa8('0x29')]=_[_0x8aa8('0x2a')](db[_0x8aa8('0x2b')]['rawAttributes']);_0x385208[_0x8aa8('0x2c')]=_[_0x8aa8('0x2a')](_0x4c5c5c['query']);_0x385208[_0x8aa8('0x2d')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],_0x385208['query']);_0x5e96c9[_0x8aa8('0x2f')]=_[_0x8aa8('0x2e')](_0x385208[_0x8aa8('0x29')],qs[_0x8aa8('0x30')](_0x4c5c5c[_0x8aa8('0x2c')][_0x8aa8('0x30')]));_0x5e96c9[_0x8aa8('0x2f')]=_0x5e96c9[_0x8aa8('0x2f')][_0x8aa8('0x31')]?_0x5e96c9[_0x8aa8('0x2f')]:_0x385208[_0x8aa8('0x29')];if(_0x4c5c5c['query']['includeAll']){_0x5e96c9[_0x8aa8('0x32')]=[{'all':!![]}];}_0x5e96c9=_[_0x8aa8('0x33')]({},_0x5e96c9,_0x4c5c5c[_0x8aa8('0x34')]);return db[_0x8aa8('0x2b')][_0x8aa8('0x35')](_0x5e96c9)[_0x8aa8('0x24')](handleEntityNotFound(_0x10810d,null))['then'](respondWithResult(_0x10810d,null))['catch'](handleError(_0x10810d,null));};exports[_0x8aa8('0x36')]=function(_0x5755b5,_0x24997c){if(_0x5755b5[_0x8aa8('0x37')]['id']){delete _0x5755b5[_0x8aa8('0x37')]['id'];}return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x5755b5[_0x8aa8('0x28')]['id']}})[_0x8aa8('0x24')](handleEntityNotFound(_0x24997c,null))['then'](saveUpdates(_0x5755b5['body'],null))[_0x8aa8('0x24')](respondWithResult(_0x24997c,null))[_0x8aa8('0x38')](handleError(_0x24997c,null));};exports['destroy']=function(_0x24eb18,_0x2e1f52){return db['MailApplication'][_0x8aa8('0x35')]({'where':{'id':_0x24eb18['params']['id']}})['then'](handleEntityNotFound(_0x2e1f52,null))[_0x8aa8('0x24')](removeEntity(_0x2e1f52,null))['catch'](handleError(_0x2e1f52,null));}; \ No newline at end of file +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 diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index d2b73ee..4af2dd9 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 _0xa3c8=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','mail_applications','utf8mb4'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3c8,0x1e1));var _0x8a3c=function(_0x356982,_0x10fd13){_0x356982=_0x356982-0x0;var _0x1951a4=_0xa3c8[_0x356982];return _0x1951a4;};'use strict';var _=require(_0x8a3c('0x0'));var util=require(_0x8a3c('0x1'));var logger=require(_0x8a3c('0x2'))(_0x8a3c('0x3'));var moment=require(_0x8a3c('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a3c('0x5'));var fs=require('fs');var path=require(_0x8a3c('0x6'));var rimraf=require(_0x8a3c('0x7'));var config=require(_0x8a3c('0x8'));var attributes=require(_0x8a3c('0x9'));module[_0x8a3c('0xa')]=function(_0x5adb87,_0x40bc3b){return _0x5adb87[_0x8a3c('0xb')]('MailApplication',attributes,{'tableName':_0x8a3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8a3c('0xd'),'collate':_0x8a3c('0xe')});}; \ No newline at end of file +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 diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c9c7bdd..d872e27 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 _0x9e5e=['info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','MailApplication','update','body','options','raw','attributes','limit','UpdateMailApplication','debug','stringify','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','request','then'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x9e5e,0x1e2));var _0xe9e5=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x9e5e[_0x36ed48];return _0x51c63a;};'use strict';var _=require(_0xe9e5('0x0'));var util=require(_0xe9e5('0x1'));var moment=require('moment');var BPromise=require(_0xe9e5('0x2'));var rs=require(_0xe9e5('0x3'));var fs=require('fs');var Redis=require(_0xe9e5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe9e5('0x5'));var logger=require('../../config/logger')(_0xe9e5('0x6'));var config=require(_0xe9e5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe9e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2333df,_0x4e0730,_0x3648a5){return new BPromise(function(_0x2533d8,_0x3c5c1b){return client[_0xe9e5('0x9')](_0x2333df,_0x3648a5)[_0xe9e5('0xa')](function(_0x18a551){logger[_0xe9e5('0xb')](_0xe9e5('0xc'),_0x4e0730,_0xe9e5('0xd'));logger['debug'](_0xe9e5('0xe'),_0x4e0730,_0xe9e5('0xd'),JSON['stringify'](_0x18a551));if(_0x18a551['error']){if(_0x18a551['error']['code']===0x1f4){logger[_0xe9e5('0xf')](_0xe9e5('0xc'),_0x4e0730,_0x18a551[_0xe9e5('0xf')][_0xe9e5('0x10')]);return _0x3c5c1b(_0x18a551[_0xe9e5('0xf')][_0xe9e5('0x10')]);}logger[_0xe9e5('0xf')](_0xe9e5('0xc'),_0x4e0730,_0x18a551[_0xe9e5('0xf')][_0xe9e5('0x10')]);return _0x2533d8(_0x18a551['error'][_0xe9e5('0x10')]);}else{logger[_0xe9e5('0xb')](_0xe9e5('0xc'),_0x4e0730,_0xe9e5('0xd'));_0x2533d8(_0x18a551[_0xe9e5('0x11')][_0xe9e5('0x10')]);}})[_0xe9e5('0x12')](function(_0x293c5b){logger[_0xe9e5('0xf')](_0xe9e5('0xc'),_0x4e0730,_0x293c5b);_0x3c5c1b(_0x293c5b);});});}exports['UpdateMailApplication']=function(_0x2df941){var _0x30550=this;return new Promise(function(_0x146c1f,_0x3ad9f9){return db[_0xe9e5('0x13')][_0xe9e5('0x14')](_0x2df941[_0xe9e5('0x15')],{'raw':_0x2df941[_0xe9e5('0x16')]?_0x2df941[_0xe9e5('0x16')][_0xe9e5('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2df941['options']?_0x2df941['options']['where']||null:null,'attributes':_0x2df941[_0xe9e5('0x16')]?_0x2df941[_0xe9e5('0x16')][_0xe9e5('0x18')]||null:null,'limit':_0x2df941[_0xe9e5('0x16')]?_0x2df941[_0xe9e5('0x16')][_0xe9e5('0x19')]||null:null})[_0xe9e5('0xa')](function(_0x15db4b){logger[_0xe9e5('0xb')](_0xe9e5('0x1a'),_0x2df941);logger[_0xe9e5('0x1b')]('UpdateMailApplication',_0x2df941,JSON[_0xe9e5('0x1c')](_0x15db4b));_0x146c1f(_0x15db4b);})['catch'](function(_0x16b561){logger['error'](_0xe9e5('0x1a'),_0x16b561['message'],_0x2df941);_0x3ad9f9(_0x30550['error'](0x1f4,_0x16b561['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 25c5517..5da840f 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 _0x7020=['show','/:id/messages','getMessages','/:id/download','download','create','addMessage','/:id/tags','tracked','mailinteraction:addtags','addTags','mailinteraction:update','update','delete','mail','removeTags','express','../../components/interaction/service','get','isAuthenticated','index','/describe','/:id'];(function(_0x178c89,_0x1f6cb7){var _0x245fb7=function(_0x319213){while(--_0x319213){_0x178c89['push'](_0x178c89['shift']());}};_0x245fb7(++_0x1f6cb7);}(_0x7020,0x10d));var _0x0702=function(_0x3ff165,_0x29087c){_0x3ff165=_0x3ff165-0x0;var _0x10b1d6=_0x7020[_0x3ff165];return _0x10b1d6;};'use strict';var express=require(_0x0702('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x0702('0x1'));var controller=require('./mailInteraction.controller');router[_0x0702('0x2')]('/',auth[_0x0702('0x3')](),controller[_0x0702('0x4')]);router[_0x0702('0x2')](_0x0702('0x5'),auth[_0x0702('0x3')](),controller['describe']);router[_0x0702('0x2')](_0x0702('0x6'),auth[_0x0702('0x3')](),controller[_0x0702('0x7')]);router[_0x0702('0x2')](_0x0702('0x8'),auth[_0x0702('0x3')](),controller[_0x0702('0x9')]);router[_0x0702('0x2')](_0x0702('0xa'),auth['isAuthenticated'](),controller[_0x0702('0xb')]);router['post']('/',auth[_0x0702('0x3')](),controller[_0x0702('0xc')]);router['post']('/:id/messages',auth[_0x0702('0x3')](),controller[_0x0702('0xd')]);router['post'](_0x0702('0xe'),auth[_0x0702('0x3')](),interaction[_0x0702('0xf')]('mail',_0x0702('0x10')),controller[_0x0702('0x11')]);router['put'](_0x0702('0x6'),auth[_0x0702('0x3')](),interaction[_0x0702('0xf')]('mail',_0x0702('0x12')),controller[_0x0702('0x13')]);router[_0x0702('0x14')](_0x0702('0x6'),auth[_0x0702('0x3')](),interaction['tracked'](_0x0702('0x15'),'mailinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth[_0x0702('0x3')](),controller[_0x0702('0x16')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index a1e01d4..d842925 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 _0x4ba1=['out','iconv','BOOLEAN','STRING','TEXT','long','DATE','ENUM'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0x4ba1,0x79));var _0x14ba=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4ba1[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x14ba('0x0'));module['exports']={'closed':{'type':Sequelize[_0x14ba('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x14ba('0x2')]},'thirdDisposition':{'type':Sequelize[_0x14ba('0x2')]},'note':{'type':Sequelize[_0x14ba('0x2')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x14ba('0x2')]},'cc':{'type':Sequelize[_0x14ba('0x3')](_0x14ba('0x4'))},'subject':{'type':Sequelize[_0x14ba('0x3')]()},'attach':{'type':Sequelize[_0x14ba('0x1')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x14ba('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x14ba('0x6')]('in',_0x14ba('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x14ba('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x14ba('0x6')]('in',_0x14ba('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x14ba('0x1')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 0a5133f..0cd47dc 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 _0x924b=['catch','MailInteraction','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','field','from','tools_tags','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','select','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','text','end','some','isEmpty','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.updatedAt','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.disposition','i.thirdDisposition','i.to','i.ContactId','c.firstName','Contact.firstName','Contact.lastName','c.email','c.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','show','includeAll','include','options','create','body','params','describe','addMessage','ids','getMessages','hasOwnProperty','format','findAll','inlineCss','addTags','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','attachments','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','moment','bluebird','util','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','socket.io-emitter','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','name','Users','fullname','Tags','TagIds','split','forEach','MailMessage','findOne','out','plainBody','lastMsgText','trimStart'];(function(_0x3e451f,_0x10500d){var _0x57978f=function(_0x52f960){while(--_0x52f960){_0x3e451f['push'](_0x3e451f['shift']());}};_0x57978f(++_0x10500d);}(_0x924b,0x18b));var _0xb924=function(_0x443f79,_0x33e446){_0x443f79=_0x443f79-0x0;var _0x3847e4=_0x924b[_0x443f79];return _0x3847e4;};'use strict';var emlformat=require(_0xb924('0x0'));var rimraf=require(_0xb924('0x1'));var zipdir=require('zip-dir');var moment=require(_0xb924('0x2'));var BPromise=require(_0xb924('0x3'));var util=require(_0xb924('0x4'));var path=require(_0xb924('0x5'));var fs=require('fs');var _=require(_0xb924('0x6'));var squel=require(_0xb924('0x7'));var juice=require(_0xb924('0x8'));var Redis=require(_0xb924('0x9'));var qs=require(_0xb924('0xa'));var as=require(_0xb924('0xb'));var logger=require(_0xb924('0xc'))('api');var config=require(_0xb924('0xd'));var db=require(_0xb924('0xe'))['db'];var htmlEntities=require(_0xb924('0xf'));config[_0xb924('0x10')]=_[_0xb924('0x11')](config[_0xb924('0x10')],{'host':'localhost','port':0x18eb});var socket=require(_0xb924('0x12'))(new Redis(config[_0xb924('0x10')]));require('./mailInteraction.socket')[_0xb924('0x13')](socket);function respondWithStatusCode(_0xbbd7fa,_0x1bed0f){_0x1bed0f=_0x1bed0f||0xcc;return function(_0x559a22){if(_0x559a22){return _0xbbd7fa['sendStatus'](_0x1bed0f);}return _0xbbd7fa[_0xb924('0x14')](_0x1bed0f)['end']();};}function respondWithResult(_0x2d7c9e,_0x1994ca){_0x1994ca=_0x1994ca||0xc8;return function(_0x50b2a8){if(_0x50b2a8){return _0x2d7c9e[_0xb924('0x14')](_0x1994ca)[_0xb924('0x15')](_0x50b2a8);}};}function respondWithFilteredResult(_0x387f9c,_0xe48216){return function(_0x7575f3){if(_0x7575f3){var _0x212183=typeof _0xe48216[_0xb924('0x16')]===_0xb924('0x17')&&typeof _0xe48216[_0xb924('0x18')]==='undefined';var _0x4dcdc2=_0x7575f3[_0xb924('0x19')];var _0x4ec6dd=_0x212183?0x0:_0xe48216['offset'];var _0x20c343=_0x212183?_0x7575f3['count']:_0xe48216[_0xb924('0x16')]+_0xe48216[_0xb924('0x18')];var _0x4904a4;if(_0x20c343>=_0x4dcdc2){_0x20c343=_0x4dcdc2;_0x4904a4=0xc8;}else{_0x4904a4=0xce;}_0x387f9c['status'](_0x4904a4);return _0x387f9c[_0xb924('0x1a')](_0xb924('0x1b'),_0x4ec6dd+'-'+_0x20c343+'/'+_0x4dcdc2)['json'](_0x7575f3);}return null;};}function saveUpdates(_0x502c95){return function(_0x46ab1e){if(_0x46ab1e){return _0x46ab1e[_0xb924('0x1c')](_0x502c95)[_0xb924('0x1d')](function(_0x4c95c2){return _0x4c95c2;});}return null;};}function removeEntity(_0x552ff5){return function(_0x4e7545){if(_0x4e7545){return _0x4e7545[_0xb924('0x1e')]()['then'](function(){_0x552ff5[_0xb924('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bca75){return function(_0x16e721){if(!_0x16e721){_0x4bca75[_0xb924('0x1f')](0x194);}return _0x16e721;};}function handleError(_0x2ddac5,_0x5ef67d){_0x5ef67d=_0x5ef67d||0x1f4;return function(_0x10ac70){logger['error'](_0x10ac70['stack']);if(_0x10ac70[_0xb924('0x20')]){delete _0x10ac70[_0xb924('0x20')];}_0x2ddac5['status'](_0x5ef67d)['send'](_0x10ac70);};}function getInteractionUsers(_0x570864,_0x422a78){return new BPromise(function(_0xd2e40c,_0x112e9e){try{if(_0x422a78[_0x570864['id']]){_0x570864[_0xb924('0x21')]=_['map'](_0x422a78[_0x570864['id']],function(_0x3e7401){return{'id':_0x3e7401['id'],'fullname':_0x3e7401[_0xb924('0x22')]};});}}catch(_0x1c1972){_0x112e9e(_0x1c1972);}_0xd2e40c(_0x570864);});}function getInteractionTags(_0x1eefe5,_0x1bdcca){return new BPromise(function(_0x33b9e5,_0x2c8a78){try{if(_0x1eefe5['TagIds']){_0x1eefe5[_0xb924('0x23')]=[];_0x1eefe5[_0xb924('0x24')][_0xb924('0x25')](',')[_0xb924('0x26')](function(_0x4074a4){_0x1eefe5[_0xb924('0x23')]['push'](_0x1bdcca[_0x4074a4]);});}delete _0x1eefe5['TagIds'];}catch(_0xb8e341){_0x2c8a78(_0xb8e341);}_0x33b9e5(_0x1eefe5);});}function getLastMessageText(_0x4f1333){return new BPromise(function(_0x4a75e4,_0x3a692e){return db[_0xb924('0x27')][_0xb924('0x28')]({'where':{'$and':[{'MailInteractionId':_0x4f1333['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xb924('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':'-id','raw':!![]})[_0xb924('0x1d')](function(_0x13cfb2){if(_0x13cfb2&&_0x13cfb2[_0xb924('0x2a')]){_0x4f1333[_0xb924('0x2b')]=_[_0xb924('0x2c')](_0x13cfb2['plainBody']);}_0x4a75e4(_0x4f1333);})[_0xb924('0x2d')](function(_0x3cb668){_0x3a692e(_0x3cb668);});});}function updateMailInteraction(_0x290b41,_0x2340b5,_0x43deb3,_0x35b470){return new BPromise(function(_0x54503f,_0x525448){return getInteractionUsers(_0x290b41,_0x43deb3)[_0xb924('0x1d')](function(_0x2f5f60){return getInteractionTags(_0x2f5f60,_0x2340b5);})[_0xb924('0x1d')](function(_0x1fe200){if(_0x35b470){_0x54503f(getLastMessageText(_0x1fe200));}else{_0x54503f(_0x1fe200);}})[_0xb924('0x2d')](function(_0x3676b8){_0x525448(_0x3676b8);});});}exports['index']=function(_0x2169b6,_0x374d40){var _0x15a315={},_0x49d6e5={},_0xac84d3={'count':0x0,'rows':[]};var _0x20722f=_['map'](db[_0xb924('0x2e')][_0xb924('0x2f')],function(_0x578e11){return{'name':_0x578e11[_0xb924('0x30')],'type':_0x578e11[_0xb924('0x31')][_0xb924('0x32')]};});_0x49d6e5[_0xb924('0x33')]=_[_0xb924('0x34')](_0x20722f,_0xb924('0x20'));_0x49d6e5[_0xb924('0x35')]=_[_0xb924('0x36')](_0x2169b6[_0xb924('0x35')]);_0x49d6e5[_0xb924('0x37')]=_[_0xb924('0x38')](_0x49d6e5['model'],_0x49d6e5['query']);_0x15a315[_0xb924('0x39')]=_[_0xb924('0x38')](_0x49d6e5[_0xb924('0x33')],qs['fields'](_0x2169b6[_0xb924('0x35')][_0xb924('0x3a')]));_0x15a315[_0xb924('0x39')]=_0x15a315[_0xb924('0x39')][_0xb924('0x3b')]?_0x15a315[_0xb924('0x39')]:_0x49d6e5[_0xb924('0x33')];if(!_0x2169b6[_0xb924('0x35')]['hasOwnProperty'](_0xb924('0x3c'))){_0x15a315[_0xb924('0x18')]=qs['limit'](_0x2169b6[_0xb924('0x35')][_0xb924('0x18')]);_0x15a315[_0xb924('0x16')]=qs[_0xb924('0x16')](_0x2169b6['query'][_0xb924('0x16')]);}_0x15a315['order']=qs[_0xb924('0x3d')](_0x2169b6['query'][_0xb924('0x3d')]);_0x15a315[_0xb924('0x3e')]=qs[_0xb924('0x37')](_[_0xb924('0x3f')](_0x2169b6[_0xb924('0x35')],_0x49d6e5[_0xb924('0x37')]),_0x20722f);var _0x1d64a4=[];var _0x4c83c8=squel['select']()[_0xb924('0x40')]('id')[_0xb924('0x40')](_0xb924('0x20'))[_0xb924('0x40')]('color')[_0xb924('0x41')](_0xb924('0x42'));var _0x4d9bfd=squel['select']()['field']('u.id')[_0xb924('0x40')](_0xb924('0x43'))[_0xb924('0x40')](_0xb924('0x44'))[_0xb924('0x41')](_0xb924('0x45'),'ui')['left_join'](_0xb924('0x46'),'u',_0xb924('0x47'));var _0x5dc8ab=squel[_0xb924('0x48')]()['from'](_0xb924('0x49'),'i')[_0xb924('0x4a')](_0xb924('0x4b'),'c',_0xb924('0x4c'))[_0xb924('0x4a')](_0xb924('0x46'),'o','o.id\x20=\x20i.UserId')[_0xb924('0x4a')]('mail_accounts','a',_0xb924('0x4d'))[_0xb924('0x4a')](_0xb924('0x4e'),'me',_0xb924('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xb924('0x50'))[_0xb924('0x4a')]('tools_tags','t',_0xb924('0x51'));var _0x31246f=squel[_0xb924('0x52')]();var _0x55d54d=[];var _0x4a690a=squel['expr']();var _0x40462e;if(_0x2169b6[_0xb924('0x35')][_0xb924('0x53')]){_0x40462e=as[_0xb924('0x54')](_0x2169b6['query']['search']);var _0x30c137=_0x40462e['sqlOperator'];for(var _0x6336e1=0x0;_0x6336e1<_0x40462e[_0xb924('0x55')][_0xb924('0x3b')];_0x6336e1++){var _0x1cdfd6=_0x40462e[_0xb924('0x55')][_0x6336e1];var _0x25fb7b='i';var _0x3c9bd1=_['find'](_0x20722f,[_0xb924('0x20'),_0x1cdfd6['field']]);if(!_0x3c9bd1){switch(_0x1cdfd6['field']){case _0xb924('0x56'):if(_0x1cdfd6['value']==0x1){_0x5dc8ab['having']('`'+_0x1cdfd6[_0xb924('0x40')]+_0xb924('0x57'));}else{_0x5dc8ab[_0xb924('0x58')]('`'+_0x1cdfd6['field']+_0xb924('0x59'));}break;case _0xb924('0x5a'):if(_0x1cdfd6[_0xb924('0x5b')]===_0xb924('0x5c')){if(_0x1cdfd6[_0xb924('0x5d')]['split']('\x20')[_0xb924('0x3b')]>0x1){_0x31246f[_0x30c137]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xb924('0x5e')](_0x1cdfd6['value']),null);}else{var _0x2dd38b='%'+_0x1cdfd6[_0xb924('0x5d')]+'%';_0x31246f[_0x30c137](_0xb924('0x5f'),_0x2dd38b,_0x2dd38b,_0x2dd38b);}}else{_0x3c9bd1=_['find'](_0x20722f,[_0xb924('0x20'),_0xb924('0x60')]);_0x1cdfd6['field']='ContactId';_0x66164f=as[_0xb924('0x61')](_0x25fb7b,_0x3c9bd1['type'],_0x1cdfd6);_0x31246f[_0x30c137](_0x66164f['text'],_0x66164f[_0xb924('0x5d')][_0xb924('0x62')],_0x66164f[_0xb924('0x5d')]['end']);}break;case _0xb924('0x63'):var _0x1aeec3=_0x1cdfd6['value'][_0xb924('0x25')](',')[_0xb924('0x34')](function(_0x459581){return Number(_0x459581);});_0x1aeec3[_0xb924('0x26')](function(_0x12b51f){_0x4a690a['or'](_0xb924('0x64'),'%,'+_0x12b51f+',%');});_0x55d54d=_[_0xb924('0x65')](_0x55d54d,_0x1aeec3);break;case'User':if(_0x1cdfd6[_0xb924('0x5b')]==='$substring'){_0x31246f[_0x30c137](_0xb924('0x66'),'%'+_0x1cdfd6[_0xb924('0x5d')]+'%',null);}else{_0x3c9bd1=_[_0xb924('0x67')](_0x20722f,[_0xb924('0x20'),_0xb924('0x68')]);_0x1cdfd6[_0xb924('0x40')]=_0xb924('0x68');_0x66164f=as[_0xb924('0x61')](_0x25fb7b,_0x3c9bd1[_0xb924('0x31')],_0x1cdfd6);_0x31246f[_0x30c137](_0x66164f[_0xb924('0x69')],_0x66164f[_0xb924('0x5d')][_0xb924('0x62')],_0x66164f[_0xb924('0x5d')][_0xb924('0x6a')]);}break;case _0xb924('0x2a'):_0x66164f=as[_0xb924('0x61')]('me',null,_0x1cdfd6);_0x31246f[_0x30c137](_0x66164f[_0xb924('0x69')],_0x66164f[_0xb924('0x5d')][_0xb924('0x62')],_0x66164f[_0xb924('0x5d')][_0xb924('0x6a')]);break;}}else{var _0x66164f=as['buildExpression'](_0x25fb7b,_0x3c9bd1[_0xb924('0x31')],_0x1cdfd6);_0x31246f[_0x30c137](_0x66164f['text'],_0x66164f[_0xb924('0x5d')][_0xb924('0x62')],_0x66164f['value'][_0xb924('0x6a')]);}}}else{var _0x41db56=_(_0x2169b6['query'])['keys']()['map'](function(_0xb681a2){return _[_0xb924('0x6b')](_0x20722f,['name',_0xb681a2])?_0xb681a2:undefined;})['compact']()['value']();if(!_[_0xb924('0x6c')](_0x41db56)){_0x41db56['forEach'](function(_0x37c73e){if(_0x37c73e==='MailAccountId'){_0x5dc8ab[_0xb924('0x3e')]('i.MailAccountId\x20IN\x20?',[][_0xb924('0x6d')](_0x2169b6[_0xb924('0x35')][_0x37c73e]));}else if(_0x37c73e===_0xb924('0x6e')){var _0x1de2d3=JSON['parse'](_0x2169b6[_0xb924('0x35')][_0x37c73e])[_0xb924('0x6f')];var _0x1dc83a=JSON[_0xb924('0x70')](_0x2169b6[_0xb924('0x35')][_0x37c73e])[_0xb924('0x71')];_0x5dc8ab['where'](_0xb924('0x72'),_0x1de2d3,_0x1dc83a);}else{if(_0x2169b6[_0xb924('0x35')][_0x37c73e]==='null'){_0x5dc8ab[_0xb924('0x3e')]('i.'+_0x37c73e+'\x20IS\x20NULL');}else{_0x5dc8ab[_0xb924('0x3e')]('i.'+_0x37c73e+_0xb924('0x73'),_0x2169b6[_0xb924('0x35')][_0x37c73e]);}}});}if(_0x2169b6[_0xb924('0x35')]['read']){if(_0x2169b6['query'][_0xb924('0x74')]==0x1){_0x5dc8ab[_0xb924('0x58')]('`unreadMessages`\x20=\x200');}else{_0x5dc8ab[_0xb924('0x58')](_0xb924('0x75'));}}if(_0x2169b6[_0xb924('0x35')][_0xb924('0x76')]){_0x55d54d=_[_0xb924('0x77')](_0x2169b6['query'][_0xb924('0x76')])?_0x2169b6[_0xb924('0x35')][_0xb924('0x76')]:new Array(_0x2169b6['query'][_0xb924('0x76')]);_0x55d54d[_0xb924('0x26')](function(_0x589cff){_0x4a690a['or'](_0xb924('0x64'),'%,'+_0x589cff+',%');});}if(_0x2169b6[_0xb924('0x35')][_0xb924('0x78')]){var _0x4f8f53=_0x2169b6['query'][_0xb924('0x78')][_0xb924('0x79')]('\x5c','\x5c\x5c')[_0xb924('0x79')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4f8f53)){_0x31246f['or']('i.id\x20LIKE\x20?',_0x4f8f53+'%');}else if(qs[_0xb924('0x7a')](_0x4f8f53)){_0x31246f['or'](_0xb924('0x7b'),_0x4f8f53+'%');}else{_0x31246f['or'](_0xb924('0x7c'),qs['getFullTextValue'](_0x4f8f53))['or'](_0xb924('0x7d'),qs[_0xb924('0x5e')](_0x4f8f53));}}}_0x5dc8ab[_0xb924('0x3e')](_0x31246f);_0x5dc8ab[_0xb924('0x7e')](_0xb924('0x7f'));var _0xfd78fc={'type':db[_0xb924('0x80')]['QueryTypes']['SELECT'],'raw':!![]};var _0x269d73=_0x5dc8ab['clone']();_0x269d73['field'](_0xb924('0x7f'));_0x269d73[_0xb924('0x40')](_0xb924('0x81'),_0xb924('0x56'));if(_0x15a315['order']){_0x15a315['order']['forEach'](function(_0x4d472a){var _0x58dc6e=_0x4d472a[0x0]===_0xb924('0x82')?_0x4d472a[0x0]:'i.'+_0x4d472a[0x0];_0x5dc8ab['order'](_0x58dc6e,_0x4d472a[0x1]===_0xb924('0x83')?![]:!![]);});}if(!_['isEmpty'](_0x55d54d)){_0x5dc8ab[_0xb924('0x58')](_0x4a690a);_0x269d73['where'](_0xb924('0x84'),_0x55d54d);}BPromise['resolve']()[_0xb924('0x1d')](function(){if(!_0x40462e){if(_0x2169b6['query'][_0xb924('0x85')])return;_0x269d73[_0xb924('0x3e')](_0xb924('0x86'));_0x5dc8ab[_0xb924('0x3e')](_0xb924('0x86'));return;}if(_0x2169b6[_0xb924('0x87')][_0xb924('0x88')]!==_0xb924('0x89'))return;return _0x2169b6[_0xb924('0x87')]['getMailAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3e5c71){if(_[_0xb924('0x6c')](_0x3e5c71)){_0x269d73[_0xb924('0x3e')]('i.MailAccountId\x20IS\x20NULL');_0x5dc8ab[_0xb924('0x3e')]('i.MailAccountId\x20IS\x20NULL');}else{_0x269d73[_0xb924('0x3e')](_0xb924('0x8a'),_[_0xb924('0x34')](_0x3e5c71,'id'));_0x5dc8ab[_0xb924('0x3e')]('i.MailAccountId\x20IN\x20?',_['map'](_0x3e5c71,'id'));}});})[_0xb924('0x1d')](function(){if(_0x2169b6['user'][_0xb924('0x88')]===_0xb924('0x89')&&!_0x40462e&&!_0x2169b6[_0xb924('0x35')]['MailAccountId'])return[];return db[_0xb924('0x8b')][_0xb924('0x35')](_0x269d73[_0xb924('0x8c')](),_0xfd78fc);})[_0xb924('0x1d')](function(_0x4a4a3f){_0xac84d3[_0xb924('0x19')]=_0x4a4a3f[_0xb924('0x3b')];if(_0xac84d3[_0xb924('0x19')]===0x0)return[];return db[_0xb924('0x8b')][_0xb924('0x35')](_0x4c83c8[_0xb924('0x8c')](),_0xfd78fc)['then'](function(_0x3440fa){_0x1d64a4=_[_0xb924('0x8d')](_0x3440fa,'id');_0xfd78fc=_[_0xb924('0x8e')](_0xfd78fc,{'model':db[_0xb924('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2169b6[_0xb924('0x35')]['fields']){_0x15a315[_0xb924('0x39')][_0xb924('0x26')](function(_0x2e066c){_0x5dc8ab[_0xb924('0x40')]('i.'+_0x2e066c);});}else{_0x5dc8ab[_0xb924('0x40')](_0xb924('0x81'),_0xb924('0x56'));_0x5dc8ab[_0xb924('0x40')]('a.key',_0xb924('0x8f'));_0x5dc8ab['field'](_0xb924('0x90'),_0xb924('0x91'));_0x5dc8ab[_0xb924('0x40')]('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',_0xb924('0x82'));_0x5dc8ab['field']('i.id');_0x5dc8ab[_0xb924('0x40')]('i.createdAt');_0x5dc8ab['field'](_0xb924('0x92'));_0x5dc8ab[_0xb924('0x40')]('i.closed');_0x5dc8ab[_0xb924('0x40')](_0xb924('0x93'));_0x5dc8ab[_0xb924('0x40')](_0xb924('0x94'));_0x5dc8ab['field'](_0xb924('0x95'));_0x5dc8ab[_0xb924('0x40')](_0xb924('0x96'));_0x5dc8ab[_0xb924('0x40')]('i.subject');_0x5dc8ab[_0xb924('0x40')](_0xb924('0x97'));_0x5dc8ab['field']('i.secondDisposition');_0x5dc8ab[_0xb924('0x40')](_0xb924('0x98'));_0x5dc8ab[_0xb924('0x40')]('i.substatus');_0x5dc8ab[_0xb924('0x40')](_0xb924('0x99'));_0x5dc8ab[_0xb924('0x40')](_0xb924('0x9a'));_0x5dc8ab[_0xb924('0x40')]('i.MailAccountId');_0x5dc8ab[_0xb924('0x40')]('i.UserId');_0x5dc8ab[_0xb924('0x40')](_0xb924('0x9b'),_0xb924('0x9c'));_0x5dc8ab[_0xb924('0x40')]('c.lastName',_0xb924('0x9d'));_0x5dc8ab[_0xb924('0x40')](_0xb924('0x9e'),'Contact.email');_0x5dc8ab[_0xb924('0x40')]('c.phone','Contact.phone');_0x5dc8ab[_0xb924('0x40')](_0xb924('0x9f'),'Contact.mobile');_0x5dc8ab[_0xb924('0x40')](_0xb924('0xa0'),_0xb924('0xa1'));_0x5dc8ab['field']('o.fullname',_0xb924('0xa2'));_0x5dc8ab[_0xb924('0x40')](_0xb924('0xa3'),_0xb924('0xa4'));_0x5dc8ab[_0xb924('0x40')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb924('0x24'));}if(_0x15a315[_0xb924('0x18')])_0x5dc8ab[_0xb924('0x18')](_0x15a315['limit']);if(_0x15a315[_0xb924('0x16')])_0x5dc8ab[_0xb924('0x16')](_0x15a315[_0xb924('0x16')]);return db['sequelize']['query'](_0x5dc8ab[_0xb924('0x8c')](),_0xfd78fc);})['then'](function(_0x50e548){if(_0x50e548['length']>0x0)_0x4d9bfd[_0xb924('0x3e')](_0xb924('0xa5'),_[_0xb924('0x34')](_0x50e548,'id'));return db[_0xb924('0x8b')][_0xb924('0x35')](_0x4d9bfd['toString'](),_0xfd78fc)[_0xb924('0x1d')](function(_0x5684fb){var _0x409561=_[_0xb924('0xa6')](_0x5684fb,_0xb924('0xa7'));var _0x5c6d09=[];return db[_0xb924('0xa8')][_0xb924('0x28')]({'attributes':[_0xb924('0xa9')],'raw':!![]})[_0xb924('0x1d')](function(_0x286ddc){var _0x54624d=_0x286ddc[_0xb924('0xa9')];_0x50e548[_0xb924('0x26')](function(_0x56db25){_0x5c6d09[_0xb924('0xaa')](updateMailInteraction(_0x56db25,_0x1d64a4,_0x409561,_0x54624d));});return BPromise[_0xb924('0xab')](_0x5c6d09);});});});})['then'](function(_0x159a38){_0xac84d3['rows']=_0x159a38;return _0xac84d3;})[_0xb924('0x1d')](respondWithFilteredResult(_0x374d40,_0x15a315))[_0xb924('0x2d')](handleError(_0x374d40,null));};exports[_0xb924('0xac')]=function(_0x276531,_0x75c3d4){var _0x66853c={'raw':![],'where':{'id':_0x276531['params']['id']}},_0x1203c6={};_0x1203c6[_0xb924('0x33')]=_[_0xb924('0x36')](db[_0xb924('0x2e')][_0xb924('0x2f')]);_0x1203c6['query']=_[_0xb924('0x36')](_0x276531['query']);_0x1203c6[_0xb924('0x37')]=_[_0xb924('0x38')](_0x1203c6[_0xb924('0x33')],_0x1203c6[_0xb924('0x35')]);_0x66853c[_0xb924('0x39')]=_[_0xb924('0x38')](_0x1203c6[_0xb924('0x33')],qs[_0xb924('0x3a')](_0x276531[_0xb924('0x35')][_0xb924('0x3a')]));_0x66853c[_0xb924('0x39')]=_0x66853c[_0xb924('0x39')]['length']?_0x66853c[_0xb924('0x39')]:_0x1203c6[_0xb924('0x33')];if(_0x276531[_0xb924('0x35')][_0xb924('0xad')]){_0x66853c[_0xb924('0xae')]=[{'all':!![]}];}_0x66853c=_['merge']({},_0x66853c,_0x276531[_0xb924('0xaf')]);return db[_0xb924('0x2e')]['find'](_0x66853c)['then'](handleEntityNotFound(_0x75c3d4,null))[_0xb924('0x1d')](respondWithResult(_0x75c3d4,null))[_0xb924('0x2d')](handleError(_0x75c3d4,null));};exports[_0xb924('0xb0')]=function(_0x153571,_0x32c413){return db[_0xb924('0x2e')]['create'](_0x153571[_0xb924('0xb1')],{})[_0xb924('0x1d')](respondWithResult(_0x32c413,0xc9))[_0xb924('0x2d')](handleError(_0x32c413,null));};exports[_0xb924('0x1c')]=function(_0x111564,_0x556f5e){if(_0x111564[_0xb924('0xb1')]['id']){delete _0x111564[_0xb924('0xb1')]['id'];}return db[_0xb924('0x2e')]['find']({'where':{'id':_0x111564[_0xb924('0xb2')]['id']}})[_0xb924('0x1d')](handleEntityNotFound(_0x556f5e,null))[_0xb924('0x1d')](saveUpdates(_0x111564['body'],null))[_0xb924('0x1d')](respondWithResult(_0x556f5e,null))[_0xb924('0x2d')](handleError(_0x556f5e,null));};exports[_0xb924('0x1e')]=function(_0x342fc1,_0x6a89ac){return db[_0xb924('0x2e')][_0xb924('0x67')]({'where':{'id':_0x342fc1['params']['id']}})[_0xb924('0x1d')](handleEntityNotFound(_0x6a89ac,null))[_0xb924('0x1d')](removeEntity(_0x6a89ac,null))[_0xb924('0x2d')](handleError(_0x6a89ac,null));};exports[_0xb924('0xb3')]=function(_0x246051,_0x20c098){return db[_0xb924('0x2e')][_0xb924('0xb3')]()[_0xb924('0x1d')](respondWithResult(_0x20c098,null))['catch'](handleError(_0x20c098,null));};exports[_0xb924('0xb4')]=function(_0x3344f8,_0x422079){return db['MailMessage'][_0xb924('0x67')]({'where':{'id':_0x3344f8[_0xb924('0xb2')]['id']}})['then'](handleEntityNotFound(_0x422079,null))[_0xb924('0x1d')](function(_0x3d4e97){if(_0x3d4e97){return _0x3d4e97[_0xb924('0xb4')](_0x3344f8['body'][_0xb924('0xb5')],_['omit'](_0x3344f8[_0xb924('0xb1')],[_0xb924('0xb5'),'id'])||{});}})[_0xb924('0x1d')](respondWithResult(_0x422079,null))[_0xb924('0x2d')](handleError(_0x422079,null));};exports[_0xb924('0xb6')]=function(_0x55a120,_0x55958e){var _0x140c67={'raw':![],'where':{}};var _0x42c853={};var _0x273b04={'count':0x0,'rows':[]};return db[_0xb924('0x2e')][_0xb924('0x28')]({'where':{'id':_0x55a120[_0xb924('0xb2')]['id']}})[_0xb924('0x1d')](handleEntityNotFound(_0x55958e,null))['then'](function(_0x5a2318){if(_0x5a2318){_0x42c853[_0xb924('0x33')]=_['keys'](db['MailMessage'][_0xb924('0x2f')]);_0x42c853['query']=_[_0xb924('0x36')](_0x55a120[_0xb924('0x35')]);_0x42c853[_0xb924('0x37')]=_['intersection'](_0x42c853['model'],_0x42c853['query']);_0x140c67[_0xb924('0x39')]=_[_0xb924('0x38')](_0x42c853[_0xb924('0x33')],qs[_0xb924('0x3a')](_0x55a120[_0xb924('0x35')][_0xb924('0x3a')]));_0x140c67[_0xb924('0x39')]=_0x140c67[_0xb924('0x39')][_0xb924('0x3b')]?_0x140c67[_0xb924('0x39')]:_0x42c853['model'];if(!_0x55a120[_0xb924('0x35')][_0xb924('0xb7')]('nolimit')){_0x140c67['limit']=qs[_0xb924('0x18')](_0x55a120['query'][_0xb924('0x18')]);_0x140c67[_0xb924('0x16')]=qs[_0xb924('0x16')](_0x55a120[_0xb924('0x35')][_0xb924('0x16')]);}_0x140c67['order']=qs['sort'](_0x55a120['query'][_0xb924('0x3d')]);_0x140c67[_0xb924('0x3e')]=qs['filters'](_['pick'](_0x55a120[_0xb924('0x35')],_0x42c853['filters']));_0x140c67[_0xb924('0x3e')][_0xb924('0xa7')]=_0x5a2318['id'];if(_0x55a120[_0xb924('0x35')]['filter']){_0x140c67[_0xb924('0x3e')]=_[_0xb924('0x8e')](_0x140c67['where'],{'$or':_[_0xb924('0x34')](_0x140c67['attributes'],function(_0x17133a){var _0x34e31a={};_0x34e31a[_0x17133a]={'$like':'%'+_0x55a120[_0xb924('0x35')]['filter']+'%'};return _0x34e31a;})});}if(_0x55a120['query'][_0xb924('0x6f')]){var _0x14a572=_0x55a120['query'][_0xb924('0x6f')][_0xb924('0x25')](',');var _0x4bc69d={};_0x4bc69d[_0x14a572[0x0]]={'$gte':moment(_0x14a572[0x1])[_0xb924('0xb8')]('YYYY-MM-DD\x20HH:mm:ss')};_0x140c67['where']=_[_0xb924('0x8e')](_0x140c67[_0xb924('0x3e')],_0x4bc69d);}_0x140c67=_[_0xb924('0x8e')]({},_0x140c67,_0x55a120[_0xb924('0xaf')]);return db[_0xb924('0x27')][_0xb924('0x19')]({'where':_0x140c67['where']})[_0xb924('0x1d')](function(_0x24fe1a){_0x273b04[_0xb924('0x19')]=_0x24fe1a;if(_0x55a120['query'][_0xb924('0xad')]){_0x140c67[_0xb924('0xae')]=[{'all':!![]}];}return db[_0xb924('0x27')][_0xb924('0xb9')](_0x140c67);})[_0xb924('0x1d')](function(_0x3c4fd2){if(_0x55a120[_0xb924('0x35')][_0xb924('0xba')]==='true'){for(var _0x4f5f0c=0x0;_0x4f5f0c<_0x3c4fd2[_0xb924('0x3b')];_0x4f5f0c++){_0x3c4fd2[_0x4f5f0c][_0xb924('0xb1')]=juice(_0x3c4fd2[_0x4f5f0c][_0xb924('0xb1')]);}}_0x273b04['rows']=_0x3c4fd2;return _0x273b04;});}})[_0xb924('0x1d')](respondWithFilteredResult(_0x55958e,_0x140c67))[_0xb924('0x2d')](handleError(_0x55958e,null));};exports[_0xb924('0xbb')]=function(_0x2e1587,_0x287dc4){return db['MailInteraction'][_0xb924('0x67')]({'where':{'id':_0x2e1587[_0xb924('0xb2')]['id']}})['then'](handleEntityNotFound(_0x287dc4,null))[_0xb924('0x1d')](function(_0x4ec019){if(_0x4ec019){return _0x4ec019[_0xb924('0xbc')](_0x2e1587['body'][_0xb924('0xb5')],_[_0xb924('0xbd')](_0x2e1587[_0xb924('0xb1')],['ids','id'])||{})[_0xb924('0xbe')](function(){return db[_0xb924('0x63')][_0xb924('0xb9')]({'attributes':['id',_0xb924('0x20'),'color'],'where':{'id':_0x2e1587['body'][_0xb924('0xb5')]}});})['then'](function(_0x37c060){socket[_0xb924('0xbf')](_0xb924('0xc0'),{'id':Number(_0x2e1587[_0xb924('0xb2')]['id']),'tags':_0x37c060||[]});return{'id':Number(_0x2e1587[_0xb924('0xb2')]['id']),'tags':_0x37c060||[]};});}})[_0xb924('0x1d')](respondWithResult(_0x287dc4,null))[_0xb924('0x2d')](handleError(_0x287dc4,null));};exports[_0xb924('0xc1')]=function(_0x5acfe7,_0x354701){return db[_0xb924('0x2e')][_0xb924('0x67')]({'where':{'id':_0x5acfe7['params']['id']}})['then'](handleEntityNotFound(_0x354701,null))[_0xb924('0x1d')](function(_0xf3d2fe){if(_0xf3d2fe){return _0xf3d2fe[_0xb924('0xc1')](_0x5acfe7[_0xb924('0x35')]['ids']);}})[_0xb924('0x1d')](respondWithStatusCode(_0x354701,null))[_0xb924('0x2d')](handleError(_0x354701,null));};exports[_0xb924('0xc2')]=function(_0x495989,_0x2629f7){var _0x35a8e1=moment()[_0xb924('0xc3')]()[_0xb924('0x8c')]();var _0x76eeb3=path[_0xb924('0xc4')](config[_0xb924('0xc5')],_0xb924('0xc6'),_0xb924('0xc7'),_0xb924('0xc8'));var _0x540916=path[_0xb924('0xc4')](config['root'],_0xb924('0xc6'),_0xb924('0xc7'),'attachments');var _0x340451=path[_0xb924('0xc4')](_0x76eeb3,_0x35a8e1);var _0x509f2d=util[_0xb924('0xb8')](_0xb924('0xc9'),_0x495989[_0xb924('0xb2')]['id'],_0x35a8e1);var _0x156eda=path[_0xb924('0xc4')](_0x76eeb3,_0x509f2d);var _0x478c98=[];if(_0x495989[_0xb924('0x35')]['attachments']){_0x478c98[_0xb924('0xaa')]({'model':db[_0xb924('0xca')],'as':_0xb924('0xcb'),'raw':!![]});}var _0x5537aa=[{'model':db[_0xb924('0x27')],'as':_0xb924('0xcc'),'attributes':['id',_0xb924('0xb1'),_0xb924('0x41'),'to','cc',_0xb924('0xcd'),_0xb924('0xce'),_0xb924('0x6e')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x478c98}];return db[_0xb924('0x2e')][_0xb924('0x67')]({'where':{'id':_0x495989[_0xb924('0xb2')]['id']},'include':_0x5537aa})[_0xb924('0x1d')](handleEntityNotFound(_0x2629f7,null))[_0xb924('0x1d')](function(_0x4dce7d){if(_0x4dce7d&&_0x4dce7d[_0xb924('0xcc')]){var _0x55d309=_0x4dce7d[_0xb924('0xcf')]({'plain':!![]});fs['mkdirSync'](_0x340451);return BPromise['each'](_0x55d309['Messages'],function(_0x23a4c6,_0xbdae6c){var _0x33fb78={'from':_0x23a4c6[_0xb924('0x41')],'to':_0x23a4c6['to'],'subject':_0x23a4c6[_0xb924('0xce')],'html':htmlEntities[_0xb924('0xd0')](_0x23a4c6[_0xb924('0xb1')]),'headers':{'Date':moment(_0x23a4c6[_0xb924('0x6e')])[_0xb924('0xb8')](_0xb924('0xd1'))},'attachments':[]};if(_0x23a4c6['cc']){_0x33fb78[_0xb924('0xd2')]['Cc']=_0x23a4c6['cc'];}if(_0x23a4c6['bcc']){_0x33fb78[_0xb924('0xd2')][_0xb924('0xd3')]=_0x23a4c6[_0xb924('0xcd')];}return new BPromise(function(_0x441f51,_0xd2b246){if(_0x23a4c6['Attachments']){for(var _0x42245b=0x0;_0x42245b<_0x23a4c6[_0xb924('0xcb')][_0xb924('0x3b')];_0x42245b++){var _0x23dc75=_0x23a4c6[_0xb924('0xcb')][_0x42245b];var _0x588b53=path[_0xb924('0xc4')](_0x540916,_0x23dc75[_0xb924('0xd4')]);if(fs[_0xb924('0xd5')](_0x588b53)){_0x33fb78[_0xb924('0xd6')][_0xb924('0xaa')]({'name':_0x23dc75['name'],'contentType':_0x23dc75[_0xb924('0x31')],'data':fs[_0xb924('0xd7')](_0x588b53)});}}}emlformat[_0xb924('0xd8')](_0x33fb78,function(_0x27256c,_0x38ef39){if(_0x27256c)return _0xd2b246(_0x27256c);fs[_0xb924('0xd9')](path[_0xb924('0xc4')](_0x340451,util['format'](_0xb924('0xda'),_0xbdae6c)),_0x38ef39);return _0x441f51(_0x38ef39);});});})[_0xb924('0x1d')](function(){return new BPromise(function(_0x1909cb,_0x25f7a1){zipdir(_0x340451,{'saveTo':_0x156eda},function(_0x32081a,_0x348b3){if(_0x32081a)return _0x25f7a1(_0x32081a);return _0x1909cb(_0x348b3);});})['then'](function(){return new BPromise(function(_0x3e39ce,_0xca8f84){rimraf(_0x340451,function(_0x1caad9){if(_0x1caad9)_0xca8f84(_0x1caad9);return _0x3e39ce();});});})[_0xb924('0x1d')](function(){return _0x2629f7['download'](_0x156eda,_0x509f2d,function(_0x41458e){if(!_0x41458e)fs[_0xb924('0xdb')](_0x156eda);});});});}else{return _0x2629f7['sendStatus'](0xc8);}})[_0xb924('0x2d')](handleError(_0x2629f7,null));}; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 769ff2a..8be2329 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 _0x7be8=['save','getUsers','then','setDataValue','Users','length','emit','events','MailInteraction','MailMessage','setMaxListeners'];(function(_0x236d24,_0x29e80a){var _0x1574cf=function(_0x5d1dad){while(--_0x5d1dad){_0x236d24['push'](_0x236d24['shift']());}};_0x1574cf(++_0x29e80a);}(_0x7be8,0x80));var _0x87be=function(_0x1ff9e6,_0x129946){_0x1ff9e6=_0x1ff9e6-0x0;var _0x2fae00=_0x7be8[_0x1ff9e6];return _0x2fae00;};'use strict';var EventEmitter=require(_0x87be('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x87be('0x1')];var MailMessage=require('../../mysqldb')['db'][_0x87be('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x87be('0x3')](0x0);var events={'afterCreate':_0x87be('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x11d87e){return function(_0x441414,_0x35050c,_0x3a6b7d){_0x441414[_0x87be('0x5')]({'attributes':['id'],'raw':!![]})[_0x87be('0x6')](function(_0x11263d){_0x441414[_0x87be('0x7')](_0x87be('0x8'),_0x11263d['map'](function(_0x3a0cf5){return{'id':_0x3a0cf5['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x441414['id'],'direction':'in','read':![]},'raw':!![]});})[_0x87be('0x6')](function(_0x2fbcb7){_0x441414['setDataValue']('unreadMessages',_0x2fbcb7[_0x87be('0x9')]);MailInteractionEvents[_0x87be('0xa')](_0x11d87e+':'+_0x441414['id'],_0x441414);MailInteractionEvents[_0x87be('0xa')](_0x11d87e,_0x441414);_0x3a6b7d(null);})['catch'](_0x3a6b7d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 76cb72d..53ebadc 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 _0x06e6=['MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','models','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports'];(function(_0x331e28,_0x410877){var _0x20db4a=function(_0x2ce70b){while(--_0x2ce70b){_0x331e28['push'](_0x331e28['shift']());}};_0x20db4a(++_0x410877);}(_0x06e6,0x9d));var _0x606e=function(_0x59ae56,_0x1a1aaf){_0x59ae56=_0x59ae56-0x0;var _0x839b0f=_0x06e6[_0x59ae56];return _0x839b0f;};'use strict';var _=require(_0x606e('0x0'));var util=require(_0x606e('0x1'));var logger=require(_0x606e('0x2'))(_0x606e('0x3'));var moment=require(_0x606e('0x4'));var BPromise=require(_0x606e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x606e('0x6'));var rimraf=require(_0x606e('0x7'));var config=require(_0x606e('0x8'));var attributes=require(_0x606e('0x9'));module[_0x606e('0xa')]=function(_0x126db1,_0xdec382){return _0x126db1['define'](_0x606e('0xb'),attributes,{'tableName':_0x606e('0xc'),'paranoid':![],'indexes':[{'name':_0x606e('0xd'),'fields':[_0x606e('0xe'),'to'],'type':_0x606e('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x293c16,_0x72efdb,_0x2e18d2){if(_0x293c16[_0x606e('0x10')]){_0x293c16['substatusAt']=moment()['format'](_0x606e('0x11'));}if(_0x293c16[_0x606e('0x12')]){_0x293c16[_0x606e('0x13')]=moment()[_0x606e('0x14')](_0x606e('0x11'));}_0x2e18d2(null,_0x72efdb);},'beforeUpdate':function(_0xbb93b5,_0x47c4e8,_0x16165f){if(_0xbb93b5[_0x606e('0x15')]('substatus')){_0xbb93b5[_0x606e('0x16')]=_0xbb93b5[_0x606e('0x10')]?moment()[_0x606e('0x14')](_0x606e('0x11')):null;}if(_0xbb93b5[_0x606e('0x15')]('closed')){_0xbb93b5['closedAt']=moment()[_0x606e('0x14')](_0x606e('0x11'));_0xbb93b5[_0x606e('0x10')]=null;_0xbb93b5['substatusAt']=null;}_0x16165f(null,_0xbb93b5);},'afterUpdate':function(_0x23b378,_0x20f15f,_0xd2d2ae){var _0x5e05ee=_0x126db1[_0x606e('0x17')];var _0x2ef29f=_0x23b378['get']({'plain':!![]});if(_0x2ef29f[_0x606e('0x12')]){return _0x5e05ee['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x2ef29f['id']}})[_0x606e('0x18')](function(){_0xd2d2ae();})[_0x606e('0x19')](function(_0xfb36d3){_0xd2d2ae(_0xfb36d3);});}else{_0xd2d2ae();}}},'charset':_0x606e('0x1a'),'collate':_0x606e('0x1b')});}; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 10c07d7..f64544e 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 _0xbdb9=['AddTagsToMailInteraction','find','addTags','body','ids','omit','AddTags','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','then','catch'];(function(_0x350c6d,_0x3e483a){var _0x5e52a9=function(_0x40a25a){while(--_0x40a25a){_0x350c6d['push'](_0x350c6d['shift']());}};_0x5e52a9(++_0x3e483a);}(_0xbdb9,0xac));var _0x9bdb=function(_0x171ad1,_0x2c1eaa){_0x171ad1=_0x171ad1-0x0;var _0x56ec02=_0xbdb9[_0x171ad1];return _0x56ec02;};'use strict';var _=require(_0x9bdb('0x0'));var util=require(_0x9bdb('0x1'));var moment=require(_0x9bdb('0x2'));var BPromise=require(_0x9bdb('0x3'));var rs=require(_0x9bdb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x9bdb('0x6'));var client=jayson['client'][_0x9bdb('0x7')]({'port':0x232a});config['redis']=_[_0x9bdb('0x8')](config[_0x9bdb('0x9')],{'host':_0x9bdb('0xa'),'port':0x18eb});var socket=require(_0x9bdb('0xb'))(new Redis(config[_0x9bdb('0x9')]));require(_0x9bdb('0xc'))[_0x9bdb('0xd')](socket);function respondWithRpcPromise(_0x58812d,_0x118bb1,_0x355bad){return new BPromise(function(_0x274dee,_0x35a5b9){return client[_0x9bdb('0xe')](_0x58812d,_0x355bad)['then'](function(_0x5af5d6){logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));logger[_0x9bdb('0x12')](_0x9bdb('0x13'),_0x118bb1,_0x9bdb('0x11'),JSON['stringify'](_0x5af5d6));if(_0x5af5d6[_0x9bdb('0x14')]){if(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x15')]===0x1f4){logger[_0x9bdb('0x14')](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6['error'][_0x9bdb('0x16')]);return _0x35a5b9(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}logger['error'](_0x9bdb('0x10'),_0x118bb1,_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);return _0x274dee(_0x5af5d6[_0x9bdb('0x14')][_0x9bdb('0x16')]);}else{logger[_0x9bdb('0xf')](_0x9bdb('0x10'),_0x118bb1,_0x9bdb('0x11'));_0x274dee(_0x5af5d6[_0x9bdb('0x17')][_0x9bdb('0x16')]);}})['catch'](function(_0x37837d){logger[_0x9bdb('0x14')]('MailInteraction,\x20%s,\x20%s',_0x118bb1,_0x37837d);_0x35a5b9(_0x37837d);});});}exports[_0x9bdb('0x18')]=function(_0x16a953){var _0x2fb1f3=this;return new Promise(function(_0x582a46,_0xdaab91){return db[_0x9bdb('0x19')][_0x9bdb('0x1a')](_0x16a953['body'],{'raw':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')][_0x9bdb('0x1d')]||null:null,'attributes':_0x16a953['options']?_0x16a953['options'][_0x9bdb('0x1e')]||null:null,'limit':_0x16a953[_0x9bdb('0x1b')]?_0x16a953[_0x9bdb('0x1b')]['limit']||null:null})[_0x9bdb('0x1f')](function(_0x2d9cfd){logger[_0x9bdb('0xf')](_0x9bdb('0x18'),_0x16a953);logger['debug'](_0x9bdb('0x18'),_0x16a953,JSON['stringify'](_0x2d9cfd));_0x582a46(_0x2d9cfd);})[_0x9bdb('0x20')](function(_0x3c2ad6){logger[_0x9bdb('0x14')]('UpdateMailInteraction',_0x3c2ad6[_0x9bdb('0x16')],_0x16a953);_0xdaab91(_0x2fb1f3[_0x9bdb('0x14')](0x1f4,_0x3c2ad6[_0x9bdb('0x16')]));});});};exports[_0x9bdb('0x21')]=function(_0x4368c4){return new Promise(function(_0x14fb6a,_0x426390){return db[_0x9bdb('0x19')][_0x9bdb('0x22')]({'where':_0x4368c4[_0x9bdb('0x1b')]?_0x4368c4['options'][_0x9bdb('0x1d')]||null:null})[_0x9bdb('0x1f')](function(_0x15edd5){if(_0x15edd5){return _0x15edd5[_0x9bdb('0x23')](_0x4368c4[_0x9bdb('0x24')][_0x9bdb('0x25')],_[_0x9bdb('0x26')](_0x4368c4['body'],[_0x9bdb('0x25'),'id'])||{});}})['spread'](function(_0x26a174){logger[_0x9bdb('0xf')](_0x9bdb('0x27'),_0x4368c4);logger[_0x9bdb('0x12')](_0x9bdb('0x27'),_0x4368c4,JSON[_0x9bdb('0x28')](_0x26a174));_0x14fb6a(_0x26a174);})[_0x9bdb('0x20')](function(_0x5f4d21){logger[_0x9bdb('0x14')](_0x9bdb('0x27'),_0x5f4d21[_0x9bdb('0x16')],_0x4368c4);_0x426390(_this['error'](0x1f4,_0x5f4d21['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 373ed1d..d3f8642 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 _0xe2ff=['remove','update','emit','length','mailInteraction:','save'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0xe2ff,0xa1));var _0xfe2f=function(_0x3140d6,_0x3388d5){_0x3140d6=_0x3140d6-0x0;var _0x1d6f60=_0xe2ff[_0x3140d6];return _0x1d6f60;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0xfe2f('0x0'),_0xfe2f('0x1'),_0xfe2f('0x2')];function createListener(_0xa44717,_0x4cd4ac){return function(_0x18d8fd){_0x4cd4ac[_0xfe2f('0x3')](_0xa44717,_0x18d8fd);};}function removeListener(_0x46c013,_0x108f80){return function(){MailInteractionEvents['removeListener'](_0x46c013,_0x108f80);};}exports['register']=function(_0x38b970){for(var _0x24e012=0x0,_0x550b60=events[_0xfe2f('0x4')];_0x24e012<_0x550b60;_0x24e012++){var _0x203fda=events[_0x24e012];var _0x2161b3=createListener(_0xfe2f('0x5')+_0x203fda,_0x38b970);MailInteractionEvents['on'](_0x203fda,_0x2161b3);}}; \ No newline at end of file +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 diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index a21d94d..f17ccc9 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 _0x7834=['tracked','mail','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','describe','/:id','show','/:id/download','download','post'];(function(_0x5465e6,_0x2a8809){var _0x10044e=function(_0x1d5dcd){while(--_0x1d5dcd){_0x5465e6['push'](_0x5465e6['shift']());}};_0x10044e(++_0x2a8809);}(_0x7834,0x13f));var _0x4783=function(_0xe429f8,_0xb5ddb4){_0xe429f8=_0xe429f8-0x0;var _0x439723=_0x7834[_0xe429f8];return _0x439723;};'use strict';var multer=require(_0x4783('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4783('0x1'));var express=require('express');var router=express[_0x4783('0x2')]();var fs_extra=require(_0x4783('0x3'));var auth=require(_0x4783('0x4'));var interaction=require(_0x4783('0x5'));var config=require(_0x4783('0x6'));var controller=require(_0x4783('0x7'));router[_0x4783('0x8')]('/',auth['isAuthenticated'](),controller[_0x4783('0x9')]);router[_0x4783('0x8')]('/describe',auth[_0x4783('0xa')](),controller[_0x4783('0xb')]);router[_0x4783('0x8')](_0x4783('0xc'),auth[_0x4783('0xa')](),controller[_0x4783('0xd')]);router['get'](_0x4783('0xe'),auth[_0x4783('0xa')](),controller[_0x4783('0xf')]);router[_0x4783('0x10')]('/',auth[_0x4783('0xa')](),interaction[_0x4783('0x11')](_0x4783('0x12'),'mailmessage:create'),controller['create']);router[_0x4783('0x13')](_0x4783('0xc'),auth['isAuthenticated'](),controller[_0x4783('0x14')]);router['put'](_0x4783('0x15'),auth[_0x4783('0xa')](),controller[_0x4783('0x16')]);router[_0x4783('0x13')](_0x4783('0x17'),auth['isAuthenticated'](),controller[_0x4783('0x18')]);router[_0x4783('0x19')](_0x4783('0xc'),auth[_0x4783('0xa')](),controller[_0x4783('0x1a')]);module[_0x4783('0x1b')]=router; \ No newline at end of file +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 diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7cceaf0..592d082 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 _0x1b0d=['Email','Chat','sequelize','lodash','exports','TEXT','long','medium','ENUM','out','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x4a2040,_0xb16605){var _0x1a4bf4=function(_0x10e234){while(--_0x10e234){_0x4a2040['push'](_0x4a2040['shift']());}};_0x1a4bf4(++_0xb16605);}(_0x1b0d,0x1a6));var _0xd1b0=function(_0x99e84c,_0x42b1a4){_0x99e84c=_0x99e84c-0x0;var _0x1f7cb7=_0x1b0d[_0x99e84c];return _0x1f7cb7;};'use strict';var Sequelize=require(_0xd1b0('0x0'));var _=require(_0xd1b0('0x1'));module[_0xd1b0('0x2')]={'body':{'type':Sequelize[_0xd1b0('0x3')](_0xd1b0('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xd1b0('0x3')](_0xd1b0('0x5'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd1b0('0x6')]('in',_0xd1b0('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd1b0('0x8')](0x1fe)},'from':{'type':Sequelize[_0xd1b0('0x8')]},'to':{'type':Sequelize[_0xd1b0('0x3')](_0xd1b0('0x4'))},'cc':{'type':Sequelize['TEXT'](_0xd1b0('0x4'))},'bcc':{'type':Sequelize[_0xd1b0('0x3')](_0xd1b0('0x4'))},'subject':{'type':Sequelize[_0xd1b0('0x3')]},'sentAt':{'type':Sequelize[_0xd1b0('0x9')]},'attach':{'type':Sequelize[_0xd1b0('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd1b0('0xb')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xd1b0('0x9')]},'originTo':{'type':Sequelize[_0xd1b0('0x3')](_0xd1b0('0x4'))},'originCc':{'type':Sequelize[_0xd1b0('0x3')](_0xd1b0('0x4'))},'originChannel':{'type':Sequelize[_0xd1b0('0x6')](_0xd1b0('0xc'),_0xd1b0('0xd')),'defaultValue':_0xd1b0('0xc'),'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index c4eb34b..edb8aa0 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 _0x7103=['decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','existsSync','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','path','lodash','html-to-text','../../components/parsers/qs','api','../../config/logger','../../mysqldb','defaults','localhost','redis','html-entities','./mailMessage.socket','register','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','count','limit','set','update','destroy','end','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','MailMessage','includeAll','include','findAll','rows','show','params','rawAttributes','intersection','fields','options','body','find','describe','create','out','split','findOne','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','auth','user','pass','length','attachments','join','basename','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteractionId','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','channel','motionChannel','event','EventManager','acceptmessage','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','internal','reject','fromString','rejectmessage','download','unix','toString','server','files','root','message-%s.eml','from','subject','createdAt','Attachment','Attachments'];(function(_0x1bbffe,_0xf4a1e1){var _0x20b464=function(_0x337aa2){while(--_0x337aa2){_0x1bbffe['push'](_0x1bbffe['shift']());}};_0x20b464(++_0xf4a1e1);}(_0x7103,0x158));var _0x3710=function(_0x4a3636,_0x3ffb3d){_0x4a3636=_0x4a3636-0x0;var _0x338212=_0x7103[_0x4a3636];return _0x338212;};'use strict';var emlformat=require(_0x3710('0x0'));var moment=require(_0x3710('0x1'));var BPromise=require(_0x3710('0x2'));var util=require(_0x3710('0x3'));var path=require(_0x3710('0x4'));var fs=require('fs');var _=require(_0x3710('0x5'));var Redis=require('ioredis');var htmlToText=require(_0x3710('0x6'));var qs=require(_0x3710('0x7'));var logger=require('../../config/logger')(_0x3710('0x8'));var interaction_log=require(_0x3710('0x9'))('mail-interactions');var config=require('../../config/environment');var db=require(_0x3710('0xa'))['db'];config['redis']=_[_0x3710('0xb')](config['redis'],{'host':_0x3710('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3710('0xd')]));var htmlEntities=require(_0x3710('0xe'));require(_0x3710('0xf'))[_0x3710('0x10')](socket);var jayson=require(_0x3710('0x11'));var client=jayson['client'][_0x3710('0x12')]({'port':0x232c});var client9003=jayson[_0x3710('0x13')][_0x3710('0x12')]({'port':0x232b});var client9002=jayson['client'][_0x3710('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x20a642,_0x1b4f72,_0x4462a6,_0xd54832){return new BPromise(function(_0x474368,_0x17f610){var _0x47862d=_0xd54832||client;return _0x47862d[_0x3710('0x14')](_0x20a642,_0x4462a6)[_0x3710('0x15')](function(_0x231006){logger[_0x3710('0x16')](_0x3710('0x17'),_0x1b4f72,_0x3710('0x18'));logger[_0x3710('0x19')](_0x3710('0x1a'),_0x1b4f72,_0x3710('0x18'),JSON[_0x3710('0x1b')](_0x231006));if(_0x231006['error']){if(_0x231006['error']['code']===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x1b4f72,_0x231006[_0x3710('0x1c')][_0x3710('0x1d')]);return _0x17f610(_0x231006[_0x3710('0x1c')]['message']);}logger[_0x3710('0x1c')](_0x3710('0x17'),_0x1b4f72,_0x231006[_0x3710('0x1c')]['message']);return _0x474368(_0x231006[_0x3710('0x1c')][_0x3710('0x1d')]);}else{logger['info'](_0x3710('0x17'),_0x1b4f72,_0x3710('0x18'));_0x474368(_0x231006[_0x3710('0x1e')][_0x3710('0x1d')]);}})[_0x3710('0x1f')](function(_0x3b343b){logger['error'](_0x3710('0x17'),_0x1b4f72,_0x3b343b);_0x17f610(_0x3b343b);});});}function respondWithResult(_0x35f54f,_0x131aae){_0x131aae=_0x131aae||0xc8;return function(_0x5ead19){if(_0x5ead19){return _0x35f54f[_0x3710('0x20')](_0x131aae)[_0x3710('0x21')](_0x5ead19);}};}function respondWithFilteredResult(_0x3d7692,_0xaa00a9){return function(_0x8ebbbe){if(_0x8ebbbe){var _0x592620=typeof _0xaa00a9[_0x3710('0x22')]===_0x3710('0x23')&&typeof _0xaa00a9['limit']===_0x3710('0x23');var _0x1ea5da=_0x8ebbbe[_0x3710('0x24')];var _0x2478d9=_0x592620?0x0:_0xaa00a9[_0x3710('0x22')];var _0x223f32=_0x592620?_0x8ebbbe['count']:_0xaa00a9['offset']+_0xaa00a9[_0x3710('0x25')];var _0x19ebcd;if(_0x223f32>=_0x1ea5da){_0x223f32=_0x1ea5da;_0x19ebcd=0xc8;}else{_0x19ebcd=0xce;}_0x3d7692[_0x3710('0x20')](_0x19ebcd);return _0x3d7692[_0x3710('0x26')]('Content-Range',_0x2478d9+'-'+_0x223f32+'/'+_0x1ea5da)[_0x3710('0x21')](_0x8ebbbe);}return null;};}function saveUpdates(_0x22f133){return function(_0x5f171c){if(_0x5f171c){return _0x5f171c[_0x3710('0x27')](_0x22f133)[_0x3710('0x15')](function(_0x5a241e){return _0x5a241e;});}return null;};}function removeEntity(_0x510f58){return function(_0x2a2cdc){if(_0x2a2cdc){return _0x2a2cdc[_0x3710('0x28')]()[_0x3710('0x15')](function(){_0x510f58[_0x3710('0x20')](0xcc)[_0x3710('0x29')]();});}};}function handleEntityNotFound(_0x3417c0){return function(_0x77d9c4){if(!_0x77d9c4){_0x3417c0['sendStatus'](0x194);}return _0x77d9c4;};}function handleError(_0x34e2c7,_0x25a24a){_0x25a24a=_0x25a24a||0x1f4;return function(_0x118d16){logger[_0x3710('0x1c')](_0x118d16['stack']);if(_0x118d16[_0x3710('0x2a')]){delete _0x118d16[_0x3710('0x2a')];}_0x34e2c7[_0x3710('0x20')](_0x25a24a)[_0x3710('0x2b')](_0x118d16);};}exports[_0x3710('0x2c')]=function(_0x3caf11,_0x2844f7){var _0x242b23={},_0x4c10bd={},_0x4c82c3={'count':0x0,'rows':[]};var _0x12cd6d=_['map'](db['MailMessage']['rawAttributes'],function(_0x100594){return{'name':_0x100594[_0x3710('0x2d')],'type':_0x100594[_0x3710('0x2e')][_0x3710('0x2f')]};});_0x4c10bd[_0x3710('0x30')]=_[_0x3710('0x31')](_0x12cd6d,_0x3710('0x2a'));_0x4c10bd[_0x3710('0x32')]=_[_0x3710('0x33')](_0x3caf11[_0x3710('0x32')]);_0x4c10bd[_0x3710('0x34')]=_['intersection'](_0x4c10bd[_0x3710('0x30')],_0x4c10bd[_0x3710('0x32')]);_0x242b23[_0x3710('0x35')]=_['intersection'](_0x4c10bd[_0x3710('0x30')],qs['fields'](_0x3caf11['query']['fields']));_0x242b23[_0x3710('0x35')]=_0x242b23['attributes']['length']?_0x242b23[_0x3710('0x35')]:_0x4c10bd[_0x3710('0x30')];if(!_0x3caf11[_0x3710('0x32')][_0x3710('0x36')](_0x3710('0x37'))){_0x242b23[_0x3710('0x25')]=qs[_0x3710('0x25')](_0x3caf11[_0x3710('0x32')][_0x3710('0x25')]);_0x242b23[_0x3710('0x22')]=qs[_0x3710('0x22')](_0x3caf11['query']['offset']);}_0x242b23[_0x3710('0x38')]=qs[_0x3710('0x39')](_0x3caf11[_0x3710('0x32')][_0x3710('0x39')]);_0x242b23['where']=qs['filters'](_[_0x3710('0x3a')](_0x3caf11[_0x3710('0x32')],_0x4c10bd[_0x3710('0x34')]),_0x12cd6d);if(_0x3caf11['query']['filter']){_0x242b23[_0x3710('0x3b')]=_[_0x3710('0x3c')](_0x242b23['where'],{'$or':_[_0x3710('0x31')](_0x12cd6d,function(_0x2c38fd){if(_0x2c38fd['type']!==_0x3710('0x3d')){var _0x32ce48={};_0x32ce48[_0x2c38fd[_0x3710('0x2a')]]={'$like':'%'+_0x3caf11[_0x3710('0x32')][_0x3710('0x3e')]+'%'};return _0x32ce48;}})});}_0x242b23=_[_0x3710('0x3c')]({},_0x242b23,_0x3caf11['options']);var _0x57b084={'where':_0x242b23[_0x3710('0x3b')]};return db[_0x3710('0x3f')]['count'](_0x57b084)[_0x3710('0x15')](function(_0x20d1ed){_0x4c82c3[_0x3710('0x24')]=_0x20d1ed;if(_0x3caf11[_0x3710('0x32')][_0x3710('0x40')]){_0x242b23[_0x3710('0x41')]=[{'all':!![]}];}return db[_0x3710('0x3f')][_0x3710('0x42')](_0x242b23);})[_0x3710('0x15')](function(_0x72ba95){_0x4c82c3[_0x3710('0x43')]=_0x72ba95;return _0x4c82c3;})[_0x3710('0x15')](respondWithFilteredResult(_0x2844f7,_0x242b23))[_0x3710('0x1f')](handleError(_0x2844f7,null));};exports[_0x3710('0x44')]=function(_0x180d6e,_0x518010){var _0x3fc234={'raw':!![],'where':{'id':_0x180d6e[_0x3710('0x45')]['id']}},_0x4fc312={};_0x4fc312[_0x3710('0x30')]=_[_0x3710('0x33')](db[_0x3710('0x3f')][_0x3710('0x46')]);_0x4fc312[_0x3710('0x32')]=_[_0x3710('0x33')](_0x180d6e[_0x3710('0x32')]);_0x4fc312[_0x3710('0x34')]=_['intersection'](_0x4fc312[_0x3710('0x30')],_0x4fc312[_0x3710('0x32')]);_0x3fc234[_0x3710('0x35')]=_[_0x3710('0x47')](_0x4fc312['model'],qs[_0x3710('0x48')](_0x180d6e[_0x3710('0x32')][_0x3710('0x48')]));_0x3fc234[_0x3710('0x35')]=_0x3fc234[_0x3710('0x35')]['length']?_0x3fc234[_0x3710('0x35')]:_0x4fc312[_0x3710('0x30')];if(_0x180d6e[_0x3710('0x32')]['includeAll']){_0x3fc234[_0x3710('0x41')]=[{'all':!![]}];}_0x3fc234=_[_0x3710('0x3c')]({},_0x3fc234,_0x180d6e[_0x3710('0x49')]);return db['MailMessage']['find'](_0x3fc234)[_0x3710('0x15')](handleEntityNotFound(_0x518010,null))[_0x3710('0x15')](respondWithResult(_0x518010,null))[_0x3710('0x1f')](handleError(_0x518010,null));};exports['update']=function(_0x380cc4,_0x30467b){if(_0x380cc4['body']['id']){delete _0x380cc4[_0x3710('0x4a')]['id'];}return db['MailMessage']['find']({'where':{'id':_0x380cc4[_0x3710('0x45')]['id']}})['then'](handleEntityNotFound(_0x30467b,null))['then'](saveUpdates(_0x380cc4[_0x3710('0x4a')],null))['then'](respondWithResult(_0x30467b,null))[_0x3710('0x1f')](handleError(_0x30467b,null));};exports['destroy']=function(_0x5dbbdd,_0x16cd14){return db[_0x3710('0x3f')][_0x3710('0x4b')]({'where':{'id':_0x5dbbdd[_0x3710('0x45')]['id']}})[_0x3710('0x15')](handleEntityNotFound(_0x16cd14,null))[_0x3710('0x15')](removeEntity(_0x16cd14,null))[_0x3710('0x1f')](handleError(_0x16cd14,null));};exports['describe']=function(_0x2a2d67,_0x3531f7){return db[_0x3710('0x3f')][_0x3710('0x4c')]()[_0x3710('0x15')](respondWithResult(_0x3531f7,null))[_0x3710('0x1f')](handleError(_0x3531f7,null));};exports[_0x3710('0x4d')]=function(_0x5c90cd,_0x3e4e47){return db[_0x3710('0x3f')][_0x3710('0x4d')](_0x5c90cd[_0x3710('0x4a')])['then'](function(_0x4221a9){if(_0x4221a9){if(_0x4221a9['direction']===_0x3710('0x4e')&&!_0x4221a9['secret']){var _0x3c929a,_0x93452f,_0x25fff2;if(_0x5c90cd[_0x3710('0x4a')]['to']){_0x93452f=_0x5c90cd['body']['to'][_0x3710('0x4f')](',')[0x0];}return db['MailAccount'][_0x3710('0x50')]({'where':{'id':_0x4221a9[_0x3710('0x51')]},'include':[{'model':db['CmList'],'as':_0x3710('0x52'),'include':[{'model':db[_0x3710('0x53')],'as':_0x3710('0x54'),'where':{'email':_0x93452f},'limit':0x1,'order':[[_0x3710('0x55'),_0x3710('0x56')]]}]},{'model':db[_0x3710('0x57')],'as':_0x3710('0x58'),'raw':!![]}]})['then'](function(_0x5b36ed){_0x3c929a=_0x5b36ed;if(_0x3c929a&&_0x3c929a[_0x3710('0x58')]){var _0x54e598={'tls':{'rejectUnauthorized':![]}};if(_[_0x3710('0x59')](_0x3c929a[_0x3710('0x58')][_0x3710('0x5a')])){_0x54e598[_0x3710('0x5b')]=_0x3c929a[_0x3710('0x58')]['host'];_0x54e598[_0x3710('0x5c')]=_0x3c929a[_0x3710('0x58')][_0x3710('0x5c')];_0x54e598[_0x3710('0x5d')]=_0x3c929a[_0x3710('0x58')][_0x3710('0x5d')];if(_0x3c929a[_0x3710('0x58')]['authentication']){_0x54e598[_0x3710('0x5e')]={'user':_0x3c929a[_0x3710('0x58')][_0x3710('0x5f')],'pass':_0x3c929a[_0x3710('0x58')][_0x3710('0x60')]};}}else{_0x54e598['service']=_0x3c929a[_0x3710('0x58')][_0x3710('0x5a')];_0x54e598[_0x3710('0x5e')]={'user':_0x3c929a[_0x3710('0x58')][_0x3710('0x5f')],'pass':_0x3c929a[_0x3710('0x58')]['pass']};_0x54e598[_0x3710('0x5d')]=_0x3c929a[_0x3710('0x58')]['secure'];}if(_0x5c90cd[_0x3710('0x4a')]['attachments']&&_0x5c90cd[_0x3710('0x4a')]['attachments'][_0x3710('0x61')]){for(var _0x33f8b9=0x0;_0x33f8b9<_0x5c90cd[_0x3710('0x4a')]['attachments'][_0x3710('0x61')];_0x33f8b9+=0x1){_0x5c90cd[_0x3710('0x4a')][_0x3710('0x62')][_0x33f8b9]={'filename':_0x5c90cd['body']['attachments'][_0x33f8b9][_0x3710('0x2a')],'path':path[_0x3710('0x63')](config['root'],'server/files/attachments',_0x5c90cd['body'][_0x3710('0x62')][_0x33f8b9][_0x3710('0x64')])};}}_0x25fff2={'account':_0x54e598,'message':_0x5c90cd[_0x3710('0x4a')]};return;}})['then'](function(){if(_0x3c929a[_0x3710('0x52')]){if(_0x3c929a[_0x3710('0x52')][_0x3710('0x54')][_0x3710('0x61')]){return _0x3c929a['List'][_0x3710('0x54')][0x0];}else{return db['CmContact'][_0x3710('0x4d')](_['defaults'](_0x5c90cd[_0x3710('0x4a')],{'firstName':_0x5c90cd['body']['to'],'email':_0x5c90cd[_0x3710('0x4a')]['to'],'phone':_0x5c90cd[_0x3710('0x4a')]['to'],'ListId':_0x3c929a[_0x3710('0x65')]}));}}else{throw new Error(_0x3710('0x66'));}})['then'](function(){if(_0x25fff2){return respondWithRpcPromise(_0x3710('0x67'),_0x3710('0x68'),_0x25fff2,client9003)['then'](function(_0x5c29d4){return _0x4221a9[_0x3710('0x27')]({'read':!![],'messageId':_0x5c29d4[_0x3710('0x69')],'sentAt':moment()[_0x3710('0x6a')](_0x3710('0x6b'))});})[_0x3710('0x1f')](function(_0x549582){logger[_0x3710('0x1c')]('%s',JSON[_0x3710('0x1b')](_0x549582));return _0x4221a9;});}return _0x4221a9;});}return _0x4221a9;}})[_0x3710('0x15')](respondWithResult(_0x3e4e47,0xc9))[_0x3710('0x1f')](handleError(_0x3e4e47,null));};exports[_0x3710('0x6c')]=function(_0xac357e,_0x4bb7b5){var _0x215233={'agent':{},'channel':_0x3710('0x6d')};if(_0xac357e[_0x3710('0x4a')]['id']){delete _0xac357e[_0x3710('0x4a')]['id'];}_0xac357e[_0x3710('0x4a')][_0x3710('0x6e')]=!![];_0xac357e['body'][_0x3710('0x6f')]=moment()['format'](_0x3710('0x6b'));_0xac357e[_0x3710('0x4a')][_0x3710('0x70')]=_0xac357e[_0x3710('0x4a')][_0x3710('0x70')]||_0xac357e[_0x3710('0x5f')]['id'];_0x215233[_0x3710('0x71')]['id']=_0xac357e[_0x3710('0x4a')]['UserId'];return db[_0x3710('0x3f')][_0x3710('0x4b')]({'where':{'id':_0xac357e[_0x3710('0x45')]['id'],'UserId':null}})[_0x3710('0x15')](handleEntityNotFound(_0x4bb7b5,null))[_0x3710('0x15')](saveUpdates(_0xac357e[_0x3710('0x4a')],null))['then'](function(_0x37318c){if(_0x37318c){_0x215233[_0x3710('0x1d')]=_0x37318c[_0x3710('0x72')]({'plain':!![]});return db['MailInteraction'][_0x3710('0x4b')]({'where':{'id':_0x37318c[_0x3710('0x73')]}});}return null;})[_0x3710('0x15')](handleEntityNotFound(_0x4bb7b5,null))['then'](function(_0x5c9552){if(_0x5c9552){return _0x5c9552[_0x3710('0x27')]({'UserId':_0xac357e[_0x3710('0x4a')]['UserId'],'read1stAt':_[_0x3710('0x59')](_0x5c9552[_0x3710('0x74')])?moment()[_0x3710('0x6a')](_0x3710('0x6b')):undefined});}return null;})[_0x3710('0x15')](function(_0x4873e0){if(_0x4873e0){_0x215233[_0x3710('0x75')]=_0x4873e0['get']({'plain':!![]});interaction_log[_0x3710('0x16')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xac357e[_0x3710('0x5f')]['id'],_0xac357e['user']['name'],_0xac357e[_0x3710('0x5f')][_0x3710('0x76')],_0x215233[_0x3710('0x75')]['id'],_0xac357e[_0x3710('0x4a')]?JSON[_0x3710('0x1b')](_0xac357e[_0x3710('0x4a')]):_0x3710('0x77'));return respondWithRpcPromise(_0x3710('0x78'),_0x3710('0x79'),_0x215233);}return null;})['then'](function(_0x49b323){var _0x2171b3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x49b323['message'][_0x3710('0x7a')];return db[_0x3710('0x7b')][_0x3710('0x32')](_0x2171b3,{'type':db[_0x3710('0x7c')][_0x3710('0x7d')][_0x3710('0x7e')],'raw':!![]})[_0x3710('0x15')](function(_0x46d6e2){return _0x46d6e2;});})[_0x3710('0x15')](function(_0x4cdfb7){if(_0x4cdfb7){_0x215233[_0x3710('0x1d')][_0x3710('0x7f')]=_0x4cdfb7[0x0];if(!_0xac357e[_0x3710('0x4a')][_0x3710('0x70')])return;return db[_0x3710('0x80')][_0x3710('0x4b')]({'where':{'id':_0xac357e[_0x3710('0x4a')][_0x3710('0x70')],'role':_0x3710('0x71')},'attributes':['id',_0x3710('0x2a'),_0x3710('0x81'),_0x3710('0x82'),'internal'],'raw':!![]});}return null;})[_0x3710('0x15')](function(_0x20c113){if(!_0x20c113)return null;_0x215233[_0x3710('0x1d')][_0x3710('0x71')]=_0x20c113;return _0x215233;})['then'](function(_0xbb57c4){if(_0xbb57c4){if(_0xac357e[_0x3710('0x4a')]['manual']){_0x215233[_0x3710('0x1d')][_0x3710('0x83')]=util[_0x3710('0x6a')]('SIP/%s',_0xac357e[_0x3710('0x5f')][_0x3710('0x2a')]);_0x215233[_0x3710('0x1d')][_0x3710('0x84')]=_0x215233[_0x3710('0x84')];_0x215233[_0x3710('0x1d')][_0x3710('0x85')]=_0x215233['channel'];_0x215233[_0x3710('0x1d')][_0x3710('0x86')]=_0x3710('0x6c');_0x215233[_0x3710('0x1d')][_0x3710('0x4a')]=htmlToText['fromString'](_0x215233[_0x3710('0x1d')]['body']);return respondWithRpcPromise(_0x3710('0x87'),'EventManager',{'event':_0x3710('0x88'),'message':_0x215233[_0x3710('0x1d')]},client9002)['then'](function(){return _0x215233;});}return _0x215233;}return null;})[_0x3710('0x15')](respondWithResult(_0x4bb7b5,null))[_0x3710('0x1f')](handleError(_0x4bb7b5,null));};exports['reject']=function(_0x3d7b21,_0x170ae9){var _0x4e41a1={'agent':{},'channel':_0x3710('0x6d')};if(_0x3d7b21[_0x3710('0x4a')]['id']){delete _0x3d7b21[_0x3710('0x4a')]['id'];}_0x3d7b21['body'][_0x3710('0x70')]=_0x3d7b21[_0x3710('0x4a')][_0x3710('0x70')]||_0x3d7b21['user']['id'];_0x4e41a1[_0x3710('0x71')]['id']=_0x3d7b21['body'][_0x3710('0x70')];return db[_0x3710('0x3f')][_0x3710('0x4b')]({'where':{'id':_0x3d7b21['params']['id'],'UserId':null}})[_0x3710('0x15')](handleEntityNotFound(_0x170ae9,null))[_0x3710('0x15')](function(_0x308a8f){if(_0x308a8f){_0x4e41a1[_0x3710('0x1d')]=_0x308a8f[_0x3710('0x72')]({'plain':!![]});return db[_0x3710('0x89')]['find']({'where':{'id':_0x308a8f[_0x3710('0x73')]}});}return null;})[_0x3710('0x15')](handleEntityNotFound(_0x170ae9,null))['then'](function(_0x3c344a){if(_0x3c344a){_0x4e41a1[_0x3710('0x75')]=_0x3c344a['get']({'plain':!![]});interaction_log['info'](_0x3710('0x8a'),_0x3d7b21[_0x3710('0x5f')]['id'],_0x3d7b21[_0x3710('0x5f')][_0x3710('0x2a')],_0x3d7b21['user']['role'],_0x4e41a1[_0x3710('0x75')]['id'],_0x3d7b21['body']?JSON['stringify'](_0x3d7b21[_0x3710('0x4a')]):'null');return respondWithRpcPromise('RejectMessage',_0x3710('0x8b'),_0x4e41a1);}return null;})[_0x3710('0x15')](function(_0x232de8){var _0x1e07d3=_0x3710('0x8c')+_0x232de8[_0x3710('0x1d')][_0x3710('0x7a')];return db[_0x3710('0x7b')][_0x3710('0x32')](_0x1e07d3,{'type':db[_0x3710('0x7c')]['QueryTypes'][_0x3710('0x7e')],'raw':!![]})[_0x3710('0x15')](function(_0x41a419){return _0x41a419;});})[_0x3710('0x15')](function(_0x45a4d5){if(_0x45a4d5){_0x4e41a1['message'][_0x3710('0x7f')]=_0x45a4d5[0x0];if(!_0x3d7b21['body'][_0x3710('0x70')])return;return db[_0x3710('0x80')][_0x3710('0x4b')]({'where':{'id':_0x3d7b21[_0x3710('0x4a')][_0x3710('0x70')],'role':_0x3710('0x71')},'attributes':['id',_0x3710('0x2a'),_0x3710('0x81'),'email',_0x3710('0x8d')],'raw':!![]});}return null;})[_0x3710('0x15')](function(_0x4094bd){if(!_0x4094bd)return null;_0x4e41a1[_0x3710('0x1d')]['agent']=_0x4094bd;return _0x4e41a1;})['then'](function(_0x4f7c9f){if(_0x4f7c9f){_0x4f7c9f[_0x3710('0x1d')][_0x3710('0x83')]=util[_0x3710('0x6a')]('SIP/%s',_0x3d7b21['user'][_0x3710('0x2a')]);_0x4f7c9f[_0x3710('0x1d')]['channel']=_0x4e41a1[_0x3710('0x84')];_0x4f7c9f[_0x3710('0x1d')][_0x3710('0x85')]=_0x4e41a1[_0x3710('0x84')];_0x4f7c9f[_0x3710('0x1d')]['event']=_0x3710('0x8e');_0x4f7c9f[_0x3710('0x1d')][_0x3710('0x4a')]=htmlToText[_0x3710('0x8f')](_0x4e41a1[_0x3710('0x1d')][_0x3710('0x4a')]);respondWithRpcPromise(_0x3710('0x87'),_0x3710('0x87'),{'event':_0x3710('0x90'),'message':_0x4f7c9f[_0x3710('0x1d')]},client9002);return _0x4e41a1;}return null;})[_0x3710('0x15')](respondWithResult(_0x170ae9,null))[_0x3710('0x1f')](handleError(_0x170ae9,null));};exports[_0x3710('0x91')]=function(_0x141144,_0x40a34a){var _0x5d471f=moment()[_0x3710('0x92')]()[_0x3710('0x93')]();var _0x1a4401=path[_0x3710('0x63')](config['root'],_0x3710('0x94'),_0x3710('0x95'),'tmp');var _0x575df1=path['join'](config[_0x3710('0x96')],'server',_0x3710('0x95'),_0x3710('0x62'));var _0x1b57ca=util[_0x3710('0x6a')](_0x3710('0x97'),_0x5d471f);return db[_0x3710('0x3f')][_0x3710('0x4b')]({'where':{'id':_0x141144[_0x3710('0x45')]['id']},'attributes':['id',_0x3710('0x4a'),_0x3710('0x98'),'to','cc','bcc',_0x3710('0x99'),_0x3710('0x9a')],'include':_0x141144[_0x3710('0x32')][_0x3710('0x62')]?[{'model':db[_0x3710('0x9b')],'as':_0x3710('0x9c')}]:undefined})[_0x3710('0x15')](handleEntityNotFound(_0x40a34a,null))['then'](function(_0x39ea41){if(_0x39ea41){var _0x436c48=_0x39ea41;var _0x1d6e0={'from':_0x436c48['from'],'to':_0x436c48['to'],'subject':_0x436c48['subject'],'html':htmlEntities[_0x3710('0x9d')](_0x436c48[_0x3710('0x4a')]),'headers':{'Date':moment(_0x436c48[_0x3710('0x9a')])[_0x3710('0x6a')](_0x3710('0x9e'))},'attachments':[]};if(_0x39ea41['cc']){_0x1d6e0['headers']['Cc']=_0x39ea41['cc'];}if(_0x39ea41[_0x3710('0x9f')]){_0x1d6e0[_0x3710('0xa0')][_0x3710('0xa1')]=_0x39ea41[_0x3710('0x9f')];}return new BPromise(function(_0x5ce35a,_0x203c99){if(_0x39ea41[_0x3710('0x9c')]){for(var _0xad208a=0x0;_0xad208a<_0x39ea41[_0x3710('0x9c')]['length'];_0xad208a++){var _0x5648a3=_0x39ea41['Attachments'][_0xad208a];var _0x3b2ebc=path[_0x3710('0x63')](_0x575df1,_0x5648a3[_0x3710('0x64')]);if(fs[_0x3710('0xa2')](_0x3b2ebc)){_0x1d6e0[_0x3710('0x62')]['push']({'name':_0x5648a3['name'],'contentType':_0x5648a3[_0x3710('0x2e')],'data':fs[_0x3710('0xa3')](_0x3b2ebc)});}}}emlformat[_0x3710('0xa4')](_0x1d6e0,function(_0x2ab575,_0x159e9f){if(_0x2ab575)return _0x203c99(_0x2ab575);fs[_0x3710('0xa5')](path[_0x3710('0x63')](_0x1a4401,_0x1b57ca),_0x159e9f);return _0x5ce35a(_0x159e9f);});});}})[_0x3710('0x15')](function(_0x449d2d){if(_0x449d2d){return _0x40a34a[_0x3710('0x91')](path[_0x3710('0x63')](_0x1a4401,_0x1b57ca),_0x1b57ca,function(_0x3cbc11){if(!_0x3cbc11)fs[_0x3710('0xa6')](path[_0x3710('0x63')](_0x1a4401,_0x1b57ca));});}})[_0x3710('0x1f')](handleError(_0x40a34a,null));}; \ No newline at end of file +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 diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 0c5bce4..338a969 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 _0xd7f6=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x466686,_0x261b89){var _0x43a940=function(_0x443fde){while(--_0x443fde){_0x466686['push'](_0x466686['shift']());}};_0x43a940(++_0x261b89);}(_0xd7f6,0x76));var _0x6d7f=function(_0x36e7fb,_0x4f81f1){_0x36e7fb=_0x36e7fb-0x0;var _0x5ac644=_0xd7f6[_0x36e7fb];return _0x5ac644;};'use strict';var EventEmitter=require(_0x6d7f('0x0'));var MailMessage=require(_0x6d7f('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x6d7f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d7f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x124a0d){return function(_0x345f30,_0x349c10,_0x226bc8){MailMessageEvents[_0x6d7f('0x4')](_0x124a0d+':'+_0x345f30['id'],_0x345f30);MailMessageEvents[_0x6d7f('0x4')](_0x124a0d,_0x345f30);_0x226bc8(null);};}for(var e in events){if(events[_0x6d7f('0x5')](e)){var event=events[e];MailMessage[_0x6d7f('0x6')](e,emitEvent(event));}}module[_0x6d7f('0x7')]=MailMessageEvents; \ No newline at end of file +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 diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 4983152..abf282f 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 _0x448e=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','MailInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util'];(function(_0x425716,_0x3e9d1c){var _0x2d39af=function(_0x1febc1){while(--_0x1febc1){_0x425716['push'](_0x425716['shift']());}};_0x2d39af(++_0x3e9d1c);}(_0x448e,0x1cd));var _0xe448=function(_0x211a02,_0x3b5362){_0x211a02=_0x211a02-0x0;var _0x13d91c=_0x448e[_0x211a02];return _0x13d91c;};'use strict';var _=require('lodash');var util=require(_0xe448('0x0'));var logger=require(_0xe448('0x1'))('api');var moment=require(_0xe448('0x2'));var BPromise=require('bluebird');var rp=require(_0xe448('0x3'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0xe448('0x4'));var rimraf=require(_0xe448('0x5'));var config=require(_0xe448('0x6'));var attributes=require('./mailMessage.attributes');module[_0xe448('0x7')]=function(_0x438ffb,_0x491a1a){return _0x438ffb[_0xe448('0x8')](_0xe448('0x9'),attributes,{'tableName':_0xe448('0xa'),'paranoid':![],'indexes':[{'name':_0xe448('0xb'),'fields':[_0xe448('0xb')]},{'name':_0xe448('0xc'),'fields':[_0xe448('0xd'),_0xe448('0xe')],'type':_0xe448('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2bf67b,_0x2e9660,_0xcfe6e3){if(_0x2bf67b['body']){_0x2bf67b[_0xe448('0xd')]=htmlToText[_0xe448('0x10')](_0x2bf67b[_0xe448('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xcfe6e3(null,_0x2e9660);},'afterCreate':function(_0x4f79d9,_0x3ec738,_0x2a5e1f){var _0x4e0b1d=_0x438ffb['models'];var _0x235952=_0x4f79d9[_0xe448('0x12')]({'plain':!![]});if(_0x235952[_0xe448('0x13')][_0xe448('0x14')]()==='in'||_0x235952['direction']['toLowerCase']()===_0xe448('0x15')&&!_0x235952[_0xe448('0x16')]&&!_[_0xe448('0x17')](_0x235952[_0xe448('0x18')])){_0x4e0b1d['MailInteraction'][_0xe448('0x19')]({'where':{'id':_0x235952[_0xe448('0x1a')]}})[_0xe448('0x1b')](function(_0x291285){if(_0x291285){_0x291285['update']({'lastMsgAt':_0x235952[_0xe448('0x1c')],'lastMsgDirection':_0x235952[_0xe448('0x13')][_0xe448('0x14')]()});}})[_0xe448('0x1d')](function(_0x1c2925){console[_0xe448('0x1e')](_0x1c2925);});}_0x2a5e1f();}},'charset':_0xe448('0x1f'),'collate':_0xe448('0x20')});}; \ No newline at end of file +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 diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 9bd1d44..268014a 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 _0x7916=['request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateMailMessage','MailMessage','body','options','raw','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','localhost','./mailMessage.socket','register'];(function(_0x2f0561,_0x1f5ee4){var _0x55bffd=function(_0x21cf48){while(--_0x21cf48){_0x2f0561['push'](_0x2f0561['shift']());}};_0x55bffd(++_0x1f5ee4);}(_0x7916,0x128));var _0x6791=function(_0x5f03af,_0x38333c){_0x5f03af=_0x5f03af-0x0;var _0x1f08fc=_0x7916[_0x5f03af];return _0x1f08fc;};'use strict';var _=require(_0x6791('0x0'));var util=require('util');var moment=require(_0x6791('0x1'));var BPromise=require(_0x6791('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6791('0x3'));var db=require(_0x6791('0x4'))['db'];var utils=require(_0x6791('0x5'));var logger=require(_0x6791('0x6'))('rpc');var config=require(_0x6791('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6791('0x8')][_0x6791('0x9')]({'port':0x232a});config['redis']=_[_0x6791('0xa')](config['redis'],{'host':_0x6791('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6791('0xc'))[_0x6791('0xd')](socket);function respondWithRpcPromise(_0x579950,_0xbc3bc6,_0x2769a4){return new BPromise(function(_0x2aeae9,_0x495d9c){return client[_0x6791('0xe')](_0x579950,_0x2769a4)[_0x6791('0xf')](function(_0x2025dd){logger[_0x6791('0x10')](_0x6791('0x11'),_0xbc3bc6,_0x6791('0x12'));logger[_0x6791('0x13')](_0x6791('0x14'),_0xbc3bc6,_0x6791('0x12'),JSON[_0x6791('0x15')](_0x2025dd));if(_0x2025dd[_0x6791('0x16')]){if(_0x2025dd['error']['code']===0x1f4){logger[_0x6791('0x16')]('MailMessage,\x20%s,\x20%s',_0xbc3bc6,_0x2025dd[_0x6791('0x16')]['message']);return _0x495d9c(_0x2025dd[_0x6791('0x16')][_0x6791('0x17')]);}logger['error'](_0x6791('0x11'),_0xbc3bc6,_0x2025dd['error'][_0x6791('0x17')]);return _0x2aeae9(_0x2025dd[_0x6791('0x16')]['message']);}else{logger[_0x6791('0x10')](_0x6791('0x11'),_0xbc3bc6,'request\x20sent');_0x2aeae9(_0x2025dd[_0x6791('0x18')]['message']);}})[_0x6791('0x19')](function(_0x126451){logger[_0x6791('0x16')](_0x6791('0x11'),_0xbc3bc6,_0x126451);_0x495d9c(_0x126451);});});}exports[_0x6791('0x1a')]=function(_0x2bc0ab){var _0x2ba11a=this;return new Promise(function(_0x581d51,_0x4a2922){return db[_0x6791('0x1b')]['create'](_0x2bc0ab[_0x6791('0x1c')],{'raw':_0x2bc0ab[_0x6791('0x1d')]?_0x2bc0ab['options'][_0x6791('0x1e')]===undefined?!![]:![]:!![]})[_0x6791('0xf')](function(_0x15b9ab){logger[_0x6791('0x10')]('CreateMailMessage',_0x2bc0ab);logger[_0x6791('0x13')](_0x6791('0x1a'),_0x2bc0ab,JSON['stringify'](_0x15b9ab));_0x581d51(_0x15b9ab);})['catch'](function(_0x4b23bc){logger[_0x6791('0x16')]('CreateMailMessage',_0x4b23bc[_0x6791('0x17')],_0x2bc0ab);_0x4a2922(_0x2ba11a['error'](0x1f4,_0x4b23bc['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index a3712b4..4cf5563 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 _0xa0e4=['removeListener','register','mailMessage:','./mailMessage.events','save','remove','update','emit'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xa0e4,0x1a3));var _0x4a0e=function(_0x2631f6,_0x552ce5){_0x2631f6=_0x2631f6-0x0;var _0x45917c=_0xa0e4[_0x2631f6];return _0x45917c;};'use strict';var MailMessageEvents=require(_0x4a0e('0x0'));var events=[_0x4a0e('0x1'),_0x4a0e('0x2'),_0x4a0e('0x3')];function createListener(_0xa4d914,_0x417825){return function(_0x301bec){_0x417825[_0x4a0e('0x4')](_0xa4d914,_0x301bec);};}function removeListener(_0x30589e,_0xa8c970){return function(){MailMessageEvents[_0x4a0e('0x5')](_0x30589e,_0xa8c970);};}exports[_0x4a0e('0x6')]=function(_0x2bf15b){for(var _0x3b3d6d=0x0,_0x2c7c10=events['length'];_0x3b3d6d<_0x2c7c10;_0x3b3d6d++){var _0x307414=events[_0x3b3d6d];var _0x3df5f3=createListener(_0x4a0e('0x7')+_0x307414,_0x2bf15b);MailMessageEvents['on'](_0x307414,_0x3df5f3);}}; \ No newline at end of file +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 diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 332a447..13138a8 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 _0xefa1=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','removeTeams','removeAgents','exports','util','path','connect-timeout','express'];(function(_0x171b2f,_0x337677){var _0x4678d8=function(_0x160fce){while(--_0x160fce){_0x171b2f['push'](_0x171b2f['shift']());}};_0x4678d8(++_0x337677);}(_0xefa1,0x170));var _0x1efa=function(_0x48c77d,_0x5a9007){_0x48c77d=_0x48c77d-0x0;var _0x1ff1a6=_0xefa1[_0x48c77d];return _0x1ff1a6;};'use strict';var multer=require('multer');var util=require(_0x1efa('0x0'));var path=require(_0x1efa('0x1'));var timeout=require(_0x1efa('0x2'));var express=require(_0x1efa('0x3'));var router=express[_0x1efa('0x4')]();var fs_extra=require(_0x1efa('0x5'));var auth=require(_0x1efa('0x6'));var interaction=require(_0x1efa('0x7'));var config=require(_0x1efa('0x8'));var controller=require(_0x1efa('0x9'));router[_0x1efa('0xa')]('/',auth[_0x1efa('0xb')](),controller[_0x1efa('0xc')]);router[_0x1efa('0xa')]('/describe',auth[_0x1efa('0xb')](),controller[_0x1efa('0xd')]);router[_0x1efa('0xa')](_0x1efa('0xe'),auth[_0x1efa('0xb')](),controller[_0x1efa('0xf')]);router[_0x1efa('0xa')](_0x1efa('0x10'),auth['isAuthenticated'](),controller[_0x1efa('0x11')]);router[_0x1efa('0xa')](_0x1efa('0x12'),auth[_0x1efa('0xb')](),controller[_0x1efa('0x13')]);router[_0x1efa('0xa')](_0x1efa('0x14'),auth['isAuthenticated'](),controller[_0x1efa('0x15')]);router[_0x1efa('0x16')]('/',auth['isAuthenticated'](),controller[_0x1efa('0x17')]);router[_0x1efa('0x16')](_0x1efa('0x12'),auth[_0x1efa('0xb')](),controller[_0x1efa('0x18')]);router['post']('/:id/users',auth[_0x1efa('0xb')](),controller[_0x1efa('0x19')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1efa('0x1a')]);router[_0x1efa('0x1b')](_0x1efa('0xe'),auth[_0x1efa('0xb')](),controller['destroy']);router[_0x1efa('0x1b')](_0x1efa('0x12'),auth['isAuthenticated'](),controller[_0x1efa('0x1c')]);router[_0x1efa('0x1b')](_0x1efa('0x14'),auth[_0x1efa('0xb')](),controller[_0x1efa('0x1d')]);module[_0x1efa('0x1e')]=router; \ No newline at end of file +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 diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index eb6a781..7650d20 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 _0x9508=['exports','STRING','name','ENUM','rrmemory','sequelize'];(function(_0x373c4b,_0x4ec002){var _0x1c9986=function(_0x2e9089){while(--_0x2e9089){_0x373c4b['push'](_0x373c4b['shift']());}};_0x1c9986(++_0x4ec002);}(_0x9508,0x16d));var _0x8950=function(_0x54d223,_0x1dbe80){_0x54d223=_0x54d223-0x0;var _0x5cbc8a=_0x9508[_0x54d223];return _0x5cbc8a;};'use strict';var Sequelize=require(_0x8950('0x0'));module[_0x8950('0x1')]={'name':{'type':Sequelize[_0x8950('0x2')],'unique':_0x8950('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8950('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8950('0x4')](_0x8950('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +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 diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 2438319..ce8fe8f 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 _0xffb3=['updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','User','Agents','online','voicePause','sequelize','each','UserMailQueue','forEach','emit','userMailQueue:save','removeTeams','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','transaction','removeAgents','userMailQueue:remove','addAgents','ids','omit','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','get','MailQueues','destroy','name','index','map','MailQueue','fieldName','type','key','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','sort','pick','MailQueueId','findAndCountAll','UserId','mailPause'];(function(_0x5a24de,_0x542232){var _0x388e2e=function(_0x438603){while(--_0x438603){_0x5a24de['push'](_0x5a24de['shift']());}};_0x388e2e(++_0x542232);}(_0xffb3,0xb2));var _0x3ffb=function(_0x76ed2b,_0x338e8b){_0x76ed2b=_0x76ed2b-0x0;var _0x327ffa=_0xffb3[_0x76ed2b];return _0x327ffa;};'use strict';var emlformat=require(_0x3ffb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3ffb('0x1'));var rp=require(_0x3ffb('0x2'));var moment=require(_0x3ffb('0x3'));var BPromise=require(_0x3ffb('0x4'));var Mustache=require(_0x3ffb('0x5'));var util=require(_0x3ffb('0x6'));var path=require('path');var sox=require(_0x3ffb('0x7'));var csv=require(_0x3ffb('0x8'));var ejs=require(_0x3ffb('0x9'));var fs=require('fs');var fs_extra=require(_0x3ffb('0xa'));var _=require(_0x3ffb('0xb'));var squel=require(_0x3ffb('0xc'));var crypto=require(_0x3ffb('0xd'));var jsforce=require(_0x3ffb('0xe'));var deskjs=require(_0x3ffb('0xf'));var toCsv=require(_0x3ffb('0x8'));var querystring=require(_0x3ffb('0x10'));var Papa=require(_0x3ffb('0x11'));var Redis=require(_0x3ffb('0x12'));var authService=require(_0x3ffb('0x13'));var qs=require(_0x3ffb('0x14'));var as=require(_0x3ffb('0x15'));var hardwareService=require(_0x3ffb('0x16'));var logger=require(_0x3ffb('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3ffb('0x18'));var db=require(_0x3ffb('0x19'))['db'];config[_0x3ffb('0x1a')]=_[_0x3ffb('0x1b')](config[_0x3ffb('0x1a')],{'host':_0x3ffb('0x1c'),'port':0x18eb});var socket=require(_0x3ffb('0x1d'))(new Redis(config[_0x3ffb('0x1a')]));require('./mailQueue.socket')[_0x3ffb('0x1e')](socket);function respondWithStatusCode(_0x2af629,_0x5011ac){_0x5011ac=_0x5011ac||0xcc;return function(_0x1377f4){if(_0x1377f4){return _0x2af629[_0x3ffb('0x1f')](_0x5011ac);}return _0x2af629[_0x3ffb('0x20')](_0x5011ac)[_0x3ffb('0x21')]();};}function respondWithResult(_0x416392,_0x2a5fe2){_0x2a5fe2=_0x2a5fe2||0xc8;return function(_0xaccabf){if(_0xaccabf){return _0x416392[_0x3ffb('0x20')](_0x2a5fe2)[_0x3ffb('0x22')](_0xaccabf);}};}function respondWithFilteredResult(_0x2a3178,_0x4e5dd0){return function(_0x1ad710){if(_0x1ad710){var _0x1ff650=typeof _0x4e5dd0[_0x3ffb('0x23')]===_0x3ffb('0x24')&&typeof _0x4e5dd0['limit']===_0x3ffb('0x24');var _0x4b8387=_0x1ad710[_0x3ffb('0x25')];var _0x469ea9=_0x1ff650?0x0:_0x4e5dd0[_0x3ffb('0x23')];var _0x3fa775=_0x1ff650?_0x1ad710['count']:_0x4e5dd0[_0x3ffb('0x23')]+_0x4e5dd0[_0x3ffb('0x26')];var _0xb17921;if(_0x3fa775>=_0x4b8387){_0x3fa775=_0x4b8387;_0xb17921=0xc8;}else{_0xb17921=0xce;}_0x2a3178['status'](_0xb17921);return _0x2a3178[_0x3ffb('0x27')]('Content-Range',_0x469ea9+'-'+_0x3fa775+'/'+_0x4b8387)[_0x3ffb('0x22')](_0x1ad710);}return null;};}function patchUpdates(_0x42004a){return function(_0x181204){try{jsonpatch[_0x3ffb('0x28')](_0x181204,_0x42004a,!![]);}catch(_0x37574e){return BPromise[_0x3ffb('0x29')](_0x37574e);}return _0x181204['save']();};}function saveUpdates(_0x7e291d,_0x251b98){return function(_0x23379){if(_0x23379){return _0x23379[_0x3ffb('0x2a')](_0x7e291d)[_0x3ffb('0x2b')](function(_0x50dac6){return _0x50dac6;});}return null;};}function removeEntity(_0x577ec6,_0x4f3adb){return function(_0x29d98e){if(_0x29d98e){return _0x29d98e['destroy']()[_0x3ffb('0x2b')](function(){var _0x107f8d=_0x29d98e[_0x3ffb('0x2c')]({'plain':!![]});var _0x5bdb33=_0x3ffb('0x2d');return db['UserProfileResource'][_0x3ffb('0x2e')]({'where':{'type':_0x5bdb33,'resourceId':_0x107f8d['id']}})[_0x3ffb('0x2b')](function(){return _0x29d98e;});})[_0x3ffb('0x2b')](function(){_0x577ec6[_0x3ffb('0x20')](0xcc)[_0x3ffb('0x21')]();});}};}function handleEntityNotFound(_0x5a4f50,_0x4ad9bd){return function(_0x3020e0){if(!_0x3020e0){_0x5a4f50[_0x3ffb('0x1f')](0x194);}return _0x3020e0;};}function handleError(_0xbc4c03,_0x5fb2e1){_0x5fb2e1=_0x5fb2e1||0x1f4;return function(_0x1327e8){logger['error'](_0x1327e8['stack']);if(_0x1327e8[_0x3ffb('0x2f')]){delete _0x1327e8['name'];}_0xbc4c03[_0x3ffb('0x20')](_0x5fb2e1)['send'](_0x1327e8);};}exports[_0x3ffb('0x30')]=function(_0x39cac7,_0x4d3a67){var _0x55c13c={},_0x35bcd3={},_0x202687={'count':0x0,'rows':[]};var _0x591a30=_[_0x3ffb('0x31')](db[_0x3ffb('0x32')]['rawAttributes'],function(_0x13fd66){return{'name':_0x13fd66[_0x3ffb('0x33')],'type':_0x13fd66[_0x3ffb('0x34')][_0x3ffb('0x35')]};});_0x35bcd3['model']=_[_0x3ffb('0x31')](_0x591a30,_0x3ffb('0x2f'));_0x35bcd3[_0x3ffb('0x36')]=_[_0x3ffb('0x37')](_0x39cac7[_0x3ffb('0x36')]);_0x35bcd3[_0x3ffb('0x38')]=_[_0x3ffb('0x39')](_0x35bcd3['model'],_0x35bcd3[_0x3ffb('0x36')]);_0x55c13c[_0x3ffb('0x3a')]=_['intersection'](_0x35bcd3['model'],qs[_0x3ffb('0x3b')](_0x39cac7[_0x3ffb('0x36')][_0x3ffb('0x3b')]));_0x55c13c[_0x3ffb('0x3a')]=_0x55c13c[_0x3ffb('0x3a')]['length']?_0x55c13c[_0x3ffb('0x3a')]:_0x35bcd3[_0x3ffb('0x3c')];if(!_0x39cac7[_0x3ffb('0x36')][_0x3ffb('0x3d')](_0x3ffb('0x3e'))){_0x55c13c[_0x3ffb('0x26')]=qs[_0x3ffb('0x26')](_0x39cac7[_0x3ffb('0x36')][_0x3ffb('0x26')]);_0x55c13c[_0x3ffb('0x23')]=qs[_0x3ffb('0x23')](_0x39cac7[_0x3ffb('0x36')]['offset']);}_0x55c13c[_0x3ffb('0x3f')]=qs['sort'](_0x39cac7[_0x3ffb('0x36')]['sort']);_0x55c13c[_0x3ffb('0x40')]=qs[_0x3ffb('0x38')](_['pick'](_0x39cac7[_0x3ffb('0x36')],_0x35bcd3['filters']),_0x591a30);if(_0x39cac7[_0x3ffb('0x36')][_0x3ffb('0x41')]){_0x55c13c[_0x3ffb('0x40')]=_['merge'](_0x55c13c[_0x3ffb('0x40')],{'$or':_[_0x3ffb('0x31')](_0x591a30,function(_0x4c653a){if(_0x4c653a[_0x3ffb('0x34')]!=='VIRTUAL'){var _0x4a6fdc={};_0x4a6fdc[_0x4c653a[_0x3ffb('0x2f')]]={'$like':'%'+_0x39cac7[_0x3ffb('0x36')][_0x3ffb('0x41')]+'%'};return _0x4a6fdc;}})});}_0x55c13c=_[_0x3ffb('0x42')]({},_0x55c13c,_0x39cac7[_0x3ffb('0x43')]);var _0x3f8745={'where':_0x55c13c[_0x3ffb('0x40')]};return db[_0x3ffb('0x32')][_0x3ffb('0x25')](_0x3f8745)[_0x3ffb('0x2b')](function(_0x1037fb){_0x202687[_0x3ffb('0x25')]=_0x1037fb;if(_0x39cac7[_0x3ffb('0x36')][_0x3ffb('0x44')]){_0x55c13c[_0x3ffb('0x45')]=[{'all':!![]}];}return db[_0x3ffb('0x32')][_0x3ffb('0x46')](_0x55c13c);})[_0x3ffb('0x2b')](function(_0x24d7fc){_0x202687[_0x3ffb('0x47')]=_0x24d7fc;return _0x202687;})[_0x3ffb('0x2b')](respondWithFilteredResult(_0x4d3a67,_0x55c13c))[_0x3ffb('0x48')](handleError(_0x4d3a67,null));};exports['show']=function(_0x42239e,_0x4f39b0){var _0x28757f={'raw':!![],'where':{'id':_0x42239e[_0x3ffb('0x49')]['id']}},_0xa1f6f6={};_0xa1f6f6[_0x3ffb('0x3c')]=_[_0x3ffb('0x37')](db['MailQueue'][_0x3ffb('0x4a')]);_0xa1f6f6['query']=_[_0x3ffb('0x37')](_0x42239e[_0x3ffb('0x36')]);_0xa1f6f6[_0x3ffb('0x38')]=_[_0x3ffb('0x39')](_0xa1f6f6['model'],_0xa1f6f6[_0x3ffb('0x36')]);_0x28757f['attributes']=_[_0x3ffb('0x39')](_0xa1f6f6[_0x3ffb('0x3c')],qs[_0x3ffb('0x3b')](_0x42239e[_0x3ffb('0x36')][_0x3ffb('0x3b')]));_0x28757f['attributes']=_0x28757f['attributes'][_0x3ffb('0x4b')]?_0x28757f[_0x3ffb('0x3a')]:_0xa1f6f6[_0x3ffb('0x3c')];if(_0x42239e[_0x3ffb('0x36')][_0x3ffb('0x44')]){_0x28757f[_0x3ffb('0x45')]=[{'all':!![]}];}_0x28757f=_[_0x3ffb('0x42')]({},_0x28757f,_0x42239e[_0x3ffb('0x43')]);return db[_0x3ffb('0x32')][_0x3ffb('0x4c')](_0x28757f)[_0x3ffb('0x2b')](handleEntityNotFound(_0x4f39b0,null))[_0x3ffb('0x2b')](respondWithResult(_0x4f39b0,null))[_0x3ffb('0x48')](handleError(_0x4f39b0,null));};exports[_0x3ffb('0x4d')]=function(_0x2dc104,_0x1c1d08){return db[_0x3ffb('0x32')][_0x3ffb('0x4d')](_0x2dc104[_0x3ffb('0x4e')],{})[_0x3ffb('0x2b')](function(_0x89ab2b){var _0x5ec499=_0x2dc104[_0x3ffb('0x4f')][_0x3ffb('0x2c')]({'plain':!![]});if(!_0x5ec499)throw new Error(_0x3ffb('0x50'));if(_0x5ec499[_0x3ffb('0x51')]===_0x3ffb('0x4f')){var _0x1c6e2b=_0x89ab2b[_0x3ffb('0x2c')]({'plain':!![]});var _0x1baa76='MailQueues';return db[_0x3ffb('0x52')]['find']({'where':{'name':_0x1baa76,'userProfileId':_0x5ec499['userProfileId']},'raw':!![]})['then'](function(_0x4e332d){if(_0x4e332d&&_0x4e332d['autoAssociation']===0x0){return db[_0x3ffb('0x53')][_0x3ffb('0x4d')]({'name':_0x1c6e2b['name'],'resourceId':_0x1c6e2b['id'],'type':_0x4e332d[_0x3ffb('0x2f')],'sectionId':_0x4e332d['id']},{})[_0x3ffb('0x2b')](function(){return _0x89ab2b;});}else{return _0x89ab2b;}})[_0x3ffb('0x48')](function(_0x46ac76){logger[_0x3ffb('0x54')](_0x3ffb('0x55'),_0x46ac76);throw _0x46ac76;});}return _0x89ab2b;})[_0x3ffb('0x2b')](respondWithResult(_0x1c1d08,0xc9))[_0x3ffb('0x48')](handleError(_0x1c1d08,null));};exports[_0x3ffb('0x2a')]=function(_0x5126d9,_0x2eab2c){if(_0x5126d9['body']['id']){delete _0x5126d9[_0x3ffb('0x4e')]['id'];}return db[_0x3ffb('0x32')][_0x3ffb('0x4c')]({'where':{'id':_0x5126d9[_0x3ffb('0x49')]['id']}})[_0x3ffb('0x2b')](handleEntityNotFound(_0x2eab2c,null))['then'](saveUpdates(_0x5126d9[_0x3ffb('0x4e')],null))['then'](respondWithResult(_0x2eab2c,null))['catch'](handleError(_0x2eab2c,null));};exports[_0x3ffb('0x2e')]=function(_0x2b21d7,_0x26001b){return db['MailQueue'][_0x3ffb('0x4c')]({'where':{'id':_0x2b21d7[_0x3ffb('0x49')]['id']}})['then'](handleEntityNotFound(_0x26001b,null))[_0x3ffb('0x2b')](removeEntity(_0x26001b,null))[_0x3ffb('0x48')](handleError(_0x26001b,null));};exports[_0x3ffb('0x56')]=function(_0x20804f,_0x4b06c1){return db[_0x3ffb('0x32')][_0x3ffb('0x56')]()[_0x3ffb('0x2b')](respondWithResult(_0x4b06c1,null))[_0x3ffb('0x48')](handleError(_0x4b06c1,null));};exports['getMembers']=function(_0xd4a37c,_0x361ff5,_0x2bcb42){var _0x519540={'raw':!![],'where':{}},_0x10a5dd={},_0x4ea433;return db['MailQueue'][_0x3ffb('0x57')]({'where':{'id':_0xd4a37c[_0x3ffb('0x49')]['id']}})[_0x3ffb('0x2b')](handleEntityNotFound(_0x361ff5,null))[_0x3ffb('0x2b')](function(_0x28a0f3){if(_0x28a0f3){_0x4ea433=_0x28a0f3['get']({'plain':!![]});_0x10a5dd[_0x3ffb('0x3c')]=_[_0x3ffb('0x37')](db['UserMailQueue'][_0x3ffb('0x4a')]);_0x10a5dd[_0x3ffb('0x36')]=_[_0x3ffb('0x37')](_0xd4a37c[_0x3ffb('0x36')]);_0x10a5dd['filters']=_['intersection'](_0x10a5dd[_0x3ffb('0x3c')],_0x10a5dd[_0x3ffb('0x36')]);_0x519540['attributes']=_[_0x3ffb('0x39')](_0x10a5dd['model'],qs[_0x3ffb('0x3b')](_0xd4a37c['query'][_0x3ffb('0x3b')]));_0x519540[_0x3ffb('0x3a')]=_0x519540[_0x3ffb('0x3a')]['length']?_0x519540[_0x3ffb('0x3a')]:_0x10a5dd[_0x3ffb('0x3c')];if(!_0xd4a37c['query'][_0x3ffb('0x3d')]('nolimit')){_0x519540[_0x3ffb('0x26')]=qs[_0x3ffb('0x26')](_0xd4a37c[_0x3ffb('0x36')][_0x3ffb('0x26')]);_0x519540[_0x3ffb('0x23')]=qs[_0x3ffb('0x23')](_0xd4a37c['query'][_0x3ffb('0x23')]);}_0x519540['order']=qs['sort'](_0xd4a37c[_0x3ffb('0x36')][_0x3ffb('0x58')]);_0x519540[_0x3ffb('0x40')]=qs['filters'](_[_0x3ffb('0x59')](_0xd4a37c['query'],_0x10a5dd['filters']));_0x519540[_0x3ffb('0x40')][_0x3ffb('0x5a')]=_0x28a0f3['id'];if(_0xd4a37c['query'][_0x3ffb('0x41')]){_0x519540[_0x3ffb('0x40')]=_['merge'](_0x519540[_0x3ffb('0x40')],{'$or':_[_0x3ffb('0x31')](_0x519540[_0x3ffb('0x3a')],function(_0xe6a285){var _0xd2f11e={};_0xd2f11e[_0xe6a285]={'$like':'%'+_0xd4a37c[_0x3ffb('0x36')]['filter']+'%'};return _0xd2f11e;})});}_0x519540=_[_0x3ffb('0x42')]({},_0x519540,_0xd4a37c[_0x3ffb('0x43')]);return db['UserMailQueue'][_0x3ffb('0x46')](_0x519540);}})[_0x3ffb('0x2b')](function(_0x217d2f){if(_0x217d2f){return db['User'][_0x3ffb('0x5b')]({'where':{'id':_[_0x3ffb('0x31')](_0x217d2f,_0x3ffb('0x5c')),'role':'agent'},'attributes':['id',_0x3ffb('0x2f'),_0x3ffb('0x5d'),_0x3ffb('0x5e'),_0x3ffb('0x5f')]});}})['then'](function(_0x4aab12){if(_0x4aab12){return{'count':_0x4aab12['count'],'rows':_[_0x3ffb('0x31')](_0x4aab12['rows'],function(_0x587037){return{'membername':_0x587037[_0x3ffb('0x2f')],'UserId':_0x587037['id'],'queue_name':_0x4ea433[_0x3ffb('0x2f')],'MailQueueId':_0x4ea433['id'],'interface':util[_0x3ffb('0x60')](_0x3ffb('0x61'),_0x3ffb('0x62'),_0x587037['name']),'penalty':0x0,'paused':_0x587037['mailPause'],'createdAt':_0x587037[_0x3ffb('0x5f')],'updatedAt':_0x587037[_0x3ffb('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x361ff5,_0x519540))[_0x3ffb('0x48')](handleError(_0x361ff5,null));};exports[_0x3ffb('0x63')]=function(_0x231b6e,_0x442429,_0x2c6d52){var _0x590366={};var _0x268319={};var _0x588a89;var _0x3a3395;return db[_0x3ffb('0x32')]['findOne']({'where':{'id':_0x231b6e['params']['id']}})[_0x3ffb('0x2b')](handleEntityNotFound(_0x442429,null))['then'](function(_0x1e45ed){if(_0x1e45ed){_0x588a89=_0x1e45ed;_0x268319[_0x3ffb('0x3c')]=_[_0x3ffb('0x37')](db[_0x3ffb('0x64')][_0x3ffb('0x4a')]);_0x268319[_0x3ffb('0x36')]=_[_0x3ffb('0x37')](_0x231b6e[_0x3ffb('0x36')]);_0x268319['filters']=_['intersection'](_0x268319['model'],_0x268319[_0x3ffb('0x36')]);_0x590366[_0x3ffb('0x3a')]=_['intersection'](_0x268319['model'],qs[_0x3ffb('0x3b')](_0x231b6e['query'][_0x3ffb('0x3b')]));_0x590366[_0x3ffb('0x3a')]=_0x590366[_0x3ffb('0x3a')][_0x3ffb('0x4b')]?_0x590366['attributes']:_0x268319[_0x3ffb('0x3c')];_0x590366[_0x3ffb('0x3f')]=qs[_0x3ffb('0x58')](_0x231b6e[_0x3ffb('0x36')][_0x3ffb('0x58')]);_0x590366[_0x3ffb('0x40')]=qs['filters'](_['pick'](_0x231b6e[_0x3ffb('0x36')],_0x268319[_0x3ffb('0x38')]));if(_0x231b6e[_0x3ffb('0x36')][_0x3ffb('0x41')]){_0x590366[_0x3ffb('0x40')]=_[_0x3ffb('0x42')](_0x590366[_0x3ffb('0x40')],{'$or':_[_0x3ffb('0x31')](_0x590366[_0x3ffb('0x3a')],function(_0x3022be){var _0x438661={};_0x438661[_0x3022be]={'$like':'%'+_0x231b6e[_0x3ffb('0x36')][_0x3ffb('0x41')]+'%'};return _0x438661;})});}_0x590366=_[_0x3ffb('0x42')]({},_0x590366,_0x231b6e['options']);return _0x588a89[_0x3ffb('0x63')](_0x590366);}})[_0x3ffb('0x2b')](function(_0x105b25){if(_0x105b25){_0x3a3395=_0x105b25[_0x3ffb('0x4b')];if(!_0x231b6e[_0x3ffb('0x36')]['hasOwnProperty'](_0x3ffb('0x3e'))){_0x590366['limit']=qs['limit'](_0x231b6e['query'][_0x3ffb('0x26')]);_0x590366[_0x3ffb('0x23')]=qs[_0x3ffb('0x23')](_0x231b6e[_0x3ffb('0x36')][_0x3ffb('0x23')]);}return _0x588a89[_0x3ffb('0x63')](_0x590366);}})[_0x3ffb('0x2b')](function(_0x495cf4){if(_0x495cf4){return _0x495cf4?{'count':_0x3a3395,'rows':_0x495cf4}:null;}})[_0x3ffb('0x2b')](respondWithResult(_0x442429,null))[_0x3ffb('0x48')](handleError(_0x442429,null));};exports[_0x3ffb('0x65')]=function(_0x38cf3e,_0x2e4e32,_0x4ed4a8){var _0x52864a=_0x38cf3e[_0x3ffb('0x4e')]['ids'];return db[_0x3ffb('0x64')][_0x3ffb('0x46')]({'where':{'id':_0x52864a},'attributes':['id'],'include':[{'model':db[_0x3ffb('0x66')],'as':_0x3ffb('0x67'),'attributes':['id',_0x3ffb('0x2f'),_0x3ffb('0x68'),_0x3ffb('0x69'),'interface'],'raw':!![]}]})[_0x3ffb('0x2b')](function(_0x1ea389){if(_0x1ea389){var _0x553198=_['flatMap'](_0x1ea389,function(_0x5c7a9e){var _0x281616=_0x5c7a9e[_0x3ffb('0x2c')]({'plain':!![]});return _0x281616[_0x3ffb('0x67')];});return db[_0x3ffb('0x32')][_0x3ffb('0x4c')]({'where':{'id':_0x38cf3e[_0x3ffb('0x49')]['id']}})[_0x3ffb('0x2b')](function(_0x5abe9f){return db[_0x3ffb('0x6a')]['transaction'](function(_0x81afcc){return _0x5abe9f[_0x3ffb('0x65')](_0x52864a,{'transaction':_0x81afcc})['then'](function(){return BPromise[_0x3ffb('0x6b')](_0x553198,function(_0x3ec389){return db[_0x3ffb('0x6c')]['findOrCreate']({'where':{'UserId':_0x3ec389['id'],'MailQueueId':_0x38cf3e[_0x3ffb('0x49')]['id']},'transaction':_0x81afcc});});})[_0x3ffb('0x2b')](function(){_0x553198[_0x3ffb('0x6d')](function(_0x2aa916){socket[_0x3ffb('0x6e')](_0x3ffb('0x6f'),{'UserId':_0x2aa916['id'],'MailQueueId':_0x5abe9f['id']});});});});});}})[_0x3ffb('0x2b')](respondWithStatusCode(_0x2e4e32,null))[_0x3ffb('0x48')](handleError(_0x2e4e32,null));};exports[_0x3ffb('0x70')]=function(_0x439026,_0x44e4e3,_0x96541a){return db['Team']['findAll']({'where':{'id':_0x439026[_0x3ffb('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3ffb('0x67'),'attributes':['id'],'raw':!![]}]})[_0x3ffb('0x2b')](handleEntityNotFound(_0x44e4e3,null))[_0x3ffb('0x2b')](function(_0x25842d){var _0x1c4a44=_[_0x3ffb('0x31')](_0x25842d,'id');var _0x409d35=[];var _0x479504=[];var _0x3c61ee=squel[_0x3ffb('0x71')]();_0x3c61ee['field']('tq.TeamId')[_0x3ffb('0x72')](_0x3ffb('0x73'),'tq')[_0x3ffb('0x74')](_0x3ffb('0x75'),'ut',_0x3ffb('0x76'))[_0x3ffb('0x40')](_0x3ffb('0x77'),_0x439026[_0x3ffb('0x49')]['id']);for(var _0x3fb39d=0x0;_0x3fb39d<_0x25842d[_0x3ffb('0x4b')];_0x3fb39d+=0x1){let _0x2fbe32=_0x25842d[_0x3fb39d];for(var _0x348079=0x0;_0x348079<_0x2fbe32[_0x3ffb('0x67')][_0x3ffb('0x4b')];_0x348079+=0x1){let _0x5d1200=_0x2fbe32[_0x3ffb('0x67')][_0x348079];var _0x9e9a6=_0x3c61ee[_0x3ffb('0x78')]();_0x9e9a6[_0x3ffb('0x40')](_0x3ffb('0x79'),_0x5d1200['id']);_0x479504[_0x3ffb('0x7a')](db[_0x3ffb('0x6a')][_0x3ffb('0x36')](_0x9e9a6[_0x3ffb('0x7b')](),{'type':db[_0x3ffb('0x6a')][_0x3ffb('0x7c')]['SELECT']})[_0x3ffb('0x2b')](function(_0x3e77f7){if(_0x3e77f7[_0x3ffb('0x4b')]===0x1){return _0x5d1200['id'];}else{var _0xd8d6e0=_[_0x3ffb('0x7d')](_['map'](_0x3e77f7,_0x3ffb('0x7e')),function(_0x316bd1){return _['includes'](_0x1c4a44,_0x316bd1);});if(_0xd8d6e0){return _0x5d1200['id'];}}}));}}return BPromise[_0x3ffb('0x7f')](_0x479504)[_0x3ffb('0x2b')](function(_0x1c8595){_0x409d35=_(_0x409d35)['union'](_0x1c8595)['compact']()['value']();return db[_0x3ffb('0x32')][_0x3ffb('0x4c')]({'where':{'id':_0x439026[_0x3ffb('0x49')]['id']}})['then'](function(_0x3061da){return db['sequelize'][_0x3ffb('0x80')](function(_0x2f83b0){return _0x3061da['removeTeams'](_0x439026['query']['ids'],{'transaction':_0x2f83b0})[_0x3ffb('0x2b')](function(){if(!_['isEmpty'](_0x409d35)){return _0x3061da[_0x3ffb('0x81')](_0x409d35,{'transaction':_0x2f83b0});}})[_0x3ffb('0x2b')](function(){_0x409d35['forEach'](function(_0x2ef4dd){socket[_0x3ffb('0x6e')](_0x3ffb('0x82'),{'UserId':_0x2ef4dd,'MailQueueId':_0x3061da['id']});});});});});});})[_0x3ffb('0x2b')](respondWithStatusCode(_0x44e4e3,null))['catch'](handleError(_0x44e4e3,null));};exports[_0x3ffb('0x83')]=function(_0x6bad8,_0x1b087c,_0x7b0364){return db[_0x3ffb('0x32')][_0x3ffb('0x4c')]({'where':{'id':_0x6bad8[_0x3ffb('0x49')]['id']}})[_0x3ffb('0x2b')](handleEntityNotFound(_0x1b087c,null))[_0x3ffb('0x2b')](function(_0x8ca4dc){if(_0x8ca4dc){return _0x8ca4dc[_0x3ffb('0x83')](_0x6bad8[_0x3ffb('0x4e')][_0x3ffb('0x84')],_[_0x3ffb('0x85')](_0x6bad8[_0x3ffb('0x4e')],[_0x3ffb('0x84'),'id'])||{})['spread'](function(_0x7870be){for(var _0x4a2e85=0x0;_0x4a2e85<_0x6bad8[_0x3ffb('0x4e')][_0x3ffb('0x84')][_0x3ffb('0x4b')];_0x4a2e85+=0x1){socket[_0x3ffb('0x6e')](_0x3ffb('0x6f'),{'UserId':Number(_0x6bad8[_0x3ffb('0x4e')][_0x3ffb('0x84')][_0x4a2e85]),'MailQueueId':Number(_0x6bad8['params']['id'])});}return _0x7870be;});}})[_0x3ffb('0x2b')](respondWithResult(_0x1b087c,null))['catch'](handleError(_0x1b087c,null));};exports[_0x3ffb('0x81')]=function(_0x55d15d,_0x4c7506,_0x222247){return db[_0x3ffb('0x32')][_0x3ffb('0x4c')]({'where':{'id':_0x55d15d[_0x3ffb('0x49')]['id']}})[_0x3ffb('0x2b')](handleEntityNotFound(_0x4c7506,null))[_0x3ffb('0x2b')](function(_0x5d8fc7){if(_0x5d8fc7){return _0x5d8fc7[_0x3ffb('0x81')](_0x55d15d[_0x3ffb('0x36')][_0x3ffb('0x84')])[_0x3ffb('0x2b')](function(){if(_[_0x3ffb('0x86')](_0x55d15d['query'][_0x3ffb('0x84')])){for(var _0x3abc9a=0x0;_0x3abc9a<_0x55d15d['query']['ids'][_0x3ffb('0x4b')];_0x3abc9a+=0x1){socket['emit'](_0x3ffb('0x82'),{'UserId':Number(_0x55d15d[_0x3ffb('0x36')][_0x3ffb('0x84')][_0x3abc9a]),'MailQueueId':Number(_0x55d15d[_0x3ffb('0x49')]['id'])});}}else{socket['emit'](_0x3ffb('0x82'),{'UserId':Number(_0x55d15d['query']['ids']),'MailQueueId':Number(_0x55d15d[_0x3ffb('0x49')]['id'])});}});}})[_0x3ffb('0x2b')](respondWithStatusCode(_0x4c7506,null))['catch'](handleError(_0x4c7506,null));};exports[_0x3ffb('0x87')]=function(_0x19a208,_0x317b66,_0x3f19d0){var _0x562a1d={};var _0x1249ba={};var _0x2e38cb;var _0x1c9135;return db[_0x3ffb('0x32')][_0x3ffb('0x57')]({'where':{'id':_0x19a208[_0x3ffb('0x49')]['id']}})['then'](handleEntityNotFound(_0x317b66,null))[_0x3ffb('0x2b')](function(_0x4af1a4){if(_0x4af1a4){_0x2e38cb=_0x4af1a4;_0x1249ba[_0x3ffb('0x3c')]=_['keys'](db['User'][_0x3ffb('0x4a')]);_0x1249ba[_0x3ffb('0x36')]=_[_0x3ffb('0x37')](_0x19a208[_0x3ffb('0x36')]);_0x1249ba['filters']=_['intersection'](_0x1249ba['model'],_0x1249ba[_0x3ffb('0x36')]);_0x562a1d[_0x3ffb('0x3a')]=_[_0x3ffb('0x39')](_0x1249ba[_0x3ffb('0x3c')],qs['fields'](_0x19a208[_0x3ffb('0x36')][_0x3ffb('0x3b')]));_0x562a1d[_0x3ffb('0x3a')]=_0x562a1d['attributes'][_0x3ffb('0x4b')]?_0x562a1d[_0x3ffb('0x3a')]:_0x1249ba['model'];_0x562a1d[_0x3ffb('0x3f')]=qs['sort'](_0x19a208[_0x3ffb('0x36')][_0x3ffb('0x58')]);_0x562a1d[_0x3ffb('0x40')]=qs[_0x3ffb('0x38')](_[_0x3ffb('0x59')](_0x19a208['query'],_0x1249ba['filters']));if(_0x19a208[_0x3ffb('0x36')][_0x3ffb('0x41')]){_0x562a1d[_0x3ffb('0x40')]=_['merge'](_0x562a1d['where'],{'$or':_[_0x3ffb('0x31')](_0x562a1d[_0x3ffb('0x3a')],function(_0x15b1d5){var _0x37e877={};_0x37e877[_0x15b1d5]={'$like':'%'+_0x19a208['query'][_0x3ffb('0x41')]+'%'};return _0x37e877;})});}_0x562a1d=_['merge']({},_0x562a1d,_0x19a208[_0x3ffb('0x43')]);return _0x2e38cb[_0x3ffb('0x87')](_0x562a1d);}})[_0x3ffb('0x2b')](function(_0x5995bb){if(_0x5995bb){_0x1c9135=_0x5995bb['length'];if(!_0x19a208['query']['hasOwnProperty'](_0x3ffb('0x3e'))){_0x562a1d[_0x3ffb('0x26')]=qs[_0x3ffb('0x26')](_0x19a208[_0x3ffb('0x36')][_0x3ffb('0x26')]);_0x562a1d[_0x3ffb('0x23')]=qs['offset'](_0x19a208['query'][_0x3ffb('0x23')]);}return _0x2e38cb[_0x3ffb('0x87')](_0x562a1d);}})[_0x3ffb('0x2b')](function(_0x479d31){if(_0x479d31){return _0x479d31?{'count':_0x1c9135,'rows':_0x479d31}:null;}})[_0x3ffb('0x2b')](respondWithResult(_0x317b66,null))[_0x3ffb('0x48')](handleError(_0x317b66,null));}; \ No newline at end of file +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 diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b8ac9e8..d17af50 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 _0x741e=['../../mysqldb','MailQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x741e,0x1c1));var _0xe741=function(_0x930498,_0x45b32a){_0x930498=_0x930498-0x0;var _0x550500=_0x741e[_0x930498];return _0x550500;};'use strict';var EventEmitter=require(_0xe741('0x0'));var MailQueue=require(_0xe741('0x1'))['db'][_0xe741('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe741('0x3')](0x0);var events={'afterCreate':_0xe741('0x4'),'afterUpdate':_0xe741('0x5'),'afterDestroy':_0xe741('0x6')};function emitEvent(_0x31d16e){return function(_0x51aa74,_0x557f5c,_0x2d9fab){MailQueueEvents['emit'](_0x31d16e+':'+_0x51aa74['id'],_0x51aa74);MailQueueEvents['emit'](_0x31d16e,_0x51aa74);_0x2d9fab(null);};}for(var e in events){if(events[_0xe741('0x7')](e)){var event=events[e];MailQueue[_0xe741('0x8')](e,emitEvent(event));}}module[_0xe741('0x9')]=MailQueueEvents; \ No newline at end of file +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 diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index d067caa..895cb61 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 _0x395e=['../../config/environment','./mailQueue.attributes','define','MailQueue','mail_queues','lodash','../../config/logger','bluebird','path','rimraf'];(function(_0x4d4c6c,_0x552965){var _0x5497c4=function(_0x2aefdf){while(--_0x2aefdf){_0x4d4c6c['push'](_0x4d4c6c['shift']());}};_0x5497c4(++_0x552965);}(_0x395e,0xcd));var _0xe395=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x395e[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xe395('0x0'));var util=require('util');var logger=require(_0xe395('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe395('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe395('0x3'));var rimraf=require(_0xe395('0x4'));var config=require(_0xe395('0x5'));var attributes=require(_0xe395('0x6'));module['exports']=function(_0x5522f8,_0x32f3a5){return _0x5522f8[_0xe395('0x7')](_0xe395('0x8'),attributes,{'tableName':_0xe395('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index 2419124..c2e9b1e 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 _0x93f1=['map','model','ShowMailQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailQueue','MailQueue','options','raw','where','attributes','limit','include'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x93f1,0x1b1));var _0x193f=function(_0x185354,_0x712a62){_0x185354=_0x185354-0x0;var _0x5ca60c=_0x93f1[_0x185354];return _0x5ca60c;};'use strict';var _=require(_0x193f('0x0'));var util=require(_0x193f('0x1'));var moment=require(_0x193f('0x2'));var BPromise=require(_0x193f('0x3'));var rs=require(_0x193f('0x4'));var fs=require('fs');var Redis=require(_0x193f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x193f('0x6'));var logger=require('../../config/logger')(_0x193f('0x7'));var config=require('../../config/environment');var jayson=require(_0x193f('0x8'));var client=jayson['client'][_0x193f('0x9')]({'port':0x232a});config[_0x193f('0xa')]=_[_0x193f('0xb')](config[_0x193f('0xa')],{'host':_0x193f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x193f('0xa')]));require(_0x193f('0xd'))[_0x193f('0xe')](socket);function respondWithRpcPromise(_0x251d74,_0x1960f8,_0x13dd1e){return new BPromise(function(_0x21d79c,_0x40c6ea){return client[_0x193f('0xf')](_0x251d74,_0x13dd1e)[_0x193f('0x10')](function(_0x2b92b6){logger[_0x193f('0x11')](_0x193f('0x12'),_0x1960f8,_0x193f('0x13'));logger[_0x193f('0x14')](_0x193f('0x15'),_0x1960f8,_0x193f('0x13'),JSON[_0x193f('0x16')](_0x2b92b6));if(_0x2b92b6[_0x193f('0x17')]){if(_0x2b92b6[_0x193f('0x17')]['code']===0x1f4){logger[_0x193f('0x17')](_0x193f('0x12'),_0x1960f8,_0x2b92b6['error'][_0x193f('0x18')]);return _0x40c6ea(_0x2b92b6[_0x193f('0x17')][_0x193f('0x18')]);}logger[_0x193f('0x17')](_0x193f('0x12'),_0x1960f8,_0x2b92b6[_0x193f('0x17')][_0x193f('0x18')]);return _0x21d79c(_0x2b92b6[_0x193f('0x17')][_0x193f('0x18')]);}else{logger[_0x193f('0x11')]('MailQueue,\x20%s,\x20%s',_0x1960f8,_0x193f('0x13'));_0x21d79c(_0x2b92b6[_0x193f('0x19')][_0x193f('0x18')]);}})[_0x193f('0x1a')](function(_0x478a40){logger[_0x193f('0x17')]('MailQueue,\x20%s,\x20%s',_0x1960f8,_0x478a40);_0x40c6ea(_0x478a40);});});}exports[_0x193f('0x1b')]=function(_0xc15c17){var _0x487e5c=this;return new Promise(function(_0x52f903,_0x4d6309){return db[_0x193f('0x1c')]['findAll']({'raw':_0xc15c17['options']?_0xc15c17[_0x193f('0x1d')][_0x193f('0x1e')]===undefined?!![]:![]:!![],'where':_0xc15c17[_0x193f('0x1d')]?_0xc15c17['options'][_0x193f('0x1f')]||null:null,'attributes':_0xc15c17['options']?_0xc15c17[_0x193f('0x1d')][_0x193f('0x20')]||null:null,'limit':_0xc15c17['options']?_0xc15c17['options'][_0x193f('0x21')]||null:null,'include':_0xc15c17[_0x193f('0x1d')]?_0xc15c17[_0x193f('0x1d')][_0x193f('0x22')]?_[_0x193f('0x23')](_0xc15c17['options'][_0x193f('0x22')],function(_0x546561){return{'model':db[_0x546561[_0x193f('0x24')]],'as':_0x546561['as'],'attributes':_0x546561[_0x193f('0x20')],'include':_0x546561[_0x193f('0x22')]?_['map'](_0x546561['include'],function(_0x42fdc1){return{'model':db[_0x42fdc1['model']],'as':_0x42fdc1['as'],'attributes':_0x42fdc1[_0x193f('0x20')],'include':_0x42fdc1['include']?_[_0x193f('0x23')](_0x42fdc1[_0x193f('0x22')],function(_0x5b9a0d){return{'model':db[_0x5b9a0d[_0x193f('0x24')]],'as':_0x5b9a0d['as'],'attributes':_0x5b9a0d[_0x193f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x193f('0x10')](function(_0x1d02bf){logger[_0x193f('0x11')](_0x193f('0x1b'),_0xc15c17);logger[_0x193f('0x14')](_0x193f('0x1b'),_0xc15c17,JSON[_0x193f('0x16')](_0x1d02bf));_0x52f903(_0x1d02bf);})['catch'](function(_0x3b677b){logger[_0x193f('0x17')](_0x193f('0x1b'),_0x3b677b[_0x193f('0x18')],_0xc15c17);_0x4d6309(_0x487e5c[_0x193f('0x17')](0x1f4,_0x3b677b[_0x193f('0x18')]));});});};exports[_0x193f('0x25')]=function(_0x535d29){var _0x20f7f4=this;return new Promise(function(_0x19b2b7,_0x46fbec){return db[_0x193f('0x1c')][_0x193f('0x26')]({'raw':_0x535d29[_0x193f('0x1d')]?_0x535d29[_0x193f('0x1d')][_0x193f('0x1e')]===undefined?!![]:![]:!![],'where':_0x535d29[_0x193f('0x1d')]?_0x535d29[_0x193f('0x1d')][_0x193f('0x1f')]||null:null,'attributes':_0x535d29[_0x193f('0x1d')]?_0x535d29[_0x193f('0x1d')][_0x193f('0x20')]||null:null,'include':_0x535d29[_0x193f('0x1d')]?_0x535d29[_0x193f('0x1d')]['include']?_[_0x193f('0x23')](_0x535d29[_0x193f('0x1d')]['include'],function(_0x52c585){return{'model':db[_0x52c585[_0x193f('0x24')]],'as':_0x52c585['as'],'attributes':_0x52c585[_0x193f('0x20')],'include':_0x52c585[_0x193f('0x22')]?_[_0x193f('0x23')](_0x52c585[_0x193f('0x22')],function(_0x3cfee3){return{'model':db[_0x3cfee3[_0x193f('0x24')]],'as':_0x3cfee3['as'],'attributes':_0x3cfee3[_0x193f('0x20')],'include':_0x3cfee3['include']?_[_0x193f('0x23')](_0x3cfee3[_0x193f('0x22')],function(_0x30b599){return{'model':db[_0x30b599[_0x193f('0x24')]],'as':_0x30b599['as'],'attributes':_0x30b599[_0x193f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x193f('0x10')](function(_0x3f7175){logger['info'](_0x193f('0x25'),_0x535d29);logger[_0x193f('0x14')](_0x193f('0x25'),_0x535d29,JSON[_0x193f('0x16')](_0x3f7175));_0x19b2b7(_0x3f7175);})['catch'](function(_0x77147e){logger[_0x193f('0x17')](_0x193f('0x25'),_0x77147e[_0x193f('0x18')],_0x535d29);_0x46fbec(_0x20f7f4['error'](0x1f4,_0x77147e[_0x193f('0x18')]));});});}; \ No newline at end of file +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 diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 5fc0791..5394381 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 _0xaa5e=['emit','removeListener','register','length','mailQueue:','./mailQueue.events','save','update'];(function(_0x16a2bb,_0x58d669){var _0x55ca6a=function(_0x5a44dc){while(--_0x5a44dc){_0x16a2bb['push'](_0x16a2bb['shift']());}};_0x55ca6a(++_0x58d669);}(_0xaa5e,0xa5));var _0xeaa5=function(_0x2fa7c6,_0x355539){_0x2fa7c6=_0x2fa7c6-0x0;var _0x3b4a57=_0xaa5e[_0x2fa7c6];return _0x3b4a57;};'use strict';var MailQueueEvents=require(_0xeaa5('0x0'));var events=[_0xeaa5('0x1'),'remove',_0xeaa5('0x2')];function createListener(_0x4f3a40,_0x15fc59){return function(_0x168bae){_0x15fc59[_0xeaa5('0x3')](_0x4f3a40,_0x168bae);};}function removeListener(_0x5a1aca,_0x2c111f){return function(){MailQueueEvents[_0xeaa5('0x4')](_0x5a1aca,_0x2c111f);};}exports[_0xeaa5('0x5')]=function(_0x382868){for(var _0x553f20=0x0,_0x4d405e=events[_0xeaa5('0x6')];_0x553f20<_0x4d405e;_0x553f20++){var _0x2c9696=events[_0x553f20];var _0x50cb62=createListener(_0xeaa5('0x7')+_0x2c9696,_0x382868);MailQueueEvents['on'](_0x2c9696,_0x50cb62);}}; \ No newline at end of file +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 diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 8b898cf..3a973ca 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 _0x7c5e=['./mailQueueReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0x7c5e,0x7f));var _0xe7c5=function(_0xae1981,_0x317a5f){_0xae1981=_0xae1981-0x0;var _0x3fd252=_0x7c5e[_0xae1981];return _0x3fd252;};'use strict';var multer=require('multer');var util=require(_0xe7c5('0x0'));var path=require(_0xe7c5('0x1'));var timeout=require(_0xe7c5('0x2'));var express=require(_0xe7c5('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe7c5('0x4'));var config=require(_0xe7c5('0x5'));var controller=require(_0xe7c5('0x6'));router[_0xe7c5('0x7')]('/',auth['isAuthenticated'](),controller[_0xe7c5('0x8')]);router[_0xe7c5('0x7')](_0xe7c5('0x9'),auth[_0xe7c5('0xa')](),controller['describe']);router['get'](_0xe7c5('0xb'),auth[_0xe7c5('0xa')](),controller[_0xe7c5('0xc')]);router[_0xe7c5('0xd')]('/',auth[_0xe7c5('0xa')](),controller[_0xe7c5('0xe')]);router[_0xe7c5('0xf')](_0xe7c5('0xb'),auth[_0xe7c5('0xa')](),controller[_0xe7c5('0x10')]);router['delete'](_0xe7c5('0xb'),auth[_0xe7c5('0xa')](),controller[_0xe7c5('0x11')]);module[_0xe7c5('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index f1eec35..f63a812 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 _0x2838=['DATE','moment','sequelize','exports','STRING'];(function(_0xe719ec,_0x5a280e){var _0x4842a1=function(_0x59b968){while(--_0x59b968){_0xe719ec['push'](_0xe719ec['shift']());}};_0x4842a1(++_0x5a280e);}(_0x2838,0x1af));var _0x8283=function(_0x30c7c5,_0x168208){_0x30c7c5=_0x30c7c5-0x0;var _0x29e24e=_0x2838[_0x30c7c5];return _0x29e24e;};'use strict';var moment=require(_0x8283('0x0'));var Sequelize=require(_0x8283('0x1'));module[_0x8283('0x2')]={'uniqueid':{'type':Sequelize[_0x8283('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8283('0x4')]},'leaveAt':{'type':Sequelize[_0x8283('0x4')]},'acceptAt':{'type':Sequelize[_0x8283('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x8283('0x3')]}}; \ No newline at end of file +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 diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index b21eb5e..85d1940 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 _0x77e6=['rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','create','catch','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','then','end','stack','name','send','index','map','MailQueueReport'];(function(_0x37a8c7,_0x5a8312){var _0x4ac543=function(_0x23dfe2){while(--_0x23dfe2){_0x37a8c7['push'](_0x37a8c7['shift']());}};_0x4ac543(++_0x5a8312);}(_0x77e6,0x1a6));var _0x677e=function(_0x138d8c,_0x4685ff){_0x138d8c=_0x138d8c-0x0;var _0x8533eb=_0x77e6[_0x138d8c];return _0x8533eb;};'use strict';var emlformat=require(_0x677e('0x0'));var rimraf=require(_0x677e('0x1'));var zipdir=require(_0x677e('0x2'));var jsonpatch=require(_0x677e('0x3'));var rp=require(_0x677e('0x4'));var moment=require(_0x677e('0x5'));var BPromise=require(_0x677e('0x6'));var Mustache=require(_0x677e('0x7'));var util=require('util');var path=require(_0x677e('0x8'));var sox=require(_0x677e('0x9'));var csv=require('to-csv');var ejs=require(_0x677e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x677e('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x677e('0xc'));var deskjs=require(_0x677e('0xd'));var toCsv=require(_0x677e('0xe'));var querystring=require(_0x677e('0xf'));var Papa=require('papaparse');var Redis=require(_0x677e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x677e('0x11'));var as=require(_0x677e('0x12'));var hardwareService=require(_0x677e('0x13'));var logger=require(_0x677e('0x14'))(_0x677e('0x15'));var utils=require(_0x677e('0x16'));var config=require(_0x677e('0x17'));var licenseUtil=require(_0x677e('0x18'));var db=require(_0x677e('0x19'))['db'];function respondWithStatusCode(_0x46a67e,_0x366490){_0x366490=_0x366490||0xcc;return function(_0x2a5f95){if(_0x2a5f95){return _0x46a67e[_0x677e('0x1a')](_0x366490);}return _0x46a67e[_0x677e('0x1b')](_0x366490)['end']();};}function respondWithResult(_0x512631,_0x5c7351){_0x5c7351=_0x5c7351||0xc8;return function(_0x213a50){if(_0x213a50){return _0x512631[_0x677e('0x1b')](_0x5c7351)[_0x677e('0x1c')](_0x213a50);}};}function respondWithFilteredResult(_0x36e976,_0x4daa04){return function(_0x42d0c3){if(_0x42d0c3){var _0x24c9eb=typeof _0x4daa04[_0x677e('0x1d')]===_0x677e('0x1e')&&typeof _0x4daa04[_0x677e('0x1f')]===_0x677e('0x1e');var _0xe4d960=_0x42d0c3['count'];var _0x1c5124=_0x24c9eb?0x0:_0x4daa04[_0x677e('0x1d')];var _0x385b06=_0x24c9eb?_0x42d0c3[_0x677e('0x20')]:_0x4daa04[_0x677e('0x1d')]+_0x4daa04[_0x677e('0x1f')];var _0x52f65d;if(_0x385b06>=_0xe4d960){_0x385b06=_0xe4d960;_0x52f65d=0xc8;}else{_0x52f65d=0xce;}_0x36e976[_0x677e('0x1b')](_0x52f65d);return _0x36e976['set'](_0x677e('0x21'),_0x1c5124+'-'+_0x385b06+'/'+_0xe4d960)[_0x677e('0x1c')](_0x42d0c3);}return null;};}function patchUpdates(_0x26e9c5){return function(_0x593aed){try{jsonpatch[_0x677e('0x22')](_0x593aed,_0x26e9c5,!![]);}catch(_0x1a6122){return BPromise[_0x677e('0x23')](_0x1a6122);}return _0x593aed[_0x677e('0x24')]();};}function saveUpdates(_0x295964,_0x8732e0){return function(_0x3a7895){if(_0x3a7895){return _0x3a7895['update'](_0x295964)['then'](function(_0x52d915){return _0x52d915;});}return null;};}function removeEntity(_0x357466,_0x154fce){return function(_0x31a1e4){if(_0x31a1e4){return _0x31a1e4[_0x677e('0x25')]()[_0x677e('0x26')](function(){_0x357466[_0x677e('0x1b')](0xcc)[_0x677e('0x27')]();});}};}function handleEntityNotFound(_0x42f2b8,_0x2c51d3){return function(_0x3f0646){if(!_0x3f0646){_0x42f2b8['sendStatus'](0x194);}return _0x3f0646;};}function handleError(_0x5f0ba2,_0x3d3370){_0x3d3370=_0x3d3370||0x1f4;return function(_0x184f68){logger['error'](_0x184f68[_0x677e('0x28')]);if(_0x184f68[_0x677e('0x29')]){delete _0x184f68[_0x677e('0x29')];}_0x5f0ba2[_0x677e('0x1b')](_0x3d3370)[_0x677e('0x2a')](_0x184f68);};}exports[_0x677e('0x2b')]=function(_0x56ad40,_0xcd4646){var _0x2a6033={},_0xeca8e2={},_0x1e2694={'count':0x0,'rows':[]};var _0x22e44c=_[_0x677e('0x2c')](db[_0x677e('0x2d')][_0x677e('0x2e')],function(_0x9d49b5){return{'name':_0x9d49b5['fieldName'],'type':_0x9d49b5[_0x677e('0x2f')][_0x677e('0x30')]};});_0xeca8e2[_0x677e('0x31')]=_[_0x677e('0x2c')](_0x22e44c,_0x677e('0x29'));_0xeca8e2[_0x677e('0x32')]=_[_0x677e('0x33')](_0x56ad40[_0x677e('0x32')]);_0xeca8e2[_0x677e('0x34')]=_[_0x677e('0x35')](_0xeca8e2['model'],_0xeca8e2[_0x677e('0x32')]);_0x2a6033[_0x677e('0x36')]=_[_0x677e('0x35')](_0xeca8e2[_0x677e('0x31')],qs[_0x677e('0x37')](_0x56ad40[_0x677e('0x32')]['fields']));_0x2a6033[_0x677e('0x36')]=_0x2a6033[_0x677e('0x36')][_0x677e('0x38')]?_0x2a6033['attributes']:_0xeca8e2[_0x677e('0x31')];if(!_0x56ad40[_0x677e('0x32')][_0x677e('0x39')](_0x677e('0x3a'))){_0x2a6033[_0x677e('0x1f')]=qs['limit'](_0x56ad40[_0x677e('0x32')][_0x677e('0x1f')]);_0x2a6033[_0x677e('0x1d')]=qs[_0x677e('0x1d')](_0x56ad40['query'][_0x677e('0x1d')]);}_0x2a6033[_0x677e('0x3b')]=qs[_0x677e('0x3c')](_0x56ad40['query']['sort']);_0x2a6033[_0x677e('0x3d')]=qs[_0x677e('0x34')](_['pick'](_0x56ad40[_0x677e('0x32')],_0xeca8e2[_0x677e('0x34')]),_0x22e44c);if(_0x56ad40['query']['filter']){_0x2a6033[_0x677e('0x3d')]=_[_0x677e('0x3e')](_0x2a6033['where'],{'$or':_['map'](_0x22e44c,function(_0x42ce2c){if(_0x42ce2c[_0x677e('0x2f')]!==_0x677e('0x3f')){var _0x5bb080={};_0x5bb080[_0x42ce2c[_0x677e('0x29')]]={'$like':'%'+_0x56ad40[_0x677e('0x32')][_0x677e('0x40')]+'%'};return _0x5bb080;}})});}_0x2a6033=_[_0x677e('0x3e')]({},_0x2a6033,_0x56ad40[_0x677e('0x41')]);var _0x4b34fa={'where':_0x2a6033['where']};return db[_0x677e('0x2d')][_0x677e('0x20')](_0x4b34fa)[_0x677e('0x26')](function(_0x1db5b4){_0x1e2694[_0x677e('0x20')]=_0x1db5b4;if(_0x56ad40[_0x677e('0x32')][_0x677e('0x42')]){_0x2a6033[_0x677e('0x43')]=[{'all':!![]}];}return db[_0x677e('0x2d')][_0x677e('0x44')](_0x2a6033);})['then'](function(_0x56eb30){_0x1e2694[_0x677e('0x45')]=_0x56eb30;return _0x1e2694;})[_0x677e('0x26')](respondWithFilteredResult(_0xcd4646,_0x2a6033))['catch'](handleError(_0xcd4646,null));};exports[_0x677e('0x46')]=function(_0x511125,_0x16362e){var _0x29b9c0={'raw':!![],'where':{'id':_0x511125[_0x677e('0x47')]['id']}},_0x283aaa={};_0x283aaa[_0x677e('0x31')]=_[_0x677e('0x33')](db['MailQueueReport'][_0x677e('0x2e')]);_0x283aaa[_0x677e('0x32')]=_[_0x677e('0x33')](_0x511125[_0x677e('0x32')]);_0x283aaa[_0x677e('0x34')]=_[_0x677e('0x35')](_0x283aaa['model'],_0x283aaa[_0x677e('0x32')]);_0x29b9c0['attributes']=_[_0x677e('0x35')](_0x283aaa[_0x677e('0x31')],qs[_0x677e('0x37')](_0x511125[_0x677e('0x32')][_0x677e('0x37')]));_0x29b9c0[_0x677e('0x36')]=_0x29b9c0[_0x677e('0x36')][_0x677e('0x38')]?_0x29b9c0[_0x677e('0x36')]:_0x283aaa[_0x677e('0x31')];if(_0x511125['query'][_0x677e('0x42')]){_0x29b9c0['include']=[{'all':!![]}];}_0x29b9c0=_['merge']({},_0x29b9c0,_0x511125[_0x677e('0x41')]);return db[_0x677e('0x2d')][_0x677e('0x48')](_0x29b9c0)[_0x677e('0x26')](handleEntityNotFound(_0x16362e,null))[_0x677e('0x26')](respondWithResult(_0x16362e,null))['catch'](handleError(_0x16362e,null));};exports[_0x677e('0x49')]=function(_0x136b77,_0x3cb653){return db[_0x677e('0x2d')][_0x677e('0x49')](_0x136b77['body'],{})[_0x677e('0x26')](respondWithResult(_0x3cb653,0xc9))[_0x677e('0x4a')](handleError(_0x3cb653,null));};exports[_0x677e('0x4b')]=function(_0x496627,_0x30ed5c){if(_0x496627['body']['id']){delete _0x496627[_0x677e('0x4c')]['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x496627[_0x677e('0x47')]['id']}})[_0x677e('0x26')](handleEntityNotFound(_0x30ed5c,null))[_0x677e('0x26')](saveUpdates(_0x496627[_0x677e('0x4c')],null))['then'](respondWithResult(_0x30ed5c,null))[_0x677e('0x4a')](handleError(_0x30ed5c,null));};exports[_0x677e('0x25')]=function(_0x51b2b8,_0x5e93e9){return db[_0x677e('0x2d')][_0x677e('0x48')]({'where':{'id':_0x51b2b8[_0x677e('0x47')]['id']}})[_0x677e('0x26')](handleEntityNotFound(_0x5e93e9,null))['then'](removeEntity(_0x5e93e9,null))[_0x677e('0x4a')](handleError(_0x5e93e9,null));};exports['describe']=function(_0x5404a1,_0x3bb4d8){return db['MailQueueReport'][_0x677e('0x4d')]()[_0x677e('0x26')](respondWithResult(_0x3bb4d8,null))[_0x677e('0x4a')](handleError(_0x3bb4d8,null));}; \ No newline at end of file +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 diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 76a7684..a626e2f 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 _0x9c26=['uniqueid','../../config/logger','moment','bluebird','rimraf','./mailQueueReport.attributes','define','report_mail_queue'];(function(_0x3858dd,_0x23afde){var _0x4a0ba5=function(_0x258547){while(--_0x258547){_0x3858dd['push'](_0x3858dd['shift']());}};_0x4a0ba5(++_0x23afde);}(_0x9c26,0x111));var _0x69c2=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x9c26[_0xae7c2f];return _0x5d7001;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x69c2('0x0'))('api');var moment=require(_0x69c2('0x1'));var BPromise=require(_0x69c2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x69c2('0x3'));var config=require('../../config/environment');var attributes=require(_0x69c2('0x4'));module['exports']=function(_0x428f42,_0x5bb3ff){return _0x428f42[_0x69c2('0x5')]('MailQueueReport',attributes,{'tableName':_0x69c2('0x6'),'paranoid':![],'indexes':[{'name':_0x69c2('0x7'),'fields':[_0x69c2('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 38d03c5..c4c8fd7 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x3512b2,_0x3ef1dd){var _0x34ce62=function(_0x4845f){while(--_0x4845f){_0x3512b2['push'](_0x3512b2['shift']());}};_0x34ce62(++_0x3ef1dd);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xc4aa[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 524452f..7fcbbca 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x5ab6a5,_0x4977b1){var _0x3cb85c=function(_0x585e95){while(--_0x585e95){_0x5ab6a5['push'](_0x5ab6a5['shift']());}};_0x3cb85c(++_0x4977b1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +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 diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c13cd8b..c738a0b 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 _0xc788=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xc788,0xc4));var _0x8c78=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0xc788[_0x2cacef];return _0x289ba6;};'use strict';var Sequelize=require(_0x8c78('0x0'));module[_0x8c78('0x1')]={'description':{'type':Sequelize[_0x8c78('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x8c78('0x2')]},'password':{'type':Sequelize[_0x8c78('0x2')]},'port':{'type':Sequelize[_0x8c78('0x3')]},'tls':{'type':Sequelize[_0x8c78('0x4')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x8c78('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x8c78('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x8c78('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x8c78('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d609712..9895b1d 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 _0xa888=['bluebird','path','../../config/environment','./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','moment'];(function(_0x39b06b,_0xb7b85a){var _0x3dcfb1=function(_0x4b1921){while(--_0x4b1921){_0x39b06b['push'](_0x39b06b['shift']());}};_0x3dcfb1(++_0xb7b85a);}(_0xa888,0x126));var _0x8a88=function(_0x361e29,_0x116f42){_0x361e29=_0x361e29-0x0;var _0x4fdddf=_0xa888[_0x361e29];return _0x4fdddf;};'use strict';var _=require(_0x8a88('0x0'));var util=require(_0x8a88('0x1'));var logger=require(_0x8a88('0x2'))(_0x8a88('0x3'));var moment=require(_0x8a88('0x4'));var BPromise=require(_0x8a88('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8a88('0x6'));var rimraf=require('rimraf');var config=require(_0x8a88('0x7'));var attributes=require(_0x8a88('0x8'));module[_0x8a88('0x9')]=function(_0x241d32,_0x75bade){return _0x241d32[_0x8a88('0xa')](_0x8a88('0xb'),attributes,{'tableName':_0x8a88('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 4a33203..0f9a896 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 _0x63bb=['../../config/environment','jayson/promise','client','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','where','limit','include','map','attributes','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x3083ea,_0x4408a1){var _0x3993ed=function(_0x37726a){while(--_0x37726a){_0x3083ea['push'](_0x3083ea['shift']());}};_0x3993ed(++_0x4408a1);}(_0x63bb,0xf8));var _0xb63b=function(_0x36a073,_0x2ce3ce){_0x36a073=_0x36a073-0x0;var _0xc9762b=_0x63bb[_0x36a073];return _0xc9762b;};'use strict';var _=require(_0xb63b('0x0'));var util=require(_0xb63b('0x1'));var moment=require(_0xb63b('0x2'));var BPromise=require(_0xb63b('0x3'));var rs=require(_0xb63b('0x4'));var fs=require('fs');var Redis=require(_0xb63b('0x5'));var db=require(_0xb63b('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb63b('0x7'));var config=require(_0xb63b('0x8'));var jayson=require(_0xb63b('0x9'));var client=jayson[_0xb63b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3eb1be,_0x2a27f9,_0x2aa873){return new BPromise(function(_0x544988,_0x366bda){return client[_0xb63b('0xb')](_0x3eb1be,_0x2aa873)['then'](function(_0x2d5002){logger[_0xb63b('0xc')](_0xb63b('0xd'),_0x2a27f9,_0xb63b('0xe'));logger[_0xb63b('0xf')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x2a27f9,_0xb63b('0xe'),JSON[_0xb63b('0x10')](_0x2d5002));if(_0x2d5002[_0xb63b('0x11')]){if(_0x2d5002['error']['code']===0x1f4){logger[_0xb63b('0x11')](_0xb63b('0xd'),_0x2a27f9,_0x2d5002[_0xb63b('0x11')][_0xb63b('0x12')]);return _0x366bda(_0x2d5002['error'][_0xb63b('0x12')]);}logger[_0xb63b('0x11')](_0xb63b('0xd'),_0x2a27f9,_0x2d5002[_0xb63b('0x11')][_0xb63b('0x12')]);return _0x544988(_0x2d5002[_0xb63b('0x11')][_0xb63b('0x12')]);}else{logger['info'](_0xb63b('0xd'),_0x2a27f9,'request\x20sent');_0x544988(_0x2d5002[_0xb63b('0x13')][_0xb63b('0x12')]);}})[_0xb63b('0x14')](function(_0x41bfc4){logger[_0xb63b('0x11')]('MailServerIn,\x20%s,\x20%s',_0x2a27f9,_0x41bfc4);_0x366bda(_0x41bfc4);});});}exports[_0xb63b('0x15')]=function(_0x322426){var _0x53ce69=this;return new Promise(function(_0x55f315,_0x4bc7c0){return db[_0xb63b('0x16')][_0xb63b('0x17')]({'raw':_0x322426[_0xb63b('0x18')]?_0x322426[_0xb63b('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x322426[_0xb63b('0x18')]?_0x322426[_0xb63b('0x18')][_0xb63b('0x19')]||null:null,'attributes':_0x322426[_0xb63b('0x18')]?_0x322426['options']['attributes']||null:null,'limit':_0x322426[_0xb63b('0x18')]?_0x322426['options'][_0xb63b('0x1a')]||null:null,'include':_0x322426[_0xb63b('0x18')]?_0x322426[_0xb63b('0x18')][_0xb63b('0x1b')]?_[_0xb63b('0x1c')](_0x322426[_0xb63b('0x18')][_0xb63b('0x1b')],function(_0x33ee73){return{'model':db[_0x33ee73['model']],'as':_0x33ee73['as'],'attributes':_0x33ee73[_0xb63b('0x1d')],'include':_0x33ee73['include']?_['map'](_0x33ee73['include'],function(_0x89c2ed){return{'model':db[_0x89c2ed[_0xb63b('0x1e')]],'as':_0x89c2ed['as'],'attributes':_0x89c2ed['attributes'],'include':_0x89c2ed[_0xb63b('0x1b')]?_['map'](_0x89c2ed['include'],function(_0x512053){return{'model':db[_0x512053['model']],'as':_0x512053['as'],'attributes':_0x512053['attributes']};}):[]};}):[]};}):[]:[]})[_0xb63b('0x1f')](function(_0x1506db){logger[_0xb63b('0xc')](_0xb63b('0x15'),_0x322426);logger[_0xb63b('0xf')]('GetMailServerIn',_0x322426,JSON[_0xb63b('0x10')](_0x1506db));_0x55f315(_0x1506db);})[_0xb63b('0x14')](function(_0x4ddcf0){logger[_0xb63b('0x11')](_0xb63b('0x15'),_0x4ddcf0[_0xb63b('0x12')],_0x322426);_0x4bc7c0(_0x53ce69[_0xb63b('0x11')](0x1f4,_0x4ddcf0[_0xb63b('0x12')]));});});}; \ No newline at end of file +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 diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index cb25de4..d864507 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 438e058..dc8b9d9 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 _0xa217=['STRING','INTEGER','sequelize'];(function(_0x1a4089,_0x4428c5){var _0x328570=function(_0x5061d0){while(--_0x5061d0){_0x1a4089['push'](_0x1a4089['shift']());}};_0x328570(++_0x4428c5);}(_0xa217,0xc5));var _0x7a21=function(_0x1dfe96,_0xacd7bf){_0x1dfe96=_0x1dfe96-0x0;var _0x23bb8a=_0xa217[_0x1dfe96];return _0x23bb8a;};'use strict';var Sequelize=require(_0x7a21('0x0'));module['exports']={'description':{'type':Sequelize[_0x7a21('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x7a21('0x1')]},'pass':{'type':Sequelize[_0x7a21('0x1')]},'port':{'type':Sequelize[_0x7a21('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x7a21('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +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 diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index bb18611..f91d8cf 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 _0xc42a=['includeAll','include','findAll','rows','catch','show','params','body','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','MailServerOut'];(function(_0x3dfb90,_0x13a3f7){var _0x59f5d5=function(_0x555a31){while(--_0x555a31){_0x3dfb90['push'](_0x3dfb90['shift']());}};_0x59f5d5(++_0x13a3f7);}(_0xc42a,0xa3));var _0xac42=function(_0x596f53,_0x769795){_0x596f53=_0x596f53-0x0;var _0x1d9466=_0xc42a[_0x596f53];return _0x1d9466;};'use strict';var emlformat=require(_0xac42('0x0'));var rimraf=require(_0xac42('0x1'));var zipdir=require(_0xac42('0x2'));var jsonpatch=require(_0xac42('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xac42('0x4'));var util=require(_0xac42('0x5'));var path=require(_0xac42('0x6'));var sox=require(_0xac42('0x7'));var csv=require('to-csv');var ejs=require(_0xac42('0x8'));var fs=require('fs');var fs_extra=require(_0xac42('0x9'));var _=require(_0xac42('0xa'));var squel=require(_0xac42('0xb'));var crypto=require(_0xac42('0xc'));var jsforce=require(_0xac42('0xd'));var deskjs=require(_0xac42('0xe'));var toCsv=require(_0xac42('0xf'));var querystring=require('querystring');var Papa=require(_0xac42('0x10'));var Redis=require(_0xac42('0x11'));var authService=require(_0xac42('0x12'));var qs=require(_0xac42('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac42('0x14'));var logger=require(_0xac42('0x15'))('api');var utils=require(_0xac42('0x16'));var config=require(_0xac42('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xac42('0x18'))['db'];function respondWithStatusCode(_0x13a420,_0x53df8d){_0x53df8d=_0x53df8d||0xcc;return function(_0x3e430f){if(_0x3e430f){return _0x13a420[_0xac42('0x19')](_0x53df8d);}return _0x13a420[_0xac42('0x1a')](_0x53df8d)[_0xac42('0x1b')]();};}function respondWithResult(_0x2c482e,_0x596173){_0x596173=_0x596173||0xc8;return function(_0x3833d8){if(_0x3833d8){return _0x2c482e[_0xac42('0x1a')](_0x596173)[_0xac42('0x1c')](_0x3833d8);}};}function respondWithFilteredResult(_0x23d955,_0xb634d0){return function(_0x15f6a2){if(_0x15f6a2){var _0x438acc=typeof _0xb634d0[_0xac42('0x1d')]===_0xac42('0x1e')&&typeof _0xb634d0['limit']==='undefined';var _0x4316fc=_0x15f6a2[_0xac42('0x1f')];var _0x2cccfd=_0x438acc?0x0:_0xb634d0[_0xac42('0x1d')];var _0x23eceb=_0x438acc?_0x15f6a2[_0xac42('0x1f')]:_0xb634d0[_0xac42('0x1d')]+_0xb634d0[_0xac42('0x20')];var _0x10ea26;if(_0x23eceb>=_0x4316fc){_0x23eceb=_0x4316fc;_0x10ea26=0xc8;}else{_0x10ea26=0xce;}_0x23d955[_0xac42('0x1a')](_0x10ea26);return _0x23d955[_0xac42('0x21')](_0xac42('0x22'),_0x2cccfd+'-'+_0x23eceb+'/'+_0x4316fc)[_0xac42('0x1c')](_0x15f6a2);}return null;};}function patchUpdates(_0x6b1224){return function(_0x37e990){try{jsonpatch[_0xac42('0x23')](_0x37e990,_0x6b1224,!![]);}catch(_0x393acc){return BPromise[_0xac42('0x24')](_0x393acc);}return _0x37e990[_0xac42('0x25')]();};}function saveUpdates(_0x357c32,_0x3d60da){return function(_0x539b18){if(_0x539b18){return _0x539b18[_0xac42('0x26')](_0x357c32)[_0xac42('0x27')](function(_0x166ced){return _0x166ced;});}return null;};}function removeEntity(_0x2ef631,_0x3ce9ec){return function(_0x6cbcd6){if(_0x6cbcd6){return _0x6cbcd6[_0xac42('0x28')]()['then'](function(){_0x2ef631[_0xac42('0x1a')](0xcc)[_0xac42('0x1b')]();});}};}function handleEntityNotFound(_0x491adc,_0x134e36){return function(_0x96571){if(!_0x96571){_0x491adc[_0xac42('0x19')](0x194);}return _0x96571;};}function handleError(_0xa31f11,_0x9945e0){_0x9945e0=_0x9945e0||0x1f4;return function(_0x4a46b0){logger['error'](_0x4a46b0[_0xac42('0x29')]);if(_0x4a46b0[_0xac42('0x2a')]){delete _0x4a46b0[_0xac42('0x2a')];}_0xa31f11[_0xac42('0x1a')](_0x9945e0)[_0xac42('0x2b')](_0x4a46b0);};}exports[_0xac42('0x2c')]=function(_0x254baa,_0x21e329){var _0x414c19={},_0x118f1c={},_0x1eaff3={'count':0x0,'rows':[]};var _0x1d87c5=_[_0xac42('0x2d')](db['MailServerOut'][_0xac42('0x2e')],function(_0x5194b7){return{'name':_0x5194b7[_0xac42('0x2f')],'type':_0x5194b7[_0xac42('0x30')][_0xac42('0x31')]};});_0x118f1c['model']=_[_0xac42('0x2d')](_0x1d87c5,_0xac42('0x2a'));_0x118f1c[_0xac42('0x32')]=_[_0xac42('0x33')](_0x254baa[_0xac42('0x32')]);_0x118f1c['filters']=_[_0xac42('0x34')](_0x118f1c[_0xac42('0x35')],_0x118f1c[_0xac42('0x32')]);_0x414c19[_0xac42('0x36')]=_['intersection'](_0x118f1c['model'],qs[_0xac42('0x37')](_0x254baa[_0xac42('0x32')][_0xac42('0x37')]));_0x414c19[_0xac42('0x36')]=_0x414c19[_0xac42('0x36')][_0xac42('0x38')]?_0x414c19[_0xac42('0x36')]:_0x118f1c[_0xac42('0x35')];if(!_0x254baa[_0xac42('0x32')]['hasOwnProperty'](_0xac42('0x39'))){_0x414c19[_0xac42('0x20')]=qs[_0xac42('0x20')](_0x254baa[_0xac42('0x32')][_0xac42('0x20')]);_0x414c19[_0xac42('0x1d')]=qs[_0xac42('0x1d')](_0x254baa[_0xac42('0x32')][_0xac42('0x1d')]);}_0x414c19[_0xac42('0x3a')]=qs[_0xac42('0x3b')](_0x254baa['query']['sort']);_0x414c19[_0xac42('0x3c')]=qs[_0xac42('0x3d')](_[_0xac42('0x3e')](_0x254baa[_0xac42('0x32')],_0x118f1c[_0xac42('0x3d')]),_0x1d87c5);if(_0x254baa[_0xac42('0x32')][_0xac42('0x3f')]){_0x414c19[_0xac42('0x3c')]=_['merge'](_0x414c19['where'],{'$or':_['map'](_0x1d87c5,function(_0x5c5b8a){if(_0x5c5b8a[_0xac42('0x30')]!==_0xac42('0x40')){var _0x331a14={};_0x331a14[_0x5c5b8a[_0xac42('0x2a')]]={'$like':'%'+_0x254baa[_0xac42('0x32')][_0xac42('0x3f')]+'%'};return _0x331a14;}})});}_0x414c19=_[_0xac42('0x41')]({},_0x414c19,_0x254baa[_0xac42('0x42')]);var _0x1851b4={'where':_0x414c19[_0xac42('0x3c')]};return db[_0xac42('0x43')][_0xac42('0x1f')](_0x1851b4)[_0xac42('0x27')](function(_0x344675){_0x1eaff3[_0xac42('0x1f')]=_0x344675;if(_0x254baa[_0xac42('0x32')][_0xac42('0x44')]){_0x414c19[_0xac42('0x45')]=[{'all':!![]}];}return db[_0xac42('0x43')][_0xac42('0x46')](_0x414c19);})[_0xac42('0x27')](function(_0x429be7){_0x1eaff3[_0xac42('0x47')]=_0x429be7;return _0x1eaff3;})['then'](respondWithFilteredResult(_0x21e329,_0x414c19))[_0xac42('0x48')](handleError(_0x21e329,null));};exports[_0xac42('0x49')]=function(_0x22aa03,_0x588e5c){var _0x25aa9e={'raw':!![],'where':{'id':_0x22aa03[_0xac42('0x4a')]['id']}},_0x50df5e={};_0x50df5e['model']=_[_0xac42('0x33')](db[_0xac42('0x43')]['rawAttributes']);_0x50df5e[_0xac42('0x32')]=_['keys'](_0x22aa03[_0xac42('0x32')]);_0x50df5e[_0xac42('0x3d')]=_[_0xac42('0x34')](_0x50df5e[_0xac42('0x35')],_0x50df5e[_0xac42('0x32')]);_0x25aa9e[_0xac42('0x36')]=_[_0xac42('0x34')](_0x50df5e['model'],qs['fields'](_0x22aa03['query']['fields']));_0x25aa9e['attributes']=_0x25aa9e[_0xac42('0x36')][_0xac42('0x38')]?_0x25aa9e['attributes']:_0x50df5e[_0xac42('0x35')];if(_0x22aa03[_0xac42('0x32')]['includeAll']){_0x25aa9e[_0xac42('0x45')]=[{'all':!![]}];}_0x25aa9e=_[_0xac42('0x41')]({},_0x25aa9e,_0x22aa03[_0xac42('0x42')]);return db[_0xac42('0x43')]['find'](_0x25aa9e)['then'](handleEntityNotFound(_0x588e5c,null))[_0xac42('0x27')](respondWithResult(_0x588e5c,null))[_0xac42('0x48')](handleError(_0x588e5c,null));};exports['create']=function(_0x22b39d,_0x35c75d){return db[_0xac42('0x43')]['create'](_0x22b39d['body'],{})['then'](respondWithResult(_0x35c75d,0xc9))[_0xac42('0x48')](handleError(_0x35c75d,null));};exports[_0xac42('0x26')]=function(_0x195f9e,_0x123d36){if(_0x195f9e['body']['id']){delete _0x195f9e[_0xac42('0x4b')]['id'];}return db[_0xac42('0x43')][_0xac42('0x4c')]({'where':{'id':_0x195f9e[_0xac42('0x4a')]['id']}})[_0xac42('0x27')](handleEntityNotFound(_0x123d36,null))['then'](saveUpdates(_0x195f9e['body'],null))[_0xac42('0x27')](respondWithResult(_0x123d36,null))[_0xac42('0x48')](handleError(_0x123d36,null));};exports['destroy']=function(_0x3b22f5,_0x2d230f){return db[_0xac42('0x43')][_0xac42('0x4c')]({'where':{'id':_0x3b22f5[_0xac42('0x4a')]['id']}})[_0xac42('0x27')](handleEntityNotFound(_0x2d230f,null))[_0xac42('0x27')](removeEntity(_0x2d230f,null))['catch'](handleError(_0x2d230f,null));}; \ No newline at end of file +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 diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 15b9aca..359abd3 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 _0x6431=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','api'];(function(_0x1f7b53,_0x11245b){var _0x1d252d=function(_0x36055d){while(--_0x36055d){_0x1f7b53['push'](_0x1f7b53['shift']());}};_0x1d252d(++_0x11245b);}(_0x6431,0xd9));var _0x1643=function(_0x888a02,_0x5df389){_0x888a02=_0x888a02-0x0;var _0xedd786=_0x6431[_0x888a02];return _0xedd786;};'use strict';var _=require(_0x1643('0x0'));var util=require(_0x1643('0x1'));var logger=require(_0x1643('0x2'))(_0x1643('0x3'));var moment=require(_0x1643('0x4'));var BPromise=require(_0x1643('0x5'));var rp=require(_0x1643('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1643('0x7'));var config=require(_0x1643('0x8'));var attributes=require('./mailServerOut.attributes');module[_0x1643('0x9')]=function(_0x1140c0,_0x2341c4){return _0x1140c0[_0x1643('0xa')](_0x1643('0xb'),attributes,{'tableName':_0x1643('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index c316f3d..e1ab957 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailServerOut,\x20%s,\x20%s','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x5c365f,_0x3b40ed){var _0x295e1b=function(_0x226683){while(--_0x226683){_0x5c365f['push'](_0x5c365f['shift']());}};_0x295e1b(++_0x3b40ed);}(_0x2ef3,0xba));var _0x32ef=function(_0x22abb4,_0x2f724c){_0x22abb4=_0x22abb4-0x0;var _0x4b0d70=_0x2ef3[_0x22abb4];return _0x4b0d70;};'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')]('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailServerOut,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file +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 diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 3b33a12..97e580c 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 _0x90d4=['/:id','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe'];(function(_0x680b65,_0x5b2e9c){var _0x1c2053=function(_0x1128e0){while(--_0x1128e0){_0x680b65['push'](_0x680b65['shift']());}};_0x1c2053(++_0x5b2e9c);}(_0x90d4,0x86));var _0x490d=function(_0x325034,_0x65e4b3){_0x325034=_0x325034-0x0;var _0x30b09e=_0x90d4[_0x325034];return _0x30b09e;};'use strict';var multer=require(_0x490d('0x0'));var util=require('util');var path=require(_0x490d('0x1'));var timeout=require(_0x490d('0x2'));var express=require(_0x490d('0x3'));var router=express[_0x490d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x490d('0x5'));var interaction=require(_0x490d('0x6'));var config=require(_0x490d('0x7'));var controller=require(_0x490d('0x8'));router[_0x490d('0x9')]('/',auth[_0x490d('0xa')](),controller['index']);router[_0x490d('0x9')](_0x490d('0xb'),auth[_0x490d('0xa')](),controller[_0x490d('0xc')]);router[_0x490d('0x9')](_0x490d('0xd'),auth['isAuthenticated'](),controller[_0x490d('0xe')]);router[_0x490d('0xf')]('/',auth[_0x490d('0xa')](),controller[_0x490d('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x490d('0x11')]);router[_0x490d('0x12')](_0x490d('0xd'),auth['isAuthenticated'](),controller[_0x490d('0x13')]);module[_0x490d('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index e770edb..ac682b3 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 _0xafb9=['sequelize','exports','STRING','name'];(function(_0x12a00a,_0x25e776){var _0x17c4dd=function(_0x3b9737){while(--_0x3b9737){_0x12a00a['push'](_0x12a00a['shift']());}};_0x17c4dd(++_0x25e776);}(_0xafb9,0x68));var _0x9afb=function(_0x3af3b1,_0x1b573f){_0x3af3b1=_0x3af3b1-0x0;var _0x215a58=_0xafb9[_0x3af3b1];return _0x215a58;};'use strict';var Sequelize=require(_0x9afb('0x0'));module[_0x9afb('0x1')]={'name':{'type':Sequelize[_0x9afb('0x2')],'unique':_0x9afb('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9afb('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index b10198e..70dfe25 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 _0x991e=['status','json','undefined','limit','count','offset','apply','reject','save','update','destroy','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end'];(function(_0x1e9c55,_0x235c76){var _0x4ceb46=function(_0x5aae80){while(--_0x5aae80){_0x1e9c55['push'](_0x1e9c55['shift']());}};_0x4ceb46(++_0x235c76);}(_0x991e,0x7b));var _0xe991=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x991e[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe991('0x0'));var zipdir=require(_0xe991('0x1'));var jsonpatch=require(_0xe991('0x2'));var rp=require(_0xe991('0x3'));var moment=require(_0xe991('0x4'));var BPromise=require(_0xe991('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe991('0x6'));var sox=require(_0xe991('0x7'));var csv=require('to-csv');var ejs=require(_0xe991('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe991('0x9'));var squel=require(_0xe991('0xa'));var crypto=require(_0xe991('0xb'));var jsforce=require(_0xe991('0xc'));var deskjs=require(_0xe991('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe991('0xe'));var Papa=require(_0xe991('0xf'));var Redis=require(_0xe991('0x10'));var authService=require(_0xe991('0x11'));var qs=require(_0xe991('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe991('0x13'));var logger=require(_0xe991('0x14'))(_0xe991('0x15'));var utils=require(_0xe991('0x16'));var config=require(_0xe991('0x17'));var licenseUtil=require(_0xe991('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b2eae,_0x460b79){_0x460b79=_0x460b79||0xcc;return function(_0x49f658){if(_0x49f658){return _0x5b2eae[_0xe991('0x19')](_0x460b79);}return _0x5b2eae['status'](_0x460b79)[_0xe991('0x1a')]();};}function respondWithResult(_0x86c1be,_0x24539b){_0x24539b=_0x24539b||0xc8;return function(_0x59b52f){if(_0x59b52f){return _0x86c1be[_0xe991('0x1b')](_0x24539b)[_0xe991('0x1c')](_0x59b52f);}};}function respondWithFilteredResult(_0x224e5d,_0x460b28){return function(_0x3b63e2){if(_0x3b63e2){var _0x5c2ad6=typeof _0x460b28['offset']===_0xe991('0x1d')&&typeof _0x460b28[_0xe991('0x1e')]==='undefined';var _0x2a3a2e=_0x3b63e2[_0xe991('0x1f')];var _0x539600=_0x5c2ad6?0x0:_0x460b28['offset'];var _0x41c05e=_0x5c2ad6?_0x3b63e2[_0xe991('0x1f')]:_0x460b28[_0xe991('0x20')]+_0x460b28[_0xe991('0x1e')];var _0x4ef24a;if(_0x41c05e>=_0x2a3a2e){_0x41c05e=_0x2a3a2e;_0x4ef24a=0xc8;}else{_0x4ef24a=0xce;}_0x224e5d[_0xe991('0x1b')](_0x4ef24a);return _0x224e5d['set']('Content-Range',_0x539600+'-'+_0x41c05e+'/'+_0x2a3a2e)[_0xe991('0x1c')](_0x3b63e2);}return null;};}function patchUpdates(_0x423fd6){return function(_0x17f8ce){try{jsonpatch[_0xe991('0x21')](_0x17f8ce,_0x423fd6,!![]);}catch(_0x540d62){return BPromise[_0xe991('0x22')](_0x540d62);}return _0x17f8ce[_0xe991('0x23')]();};}function saveUpdates(_0x50c703,_0x5293d1){return function(_0xb143a0){if(_0xb143a0){return _0xb143a0[_0xe991('0x24')](_0x50c703)['then'](function(_0x1800c8){return _0x1800c8;});}return null;};}function removeEntity(_0x2b21f6,_0x3b7b7c){return function(_0x180f0c){if(_0x180f0c){return _0x180f0c[_0xe991('0x25')]()['then'](function(){_0x2b21f6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x24b242,_0x426585){return function(_0x2620bb){if(!_0x2620bb){_0x24b242[_0xe991('0x19')](0x194);}return _0x2620bb;};}function handleError(_0x264cb8,_0x49a264){_0x49a264=_0x49a264||0x1f4;return function(_0x1c60ce){logger[_0xe991('0x26')](_0x1c60ce[_0xe991('0x27')]);if(_0x1c60ce[_0xe991('0x28')]){delete _0x1c60ce['name'];}_0x264cb8['status'](_0x49a264)['send'](_0x1c60ce);};}exports[_0xe991('0x29')]=function(_0xd79e67,_0x44bfad){var _0x3f8526={},_0x28f49e={},_0x348ca6={'count':0x0,'rows':[]};var _0x40ce1b=_[_0xe991('0x2a')](db[_0xe991('0x2b')][_0xe991('0x2c')],function(_0x216327){return{'name':_0x216327[_0xe991('0x2d')],'type':_0x216327[_0xe991('0x2e')][_0xe991('0x2f')]};});_0x28f49e['model']=_[_0xe991('0x2a')](_0x40ce1b,_0xe991('0x28'));_0x28f49e['query']=_[_0xe991('0x30')](_0xd79e67[_0xe991('0x31')]);_0x28f49e[_0xe991('0x32')]=_[_0xe991('0x33')](_0x28f49e[_0xe991('0x34')],_0x28f49e[_0xe991('0x31')]);_0x3f8526[_0xe991('0x35')]=_[_0xe991('0x33')](_0x28f49e[_0xe991('0x34')],qs[_0xe991('0x36')](_0xd79e67['query'][_0xe991('0x36')]));_0x3f8526['attributes']=_0x3f8526[_0xe991('0x35')][_0xe991('0x37')]?_0x3f8526[_0xe991('0x35')]:_0x28f49e['model'];if(!_0xd79e67[_0xe991('0x31')][_0xe991('0x38')]('nolimit')){_0x3f8526[_0xe991('0x1e')]=qs['limit'](_0xd79e67[_0xe991('0x31')][_0xe991('0x1e')]);_0x3f8526['offset']=qs[_0xe991('0x20')](_0xd79e67['query'][_0xe991('0x20')]);}_0x3f8526[_0xe991('0x39')]=qs[_0xe991('0x3a')](_0xd79e67[_0xe991('0x31')]['sort']);_0x3f8526[_0xe991('0x3b')]=qs[_0xe991('0x32')](_[_0xe991('0x3c')](_0xd79e67['query'],_0x28f49e[_0xe991('0x32')]),_0x40ce1b);if(_0xd79e67[_0xe991('0x31')][_0xe991('0x3d')]){_0x3f8526[_0xe991('0x3b')]=_[_0xe991('0x3e')](_0x3f8526[_0xe991('0x3b')],{'$or':_[_0xe991('0x2a')](_0x40ce1b,function(_0x12cc9e){if(_0x12cc9e['type']!==_0xe991('0x3f')){var _0x5ce3aa={};_0x5ce3aa[_0x12cc9e['name']]={'$like':'%'+_0xd79e67[_0xe991('0x31')][_0xe991('0x3d')]+'%'};return _0x5ce3aa;}})});}_0x3f8526=_[_0xe991('0x3e')]({},_0x3f8526,_0xd79e67[_0xe991('0x40')]);var _0x55f6b3={'where':_0x3f8526['where']};return db[_0xe991('0x2b')][_0xe991('0x1f')](_0x55f6b3)[_0xe991('0x41')](function(_0x35214b){_0x348ca6[_0xe991('0x1f')]=_0x35214b;if(_0xd79e67[_0xe991('0x31')][_0xe991('0x42')]){_0x3f8526[_0xe991('0x43')]=[{'all':!![]}];}return db[_0xe991('0x2b')]['findAll'](_0x3f8526);})[_0xe991('0x41')](function(_0x3ce744){_0x348ca6[_0xe991('0x44')]=_0x3ce744;return _0x348ca6;})[_0xe991('0x41')](respondWithFilteredResult(_0x44bfad,_0x3f8526))[_0xe991('0x45')](handleError(_0x44bfad,null));};exports['show']=function(_0x34babb,_0x43fe61){var _0x2fb4bd={'raw':!![],'where':{'id':_0x34babb[_0xe991('0x46')]['id']}},_0x44ef06={};_0x44ef06[_0xe991('0x34')]=_[_0xe991('0x30')](db[_0xe991('0x2b')][_0xe991('0x2c')]);_0x44ef06[_0xe991('0x31')]=_[_0xe991('0x30')](_0x34babb[_0xe991('0x31')]);_0x44ef06[_0xe991('0x32')]=_[_0xe991('0x33')](_0x44ef06['model'],_0x44ef06[_0xe991('0x31')]);_0x2fb4bd[_0xe991('0x35')]=_['intersection'](_0x44ef06[_0xe991('0x34')],qs['fields'](_0x34babb[_0xe991('0x31')][_0xe991('0x36')]));_0x2fb4bd['attributes']=_0x2fb4bd['attributes'][_0xe991('0x37')]?_0x2fb4bd[_0xe991('0x35')]:_0x44ef06['model'];if(_0x34babb[_0xe991('0x31')]['includeAll']){_0x2fb4bd[_0xe991('0x43')]=[{'all':!![]}];}_0x2fb4bd=_['merge']({},_0x2fb4bd,_0x34babb[_0xe991('0x40')]);return db[_0xe991('0x2b')][_0xe991('0x47')](_0x2fb4bd)['then'](handleEntityNotFound(_0x43fe61,null))[_0xe991('0x41')](respondWithResult(_0x43fe61,null))[_0xe991('0x45')](handleError(_0x43fe61,null));};exports[_0xe991('0x48')]=function(_0x11699a,_0xec21ea){return db[_0xe991('0x2b')][_0xe991('0x48')](_0x11699a[_0xe991('0x49')],{})[_0xe991('0x41')](respondWithResult(_0xec21ea,0xc9))[_0xe991('0x45')](handleError(_0xec21ea,null));};exports[_0xe991('0x24')]=function(_0x2acb02,_0x5e74dc){if(_0x2acb02[_0xe991('0x49')]['id']){delete _0x2acb02[_0xe991('0x49')]['id'];}return db[_0xe991('0x2b')][_0xe991('0x47')]({'where':{'id':_0x2acb02[_0xe991('0x46')]['id']}})[_0xe991('0x41')](handleEntityNotFound(_0x5e74dc,null))[_0xe991('0x41')](saveUpdates(_0x2acb02['body'],null))[_0xe991('0x41')](respondWithResult(_0x5e74dc,null))['catch'](handleError(_0x5e74dc,null));};exports[_0xe991('0x25')]=function(_0x56df3b,_0x4814bf){return db[_0xe991('0x2b')][_0xe991('0x47')]({'where':{'id':_0x56df3b['params']['id']}})['then'](handleEntityNotFound(_0x4814bf,null))[_0xe991('0x41')](removeEntity(_0x4814bf,null))[_0xe991('0x45')](handleError(_0x4814bf,null));};exports[_0xe991('0x4a')]=function(_0x4c9893,_0x6126af){return db[_0xe991('0x2b')][_0xe991('0x4a')]()[_0xe991('0x41')](respondWithResult(_0x6126af,null))[_0xe991('0x45')](handleError(_0x6126af,null));}; \ No newline at end of file +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 diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 02da8b4..1ac93d2 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 _0x6e47=['events','../../mysqldb','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x1c6ef2,_0x8d926a){var _0x404b8c=function(_0x4fdf1e){while(--_0x4fdf1e){_0x1c6ef2['push'](_0x1c6ef2['shift']());}};_0x404b8c(++_0x8d926a);}(_0x6e47,0x13b));var _0x76e4=function(_0x18ddc3,_0x3c44c8){_0x18ddc3=_0x18ddc3-0x0;var _0x477de9=_0x6e47[_0x18ddc3];return _0x477de9;};'use strict';var EventEmitter=require(_0x76e4('0x0'));var MailSubstatus=require(_0x76e4('0x1'))['db'][_0x76e4('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x76e4('0x3')](0x0);var events={'afterUpdate':_0x76e4('0x4')};function emitEvent(_0x1e2516){return function(_0x4bc87b,_0x23f649,_0x8f4c7a){MailSubstatusEvents[_0x76e4('0x5')](_0x1e2516+':'+_0x4bc87b['id'],_0x4bc87b);MailSubstatusEvents[_0x76e4('0x5')](_0x1e2516,_0x4bc87b);_0x8f4c7a(null);};}for(var e in events){if(events[_0x76e4('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +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 diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index d8609b1..7dd4472 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 _0x9619=['models','define','MailSubstatus','name','_previousDataValues','catch','./mailSubstatus.attributes','exports'];(function(_0x2082ea,_0x68ec33){var _0x3cd444=function(_0x4752b8){while(--_0x4752b8){_0x2082ea['push'](_0x2082ea['shift']());}};_0x3cd444(++_0x68ec33);}(_0x9619,0x6e));var _0x9961=function(_0x5d5eab,_0x40e104){_0x5d5eab=_0x5d5eab-0x0;var _0x5133c7=_0x9619[_0x5d5eab];return _0x5133c7;};'use strict';var attributes=require(_0x9961('0x0'));module[_0x9961('0x1')]=function(_0x240bde){var _0x53f5f9=_0x240bde[_0x9961('0x2')];return _0x240bde[_0x9961('0x3')](_0x9961('0x4'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x3d1bee,_0x52b3b8,_0x555247){return _0x53f5f9['Condition']['update']({'value':_0x3d1bee[_0x9961('0x5')]},{'where':{'field':'mailSubstatus','value':_0x3d1bee[_0x9961('0x6')][_0x9961('0x5')]}})['then'](function(){_0x555247();})[_0x9961('0x7')](function(_0x5b9935){_0x555247(_0x5b9935);});}}});}; \ No newline at end of file +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 diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index c3b31fc..9d9b39f 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 _0xbf54=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','lodash','util','moment','bluebird'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xbf54,0x8f));var _0x4bf5=function(_0x26b8b5,_0xf5c2c1){_0x26b8b5=_0x26b8b5-0x0;var _0x2150a9=_0xbf54[_0x26b8b5];return _0x2150a9;};'use strict';var _=require(_0x4bf5('0x0'));var util=require(_0x4bf5('0x1'));var moment=require(_0x4bf5('0x2'));var BPromise=require(_0x4bf5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bf5('0x4'));var db=require(_0x4bf5('0x5'))['db'];var utils=require(_0x4bf5('0x6'));var logger=require(_0x4bf5('0x7'))('rpc');var config=require(_0x4bf5('0x8'));var jayson=require(_0x4bf5('0x9'));var client=jayson[_0x4bf5('0xa')][_0x4bf5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b3893,_0x49cfdb,_0x3c0e29){return new BPromise(function(_0x3f9970,_0x2596f0){return client['request'](_0x3b3893,_0x3c0e29)[_0x4bf5('0xc')](function(_0x4aa806){logger[_0x4bf5('0xd')](_0x4bf5('0xe'),_0x49cfdb,_0x4bf5('0xf'));logger[_0x4bf5('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x49cfdb,'request\x20sent',JSON[_0x4bf5('0x11')](_0x4aa806));if(_0x4aa806['error']){if(_0x4aa806[_0x4bf5('0x12')]['code']===0x1f4){logger['error'](_0x4bf5('0xe'),_0x49cfdb,_0x4aa806[_0x4bf5('0x12')][_0x4bf5('0x13')]);return _0x2596f0(_0x4aa806[_0x4bf5('0x12')][_0x4bf5('0x13')]);}logger[_0x4bf5('0x12')](_0x4bf5('0xe'),_0x49cfdb,_0x4aa806[_0x4bf5('0x12')][_0x4bf5('0x13')]);return _0x3f9970(_0x4aa806[_0x4bf5('0x12')][_0x4bf5('0x13')]);}else{logger[_0x4bf5('0xd')](_0x4bf5('0xe'),_0x49cfdb,_0x4bf5('0xf'));_0x3f9970(_0x4aa806['result'][_0x4bf5('0x13')]);}})[_0x4bf5('0x14')](function(_0x2f8e2c){logger['error'](_0x4bf5('0xe'),_0x49cfdb,_0x2f8e2c);_0x2596f0(_0x2f8e2c);});});} \ No newline at end of file +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 diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index d2f5cdb..24caa5b 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 _0xe293=['exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','/describe','/:id','show','put','delete','destroy'];(function(_0x3dcdb5,_0xdabd65){var _0x26e693=function(_0x3a477b){while(--_0x3a477b){_0x3dcdb5['push'](_0x3dcdb5['shift']());}};_0x26e693(++_0xdabd65);}(_0xe293,0x181));var _0x3e29=function(_0x210603,_0x4adbac){_0x210603=_0x210603-0x0;var _0x1bcb7d=_0xe293[_0x210603];return _0x1bcb7d;};'use strict';var multer=require(_0x3e29('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3e29('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3e29('0x2'));var auth=require(_0x3e29('0x3'));var interaction=require(_0x3e29('0x4'));var config=require(_0x3e29('0x5'));var controller=require(_0x3e29('0x6'));router[_0x3e29('0x7')]('/',auth[_0x3e29('0x8')](),controller['index']);router[_0x3e29('0x7')](_0x3e29('0x9'),auth[_0x3e29('0x8')](),controller['describe']);router[_0x3e29('0x7')](_0x3e29('0xa'),auth[_0x3e29('0x8')](),controller[_0x3e29('0xb')]);router['post']('/',auth[_0x3e29('0x8')](),controller['create']);router[_0x3e29('0xc')](_0x3e29('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x3e29('0xd')]('/:id',auth[_0x3e29('0x8')](),controller[_0x3e29('0xe')]);module[_0x3e29('0xf')]=router; \ No newline at end of file +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 diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index e6e1892..e7c1601 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x417756,_0x548873){var _0x5ac44b=function(_0x4aa854){while(--_0x4aa854){_0x417756['push'](_0x417756['shift']());}};_0x5ac44b(++_0x548873);}(_0x70e0,0x17b));var _0x070e=function(_0x43a29a,_0x47af99){_0x43a29a=_0x43a29a-0x0;var _0x491511=_0x70e0[_0x43a29a];return _0x491511;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 55141ed..e31868b 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 _0x64b4=['type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','include','rows','catch','params','keys','includeAll','options','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailTransferReport','rawAttributes','fieldName'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x64b4,0x17c));var _0x464b=function(_0x5c8361,_0x43b55c){_0x5c8361=_0x5c8361-0x0;var _0x1af5e7=_0x64b4[_0x5c8361];return _0x1af5e7;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x464b('0x0'));var jsonpatch=require(_0x464b('0x1'));var rp=require(_0x464b('0x2'));var moment=require(_0x464b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x464b('0x4'));var util=require(_0x464b('0x5'));var path=require(_0x464b('0x6'));var sox=require(_0x464b('0x7'));var csv=require(_0x464b('0x8'));var ejs=require(_0x464b('0x9'));var fs=require('fs');var fs_extra=require(_0x464b('0xa'));var _=require('lodash');var squel=require(_0x464b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x464b('0x8'));var querystring=require(_0x464b('0xc'));var Papa=require(_0x464b('0xd'));var Redis=require(_0x464b('0xe'));var authService=require(_0x464b('0xf'));var qs=require(_0x464b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x464b('0x11'));var logger=require('../../config/logger')(_0x464b('0x12'));var utils=require(_0x464b('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x464b('0x14'))['db'];function respondWithStatusCode(_0xf03def,_0x101f58){_0x101f58=_0x101f58||0xcc;return function(_0x5e2fcc){if(_0x5e2fcc){return _0xf03def[_0x464b('0x15')](_0x101f58);}return _0xf03def['status'](_0x101f58)[_0x464b('0x16')]();};}function respondWithResult(_0x2bb680,_0x5d4116){_0x5d4116=_0x5d4116||0xc8;return function(_0x3c9c25){if(_0x3c9c25){return _0x2bb680[_0x464b('0x17')](_0x5d4116)['json'](_0x3c9c25);}};}function respondWithFilteredResult(_0xc34834,_0x38d75f){return function(_0x9d2a68){if(_0x9d2a68){var _0x3ffcaf=typeof _0x38d75f[_0x464b('0x18')]===_0x464b('0x19')&&typeof _0x38d75f['limit']==='undefined';var _0x6f4579=_0x9d2a68[_0x464b('0x1a')];var _0x3deb25=_0x3ffcaf?0x0:_0x38d75f['offset'];var _0x1bc392=_0x3ffcaf?_0x9d2a68[_0x464b('0x1a')]:_0x38d75f[_0x464b('0x18')]+_0x38d75f[_0x464b('0x1b')];var _0x44ab72;if(_0x1bc392>=_0x6f4579){_0x1bc392=_0x6f4579;_0x44ab72=0xc8;}else{_0x44ab72=0xce;}_0xc34834['status'](_0x44ab72);return _0xc34834[_0x464b('0x1c')](_0x464b('0x1d'),_0x3deb25+'-'+_0x1bc392+'/'+_0x6f4579)[_0x464b('0x1e')](_0x9d2a68);}return null;};}function patchUpdates(_0x32b82c){return function(_0x2c14ab){try{jsonpatch[_0x464b('0x1f')](_0x2c14ab,_0x32b82c,!![]);}catch(_0x4ffa88){return BPromise[_0x464b('0x20')](_0x4ffa88);}return _0x2c14ab[_0x464b('0x21')]();};}function saveUpdates(_0x6c99ac,_0x2d845f){return function(_0x539a87){if(_0x539a87){return _0x539a87[_0x464b('0x22')](_0x6c99ac)[_0x464b('0x23')](function(_0x5bbfa1){return _0x5bbfa1;});}return null;};}function removeEntity(_0x19e0ba,_0x582549){return function(_0x26b6c4){if(_0x26b6c4){return _0x26b6c4[_0x464b('0x24')]()[_0x464b('0x23')](function(){_0x19e0ba[_0x464b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dd74c,_0x82ab8e){return function(_0x28de20){if(!_0x28de20){_0x3dd74c[_0x464b('0x15')](0x194);}return _0x28de20;};}function handleError(_0x4677a5,_0x229b15){_0x229b15=_0x229b15||0x1f4;return function(_0x3188ba){logger[_0x464b('0x25')](_0x3188ba[_0x464b('0x26')]);if(_0x3188ba[_0x464b('0x27')]){delete _0x3188ba[_0x464b('0x27')];}_0x4677a5[_0x464b('0x17')](_0x229b15)[_0x464b('0x28')](_0x3188ba);};}exports[_0x464b('0x29')]=function(_0x499575,_0x525be4){var _0x4faf92={},_0x27841d={},_0xde97df={'count':0x0,'rows':[]};var _0x26927a=_[_0x464b('0x2a')](db[_0x464b('0x2b')][_0x464b('0x2c')],function(_0x7bf470){return{'name':_0x7bf470[_0x464b('0x2d')],'type':_0x7bf470[_0x464b('0x2e')]['key']};});_0x27841d[_0x464b('0x2f')]=_[_0x464b('0x2a')](_0x26927a,'name');_0x27841d[_0x464b('0x30')]=_['keys'](_0x499575['query']);_0x27841d[_0x464b('0x31')]=_[_0x464b('0x32')](_0x27841d[_0x464b('0x2f')],_0x27841d['query']);_0x4faf92[_0x464b('0x33')]=_[_0x464b('0x32')](_0x27841d[_0x464b('0x2f')],qs[_0x464b('0x34')](_0x499575[_0x464b('0x30')]['fields']));_0x4faf92['attributes']=_0x4faf92[_0x464b('0x33')][_0x464b('0x35')]?_0x4faf92[_0x464b('0x33')]:_0x27841d[_0x464b('0x2f')];if(!_0x499575[_0x464b('0x30')][_0x464b('0x36')]('nolimit')){_0x4faf92[_0x464b('0x1b')]=qs[_0x464b('0x1b')](_0x499575[_0x464b('0x30')][_0x464b('0x1b')]);_0x4faf92[_0x464b('0x18')]=qs[_0x464b('0x18')](_0x499575[_0x464b('0x30')][_0x464b('0x18')]);}_0x4faf92[_0x464b('0x37')]=qs[_0x464b('0x38')](_0x499575[_0x464b('0x30')]['sort']);_0x4faf92[_0x464b('0x39')]=qs[_0x464b('0x31')](_['pick'](_0x499575['query'],_0x27841d[_0x464b('0x31')]),_0x26927a);if(_0x499575[_0x464b('0x30')][_0x464b('0x3a')]){_0x4faf92[_0x464b('0x39')]=_[_0x464b('0x3b')](_0x4faf92['where'],{'$or':_[_0x464b('0x2a')](_0x26927a,function(_0x4e4eeb){if(_0x4e4eeb['type']!=='VIRTUAL'){var _0x252d4b={};_0x252d4b[_0x4e4eeb[_0x464b('0x27')]]={'$like':'%'+_0x499575[_0x464b('0x30')][_0x464b('0x3a')]+'%'};return _0x252d4b;}})});}_0x4faf92=_[_0x464b('0x3b')]({},_0x4faf92,_0x499575['options']);var _0x20d189={'where':_0x4faf92[_0x464b('0x39')]};return db[_0x464b('0x2b')][_0x464b('0x1a')](_0x20d189)[_0x464b('0x23')](function(_0x20effa){_0xde97df['count']=_0x20effa;if(_0x499575['query']['includeAll']){_0x4faf92[_0x464b('0x3c')]=[{'all':!![]}];}return db[_0x464b('0x2b')]['findAll'](_0x4faf92);})[_0x464b('0x23')](function(_0x364aaf){_0xde97df[_0x464b('0x3d')]=_0x364aaf;return _0xde97df;})['then'](respondWithFilteredResult(_0x525be4,_0x4faf92))[_0x464b('0x3e')](handleError(_0x525be4,null));};exports['show']=function(_0x430b56,_0x2e03aa){var _0x136f47={'raw':!![],'where':{'id':_0x430b56[_0x464b('0x3f')]['id']}},_0xb9c4fa={};_0xb9c4fa[_0x464b('0x2f')]=_[_0x464b('0x40')](db['MailTransferReport'][_0x464b('0x2c')]);_0xb9c4fa[_0x464b('0x30')]=_['keys'](_0x430b56[_0x464b('0x30')]);_0xb9c4fa[_0x464b('0x31')]=_[_0x464b('0x32')](_0xb9c4fa[_0x464b('0x2f')],_0xb9c4fa[_0x464b('0x30')]);_0x136f47[_0x464b('0x33')]=_[_0x464b('0x32')](_0xb9c4fa[_0x464b('0x2f')],qs[_0x464b('0x34')](_0x430b56[_0x464b('0x30')]['fields']));_0x136f47[_0x464b('0x33')]=_0x136f47[_0x464b('0x33')]['length']?_0x136f47[_0x464b('0x33')]:_0xb9c4fa[_0x464b('0x2f')];if(_0x430b56[_0x464b('0x30')][_0x464b('0x41')]){_0x136f47[_0x464b('0x3c')]=[{'all':!![]}];}_0x136f47=_['merge']({},_0x136f47,_0x430b56[_0x464b('0x42')]);return db[_0x464b('0x2b')][_0x464b('0x43')](_0x136f47)[_0x464b('0x23')](handleEntityNotFound(_0x2e03aa,null))[_0x464b('0x23')](respondWithResult(_0x2e03aa,null))[_0x464b('0x3e')](handleError(_0x2e03aa,null));};exports[_0x464b('0x44')]=function(_0x318877,_0x279530){return db[_0x464b('0x2b')][_0x464b('0x44')](_0x318877[_0x464b('0x45')],{})[_0x464b('0x23')](respondWithResult(_0x279530,0xc9))[_0x464b('0x3e')](handleError(_0x279530,null));};exports[_0x464b('0x22')]=function(_0x562e5b,_0x287d85){if(_0x562e5b[_0x464b('0x45')]['id']){delete _0x562e5b[_0x464b('0x45')]['id'];}return db[_0x464b('0x2b')][_0x464b('0x43')]({'where':{'id':_0x562e5b['params']['id']}})[_0x464b('0x23')](handleEntityNotFound(_0x287d85,null))['then'](saveUpdates(_0x562e5b[_0x464b('0x45')],null))[_0x464b('0x23')](respondWithResult(_0x287d85,null))[_0x464b('0x3e')](handleError(_0x287d85,null));};exports['destroy']=function(_0x4ef770,_0x17caa0){return db[_0x464b('0x2b')]['find']({'where':{'id':_0x4ef770[_0x464b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x17caa0,null))[_0x464b('0x23')](removeEntity(_0x17caa0,null))[_0x464b('0x3e')](handleError(_0x17caa0,null));};exports[_0x464b('0x46')]=function(_0x45cd32,_0x27c238){return db[_0x464b('0x2b')][_0x464b('0x46')]()[_0x464b('0x23')](respondWithResult(_0x27c238,null))[_0x464b('0x3e')](handleError(_0x27c238,null));}; \ No newline at end of file +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 diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 01f39fc..98c739f 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 _0x9b67=['util','../../config/logger','api','moment','request-promise','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0x56b6a8,_0x2dd717){var _0x5f428b=function(_0x4efa26){while(--_0x4efa26){_0x56b6a8['push'](_0x56b6a8['shift']());}};_0x5f428b(++_0x2dd717);}(_0x9b67,0xf6));var _0x79b6=function(_0x54e4a8,_0x2f7099){_0x54e4a8=_0x54e4a8-0x0;var _0x2d14e6=_0x9b67[_0x54e4a8];return _0x2d14e6;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));module[_0x79b6('0x8')]=function(_0x258103,_0xec367e){return _0x258103[_0x79b6('0x9')](_0x79b6('0xa'),attributes,{'tableName':_0x79b6('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x79b6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6298a26..656c3cd 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 _0x0090=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','util','randomstring'];(function(_0x3c64b5,_0x42ab2a){var _0x1eea7d=function(_0x42f4c7){while(--_0x42f4c7){_0x3c64b5['push'](_0x3c64b5['shift']());}};_0x1eea7d(++_0x42ab2a);}(_0x0090,0xca));var _0x0009=function(_0x4d2c84,_0x3f48ef){_0x4d2c84=_0x4d2c84-0x0;var _0x856009=_0x0090[_0x4d2c84];return _0x856009;};'use strict';var _=require('lodash');var util=require(_0x0009('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0009('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0009('0x2'))['db'];var utils=require(_0x0009('0x3'));var logger=require(_0x0009('0x4'))('rpc');var config=require(_0x0009('0x5'));var jayson=require(_0x0009('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3f8271,_0x317a84,_0x432912){return new BPromise(function(_0x441d76,_0x4996b9){return client[_0x0009('0x7')](_0x3f8271,_0x432912)['then'](function(_0x511145){logger[_0x0009('0x8')](_0x0009('0x9'),_0x317a84,_0x0009('0xa'));logger[_0x0009('0xb')](_0x0009('0xc'),_0x317a84,_0x0009('0xa'),JSON[_0x0009('0xd')](_0x511145));if(_0x511145[_0x0009('0xe')]){if(_0x511145[_0x0009('0xe')][_0x0009('0xf')]===0x1f4){logger['error'](_0x0009('0x9'),_0x317a84,_0x511145['error'][_0x0009('0x10')]);return _0x4996b9(_0x511145[_0x0009('0xe')][_0x0009('0x10')]);}logger[_0x0009('0xe')](_0x0009('0x9'),_0x317a84,_0x511145[_0x0009('0xe')][_0x0009('0x10')]);return _0x441d76(_0x511145[_0x0009('0xe')]['message']);}else{logger['info'](_0x0009('0x9'),_0x317a84,_0x0009('0xa'));_0x441d76(_0x511145['result'][_0x0009('0x10')]);}})['catch'](function(_0x580256){logger[_0x0009('0xe')](_0x0009('0x9'),_0x317a84,_0x580256);_0x4996b9(_0x580256);});});} \ No newline at end of file +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 diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 6ef9b8d..1251987 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 _0x883c=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./memberReport.controller','isAuthenticated','index','get','/describe','describe','/:id','create','put'];(function(_0x25c70d,_0x28bcd4){var _0x46ab=function(_0x44252a){while(--_0x44252a){_0x25c70d['push'](_0x25c70d['shift']());}};_0x46ab(++_0x28bcd4);}(_0x883c,0x10e));var _0xc883=function(_0x5ee447,_0x4ee2bf){_0x5ee447=_0x5ee447-0x0;var _0x656bfe=_0x883c[_0x5ee447];return _0x656bfe;};'use strict';var multer=require(_0xc883('0x0'));var util=require('util');var path=require(_0xc883('0x1'));var timeout=require(_0xc883('0x2'));var express=require(_0xc883('0x3'));var router=express[_0xc883('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc883('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc883('0x6'));router['get']('/',auth[_0xc883('0x7')](),controller[_0xc883('0x8')]);router[_0xc883('0x9')](_0xc883('0xa'),auth[_0xc883('0x7')](),controller[_0xc883('0xb')]);router[_0xc883('0x9')](_0xc883('0xc'),auth[_0xc883('0x7')](),controller['show']);router['post']('/',auth[_0xc883('0x7')](),controller[_0xc883('0xd')]);router[_0xc883('0xe')](_0xc883('0xc'),auth['isAuthenticated'](),controller[_0xc883('0xf')]);router[_0xc883('0x10')](_0xc883('0xc'),auth['isAuthenticated'](),controller[_0xc883('0x11')]);module[_0xc883('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ce3bd8d..7fb81dd 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 _0xa176=['exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','moment'];(function(_0x1913c1,_0xe25386){var _0x45b05a=function(_0xe8bac9){while(--_0xe8bac9){_0x1913c1['push'](_0x1913c1['shift']());}};_0x45b05a(++_0xe25386);}(_0xa176,0x8f));var _0x6a17=function(_0x2c40dd,_0x56240f){_0x2c40dd=_0x2c40dd-0x0;var _0x174f84=_0xa176[_0x2c40dd];return _0x174f84;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6a17('0x0'));module[_0x6a17('0x1')]={'channel':{'type':Sequelize[_0x6a17('0x2')]},'membername':{'type':Sequelize[_0x6a17('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6a17('0x2')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x6a17('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x6a17('0x4')]},'exitAt':{'type':Sequelize[_0x6a17('0x4')],'set':function(_0x1fa250){var _0x1e8178=moment(_0x1fa250);var _0x2678c7=moment(this[_0x6a17('0x5')](_0x6a17('0x6')));var _0x3bcca0=_0x1e8178[_0x6a17('0x7')](_0x2678c7,'seconds');this[_0x6a17('0x8')](_0x6a17('0x9'),_0x1fa250);this[_0x6a17('0x8')](_0x6a17('0xa'),_0x3bcca0>=0x0?_0x3bcca0:null);}},'data1':{'type':Sequelize[_0x6a17('0x2')],'comment':_0x6a17('0xb')},'data2':{'type':Sequelize['STRING'],'comment':_0x6a17('0xc')},'data3':{'type':Sequelize[_0x6a17('0x2')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x6a17('0x2')],'comment':_0x6a17('0xd')},'data5':{'type':Sequelize[_0x6a17('0x2')],'comment':_0x6a17('0xe')},'role':{'type':Sequelize[_0x6a17('0x2')]},'internal':{'type':Sequelize[_0x6a17('0xf')]},'uniqueid':{'type':Sequelize[_0x6a17('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index d9179df..bebafbc 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 _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(_0x5d60d1,_0x325ad0){var _0x5e94a7=function(_0x40fb9c){while(--_0x40fb9c){_0x5d60d1['push'](_0x5d60d1['shift']());}};_0x5e94a7(++_0x325ad0);}(_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 +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 diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index badd6c6..7657ebd 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 _0x7ad9=['membername_interface','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x37b127,_0x3edce8){var _0x45a313=function(_0x439e69){while(--_0x439e69){_0x37b127['push'](_0x37b127['shift']());}};_0x45a313(++_0x3edce8);}(_0x7ad9,0x16f));var _0x97ad=function(_0x41bce1,_0x5c6118){_0x41bce1=_0x41bce1-0x0;var _0x516438=_0x7ad9[_0x41bce1];return _0x516438;};'use strict';var _=require(_0x97ad('0x0'));var util=require(_0x97ad('0x1'));var logger=require('../../config/logger')(_0x97ad('0x2'));var moment=require(_0x97ad('0x3'));var BPromise=require(_0x97ad('0x4'));var rp=require(_0x97ad('0x5'));var fs=require('fs');var path=require(_0x97ad('0x6'));var rimraf=require('rimraf');var config=require(_0x97ad('0x7'));var attributes=require(_0x97ad('0x8'));module['exports']=function(_0x28a6ab,_0x2cf030){return _0x28a6ab[_0x97ad('0x9')](_0x97ad('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x97ad('0xb'),'fields':[_0x97ad('0xc'),_0x97ad('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 3b417b3..2f200fc 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 _0xf767=['create','body','UpdateMemberReport','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMemberReport','findAll','options','raw','limit','map','include','model','attributes','info','CreateMemberReport','MemberReport'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0xf767,0x76));var _0x7f76=function(_0xd2d54,_0x5329f7){_0xd2d54=_0xd2d54-0x0;var _0x78b113=_0xf767[_0xd2d54];return _0x78b113;};'use strict';var _=require('lodash');var util=require(_0x7f76('0x0'));var moment=require(_0x7f76('0x1'));var BPromise=require(_0x7f76('0x2'));var rs=require(_0x7f76('0x3'));var fs=require('fs');var Redis=require(_0x7f76('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f76('0x5'));var logger=require(_0x7f76('0x6'))(_0x7f76('0x7'));var config=require(_0x7f76('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f76('0x9')][_0x7f76('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45ddcc,_0x1eeb08,_0x1fc46c){return new BPromise(function(_0x5acfee,_0x8b5dce){return client[_0x7f76('0xb')](_0x45ddcc,_0x1fc46c)[_0x7f76('0xc')](function(_0x15dcd9){logger['info'](_0x7f76('0xd'),_0x1eeb08,'request\x20sent');logger[_0x7f76('0xe')](_0x7f76('0xf'),_0x1eeb08,_0x7f76('0x10'),JSON[_0x7f76('0x11')](_0x15dcd9));if(_0x15dcd9[_0x7f76('0x12')]){if(_0x15dcd9[_0x7f76('0x12')]['code']===0x1f4){logger[_0x7f76('0x12')](_0x7f76('0xd'),_0x1eeb08,_0x15dcd9[_0x7f76('0x12')][_0x7f76('0x13')]);return _0x8b5dce(_0x15dcd9[_0x7f76('0x12')]['message']);}logger[_0x7f76('0x12')]('MemberReport,\x20%s,\x20%s',_0x1eeb08,_0x15dcd9[_0x7f76('0x12')][_0x7f76('0x13')]);return _0x5acfee(_0x15dcd9['error']['message']);}else{logger['info'](_0x7f76('0xd'),_0x1eeb08,_0x7f76('0x10'));_0x5acfee(_0x15dcd9[_0x7f76('0x14')]['message']);}})[_0x7f76('0x15')](function(_0x522a2c){logger[_0x7f76('0x12')](_0x7f76('0xd'),_0x1eeb08,_0x522a2c);_0x8b5dce(_0x522a2c);});});}exports[_0x7f76('0x16')]=function(_0x4802ff){var _0x4f1c15=this;return new Promise(function(_0x494537,_0x54e95a){return db['MemberReport'][_0x7f76('0x17')]({'raw':_0x4802ff[_0x7f76('0x18')]?_0x4802ff[_0x7f76('0x18')][_0x7f76('0x19')]===undefined?!![]:![]:!![],'where':_0x4802ff['options']?_0x4802ff[_0x7f76('0x18')]['where']||null:null,'attributes':_0x4802ff[_0x7f76('0x18')]?_0x4802ff[_0x7f76('0x18')]['attributes']||null:null,'limit':_0x4802ff['options']?_0x4802ff[_0x7f76('0x18')][_0x7f76('0x1a')]||null:null,'include':_0x4802ff['options']?_0x4802ff[_0x7f76('0x18')]['include']?_[_0x7f76('0x1b')](_0x4802ff[_0x7f76('0x18')][_0x7f76('0x1c')],function(_0x3deb00){return{'model':db[_0x3deb00[_0x7f76('0x1d')]],'as':_0x3deb00['as'],'attributes':_0x3deb00['attributes'],'include':_0x3deb00[_0x7f76('0x1c')]?_['map'](_0x3deb00['include'],function(_0x197519){return{'model':db[_0x197519[_0x7f76('0x1d')]],'as':_0x197519['as'],'attributes':_0x197519[_0x7f76('0x1e')],'include':_0x197519['include']?_[_0x7f76('0x1b')](_0x197519[_0x7f76('0x1c')],function(_0x3e624d){return{'model':db[_0x3e624d[_0x7f76('0x1d')]],'as':_0x3e624d['as'],'attributes':_0x3e624d[_0x7f76('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13f3c9){logger[_0x7f76('0x1f')]('GetMemberReport',_0x4802ff);logger['debug'](_0x7f76('0x16'),_0x4802ff,JSON['stringify'](_0x13f3c9));_0x494537(_0x13f3c9);})[_0x7f76('0x15')](function(_0x3542e3){logger[_0x7f76('0x12')](_0x7f76('0x16'),_0x3542e3[_0x7f76('0x13')],_0x4802ff);_0x54e95a(_0x4f1c15[_0x7f76('0x12')](0x1f4,_0x3542e3['message']));});});};exports[_0x7f76('0x20')]=function(_0x218aee){var _0x109589=this;return new Promise(function(_0x38f31e,_0x5eb5cf){return db[_0x7f76('0x21')][_0x7f76('0x22')](_0x218aee[_0x7f76('0x23')],{'raw':_0x218aee['options']?_0x218aee[_0x7f76('0x18')][_0x7f76('0x19')]===undefined?!![]:![]:!![]})[_0x7f76('0xc')](function(_0x4582bc){logger[_0x7f76('0x1f')](_0x7f76('0x20'),_0x218aee);logger[_0x7f76('0xe')](_0x7f76('0x20'),_0x218aee,JSON[_0x7f76('0x11')](_0x4582bc));_0x38f31e(_0x4582bc);})[_0x7f76('0x15')](function(_0x1458a6){logger[_0x7f76('0x12')](_0x7f76('0x20'),_0x1458a6['message'],_0x218aee);_0x5eb5cf(_0x109589[_0x7f76('0x12')](0x1f4,_0x1458a6[_0x7f76('0x13')]));});});};exports[_0x7f76('0x24')]=function(_0x19dfe0){var _0x349343=this;return new Promise(function(_0x20c260,_0x21cb09){return db[_0x7f76('0x21')]['update'](_0x19dfe0[_0x7f76('0x23')],{'raw':_0x19dfe0['options']?_0x19dfe0['options'][_0x7f76('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19dfe0['options']?_0x19dfe0[_0x7f76('0x18')][_0x7f76('0x25')]||null:null,'attributes':_0x19dfe0['options']?_0x19dfe0[_0x7f76('0x18')]['attributes']||null:null,'limit':_0x19dfe0['options']?_0x19dfe0[_0x7f76('0x18')][_0x7f76('0x1a')]||null:null})[_0x7f76('0xc')](function(_0x164e2d){logger[_0x7f76('0x1f')]('UpdateMemberReport',_0x19dfe0);logger[_0x7f76('0xe')](_0x7f76('0x24'),_0x19dfe0,JSON['stringify'](_0x164e2d));_0x20c260(_0x164e2d);})['catch'](function(_0x311204){logger['error'](_0x7f76('0x24'),_0x311204[_0x7f76('0x13')],_0x19dfe0);_0x21cb09(_0x349343[_0x7f76('0x12')](0x1f4,_0x311204['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d67aafe..04c6a62 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 _0x48b9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','multer','connect-timeout','express','Router','fs-extra'];(function(_0x19353b,_0x18124e){var _0x3428c0=function(_0x2dc643){while(--_0x2dc643){_0x19353b['push'](_0x19353b['shift']());}};_0x3428c0(++_0x18124e);}(_0x48b9,0x1b3));var _0x948b=function(_0x49eb44,_0x724f7f){_0x49eb44=_0x49eb44-0x0;var _0x3ba34a=_0x48b9[_0x49eb44];return _0x3ba34a;};'use strict';var multer=require(_0x948b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x948b('0x1'));var express=require(_0x948b('0x2'));var router=express[_0x948b('0x3')]();var fs_extra=require(_0x948b('0x4'));var auth=require(_0x948b('0x5'));var interaction=require(_0x948b('0x6'));var config=require(_0x948b('0x7'));var controller=require(_0x948b('0x8'));router[_0x948b('0x9')]('/',controller['index']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index bcd16c1..892b4ef 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 _0xbb12=['STRING','version','sequelize'];(function(_0x17c519,_0x230bb8){var _0x56752b=function(_0x3b1f35){while(--_0x3b1f35){_0x17c519['push'](_0x17c519['shift']());}};_0x56752b(++_0x230bb8);}(_0xbb12,0x1b5));var _0x2bb1=function(_0x2d8408,_0x42a8f3){_0x2d8408=_0x2d8408-0x0;var _0x5e4a63=_0xbb12[_0x2d8408];return _0x5e4a63;};'use strict';var Sequelize=require(_0x2bb1('0x0'));module['exports']={'version':{'type':Sequelize[_0x2bb1('0x1')],'unique':_0x2bb1('0x2')}}; \ No newline at end of file +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 diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 6d22afb..83b8a4d 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 _0x7a89=['options','Migration','includeAll','include','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge'];(function(_0x1f4202,_0x5350da){var _0x47bb0d=function(_0x3052e9){while(--_0x3052e9){_0x1f4202['push'](_0x1f4202['shift']());}};_0x47bb0d(++_0x5350da);}(_0x7a89,0x93));var _0x97a8=function(_0xf53937,_0x2bf512){_0xf53937=_0xf53937-0x0;var _0x33b67b=_0x7a89[_0xf53937];return _0x33b67b;};'use strict';var emlformat=require(_0x97a8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x97a8('0x1'));var jsonpatch=require(_0x97a8('0x2'));var rp=require(_0x97a8('0x3'));var moment=require(_0x97a8('0x4'));var BPromise=require(_0x97a8('0x5'));var Mustache=require(_0x97a8('0x6'));var util=require(_0x97a8('0x7'));var path=require(_0x97a8('0x8'));var sox=require(_0x97a8('0x9'));var csv=require(_0x97a8('0xa'));var ejs=require(_0x97a8('0xb'));var fs=require('fs');var fs_extra=require(_0x97a8('0xc'));var _=require(_0x97a8('0xd'));var squel=require(_0x97a8('0xe'));var crypto=require('crypto');var jsforce=require(_0x97a8('0xf'));var deskjs=require(_0x97a8('0x10'));var toCsv=require(_0x97a8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x97a8('0x11'));var authService=require(_0x97a8('0x12'));var qs=require(_0x97a8('0x13'));var as=require(_0x97a8('0x14'));var hardwareService=require(_0x97a8('0x15'));var logger=require(_0x97a8('0x16'))(_0x97a8('0x17'));var utils=require(_0x97a8('0x18'));var config=require(_0x97a8('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x97a8('0x1a'))['db'];function respondWithStatusCode(_0x5978cc,_0x178192){_0x178192=_0x178192||0xcc;return function(_0x20b5aa){if(_0x20b5aa){return _0x5978cc[_0x97a8('0x1b')](_0x178192);}return _0x5978cc[_0x97a8('0x1c')](_0x178192)[_0x97a8('0x1d')]();};}function respondWithResult(_0x3dfde5,_0x290119){_0x290119=_0x290119||0xc8;return function(_0xa93833){if(_0xa93833){return _0x3dfde5['status'](_0x290119)[_0x97a8('0x1e')](_0xa93833);}};}function respondWithFilteredResult(_0x2c552b,_0x118904){return function(_0x2861ef){if(_0x2861ef){var _0x2d72cf=typeof _0x118904[_0x97a8('0x1f')]===_0x97a8('0x20')&&typeof _0x118904[_0x97a8('0x21')]==='undefined';var _0x11409a=_0x2861ef[_0x97a8('0x22')];var _0x2a270a=_0x2d72cf?0x0:_0x118904['offset'];var _0xf68ef5=_0x2d72cf?_0x2861ef[_0x97a8('0x22')]:_0x118904[_0x97a8('0x1f')]+_0x118904[_0x97a8('0x21')];var _0x4c61b8;if(_0xf68ef5>=_0x11409a){_0xf68ef5=_0x11409a;_0x4c61b8=0xc8;}else{_0x4c61b8=0xce;}_0x2c552b[_0x97a8('0x1c')](_0x4c61b8);return _0x2c552b['set'](_0x97a8('0x23'),_0x2a270a+'-'+_0xf68ef5+'/'+_0x11409a)['json'](_0x2861ef);}return null;};}function patchUpdates(_0x3828ec){return function(_0x4ce171){try{jsonpatch['apply'](_0x4ce171,_0x3828ec,!![]);}catch(_0x4bbb13){return BPromise[_0x97a8('0x24')](_0x4bbb13);}return _0x4ce171[_0x97a8('0x25')]();};}function saveUpdates(_0x3e9071,_0x556f57){return function(_0x3d8ee6){if(_0x3d8ee6){return _0x3d8ee6[_0x97a8('0x26')](_0x3e9071)[_0x97a8('0x27')](function(_0x5aaa14){return _0x5aaa14;});}return null;};}function removeEntity(_0x3e3559,_0xb03ef4){return function(_0x408393){if(_0x408393){return _0x408393[_0x97a8('0x28')]()['then'](function(){_0x3e3559[_0x97a8('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42a3e9,_0x1ee55e){return function(_0x269205){if(!_0x269205){_0x42a3e9[_0x97a8('0x1b')](0x194);}return _0x269205;};}function handleError(_0x1e4273,_0x585511){_0x585511=_0x585511||0x1f4;return function(_0x6e88cd){logger[_0x97a8('0x29')](_0x6e88cd[_0x97a8('0x2a')]);if(_0x6e88cd[_0x97a8('0x2b')]){delete _0x6e88cd[_0x97a8('0x2b')];}_0x1e4273[_0x97a8('0x1c')](_0x585511)[_0x97a8('0x2c')](_0x6e88cd);};}exports[_0x97a8('0x2d')]=function(_0x4d98f8,_0x5dadbe){var _0x1102c3={},_0x5ca615={},_0x204139={'count':0x0,'rows':[]};var _0x23fe29=_[_0x97a8('0x2e')](db['Migration']['rawAttributes'],function(_0xf5b533){return{'name':_0xf5b533['fieldName'],'type':_0xf5b533[_0x97a8('0x2f')][_0x97a8('0x30')]};});_0x5ca615[_0x97a8('0x31')]=_['map'](_0x23fe29,_0x97a8('0x2b'));_0x5ca615['query']=_[_0x97a8('0x32')](_0x4d98f8[_0x97a8('0x33')]);_0x5ca615[_0x97a8('0x34')]=_['intersection'](_0x5ca615[_0x97a8('0x31')],_0x5ca615[_0x97a8('0x33')]);_0x1102c3[_0x97a8('0x35')]=_[_0x97a8('0x36')](_0x5ca615[_0x97a8('0x31')],qs[_0x97a8('0x37')](_0x4d98f8[_0x97a8('0x33')]['fields']));_0x1102c3['attributes']=_0x1102c3[_0x97a8('0x35')]['length']?_0x1102c3[_0x97a8('0x35')]:_0x5ca615[_0x97a8('0x31')];if(!_0x4d98f8[_0x97a8('0x33')][_0x97a8('0x38')](_0x97a8('0x39'))){_0x1102c3['limit']=qs[_0x97a8('0x21')](_0x4d98f8[_0x97a8('0x33')]['limit']);_0x1102c3[_0x97a8('0x1f')]=qs[_0x97a8('0x1f')](_0x4d98f8['query'][_0x97a8('0x1f')]);}_0x1102c3[_0x97a8('0x3a')]=qs['sort'](_0x4d98f8[_0x97a8('0x33')]['sort']);_0x1102c3[_0x97a8('0x3b')]=qs[_0x97a8('0x34')](_[_0x97a8('0x3c')](_0x4d98f8[_0x97a8('0x33')],_0x5ca615[_0x97a8('0x34')]),_0x23fe29);if(_0x4d98f8[_0x97a8('0x33')][_0x97a8('0x3d')]){_0x1102c3[_0x97a8('0x3b')]=_[_0x97a8('0x3e')](_0x1102c3['where'],{'$or':_[_0x97a8('0x2e')](_0x23fe29,function(_0x497dd1){if(_0x497dd1[_0x97a8('0x2f')]!=='VIRTUAL'){var _0x4d17f3={};_0x4d17f3[_0x497dd1[_0x97a8('0x2b')]]={'$like':'%'+_0x4d98f8[_0x97a8('0x33')][_0x97a8('0x3d')]+'%'};return _0x4d17f3;}})});}_0x1102c3=_[_0x97a8('0x3e')]({},_0x1102c3,_0x4d98f8[_0x97a8('0x3f')]);var _0x22ecb7={'where':_0x1102c3[_0x97a8('0x3b')]};return db[_0x97a8('0x40')]['count'](_0x22ecb7)['then'](function(_0x5c873e){_0x204139[_0x97a8('0x22')]=_0x5c873e;if(_0x4d98f8['query'][_0x97a8('0x41')]){_0x1102c3[_0x97a8('0x42')]=[{'all':!![]}];}return db[_0x97a8('0x40')][_0x97a8('0x43')](_0x1102c3);})[_0x97a8('0x27')](function(_0x9c734e){_0x204139[_0x97a8('0x44')]=_0x9c734e;return _0x204139;})[_0x97a8('0x27')](respondWithFilteredResult(_0x5dadbe,_0x1102c3))[_0x97a8('0x45')](handleError(_0x5dadbe,null));}; \ No newline at end of file +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 diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 585bfde..4061e7e 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 _0xffe4=['request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3f1f14,_0x428908){var _0x2c4421=function(_0x298a6c){while(--_0x298a6c){_0x3f1f14['push'](_0x3f1f14['shift']());}};_0x2c4421(++_0x428908);}(_0xffe4,0xdb));var _0x4ffe=function(_0x378a6d,_0x215cc6){_0x378a6d=_0x378a6d-0x0;var _0x91bbe2=_0xffe4[_0x378a6d];return _0x91bbe2;};'use strict';var _=require(_0x4ffe('0x0'));var util=require(_0x4ffe('0x1'));var logger=require(_0x4ffe('0x2'))(_0x4ffe('0x3'));var moment=require(_0x4ffe('0x4'));var BPromise=require(_0x4ffe('0x5'));var rp=require(_0x4ffe('0x6'));var fs=require('fs');var path=require(_0x4ffe('0x7'));var rimraf=require(_0x4ffe('0x8'));var config=require(_0x4ffe('0x9'));var attributes=require(_0x4ffe('0xa'));module[_0x4ffe('0xb')]=function(_0x1ffa74,_0x90d27c){return _0x1ffa74[_0x4ffe('0xc')](_0x4ffe('0xd'),attributes,{'tableName':_0x4ffe('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index 499a7cc..f575e9b 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 _0xd240=['../../config/logger','rpc','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x244893,_0x541cd1){var _0x1a5c16=function(_0x1d1d5d){while(--_0x1d1d5d){_0x244893['push'](_0x244893['shift']());}};_0x1a5c16(++_0x541cd1);}(_0xd240,0x1c7));var _0x0d24=function(_0x4bf009,_0x303e8c){_0x4bf009=_0x4bf009-0x0;var _0x25b707=_0xd240[_0x4bf009];return _0x25b707;};'use strict';var _=require('lodash');var util=require(_0x0d24('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0d24('0x1'));var fs=require('fs');var Redis=require(_0x0d24('0x2'));var db=require(_0x0d24('0x3'))['db'];var utils=require(_0x0d24('0x4'));var logger=require(_0x0d24('0x5'))(_0x0d24('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d24('0x7')][_0x0d24('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1005ff,_0x250141,_0x48fb91){return new BPromise(function(_0xdb2d81,_0x2fdf4a){return client[_0x0d24('0x9')](_0x1005ff,_0x48fb91)[_0x0d24('0xa')](function(_0x58b925){logger[_0x0d24('0xb')](_0x0d24('0xc'),_0x250141,'request\x20sent');logger[_0x0d24('0xd')]('Migration,\x20%s,\x20%s,\x20%s',_0x250141,_0x0d24('0xe'),JSON['stringify'](_0x58b925));if(_0x58b925[_0x0d24('0xf')]){if(_0x58b925[_0x0d24('0xf')][_0x0d24('0x10')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x250141,_0x58b925[_0x0d24('0xf')][_0x0d24('0x11')]);return _0x2fdf4a(_0x58b925[_0x0d24('0xf')]['message']);}logger[_0x0d24('0xf')](_0x0d24('0xc'),_0x250141,_0x58b925['error']['message']);return _0xdb2d81(_0x58b925[_0x0d24('0xf')][_0x0d24('0x11')]);}else{logger[_0x0d24('0xb')](_0x0d24('0xc'),_0x250141,_0x0d24('0xe'));_0xdb2d81(_0x58b925[_0x0d24('0x12')][_0x0d24('0x11')]);}})[_0x0d24('0x13')](function(_0x47ee4b){logger[_0x0d24('0xf')](_0x0d24('0xc'),_0x250141,_0x47ee4b);_0x2fdf4a(_0x47ee4b);});});} \ No newline at end of file +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 diff --git a/server/api/network/index.js b/server/api/network/index.js index a4c92db..0a52a18 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 _0x8163=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./network.controller','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x8163,0x11b));var _0x3816=function(_0x552026,_0x315b5d){_0x552026=_0x552026-0x0;var _0x3c5a7c=_0x8163[_0x552026];return _0x3c5a7c;};'use strict';var multer=require(_0x3816('0x0'));var util=require(_0x3816('0x1'));var path=require(_0x3816('0x2'));var timeout=require(_0x3816('0x3'));var express=require(_0x3816('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3816('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3816('0x6'));var controller=require(_0x3816('0x7'));router[_0x3816('0x8')]('/',auth['isAuthenticated'](),controller[_0x3816('0x9')]);router['get']('/:id',auth[_0x3816('0xa')](),controller[_0x3816('0xb')]);router['post']('/',auth[_0x3816('0xa')](),controller[_0x3816('0xc')]);router[_0x3816('0xd')](_0x3816('0xe'),auth['isAuthenticated'](),controller[_0x3816('0xf')]);router[_0x3816('0x10')](_0x3816('0xe'),auth[_0x3816('0xa')](),controller[_0x3816('0x11')]);module[_0x3816('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index a624680..9fc841d 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 _0x273f=['turn','STRING','sequelize','ENUM','localnet','externip'];(function(_0x22fd7b,_0x9404be){var _0x5bd073=function(_0x195aae){while(--_0x195aae){_0x22fd7b['push'](_0x22fd7b['shift']());}};_0x5bd073(++_0x9404be);}(_0x273f,0xa4));var _0xf273=function(_0xb52d64,_0x256020){_0xb52d64=_0xb52d64-0x0;var _0x53ccb0=_0x273f[_0xb52d64];return _0x53ccb0;};'use strict';var Sequelize=require(_0xf273('0x0'));module['exports']={'type':{'type':Sequelize[_0xf273('0x1')](_0xf273('0x2'),_0xf273('0x3'),'stun',_0xf273('0x4'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf273('0x5')]},'password':{'type':Sequelize[_0xf273('0x5')]}}; \ No newline at end of file +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 diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index b3a7c65..1c1b161 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 _0x8fe8=['writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','render','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','status','end','json','offset','limit','undefined','count','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','Network','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','includeAll','catch','show','params','rawAttributes','options','find','create','sequelize','transaction','body','findAll','toUpperCase','STUN','readFileSync','join','root','utf8'];(function(_0x496282,_0x2e7e60){var _0x513e64=function(_0xe739e4){while(--_0xe739e4){_0x496282['push'](_0x496282['shift']());}};_0x513e64(++_0x2e7e60);}(_0x8fe8,0x1b6));var _0x88fe=function(_0x17de95,_0x532be5){_0x17de95=_0x17de95-0x0;var _0xcd5431=_0x8fe8[_0x17de95];return _0xcd5431;};'use strict';var emlformat=require(_0x88fe('0x0'));var rimraf=require(_0x88fe('0x1'));var zipdir=require(_0x88fe('0x2'));var jsonpatch=require(_0x88fe('0x3'));var rp=require('request-promise');var moment=require(_0x88fe('0x4'));var BPromise=require(_0x88fe('0x5'));var Mustache=require(_0x88fe('0x6'));var util=require(_0x88fe('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x88fe('0x8'));var ejs=require(_0x88fe('0x9'));var fs=require('fs');var fs_extra=require(_0x88fe('0xa'));var _=require(_0x88fe('0xb'));var squel=require('squel');var crypto=require(_0x88fe('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x88fe('0xd'));var toCsv=require(_0x88fe('0x8'));var querystring=require(_0x88fe('0xe'));var Papa=require(_0x88fe('0xf'));var Redis=require(_0x88fe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x88fe('0x11'));var as=require(_0x88fe('0x12'));var hardwareService=require(_0x88fe('0x13'));var logger=require(_0x88fe('0x14'))('api');var utils=require(_0x88fe('0x15'));var config=require(_0x88fe('0x16'));var licenseUtil=require(_0x88fe('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x88fe('0x18'));var client=jayson[_0x88fe('0x19')][_0x88fe('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x39d462,_0x3b5549,_0x181b34,_0x5003ef){return new BPromise(function(_0x3ab4de,_0x5aa74e){var _0x1d53fc=_0x5003ef||client;return _0x1d53fc[_0x88fe('0x1b')](_0x39d462,_0x181b34)[_0x88fe('0x1c')](function(_0x3a7a73){logger['info'](_0x88fe('0x1d'),_0x3b5549,'request\x20sent');logger[_0x88fe('0x1e')](_0x88fe('0x1f'),_0x3b5549,_0x88fe('0x20'),JSON['stringify'](_0x3a7a73));if(_0x3a7a73[_0x88fe('0x21')]){if(_0x3a7a73['error']['code']===0x1f4){logger['error'](_0x88fe('0x1d'),_0x3b5549,_0x3a7a73[_0x88fe('0x21')][_0x88fe('0x22')]);return _0x5aa74e(_0x3a7a73['error']['message']);}logger[_0x88fe('0x21')](_0x88fe('0x1d'),_0x3b5549,_0x3a7a73['error'][_0x88fe('0x22')]);return _0x3ab4de(_0x3a7a73[_0x88fe('0x21')][_0x88fe('0x22')]);}else{logger[_0x88fe('0x23')](_0x88fe('0x1d'),_0x3b5549,_0x88fe('0x20'));_0x3ab4de(_0x3a7a73[_0x88fe('0x24')][_0x88fe('0x22')]);}})['catch'](function(_0x222828){logger[_0x88fe('0x21')](_0x88fe('0x1d'),_0x3b5549,_0x222828);_0x5aa74e(_0x222828);});});}function respondWithStatusCode(_0x230769,_0x40dc1d){_0x40dc1d=_0x40dc1d||0xcc;return function(_0x8ddcd6){if(_0x8ddcd6){return _0x230769['sendStatus'](_0x40dc1d);}return _0x230769[_0x88fe('0x25')](_0x40dc1d)[_0x88fe('0x26')]();};}function respondWithResult(_0x400267,_0xed01ef){_0xed01ef=_0xed01ef||0xc8;return function(_0x28b931){if(_0x28b931){return _0x400267[_0x88fe('0x25')](_0xed01ef)[_0x88fe('0x27')](_0x28b931);}};}function respondWithFilteredResult(_0x3c0d63,_0x31c887){return function(_0x3080db){if(_0x3080db){var _0x2795e8=typeof _0x31c887[_0x88fe('0x28')]==='undefined'&&typeof _0x31c887[_0x88fe('0x29')]===_0x88fe('0x2a');var _0x4e047e=_0x3080db['count'];var _0x400140=_0x2795e8?0x0:_0x31c887[_0x88fe('0x28')];var _0x4e40f5=_0x2795e8?_0x3080db[_0x88fe('0x2b')]:_0x31c887[_0x88fe('0x28')]+_0x31c887[_0x88fe('0x29')];var _0x3ae77c;if(_0x4e40f5>=_0x4e047e){_0x4e40f5=_0x4e047e;_0x3ae77c=0xc8;}else{_0x3ae77c=0xce;}_0x3c0d63['status'](_0x3ae77c);return _0x3c0d63['set']('Content-Range',_0x400140+'-'+_0x4e40f5+'/'+_0x4e047e)[_0x88fe('0x27')](_0x3080db);}return null;};}function patchUpdates(_0x5e4d24){return function(_0x59640c){try{jsonpatch[_0x88fe('0x2c')](_0x59640c,_0x5e4d24,!![]);}catch(_0x38175d){return BPromise[_0x88fe('0x2d')](_0x38175d);}return _0x59640c[_0x88fe('0x2e')]();};}function saveUpdates(_0x440add,_0x987cbc){return function(_0x530f6a){if(_0x530f6a){return _0x530f6a['update'](_0x440add)[_0x88fe('0x1c')](function(_0x2fa98e){return _0x2fa98e;});}return null;};}function removeEntity(_0x339ae6,_0x1ad61e){return function(_0x263b97){if(_0x263b97){return _0x263b97[_0x88fe('0x2f')]()['then'](function(){_0x339ae6['status'](0xcc)[_0x88fe('0x26')]();});}};}function handleEntityNotFound(_0x588cb5,_0xea02b8){return function(_0x592135){if(!_0x592135){_0x588cb5[_0x88fe('0x30')](0x194);}return _0x592135;};}function handleError(_0xf67d8,_0x4393cf){_0x4393cf=_0x4393cf||0x1f4;return function(_0x22a9f2){logger[_0x88fe('0x21')](_0x22a9f2[_0x88fe('0x31')]);if(_0x22a9f2[_0x88fe('0x32')]){delete _0x22a9f2['name'];}_0xf67d8[_0x88fe('0x25')](_0x4393cf)[_0x88fe('0x33')](_0x22a9f2);};}exports[_0x88fe('0x34')]=function(_0xb7b38,_0x457164){var _0x246538={},_0x29741a={},_0x221727={'count':0x0,'rows':[]};var _0x253589=_[_0x88fe('0x35')](db[_0x88fe('0x36')]['rawAttributes'],function(_0x4f0416){return{'name':_0x4f0416[_0x88fe('0x37')],'type':_0x4f0416['type'][_0x88fe('0x38')]};});_0x29741a[_0x88fe('0x39')]=_[_0x88fe('0x35')](_0x253589,_0x88fe('0x32'));_0x29741a[_0x88fe('0x3a')]=_[_0x88fe('0x3b')](_0xb7b38['query']);_0x29741a[_0x88fe('0x3c')]=_[_0x88fe('0x3d')](_0x29741a['model'],_0x29741a[_0x88fe('0x3a')]);_0x246538[_0x88fe('0x3e')]=_[_0x88fe('0x3d')](_0x29741a[_0x88fe('0x39')],qs[_0x88fe('0x3f')](_0xb7b38[_0x88fe('0x3a')]['fields']));_0x246538['attributes']=_0x246538['attributes'][_0x88fe('0x40')]?_0x246538['attributes']:_0x29741a[_0x88fe('0x39')];if(!_0xb7b38[_0x88fe('0x3a')][_0x88fe('0x41')](_0x88fe('0x42'))){_0x246538[_0x88fe('0x29')]=qs['limit'](_0xb7b38['query'][_0x88fe('0x29')]);_0x246538['offset']=qs[_0x88fe('0x28')](_0xb7b38['query'][_0x88fe('0x28')]);}_0x246538[_0x88fe('0x43')]=qs[_0x88fe('0x44')](_0xb7b38[_0x88fe('0x3a')][_0x88fe('0x44')]);_0x246538['where']=qs[_0x88fe('0x3c')](_['pick'](_0xb7b38[_0x88fe('0x3a')],_0x29741a['filters']),_0x253589);if(_0xb7b38['query'][_0x88fe('0x45')]){_0x246538[_0x88fe('0x46')]=_[_0x88fe('0x47')](_0x246538[_0x88fe('0x46')],{'$or':_[_0x88fe('0x35')](_0x253589,function(_0x7c22){if(_0x7c22[_0x88fe('0x48')]!==_0x88fe('0x49')){var _0x155efc={};_0x155efc[_0x7c22[_0x88fe('0x32')]]={'$like':'%'+_0xb7b38[_0x88fe('0x3a')]['filter']+'%'};return _0x155efc;}})});}_0x246538=_['merge']({},_0x246538,_0xb7b38['options']);var _0x32dc06={'where':_0x246538['where']};return db[_0x88fe('0x36')]['count'](_0x32dc06)[_0x88fe('0x1c')](function(_0x5dc5c8){_0x221727['count']=_0x5dc5c8;if(_0xb7b38[_0x88fe('0x3a')][_0x88fe('0x4a')]){_0x246538['include']=[{'all':!![]}];}return db[_0x88fe('0x36')]['findAll'](_0x246538);})[_0x88fe('0x1c')](function(_0x2de513){_0x221727['rows']=_0x2de513;return _0x221727;})[_0x88fe('0x1c')](respondWithFilteredResult(_0x457164,_0x246538))[_0x88fe('0x4b')](handleError(_0x457164,null));};exports[_0x88fe('0x4c')]=function(_0x2ad9c2,_0x397b24){var _0x40648a={'raw':!![],'where':{'id':_0x2ad9c2[_0x88fe('0x4d')]['id']}},_0x36984a={};_0x36984a[_0x88fe('0x39')]=_[_0x88fe('0x3b')](db[_0x88fe('0x36')][_0x88fe('0x4e')]);_0x36984a['query']=_[_0x88fe('0x3b')](_0x2ad9c2[_0x88fe('0x3a')]);_0x36984a[_0x88fe('0x3c')]=_[_0x88fe('0x3d')](_0x36984a[_0x88fe('0x39')],_0x36984a['query']);_0x40648a['attributes']=_[_0x88fe('0x3d')](_0x36984a['model'],qs[_0x88fe('0x3f')](_0x2ad9c2[_0x88fe('0x3a')][_0x88fe('0x3f')]));_0x40648a[_0x88fe('0x3e')]=_0x40648a[_0x88fe('0x3e')][_0x88fe('0x40')]?_0x40648a[_0x88fe('0x3e')]:_0x36984a['model'];if(_0x2ad9c2[_0x88fe('0x3a')][_0x88fe('0x4a')]){_0x40648a['include']=[{'all':!![]}];}_0x40648a=_[_0x88fe('0x47')]({},_0x40648a,_0x2ad9c2[_0x88fe('0x4f')]);return db[_0x88fe('0x36')][_0x88fe('0x50')](_0x40648a)[_0x88fe('0x1c')](handleEntityNotFound(_0x397b24,null))[_0x88fe('0x1c')](respondWithResult(_0x397b24,null))[_0x88fe('0x4b')](handleError(_0x397b24,null));};exports[_0x88fe('0x51')]=function(_0x527415,_0x5c3a73,_0x3c9467){var _0x18320f;return db[_0x88fe('0x52')][_0x88fe('0x53')](function(_0x20867b){return db[_0x88fe('0x36')][_0x88fe('0x51')](_0x527415[_0x88fe('0x54')],{'raw':!![]})[_0x88fe('0x1c')](function(_0x22dbf4){_0x18320f=_0x22dbf4;return db['Network'][_0x88fe('0x55')]({'where':{'type':_0x527415[_0x88fe('0x54')][_0x88fe('0x48')]},'raw':!![]});})[_0x88fe('0x1c')](function(_0x5a861a){if(_0x18320f[_0x88fe('0x48')][_0x88fe('0x56')]()==_0x88fe('0x57')){var _0x45b6c1=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],'server/files/templates/stun_multiple.ejs'),_0x88fe('0x5b'));var _0x2346cc=ejs['render'](_0x45b6c1,{'networks':_0x5a861a||[]});fs[_0x88fe('0x5c')](_0x88fe('0x5d'),_0x2346cc);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x51'),{'module':'res_stun_monitor.so'});}else if(_0x18320f[_0x88fe('0x48')][_0x88fe('0x56')]()==_0x88fe('0x5f')){var _0x53ba95=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],_0x88fe('0x60')),_0x88fe('0x5b'));var _0x3d9fc4=ejs[_0x88fe('0x61')](_0x53ba95,{'networks':_0x5a861a||[]});fs[_0x88fe('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x3d9fc4);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x51'),{'module':_0x88fe('0x62')});}else{var _0x40767c=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config['root'],'server/files/templates/network.ejs'),_0x88fe('0x5b'));var _0x4871cb=ejs[_0x88fe('0x61')](_0x40767c,{'networks':_0x5a861a||[]});fs[_0x88fe('0x5c')](util[_0x88fe('0x63')](_0x88fe('0x64'),_0x527415[_0x88fe('0x54')][_0x88fe('0x48')][_0x88fe('0x65')]()),_0x4871cb);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x51'),{'module':_0x88fe('0x66')});}return null;})[_0x88fe('0x1c')](function(){return _0x18320f;});})[_0x88fe('0x1c')](respondWithResult(_0x5c3a73,0xc9))['catch'](handleError(_0x5c3a73,null));};exports['update']=function(_0x1af77b,_0x46781f,_0x4d6bab){var _0x13a8f8;return db[_0x88fe('0x52')][_0x88fe('0x53')](function(_0x2302dc){return db[_0x88fe('0x36')][_0x88fe('0x50')]({'where':{'id':_0x1af77b[_0x88fe('0x4d')]['id']}})[_0x88fe('0x1c')](handleEntityNotFound(_0x46781f,null))[_0x88fe('0x1c')](saveUpdates(_0x1af77b[_0x88fe('0x54')],null))[_0x88fe('0x1c')](function(_0xdedb98){if(_0xdedb98){_0x13a8f8=_0xdedb98;return db[_0x88fe('0x36')][_0x88fe('0x55')]({'where':{'type':_0x13a8f8[_0x88fe('0x48')]},'raw':!![]});}return null;})[_0x88fe('0x1c')](function(_0x3462ac){if(_0x13a8f8[_0x88fe('0x48')][_0x88fe('0x56')]()==_0x88fe('0x57')){var _0x35b44e=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],'server/files/templates/stun_multiple.ejs'),_0x88fe('0x5b'));var _0x14d0b1=ejs['render'](_0x35b44e,{'networks':_0x3462ac||[]});fs['writeFileSync'](_0x88fe('0x5d'),_0x14d0b1);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x67'),{'module':_0x88fe('0x62')});}else if(_0x13a8f8[_0x88fe('0x48')][_0x88fe('0x56')]()=='TURN'){var _0x15a314=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x11a73b=ejs[_0x88fe('0x61')](_0x15a314,{'networks':_0x3462ac||[]});fs[_0x88fe('0x5c')](_0x88fe('0x68'),_0x11a73b);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x67'),{'module':_0x88fe('0x62')});}else{var _0x3b22d8=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],'server/files/templates/network.ejs'),'utf8');var _0x3ee9ef=ejs[_0x88fe('0x61')](_0x3b22d8,{'networks':_0x3462ac||[]});fs[_0x88fe('0x5c')](util[_0x88fe('0x63')](_0x88fe('0x64'),_0x1af77b[_0x88fe('0x54')][_0x88fe('0x48')][_0x88fe('0x65')]()),_0x3ee9ef);return respondWithRpcPromise('Reload',_0x88fe('0x67'),{'module':_0x88fe('0x66')});}return null;})[_0x88fe('0x1c')](function(_0x585cab){if(_0x585cab){return _0x13a8f8;}return null;});})[_0x88fe('0x1c')](respondWithResult(_0x46781f,null))[_0x88fe('0x4b')](handleError(_0x46781f,null));};exports['destroy']=function(_0x18b1ca,_0x437bb7,_0x143b5f){var _0x4403e1;return db['Network']['find']({'where':{'id':_0x18b1ca[_0x88fe('0x4d')]['id']}})[_0x88fe('0x1c')](function(_0xfd0442){_0x4403e1=_0xfd0442;return _0xfd0442;})['then'](handleEntityNotFound(_0x437bb7,null))[_0x88fe('0x1c')](removeEntity(_0x437bb7,null))[_0x88fe('0x1c')](function(){if(_0x4403e1){return db['Network'][_0x88fe('0x55')]({'where':{'type':_0x4403e1[_0x88fe('0x48')]},'raw':!![]});}})[_0x88fe('0x1c')](function(_0x44c56d){if(_0x4403e1[_0x88fe('0x48')]['toUpperCase']()==_0x88fe('0x57')){var _0x4b2d55=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],'server/files/templates/stun_multiple.ejs'),_0x88fe('0x5b'));var _0x131100=ejs[_0x88fe('0x61')](_0x4b2d55,{'networks':_0x44c56d||[]});fs[_0x88fe('0x5c')](_0x88fe('0x5d'),_0x131100);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x2f'),{'module':_0x88fe('0x62')});}else if(_0x4403e1[_0x88fe('0x48')][_0x88fe('0x56')]()=='TURN'){var _0x4d06e6=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],'server/files/templates/turn_multiple.ejs'),_0x88fe('0x5b'));var _0x3455d0=ejs[_0x88fe('0x61')](_0x4d06e6,{'networks':_0x44c56d||[]});fs['writeFileSync'](_0x88fe('0x68'),_0x3455d0);return respondWithRpcPromise('Reload',_0x88fe('0x2f'),{'module':_0x88fe('0x62')});}else{var _0x3e0c84=fs[_0x88fe('0x58')](path[_0x88fe('0x59')](config[_0x88fe('0x5a')],_0x88fe('0x69')),_0x88fe('0x5b'));var _0x1502c3=ejs[_0x88fe('0x61')](_0x3e0c84,{'networks':_0x44c56d||[]});fs[_0x88fe('0x5c')](util[_0x88fe('0x63')](_0x88fe('0x64'),_0x18b1ca[_0x88fe('0x54')][_0x88fe('0x48')][_0x88fe('0x65')]()),_0x1502c3);return respondWithRpcPromise(_0x88fe('0x5e'),_0x88fe('0x2f'),{'module':_0x88fe('0x66')});}return null;})['catch'](handleError(_0x437bb7,null));}; \ No newline at end of file +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 diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index a41f5cb..6e0c204 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 _0xe644=['path','rimraf','../../config/environment','./network.attributes','exports','define','Network','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x52fec5,_0x58e1dd){var _0xaba177=function(_0x1eaa0e){while(--_0x1eaa0e){_0x52fec5['push'](_0x52fec5['shift']());}};_0xaba177(++_0x58e1dd);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var logger=require(_0x4e64('0x2'))(_0x4e64('0x3'));var moment=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e64('0x6'));var rimraf=require(_0x4e64('0x7'));var config=require(_0x4e64('0x8'));var attributes=require(_0x4e64('0x9'));module[_0x4e64('0xa')]=function(_0x13fa90,_0x55c23b){return _0x13fa90[_0x4e64('0xb')](_0x4e64('0xc'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 988e8d4..0e03b03 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x18e5c7,_0x392a80){var _0x55f2f0=function(_0x37b377){while(--_0x37b377){_0x18e5c7['push'](_0x18e5c7['shift']());}};_0x55f2f0(++_0x392a80);}(_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 moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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 diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 57f0265..9f6b984 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 _0xdef6=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x31b264,_0x172a83){var _0x3556ca=function(_0x3bc4ff){while(--_0x3bc4ff){_0x31b264['push'](_0x31b264['shift']());}};_0x3556ca(++_0x172a83);}(_0xdef6,0xd7));var _0x6def=function(_0x481657,_0x3f66e4){_0x481657=_0x481657-0x0;var _0x2e5568=_0xdef6[_0x481657];return _0x2e5568;};'use strict';var multer=require(_0x6def('0x0'));var util=require(_0x6def('0x1'));var path=require(_0x6def('0x2'));var timeout=require(_0x6def('0x3'));var express=require(_0x6def('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(_0x6def('0x5'));var controller=require(_0x6def('0x6'));router[_0x6def('0x7')]('/',auth[_0x6def('0x8')](),controller[_0x6def('0x9')]);router['get'](_0x6def('0xa'),auth[_0x6def('0x8')](),controller['describe']);router[_0x6def('0x7')](_0x6def('0xb'),auth['isAuthenticated'](),controller[_0x6def('0xc')]);router[_0x6def('0x7')](_0x6def('0xd'),auth['isAuthenticated'](),controller[_0x6def('0xe')]);router[_0x6def('0x7')](_0x6def('0xf'),auth[_0x6def('0x8')](),controller[_0x6def('0x10')]);router[_0x6def('0x7')](_0x6def('0x11'),auth[_0x6def('0x8')](),controller[_0x6def('0x12')]);router[_0x6def('0x7')](_0x6def('0x13'),auth[_0x6def('0x8')](),controller[_0x6def('0x14')]);router[_0x6def('0x7')](_0x6def('0x15'),auth[_0x6def('0x8')](),controller[_0x6def('0x16')]);router[_0x6def('0x17')]('/',auth['isAuthenticated'](),controller[_0x6def('0x18')]);router[_0x6def('0x17')](_0x6def('0xd'),auth[_0x6def('0x8')](),controller[_0x6def('0x19')]);router[_0x6def('0x17')]('/:id/canned_answers',auth[_0x6def('0x8')](),controller[_0x6def('0x1a')]);router[_0x6def('0x17')](_0x6def('0x1b'),controller[_0x6def('0x1c')]);router['post'](_0x6def('0x11'),auth['isAuthenticated'](),controller[_0x6def('0x1d')]);router[_0x6def('0x17')](_0x6def('0x15'),auth[_0x6def('0x8')](),controller['addAgents']);router[_0x6def('0x17')](_0x6def('0x1e'),auth[_0x6def('0x8')](),controller[_0x6def('0x1f')]);router['put']('/:id',auth[_0x6def('0x8')](),controller[_0x6def('0x20')]);router[_0x6def('0x21')]('/:id',auth[_0x6def('0x8')](),controller[_0x6def('0x22')]);router['delete'](_0x6def('0xd'),auth[_0x6def('0x8')](),controller[_0x6def('0x23')]);router[_0x6def('0x21')](_0x6def('0xf'),auth[_0x6def('0x8')](),controller[_0x6def('0x24')]);router['delete'](_0x6def('0x15'),auth[_0x6def('0x8')](),controller[_0x6def('0x25')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 427bbd2..9f06557 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 _0x6630=['mandatoryDisposition','sequelize','randomstring','exports','STRING','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue'];(function(_0x3334bb,_0x54d6c1){var _0x3ccd2f=function(_0x3e7702){while(--_0x3e7702){_0x3334bb['push'](_0x3334bb['shift']());}};_0x3ccd2f(++_0x54d6c1);}(_0x6630,0x114));var _0x0663=function(_0x3e2b07,_0x9750f1){_0x3e2b07=_0x3e2b07-0x0;var _0x1b3c2e=_0x6630[_0x3e2b07];return _0x1b3c2e;};'use strict';var Sequelize=require(_0x0663('0x0'));var rs=require(_0x0663('0x1'));module[_0x0663('0x2')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0663('0x3')]},'token':{'type':Sequelize[_0x0663('0x3')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x0663('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x0663('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x0663('0x4')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0663('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0663('0x3')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0663('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0663('0x5')],'allowNull':!![],'defaultValue':null,'comment':_0x0663('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x0663('0x4')],'defaultValue':![],'comment':_0x0663('0x7'),'set':function(_0x536a5d){if(!_0x536a5d)this['setDataValue'](_0x0663('0x8'),null);this[_0x0663('0x9')](_0x0663('0xa'),_0x536a5d);}}}; \ No newline at end of file +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 diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index f6c0af4..8d817a1 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 _0xac4e=['messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','addApplications','sequelize','transaction','findAndCountAll','getApplications','hasOwnProperty','getInteractions','Contact','Owner','internal','Tag','Tags','color','tag','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','eml-format','zip-dir','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','sendStatus','status','end','json','limit','undefined','count','apply','reject','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','options','OpenchannelAccount','include','findAll','rows','catch','show','params','Pause','keys','filters','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','OpenchannelAccountId','getDispositions','findOne','Disposition','filter','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','openchannel','CmContact','describe','ValidationError','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','account','applications','list','List','priority','asc','Applications','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread'];(function(_0x3d0671,_0x4679a7){var _0x374f80=function(_0x568c02){while(--_0x568c02){_0x3d0671['push'](_0x3d0671['shift']());}};_0x374f80(++_0x4679a7);}(_0xac4e,0x19d));var _0xeac4=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xac4e[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require(_0xeac4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeac4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xeac4('0x2'));var moment=require('moment');var BPromise=require(_0xeac4('0x3'));var Mustache=require('mustache');var util=require(_0xeac4('0x4'));var path=require(_0xeac4('0x5'));var sox=require('sox');var csv=require(_0xeac4('0x6'));var ejs=require(_0xeac4('0x7'));var fs=require('fs');var fs_extra=require(_0xeac4('0x8'));var _=require('lodash');var squel=require(_0xeac4('0x9'));var crypto=require('crypto');var jsforce=require(_0xeac4('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xeac4('0xb'));var Papa=require(_0xeac4('0xc'));var Redis=require('ioredis');var authService=require(_0xeac4('0xd'));var qs=require(_0xeac4('0xe'));var as=require(_0xeac4('0xf'));var hardwareService=require(_0xeac4('0x10'));var logger=require('../../config/logger')(_0xeac4('0x11'));var utils=require(_0xeac4('0x12'));var config=require(_0xeac4('0x13'));var licenseUtil=require(_0xeac4('0x14'));var db=require(_0xeac4('0x15'))['db'];config[_0xeac4('0x16')]=_[_0xeac4('0x17')](config[_0xeac4('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xeac4('0x16')]));require(_0xeac4('0x18'))[_0xeac4('0x19')](socket);var jayson=require(_0xeac4('0x1a'));var client=jayson['client'][_0xeac4('0x1b')]({'port':0x232c});var client9002=jayson[_0xeac4('0x1c')][_0xeac4('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1deb83,_0x4cc657,_0xa4f2f7,_0x26e37d){return new BPromise(function(_0x800353,_0x4dc2f0){var _0x31db8c=_0x26e37d||client;return _0x31db8c[_0xeac4('0x1d')](_0x1deb83,_0xa4f2f7)[_0xeac4('0x1e')](function(_0x409a92){logger['info'](_0xeac4('0x1f'),_0x4cc657,_0xeac4('0x20'));logger[_0xeac4('0x21')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4cc657,_0xeac4('0x20'),JSON[_0xeac4('0x22')](_0x409a92));if(_0x409a92[_0xeac4('0x23')]){if(_0x409a92['error'][_0xeac4('0x24')]===0x1f4){logger[_0xeac4('0x23')](_0xeac4('0x1f'),_0x4cc657,_0x409a92[_0xeac4('0x23')][_0xeac4('0x25')]);return _0x4dc2f0(_0x409a92['error'][_0xeac4('0x25')]);}logger['error'](_0xeac4('0x1f'),_0x4cc657,_0x409a92[_0xeac4('0x23')]['message']);return _0x800353(_0x409a92[_0xeac4('0x23')][_0xeac4('0x25')]);}else{logger[_0xeac4('0x26')](_0xeac4('0x1f'),_0x4cc657,_0xeac4('0x20'));_0x800353(_0x409a92['result'][_0xeac4('0x25')]);}})['catch'](function(_0x1b99b7){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x4cc657,_0x1b99b7);_0x4dc2f0(_0x1b99b7);});});}function respondWithStatusCode(_0x288e4b,_0x172825){_0x172825=_0x172825||0xcc;return function(_0x2bbb5b){if(_0x2bbb5b){return _0x288e4b[_0xeac4('0x27')](_0x172825);}return _0x288e4b[_0xeac4('0x28')](_0x172825)[_0xeac4('0x29')]();};}function respondWithResult(_0x3c1a0e,_0x477752){_0x477752=_0x477752||0xc8;return function(_0x98fd70){if(_0x98fd70){return _0x3c1a0e[_0xeac4('0x28')](_0x477752)[_0xeac4('0x2a')](_0x98fd70);}};}function respondWithFilteredResult(_0x21df31,_0x463740){return function(_0x67de24){if(_0x67de24){var _0x4dcfb1=typeof _0x463740['offset']==='undefined'&&typeof _0x463740[_0xeac4('0x2b')]===_0xeac4('0x2c');var _0x194265=_0x67de24[_0xeac4('0x2d')];var _0x2829b1=_0x4dcfb1?0x0:_0x463740['offset'];var _0x5bb1ac=_0x4dcfb1?_0x67de24[_0xeac4('0x2d')]:_0x463740['offset']+_0x463740[_0xeac4('0x2b')];var _0x8ebf45;if(_0x5bb1ac>=_0x194265){_0x5bb1ac=_0x194265;_0x8ebf45=0xc8;}else{_0x8ebf45=0xce;}_0x21df31[_0xeac4('0x28')](_0x8ebf45);return _0x21df31['set']('Content-Range',_0x2829b1+'-'+_0x5bb1ac+'/'+_0x194265)[_0xeac4('0x2a')](_0x67de24);}return null;};}function patchUpdates(_0x80d7b8){return function(_0x506947){try{jsonpatch[_0xeac4('0x2e')](_0x506947,_0x80d7b8,!![]);}catch(_0x3b7e62){return BPromise[_0xeac4('0x2f')](_0x3b7e62);}return _0x506947['save']();};}function saveUpdates(_0x9a7a51,_0x5b5c6d){return function(_0x9f1a76){if(_0x9f1a76){return _0x9f1a76[_0xeac4('0x30')](_0x9a7a51)['then'](function(_0x1b9691){return _0x1b9691;});}return null;};}function removeEntity(_0x2bfe68,_0x2f6bbb){return function(_0x35fffe){if(_0x35fffe){return _0x35fffe[_0xeac4('0x31')]()[_0xeac4('0x1e')](function(){var _0x1cf59c=_0x35fffe[_0xeac4('0x32')]({'plain':!![]});var _0x403445=_0xeac4('0x33');return db[_0xeac4('0x34')][_0xeac4('0x31')]({'where':{'type':_0x403445,'resourceId':_0x1cf59c['id']}})['then'](function(){return _0x35fffe;});})[_0xeac4('0x1e')](function(){_0x2bfe68[_0xeac4('0x28')](0xcc)[_0xeac4('0x29')]();});}};}function handleEntityNotFound(_0x2e6d0d,_0x2df0c6){return function(_0x1aa46a){if(!_0x1aa46a){_0x2e6d0d[_0xeac4('0x27')](0x194);}return _0x1aa46a;};}function handleError(_0x1231cc,_0x2c7706){_0x2c7706=_0x2c7706||0x1f4;return function(_0x33a907){logger[_0xeac4('0x23')](_0x33a907[_0xeac4('0x35')]);if(_0x33a907[_0xeac4('0x36')]){delete _0x33a907[_0xeac4('0x36')];}_0x1231cc[_0xeac4('0x28')](_0x2c7706)[_0xeac4('0x37')](_0x33a907);};}exports[_0xeac4('0x38')]=function(_0xb967a,_0x322018){var _0x453fca={'include':[{'model':db['Pause'],'as':_0xeac4('0x39')}]},_0x4e5786={},_0x499c05={'count':0x0,'rows':[]};var _0x26fe57=_['map'](db['OpenchannelAccount'][_0xeac4('0x3a')],function(_0xc3318e){return{'name':_0xc3318e[_0xeac4('0x3b')],'type':_0xc3318e[_0xeac4('0x3c')][_0xeac4('0x3d')]};});_0x4e5786['model']=_[_0xeac4('0x3e')](_0x26fe57,'name');_0x4e5786[_0xeac4('0x3f')]=_['keys'](_0xb967a[_0xeac4('0x3f')]);_0x4e5786['filters']=_[_0xeac4('0x40')](_0x4e5786[_0xeac4('0x41')],_0x4e5786['query']);_0x453fca[_0xeac4('0x42')]=_[_0xeac4('0x40')](_0x4e5786['model'],qs[_0xeac4('0x43')](_0xb967a['query']['fields']));_0x453fca[_0xeac4('0x42')]=_0x453fca['attributes'][_0xeac4('0x44')]?_0x453fca[_0xeac4('0x42')]:_0x4e5786['model'];if(!_0xb967a['query']['hasOwnProperty'](_0xeac4('0x45'))){_0x453fca[_0xeac4('0x2b')]=qs['limit'](_0xb967a[_0xeac4('0x3f')]['limit']);_0x453fca['offset']=qs[_0xeac4('0x46')](_0xb967a['query'][_0xeac4('0x46')]);}_0x453fca[_0xeac4('0x47')]=qs[_0xeac4('0x48')](_0xb967a['query']['sort']);_0x453fca[_0xeac4('0x49')]=qs['filters'](_[_0xeac4('0x4a')](_0xb967a[_0xeac4('0x3f')],_0x4e5786['filters']),_0x26fe57);if(_0xb967a[_0xeac4('0x3f')]['filter']){_0x453fca[_0xeac4('0x49')]=_[_0xeac4('0x4b')](_0x453fca[_0xeac4('0x49')],{'$or':_[_0xeac4('0x3e')](_0x26fe57,function(_0x2f654a){if(_0x2f654a['type']!==_0xeac4('0x4c')){var _0x4e8e2e={};_0x4e8e2e[_0x2f654a['name']]={'$like':'%'+_0xb967a['query']['filter']+'%'};return _0x4e8e2e;}})});}_0x453fca=_['merge']({},_0x453fca,_0xb967a[_0xeac4('0x4d')]);var _0xe383fe={'where':_0x453fca[_0xeac4('0x49')]};return db[_0xeac4('0x4e')]['count'](_0xe383fe)[_0xeac4('0x1e')](function(_0x478a81){_0x499c05[_0xeac4('0x2d')]=_0x478a81;if(_0xb967a[_0xeac4('0x3f')]['includeAll']){_0x453fca[_0xeac4('0x4f')]=[{'all':!![]}];}return db[_0xeac4('0x4e')][_0xeac4('0x50')](_0x453fca);})[_0xeac4('0x1e')](function(_0x211111){_0x499c05[_0xeac4('0x51')]=_0x211111;return _0x499c05;})[_0xeac4('0x1e')](respondWithFilteredResult(_0x322018,_0x453fca))[_0xeac4('0x52')](handleError(_0x322018,null));};exports[_0xeac4('0x53')]=function(_0x78bbc2,_0x26542c){var _0x454045={'raw':![],'where':{'id':_0x78bbc2[_0xeac4('0x54')]['id']},'include':[{'model':db[_0xeac4('0x55')],'as':'mandatoryDispositionPause'}]},_0x333dcb={};_0x333dcb[_0xeac4('0x41')]=_[_0xeac4('0x56')](db[_0xeac4('0x4e')][_0xeac4('0x3a')]);_0x333dcb[_0xeac4('0x3f')]=_['keys'](_0x78bbc2['query']);_0x333dcb[_0xeac4('0x57')]=_[_0xeac4('0x40')](_0x333dcb['model'],_0x333dcb[_0xeac4('0x3f')]);_0x454045['attributes']=_[_0xeac4('0x40')](_0x333dcb[_0xeac4('0x41')],qs[_0xeac4('0x43')](_0x78bbc2[_0xeac4('0x3f')][_0xeac4('0x43')]));_0x454045['attributes']=_0x454045['attributes'][_0xeac4('0x44')]?_0x454045[_0xeac4('0x42')]:_0x333dcb['model'];if(_0x78bbc2['query'][_0xeac4('0x58')]){_0x454045['include']=[{'all':!![]}];}_0x454045=_[_0xeac4('0x4b')]({},_0x454045,_0x78bbc2[_0xeac4('0x4d')]);return db[_0xeac4('0x4e')][_0xeac4('0x59')](_0x454045)['then'](handleEntityNotFound(_0x26542c,null))[_0xeac4('0x1e')](respondWithResult(_0x26542c,null))[_0xeac4('0x52')](handleError(_0x26542c,null));};exports[_0xeac4('0x5a')]=function(_0x6a0cfa,_0x24a04f){return db[_0xeac4('0x4e')][_0xeac4('0x5a')](_0x6a0cfa[_0xeac4('0x5b')],{})[_0xeac4('0x1e')](function(_0x49975e){var _0x112e70=_0x6a0cfa[_0xeac4('0x5c')][_0xeac4('0x32')]({'plain':!![]});if(!_0x112e70)throw new Error(_0xeac4('0x5d'));if(_0x112e70[_0xeac4('0x5e')]==='user'){var _0x29d37e=_0x49975e[_0xeac4('0x32')]({'plain':!![]});var _0x329df0=_0xeac4('0x33');return db['UserProfileSection'][_0xeac4('0x59')]({'where':{'name':_0x329df0,'userProfileId':_0x112e70[_0xeac4('0x5f')]},'raw':!![]})[_0xeac4('0x1e')](function(_0x24e285){if(_0x24e285&&_0x24e285[_0xeac4('0x60')]===0x0){return db[_0xeac4('0x34')][_0xeac4('0x5a')]({'name':_0x29d37e[_0xeac4('0x36')],'resourceId':_0x29d37e['id'],'type':_0x24e285['name'],'sectionId':_0x24e285['id']},{})[_0xeac4('0x1e')](function(){return _0x49975e;});}else{return _0x49975e;}})[_0xeac4('0x52')](function(_0x1de2a0){logger[_0xeac4('0x23')](_0xeac4('0x61'),_0x1de2a0);throw _0x1de2a0;});}return _0x49975e;})[_0xeac4('0x1e')](respondWithResult(_0x24a04f,0xc9))[_0xeac4('0x52')](handleError(_0x24a04f,null));};exports[_0xeac4('0x30')]=function(_0x647a27,_0x2680da){if(_0x647a27['body']['id']){delete _0x647a27[_0xeac4('0x5b')]['id'];}return db[_0xeac4('0x4e')]['find']({'where':{'id':_0x647a27[_0xeac4('0x54')]['id']},'include':[{'model':db['Pause'],'as':_0xeac4('0x39')}]})[_0xeac4('0x1e')](handleEntityNotFound(_0x2680da,null))['then'](saveUpdates(_0x647a27[_0xeac4('0x5b')],null))[_0xeac4('0x1e')](respondWithResult(_0x2680da,null))[_0xeac4('0x52')](handleError(_0x2680da,null));};exports[_0xeac4('0x31')]=function(_0x58b777,_0x319deb){return db['OpenchannelAccount'][_0xeac4('0x59')]({'where':{'id':_0x58b777[_0xeac4('0x54')]['id']}})['then'](handleEntityNotFound(_0x319deb,null))[_0xeac4('0x1e')](removeEntity(_0x319deb,null))[_0xeac4('0x52')](handleError(_0x319deb,null));};exports['describe']=function(_0x59ec4b,_0x54cc65){return db[_0xeac4('0x4e')]['describe']()['then'](respondWithResult(_0x54cc65,null))[_0xeac4('0x52')](handleError(_0x54cc65,null));};exports['addDisposition']=function(_0x5412bd,_0x456acc,_0x291583){if(_0x5412bd[_0xeac4('0x5b')]['id']){delete _0x5412bd['body']['id'];}return db[_0xeac4('0x4e')][_0xeac4('0x59')]({'where':{'id':_0x5412bd[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x456acc,null))['then'](function(_0x1384df){if(_0x1384df){_0x5412bd[_0xeac4('0x5b')][_0xeac4('0x62')]=_0x1384df['id'];return db['Disposition'][_0xeac4('0x5a')](_0x5412bd[_0xeac4('0x5b')]);}})[_0xeac4('0x1e')](respondWithResult(_0x456acc,null))[_0xeac4('0x52')](handleError(_0x456acc,null));};exports[_0xeac4('0x63')]=function(_0x3bc91f,_0x5458c1,_0x4ee5a6){var _0x50decd={'raw':![],'where':{}};var _0x548064={};var _0x364b5d={'count':0x0,'rows':[]};return db[_0xeac4('0x4e')][_0xeac4('0x64')]({'where':{'id':_0x3bc91f[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x5458c1,null))[_0xeac4('0x1e')](function(_0x340e6f){if(_0x340e6f){_0x548064['model']=_['keys'](db[_0xeac4('0x65')][_0xeac4('0x3a')]);_0x548064[_0xeac4('0x3f')]=_['keys'](_0x3bc91f[_0xeac4('0x3f')]);_0x548064['filters']=_[_0xeac4('0x40')](_0x548064['model'],_0x548064[_0xeac4('0x3f')]);_0x50decd['attributes']=_[_0xeac4('0x40')](_0x548064[_0xeac4('0x41')],qs[_0xeac4('0x43')](_0x3bc91f[_0xeac4('0x3f')][_0xeac4('0x43')]));_0x50decd[_0xeac4('0x42')]=_0x50decd[_0xeac4('0x42')]['length']?_0x50decd[_0xeac4('0x42')]:_0x548064[_0xeac4('0x41')];if(!_0x3bc91f[_0xeac4('0x3f')]['hasOwnProperty'](_0xeac4('0x45'))){_0x50decd['limit']=qs[_0xeac4('0x2b')](_0x3bc91f['query'][_0xeac4('0x2b')]);_0x50decd[_0xeac4('0x46')]=qs[_0xeac4('0x46')](_0x3bc91f['query'][_0xeac4('0x46')]);}_0x50decd['order']=qs[_0xeac4('0x48')](_0x3bc91f['query'][_0xeac4('0x48')]);_0x50decd['where']=qs['filters'](_[_0xeac4('0x4a')](_0x3bc91f[_0xeac4('0x3f')],_0x548064[_0xeac4('0x57')]));_0x50decd['where'][_0xeac4('0x62')]=_0x340e6f['id'];if(_0x3bc91f['query'][_0xeac4('0x66')]){_0x50decd[_0xeac4('0x49')]=_[_0xeac4('0x4b')](_0x50decd[_0xeac4('0x49')],{'$or':_['map'](_0x50decd[_0xeac4('0x42')],function(_0x5b7151){var _0x317fa6={};_0x317fa6[_0x5b7151]={'$like':'%'+_0x3bc91f[_0xeac4('0x3f')][_0xeac4('0x66')]+'%'};return _0x317fa6;})});}_0x50decd=_[_0xeac4('0x4b')]({},_0x50decd,_0x3bc91f[_0xeac4('0x4d')]);return db[_0xeac4('0x65')][_0xeac4('0x2d')]({'where':_0x50decd[_0xeac4('0x49')]})['then'](function(_0x52ba43){_0x364b5d['count']=_0x52ba43;if(_0x3bc91f['query'][_0xeac4('0x58')]){_0x50decd['include']=[{'all':!![]}];}return db[_0xeac4('0x65')][_0xeac4('0x50')](_0x50decd);})[_0xeac4('0x1e')](function(_0x1346a4){_0x364b5d['rows']=_0x1346a4;return _0x364b5d;});}})[_0xeac4('0x1e')](respondWithFilteredResult(_0x5458c1,_0x50decd))['catch'](handleError(_0x5458c1,null));};exports['removeDispositions']=function(_0x111392,_0x26c13e,_0x288596){return db['OpenchannelAccount'][_0xeac4('0x59')]({'where':{'id':_0x111392['params']['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x26c13e,null))[_0xeac4('0x1e')](function(_0x258d87){if(_0x258d87){return _0x258d87[_0xeac4('0x67')](_0x111392[_0xeac4('0x3f')][_0xeac4('0x68')]);}})[_0xeac4('0x1e')](respondWithStatusCode(_0x26c13e,null))[_0xeac4('0x52')](handleError(_0x26c13e,null));};exports['addAnswer']=function(_0x5dbe4d,_0x31e7df,_0x4affcf){if(_0x5dbe4d[_0xeac4('0x5b')]['id']){delete _0x5dbe4d[_0xeac4('0x5b')]['id'];}return db[_0xeac4('0x4e')][_0xeac4('0x59')]({'where':{'id':_0x5dbe4d[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x31e7df,null))['then'](function(_0x688f24){if(_0x688f24){_0x5dbe4d['body'][_0xeac4('0x62')]=_0x688f24['id'];return db[_0xeac4('0x69')][_0xeac4('0x5a')](_0x5dbe4d[_0xeac4('0x5b')]);}})[_0xeac4('0x1e')](respondWithResult(_0x31e7df,null))['catch'](handleError(_0x31e7df,null));};exports[_0xeac4('0x6a')]=function(_0x523125,_0x19b3a0,_0x14b128){var _0x65dd23={'raw':![],'where':{}};var _0x36d428={};var _0x155a9c={'count':0x0,'rows':[]};return db[_0xeac4('0x4e')][_0xeac4('0x64')]({'where':{'id':_0x523125['params']['id']}})['then'](handleEntityNotFound(_0x19b3a0,null))[_0xeac4('0x1e')](function(_0x4d1aff){if(_0x4d1aff){_0x36d428[_0xeac4('0x41')]=_[_0xeac4('0x56')](db['CannedAnswer']['rawAttributes']);_0x36d428[_0xeac4('0x3f')]=_[_0xeac4('0x56')](_0x523125[_0xeac4('0x3f')]);_0x36d428[_0xeac4('0x57')]=_[_0xeac4('0x40')](_0x36d428[_0xeac4('0x41')],_0x36d428[_0xeac4('0x3f')]);_0x65dd23[_0xeac4('0x42')]=_[_0xeac4('0x40')](_0x36d428[_0xeac4('0x41')],qs['fields'](_0x523125[_0xeac4('0x3f')][_0xeac4('0x43')]));_0x65dd23[_0xeac4('0x42')]=_0x65dd23[_0xeac4('0x42')]['length']?_0x65dd23[_0xeac4('0x42')]:_0x36d428[_0xeac4('0x41')];if(!_0x523125[_0xeac4('0x3f')]['hasOwnProperty'](_0xeac4('0x45'))){_0x65dd23[_0xeac4('0x2b')]=qs['limit'](_0x523125['query'][_0xeac4('0x2b')]);_0x65dd23['offset']=qs[_0xeac4('0x46')](_0x523125[_0xeac4('0x3f')][_0xeac4('0x46')]);}_0x65dd23['order']=qs[_0xeac4('0x48')](_0x523125[_0xeac4('0x3f')][_0xeac4('0x48')]);_0x65dd23['where']=qs['filters'](_[_0xeac4('0x4a')](_0x523125[_0xeac4('0x3f')],_0x36d428[_0xeac4('0x57')]));_0x65dd23[_0xeac4('0x49')][_0xeac4('0x62')]=_0x4d1aff['id'];if(_0x523125[_0xeac4('0x3f')][_0xeac4('0x66')]){_0x65dd23[_0xeac4('0x49')]=_[_0xeac4('0x4b')](_0x65dd23[_0xeac4('0x49')],{'$or':_[_0xeac4('0x3e')](_0x65dd23['attributes'],function(_0x2fc995){var _0x4436cc={};_0x4436cc[_0x2fc995]={'$like':'%'+_0x523125[_0xeac4('0x3f')][_0xeac4('0x66')]+'%'};return _0x4436cc;})});}_0x65dd23=_[_0xeac4('0x4b')]({},_0x65dd23,_0x523125[_0xeac4('0x4d')]);return db[_0xeac4('0x69')][_0xeac4('0x2d')]({'where':_0x65dd23[_0xeac4('0x49')]})['then'](function(_0x359e50){_0x155a9c[_0xeac4('0x2d')]=_0x359e50;if(_0x523125[_0xeac4('0x3f')]['includeAll']){_0x65dd23[_0xeac4('0x4f')]=[{'all':!![]}];}return db[_0xeac4('0x69')][_0xeac4('0x50')](_0x65dd23);})[_0xeac4('0x1e')](function(_0x4c2bf8){_0x155a9c[_0xeac4('0x51')]=_0x4c2bf8;return _0x155a9c;});}})[_0xeac4('0x1e')](respondWithFilteredResult(_0x19b3a0,_0x65dd23))[_0xeac4('0x52')](handleError(_0x19b3a0,null));};exports['removeAnswers']=function(_0xc2d2a6,_0xe9458,_0x1783b9){return db[_0xeac4('0x4e')]['find']({'where':{'id':_0xc2d2a6[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0xe9458,null))[_0xeac4('0x1e')](function(_0x1dbb47){if(_0x1dbb47){return _0x1dbb47[_0xeac4('0x6b')](_0xc2d2a6['query'][_0xeac4('0x68')]);}})['then'](respondWithStatusCode(_0xe9458,null))[_0xeac4('0x52')](handleError(_0xe9458,null));};exports['notify']=function(_0x114814,_0x5e1baf,_0x392c73){var _0x5b4e98={'body':_0x114814[_0xeac4('0x5b')],'channel':_0xeac4('0x6c')};var _0x211d4f=[];var _0x48e42f=[];var _0x42da90={};var _0x447de9=![];return db[_0xeac4('0x6d')][_0xeac4('0x6e')]()[_0xeac4('0x1e')](function(_0x136713){if(!_0x136713){throw new db['Sequelize'][(_0xeac4('0x6f'))]('no\x20available\x20attributes');}_0x211d4f=_[_0xeac4('0x70')](_[_0xeac4('0x56')](_0x136713),[_0xeac4('0x71'),_0xeac4('0x72')]);_0x48e42f=_['difference'](_[_0xeac4('0x56')](_0x136713),['createdAt','updatedAt',_0xeac4('0x73'),_0xeac4('0x74')]);if(_0x114814[_0xeac4('0x5b')]['id']){delete _0x114814['body']['id'];}if(_[_0xeac4('0x75')](_0x114814[_0xeac4('0x5b')][_0xeac4('0x76')])){throw new db[(_0xeac4('0x77'))][(_0xeac4('0x6f'))](_0xeac4('0x78'));}if(_[_0xeac4('0x75')](_0x114814['body'][_0xeac4('0x5b')])||_0x114814[_0xeac4('0x5b')][_0xeac4('0x5b')]===''){throw new db[(_0xeac4('0x77'))][(_0xeac4('0x6f'))](_0xeac4('0x79'));}if(_[_0xeac4('0x75')](_0x114814[_0xeac4('0x5b')][_0xeac4('0x7a')])){throw new db[(_0xeac4('0x77'))][(_0xeac4('0x6f'))](_0xeac4('0x7b')+_0x48e42f);}if(!_[_0xeac4('0x7c')](_0x48e42f,_0x114814[_0xeac4('0x5b')]['mapKey'])){throw new db[(_0xeac4('0x77'))][(_0xeac4('0x6f'))](_0xeac4('0x7d')+_0x48e42f);}_0x42da90[_0x114814['body'][_0xeac4('0x7a')]]=_0x114814[_0xeac4('0x5b')][_0xeac4('0x76')];})[_0xeac4('0x1e')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x114814[_0xeac4('0x54')]['id']},'include':[{'model':db[_0xeac4('0x7e')],'as':'List','include':[{'model':db['CmContact'],'as':_0xeac4('0x7f'),'where':_0x42da90,'limit':0x1,'order':[[_0xeac4('0x72'),_0xeac4('0x80')]]}]},{'model':db[_0xeac4('0x81')],'as':'Applications'}]});})[_0xeac4('0x1e')](handleEntityNotFound(_0x5e1baf,null))[_0xeac4('0x1e')](function(_0x4aff95){if(_0x4aff95&&_0x4aff95['List']){_0x5b4e98[_0xeac4('0x82')]=_0x4aff95;_0x5b4e98[_0xeac4('0x83')]=_0x4aff95['Applications'];_0x5b4e98[_0xeac4('0x84')]=_0x4aff95[_0xeac4('0x85')];_0x5b4e98['applications']=_['orderBy'](_0x5b4e98[_0xeac4('0x83')],[_0xeac4('0x86')],[_0xeac4('0x87')]);if(_0x5b4e98[_0xeac4('0x82')][_0xeac4('0x88')]){delete _0x5b4e98[_0xeac4('0x82')][_0xeac4('0x88')];}if(_0x5b4e98[_0xeac4('0x82')][_0xeac4('0x85')]&&_0x5b4e98[_0xeac4('0x82')]['List']['Contacts'][_0xeac4('0x44')]){return _0x5b4e98['account'][_0xeac4('0x85')][_0xeac4('0x7f')][0x0];}var _0x27653a=_['defaults'](_0x114814[_0xeac4('0x5b')],{'firstName':_0x114814[_0xeac4('0x5b')][_0xeac4('0x76')],'ListId':_0x4aff95['ListId']});_0x27653a[_0x114814[_0xeac4('0x5b')]['mapKey']]=_0x114814[_0xeac4('0x5b')][_0xeac4('0x76')];return db[_0xeac4('0x6d')]['create'](_0x27653a,{'fields':_0x211d4f,'raw':!![]});}})[_0xeac4('0x1e')](handleEntityNotFound(_0x5e1baf,null))['then'](function(_0x57efae){_0x5b4e98[_0xeac4('0x89')]=_0x57efae;if(_0x57efae){var _0x5487c4={'ContactId':_0x57efae['id'],'OpenchannelAccountId':_0x114814[_0xeac4('0x54')]['id'],'from':(_0x57efae[_0xeac4('0x8a')]||'')+'\x20'+(_0x57efae[_0xeac4('0x8b')]||'')};var _0x151a9d={'OpenchannelAccountId':_0x114814['params']['id'],'closed':![]};if(_0x114814['body']['threadId']){_0x151a9d[_0xeac4('0x8c')]=_0x114814['body'][_0xeac4('0x8c')];return db[_0xeac4('0x8d')][_0xeac4('0x59')]({'where':_0x151a9d})['then'](function(_0x330f4b){if(_0x330f4b){return[_0x330f4b,![]];}_0x5487c4[_0xeac4('0x8c')]=_0x114814[_0xeac4('0x5b')][_0xeac4('0x8c')];_0x5487c4[_0xeac4('0x8e')]=_0x114814[_0xeac4('0x5b')][_0xeac4('0x8e')];return db['OpenchannelInteraction'][_0xeac4('0x5a')](_0x5487c4)['then'](function(_0x2ca00f){return[_0x2ca00f,!![]];});});}else{_0x151a9d[_0xeac4('0x8c')]=null;}_0x151a9d[_0xeac4('0x8f')]=_0x57efae['id'];return db['OpenchannelInteraction'][_0xeac4('0x59')]({'where':_0x151a9d})[_0xeac4('0x1e')](function(_0x93e20c){if(_0x93e20c){return[_0x93e20c,![]];}return db[_0xeac4('0x8d')][_0xeac4('0x5a')](_0x5487c4)[_0xeac4('0x1e')](function(_0x1ae265){return[_0x1ae265,!![]];});});}})[_0xeac4('0x90')](function(_0xeae1f1,_0x32e516){if(_0xeae1f1){_0x447de9=_0x32e516;if(!_0x32e516){var _0x5ec667={'from':(_0x5b4e98[_0xeac4('0x89')]['firstName']||'')+'\x20'+(_0x5b4e98['contact'][_0xeac4('0x8b')]||'')};if(_0x114814[_0xeac4('0x5b')]['threadId']&&_0x114814[_0xeac4('0x5b')][_0xeac4('0x91')]&&_0x114814[_0xeac4('0x5b')][_0xeac4('0x8c')]!=_0x114814[_0xeac4('0x5b')][_0xeac4('0x91')]){_0x5ec667[_0xeac4('0x8c')]=_0x114814['body'][_0xeac4('0x91')];}return _0xeae1f1[_0xeac4('0x30')](_0x5ec667);}else{return _0xeae1f1;}}})[_0xeac4('0x1e')](function(_0x1c9014){_0x5b4e98[_0xeac4('0x92')]=_0x1c9014[_0xeac4('0x32')]({'plain':!![]});_0x5b4e98[_0xeac4('0x92')][_0xeac4('0x93')]=_0x447de9;if(_0x5b4e98[_0xeac4('0x92')]['created']){if(_0x5b4e98[_0xeac4('0x82')][_0xeac4('0x94')]){_0x5b4e98['applications']['push']({'id':0x0,'priority':_0x5b4e98[_0xeac4('0x83')]['length']+0x1,'app':_0xeac4('0x95'),'appdata':_0xeac4('0x96'),'interval':_0xeac4('0x97')});}}return db[_0xeac4('0x98')]['create']({'body':_0x114814[_0xeac4('0x5b')][_0xeac4('0x5b')],'OpenchannelAccountId':_0x114814['params']['id'],'OpenchannelInteractionId':_0x1c9014['id'],'direction':'in','ContactId':_0x5b4e98['contact']['id'],'AttachmentId':_0x114814[_0xeac4('0x5b')][_0xeac4('0x99')]});})[_0xeac4('0x1e')](function(_0xd665e1){_0x5b4e98[_0xeac4('0x25')]=_0xd665e1;if(_0x5b4e98[_0xeac4('0x92')][_0xeac4('0x9a')]){return db[_0xeac4('0x9b')]['find']({'attributes':['id',_0xeac4('0x36')],'where':{'id':_0x5b4e98[_0xeac4('0x92')][_0xeac4('0x9a')]}})[_0xeac4('0x1e')](function(_0x3f9150){if(_0x3f9150){_0x5b4e98['applications'][_0xeac4('0x9c')]({'id':0x0,'priority':0x0,'app':_0xeac4('0x9d'),'appdata':_0x3f9150[_0xeac4('0x36')]+','+(_0x5b4e98['account'][_0xeac4('0x9e')]||0xa),'interval':_0xeac4('0x97')});_0x5b4e98[_0xeac4('0x9f')]=![];}return respondWithRpcPromise(_0xeac4('0xa0'),_0xeac4('0xa1'),_0x5b4e98);});}return respondWithRpcPromise(_0xeac4('0xa0'),_0xeac4('0xa1'),_0x5b4e98);})[_0xeac4('0x1e')](function(_0x345253){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x345253},client9002);return _0x345253;})[_0xeac4('0x1e')](respondWithResult(_0x5e1baf,null))[_0xeac4('0x52')](handleError(_0x5e1baf,null));};exports[_0xeac4('0xa2')]=function(_0x202b4b,_0x3ac1c4,_0x1ed774){return db[_0xeac4('0x4e')][_0xeac4('0x64')]({'where':{'id':_0x202b4b[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x3ac1c4,null))[_0xeac4('0x1e')](function(_0x90e3df){if(_0x90e3df){return db[_0xeac4('0xa3')][_0xeac4('0xa4')](function(_0x3f98d5){return db[_0xeac4('0x81')]['destroy']({'where':{'OpenchannelAccountId':_0x202b4b['params']['id']},'transaction':_0x3f98d5})[_0xeac4('0x1e')](function(_0x4510a6){var _0x210c6c=_[_0xeac4('0x3e')](_0x202b4b[_0xeac4('0x5b')],function(_0x59ce10){_0x59ce10[_0xeac4('0x62')]=_0x202b4b[_0xeac4('0x54')]['id'];return _0x59ce10;});return db[_0xeac4('0x81')]['bulkCreate'](_0x210c6c,{'transaction':_0x3f98d5});});})[_0xeac4('0x1e')](function(){return db[_0xeac4('0x81')][_0xeac4('0xa5')]({'where':{'OpenchannelAccountId':_0x202b4b[_0xeac4('0x54')]['id']},'order':_0xeac4('0x86')});});}})['then'](respondWithResult(_0x3ac1c4,null))['catch'](handleError(_0x3ac1c4,null));};exports[_0xeac4('0xa6')]=function(_0x3b3636,_0x5718f3,_0x1517ad){var _0x159e5f={};var _0x55d4a7={};var _0x4f7081;var _0x4bb51d;return db[_0xeac4('0x4e')][_0xeac4('0x64')]({'where':{'id':_0x3b3636[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x5718f3,null))['then'](function(_0x583f89){if(_0x583f89){_0x4f7081=_0x583f89;_0x55d4a7[_0xeac4('0x41')]=_['keys'](db['OpenchannelApplication'][_0xeac4('0x3a')]);_0x55d4a7[_0xeac4('0x3f')]=_[_0xeac4('0x56')](_0x3b3636['query']);_0x55d4a7[_0xeac4('0x57')]=_[_0xeac4('0x40')](_0x55d4a7[_0xeac4('0x41')],_0x55d4a7[_0xeac4('0x3f')]);_0x159e5f[_0xeac4('0x42')]=_[_0xeac4('0x40')](_0x55d4a7[_0xeac4('0x41')],qs[_0xeac4('0x43')](_0x3b3636[_0xeac4('0x3f')][_0xeac4('0x43')]));_0x159e5f[_0xeac4('0x42')]=_0x159e5f['attributes'][_0xeac4('0x44')]?_0x159e5f[_0xeac4('0x42')]:_0x55d4a7[_0xeac4('0x41')];_0x159e5f[_0xeac4('0x47')]=qs[_0xeac4('0x48')](_0x3b3636[_0xeac4('0x3f')][_0xeac4('0x48')]);_0x159e5f[_0xeac4('0x49')]=qs[_0xeac4('0x57')](_[_0xeac4('0x4a')](_0x3b3636['query'],_0x55d4a7['filters']));if(_0x3b3636[_0xeac4('0x3f')][_0xeac4('0x66')]){_0x159e5f[_0xeac4('0x49')]=_[_0xeac4('0x4b')](_0x159e5f[_0xeac4('0x49')],{'$or':_['map'](_0x159e5f[_0xeac4('0x42')],function(_0x36e486){var _0x230dad={};_0x230dad[_0x36e486]={'$like':'%'+_0x3b3636[_0xeac4('0x3f')]['filter']+'%'};return _0x230dad;})});}_0x159e5f=_[_0xeac4('0x4b')]({},_0x159e5f,_0x3b3636[_0xeac4('0x4d')]);return _0x4f7081[_0xeac4('0xa6')](_0x159e5f);}})[_0xeac4('0x1e')](function(_0x455d1c){if(_0x455d1c){_0x4bb51d=_0x455d1c[_0xeac4('0x44')];if(!_0x3b3636['query'][_0xeac4('0xa7')](_0xeac4('0x45'))){_0x159e5f[_0xeac4('0x2b')]=qs[_0xeac4('0x2b')](_0x3b3636['query'][_0xeac4('0x2b')]);_0x159e5f[_0xeac4('0x46')]=qs[_0xeac4('0x46')](_0x3b3636[_0xeac4('0x3f')][_0xeac4('0x46')]);}return _0x4f7081[_0xeac4('0xa6')](_0x159e5f);}})['then'](function(_0x3da9ad){if(_0x3da9ad){return _0x3da9ad?{'count':_0x4bb51d,'rows':_0x3da9ad}:null;}})[_0xeac4('0x1e')](respondWithResult(_0x5718f3,null))[_0xeac4('0x52')](handleError(_0x5718f3,null));};exports[_0xeac4('0xa8')]=function(_0x25c9b2,_0x23ca4c,_0x30c324){var _0x432a2f={'raw':![],'where':{}};var _0x66e92e={};var _0xdc1487={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x25c9b2[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x23ca4c,null))[_0xeac4('0x1e')](function(_0x50203b){if(_0x50203b){_0x66e92e['model']=_[_0xeac4('0x56')](db[_0xeac4('0x8d')][_0xeac4('0x3a')]);_0x66e92e[_0xeac4('0x3f')]=_[_0xeac4('0x56')](_0x25c9b2[_0xeac4('0x3f')]);_0x66e92e['filters']=_[_0xeac4('0x40')](_0x66e92e['model'],_0x66e92e['query']);_0x432a2f[_0xeac4('0x42')]=_['intersection'](_0x66e92e[_0xeac4('0x41')],qs[_0xeac4('0x43')](_0x25c9b2[_0xeac4('0x3f')]['fields']));_0x432a2f['attributes']=_0x432a2f[_0xeac4('0x42')][_0xeac4('0x44')]?_0x432a2f[_0xeac4('0x42')]:_0x66e92e[_0xeac4('0x41')];if(!_0x25c9b2['query']['hasOwnProperty'](_0xeac4('0x45'))){_0x432a2f['limit']=qs['limit'](_0x25c9b2[_0xeac4('0x3f')]['limit']);_0x432a2f[_0xeac4('0x46')]=qs[_0xeac4('0x46')](_0x25c9b2[_0xeac4('0x3f')]['offset']);}_0x432a2f[_0xeac4('0x47')]=qs[_0xeac4('0x48')](_0x25c9b2[_0xeac4('0x3f')]['sort']);_0x432a2f[_0xeac4('0x49')]=qs[_0xeac4('0x57')](_[_0xeac4('0x4a')](_0x25c9b2[_0xeac4('0x3f')],_0x66e92e[_0xeac4('0x57')]));_0x432a2f[_0xeac4('0x49')][_0xeac4('0x62')]=_0x50203b['id'];if(_0x25c9b2[_0xeac4('0x3f')]['filter']){_0x432a2f['where']=_['merge'](_0x432a2f[_0xeac4('0x49')],{'$or':_[_0xeac4('0x3e')](_0x432a2f['attributes'],function(_0x4dbd46){var _0x4adaa4={};_0x4adaa4[_0x4dbd46]={'$like':'%'+_0x25c9b2[_0xeac4('0x3f')]['filter']+'%'};return _0x4adaa4;})});}_0x432a2f=_[_0xeac4('0x4b')]({},_0x432a2f,_0x25c9b2[_0xeac4('0x4d')]);return db[_0xeac4('0x8d')][_0xeac4('0x2d')]({'where':_0x432a2f[_0xeac4('0x49')]})[_0xeac4('0x1e')](function(_0x12eea2){_0xdc1487[_0xeac4('0x2d')]=_0x12eea2;if(_0x25c9b2['query'][_0xeac4('0x58')]){_0x432a2f[_0xeac4('0x4f')]=[{'model':db[_0xeac4('0x6d')],'as':_0xeac4('0xa9'),'required':![]},{'model':db[_0xeac4('0x9b')],'as':_0xeac4('0xaa'),'attributes':[_0xeac4('0x36'),'fullname',_0xeac4('0xab')],'required':![]},{'model':db[_0xeac4('0xac')],'as':_0xeac4('0xad'),'attributes':['id',_0xeac4('0x36'),_0xeac4('0xae')],'where':_0x25c9b2[_0xeac4('0x3f')][_0xeac4('0xaf')]?{'id':_0x25c9b2[_0xeac4('0x3f')][_0xeac4('0xaf')]}:undefined,'required':_0x25c9b2['query'][_0xeac4('0xaf')]?!![]:![]}];}return db[_0xeac4('0x8d')][_0xeac4('0x50')](_0x432a2f);})[_0xeac4('0x1e')](function(_0x2f5953){_0xdc1487[_0xeac4('0x51')]=_0x2f5953;return _0xdc1487;});}})[_0xeac4('0x1e')](respondWithFilteredResult(_0x23ca4c,_0x432a2f))[_0xeac4('0x52')](handleError(_0x23ca4c,null));};exports['addAgents']=function(_0x1c1362,_0x235149,_0x511719){return db[_0xeac4('0x4e')][_0xeac4('0x59')]({'where':{'id':_0x1c1362['params']['id']}})['then'](handleEntityNotFound(_0x235149,null))[_0xeac4('0x1e')](function(_0x4b4f86){if(_0x4b4f86){return _0x4b4f86['addAgents'](_0x1c1362[_0xeac4('0x5b')][_0xeac4('0x68')],_['omit'](_0x1c1362[_0xeac4('0x5b')],[_0xeac4('0x68'),'id'])||{})[_0xeac4('0x90')](function(_0x21bca6){for(var _0x395e7c=0x0;_0x395e7c<_0x1c1362['body']['ids'][_0xeac4('0x44')];_0x395e7c+=0x1){socket[_0xeac4('0xb0')](_0xeac4('0xb1'),{'UserId':Number(_0x1c1362['body'][_0xeac4('0x68')][_0x395e7c]),'OpenchannelAccountId':Number(_0x1c1362[_0xeac4('0x54')]['id'])});}return _0x21bca6;});}})[_0xeac4('0x1e')](respondWithResult(_0x235149,null))[_0xeac4('0x52')](handleError(_0x235149,null));};exports[_0xeac4('0xb2')]=function(_0x5c9c85,_0x2da5f4,_0x2b1b25){return db[_0xeac4('0x4e')][_0xeac4('0x59')]({'where':{'id':_0x5c9c85['params']['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x2da5f4,null))[_0xeac4('0x1e')](function(_0x25d778){if(_0x25d778){return _0x25d778[_0xeac4('0xb2')](_0x5c9c85['query'][_0xeac4('0x68')])['then'](function(){if(_[_0xeac4('0xb3')](_0x5c9c85[_0xeac4('0x3f')][_0xeac4('0x68')])){for(var _0x46c188=0x0;_0x46c188<_0x5c9c85[_0xeac4('0x3f')][_0xeac4('0x68')][_0xeac4('0x44')];_0x46c188+=0x1){socket[_0xeac4('0xb0')](_0xeac4('0xb4'),{'UserId':Number(_0x5c9c85[_0xeac4('0x3f')][_0xeac4('0x68')][_0x46c188]),'OpenchannelAccountId':Number(_0x5c9c85['params']['id'])});}}else{socket[_0xeac4('0xb0')](_0xeac4('0xb4'),{'UserId':Number(_0x5c9c85['query'][_0xeac4('0x68')]),'OpenchannelAccountId':Number(_0x5c9c85[_0xeac4('0x54')]['id'])});}});}})[_0xeac4('0x1e')](respondWithStatusCode(_0x2da5f4,null))[_0xeac4('0x52')](handleError(_0x2da5f4,null));};exports[_0xeac4('0xb5')]=function(_0x5a50fc,_0x314929,_0x1b7b0e){var _0x4dc639={};var _0x365fc3={};var _0x288aab;var _0x20fa43;return db['OpenchannelAccount'][_0xeac4('0x64')]({'where':{'id':_0x5a50fc[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0x314929,null))[_0xeac4('0x1e')](function(_0x890af9){if(_0x890af9){_0x288aab=_0x890af9;_0x365fc3[_0xeac4('0x41')]=_[_0xeac4('0x56')](db['User'][_0xeac4('0x3a')]);_0x365fc3[_0xeac4('0x3f')]=_['keys'](_0x5a50fc[_0xeac4('0x3f')]);_0x365fc3[_0xeac4('0x57')]=_[_0xeac4('0x40')](_0x365fc3['model'],_0x365fc3[_0xeac4('0x3f')]);_0x4dc639[_0xeac4('0x42')]=_[_0xeac4('0x40')](_0x365fc3[_0xeac4('0x41')],qs[_0xeac4('0x43')](_0x5a50fc[_0xeac4('0x3f')][_0xeac4('0x43')]));_0x4dc639['attributes']=_0x4dc639['attributes'][_0xeac4('0x44')]?_0x4dc639[_0xeac4('0x42')]:_0x365fc3['model'];_0x4dc639['order']=qs[_0xeac4('0x48')](_0x5a50fc['query'][_0xeac4('0x48')]);_0x4dc639[_0xeac4('0x49')]=qs[_0xeac4('0x57')](_['pick'](_0x5a50fc[_0xeac4('0x3f')],_0x365fc3[_0xeac4('0x57')]));if(_0x5a50fc['query'][_0xeac4('0x66')]){_0x4dc639[_0xeac4('0x49')]=_[_0xeac4('0x4b')](_0x4dc639[_0xeac4('0x49')],{'$or':_[_0xeac4('0x3e')](_0x4dc639[_0xeac4('0x42')],function(_0x23cc96){var _0x469423={};_0x469423[_0x23cc96]={'$like':'%'+_0x5a50fc[_0xeac4('0x3f')]['filter']+'%'};return _0x469423;})});}_0x4dc639=_[_0xeac4('0x4b')]({},_0x4dc639,_0x5a50fc[_0xeac4('0x4d')]);return _0x288aab['getAgents'](_0x4dc639);}})[_0xeac4('0x1e')](function(_0x1d8687){if(_0x1d8687){_0x20fa43=_0x1d8687[_0xeac4('0x44')];if(!_0x5a50fc[_0xeac4('0x3f')][_0xeac4('0xa7')](_0xeac4('0x45'))){_0x4dc639['limit']=qs[_0xeac4('0x2b')](_0x5a50fc['query'][_0xeac4('0x2b')]);_0x4dc639[_0xeac4('0x46')]=qs[_0xeac4('0x46')](_0x5a50fc[_0xeac4('0x3f')][_0xeac4('0x46')]);}return _0x288aab[_0xeac4('0xb5')](_0x4dc639);}})[_0xeac4('0x1e')](function(_0x288300){if(_0x288300){return _0x288300?{'count':_0x20fa43,'rows':_0x288300}:null;}})[_0xeac4('0x1e')](respondWithResult(_0x314929,null))[_0xeac4('0x52')](handleError(_0x314929,null));};exports[_0xeac4('0x37')]=function(_0x68a3ac,_0xaeeb84,_0x2d5bc9){var _0x179ab6,_0x4aec62,_0x833635;if(_['isNil'](_0x68a3ac['body'][_0xeac4('0x5b')])||_0x68a3ac[_0xeac4('0x5b')]['body']===''){throw new db[(_0xeac4('0x77'))][(_0xeac4('0x6f'))](_0xeac4('0x79'));}if(_[_0xeac4('0x75')](_0x68a3ac[_0xeac4('0x5b')]['to'])){}_0x179ab6=_0x68a3ac['body']['to'];return db[_0xeac4('0x4e')][_0xeac4('0x64')]({'where':{'id':_0x68a3ac[_0xeac4('0x54')]['id']}})[_0xeac4('0x1e')](handleEntityNotFound(_0xaeeb84,null))[_0xeac4('0x1e')](function(_0x2c0ae7){if(_0x2c0ae7){return db[_0xeac4('0x4e')][_0xeac4('0x59')]({'where':{'id':_0x2c0ae7['id']},'include':[{'model':db[_0xeac4('0x7e')],'as':_0xeac4('0x85'),'include':[{'model':db[_0xeac4('0x6d')],'as':_0xeac4('0x7f'),'where':{[_0x2c0ae7[_0xeac4('0x7a')]]:_0x179ab6},'limit':0x1,'order':[[_0xeac4('0x72'),'DESC']]}]}]})[_0xeac4('0x1e')](handleEntityNotFound(_0xaeeb84,null))[_0xeac4('0x1e')](function(_0x1d0df6){if(_0x1d0df6&&_0x1d0df6['List']){_0x4aec62=_0x1d0df6['get']({'plain':!![]});if(_0x4aec62['List']&&_0x4aec62[_0xeac4('0x85')]['Contacts'][_0xeac4('0x44')]){return _0x4aec62[_0xeac4('0x85')][_0xeac4('0x7f')][0x0];}return db[_0xeac4('0x6d')][_0xeac4('0x5a')](_['defaults'](_0x68a3ac[_0xeac4('0x5b')],{'firstName':_0x179ab6,[_0x1d0df6[_0xeac4('0x7a')]]:_0x179ab6,'phone':_0x179ab6,'ListId':_0x4aec62[_0xeac4('0x74')]}));}})[_0xeac4('0x1e')](handleEntityNotFound(_0xaeeb84,null))[_0xeac4('0x1e')](function(_0x93b93e){if(_0x93b93e){_0x833635=_0x93b93e;return db[_0xeac4('0x8d')][_0xeac4('0x59')]({'where':{'ContactId':_0x833635['id'],'closed':![],'OpenchannelAccountId':_0x4aec62['id']}})['then'](function(_0x30f784){if(_0x30f784){return[_0x30f784,![]];}return db[_0xeac4('0x8d')][_0xeac4('0x5a')]({'UserId':_0x68a3ac[_0xeac4('0x5c')]['id'],'ContactId':_0x833635['id'],'OpenchannelAccountId':_0x4aec62['id'],'lastMsgDirection':_0xeac4('0xb6'),'Messages':[_[_0xeac4('0x4b')](_0x68a3ac[_0xeac4('0x5b')],{'read':![],'body':_0x68a3ac['body'][_0xeac4('0x5b')],'OpenchannelAccountId':_0x4aec62['id'],'UserId':_0x68a3ac[_0xeac4('0x5c')]['id'],'ContactId':_0x833635['id']})]},{'include':[{'model':db[_0xeac4('0x98')],'as':_0xeac4('0xb7')}]})[_0xeac4('0x1e')](function(_0x31ef90){return[_0x31ef90,!![]];});});}})[_0xeac4('0x90')](function(_0x56e225,_0xeed7a1){if(_0xeed7a1){return _0x56e225;}return db['OpenchannelMessage'][_0xeac4('0x5a')](_[_0xeac4('0x4b')](_0x68a3ac[_0xeac4('0x5b')],{'read':![],'body':_0x68a3ac['body'][_0xeac4('0x5b')],'OpenchannelAccountId':_0x4aec62['id'],'OpenchannelInteractionId':_0x56e225['id'],'UserId':_0x68a3ac[_0xeac4('0x5c')]['id'],'ContactId':_0x833635['id']}))['then'](function(_0x28f6ef){_0x56e225[_0xeac4('0xb8')][_0xeac4('0xb7')]=[];_0x56e225['dataValues']['Messages'][_0xeac4('0xb9')](_0x28f6ef[_0xeac4('0xb8')]);return _0x56e225;});});}})[_0xeac4('0x1e')](respondWithResult(_0xaeeb84,null))[_0xeac4('0x52')](handleError(_0xaeeb84,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 1609311..5c60470 100644 --- a/server/api/openchannelAccount/openchannelAccount.events.js +++ b/server/api/openchannelAccount/openchannelAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x4a095e,_0x381cd5){var _0x10ef73=function(_0x1f6964){while(--_0x1f6964){_0x4a095e['push'](_0x4a095e['shift']());}};_0x10ef73(++_0x381cd5);}(_0x668b,0x140));var _0xb668=function(_0x3e7e96,_0x5683ca){_0x3e7e96=_0x3e7e96-0x0;var _0x13f6f0=_0x668b[_0x3e7e96];return _0x13f6f0;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _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 diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 4b62cff..244f7c3 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(_0x54b415,_0x2695c1){var _0x49b318=function(_0xd1756c){while(--_0xd1756c){_0x54b415['push'](_0x54b415['shift']());}};_0x49b318(++_0x2695c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_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 diff --git a/server/api/openchannelAccount/openchannelAccount.rpc.js b/server/api/openchannelAccount/openchannelAccount.rpc.js index 4c812ea..4c10a0d 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 _0x51c5=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x219b0e,_0xb58bfd){var _0x24a66c=function(_0x1beead){while(--_0x1beead){_0x219b0e['push'](_0x219b0e['shift']());}};_0x24a66c(++_0xb58bfd);}(_0x51c5,0x8f));var _0x551c=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x51c5[_0x26f702];return _0x11417d;};'use strict';var _=require(_0x551c('0x0'));var util=require(_0x551c('0x1'));var moment=require(_0x551c('0x2'));var BPromise=require(_0x551c('0x3'));var rs=require(_0x551c('0x4'));var fs=require('fs');var Redis=require(_0x551c('0x5'));var db=require(_0x551c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x551c('0x7'))(_0x551c('0x8'));var config=require(_0x551c('0x9'));var jayson=require(_0x551c('0xa'));var client=jayson[_0x551c('0xb')][_0x551c('0xc')]({'port':0x232a});config[_0x551c('0xd')]=_[_0x551c('0xe')](config['redis'],{'host':_0x551c('0xf'),'port':0x18eb});var socket=require(_0x551c('0x10'))(new Redis(config[_0x551c('0xd')]));require('./openchannelAccount.socket')[_0x551c('0x11')](socket);function respondWithRpcPromise(_0x5c0257,_0x5682ef,_0x5ed459){return new BPromise(function(_0x1a92a3,_0x5cad27){return client[_0x551c('0x12')](_0x5c0257,_0x5ed459)[_0x551c('0x13')](function(_0xe61359){logger[_0x551c('0x14')](_0x551c('0x15'),_0x5682ef,_0x551c('0x16'));logger['debug'](_0x551c('0x17'),_0x5682ef,_0x551c('0x16'),JSON[_0x551c('0x18')](_0xe61359));if(_0xe61359['error']){if(_0xe61359[_0x551c('0x19')][_0x551c('0x1a')]===0x1f4){logger['error'](_0x551c('0x15'),_0x5682ef,_0xe61359['error'][_0x551c('0x1b')]);return _0x5cad27(_0xe61359[_0x551c('0x19')][_0x551c('0x1b')]);}logger[_0x551c('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x5682ef,_0xe61359['error'][_0x551c('0x1b')]);return _0x1a92a3(_0xe61359[_0x551c('0x19')]['message']);}else{logger[_0x551c('0x14')](_0x551c('0x15'),_0x5682ef,_0x551c('0x16'));_0x1a92a3(_0xe61359[_0x551c('0x1c')]['message']);}})['catch'](function(_0x491fec){logger[_0x551c('0x19')]('OpenchannelAccount,\x20%s,\x20%s',_0x5682ef,_0x491fec);_0x5cad27(_0x491fec);});});} \ No newline at end of file +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 diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c146fdf..15957f8 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 _0x9b00=['openchannelAccount:','./openchannelAccount.events','save','remove','emit','removeListener','length'];(function(_0x2b04b9,_0x34026d){var _0x5b389e=function(_0x1198f5){while(--_0x1198f5){_0x2b04b9['push'](_0x2b04b9['shift']());}};_0x5b389e(++_0x34026d);}(_0x9b00,0xcc));var _0x09b0=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9b00[_0x19e35c];return _0x3e1fe8;};'use strict';var OpenchannelAccountEvents=require(_0x09b0('0x0'));var events=[_0x09b0('0x1'),_0x09b0('0x2'),'update'];function createListener(_0x1737fd,_0x2bf951){return function(_0x18bb45){_0x2bf951[_0x09b0('0x3')](_0x1737fd,_0x18bb45);};}function removeListener(_0x405978,_0x3c02c5){return function(){OpenchannelAccountEvents[_0x09b0('0x4')](_0x405978,_0x3c02c5);};}exports['register']=function(_0x79bc56){for(var _0x57b9e0=0x0,_0x20c971=events[_0x09b0('0x5')];_0x57b9e0<_0x20c971;_0x57b9e0++){var _0x396bd6=events[_0x57b9e0];var _0x4290c7=createListener(_0x09b0('0x6')+_0x396bd6,_0x79bc56);OpenchannelAccountEvents['on'](_0x396bd6,_0x4290c7);}}; \ No newline at end of file +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 diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 4e6347b..efc33da 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 _0xf4fe=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','exports','multer','connect-timeout'];(function(_0x1ba6e5,_0x489e5d){var _0x4872cc=function(_0xb209b3){while(--_0xb209b3){_0x1ba6e5['push'](_0x1ba6e5['shift']());}};_0x4872cc(++_0x489e5d);}(_0xf4fe,0x154));var _0xef4f=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xf4fe[_0x49ca18];return _0x145d54;};'use strict';var multer=require(_0xef4f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xef4f('0x1'));var express=require(_0xef4f('0x2'));var router=express[_0xef4f('0x3')]();var fs_extra=require(_0xef4f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xef4f('0x5'));var config=require(_0xef4f('0x6'));var controller=require('./openchannelApplication.controller');router[_0xef4f('0x7')]('/',auth['isAuthenticated'](),controller[_0xef4f('0x8')]);router[_0xef4f('0x7')](_0xef4f('0x9'),auth['isAuthenticated'](),controller[_0xef4f('0xa')]);router[_0xef4f('0xb')]('/',auth[_0xef4f('0xc')](),controller[_0xef4f('0xd')]);router[_0xef4f('0xe')](_0xef4f('0x9'),auth['isAuthenticated'](),controller[_0xef4f('0xf')]);router[_0xef4f('0x10')](_0xef4f('0x9'),auth[_0xef4f('0xc')](),controller['destroy']);module[_0xef4f('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 984dc49..a9002ef 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 _0x6b10=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x4a9cfa,_0x38de10){var _0x1a795f=function(_0x25dc97){while(--_0x25dc97){_0x4a9cfa['push'](_0x4a9cfa['shift']());}};_0x1a795f(++_0x38de10);}(_0x6b10,0xa7));var _0x06b1=function(_0xf49839,_0x4209c1){_0xf49839=_0xf49839-0x0;var _0x497df5=_0x6b10[_0xf49839];return _0x497df5;};'use strict';var Sequelize=require(_0x06b1('0x0'));module[_0x06b1('0x1')]={'priority':{'type':Sequelize[_0x06b1('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x06b1('0x3')],'allowNull':![],'defaultValue':_0x06b1('0x4')},'appdata':{'type':Sequelize[_0x06b1('0x5')]()},'description':{'type':Sequelize[_0x06b1('0x3')]},'interval':{'type':Sequelize[_0x06b1('0x3')],'defaultValue':_0x06b1('0x6')}}; \ No newline at end of file +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 diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index db2b45d..5a35dbb 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 _0xd15a=['update','then','end','error','stack','name','send','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','include','findAll','rows','params','catch','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x5f2503,_0x4a3261){var _0x1def2d=function(_0x35b47c){while(--_0x35b47c){_0x5f2503['push'](_0x5f2503['shift']());}};_0x1def2d(++_0x4a3261);}(_0xd15a,0x10a));var _0xad15=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd15a[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xad15('0x0'));var rimraf=require(_0xad15('0x1'));var zipdir=require(_0xad15('0x2'));var jsonpatch=require(_0xad15('0x3'));var rp=require(_0xad15('0x4'));var moment=require(_0xad15('0x5'));var BPromise=require(_0xad15('0x6'));var Mustache=require('mustache');var util=require(_0xad15('0x7'));var path=require('path');var sox=require(_0xad15('0x8'));var csv=require(_0xad15('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xad15('0xa'));var _=require(_0xad15('0xb'));var squel=require(_0xad15('0xc'));var crypto=require(_0xad15('0xd'));var jsforce=require(_0xad15('0xe'));var deskjs=require(_0xad15('0xf'));var toCsv=require(_0xad15('0x9'));var querystring=require(_0xad15('0x10'));var Papa=require(_0xad15('0x11'));var Redis=require(_0xad15('0x12'));var authService=require(_0xad15('0x13'));var qs=require(_0xad15('0x14'));var as=require(_0xad15('0x15'));var hardwareService=require(_0xad15('0x16'));var logger=require(_0xad15('0x17'))('api');var utils=require(_0xad15('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad15('0x19'))['db'];function respondWithStatusCode(_0x15c4dc,_0xc58a){_0xc58a=_0xc58a||0xcc;return function(_0x5dc3db){if(_0x5dc3db){return _0x15c4dc[_0xad15('0x1a')](_0xc58a);}return _0x15c4dc[_0xad15('0x1b')](_0xc58a)['end']();};}function respondWithResult(_0x4bc0e9,_0x4adf84){_0x4adf84=_0x4adf84||0xc8;return function(_0x424e6d){if(_0x424e6d){return _0x4bc0e9[_0xad15('0x1b')](_0x4adf84)[_0xad15('0x1c')](_0x424e6d);}};}function respondWithFilteredResult(_0x432102,_0x4b70aa){return function(_0x3f0028){if(_0x3f0028){var _0x3d3d98=typeof _0x4b70aa[_0xad15('0x1d')]===_0xad15('0x1e')&&typeof _0x4b70aa[_0xad15('0x1f')]===_0xad15('0x1e');var _0x547eb5=_0x3f0028[_0xad15('0x20')];var _0x1214c0=_0x3d3d98?0x0:_0x4b70aa[_0xad15('0x1d')];var _0xb40d47=_0x3d3d98?_0x3f0028['count']:_0x4b70aa[_0xad15('0x1d')]+_0x4b70aa[_0xad15('0x1f')];var _0x3a05ac;if(_0xb40d47>=_0x547eb5){_0xb40d47=_0x547eb5;_0x3a05ac=0xc8;}else{_0x3a05ac=0xce;}_0x432102[_0xad15('0x1b')](_0x3a05ac);return _0x432102[_0xad15('0x21')](_0xad15('0x22'),_0x1214c0+'-'+_0xb40d47+'/'+_0x547eb5)[_0xad15('0x1c')](_0x3f0028);}return null;};}function patchUpdates(_0x13446c){return function(_0x5d6d1d){try{jsonpatch[_0xad15('0x23')](_0x5d6d1d,_0x13446c,!![]);}catch(_0x9d90aa){return BPromise[_0xad15('0x24')](_0x9d90aa);}return _0x5d6d1d[_0xad15('0x25')]();};}function saveUpdates(_0x30b86b,_0x43fe91){return function(_0x59c340){if(_0x59c340){return _0x59c340[_0xad15('0x26')](_0x30b86b)[_0xad15('0x27')](function(_0x2627b8){return _0x2627b8;});}return null;};}function removeEntity(_0x3a8ddc,_0x41c32b){return function(_0x4eefa1){if(_0x4eefa1){return _0x4eefa1['destroy']()['then'](function(){_0x3a8ddc[_0xad15('0x1b')](0xcc)[_0xad15('0x28')]();});}};}function handleEntityNotFound(_0x2f1005,_0x3f96ae){return function(_0x207f5f){if(!_0x207f5f){_0x2f1005[_0xad15('0x1a')](0x194);}return _0x207f5f;};}function handleError(_0x5bc591,_0x1da315){_0x1da315=_0x1da315||0x1f4;return function(_0x294d8e){logger[_0xad15('0x29')](_0x294d8e[_0xad15('0x2a')]);if(_0x294d8e[_0xad15('0x2b')]){delete _0x294d8e[_0xad15('0x2b')];}_0x5bc591[_0xad15('0x1b')](_0x1da315)[_0xad15('0x2c')](_0x294d8e);};}exports['index']=function(_0x4a4804,_0x5e2dbc){var _0x37a9bf={},_0x90a23b={},_0x4fd76b={'count':0x0,'rows':[]};var _0x3709e3=_[_0xad15('0x2d')](db[_0xad15('0x2e')][_0xad15('0x2f')],function(_0x34c4ce){return{'name':_0x34c4ce[_0xad15('0x30')],'type':_0x34c4ce[_0xad15('0x31')]['key']};});_0x90a23b[_0xad15('0x32')]=_['map'](_0x3709e3,'name');_0x90a23b[_0xad15('0x33')]=_[_0xad15('0x34')](_0x4a4804[_0xad15('0x33')]);_0x90a23b['filters']=_[_0xad15('0x35')](_0x90a23b[_0xad15('0x32')],_0x90a23b[_0xad15('0x33')]);_0x37a9bf['attributes']=_['intersection'](_0x90a23b[_0xad15('0x32')],qs[_0xad15('0x36')](_0x4a4804[_0xad15('0x33')]['fields']));_0x37a9bf['attributes']=_0x37a9bf[_0xad15('0x37')][_0xad15('0x38')]?_0x37a9bf['attributes']:_0x90a23b[_0xad15('0x32')];if(!_0x4a4804[_0xad15('0x33')][_0xad15('0x39')]('nolimit')){_0x37a9bf[_0xad15('0x1f')]=qs[_0xad15('0x1f')](_0x4a4804[_0xad15('0x33')][_0xad15('0x1f')]);_0x37a9bf[_0xad15('0x1d')]=qs[_0xad15('0x1d')](_0x4a4804[_0xad15('0x33')][_0xad15('0x1d')]);}_0x37a9bf[_0xad15('0x3a')]=qs['sort'](_0x4a4804[_0xad15('0x33')][_0xad15('0x3b')]);_0x37a9bf[_0xad15('0x3c')]=qs['filters'](_[_0xad15('0x3d')](_0x4a4804[_0xad15('0x33')],_0x90a23b[_0xad15('0x3e')]),_0x3709e3);if(_0x4a4804[_0xad15('0x33')]['filter']){_0x37a9bf[_0xad15('0x3c')]=_[_0xad15('0x3f')](_0x37a9bf[_0xad15('0x3c')],{'$or':_[_0xad15('0x2d')](_0x3709e3,function(_0x364a9d){if(_0x364a9d[_0xad15('0x31')]!==_0xad15('0x40')){var _0x139de2={};_0x139de2[_0x364a9d[_0xad15('0x2b')]]={'$like':'%'+_0x4a4804[_0xad15('0x33')][_0xad15('0x41')]+'%'};return _0x139de2;}})});}_0x37a9bf=_[_0xad15('0x3f')]({},_0x37a9bf,_0x4a4804[_0xad15('0x42')]);var _0x328e21={'where':_0x37a9bf['where']};return db[_0xad15('0x2e')][_0xad15('0x20')](_0x328e21)['then'](function(_0x3f0328){_0x4fd76b[_0xad15('0x20')]=_0x3f0328;if(_0x4a4804['query']['includeAll']){_0x37a9bf[_0xad15('0x43')]=[{'all':!![]}];}return db[_0xad15('0x2e')][_0xad15('0x44')](_0x37a9bf);})[_0xad15('0x27')](function(_0x42d8c8){_0x4fd76b[_0xad15('0x45')]=_0x42d8c8;return _0x4fd76b;})['then'](respondWithFilteredResult(_0x5e2dbc,_0x37a9bf))['catch'](handleError(_0x5e2dbc,null));};exports['show']=function(_0x30c120,_0x5c23c6){var _0x6a4ad={'raw':!![],'where':{'id':_0x30c120[_0xad15('0x46')]['id']}},_0x2f7b52={};_0x2f7b52[_0xad15('0x32')]=_[_0xad15('0x34')](db[_0xad15('0x2e')][_0xad15('0x2f')]);_0x2f7b52['query']=_[_0xad15('0x34')](_0x30c120[_0xad15('0x33')]);_0x2f7b52[_0xad15('0x3e')]=_[_0xad15('0x35')](_0x2f7b52[_0xad15('0x32')],_0x2f7b52[_0xad15('0x33')]);_0x6a4ad[_0xad15('0x37')]=_[_0xad15('0x35')](_0x2f7b52[_0xad15('0x32')],qs[_0xad15('0x36')](_0x30c120['query'][_0xad15('0x36')]));_0x6a4ad[_0xad15('0x37')]=_0x6a4ad[_0xad15('0x37')][_0xad15('0x38')]?_0x6a4ad['attributes']:_0x2f7b52[_0xad15('0x32')];if(_0x30c120[_0xad15('0x33')]['includeAll']){_0x6a4ad[_0xad15('0x43')]=[{'all':!![]}];}_0x6a4ad=_[_0xad15('0x3f')]({},_0x6a4ad,_0x30c120[_0xad15('0x42')]);return db[_0xad15('0x2e')]['find'](_0x6a4ad)['then'](handleEntityNotFound(_0x5c23c6,null))[_0xad15('0x27')](respondWithResult(_0x5c23c6,null))[_0xad15('0x47')](handleError(_0x5c23c6,null));};exports[_0xad15('0x48')]=function(_0x22cd36,_0xaf3f0a){return db[_0xad15('0x2e')][_0xad15('0x48')](_0x22cd36[_0xad15('0x49')],{})[_0xad15('0x27')](respondWithResult(_0xaf3f0a,0xc9))[_0xad15('0x47')](handleError(_0xaf3f0a,null));};exports['update']=function(_0x247f03,_0x552660){if(_0x247f03[_0xad15('0x49')]['id']){delete _0x247f03[_0xad15('0x49')]['id'];}return db[_0xad15('0x2e')][_0xad15('0x4a')]({'where':{'id':_0x247f03[_0xad15('0x46')]['id']}})['then'](handleEntityNotFound(_0x552660,null))['then'](saveUpdates(_0x247f03[_0xad15('0x49')],null))['then'](respondWithResult(_0x552660,null))[_0xad15('0x47')](handleError(_0x552660,null));};exports[_0xad15('0x4b')]=function(_0x4307e5,_0x244345){return db['OpenchannelApplication'][_0xad15('0x4a')]({'where':{'id':_0x4307e5[_0xad15('0x46')]['id']}})[_0xad15('0x27')](handleEntityNotFound(_0x244345,null))[_0xad15('0x27')](removeEntity(_0x244345,null))[_0xad15('0x47')](handleError(_0x244345,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index c968543..2b99cd5 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 _0x4d64=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./openchannelApplication.attributes'];(function(_0xc5d388,_0x34433f){var _0xab136=function(_0xc1e9b){while(--_0xc1e9b){_0xc5d388['push'](_0xc5d388['shift']());}};_0xab136(++_0x34433f);}(_0x4d64,0x1f3));var _0x44d6=function(_0x1834e4,_0x5e53e1){_0x1834e4=_0x1834e4-0x0;var _0x208b36=_0x4d64[_0x1834e4];return _0x208b36;};'use strict';var _=require(_0x44d6('0x0'));var util=require('util');var logger=require(_0x44d6('0x1'))(_0x44d6('0x2'));var moment=require('moment');var BPromise=require(_0x44d6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x44d6('0x4'));var rimraf=require(_0x44d6('0x5'));var config=require(_0x44d6('0x6'));var attributes=require(_0x44d6('0x7'));module[_0x44d6('0x8')]=function(_0x2ceb73,_0x224854){return _0x2ceb73[_0x44d6('0x9')](_0x44d6('0xa'),attributes,{'tableName':_0x44d6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x44d6('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +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 diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 67aa64b..fe3f298 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 _0x5c27=['where','limit','debug','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','body','options','raw'];(function(_0x2af9b6,_0x29584b){var _0x511278=function(_0x595504){while(--_0x595504){_0x2af9b6['push'](_0x2af9b6['shift']());}};_0x511278(++_0x29584b);}(_0x5c27,0x6b));var _0x75c2=function(_0x5bce33,_0x4a4b06){_0x5bce33=_0x5bce33-0x0;var _0x15bc20=_0x5c27[_0x5bce33];return _0x15bc20;};'use strict';var _=require(_0x75c2('0x0'));var util=require(_0x75c2('0x1'));var moment=require(_0x75c2('0x2'));var BPromise=require(_0x75c2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x75c2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x75c2('0x5'));var jayson=require(_0x75c2('0x6'));var client=jayson[_0x75c2('0x7')][_0x75c2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d0855,_0x525392,_0x49c10b){return new BPromise(function(_0x2b85c4,_0x4d2971){return client[_0x75c2('0x9')](_0x1d0855,_0x49c10b)['then'](function(_0x45b6ec){logger[_0x75c2('0xa')](_0x75c2('0xb'),_0x525392,_0x75c2('0xc'));logger['debug'](_0x75c2('0xd'),_0x525392,'request\x20sent',JSON[_0x75c2('0xe')](_0x45b6ec));if(_0x45b6ec[_0x75c2('0xf')]){if(_0x45b6ec[_0x75c2('0xf')]['code']===0x1f4){logger['error'](_0x75c2('0xb'),_0x525392,_0x45b6ec[_0x75c2('0xf')]['message']);return _0x4d2971(_0x45b6ec[_0x75c2('0xf')]['message']);}logger[_0x75c2('0xf')](_0x75c2('0xb'),_0x525392,_0x45b6ec['error']['message']);return _0x2b85c4(_0x45b6ec[_0x75c2('0xf')][_0x75c2('0x10')]);}else{logger['info']('OpenchannelApplication,\x20%s,\x20%s',_0x525392,'request\x20sent');_0x2b85c4(_0x45b6ec['result'][_0x75c2('0x10')]);}})[_0x75c2('0x11')](function(_0x24785d){logger[_0x75c2('0xf')](_0x75c2('0xb'),_0x525392,_0x24785d);_0x4d2971(_0x24785d);});});}exports[_0x75c2('0x12')]=function(_0x5d8512){var _0x2da3fb=this;return new Promise(function(_0x481e48,_0x1e7e38){return db[_0x75c2('0x13')]['update'](_0x5d8512[_0x75c2('0x14')],{'raw':_0x5d8512[_0x75c2('0x15')]?_0x5d8512[_0x75c2('0x15')][_0x75c2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d8512[_0x75c2('0x15')]?_0x5d8512['options'][_0x75c2('0x17')]||null:null,'attributes':_0x5d8512[_0x75c2('0x15')]?_0x5d8512[_0x75c2('0x15')]['attributes']||null:null,'limit':_0x5d8512[_0x75c2('0x15')]?_0x5d8512[_0x75c2('0x15')][_0x75c2('0x18')]||null:null})['then'](function(_0x4144bb){logger[_0x75c2('0xa')](_0x75c2('0x12'),_0x5d8512);logger[_0x75c2('0x19')](_0x75c2('0x12'),_0x5d8512,JSON[_0x75c2('0xe')](_0x4144bb));_0x481e48(_0x4144bb);})[_0x75c2('0x11')](function(_0x77b5ec){logger[_0x75c2('0xf')](_0x75c2('0x12'),_0x77b5ec['message'],_0x5d8512);_0x1e7e38(_0x2da3fb[_0x75c2('0xf')](0x1f4,_0x77b5ec[_0x75c2('0x10')]));});});}; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index fbab09a..9e6e5b5 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 _0x3b6d=['util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','tracked','openchannelinteraction:addtags','put','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','/:id/tags','removeTags','exports','multer'];(function(_0x1f29bd,_0x260de3){var _0xee0281=function(_0x538ee3){while(--_0x538ee3){_0x1f29bd['push'](_0x1f29bd['shift']());}};_0xee0281(++_0x260de3);}(_0x3b6d,0xdf));var _0xd3b6=function(_0x166b76,_0x5dc873){_0x166b76=_0x166b76-0x0;var _0x98a50e=_0x3b6d[_0x166b76];return _0x98a50e;};'use strict';var multer=require(_0xd3b6('0x0'));var util=require(_0xd3b6('0x1'));var path=require(_0xd3b6('0x2'));var timeout=require(_0xd3b6('0x3'));var express=require(_0xd3b6('0x4'));var router=express['Router']();var fs_extra=require(_0xd3b6('0x5'));var auth=require(_0xd3b6('0x6'));var interaction=require(_0xd3b6('0x7'));var config=require(_0xd3b6('0x8'));var controller=require('./openchannelInteraction.controller');router[_0xd3b6('0x9')]('/',auth[_0xd3b6('0xa')](),controller[_0xd3b6('0xb')]);router[_0xd3b6('0x9')](_0xd3b6('0xc'),auth[_0xd3b6('0xa')](),controller['describe']);router['get'](_0xd3b6('0xd'),auth['isAuthenticated'](),controller[_0xd3b6('0xe')]);router[_0xd3b6('0x9')](_0xd3b6('0xf'),auth[_0xd3b6('0xa')](),controller['getMessages']);router['get'](_0xd3b6('0x10'),auth[_0xd3b6('0xa')](),controller[_0xd3b6('0x11')]);router[_0xd3b6('0x12')]('/',auth[_0xd3b6('0xa')](),controller[_0xd3b6('0x13')]);router[_0xd3b6('0x12')]('/:id/messages',auth[_0xd3b6('0xa')](),controller[_0xd3b6('0x14')]);router[_0xd3b6('0x12')]('/:id/tags',auth[_0xd3b6('0xa')](),interaction[_0xd3b6('0x15')]('openchannel',_0xd3b6('0x16')),controller['addTags']);router[_0xd3b6('0x17')](_0xd3b6('0xd'),auth[_0xd3b6('0xa')](),interaction[_0xd3b6('0x15')]('openchannel',_0xd3b6('0x18')),controller[_0xd3b6('0x19')]);router['delete'](_0xd3b6('0xd'),auth[_0xd3b6('0xa')](),interaction[_0xd3b6('0x15')]('openchannel',_0xd3b6('0x1a')),controller[_0xd3b6('0x1b')]);router[_0xd3b6('0x1c')](_0xd3b6('0x1d'),auth[_0xd3b6('0xa')](),controller[_0xd3b6('0x1e')]);module[_0xd3b6('0x1f')]=router; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 04270fd..a509e4c 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 _0xab29=['out','sequelize','exports','BOOLEAN','DATE','STRING'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xab29,0x145));var _0x9ab2=function(_0xdef023,_0xe8841f){_0xdef023=_0xdef023-0x0;var _0x1ae7dc=_0xab29[_0xdef023];return _0x1ae7dc;};'use strict';var Sequelize=require(_0x9ab2('0x0'));module[_0x9ab2('0x1')]={'closed':{'type':Sequelize[_0x9ab2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x9ab2('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x9ab2('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x9ab2('0x4')]},'read1stAt':{'type':Sequelize[_0x9ab2('0x3')]},'threadId':{'type':Sequelize[_0x9ab2('0x4')]},'externalUrl':{'type':Sequelize[_0x9ab2('0x4')]},'lastMsgAt':{'type':Sequelize[_0x9ab2('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x9ab2('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x9ab2('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x9ab2('0x2')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 08c3946..22521fe 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 _0xddc2=['localhost','./openchannelInteraction.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','Users','fullname','Tags','forEach','push','TagIds','index','map','OpenchannelInteraction','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','select','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','openchannel_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','some','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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)','order','isEmpty','t.id\x20IN\x20?','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','all','rows','catch','show','params','rawAttributes','include','options','create','body','describe','addMessage','OpenchannelMessage','ids','findOne','pick','OpenchannelInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','setTags','emit','removeTags','download','unix','root','server','files','tmp','join','attachments','transcript-%d-%s.zip','CmContact','Attachment','Messages','secret','read','OpenchannelAccount','Owner','get','mkdirSync','Openchannel','Account','N.A.','closed','closedAt','disposition','threadId','Private','basename','existsSync','pipe','direction','System','firstName','lastName','out','renderFile','transcript-','.pdf','createPdfFromHTML','err','sendStatus','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x33fcbb,_0x291d0f){var _0x2efe40=function(_0x2e9442){while(--_0x2e9442){_0x33fcbb['push'](_0x33fcbb['shift']());}};_0x2efe40(++_0x291d0f);}(_0xddc2,0xd2));var _0x2ddc=function(_0x38daf2,_0x36d03a){_0x38daf2=_0x38daf2-0x0;var _0x409f2b=_0xddc2[_0x38daf2];return _0x409f2b;};'use strict';var emlformat=require(_0x2ddc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2ddc('0x1'));var rp=require(_0x2ddc('0x2'));var moment=require(_0x2ddc('0x3'));var BPromise=require(_0x2ddc('0x4'));var Mustache=require(_0x2ddc('0x5'));var util=require(_0x2ddc('0x6'));var path=require(_0x2ddc('0x7'));var sox=require(_0x2ddc('0x8'));var csv=require(_0x2ddc('0x9'));var ejs=require(_0x2ddc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2ddc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2ddc('0xc'));var toCsv=require(_0x2ddc('0x9'));var querystring=require(_0x2ddc('0xd'));var Papa=require(_0x2ddc('0xe'));var Redis=require(_0x2ddc('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x2ddc('0x10'));var as=require(_0x2ddc('0x11'));var pdf=require(_0x2ddc('0x12'));var hardwareService=require(_0x2ddc('0x13'));var logger=require('../../config/logger')(_0x2ddc('0x14'));var utils=require(_0x2ddc('0x15'));var config=require(_0x2ddc('0x16'));var licenseUtil=require(_0x2ddc('0x17'));var db=require(_0x2ddc('0x18'))['db'];config[_0x2ddc('0x19')]=_[_0x2ddc('0x1a')](config['redis'],{'host':_0x2ddc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2ddc('0x19')]));require(_0x2ddc('0x1c'))['register'](socket);function respondWithStatusCode(_0x4dd3ae,_0x2f186f){_0x2f186f=_0x2f186f||0xcc;return function(_0x46cd51){if(_0x46cd51){return _0x4dd3ae['sendStatus'](_0x2f186f);}return _0x4dd3ae[_0x2ddc('0x1d')](_0x2f186f)[_0x2ddc('0x1e')]();};}function respondWithResult(_0x5b79e8,_0x345be7){_0x345be7=_0x345be7||0xc8;return function(_0x5a8b9c){if(_0x5a8b9c){return _0x5b79e8[_0x2ddc('0x1d')](_0x345be7)[_0x2ddc('0x1f')](_0x5a8b9c);}};}function respondWithFilteredResult(_0x1a0cc9,_0xbdc526){return function(_0x43d571){if(_0x43d571){var _0x5bdd55=typeof _0xbdc526[_0x2ddc('0x20')]===_0x2ddc('0x21')&&typeof _0xbdc526[_0x2ddc('0x22')]===_0x2ddc('0x21');var _0x544889=_0x43d571[_0x2ddc('0x23')];var _0x5942cb=_0x5bdd55?0x0:_0xbdc526[_0x2ddc('0x20')];var _0x175a78=_0x5bdd55?_0x43d571[_0x2ddc('0x23')]:_0xbdc526[_0x2ddc('0x20')]+_0xbdc526[_0x2ddc('0x22')];var _0x212a00;if(_0x175a78>=_0x544889){_0x175a78=_0x544889;_0x212a00=0xc8;}else{_0x212a00=0xce;}_0x1a0cc9['status'](_0x212a00);return _0x1a0cc9[_0x2ddc('0x24')](_0x2ddc('0x25'),_0x5942cb+'-'+_0x175a78+'/'+_0x544889)[_0x2ddc('0x1f')](_0x43d571);}return null;};}function patchUpdates(_0x5970bf){return function(_0x1b088d){try{jsonpatch['apply'](_0x1b088d,_0x5970bf,!![]);}catch(_0x165fc2){return BPromise[_0x2ddc('0x26')](_0x165fc2);}return _0x1b088d[_0x2ddc('0x27')]();};}function saveUpdates(_0x20826f,_0x26340d){return function(_0x5d3dca){if(_0x5d3dca){return _0x5d3dca[_0x2ddc('0x28')](_0x20826f)['then'](function(_0x524f26){return _0x524f26;});}return null;};}function removeEntity(_0x1aeb19,_0x2daf83){return function(_0x1b32ca){if(_0x1b32ca){return _0x1b32ca[_0x2ddc('0x29')]()[_0x2ddc('0x2a')](function(){_0x1aeb19[_0x2ddc('0x1d')](0xcc)[_0x2ddc('0x1e')]();});}};}function handleEntityNotFound(_0x20af75,_0x5eb780){return function(_0x76a8ad){if(!_0x76a8ad){_0x20af75['sendStatus'](0x194);}return _0x76a8ad;};}function handleError(_0x43cc04,_0x2d2fa3){_0x2d2fa3=_0x2d2fa3||0x1f4;return function(_0x4d8705){logger[_0x2ddc('0x2b')](_0x4d8705[_0x2ddc('0x2c')]);if(_0x4d8705[_0x2ddc('0x2d')]){delete _0x4d8705[_0x2ddc('0x2d')];}_0x43cc04['status'](_0x2d2fa3)[_0x2ddc('0x2e')](_0x4d8705);};}function getInteractionUsers(_0x1b4c9b,_0x94fc6e){return new BPromise(function(_0x522296,_0x4de2e1){try{if(_0x94fc6e[_0x1b4c9b['id']]){_0x1b4c9b[_0x2ddc('0x2f')]=_['map'](_0x94fc6e[_0x1b4c9b['id']],function(_0x23f768){return{'id':_0x23f768['id'],'fullname':_0x23f768[_0x2ddc('0x30')]};});}}catch(_0x41addb){_0x4de2e1(_0x41addb);}_0x522296(_0x1b4c9b);});}function getInteractionTags(_0x3639d9,_0x479884){return new BPromise(function(_0x45dc22,_0x94a086){try{if(_0x3639d9['TagIds']){_0x3639d9[_0x2ddc('0x31')]=[];_0x3639d9['TagIds']['split'](',')[_0x2ddc('0x32')](function(_0x331b65){_0x3639d9[_0x2ddc('0x31')][_0x2ddc('0x33')](_0x479884[_0x331b65]);});}delete _0x3639d9[_0x2ddc('0x34')];}catch(_0x258ea2){_0x94a086(_0x258ea2);}_0x45dc22(_0x3639d9);});}function updateOpenchannelInteraction(_0x7cb064,_0x435251,_0x2298ca){return new BPromise(function(_0xeebba4,_0x1e2640){return getInteractionUsers(_0x7cb064,_0x2298ca)[_0x2ddc('0x2a')](function(_0x55fe28){return getInteractionTags(_0x55fe28,_0x435251);})[_0x2ddc('0x2a')](function(_0x27cf16){_0xeebba4(_0x27cf16);})['catch'](function(_0x389402){_0x1e2640(_0x389402);});});}exports[_0x2ddc('0x35')]=function(_0x42a42f,_0x452cac){var _0x2f8d9a={},_0x193e51={},_0x4f0414={'count':0x0,'rows':[]};var _0x536dc0=_[_0x2ddc('0x36')](db[_0x2ddc('0x37')]['rawAttributes'],function(_0x2fb4d5){return{'name':_0x2fb4d5['fieldName'],'type':_0x2fb4d5[_0x2ddc('0x38')][_0x2ddc('0x39')]};});_0x193e51[_0x2ddc('0x3a')]=_['map'](_0x536dc0,_0x2ddc('0x2d'));_0x193e51['query']=_[_0x2ddc('0x3b')](_0x42a42f[_0x2ddc('0x3c')]);_0x193e51['filters']=_[_0x2ddc('0x3d')](_0x193e51[_0x2ddc('0x3a')],_0x193e51[_0x2ddc('0x3c')]);_0x2f8d9a['attributes']=_['intersection'](_0x193e51[_0x2ddc('0x3a')],qs[_0x2ddc('0x3e')](_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x3e')]));_0x2f8d9a[_0x2ddc('0x3f')]=_0x2f8d9a[_0x2ddc('0x3f')][_0x2ddc('0x40')]?_0x2f8d9a[_0x2ddc('0x3f')]:_0x193e51[_0x2ddc('0x3a')];if(!_0x42a42f['query'][_0x2ddc('0x41')](_0x2ddc('0x42'))){_0x2f8d9a['limit']=qs['limit'](_0x42a42f[_0x2ddc('0x3c')]['limit']);_0x2f8d9a[_0x2ddc('0x20')]=qs[_0x2ddc('0x20')](_0x42a42f['query'][_0x2ddc('0x20')]);}_0x2f8d9a['order']=qs[_0x2ddc('0x43')](_0x42a42f['query']['sort']);_0x2f8d9a[_0x2ddc('0x44')]=qs[_0x2ddc('0x45')](_['pick'](_0x42a42f[_0x2ddc('0x3c')],_0x193e51[_0x2ddc('0x45')]),_0x536dc0);var _0x1ac2c6=[];var _0x2b7f17=squel[_0x2ddc('0x46')]()[_0x2ddc('0x47')]('id')[_0x2ddc('0x47')]('name')[_0x2ddc('0x47')](_0x2ddc('0x48'))[_0x2ddc('0x49')](_0x2ddc('0x4a'));var _0x166d8c=squel[_0x2ddc('0x46')]()[_0x2ddc('0x47')]('u.id')[_0x2ddc('0x47')](_0x2ddc('0x4b'))['field'](_0x2ddc('0x4c'))['from'](_0x2ddc('0x4d'),'ui')['left_join'](_0x2ddc('0x4e'),'u',_0x2ddc('0x4f'));var _0x12116=squel[_0x2ddc('0x46')]()[_0x2ddc('0x49')](_0x2ddc('0x50'),'i')[_0x2ddc('0x51')](_0x2ddc('0x52'),'c',_0x2ddc('0x53'))['left_join'](_0x2ddc('0x4e'),'o',_0x2ddc('0x54'))[_0x2ddc('0x51')](_0x2ddc('0x55'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x2ddc('0x51')]('openchannel_messages','me',_0x2ddc('0x56'))[_0x2ddc('0x51')](_0x2ddc('0x57'),'it','it.OpenchannelInteractionId\x20=\x20i.id')[_0x2ddc('0x51')]('tools_tags','t',_0x2ddc('0x58'));var _0x342faa=squel[_0x2ddc('0x59')]();var _0x44f3cf=[];var _0x48418b=squel[_0x2ddc('0x59')]();var _0x13e3ac;if(_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x5a')]){_0x13e3ac=as[_0x2ddc('0x5b')](_0x42a42f[_0x2ddc('0x3c')]['search']);var _0x54ff58=_0x13e3ac[_0x2ddc('0x5c')];for(var _0x2e5eca=0x0;_0x2e5eca<_0x13e3ac['conditions'][_0x2ddc('0x40')];_0x2e5eca++){var _0x577491=_0x13e3ac[_0x2ddc('0x5d')][_0x2e5eca];var _0x3cf890='i';var _0xf2d65a=_['find'](_0x536dc0,[_0x2ddc('0x2d'),_0x577491[_0x2ddc('0x47')]]);if(!_0xf2d65a){switch(_0x577491[_0x2ddc('0x47')]){case _0x2ddc('0x5e'):if(_0x577491[_0x2ddc('0x5f')]==0x1){_0x12116['having']('`'+_0x577491[_0x2ddc('0x47')]+_0x2ddc('0x60'));}else{_0x12116[_0x2ddc('0x61')]('`'+_0x577491[_0x2ddc('0x47')]+_0x2ddc('0x62'));}break;case _0x2ddc('0x63'):if(_0x577491[_0x2ddc('0x64')]===_0x2ddc('0x65')){if(_0x577491[_0x2ddc('0x5f')][_0x2ddc('0x66')]('\x20')[_0x2ddc('0x40')]>0x1){_0x342faa[_0x54ff58](_0x2ddc('0x67'),qs['getFullTextValue'](_0x577491[_0x2ddc('0x5f')]),null);}else{var _0x8c5b7='%'+_0x577491[_0x2ddc('0x5f')]+'%';_0x342faa[_0x54ff58](_0x2ddc('0x68'),_0x8c5b7,_0x8c5b7,_0x8c5b7);}}else{_0xf2d65a=_[_0x2ddc('0x69')](_0x536dc0,[_0x2ddc('0x2d'),_0x2ddc('0x6a')]);_0x577491[_0x2ddc('0x47')]=_0x2ddc('0x6a');_0x4f9efd=as[_0x2ddc('0x6b')](_0x3cf890,_0xf2d65a['type'],_0x577491);_0x342faa[_0x54ff58](_0x4f9efd[_0x2ddc('0x6c')],_0x4f9efd[_0x2ddc('0x5f')][_0x2ddc('0x6d')],_0x4f9efd['value'][_0x2ddc('0x1e')]);}break;case _0x2ddc('0x6e'):var _0x132698=_0x577491[_0x2ddc('0x5f')][_0x2ddc('0x66')](',')[_0x2ddc('0x36')](function(_0x22d1d3){return Number(_0x22d1d3);});_0x132698[_0x2ddc('0x32')](function(_0x556202){_0x48418b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x556202+',%');});_0x44f3cf=_[_0x2ddc('0x6f')](_0x44f3cf,_0x132698);break;case _0x2ddc('0x70'):if(_0x577491[_0x2ddc('0x64')]==='$substring'){_0x342faa[_0x54ff58](_0x2ddc('0x71'),'%'+_0x577491['value']+'%',null);}else{_0xf2d65a=_[_0x2ddc('0x69')](_0x536dc0,[_0x2ddc('0x2d'),_0x2ddc('0x72')]);_0x577491[_0x2ddc('0x47')]=_0x2ddc('0x72');_0x4f9efd=as['buildExpression'](_0x3cf890,_0xf2d65a[_0x2ddc('0x38')],_0x577491);_0x342faa[_0x54ff58](_0x4f9efd['text'],_0x4f9efd[_0x2ddc('0x5f')][_0x2ddc('0x6d')],_0x4f9efd['value'][_0x2ddc('0x1e')]);}break;case'body':_0x4f9efd=as[_0x2ddc('0x6b')]('me',null,_0x577491);_0x342faa[_0x54ff58](_0x4f9efd[_0x2ddc('0x6c')],_0x4f9efd['value'][_0x2ddc('0x6d')],_0x4f9efd[_0x2ddc('0x5f')][_0x2ddc('0x1e')]);break;}}else{var _0x4f9efd=as['buildExpression'](_0x3cf890,_0xf2d65a[_0x2ddc('0x38')],_0x577491);_0x342faa[_0x54ff58](_0x4f9efd[_0x2ddc('0x6c')],_0x4f9efd[_0x2ddc('0x5f')]['start'],_0x4f9efd['value'][_0x2ddc('0x1e')]);}}}else{var _0x285485=_(_0x42a42f['query'])['keys']()[_0x2ddc('0x36')](function(_0x35348a){return _[_0x2ddc('0x73')](_0x536dc0,['name',_0x35348a])?_0x35348a:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x285485)){_0x285485[_0x2ddc('0x32')](function(_0x328126){if(_0x328126==='OpenchannelAccountId'){_0x12116[_0x2ddc('0x44')](_0x2ddc('0x74'),[][_0x2ddc('0x75')](_0x42a42f[_0x2ddc('0x3c')][_0x328126]));}else if(_0x328126===_0x2ddc('0x76')){var _0x3ae617=JSON[_0x2ddc('0x77')](_0x42a42f[_0x2ddc('0x3c')][_0x328126])[_0x2ddc('0x78')];var _0x242059=JSON[_0x2ddc('0x77')](_0x42a42f[_0x2ddc('0x3c')][_0x328126])[_0x2ddc('0x79')];_0x12116['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3ae617,_0x242059);}else{if(_0x42a42f[_0x2ddc('0x3c')][_0x328126]==='null'){_0x12116[_0x2ddc('0x44')]('i.'+_0x328126+_0x2ddc('0x7a'));}else{_0x12116[_0x2ddc('0x44')]('i.'+_0x328126+_0x2ddc('0x7b'),_0x42a42f[_0x2ddc('0x3c')][_0x328126]);}}});}if(_0x42a42f[_0x2ddc('0x3c')]['read']){if(_0x42a42f[_0x2ddc('0x3c')]['read']==0x1){_0x12116[_0x2ddc('0x61')](_0x2ddc('0x7c'));}else{_0x12116[_0x2ddc('0x61')](_0x2ddc('0x7d'));}}if(_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x7e')]){_0x44f3cf=_['isArray'](_0x42a42f['query'][_0x2ddc('0x7e')])?_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x7e')]:new Array(_0x42a42f[_0x2ddc('0x3c')]['tag']);_0x44f3cf['forEach'](function(_0x2efcfc){_0x48418b['or'](_0x2ddc('0x7f'),'%,'+_0x2efcfc+',%');});}if(_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x80')]){var _0x4bf7a0=_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x80')]['replace']('\x5c','\x5c\x5c')[_0x2ddc('0x81')](/'/g,'\x27\x27');if(qs[_0x2ddc('0x82')](_0x4bf7a0)){_0x342faa['or']('i.id\x20LIKE\x20?',_0x4bf7a0+'%');}else{_0x342faa['or'](_0x2ddc('0x83'),qs[_0x2ddc('0x84')](_0x4bf7a0))['or']('i.from\x20LIKE\x20?',_0x4bf7a0+'%')['or'](_0x2ddc('0x85'),_0x4bf7a0+'%');}}}_0x12116[_0x2ddc('0x44')](_0x342faa);_0x12116[_0x2ddc('0x86')]('i.id');var _0x179224={'type':db[_0x2ddc('0x87')][_0x2ddc('0x88')][_0x2ddc('0x89')],'raw':!![]};var _0x5b2c08=_0x12116[_0x2ddc('0x8a')]();_0x5b2c08['field'](_0x2ddc('0x8b'));_0x5b2c08[_0x2ddc('0x47')](_0x2ddc('0x8c'),_0x2ddc('0x5e'));if(_0x2f8d9a[_0x2ddc('0x8d')]){_0x2f8d9a['order'][_0x2ddc('0x32')](function(_0x4139ca){var _0x1aa098=_0x4139ca[0x0]==='contactName'?_0x4139ca[0x0]:'i.'+_0x4139ca[0x0];_0x12116[_0x2ddc('0x8d')](_0x1aa098,_0x4139ca[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2ddc('0x8e')](_0x44f3cf)){_0x12116[_0x2ddc('0x61')](_0x48418b);_0x5b2c08[_0x2ddc('0x44')](_0x2ddc('0x8f'),_0x44f3cf);}BPromise['resolve']()[_0x2ddc('0x2a')](function(){if(!_0x13e3ac){if(_0x42a42f['query'][_0x2ddc('0x90')])return;_0x5b2c08['where']('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0x12116[_0x2ddc('0x44')](_0x2ddc('0x91'));return;}if(_0x42a42f[_0x2ddc('0x92')][_0x2ddc('0x93')]!==_0x2ddc('0x94'))return;return _0x42a42f['user'][_0x2ddc('0x95')]({'attributes':['id'],'raw':!![]})[_0x2ddc('0x2a')](function(_0x4af19d){if(_[_0x2ddc('0x8e')](_0x4af19d)){_0x5b2c08[_0x2ddc('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x12116[_0x2ddc('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5b2c08['where'](_0x2ddc('0x74'),_[_0x2ddc('0x36')](_0x4af19d,'id'));_0x12116['where'](_0x2ddc('0x74'),_['map'](_0x4af19d,'id'));}});})['then'](function(){if(_0x42a42f[_0x2ddc('0x92')][_0x2ddc('0x93')]===_0x2ddc('0x94')&&!_0x13e3ac&&!_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x90')])return[];return db[_0x2ddc('0x96')][_0x2ddc('0x3c')](_0x5b2c08[_0x2ddc('0x97')](),_0x179224);})[_0x2ddc('0x2a')](function(_0x374f41){_0x4f0414[_0x2ddc('0x23')]=_0x374f41[_0x2ddc('0x40')];if(_0x4f0414['count']===0x0)return[];return db[_0x2ddc('0x96')][_0x2ddc('0x3c')](_0x2b7f17[_0x2ddc('0x97')](),_0x179224)['then'](function(_0x451f9e){_0x1ac2c6=_['keyBy'](_0x451f9e,'id');_0x179224=_[_0x2ddc('0x98')](_0x179224,{'model':db[_0x2ddc('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x42a42f[_0x2ddc('0x3c')][_0x2ddc('0x3e')]){_0x2f8d9a[_0x2ddc('0x3f')][_0x2ddc('0x32')](function(_0x19d98e){_0x12116[_0x2ddc('0x47')]('i.'+_0x19d98e);});}else{_0x12116[_0x2ddc('0x47')](_0x2ddc('0x8c'),'unreadMessages');_0x12116['field'](_0x2ddc('0x99'),_0x2ddc('0x9a'));_0x12116['field'](_0x2ddc('0x9b'),_0x2ddc('0x9c'));_0x12116[_0x2ddc('0x47')](_0x2ddc('0x9d'),_0x2ddc('0x9e'));_0x12116[_0x2ddc('0x47')]('i.*');_0x12116[_0x2ddc('0x47')](_0x2ddc('0x9f'),_0x2ddc('0xa0'));_0x12116[_0x2ddc('0x47')](_0x2ddc('0xa1'),'Contact.lastName');_0x12116[_0x2ddc('0x47')](_0x2ddc('0xa2'),'Contact.email');_0x12116['field'](_0x2ddc('0xa3'),_0x2ddc('0xa4'));_0x12116[_0x2ddc('0x47')](_0x2ddc('0xa5'),_0x2ddc('0xa6'));_0x12116[_0x2ddc('0x47')]('c.fax','Contact.fax');_0x12116[_0x2ddc('0x47')](_0x2ddc('0xa7'),_0x2ddc('0xa8'));_0x12116['field'](_0x2ddc('0xa9'),_0x2ddc('0xaa'));_0x12116[_0x2ddc('0x47')](_0x2ddc('0xab'),'TagIds');}if(_0x2f8d9a[_0x2ddc('0x22')])_0x12116['limit'](_0x2f8d9a['limit']);if(_0x2f8d9a[_0x2ddc('0x20')])_0x12116[_0x2ddc('0x20')](_0x2f8d9a[_0x2ddc('0x20')]);return db['sequelize'][_0x2ddc('0x3c')](_0x12116[_0x2ddc('0x97')](),_0x179224);})[_0x2ddc('0x2a')](function(_0x5716e3){if(_0x5716e3[_0x2ddc('0x40')]>0x0)_0x166d8c['where'](_0x2ddc('0xac'),_['map'](_0x5716e3,'id'));return db[_0x2ddc('0x96')]['query'](_0x166d8c[_0x2ddc('0x97')](),_0x179224)[_0x2ddc('0x2a')](function(_0x290be6){var _0x328727=_['groupBy'](_0x290be6,'OpenchannelInteractionId');var _0xf40b6=[];_0x5716e3['forEach'](function(_0x338931){_0xf40b6[_0x2ddc('0x33')](updateOpenchannelInteraction(_0x338931,_0x1ac2c6,_0x328727));});return BPromise[_0x2ddc('0xad')](_0xf40b6);});});})['then'](function(_0x1ccf47){_0x4f0414[_0x2ddc('0xae')]=_0x1ccf47;return _0x4f0414;})[_0x2ddc('0x2a')](respondWithFilteredResult(_0x452cac,_0x2f8d9a))[_0x2ddc('0xaf')](handleError(_0x452cac,null));};exports[_0x2ddc('0xb0')]=function(_0x587c91,_0x18b274){var _0x2266e={};if(_0x587c91[_0x2ddc('0x3c')][_0x2ddc('0x38')]&&_0x587c91[_0x2ddc('0x3c')]['type']===_0x2ddc('0x49')){_0x2266e['from']=_0x587c91[_0x2ddc('0xb1')]['id'];}else{_0x2266e['id']=_0x587c91[_0x2ddc('0xb1')]['id'];}var _0x416c61={'raw':![],'where':_0x2266e},_0x26ed47={};_0x26ed47[_0x2ddc('0x3a')]=_[_0x2ddc('0x3b')](db[_0x2ddc('0x37')][_0x2ddc('0xb2')]);_0x26ed47[_0x2ddc('0x3c')]=_['keys'](_0x587c91[_0x2ddc('0x3c')]);_0x26ed47[_0x2ddc('0x45')]=_[_0x2ddc('0x3d')](_0x26ed47[_0x2ddc('0x3a')],_0x26ed47[_0x2ddc('0x3c')]);_0x416c61[_0x2ddc('0x3f')]=_[_0x2ddc('0x3d')](_0x26ed47[_0x2ddc('0x3a')],qs[_0x2ddc('0x3e')](_0x587c91[_0x2ddc('0x3c')]['fields']));_0x416c61[_0x2ddc('0x3f')]=_0x416c61['attributes'][_0x2ddc('0x40')]?_0x416c61[_0x2ddc('0x3f')]:_0x26ed47[_0x2ddc('0x3a')];if(_0x587c91[_0x2ddc('0x3c')]['includeAll']){_0x416c61[_0x2ddc('0xb3')]=[{'all':!![]}];}_0x416c61=_['merge']({},_0x416c61,_0x587c91[_0x2ddc('0xb4')]);return db[_0x2ddc('0x37')][_0x2ddc('0x69')](_0x416c61)[_0x2ddc('0x2a')](handleEntityNotFound(_0x18b274,null))[_0x2ddc('0x2a')](respondWithResult(_0x18b274,null))[_0x2ddc('0xaf')](handleError(_0x18b274,null));};exports[_0x2ddc('0xb5')]=function(_0x229636,_0x114359){return db[_0x2ddc('0x37')][_0x2ddc('0xb5')](_0x229636['body'],{})[_0x2ddc('0x2a')](respondWithResult(_0x114359,0xc9))[_0x2ddc('0xaf')](handleError(_0x114359,null));};exports[_0x2ddc('0x28')]=function(_0x55152e,_0x48235f){if(_0x55152e[_0x2ddc('0xb6')]['id']){delete _0x55152e[_0x2ddc('0xb6')]['id'];}return db[_0x2ddc('0x37')][_0x2ddc('0x69')]({'where':{'id':_0x55152e[_0x2ddc('0xb1')]['id']}})[_0x2ddc('0x2a')](handleEntityNotFound(_0x48235f,null))[_0x2ddc('0x2a')](saveUpdates(_0x55152e[_0x2ddc('0xb6')],null))[_0x2ddc('0x2a')](respondWithResult(_0x48235f,null))[_0x2ddc('0xaf')](handleError(_0x48235f,null));};exports['destroy']=function(_0x32fcb8,_0x4d7202){return db[_0x2ddc('0x37')][_0x2ddc('0x69')]({'where':{'id':_0x32fcb8['params']['id']}})[_0x2ddc('0x2a')](handleEntityNotFound(_0x4d7202,null))[_0x2ddc('0x2a')](removeEntity(_0x4d7202,null))[_0x2ddc('0xaf')](handleError(_0x4d7202,null));};exports[_0x2ddc('0xb7')]=function(_0x22318f,_0x25a674){return db['OpenchannelInteraction'][_0x2ddc('0xb7')]()[_0x2ddc('0x2a')](respondWithResult(_0x25a674,null))['catch'](handleError(_0x25a674,null));};exports[_0x2ddc('0xb8')]=function(_0xc9f9ea,_0x5446ef,_0x590aab){return db[_0x2ddc('0xb9')][_0x2ddc('0x69')]({'where':{'id':_0xc9f9ea[_0x2ddc('0xb1')]['id']}})[_0x2ddc('0x2a')](handleEntityNotFound(_0x5446ef,null))[_0x2ddc('0x2a')](function(_0x45bc65){if(_0x45bc65){return _0x45bc65[_0x2ddc('0xb8')](_0xc9f9ea[_0x2ddc('0xb6')][_0x2ddc('0xba')],_['omit'](_0xc9f9ea[_0x2ddc('0xb6')],[_0x2ddc('0xba'),'id'])||{});}})[_0x2ddc('0x2a')](respondWithResult(_0x5446ef,null))['catch'](handleError(_0x5446ef,null));};exports['getMessages']=function(_0x3c26be,_0xd5f9a4,_0x1cfdf5){var _0x3a9179={'raw':![],'where':{}};var _0x4f4642={};var _0x12727d={'count':0x0,'rows':[]};return db[_0x2ddc('0x37')][_0x2ddc('0xbb')]({'where':{'id':_0x3c26be[_0x2ddc('0xb1')]['id']}})[_0x2ddc('0x2a')](handleEntityNotFound(_0xd5f9a4,null))[_0x2ddc('0x2a')](function(_0xab1bd6){if(_0xab1bd6){_0x4f4642[_0x2ddc('0x3a')]=_[_0x2ddc('0x3b')](db['OpenchannelMessage'][_0x2ddc('0xb2')]);_0x4f4642[_0x2ddc('0x3c')]=_[_0x2ddc('0x3b')](_0x3c26be[_0x2ddc('0x3c')]);_0x4f4642[_0x2ddc('0x45')]=_[_0x2ddc('0x3d')](_0x4f4642[_0x2ddc('0x3a')],_0x4f4642[_0x2ddc('0x3c')]);_0x3a9179['attributes']=_[_0x2ddc('0x3d')](_0x4f4642[_0x2ddc('0x3a')],qs['fields'](_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0x3e')]));_0x3a9179[_0x2ddc('0x3f')]=_0x3a9179[_0x2ddc('0x3f')][_0x2ddc('0x40')]?_0x3a9179[_0x2ddc('0x3f')]:_0x4f4642[_0x2ddc('0x3a')];if(!_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0x41')](_0x2ddc('0x42'))){_0x3a9179[_0x2ddc('0x22')]=qs[_0x2ddc('0x22')](_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0x22')]);_0x3a9179[_0x2ddc('0x20')]=qs[_0x2ddc('0x20')](_0x3c26be['query']['offset']);}_0x3a9179[_0x2ddc('0x8d')]=qs[_0x2ddc('0x43')](_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0x43')]);_0x3a9179[_0x2ddc('0x44')]=qs[_0x2ddc('0x45')](_[_0x2ddc('0xbc')](_0x3c26be[_0x2ddc('0x3c')],_0x4f4642[_0x2ddc('0x45')]));_0x3a9179[_0x2ddc('0x44')][_0x2ddc('0xbd')]=_0xab1bd6['id'];if(_0x3c26be[_0x2ddc('0x3c')]['filter']){_0x3a9179[_0x2ddc('0x44')]=_['merge'](_0x3a9179[_0x2ddc('0x44')],{'$or':_[_0x2ddc('0x36')](_0x3a9179['attributes'],function(_0x368645){var _0x3253ca={};_0x3253ca[_0x368645]={'$like':'%'+_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0x80')]+'%'};return _0x3253ca;})});}if(_0x3c26be[_0x2ddc('0x3c')]['$gte']){var _0x1d28d7=_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0x78')][_0x2ddc('0x66')](',');var _0x2613bb={};_0x2613bb[_0x1d28d7[0x0]]={'$gte':moment(_0x1d28d7[0x1])[_0x2ddc('0xbe')](_0x2ddc('0xbf'))};_0x3a9179['where']=_['merge'](_0x3a9179['where'],_0x2613bb);}_0x3a9179=_[_0x2ddc('0x98')]({},_0x3a9179,_0x3c26be[_0x2ddc('0xb4')]);return db[_0x2ddc('0xb9')]['count']({'where':_0x3a9179[_0x2ddc('0x44')]})[_0x2ddc('0x2a')](function(_0x1053ee){_0x12727d[_0x2ddc('0x23')]=_0x1053ee;if(_0x3c26be[_0x2ddc('0x3c')][_0x2ddc('0xc0')]){_0x3a9179['include']=[{'all':!![]}];}return db[_0x2ddc('0xb9')][_0x2ddc('0xc1')](_0x3a9179);})[_0x2ddc('0x2a')](function(_0x21e59b){_0x12727d['rows']=_0x21e59b;return _0x12727d;});}})[_0x2ddc('0x2a')](respondWithFilteredResult(_0xd5f9a4,_0x3a9179))[_0x2ddc('0xaf')](handleError(_0xd5f9a4,null));};exports['addTags']=function(_0x3cf159,_0x58ce6c,_0x276496){return db[_0x2ddc('0x37')][_0x2ddc('0x69')]({'where':{'id':_0x3cf159[_0x2ddc('0xb1')]['id']}})['then'](handleEntityNotFound(_0x58ce6c,null))['then'](function(_0x38ac3a){if(_0x38ac3a){return _0x38ac3a[_0x2ddc('0xc2')](_0x3cf159[_0x2ddc('0xb6')][_0x2ddc('0xba')],_['omit'](_0x3cf159[_0x2ddc('0xb6')],[_0x2ddc('0xba'),'id'])||{})['spread'](function(){return db[_0x2ddc('0x6e')][_0x2ddc('0xc1')]({'attributes':['id',_0x2ddc('0x2d'),_0x2ddc('0x48')],'where':{'id':_0x3cf159[_0x2ddc('0xb6')][_0x2ddc('0xba')]}});})[_0x2ddc('0x2a')](function(_0x52aaf7){socket[_0x2ddc('0xc3')]('openchannelInteractionTags:save',{'id':Number(_0x3cf159[_0x2ddc('0xb1')]['id']),'tags':_0x52aaf7||[]});return{'id':Number(_0x3cf159[_0x2ddc('0xb1')]['id']),'tags':_0x52aaf7||[]};});}})['then'](respondWithResult(_0x58ce6c,null))['catch'](handleError(_0x58ce6c,null));};exports[_0x2ddc('0xc4')]=function(_0x1c4f97,_0x57c4b8,_0x52eb8e){return db[_0x2ddc('0x37')][_0x2ddc('0x69')]({'where':{'id':_0x1c4f97[_0x2ddc('0xb1')]['id']}})[_0x2ddc('0x2a')](handleEntityNotFound(_0x57c4b8,null))[_0x2ddc('0x2a')](function(_0x269f7b){if(_0x269f7b){return _0x269f7b[_0x2ddc('0xc4')](_0x1c4f97[_0x2ddc('0x3c')]['ids']);}})[_0x2ddc('0x2a')](respondWithStatusCode(_0x57c4b8,null))[_0x2ddc('0xaf')](handleError(_0x57c4b8,null));};exports[_0x2ddc('0xc5')]=function(_0x172f31,_0x2ad8e6){var _0x4f3b62=moment()[_0x2ddc('0xc6')]()[_0x2ddc('0x97')]();var _0x15d37d=path['join'](config[_0x2ddc('0xc7')],_0x2ddc('0xc8'),_0x2ddc('0xc9'),_0x2ddc('0xca'));var _0x151bb7=path[_0x2ddc('0xcb')](config[_0x2ddc('0xc7')],_0x2ddc('0xc8'),_0x2ddc('0xc9'),_0x2ddc('0xcc'));var _0x5d3888=path[_0x2ddc('0xcb')](_0x15d37d,_0x4f3b62);var _0x1d039a=util[_0x2ddc('0xbe')](_0x2ddc('0xcd'),_0x172f31[_0x2ddc('0xb1')]['id'],_0x4f3b62);var _0x5bb44b=path[_0x2ddc('0xcb')](_0x15d37d,_0x1d039a);var _0x40b2f1=[];_0x40b2f1[_0x2ddc('0x33')]({'model':db[_0x2ddc('0x70')],'as':_0x2ddc('0x70'),'attributes':['id',_0x2ddc('0x30')],'raw':!![]});_0x40b2f1[_0x2ddc('0x33')]({'model':db[_0x2ddc('0xce')],'as':'Contact','attributes':['id','firstName','lastName'],'raw':!![]});if(_0x172f31[_0x2ddc('0x3c')]['attachments']){_0x40b2f1['push']({'model':db[_0x2ddc('0xcf')],'as':_0x2ddc('0xcf'),'raw':!![]});}var _0x38e98f=[{'model':db[_0x2ddc('0xb9')],'as':_0x2ddc('0xd0'),'attributes':['id',_0x2ddc('0xb6'),_0x2ddc('0x76'),'direction',_0x2ddc('0xd1'),_0x2ddc('0xd2')],'include':_0x40b2f1}];_0x38e98f[_0x2ddc('0x33')]({'model':db[_0x2ddc('0xd3')],'as':'Account','attributes':['id',_0x2ddc('0x2d')]});_0x38e98f[_0x2ddc('0x33')]({'model':db[_0x2ddc('0x70')],'as':_0x2ddc('0xd4'),'attributes':['id','fullname']});return db[_0x2ddc('0x37')][_0x2ddc('0x69')]({'where':{'id':_0x172f31[_0x2ddc('0xb1')]['id']},'include':_0x38e98f})[_0x2ddc('0x2a')](handleEntityNotFound(_0x2ad8e6,null))[_0x2ddc('0x2a')](function(_0x367335){if(_0x367335){var _0x315897=_0x367335[_0x2ddc('0xd5')]({'plain':!![]});fs[_0x2ddc('0xd6')](_0x5d3888);var _0x2e5272={'channel':_0x2ddc('0xd7'),'account':_0x315897[_0x2ddc('0xd8')]['name'],'agent':_0x315897['Owner']?_0x315897[_0x2ddc('0xd4')][_0x2ddc('0x30')]:_0x2ddc('0xd9'),'createdAt':moment(_0x315897[_0x2ddc('0x76')])[_0x2ddc('0xbe')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2ddc('0x97')](),'closedAt':_0x315897[_0x2ddc('0xda')]?moment(_0x315897[_0x2ddc('0xdb')])['format'](_0x2ddc('0xbf'))['toString']():'','disposition':_0x315897[_0x2ddc('0xdc')],'visibility':_0x315897[_0x2ddc('0xdd')]?'Public':_0x2ddc('0xde'),'messages':_(_0x315897[_0x2ddc('0xd0')])[_0x2ddc('0x80')]({'secret':![]})['map'](function(_0x2ec1cd){if(_0x2ec1cd[_0x2ddc('0xcf')]){var _0x8fc2a4=path[_0x2ddc('0xcb')](_0x151bb7,_0x2ec1cd[_0x2ddc('0xcf')][_0x2ddc('0xdf')]);if(fs[_0x2ddc('0xe0')](_0x8fc2a4)){fs['createReadStream'](_0x8fc2a4)[_0x2ddc('0xe1')](fs['createWriteStream'](path[_0x2ddc('0xcb')](_0x5d3888,_0x2ec1cd[_0x2ddc('0xcf')][_0x2ddc('0xdf')])));}}return{'date':moment(_0x2ec1cd['createdAt'])['format'](_0x2ddc('0xbf'))[_0x2ddc('0x97')](),'sender':_0x2ec1cd[_0x2ddc('0xe2')]==='out'?_0x2ec1cd[_0x2ddc('0x70')]?_0x2ec1cd[_0x2ddc('0x70')]['fullname']:_0x2ddc('0xe3'):_0x2ec1cd['Contact'][_0x2ddc('0xe4')]+(_0x2ec1cd['Contact'][_0x2ddc('0xe5')]?'\x20'+_0x2ec1cd[_0x2ddc('0x63')][_0x2ddc('0xe5')]:''),'body':_0x2ec1cd[_0x2ddc('0xcf')]?_0x2ec1cd[_0x2ddc('0xcf')][_0x2ddc('0xdf')]:_0x2ec1cd[_0x2ddc('0xb6')],'direction':_0x2ec1cd['direction']===_0x2ddc('0xe6')?'A':'C','secret':_0x2ec1cd[_0x2ddc('0xd1')],'read':_0x2ec1cd['read'],'attachment':_0x2ec1cd[_0x2ddc('0xcf')]};})[_0x2ddc('0x5f')]()};return ejs[_0x2ddc('0xe7')](path[_0x2ddc('0xcb')](config[_0x2ddc('0xc7')],_0x2ddc('0xc8'),'views','downloadInteraction.ejs'),{'interaction':_0x2e5272})[_0x2ddc('0x2a')](function(_0x27463c){var _0x269bd6=path['join'](_0x5d3888,_0x2ddc('0xe8')+_0x315897['id']+'-'+_0x4f3b62+_0x2ddc('0xe9'));var _0x1d3bb4={'path':_0x269bd6,'channel':_0x2ddc('0xd7'),'interactionId':_0x315897['id']};return pdf[_0x2ddc('0xea')](_0x27463c,_0x1d3bb4);})[_0x2ddc('0x2a')](function(){return new BPromise(function(_0x5c3918,_0x3e7b69){zipdir(_0x5d3888,{'saveTo':_0x5bb44b},function(_0x38cc71,_0x3e2f72){if(_0x38cc71)return _0x3e7b69(_0x38cc71);return _0x5c3918(_0x3e2f72);});})[_0x2ddc('0x2a')](function(){return new BPromise(function(_0x9a760c,_0x1ab0aa){rimraf(_0x5d3888,function(_0x4bdf9e){if(_0x4bdf9e)_0x1ab0aa(_0x4bdf9e);return _0x9a760c();});});})['then'](function(){return _0x2ad8e6[_0x2ddc('0xc5')](_0x5bb44b,_0x1d039a,function(_0x7cf0d3){if(_0x7cf0d3){console['log'](_0x2ddc('0xeb'),_0x7cf0d3);}else{fs['unlinkSync'](_0x5bb44b);}});});});}else{return _0x2ad8e6[_0x2ddc('0xec')](0xc8);}})['catch'](handleError(_0x2ad8e6,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 1ee2150..5686e0f 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 _0x3996=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch'];(function(_0x2f127e,_0x593881){var _0x4baf44=function(_0x49e088){while(--_0x49e088){_0x2f127e['push'](_0x2f127e['shift']());}};_0x4baf44(++_0x593881);}(_0x3996,0x80));var _0x6399=function(_0x829307,_0xf900a1){_0x829307=_0x829307-0x0;var _0x42d07d=_0x3996[_0x829307];return _0x42d07d;};'use strict';var EventEmitter=require(_0x6399('0x0'));var OpenchannelInteraction=require(_0x6399('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x6399('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x6399('0x3')](0x0);var events={'afterCreate':_0x6399('0x4'),'afterUpdate':_0x6399('0x5'),'afterDestroy':_0x6399('0x6')};function emitEvent(_0x51c552){return function(_0x1edd8a,_0x1af96e,_0x10540c){_0x1edd8a[_0x6399('0x7')]({'attributes':['id'],'raw':!![]})[_0x6399('0x8')](function(_0x3c5275){_0x1edd8a['setDataValue']('Users',_0x3c5275[_0x6399('0x9')](function(_0x3477a4){return{'id':_0x3477a4['id']};}));return OpenchannelMessage[_0x6399('0xa')]({'where':{'OpenchannelInteractionId':_0x1edd8a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6399('0x8')](function(_0xe806fe){_0x1edd8a[_0x6399('0xb')](_0x6399('0xc'),_0xe806fe[_0x6399('0xd')]);OpenchannelInteractionEvents[_0x6399('0xe')](_0x51c552+':'+_0x1edd8a['id'],_0x1edd8a);OpenchannelInteractionEvents[_0x6399('0xe')](_0x51c552,_0x1edd8a);_0x10540c(null);})[_0x6399('0xf')](_0x10540c(null));};}for(var e in events){if(events[_0x6399('0x10')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x6399('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 249b7ff..d7533c2 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 _0x6a82=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed'];(function(_0x29a65d,_0x289c18){var _0xd0e5c=function(_0x95fee3){while(--_0x95fee3){_0x29a65d['push'](_0x29a65d['shift']());}};_0xd0e5c(++_0x289c18);}(_0x6a82,0x1e4));var _0x26a8=function(_0x352165,_0x2e5ed7){_0x352165=_0x352165-0x0;var _0x16e03a=_0x6a82[_0x352165];return _0x16e03a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x26a8('0x0'))(_0x26a8('0x1'));var moment=require('moment');var BPromise=require(_0x26a8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x26a8('0x3'));var config=require(_0x26a8('0x4'));var attributes=require(_0x26a8('0x5'));module[_0x26a8('0x6')]=function(_0x311c95,_0x5e38f2){return _0x311c95[_0x26a8('0x7')](_0x26a8('0x8'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x26a8('0x9'),'collate':_0x26a8('0xa'),'hooks':{'beforeUpdate':function(_0x4abd03,_0x2db0b9,_0x469dd0){if(_0x4abd03[_0x26a8('0xb')](_0x26a8('0xc'))){_0x4abd03[_0x26a8('0xd')]=moment()[_0x26a8('0xe')](_0x26a8('0xf'));}_0x469dd0(null,_0x4abd03);}}});}; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 70eae93..1d64a53 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 _0x52ea=['debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','addTags','omit','spread','AddTags','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','info','OpenchannelInteraction,\x20%s,\x20%s'];(function(_0x3e4825,_0x231016){var _0x2c6f3c=function(_0x4ed9de){while(--_0x4ed9de){_0x3e4825['push'](_0x3e4825['shift']());}};_0x2c6f3c(++_0x231016);}(_0x52ea,0x168));var _0xa52e=function(_0x4cee82,_0x208e67){_0x4cee82=_0x4cee82-0x0;var _0x200c1d=_0x52ea[_0x4cee82];return _0x200c1d;};'use strict';var _=require('lodash');var util=require(_0xa52e('0x0'));var moment=require(_0xa52e('0x1'));var BPromise=require(_0xa52e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa52e('0x3'));var db=require(_0xa52e('0x4'))['db'];var utils=require(_0xa52e('0x5'));var logger=require('../../config/logger')(_0xa52e('0x6'));var config=require(_0xa52e('0x7'));var jayson=require(_0xa52e('0x8'));var client=jayson[_0xa52e('0x9')][_0xa52e('0xa')]({'port':0x232a});config['redis']=_[_0xa52e('0xb')](config[_0xa52e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xa52e('0xd'))(new Redis(config[_0xa52e('0xc')]));require('./openchannelInteraction.socket')[_0xa52e('0xe')](socket);function respondWithRpcPromise(_0x369209,_0x205395,_0x2c8ef7){return new BPromise(function(_0x20007f,_0x5d12c9){return client[_0xa52e('0xf')](_0x369209,_0x2c8ef7)['then'](function(_0x324e2e){logger[_0xa52e('0x10')](_0xa52e('0x11'),_0x205395,'request\x20sent');logger[_0xa52e('0x12')](_0xa52e('0x13'),_0x205395,_0xa52e('0x14'),JSON['stringify'](_0x324e2e));if(_0x324e2e[_0xa52e('0x15')]){if(_0x324e2e[_0xa52e('0x15')][_0xa52e('0x16')]===0x1f4){logger[_0xa52e('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x205395,_0x324e2e[_0xa52e('0x15')][_0xa52e('0x17')]);return _0x5d12c9(_0x324e2e[_0xa52e('0x15')][_0xa52e('0x17')]);}logger[_0xa52e('0x15')](_0xa52e('0x11'),_0x205395,_0x324e2e[_0xa52e('0x15')]['message']);return _0x20007f(_0x324e2e[_0xa52e('0x15')][_0xa52e('0x17')]);}else{logger['info'](_0xa52e('0x11'),_0x205395,_0xa52e('0x14'));_0x20007f(_0x324e2e[_0xa52e('0x18')][_0xa52e('0x17')]);}})[_0xa52e('0x19')](function(_0x33e047){logger[_0xa52e('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x205395,_0x33e047);_0x5d12c9(_0x33e047);});});}exports[_0xa52e('0x1a')]=function(_0x504a23){var _0x5d485f=this;return new Promise(function(_0x9d5b64,_0x1ad7bc){return db[_0xa52e('0x1b')][_0xa52e('0x1c')](_0x504a23[_0xa52e('0x1d')],{'raw':_0x504a23['options']?_0x504a23[_0xa52e('0x1e')][_0xa52e('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x504a23[_0xa52e('0x1e')]?_0x504a23['options'][_0xa52e('0x20')]||null:null,'attributes':_0x504a23[_0xa52e('0x1e')]?_0x504a23[_0xa52e('0x1e')][_0xa52e('0x21')]||null:null,'limit':_0x504a23[_0xa52e('0x1e')]?_0x504a23[_0xa52e('0x1e')][_0xa52e('0x22')]||null:null})[_0xa52e('0x23')](function(_0x31a6ca){logger['info'](_0xa52e('0x1a'),_0x504a23);logger[_0xa52e('0x12')](_0xa52e('0x1a'),_0x504a23,JSON['stringify'](_0x31a6ca));_0x9d5b64(_0x31a6ca);})[_0xa52e('0x19')](function(_0x279d0a){logger[_0xa52e('0x15')](_0xa52e('0x1a'),_0x279d0a[_0xa52e('0x17')],_0x504a23);_0x1ad7bc(_0x5d485f['error'](0x1f4,_0x279d0a['message']));});});};exports[_0xa52e('0x24')]=function(_0x431333){return new Promise(function(_0x1c1627,_0x1768d1){return db[_0xa52e('0x1b')]['find']({'where':_0x431333[_0xa52e('0x1e')]?_0x431333['options']['where']||null:null})[_0xa52e('0x23')](function(_0x40e0b9){if(_0x40e0b9){return _0x40e0b9[_0xa52e('0x25')](_0x431333['body']['ids'],_[_0xa52e('0x26')](_0x431333['body'],['ids','id'])||{});}})[_0xa52e('0x27')](function(_0xcabfe2){logger[_0xa52e('0x10')](_0xa52e('0x28'),_0x431333);logger['debug'](_0xa52e('0x28'),_0x431333,JSON[_0xa52e('0x29')](_0xcabfe2));_0x1c1627(_0xcabfe2);})[_0xa52e('0x19')](function(_0x15f7b2){logger['error'](_0xa52e('0x28'),_0x15f7b2['message'],_0x431333);_0x1768d1(_this[_0xa52e('0x15')](0x1f4,_0x15f7b2['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 76f06bc..446f64a 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 _0x2897=['register','./openchannelInteraction.events','remove','update','emit','removeListener'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x2897,0x121));var _0x7289=function(_0x4d5c2f,_0x38ba1d){_0x4d5c2f=_0x4d5c2f-0x0;var _0x5b547c=_0x2897[_0x4d5c2f];return _0x5b547c;};'use strict';var OpenchannelInteractionEvents=require(_0x7289('0x0'));var events=['save',_0x7289('0x1'),_0x7289('0x2')];function createListener(_0x2325da,_0x1d72ef){return function(_0x197fdb){_0x1d72ef[_0x7289('0x3')](_0x2325da,_0x197fdb);};}function removeListener(_0x231c8c,_0x3f401b){return function(){OpenchannelInteractionEvents[_0x7289('0x4')](_0x231c8c,_0x3f401b);};}exports[_0x7289('0x5')]=function(_0x1fbb4b){for(var _0x3797a7=0x0,_0x1c807a=events['length'];_0x3797a7<_0x1c807a;_0x3797a7++){var _0x4be19c=events[_0x3797a7];var _0x24a6ea=createListener('openchannelInteraction:'+_0x4be19c,_0x1fbb4b);OpenchannelInteractionEvents['on'](_0x4be19c,_0x24a6ea);}}; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 2ff9eca..71e5e78 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 _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x2b9dad,_0x41a594){var _0x3f70c4=function(_0x1fd273){while(--_0x1fd273){_0x2b9dad['push'](_0x2b9dad['shift']());}};_0x3f70c4(++_0x41a594);}(_0xe706,0xa3));var _0x6e70=function(_0x463f29,_0x315360){_0x463f29=_0x463f29-0x0;var _0x516d9b=_0xe706[_0x463f29];return _0x516d9b;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index e25a51c..290466b 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 _0x9563=['BOOLEAN','ENUM','DATE','TEXT','sequelize','exports','medium'];(function(_0x4c190d,_0x5b9e3b){var _0x1e72c4=function(_0x1ca2a0){while(--_0x1ca2a0){_0x4c190d['push'](_0x4c190d['shift']());}};_0x1e72c4(++_0x5b9e3b);}(_0x9563,0x1e7));var _0x3956=function(_0xec0de7,_0x11ede3){_0xec0de7=_0xec0de7-0x0;var _0x2b5529=_0x9563[_0xec0de7];return _0x2b5529;};'use strict';var Sequelize=require(_0x3956('0x0'));module[_0x3956('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3956('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x3956('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3956('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3956('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x3956('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3956('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 1f5fed0..3762f7e 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 _0xbcba=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','json','limit','undefined','count','offset','Content-Range','apply','save','destroy','end','name','index','map','OpenchannelMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','filter','where','merge','options','includeAll','include','findAll','catch','params','rawAttributes','find','create','body','update','describe','accept','openchannel','read','readAt','format','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','fullname','email','internal','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','contact','User','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x541600,_0x3d3619){var _0x1f277f=function(_0x7cc82){while(--_0x7cc82){_0x541600['push'](_0x541600['shift']());}};_0x1f277f(++_0x3d3619);}(_0xbcba,0x6d));var _0xabcb=function(_0x397832,_0x1274c2){_0x397832=_0x397832-0x0;var _0x4bd0fb=_0xbcba[_0x397832];return _0x4bd0fb;};'use strict';var emlformat=require(_0xabcb('0x0'));var rimraf=require(_0xabcb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xabcb('0x2'));var rp=require(_0xabcb('0x3'));var moment=require(_0xabcb('0x4'));var BPromise=require(_0xabcb('0x5'));var Mustache=require(_0xabcb('0x6'));var util=require(_0xabcb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xabcb('0x8'));var ejs=require(_0xabcb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xabcb('0xa'));var crypto=require(_0xabcb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xabcb('0x8'));var querystring=require('querystring');var Papa=require(_0xabcb('0xc'));var Redis=require(_0xabcb('0xd'));var authService=require(_0xabcb('0xe'));var qs=require(_0xabcb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabcb('0x10'));var logger=require(_0xabcb('0x11'))(_0xabcb('0x12'));var utils=require(_0xabcb('0x13'));var config=require(_0xabcb('0x14'));var licenseUtil=require(_0xabcb('0x15'));var db=require(_0xabcb('0x16'))['db'];config[_0xabcb('0x17')]=_['defaults'](config[_0xabcb('0x17')],{'host':_0xabcb('0x18'),'port':0x18eb});var socket=require(_0xabcb('0x19'))(new Redis(config[_0xabcb('0x17')]));require(_0xabcb('0x1a'))[_0xabcb('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xabcb('0x1c')][_0xabcb('0x1d')]({'port':0x232c});var client9002=jayson[_0xabcb('0x1c')][_0xabcb('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x29c6f4,_0x40ee1b,_0x22a10c,_0x233048){return new BPromise(function(_0x19032f,_0x25b67e){var _0x48dd27=_0x233048||client;return _0x48dd27[_0xabcb('0x1e')](_0x29c6f4,_0x22a10c)[_0xabcb('0x1f')](function(_0x314016){logger[_0xabcb('0x20')](_0xabcb('0x21'),_0x40ee1b,_0xabcb('0x22'));logger[_0xabcb('0x23')](_0xabcb('0x24'),_0x40ee1b,_0xabcb('0x22'),JSON[_0xabcb('0x25')](_0x314016));if(_0x314016[_0xabcb('0x26')]){if(_0x314016[_0xabcb('0x26')][_0xabcb('0x27')]===0x1f4){logger[_0xabcb('0x26')]('OpenchannelMessage,\x20%s,\x20%s',_0x40ee1b,_0x314016['error']['message']);return _0x25b67e(_0x314016[_0xabcb('0x26')][_0xabcb('0x28')]);}logger[_0xabcb('0x26')](_0xabcb('0x21'),_0x40ee1b,_0x314016[_0xabcb('0x26')]['message']);return _0x19032f(_0x314016[_0xabcb('0x26')]['message']);}else{logger['info'](_0xabcb('0x21'),_0x40ee1b,_0xabcb('0x22'));_0x19032f(_0x314016[_0xabcb('0x29')][_0xabcb('0x28')]);}})['catch'](function(_0xf7ddfb){logger[_0xabcb('0x26')](_0xabcb('0x21'),_0x40ee1b,_0xf7ddfb);_0x25b67e(_0xf7ddfb);});});}function respondWithStatusCode(_0x117ee6,_0x4b6a46){_0x4b6a46=_0x4b6a46||0xcc;return function(_0x461866){if(_0x461866){return _0x117ee6[_0xabcb('0x2a')](_0x4b6a46);}return _0x117ee6['status'](_0x4b6a46)['end']();};}function respondWithResult(_0x1b0938,_0x5e5533){_0x5e5533=_0x5e5533||0xc8;return function(_0x1bbf15){if(_0x1bbf15){return _0x1b0938[_0xabcb('0x2b')](_0x5e5533)[_0xabcb('0x2c')](_0x1bbf15);}};}function respondWithFilteredResult(_0xe6a539,_0x342383){return function(_0x279f03){if(_0x279f03){var _0x3ce398=typeof _0x342383['offset']==='undefined'&&typeof _0x342383[_0xabcb('0x2d')]===_0xabcb('0x2e');var _0x531bae=_0x279f03[_0xabcb('0x2f')];var _0x1d848b=_0x3ce398?0x0:_0x342383[_0xabcb('0x30')];var _0xa1b649=_0x3ce398?_0x279f03[_0xabcb('0x2f')]:_0x342383[_0xabcb('0x30')]+_0x342383['limit'];var _0x18f014;if(_0xa1b649>=_0x531bae){_0xa1b649=_0x531bae;_0x18f014=0xc8;}else{_0x18f014=0xce;}_0xe6a539[_0xabcb('0x2b')](_0x18f014);return _0xe6a539['set'](_0xabcb('0x31'),_0x1d848b+'-'+_0xa1b649+'/'+_0x531bae)[_0xabcb('0x2c')](_0x279f03);}return null;};}function patchUpdates(_0x49aff7){return function(_0xf94b8a){try{jsonpatch[_0xabcb('0x32')](_0xf94b8a,_0x49aff7,!![]);}catch(_0x4e704e){return BPromise['reject'](_0x4e704e);}return _0xf94b8a[_0xabcb('0x33')]();};}function saveUpdates(_0x539d44,_0x3e1b0f){return function(_0x575c24){if(_0x575c24){return _0x575c24['update'](_0x539d44)['then'](function(_0x1d950c){return _0x1d950c;});}return null;};}function removeEntity(_0x30e963,_0x24b90c){return function(_0x54f3ab){if(_0x54f3ab){return _0x54f3ab[_0xabcb('0x34')]()[_0xabcb('0x1f')](function(){_0x30e963[_0xabcb('0x2b')](0xcc)[_0xabcb('0x35')]();});}};}function handleEntityNotFound(_0x4aea88,_0x4827d6){return function(_0x28b0f9){if(!_0x28b0f9){_0x4aea88[_0xabcb('0x2a')](0x194);}return _0x28b0f9;};}function handleError(_0x4f32f0,_0x2d415b){_0x2d415b=_0x2d415b||0x1f4;return function(_0x114c3c){logger[_0xabcb('0x26')](_0x114c3c['stack']);if(_0x114c3c[_0xabcb('0x36')]){delete _0x114c3c[_0xabcb('0x36')];}_0x4f32f0[_0xabcb('0x2b')](_0x2d415b)['send'](_0x114c3c);};}exports[_0xabcb('0x37')]=function(_0x2a1d6e,_0x3d643f){var _0x49f790={},_0x2597bb={},_0x441f16={'count':0x0,'rows':[]};var _0xfb7484=_[_0xabcb('0x38')](db[_0xabcb('0x39')]['rawAttributes'],function(_0x4421cc){return{'name':_0x4421cc[_0xabcb('0x3a')],'type':_0x4421cc[_0xabcb('0x3b')][_0xabcb('0x3c')]};});_0x2597bb[_0xabcb('0x3d')]=_['map'](_0xfb7484,_0xabcb('0x36'));_0x2597bb[_0xabcb('0x3e')]=_[_0xabcb('0x3f')](_0x2a1d6e[_0xabcb('0x3e')]);_0x2597bb[_0xabcb('0x40')]=_[_0xabcb('0x41')](_0x2597bb[_0xabcb('0x3d')],_0x2597bb[_0xabcb('0x3e')]);_0x49f790[_0xabcb('0x42')]=_[_0xabcb('0x41')](_0x2597bb[_0xabcb('0x3d')],qs[_0xabcb('0x43')](_0x2a1d6e['query']['fields']));_0x49f790[_0xabcb('0x42')]=_0x49f790['attributes'][_0xabcb('0x44')]?_0x49f790['attributes']:_0x2597bb['model'];if(!_0x2a1d6e['query'][_0xabcb('0x45')]('nolimit')){_0x49f790['limit']=qs[_0xabcb('0x2d')](_0x2a1d6e[_0xabcb('0x3e')]['limit']);_0x49f790[_0xabcb('0x30')]=qs[_0xabcb('0x30')](_0x2a1d6e[_0xabcb('0x3e')]['offset']);}_0x49f790['order']=qs[_0xabcb('0x46')](_0x2a1d6e[_0xabcb('0x3e')][_0xabcb('0x46')]);_0x49f790['where']=qs['filters'](_['pick'](_0x2a1d6e[_0xabcb('0x3e')],_0x2597bb['filters']),_0xfb7484);if(_0x2a1d6e[_0xabcb('0x3e')][_0xabcb('0x47')]){_0x49f790[_0xabcb('0x48')]=_['merge'](_0x49f790[_0xabcb('0x48')],{'$or':_['map'](_0xfb7484,function(_0xf9d2f0){if(_0xf9d2f0['type']!=='VIRTUAL'){var _0x1fa411={};_0x1fa411[_0xf9d2f0[_0xabcb('0x36')]]={'$like':'%'+_0x2a1d6e[_0xabcb('0x3e')]['filter']+'%'};return _0x1fa411;}})});}_0x49f790=_[_0xabcb('0x49')]({},_0x49f790,_0x2a1d6e[_0xabcb('0x4a')]);var _0x4cf824={'where':_0x49f790['where']};return db[_0xabcb('0x39')][_0xabcb('0x2f')](_0x4cf824)[_0xabcb('0x1f')](function(_0x5f2a3d){_0x441f16[_0xabcb('0x2f')]=_0x5f2a3d;if(_0x2a1d6e[_0xabcb('0x3e')][_0xabcb('0x4b')]){_0x49f790[_0xabcb('0x4c')]=[{'all':!![]}];}return db[_0xabcb('0x39')][_0xabcb('0x4d')](_0x49f790);})[_0xabcb('0x1f')](function(_0x4e0a33){_0x441f16['rows']=_0x4e0a33;return _0x441f16;})['then'](respondWithFilteredResult(_0x3d643f,_0x49f790))[_0xabcb('0x4e')](handleError(_0x3d643f,null));};exports['show']=function(_0x534696,_0x1a4a09){var _0x264799={'raw':!![],'where':{'id':_0x534696[_0xabcb('0x4f')]['id']}},_0x24f9d6={};_0x24f9d6['model']=_[_0xabcb('0x3f')](db[_0xabcb('0x39')][_0xabcb('0x50')]);_0x24f9d6[_0xabcb('0x3e')]=_[_0xabcb('0x3f')](_0x534696['query']);_0x24f9d6[_0xabcb('0x40')]=_['intersection'](_0x24f9d6[_0xabcb('0x3d')],_0x24f9d6[_0xabcb('0x3e')]);_0x264799[_0xabcb('0x42')]=_[_0xabcb('0x41')](_0x24f9d6[_0xabcb('0x3d')],qs[_0xabcb('0x43')](_0x534696[_0xabcb('0x3e')][_0xabcb('0x43')]));_0x264799[_0xabcb('0x42')]=_0x264799[_0xabcb('0x42')][_0xabcb('0x44')]?_0x264799['attributes']:_0x24f9d6[_0xabcb('0x3d')];if(_0x534696[_0xabcb('0x3e')]['includeAll']){_0x264799[_0xabcb('0x4c')]=[{'all':!![]}];}_0x264799=_[_0xabcb('0x49')]({},_0x264799,_0x534696[_0xabcb('0x4a')]);return db[_0xabcb('0x39')][_0xabcb('0x51')](_0x264799)['then'](handleEntityNotFound(_0x1a4a09,null))['then'](respondWithResult(_0x1a4a09,null))[_0xabcb('0x4e')](handleError(_0x1a4a09,null));};exports[_0xabcb('0x52')]=function(_0x530401,_0x3a3104){return db[_0xabcb('0x39')][_0xabcb('0x52')](_0x530401[_0xabcb('0x53')],{})['then'](respondWithResult(_0x3a3104,0xc9))[_0xabcb('0x4e')](handleError(_0x3a3104,null));};exports[_0xabcb('0x54')]=function(_0x4a0112,_0x2f1f96){if(_0x4a0112[_0xabcb('0x53')]['id']){delete _0x4a0112[_0xabcb('0x53')]['id'];}return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x4a0112[_0xabcb('0x4f')]['id']}})[_0xabcb('0x1f')](handleEntityNotFound(_0x2f1f96,null))[_0xabcb('0x1f')](saveUpdates(_0x4a0112['body'],null))[_0xabcb('0x1f')](respondWithResult(_0x2f1f96,null))[_0xabcb('0x4e')](handleError(_0x2f1f96,null));};exports['destroy']=function(_0x58ed05,_0x311f5e){return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x58ed05[_0xabcb('0x4f')]['id']}})[_0xabcb('0x1f')](handleEntityNotFound(_0x311f5e,null))['then'](removeEntity(_0x311f5e,null))['catch'](handleError(_0x311f5e,null));};exports[_0xabcb('0x55')]=function(_0x3e4133,_0x341eb3){return db['OpenchannelMessage'][_0xabcb('0x55')]()[_0xabcb('0x1f')](respondWithResult(_0x341eb3,null))[_0xabcb('0x4e')](handleError(_0x341eb3,null));};var interaction_log=require(_0xabcb('0x11'))('openchannel-interactions');exports[_0xabcb('0x56')]=function(_0x366eae,_0x9f4be1,_0x361cc7){var _0x13b3f4={'agent':{},'channel':_0xabcb('0x57')};if(_0x366eae['body']['id']){delete _0x366eae[_0xabcb('0x53')]['id'];}_0x366eae[_0xabcb('0x53')][_0xabcb('0x58')]=!![];_0x366eae[_0xabcb('0x53')][_0xabcb('0x59')]=moment()[_0xabcb('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x366eae['body'][_0xabcb('0x5b')]=_0x366eae['body'][_0xabcb('0x5b')]||_0x366eae[_0xabcb('0x5c')]['id'];_0x13b3f4[_0xabcb('0x5d')]['id']=_0x366eae['body'][_0xabcb('0x5b')];return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x366eae['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x9f4be1,null))['then'](saveUpdates(_0x366eae[_0xabcb('0x53')],null))[_0xabcb('0x1f')](function(_0x50c6b6){if(_0x50c6b6){_0x13b3f4[_0xabcb('0x28')]=_0x50c6b6[_0xabcb('0x5e')]({'plain':!![]});return db[_0xabcb('0x5f')][_0xabcb('0x51')]({'where':{'id':_0x50c6b6[_0xabcb('0x60')]}});}return null;})[_0xabcb('0x1f')](handleEntityNotFound(_0x9f4be1,null))['then'](function(_0x4d2b77){if(_0x4d2b77){return _0x4d2b77['update']({'UserId':_0x366eae[_0xabcb('0x53')][_0xabcb('0x5b')],'read1stAt':_[_0xabcb('0x61')](_0x4d2b77[_0xabcb('0x62')])?moment()[_0xabcb('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xabcb('0x1f')](function(_0x277168){if(_0x277168){_0x13b3f4[_0xabcb('0x63')]=_0x277168[_0xabcb('0x5e')]({'plain':!![]});interaction_log[_0xabcb('0x20')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x366eae[_0xabcb('0x5c')]['id'],_0x366eae[_0xabcb('0x5c')][_0xabcb('0x36')],_0x366eae['user'][_0xabcb('0x64')],_0x13b3f4[_0xabcb('0x63')]['id'],_0x366eae[_0xabcb('0x53')]?JSON[_0xabcb('0x25')](_0x366eae[_0xabcb('0x53')]):_0xabcb('0x65'));return respondWithRpcPromise(_0xabcb('0x66'),_0xabcb('0x67'),_0x13b3f4);}return null;})[_0xabcb('0x1f')](function(_0x346bb8){var _0x30cc41='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x346bb8[_0xabcb('0x28')][_0xabcb('0x68')];return db[_0xabcb('0x69')]['query'](_0x30cc41,{'type':db[_0xabcb('0x6a')][_0xabcb('0x6b')]['SELECT'],'raw':!![]})[_0xabcb('0x1f')](function(_0x2d1427){return _0x2d1427;});})[_0xabcb('0x1f')](function(_0x5ef058){if(_0x5ef058){_0x13b3f4[_0xabcb('0x28')]['contact']=_0x5ef058[0x0];if(!_0x366eae[_0xabcb('0x53')][_0xabcb('0x5b')])return;return db['User'][_0xabcb('0x51')]({'where':{'id':_0x366eae[_0xabcb('0x53')][_0xabcb('0x5b')],'role':'agent'},'attributes':['id',_0xabcb('0x36'),_0xabcb('0x6c'),_0xabcb('0x6d'),_0xabcb('0x6e')],'raw':!![]});}return null;})[_0xabcb('0x1f')](function(_0x3f25b4){if(!_0x3f25b4)return null;_0x13b3f4[_0xabcb('0x28')][_0xabcb('0x5d')]=_0x3f25b4;return _0x13b3f4;})[_0xabcb('0x1f')](function(_0x5c9b7a){if(_0x5c9b7a){if(_0x366eae[_0xabcb('0x53')]['manual']){_0x13b3f4[_0xabcb('0x28')][_0xabcb('0x6f')]=util['format'](_0xabcb('0x70'),_0x366eae[_0xabcb('0x5c')][_0xabcb('0x36')]);_0x13b3f4[_0xabcb('0x28')][_0xabcb('0x71')]=_0x13b3f4['channel'];_0x13b3f4['message']['motionChannel']=_0x13b3f4[_0xabcb('0x71')];_0x13b3f4['message'][_0xabcb('0x72')]=_0xabcb('0x56');return respondWithRpcPromise(_0xabcb('0x73'),'EventManager',{'event':_0xabcb('0x74'),'message':_0x13b3f4[_0xabcb('0x28')]},client9002)[_0xabcb('0x1f')](function(){return _0x13b3f4;});}return _0x13b3f4;}return null;})[_0xabcb('0x1f')](respondWithResult(_0x9f4be1,null))[_0xabcb('0x4e')](handleError(_0x9f4be1,null));};var interaction_log=require(_0xabcb('0x11'))('openchannel-interactions');exports[_0xabcb('0x75')]=function(_0x3bc6ba,_0xf330ad,_0x3731e5){var _0x5cc09b={'agent':{},'channel':_0xabcb('0x57')};if(_0x3bc6ba[_0xabcb('0x53')]['id']){delete _0x3bc6ba[_0xabcb('0x53')]['id'];}_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')]=_0x3bc6ba[_0xabcb('0x53')]['UserId']||_0x3bc6ba[_0xabcb('0x5c')]['id'];_0x5cc09b[_0xabcb('0x5d')]['id']=_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')];return db[_0xabcb('0x39')][_0xabcb('0x51')]({'where':{'id':_0x3bc6ba[_0xabcb('0x4f')]['id'],'UserId':null}})[_0xabcb('0x1f')](handleEntityNotFound(_0xf330ad,null))[_0xabcb('0x1f')](function(_0x24672f){if(_0x24672f){_0x5cc09b['message']=_0x24672f[_0xabcb('0x5e')]({'plain':!![]});return db[_0xabcb('0x5f')][_0xabcb('0x51')]({'where':{'id':_0x24672f[_0xabcb('0x60')]}});}return null;})[_0xabcb('0x1f')](handleEntityNotFound(_0xf330ad,null))[_0xabcb('0x1f')](function(_0x5eb2a4){if(_0x5eb2a4){_0x5cc09b[_0xabcb('0x63')]=_0x5eb2a4['get']({'plain':!![]});interaction_log[_0xabcb('0x20')](_0xabcb('0x76'),_0x3bc6ba[_0xabcb('0x5c')]['id'],_0x3bc6ba[_0xabcb('0x5c')]['name'],_0x3bc6ba[_0xabcb('0x5c')]['role'],_0x5cc09b['interaction']['id'],_0x3bc6ba[_0xabcb('0x53')]?JSON[_0xabcb('0x25')](_0x3bc6ba[_0xabcb('0x53')]):_0xabcb('0x65'));return respondWithRpcPromise(_0xabcb('0x77'),_0xabcb('0x78'),_0x5cc09b);}return null;})[_0xabcb('0x1f')](function(_0x584e35){var _0x4ee15c=_0xabcb('0x79')+_0x584e35[_0xabcb('0x28')][_0xabcb('0x68')];return db[_0xabcb('0x69')]['query'](_0x4ee15c,{'type':db[_0xabcb('0x6a')][_0xabcb('0x6b')][_0xabcb('0x7a')],'raw':!![]})['then'](function(_0x404e16){return _0x404e16;});})[_0xabcb('0x1f')](function(_0x1e1e34){if(_0x1e1e34){_0x5cc09b[_0xabcb('0x28')][_0xabcb('0x7b')]=_0x1e1e34[0x0];if(!_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')])return;return db[_0xabcb('0x7c')]['find']({'where':{'id':_0x3bc6ba[_0xabcb('0x53')][_0xabcb('0x5b')],'role':_0xabcb('0x5d')},'attributes':['id','name',_0xabcb('0x6c'),'email',_0xabcb('0x6e')],'raw':!![]});}return null;})[_0xabcb('0x1f')](function(_0x28fc9e){if(!_0x28fc9e)return null;_0x5cc09b[_0xabcb('0x28')][_0xabcb('0x5d')]=_0x28fc9e;return _0x5cc09b;})[_0xabcb('0x1f')](function(_0x54c404){if(_0x54c404){_0x54c404['message'][_0xabcb('0x6f')]=util[_0xabcb('0x5a')](_0xabcb('0x70'),_0x3bc6ba[_0xabcb('0x5c')][_0xabcb('0x36')]);_0x54c404[_0xabcb('0x28')][_0xabcb('0x71')]=_0x5cc09b[_0xabcb('0x71')];_0x54c404[_0xabcb('0x28')]['motionChannel']=_0x5cc09b[_0xabcb('0x71')];_0x54c404['message'][_0xabcb('0x72')]=_0xabcb('0x75');respondWithRpcPromise(_0xabcb('0x73'),_0xabcb('0x73'),{'event':_0xabcb('0x7d'),'message':_0x54c404[_0xabcb('0x28')]},client9002);return _0x5cc09b;}return null;})[_0xabcb('0x1f')](respondWithResult(_0xf330ad,null))[_0xabcb('0x4e')](handleError(_0xf330ad,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index dae826d..6373ba7 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 _0xb631=['exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x293ac7,_0x4e735c){var _0xd69cb2=function(_0xd83b94){while(--_0xd83b94){_0x293ac7['push'](_0x293ac7['shift']());}};_0xd69cb2(++_0x4e735c);}(_0xb631,0x140));var _0x1b63=function(_0x5a61d5,_0x54141c){_0x5a61d5=_0x5a61d5-0x0;var _0x130e7c=_0xb631[_0x5a61d5];return _0x130e7c;};'use strict';var EventEmitter=require(_0x1b63('0x0'));var OpenchannelMessage=require(_0x1b63('0x1'))['db'][_0x1b63('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1b63('0x3')](0x0);var events={'afterCreate':_0x1b63('0x4'),'afterUpdate':_0x1b63('0x5'),'afterDestroy':_0x1b63('0x6')};function emitEvent(_0x5c0750){return function(_0x28ad95,_0x388219,_0x2d9936){OpenchannelMessageEvents[_0x1b63('0x7')](_0x5c0750+':'+_0x28ad95['id'],_0x28ad95);OpenchannelMessageEvents[_0x1b63('0x7')](_0x5c0750,_0x28ad95);_0x2d9936(null);};}for(var e in events){if(events[_0x1b63('0x8')](e)){var event=events[e];OpenchannelMessage[_0x1b63('0x9')](e,emitEvent(event));}}module[_0x1b63('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9451fce..b4e9ae7 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 _0x4fc2=['length','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri'];(function(_0x21c810,_0x75203b){var _0x26adf2=function(_0x40288b){while(--_0x40288b){_0x21c810['push'](_0x21c810['shift']());}};_0x26adf2(++_0x75203b);}(_0x4fc2,0x111));var _0x24fc=function(_0x1a0967,_0x51bc82){_0x1a0967=_0x1a0967-0x0;var _0x5a169f=_0x4fc2[_0x1a0967];return _0x5a169f;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[{'name':_0x24fc('0xb'),'fields':[_0x24fc('0xc')],'type':_0x24fc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47349b,_0x5afdf1,_0x44caca){var _0x1819a5=_0x26fcc6[_0x24fc('0xe')];var _0x133438=_0x47349b[_0x24fc('0xf')]({'plain':!![]});if(_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()==='in'||_0x133438[_0x24fc('0x10')]['toLowerCase']()===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]&&!_['isNil'](_0x133438[_0x24fc('0x14')])){_0x1819a5[_0x24fc('0x15')][_0x24fc('0x16')]({'where':{'id':_0x133438[_0x24fc('0x17')]}})[_0x24fc('0x18')](function(_0x326276){if(_0x326276){_0x326276['update']({'lastMsgAt':_0x133438[_0x24fc('0x19')],'lastMsgDirection':_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()});}})[_0x24fc('0x1a')](function(_0x4acd36){console[_0x24fc('0x1b')](_0x4acd36);});}if(_0x133438['direction']===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]){var _0x218fb6;_0x1819a5[_0x24fc('0x1c')][_0x24fc('0x1d')]()['then'](function(_0x23873c){return _0x1819a5[_0x24fc('0x1e')][_0x24fc('0x1f')]({'where':{'id':_0x133438[_0x24fc('0x20')]},'include':[{'model':_0x1819a5['OpenchannelInteraction'],'as':_0x24fc('0x21'),'where':{'id':_0x133438[_0x24fc('0x17')]},'limit':0x1,'include':[{'model':_0x1819a5[_0x24fc('0x1c')],'as':'Contact','attributes':_[_0x24fc('0x22')](_0x23873c)}]}]});})[_0x24fc('0x18')](function(_0xbf1d6b){_0x218fb6=_0xbf1d6b[_0x24fc('0xf')]({'plain':!![]});if(_0x218fb6&&_0x218fb6['replyUri']){logger[_0x24fc('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x24fc('0x24'),util['format'](_0x24fc('0x25'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x218fb6[_0x24fc('0x21')]&&_0x218fb6['Interactions'][_0x24fc('0x27')]){_0x133438['Interaction']=_[_0x24fc('0x28')](_0x218fb6[_0x24fc('0x21')][0x0],_0x24fc('0x29'));_0x133438[_0x24fc('0x29')]=_0x218fb6[_0x24fc('0x21')][0x0][_0x24fc('0x29')];}var _0x5afdf1={'method':_0x24fc('0x2a'),'uri':encodeURI(_0x218fb6[_0x24fc('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5afdf1[_0x24fc('0x2b')]){case'GET':_0x5afdf1['qs']=_0x133438;break;case _0x24fc('0x2a'):_0x5afdf1[_0x24fc('0xc')]=_0x133438;break;}return rp(_0x5afdf1)[_0x24fc('0x18')](function(_0x5bb4c8){logger[_0x24fc('0x23')](_0x24fc('0x2c'),_0x24fc('0x24'),util[_0x24fc('0x2d')](_0x24fc('0x2e'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x5bb4c8['body'][_0x24fc('0x2f')]&&_0x5bb4c8[_0x24fc('0xc')][_0x24fc('0x2f')]!=_0x133438[_0x24fc('0x30')][_0x24fc('0x2f')]){return _0x1819a5['OpenchannelInteraction']['update']({'threadId':_0x5bb4c8['body'][_0x24fc('0x2f')]},{'logging':!![],'where':{'id':_0x133438['Interaction']['id']}});}else{return;}})[_0x24fc('0x18')](function(){return _0x47349b[_0x24fc('0x31')]({'read':!![]});})[_0x24fc('0x1a')](function(_0x2086c0){logger['error'](_0x24fc('0x2c'),_0x24fc('0x24'),util['inspect'](_0x2086c0,{'showHidden':![],'depth':null}));_0x44caca();});}else{_0x44caca();}})[_0x24fc('0x32')](function(){_0x44caca();});}else{_0x44caca();}}},'charset':_0x24fc('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +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 diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b37d2b1..ee592e7 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 _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(_0x4b8997,_0x1cb02b){var _0x526b87=function(_0x235196){while(--_0x235196){_0x4b8997['push'](_0x4b8997['shift']());}};_0x526b87(++_0x1cb02b);}(_0xadb5,0xad));var _0x5adb=function(_0x18ee22,_0x11bcf1){_0x18ee22=_0x18ee22-0x0;var _0x5a6442=_0xadb5[_0x18ee22];return _0x5a6442;};'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 +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 diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 1f15d20..b445e7b 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 _0xf2e0=['save','update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x43f916,_0x1162db){var _0x24beb3=function(_0x552713){while(--_0x552713){_0x43f916['push'](_0x43f916['shift']());}};_0x24beb3(++_0x1162db);}(_0xf2e0,0xc7));var _0x0f2e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xf2e0[_0x297fd3];return _0x2af381;};'use strict';var OpenchannelMessageEvents=require(_0x0f2e('0x0'));var events=[_0x0f2e('0x1'),'remove',_0x0f2e('0x2')];function createListener(_0x359e6e,_0x48b292){return function(_0x3261d6){_0x48b292[_0x0f2e('0x3')](_0x359e6e,_0x3261d6);};}function removeListener(_0x363be3,_0x4d60de){return function(){OpenchannelMessageEvents[_0x0f2e('0x4')](_0x363be3,_0x4d60de);};}exports[_0x0f2e('0x5')]=function(_0x256aba){for(var _0x47c448=0x0,_0x51a040=events[_0x0f2e('0x6')];_0x47c448<_0x51a040;_0x47c448++){var _0x53de0f=events[_0x47c448];var _0x1e28ed=createListener(_0x0f2e('0x7')+_0x53de0f,_0x256aba);OpenchannelMessageEvents['on'](_0x53de0f,_0x1e28ed);}}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 381e8aa..00faae0 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 _0x63f3=['put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0x63f3,0x87));var _0x363f=function(_0x3a8db5,_0x31cff7){_0x3a8db5=_0x3a8db5-0x0;var _0x2c03cd=_0x63f3[_0x3a8db5];return _0x2c03cd;};'use strict';var multer=require(_0x363f('0x0'));var util=require(_0x363f('0x1'));var path=require(_0x363f('0x2'));var timeout=require(_0x363f('0x3'));var express=require('express');var router=express[_0x363f('0x4')]();var fs_extra=require(_0x363f('0x5'));var auth=require(_0x363f('0x6'));var interaction=require(_0x363f('0x7'));var config=require(_0x363f('0x8'));var controller=require(_0x363f('0x9'));router[_0x363f('0xa')]('/',auth[_0x363f('0xb')](),controller[_0x363f('0xc')]);router[_0x363f('0xa')](_0x363f('0xd'),auth[_0x363f('0xb')](),controller[_0x363f('0xe')]);router[_0x363f('0xa')](_0x363f('0xf'),auth['isAuthenticated'](),controller[_0x363f('0x10')]);router['get'](_0x363f('0x11'),auth[_0x363f('0xb')](),controller['getMembers']);router[_0x363f('0xa')](_0x363f('0x12'),auth[_0x363f('0xb')](),controller[_0x363f('0x13')]);router[_0x363f('0xa')](_0x363f('0x14'),auth[_0x363f('0xb')](),controller[_0x363f('0x15')]);router[_0x363f('0x16')]('/',auth[_0x363f('0xb')](),controller['create']);router['post'](_0x363f('0x12'),auth['isAuthenticated'](),controller[_0x363f('0x17')]);router[_0x363f('0x16')](_0x363f('0x14'),auth[_0x363f('0xb')](),controller[_0x363f('0x18')]);router[_0x363f('0x19')]('/:id',auth[_0x363f('0xb')](),controller[_0x363f('0x1a')]);router[_0x363f('0x1b')](_0x363f('0xf'),auth[_0x363f('0xb')](),controller[_0x363f('0x1c')]);router[_0x363f('0x1b')]('/:id/teams',auth[_0x363f('0xb')](),controller[_0x363f('0x1d')]);router[_0x363f('0x1b')](_0x363f('0x14'),auth['isAuthenticated'](),controller[_0x363f('0x1e')]);module[_0x363f('0x1f')]=router; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index e8a4d2c..e30c9f5 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 _0x90c1=['STRING','INTEGER','ENUM','beepall','roundrobin','exports','name'];(function(_0x48271f,_0xc4f6d3){var _0x13eb5c=function(_0x1a4acd){while(--_0x1a4acd){_0x48271f['push'](_0x48271f['shift']());}};_0x13eb5c(++_0xc4f6d3);}(_0x90c1,0xc2));var _0x190c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x90c1[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');module[_0x190c('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x190c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x190c('0x2')]},'timeout':{'type':Sequelize[_0x190c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x190c('0x4')]('rrmemory',_0x190c('0x5'),_0x190c('0x6'))}}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5953a78..44ed17e 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 _0x3800=['limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','OpenchannelQueue','includeAll','findAll','show','params','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','describe','getMembers','findOne','UserOpenchannelQueue','User','findAndCountAll','UserId','agent','openchannelPause','rows','format','%s/%s','SIP','getTeams','ids','Team','Agents','online','voicePause','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','addAgents','spread','isArray','userOpenchannelQueue:remove','getAgents','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','json','undefined','count','offset','set','Content-Range','apply','reject','update','then','get','OpenchannelQueues','UserProfileResource','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit'];(function(_0x2ea183,_0x3cff11){var _0x47c16c=function(_0x3d91e5){while(--_0x3d91e5){_0x2ea183['push'](_0x2ea183['shift']());}};_0x47c16c(++_0x3cff11);}(_0x3800,0x1ee));var _0x0380=function(_0x2e30e1,_0x11c4f2){_0x2e30e1=_0x2e30e1-0x0;var _0xe01f3f=_0x3800[_0x2e30e1];return _0xe01f3f;};'use strict';var emlformat=require(_0x0380('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0380('0x1'));var moment=require(_0x0380('0x2'));var BPromise=require(_0x0380('0x3'));var Mustache=require(_0x0380('0x4'));var util=require(_0x0380('0x5'));var path=require(_0x0380('0x6'));var sox=require('sox');var csv=require(_0x0380('0x7'));var ejs=require(_0x0380('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0380('0x9'));var squel=require(_0x0380('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0380('0xb'));var toCsv=require(_0x0380('0x7'));var querystring=require(_0x0380('0xc'));var Papa=require(_0x0380('0xd'));var Redis=require(_0x0380('0xe'));var authService=require(_0x0380('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x0380('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0380('0x11'))(_0x0380('0x12'));var utils=require('../../config/utils');var config=require(_0x0380('0x13'));var licenseUtil=require(_0x0380('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0380('0x15')](config[_0x0380('0x16')],{'host':_0x0380('0x17'),'port':0x18eb});var socket=require(_0x0380('0x18'))(new Redis(config[_0x0380('0x16')]));require(_0x0380('0x19'))[_0x0380('0x1a')](socket);function respondWithStatusCode(_0x56b328,_0x1da003){_0x1da003=_0x1da003||0xcc;return function(_0x3c7aed){if(_0x3c7aed){return _0x56b328[_0x0380('0x1b')](_0x1da003);}return _0x56b328[_0x0380('0x1c')](_0x1da003)['end']();};}function respondWithResult(_0x24fde5,_0x6ed74d){_0x6ed74d=_0x6ed74d||0xc8;return function(_0x579139){if(_0x579139){return _0x24fde5[_0x0380('0x1c')](_0x6ed74d)[_0x0380('0x1d')](_0x579139);}};}function respondWithFilteredResult(_0x34bcda,_0x2a74e4){return function(_0x513927){if(_0x513927){var _0x5dfa32=typeof _0x2a74e4['offset']===_0x0380('0x1e')&&typeof _0x2a74e4['limit']===_0x0380('0x1e');var _0x115471=_0x513927[_0x0380('0x1f')];var _0x353bd6=_0x5dfa32?0x0:_0x2a74e4[_0x0380('0x20')];var _0x56a340=_0x5dfa32?_0x513927[_0x0380('0x1f')]:_0x2a74e4[_0x0380('0x20')]+_0x2a74e4['limit'];var _0x16d63d;if(_0x56a340>=_0x115471){_0x56a340=_0x115471;_0x16d63d=0xc8;}else{_0x16d63d=0xce;}_0x34bcda[_0x0380('0x1c')](_0x16d63d);return _0x34bcda[_0x0380('0x21')](_0x0380('0x22'),_0x353bd6+'-'+_0x56a340+'/'+_0x115471)[_0x0380('0x1d')](_0x513927);}return null;};}function patchUpdates(_0x387166){return function(_0x4c788){try{jsonpatch[_0x0380('0x23')](_0x4c788,_0x387166,!![]);}catch(_0x150985){return BPromise[_0x0380('0x24')](_0x150985);}return _0x4c788['save']();};}function saveUpdates(_0x5a99a7,_0x443c36){return function(_0x26aff5){if(_0x26aff5){return _0x26aff5[_0x0380('0x25')](_0x5a99a7)[_0x0380('0x26')](function(_0x3060bc){return _0x3060bc;});}return null;};}function removeEntity(_0x1e6d76,_0x40a60d){return function(_0x8ee5fe){if(_0x8ee5fe){return _0x8ee5fe['destroy']()[_0x0380('0x26')](function(){var _0x4f6ddc=_0x8ee5fe[_0x0380('0x27')]({'plain':!![]});var _0x2b7ae6=_0x0380('0x28');return db[_0x0380('0x29')][_0x0380('0x2a')]({'where':{'type':_0x2b7ae6,'resourceId':_0x4f6ddc['id']}})['then'](function(){return _0x8ee5fe;});})[_0x0380('0x26')](function(){_0x1e6d76[_0x0380('0x1c')](0xcc)[_0x0380('0x2b')]();});}};}function handleEntityNotFound(_0x41f319,_0x332eb6){return function(_0x3fff26){if(!_0x3fff26){_0x41f319['sendStatus'](0x194);}return _0x3fff26;};}function handleError(_0x3e57a3,_0x57ce35){_0x57ce35=_0x57ce35||0x1f4;return function(_0x2b80b2){logger[_0x0380('0x2c')](_0x2b80b2[_0x0380('0x2d')]);if(_0x2b80b2[_0x0380('0x2e')]){delete _0x2b80b2[_0x0380('0x2e')];}_0x3e57a3[_0x0380('0x1c')](_0x57ce35)[_0x0380('0x2f')](_0x2b80b2);};}exports[_0x0380('0x30')]=function(_0x2fb47e,_0x315015){var _0x173cec={},_0x505072={},_0x3da76d={'count':0x0,'rows':[]};var _0x41dda7=_[_0x0380('0x31')](db['OpenchannelQueue'][_0x0380('0x32')],function(_0x2f548d){return{'name':_0x2f548d[_0x0380('0x33')],'type':_0x2f548d['type'][_0x0380('0x34')]};});_0x505072[_0x0380('0x35')]=_[_0x0380('0x31')](_0x41dda7,_0x0380('0x2e'));_0x505072['query']=_[_0x0380('0x36')](_0x2fb47e[_0x0380('0x37')]);_0x505072[_0x0380('0x38')]=_['intersection'](_0x505072[_0x0380('0x35')],_0x505072[_0x0380('0x37')]);_0x173cec[_0x0380('0x39')]=_[_0x0380('0x3a')](_0x505072[_0x0380('0x35')],qs[_0x0380('0x3b')](_0x2fb47e[_0x0380('0x37')]['fields']));_0x173cec['attributes']=_0x173cec[_0x0380('0x39')]['length']?_0x173cec[_0x0380('0x39')]:_0x505072[_0x0380('0x35')];if(!_0x2fb47e[_0x0380('0x37')][_0x0380('0x3c')](_0x0380('0x3d'))){_0x173cec[_0x0380('0x3e')]=qs['limit'](_0x2fb47e[_0x0380('0x37')][_0x0380('0x3e')]);_0x173cec[_0x0380('0x20')]=qs[_0x0380('0x20')](_0x2fb47e[_0x0380('0x37')]['offset']);}_0x173cec[_0x0380('0x3f')]=qs[_0x0380('0x40')](_0x2fb47e[_0x0380('0x37')][_0x0380('0x40')]);_0x173cec[_0x0380('0x41')]=qs[_0x0380('0x38')](_[_0x0380('0x42')](_0x2fb47e[_0x0380('0x37')],_0x505072[_0x0380('0x38')]),_0x41dda7);if(_0x2fb47e[_0x0380('0x37')][_0x0380('0x43')]){_0x173cec[_0x0380('0x41')]=_[_0x0380('0x44')](_0x173cec[_0x0380('0x41')],{'$or':_[_0x0380('0x31')](_0x41dda7,function(_0x4431a2){if(_0x4431a2[_0x0380('0x45')]!==_0x0380('0x46')){var _0x512c8d={};_0x512c8d[_0x4431a2[_0x0380('0x2e')]]={'$like':'%'+_0x2fb47e[_0x0380('0x37')][_0x0380('0x43')]+'%'};return _0x512c8d;}})});}_0x173cec=_['merge']({},_0x173cec,_0x2fb47e[_0x0380('0x47')]);var _0x2250db={'where':_0x173cec['where']};return db[_0x0380('0x48')]['count'](_0x2250db)[_0x0380('0x26')](function(_0x53d0e3){_0x3da76d[_0x0380('0x1f')]=_0x53d0e3;if(_0x2fb47e[_0x0380('0x37')][_0x0380('0x49')]){_0x173cec['include']=[{'all':!![]}];}return db['OpenchannelQueue'][_0x0380('0x4a')](_0x173cec);})['then'](function(_0x13e3fa){_0x3da76d['rows']=_0x13e3fa;return _0x3da76d;})['then'](respondWithFilteredResult(_0x315015,_0x173cec))['catch'](handleError(_0x315015,null));};exports[_0x0380('0x4b')]=function(_0x3ce934,_0x5939c8){var _0x4ff330={'raw':!![],'where':{'id':_0x3ce934[_0x0380('0x4c')]['id']}},_0x5123fa={};_0x5123fa[_0x0380('0x35')]=_[_0x0380('0x36')](db[_0x0380('0x48')][_0x0380('0x32')]);_0x5123fa['query']=_[_0x0380('0x36')](_0x3ce934['query']);_0x5123fa[_0x0380('0x38')]=_[_0x0380('0x3a')](_0x5123fa[_0x0380('0x35')],_0x5123fa[_0x0380('0x37')]);_0x4ff330[_0x0380('0x39')]=_[_0x0380('0x3a')](_0x5123fa[_0x0380('0x35')],qs[_0x0380('0x3b')](_0x3ce934['query'][_0x0380('0x3b')]));_0x4ff330[_0x0380('0x39')]=_0x4ff330[_0x0380('0x39')][_0x0380('0x4d')]?_0x4ff330[_0x0380('0x39')]:_0x5123fa['model'];if(_0x3ce934[_0x0380('0x37')]['includeAll']){_0x4ff330['include']=[{'all':!![]}];}_0x4ff330=_[_0x0380('0x44')]({},_0x4ff330,_0x3ce934[_0x0380('0x47')]);return db[_0x0380('0x48')][_0x0380('0x4e')](_0x4ff330)['then'](handleEntityNotFound(_0x5939c8,null))['then'](respondWithResult(_0x5939c8,null))[_0x0380('0x4f')](handleError(_0x5939c8,null));};exports[_0x0380('0x50')]=function(_0x4318df,_0x4c84fc){return db[_0x0380('0x48')][_0x0380('0x50')](_0x4318df[_0x0380('0x51')],{})['then'](function(_0x4a6f3c){var _0x3f8430=_0x4318df['user'][_0x0380('0x27')]({'plain':!![]});if(!_0x3f8430)throw new Error(_0x0380('0x52'));if(_0x3f8430['role']===_0x0380('0x53')){var _0x12633f=_0x4a6f3c[_0x0380('0x27')]({'plain':!![]});var _0xc05432='OpenchannelQueues';return db[_0x0380('0x54')]['find']({'where':{'name':_0xc05432,'userProfileId':_0x3f8430[_0x0380('0x55')]},'raw':!![]})['then'](function(_0x517f18){if(_0x517f18&&_0x517f18[_0x0380('0x56')]===0x0){return db[_0x0380('0x29')][_0x0380('0x50')]({'name':_0x12633f[_0x0380('0x2e')],'resourceId':_0x12633f['id'],'type':_0x517f18[_0x0380('0x2e')],'sectionId':_0x517f18['id']},{})[_0x0380('0x26')](function(){return _0x4a6f3c;});}else{return _0x4a6f3c;}})[_0x0380('0x4f')](function(_0x23656e){logger[_0x0380('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x23656e);throw _0x23656e;});}return _0x4a6f3c;})[_0x0380('0x26')](respondWithResult(_0x4c84fc,0xc9))['catch'](handleError(_0x4c84fc,null));};exports[_0x0380('0x25')]=function(_0x179559,_0x3d8b40){if(_0x179559[_0x0380('0x51')]['id']){delete _0x179559['body']['id'];}return db['OpenchannelQueue']['find']({'where':{'id':_0x179559[_0x0380('0x4c')]['id']}})[_0x0380('0x26')](handleEntityNotFound(_0x3d8b40,null))[_0x0380('0x26')](saveUpdates(_0x179559[_0x0380('0x51')],null))[_0x0380('0x26')](respondWithResult(_0x3d8b40,null))['catch'](handleError(_0x3d8b40,null));};exports['destroy']=function(_0x3f0892,_0x48d7f6){return db[_0x0380('0x48')]['find']({'where':{'id':_0x3f0892[_0x0380('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48d7f6,null))[_0x0380('0x26')](removeEntity(_0x48d7f6,null))[_0x0380('0x4f')](handleError(_0x48d7f6,null));};exports['describe']=function(_0x5915f0,_0x139dfe){return db[_0x0380('0x48')][_0x0380('0x57')]()[_0x0380('0x26')](respondWithResult(_0x139dfe,null))[_0x0380('0x4f')](handleError(_0x139dfe,null));};exports[_0x0380('0x58')]=function(_0x3f3738,_0xfa2494,_0x542b2f){var _0x372465={'raw':!![],'where':{}},_0x5a8aab={},_0xbb8704;return db[_0x0380('0x48')][_0x0380('0x59')]({'where':{'id':_0x3f3738[_0x0380('0x4c')]['id']}})[_0x0380('0x26')](handleEntityNotFound(_0xfa2494,null))[_0x0380('0x26')](function(_0x9e2c08){if(_0x9e2c08){_0xbb8704=_0x9e2c08[_0x0380('0x27')]({'plain':!![]});_0x5a8aab['model']=_[_0x0380('0x36')](db['UserOpenchannelQueue'][_0x0380('0x32')]);_0x5a8aab[_0x0380('0x37')]=_['keys'](_0x3f3738[_0x0380('0x37')]);_0x5a8aab['filters']=_['intersection'](_0x5a8aab[_0x0380('0x35')],_0x5a8aab[_0x0380('0x37')]);_0x372465['attributes']=_[_0x0380('0x3a')](_0x5a8aab[_0x0380('0x35')],qs['fields'](_0x3f3738['query']['fields']));_0x372465[_0x0380('0x39')]=_0x372465[_0x0380('0x39')]['length']?_0x372465['attributes']:_0x5a8aab[_0x0380('0x35')];if(!_0x3f3738[_0x0380('0x37')]['hasOwnProperty'](_0x0380('0x3d'))){_0x372465[_0x0380('0x3e')]=qs[_0x0380('0x3e')](_0x3f3738['query'][_0x0380('0x3e')]);_0x372465[_0x0380('0x20')]=qs[_0x0380('0x20')](_0x3f3738['query'][_0x0380('0x20')]);}_0x372465['order']=qs[_0x0380('0x40')](_0x3f3738[_0x0380('0x37')][_0x0380('0x40')]);_0x372465[_0x0380('0x41')]=qs[_0x0380('0x38')](_[_0x0380('0x42')](_0x3f3738[_0x0380('0x37')],_0x5a8aab[_0x0380('0x38')]));_0x372465[_0x0380('0x41')]['OpenchannelQueueId']=_0x9e2c08['id'];if(_0x3f3738['query']['filter']){_0x372465[_0x0380('0x41')]=_[_0x0380('0x44')](_0x372465[_0x0380('0x41')],{'$or':_[_0x0380('0x31')](_0x372465[_0x0380('0x39')],function(_0x298be8){var _0x182920={};_0x182920[_0x298be8]={'$like':'%'+_0x3f3738[_0x0380('0x37')]['filter']+'%'};return _0x182920;})});}_0x372465=_[_0x0380('0x44')]({},_0x372465,_0x3f3738[_0x0380('0x47')]);return db[_0x0380('0x5a')][_0x0380('0x4a')](_0x372465);}})['then'](function(_0x16a4d7){if(_0x16a4d7){return db[_0x0380('0x5b')][_0x0380('0x5c')]({'where':{'id':_[_0x0380('0x31')](_0x16a4d7,_0x0380('0x5d')),'role':_0x0380('0x5e')},'attributes':['id',_0x0380('0x2e'),_0x0380('0x5f'),'updatedAt','createdAt']});}})[_0x0380('0x26')](function(_0x1de233){if(_0x1de233){return{'count':_0x1de233['count'],'rows':_[_0x0380('0x31')](_0x1de233[_0x0380('0x60')],function(_0x57b0a7){return{'membername':_0x57b0a7[_0x0380('0x2e')],'UserId':_0x57b0a7['id'],'queue_name':_0xbb8704[_0x0380('0x2e')],'OpenchannelQueueId':_0xbb8704['id'],'interface':util[_0x0380('0x61')](_0x0380('0x62'),_0x0380('0x63'),_0x57b0a7['name']),'penalty':0x0,'paused':_0x57b0a7['openchannelPause'],'createdAt':_0x57b0a7['createdAt'],'updatedAt':_0x57b0a7['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x0380('0x26')](respondWithFilteredResult(_0xfa2494,_0x372465))['catch'](handleError(_0xfa2494,null));};exports[_0x0380('0x64')]=function(_0x131172,_0x4cd0a0,_0x4e2190){var _0x63e947={};var _0x2f3ce0={};var _0x21bc22;var _0x20dda6;return db[_0x0380('0x48')][_0x0380('0x59')]({'where':{'id':_0x131172[_0x0380('0x4c')]['id']}})[_0x0380('0x26')](handleEntityNotFound(_0x4cd0a0,null))[_0x0380('0x26')](function(_0x55ffa4){if(_0x55ffa4){_0x21bc22=_0x55ffa4;_0x2f3ce0[_0x0380('0x35')]=_[_0x0380('0x36')](db['Team']['rawAttributes']);_0x2f3ce0[_0x0380('0x37')]=_[_0x0380('0x36')](_0x131172[_0x0380('0x37')]);_0x2f3ce0[_0x0380('0x38')]=_['intersection'](_0x2f3ce0[_0x0380('0x35')],_0x2f3ce0[_0x0380('0x37')]);_0x63e947[_0x0380('0x39')]=_[_0x0380('0x3a')](_0x2f3ce0[_0x0380('0x35')],qs[_0x0380('0x3b')](_0x131172[_0x0380('0x37')][_0x0380('0x3b')]));_0x63e947[_0x0380('0x39')]=_0x63e947[_0x0380('0x39')]['length']?_0x63e947[_0x0380('0x39')]:_0x2f3ce0[_0x0380('0x35')];_0x63e947[_0x0380('0x3f')]=qs['sort'](_0x131172[_0x0380('0x37')][_0x0380('0x40')]);_0x63e947['where']=qs[_0x0380('0x38')](_['pick'](_0x131172['query'],_0x2f3ce0[_0x0380('0x38')]));if(_0x131172[_0x0380('0x37')][_0x0380('0x43')]){_0x63e947[_0x0380('0x41')]=_[_0x0380('0x44')](_0x63e947[_0x0380('0x41')],{'$or':_['map'](_0x63e947[_0x0380('0x39')],function(_0x563daa){var _0x451ce2={};_0x451ce2[_0x563daa]={'$like':'%'+_0x131172['query']['filter']+'%'};return _0x451ce2;})});}_0x63e947=_[_0x0380('0x44')]({},_0x63e947,_0x131172[_0x0380('0x47')]);return _0x21bc22['getTeams'](_0x63e947);}})[_0x0380('0x26')](function(_0x5b422a){if(_0x5b422a){_0x20dda6=_0x5b422a[_0x0380('0x4d')];if(!_0x131172['query']['hasOwnProperty']('nolimit')){_0x63e947[_0x0380('0x3e')]=qs['limit'](_0x131172['query'][_0x0380('0x3e')]);_0x63e947[_0x0380('0x20')]=qs['offset'](_0x131172[_0x0380('0x37')][_0x0380('0x20')]);}return _0x21bc22[_0x0380('0x64')](_0x63e947);}})[_0x0380('0x26')](function(_0x1af7a7){if(_0x1af7a7){return _0x1af7a7?{'count':_0x20dda6,'rows':_0x1af7a7}:null;}})[_0x0380('0x26')](respondWithResult(_0x4cd0a0,null))['catch'](handleError(_0x4cd0a0,null));};exports['addTeams']=function(_0x433ea0,_0x480088,_0xaf3c5){var _0x131041=_0x433ea0[_0x0380('0x51')][_0x0380('0x65')];return db[_0x0380('0x66')][_0x0380('0x4a')]({'where':{'id':_0x131041},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0380('0x67'),'attributes':['id',_0x0380('0x2e'),_0x0380('0x68'),_0x0380('0x69'),'interface'],'raw':!![]}]})[_0x0380('0x26')](function(_0xe564ba){if(_0xe564ba){var _0x17a6a7=_[_0x0380('0x6a')](_0xe564ba,function(_0x47f28b){var _0x32a55d=_0x47f28b['get']({'plain':!![]});return _0x32a55d[_0x0380('0x67')];});return db[_0x0380('0x48')][_0x0380('0x4e')]({'where':{'id':_0x433ea0[_0x0380('0x4c')]['id']}})[_0x0380('0x26')](function(_0x54ce40){return db[_0x0380('0x6b')][_0x0380('0x6c')](function(_0x2410bc){return _0x54ce40['addTeams'](_0x131041,{'transaction':_0x2410bc})[_0x0380('0x26')](function(){return BPromise[_0x0380('0x6d')](_0x17a6a7,function(_0x143495){return db[_0x0380('0x5a')][_0x0380('0x6e')]({'where':{'UserId':_0x143495['id'],'OpenchannelQueueId':_0x433ea0[_0x0380('0x4c')]['id']},'transaction':_0x2410bc});});})[_0x0380('0x26')](function(){_0x17a6a7[_0x0380('0x6f')](function(_0x41e15f){socket[_0x0380('0x70')](_0x0380('0x71'),{'UserId':_0x41e15f['id'],'OpenchannelQueueId':_0x54ce40['id']});});});});});}})[_0x0380('0x26')](respondWithStatusCode(_0x480088,null))[_0x0380('0x4f')](handleError(_0x480088,null));};exports['removeTeams']=function(_0x87154f,_0xce5dca,_0x33af62){return db['Team']['findAll']({'where':{'id':_0x87154f[_0x0380('0x37')][_0x0380('0x65')]},'attributes':['id'],'include':[{'model':db[_0x0380('0x5b')],'as':_0x0380('0x67'),'attributes':['id'],'raw':!![]}]})[_0x0380('0x26')](handleEntityNotFound(_0xce5dca,null))[_0x0380('0x26')](function(_0x40cf91){var _0x5b2e98=_[_0x0380('0x31')](_0x40cf91,'id');var _0x45e4cf=[];var _0x1b4e89=[];var _0x5dfcf0=squel[_0x0380('0x72')]();_0x5dfcf0[_0x0380('0x73')](_0x0380('0x74'))[_0x0380('0x75')](_0x0380('0x76'),'tq')[_0x0380('0x77')](_0x0380('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0380('0x41')]('OpenchannelQueueId\x20=\x20?',_0x87154f[_0x0380('0x4c')]['id']);for(var _0x4dd606=0x0;_0x4dd606<_0x40cf91[_0x0380('0x4d')];_0x4dd606+=0x1){let _0x141abe=_0x40cf91[_0x4dd606];for(var _0x3cdee2=0x0;_0x3cdee2<_0x141abe[_0x0380('0x67')][_0x0380('0x4d')];_0x3cdee2+=0x1){let _0x3c40ab=_0x141abe[_0x0380('0x67')][_0x3cdee2];var _0xaad385=_0x5dfcf0['clone']();_0xaad385['where'](_0x0380('0x79'),_0x3c40ab['id']);_0x1b4e89[_0x0380('0x7a')](db[_0x0380('0x6b')][_0x0380('0x37')](_0xaad385[_0x0380('0x7b')](),{'type':db['sequelize'][_0x0380('0x7c')]['SELECT']})[_0x0380('0x26')](function(_0x454c8f){if(_0x454c8f[_0x0380('0x4d')]===0x1){return _0x3c40ab['id'];}else{var _0x185faa=_[_0x0380('0x7d')](_[_0x0380('0x31')](_0x454c8f,_0x0380('0x7e')),function(_0xbec7a4){return _[_0x0380('0x7f')](_0x5b2e98,_0xbec7a4);});if(_0x185faa){return _0x3c40ab['id'];}}}));}}return BPromise[_0x0380('0x80')](_0x1b4e89)[_0x0380('0x26')](function(_0x4139aa){_0x45e4cf=_(_0x45e4cf)[_0x0380('0x81')](_0x4139aa)['compact']()[_0x0380('0x82')]();return db[_0x0380('0x48')][_0x0380('0x4e')]({'where':{'id':_0x87154f['params']['id']}})[_0x0380('0x26')](function(_0x35659f){return db['sequelize']['transaction'](function(_0x1abcd1){return _0x35659f[_0x0380('0x83')](_0x87154f[_0x0380('0x37')][_0x0380('0x65')],{'transaction':_0x1abcd1})[_0x0380('0x26')](function(){if(!_[_0x0380('0x84')](_0x45e4cf)){return _0x35659f[_0x0380('0x85')](_0x45e4cf,{'transaction':_0x1abcd1});}})[_0x0380('0x26')](function(){_0x45e4cf[_0x0380('0x6f')](function(_0x133948){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x133948,'OpenchannelQueueId':_0x35659f['id']});});});});});});})[_0x0380('0x26')](respondWithStatusCode(_0xce5dca,null))[_0x0380('0x4f')](handleError(_0xce5dca,null));};exports[_0x0380('0x86')]=function(_0x447f42,_0x7828fd,_0x173c60){return db[_0x0380('0x48')][_0x0380('0x4e')]({'where':{'id':_0x447f42['params']['id']}})[_0x0380('0x26')](handleEntityNotFound(_0x7828fd,null))[_0x0380('0x26')](function(_0x5839ca){if(_0x5839ca){return _0x5839ca[_0x0380('0x86')](_0x447f42['body']['ids'],_['omit'](_0x447f42[_0x0380('0x51')],['ids','id'])||{})[_0x0380('0x87')](function(_0x394952){for(var _0x336a04=0x0;_0x336a04<_0x447f42['body'][_0x0380('0x65')]['length'];_0x336a04+=0x1){socket[_0x0380('0x70')](_0x0380('0x71'),{'UserId':Number(_0x447f42[_0x0380('0x51')][_0x0380('0x65')][_0x336a04]),'OpenchannelQueueId':Number(_0x447f42[_0x0380('0x4c')]['id'])});}return _0x394952;});}})['then'](respondWithResult(_0x7828fd,null))[_0x0380('0x4f')](handleError(_0x7828fd,null));};exports[_0x0380('0x85')]=function(_0x2ae80a,_0x4e949e,_0x1956fa){return db['OpenchannelQueue'][_0x0380('0x4e')]({'where':{'id':_0x2ae80a[_0x0380('0x4c')]['id']}})[_0x0380('0x26')](handleEntityNotFound(_0x4e949e,null))[_0x0380('0x26')](function(_0x598a8a){if(_0x598a8a){return _0x598a8a[_0x0380('0x85')](_0x2ae80a[_0x0380('0x37')][_0x0380('0x65')])[_0x0380('0x26')](function(){if(_[_0x0380('0x88')](_0x2ae80a[_0x0380('0x37')][_0x0380('0x65')])){for(var _0x2862c5=0x0;_0x2862c5<_0x2ae80a[_0x0380('0x37')][_0x0380('0x65')][_0x0380('0x4d')];_0x2862c5+=0x1){socket[_0x0380('0x70')](_0x0380('0x89'),{'UserId':Number(_0x2ae80a[_0x0380('0x37')][_0x0380('0x65')][_0x2862c5]),'OpenchannelQueueId':Number(_0x2ae80a['params']['id'])});}}else{socket[_0x0380('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2ae80a[_0x0380('0x37')]['ids']),'OpenchannelQueueId':Number(_0x2ae80a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e949e,null))[_0x0380('0x4f')](handleError(_0x4e949e,null));};exports[_0x0380('0x8a')]=function(_0x4e3a42,_0x5a7e24,_0x4795ed){var _0x411aa5={};var _0x34e64c={};var _0x9517a7;var _0x40e4ca;return db['OpenchannelQueue'][_0x0380('0x59')]({'where':{'id':_0x4e3a42[_0x0380('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5a7e24,null))['then'](function(_0x2c2c77){if(_0x2c2c77){_0x9517a7=_0x2c2c77;_0x34e64c[_0x0380('0x35')]=_['keys'](db[_0x0380('0x5b')][_0x0380('0x32')]);_0x34e64c[_0x0380('0x37')]=_[_0x0380('0x36')](_0x4e3a42[_0x0380('0x37')]);_0x34e64c[_0x0380('0x38')]=_[_0x0380('0x3a')](_0x34e64c[_0x0380('0x35')],_0x34e64c[_0x0380('0x37')]);_0x411aa5[_0x0380('0x39')]=_[_0x0380('0x3a')](_0x34e64c[_0x0380('0x35')],qs[_0x0380('0x3b')](_0x4e3a42[_0x0380('0x37')][_0x0380('0x3b')]));_0x411aa5[_0x0380('0x39')]=_0x411aa5[_0x0380('0x39')][_0x0380('0x4d')]?_0x411aa5[_0x0380('0x39')]:_0x34e64c['model'];_0x411aa5[_0x0380('0x3f')]=qs['sort'](_0x4e3a42[_0x0380('0x37')][_0x0380('0x40')]);_0x411aa5['where']=qs[_0x0380('0x38')](_[_0x0380('0x42')](_0x4e3a42['query'],_0x34e64c['filters']));if(_0x4e3a42[_0x0380('0x37')][_0x0380('0x43')]){_0x411aa5[_0x0380('0x41')]=_[_0x0380('0x44')](_0x411aa5[_0x0380('0x41')],{'$or':_[_0x0380('0x31')](_0x411aa5['attributes'],function(_0x36a6a3){var _0x2b0508={};_0x2b0508[_0x36a6a3]={'$like':'%'+_0x4e3a42[_0x0380('0x37')][_0x0380('0x43')]+'%'};return _0x2b0508;})});}_0x411aa5=_[_0x0380('0x44')]({},_0x411aa5,_0x4e3a42[_0x0380('0x47')]);return _0x9517a7[_0x0380('0x8a')](_0x411aa5);}})[_0x0380('0x26')](function(_0x41191d){if(_0x41191d){_0x40e4ca=_0x41191d['length'];if(!_0x4e3a42['query']['hasOwnProperty'](_0x0380('0x3d'))){_0x411aa5[_0x0380('0x3e')]=qs['limit'](_0x4e3a42[_0x0380('0x37')][_0x0380('0x3e')]);_0x411aa5[_0x0380('0x20')]=qs['offset'](_0x4e3a42['query'][_0x0380('0x20')]);}return _0x9517a7[_0x0380('0x8a')](_0x411aa5);}})['then'](function(_0x303d03){if(_0x303d03){return _0x303d03?{'count':_0x40e4ca,'rows':_0x303d03}:null;}})[_0x0380('0x26')](respondWithResult(_0x5a7e24,null))[_0x0380('0x4f')](handleError(_0x5a7e24,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6cfe91d..59ee4ec 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 _0xecb0=['hasOwnProperty','hook','exports','events','OpenchannelQueue','setMaxListeners','update','remove','emit'];(function(_0x4b4d43,_0x1590f7){var _0x5706ba=function(_0x11d99b){while(--_0x11d99b){_0x4b4d43['push'](_0x4b4d43['shift']());}};_0x5706ba(++_0x1590f7);}(_0xecb0,0xd2));var _0x0ecb=function(_0x26e9c6,_0xe583e9){_0x26e9c6=_0x26e9c6-0x0;var _0xd8752d=_0xecb0[_0x26e9c6];return _0xd8752d;};'use strict';var EventEmitter=require(_0x0ecb('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0x0ecb('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x0ecb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ecb('0x3'),'afterDestroy':_0x0ecb('0x4')};function emitEvent(_0x2e273b){return function(_0xfcf0db,_0x123b27,_0x2ee1cf){OpenchannelQueueEvents[_0x0ecb('0x5')](_0x2e273b+':'+_0xfcf0db['id'],_0xfcf0db);OpenchannelQueueEvents[_0x0ecb('0x5')](_0x2e273b,_0xfcf0db);_0x2ee1cf(null);};}for(var e in events){if(events[_0x0ecb('0x6')](e)){var event=events[e];OpenchannelQueue[_0x0ecb('0x7')](e,emitEvent(event));}}module[_0x0ecb('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index da27e23..f5ff343 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 _0x13b0=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','define','openchannel_queues','util'];(function(_0x3594b2,_0xcbb4da){var _0x3c2f2b=function(_0x465ce5){while(--_0x465ce5){_0x3594b2['push'](_0x3594b2['shift']());}};_0x3c2f2b(++_0xcbb4da);}(_0x13b0,0x10d));var _0x013b=function(_0xdabb58,_0x2b2c15){_0xdabb58=_0xdabb58-0x0;var _0x10120e=_0x13b0[_0xdabb58];return _0x10120e;};'use strict';var _=require('lodash');var util=require(_0x013b('0x0'));var logger=require(_0x013b('0x1'))(_0x013b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x013b('0x3'));var fs=require('fs');var path=require(_0x013b('0x4'));var rimraf=require(_0x013b('0x5'));var config=require(_0x013b('0x6'));var attributes=require(_0x013b('0x7'));module['exports']=function(_0x5cffa0,_0x266437){return _0x5cffa0[_0x013b('0x8')]('OpenchannelQueue',attributes,{'tableName':_0x013b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index af5c22d..a19294b 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 _0x50ac=['info','result','catch','GetOpenchannelQueue','options','where','attributes','include','map','model','stringify','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x3c62ab,_0x33f23d){var _0x536970=function(_0x3a4759){while(--_0x3a4759){_0x3c62ab['push'](_0x3c62ab['shift']());}};_0x536970(++_0x33f23d);}(_0x50ac,0x15b));var _0xc50a=function(_0x25283b,_0x229f9b){_0x25283b=_0x25283b-0x0;var _0x39a10f=_0x50ac[_0x25283b];return _0x39a10f;};'use strict';var _=require(_0xc50a('0x0'));var util=require(_0xc50a('0x1'));var moment=require(_0xc50a('0x2'));var BPromise=require(_0xc50a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc50a('0x4'));var db=require(_0xc50a('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc50a('0x6'))(_0xc50a('0x7'));var config=require('../../config/environment');var jayson=require(_0xc50a('0x8'));var client=jayson[_0xc50a('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc50a('0xa')],{'host':_0xc50a('0xb'),'port':0x18eb});var socket=require(_0xc50a('0xc'))(new Redis(config[_0xc50a('0xa')]));require(_0xc50a('0xd'))[_0xc50a('0xe')](socket);function respondWithRpcPromise(_0x5edb3a,_0xd6e578,_0x3991f0){return new BPromise(function(_0x556c03,_0x58f2e8){return client[_0xc50a('0xf')](_0x5edb3a,_0x3991f0)[_0xc50a('0x10')](function(_0x4472bd){logger['info'](_0xc50a('0x11'),_0xd6e578,_0xc50a('0x12'));logger[_0xc50a('0x13')]('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0xd6e578,'request\x20sent',JSON['stringify'](_0x4472bd));if(_0x4472bd['error']){if(_0x4472bd[_0xc50a('0x14')][_0xc50a('0x15')]===0x1f4){logger['error'](_0xc50a('0x11'),_0xd6e578,_0x4472bd[_0xc50a('0x14')][_0xc50a('0x16')]);return _0x58f2e8(_0x4472bd[_0xc50a('0x14')][_0xc50a('0x16')]);}logger[_0xc50a('0x14')](_0xc50a('0x11'),_0xd6e578,_0x4472bd[_0xc50a('0x14')][_0xc50a('0x16')]);return _0x556c03(_0x4472bd[_0xc50a('0x14')][_0xc50a('0x16')]);}else{logger[_0xc50a('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0xd6e578,_0xc50a('0x12'));_0x556c03(_0x4472bd[_0xc50a('0x18')][_0xc50a('0x16')]);}})[_0xc50a('0x19')](function(_0x5d8442){logger['error'](_0xc50a('0x11'),_0xd6e578,_0x5d8442);_0x58f2e8(_0x5d8442);});});}exports[_0xc50a('0x1a')]=function(_0x1802ed){var _0x116090=this;return new Promise(function(_0x3b0309,_0xe9c68a){return db['OpenchannelQueue']['findAll']({'raw':_0x1802ed[_0xc50a('0x1b')]?_0x1802ed[_0xc50a('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1802ed[_0xc50a('0x1b')]?_0x1802ed[_0xc50a('0x1b')][_0xc50a('0x1c')]||null:null,'attributes':_0x1802ed[_0xc50a('0x1b')]?_0x1802ed[_0xc50a('0x1b')][_0xc50a('0x1d')]||null:null,'limit':_0x1802ed[_0xc50a('0x1b')]?_0x1802ed[_0xc50a('0x1b')]['limit']||null:null,'include':_0x1802ed[_0xc50a('0x1b')]?_0x1802ed[_0xc50a('0x1b')][_0xc50a('0x1e')]?_[_0xc50a('0x1f')](_0x1802ed[_0xc50a('0x1b')]['include'],function(_0x6b3be0){return{'model':db[_0x6b3be0[_0xc50a('0x20')]],'as':_0x6b3be0['as'],'attributes':_0x6b3be0[_0xc50a('0x1d')],'include':_0x6b3be0[_0xc50a('0x1e')]?_[_0xc50a('0x1f')](_0x6b3be0['include'],function(_0x39c7b1){return{'model':db[_0x39c7b1[_0xc50a('0x20')]],'as':_0x39c7b1['as'],'attributes':_0x39c7b1[_0xc50a('0x1d')],'include':_0x39c7b1[_0xc50a('0x1e')]?_[_0xc50a('0x1f')](_0x39c7b1[_0xc50a('0x1e')],function(_0x492fc9){return{'model':db[_0x492fc9[_0xc50a('0x20')]],'as':_0x492fc9['as'],'attributes':_0x492fc9[_0xc50a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc50a('0x10')](function(_0x103c0f){logger[_0xc50a('0x17')](_0xc50a('0x1a'),_0x1802ed);logger[_0xc50a('0x13')](_0xc50a('0x1a'),_0x1802ed,JSON[_0xc50a('0x21')](_0x103c0f));_0x3b0309(_0x103c0f);})[_0xc50a('0x19')](function(_0x1968e0){logger[_0xc50a('0x14')](_0xc50a('0x1a'),_0x1968e0['message'],_0x1802ed);_0xe9c68a(_0x116090[_0xc50a('0x14')](0x1f4,_0x1968e0[_0xc50a('0x16')]));});});};exports[_0xc50a('0x22')]=function(_0xf8f3a){var _0x49ddf1=this;return new Promise(function(_0x41105c,_0x38978b){return db[_0xc50a('0x23')][_0xc50a('0x24')]({'raw':_0xf8f3a['options']?_0xf8f3a['options']['raw']===undefined?!![]:![]:!![],'where':_0xf8f3a['options']?_0xf8f3a[_0xc50a('0x1b')]['where']||null:null,'attributes':_0xf8f3a[_0xc50a('0x1b')]?_0xf8f3a[_0xc50a('0x1b')][_0xc50a('0x1d')]||null:null,'include':_0xf8f3a[_0xc50a('0x1b')]?_0xf8f3a['options'][_0xc50a('0x1e')]?_[_0xc50a('0x1f')](_0xf8f3a[_0xc50a('0x1b')][_0xc50a('0x1e')],function(_0x5ce56f){return{'model':db[_0x5ce56f['model']],'as':_0x5ce56f['as'],'attributes':_0x5ce56f[_0xc50a('0x1d')],'include':_0x5ce56f[_0xc50a('0x1e')]?_[_0xc50a('0x1f')](_0x5ce56f[_0xc50a('0x1e')],function(_0x14da58){return{'model':db[_0x14da58[_0xc50a('0x20')]],'as':_0x14da58['as'],'attributes':_0x14da58[_0xc50a('0x1d')],'include':_0x14da58['include']?_[_0xc50a('0x1f')](_0x14da58[_0xc50a('0x1e')],function(_0x343b16){return{'model':db[_0x343b16[_0xc50a('0x20')]],'as':_0x343b16['as'],'attributes':_0x343b16[_0xc50a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ed334){logger[_0xc50a('0x17')]('ShowOpenchannelQueue',_0xf8f3a);logger[_0xc50a('0x13')](_0xc50a('0x22'),_0xf8f3a,JSON[_0xc50a('0x21')](_0x2ed334));_0x41105c(_0x2ed334);})[_0xc50a('0x19')](function(_0x14d978){logger['error']('ShowOpenchannelQueue',_0x14d978['message'],_0xf8f3a);_0x38978b(_0x49ddf1[_0xc50a('0x14')](0x1f4,_0x14d978[_0xc50a('0x16')]));});});}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index e30f62f..331439b 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 _0x2f36=['openchannelQueue:','remove','emit','removeListener','register','length'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0x2f36,0xf7));var _0x62f3=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x2f36[_0x42245d];return _0x4b211a;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=['save',_0x62f3('0x0'),'update'];function createListener(_0x7d642e,_0x591421){return function(_0x23e678){_0x591421[_0x62f3('0x1')](_0x7d642e,_0x23e678);};}function removeListener(_0x4306eb,_0x45b81c){return function(){OpenchannelQueueEvents[_0x62f3('0x2')](_0x4306eb,_0x45b81c);};}exports[_0x62f3('0x3')]=function(_0x23a4ff){for(var _0x3b69fd=0x0,_0x3f6a20=events[_0x62f3('0x4')];_0x3b69fd<_0x3f6a20;_0x3b69fd++){var _0x109111=events[_0x3b69fd];var _0x18205b=createListener(_0x62f3('0x5')+_0x109111,_0x23a4ff);OpenchannelQueueEvents['on'](_0x109111,_0x18205b);}}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 6600fc5..7f34bbf 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 _0xd51d=['exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','index','get','/describe','isAuthenticated','describe','show','put','/:id','update','delete','destroy'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xd51d,0x18d));var _0xdd51=function(_0x44bc4e,_0x48ba83){_0x44bc4e=_0x44bc4e-0x0;var _0x2df568=_0xd51d[_0x44bc4e];return _0x2df568;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xdd51('0x0'));var express=require('express');var router=express[_0xdd51('0x1')]();var fs_extra=require(_0xdd51('0x2'));var auth=require(_0xdd51('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xdd51('0x4'));var controller=require(_0xdd51('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0xdd51('0x6')]);router[_0xdd51('0x7')](_0xdd51('0x8'),auth[_0xdd51('0x9')](),controller[_0xdd51('0xa')]);router[_0xdd51('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xdd51('0xb')]);router['post']('/',auth[_0xdd51('0x9')](),controller['create']);router[_0xdd51('0xc')](_0xdd51('0xd'),auth[_0xdd51('0x9')](),controller[_0xdd51('0xe')]);router[_0xdd51('0xf')](_0xdd51('0xd'),auth[_0xdd51('0x9')](),controller[_0xdd51('0x10')]);module[_0xdd51('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 150f9f6..f1159a2 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 _0x4ef0=['moment','sequelize','STRING','DATE'];(function(_0x54566e,_0x58451a){var _0x51efaa=function(_0x389513){while(--_0x389513){_0x54566e['push'](_0x54566e['shift']());}};_0x51efaa(++_0x58451a);}(_0x4ef0,0x130));var _0x04ef=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4ef0[_0x565c49];return _0x20ca34;};'use strict';var moment=require(_0x04ef('0x0'));var Sequelize=require(_0x04ef('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x04ef('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x04ef('0x3')]},'acceptAt':{'type':Sequelize[_0x04ef('0x3')]},'exitAt':{'type':Sequelize[_0x04ef('0x3')]},'reason':{'type':Sequelize[_0x04ef('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 9f1f303..2e0bfb8 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 _0xb162=['options','include','OpenchannelQueueReport','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter'];(function(_0x583201,_0x1f7977){var _0x20b6f5=function(_0x5559ef){while(--_0x5559ef){_0x583201['push'](_0x583201['shift']());}};_0x20b6f5(++_0x1f7977);}(_0xb162,0xeb));var _0x2b16=function(_0x1725de,_0x6d614b){_0x1725de=_0x1725de-0x0;var _0x50ec3e=_0xb162[_0x1725de];return _0x50ec3e;};'use strict';var emlformat=require(_0x2b16('0x0'));var rimraf=require(_0x2b16('0x1'));var zipdir=require(_0x2b16('0x2'));var jsonpatch=require(_0x2b16('0x3'));var rp=require(_0x2b16('0x4'));var moment=require(_0x2b16('0x5'));var BPromise=require(_0x2b16('0x6'));var Mustache=require(_0x2b16('0x7'));var util=require(_0x2b16('0x8'));var path=require(_0x2b16('0x9'));var sox=require(_0x2b16('0xa'));var csv=require(_0x2b16('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2b16('0xc'));var squel=require('squel');var crypto=require(_0x2b16('0xd'));var jsforce=require(_0x2b16('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x2b16('0xf'));var Papa=require('papaparse');var Redis=require(_0x2b16('0x10'));var authService=require(_0x2b16('0x11'));var qs=require(_0x2b16('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b16('0x13'));var logger=require(_0x2b16('0x14'))(_0x2b16('0x15'));var utils=require(_0x2b16('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2b16('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c14dc,_0x20d7d3){_0x20d7d3=_0x20d7d3||0xcc;return function(_0x3eb829){if(_0x3eb829){return _0x2c14dc[_0x2b16('0x18')](_0x20d7d3);}return _0x2c14dc[_0x2b16('0x19')](_0x20d7d3)[_0x2b16('0x1a')]();};}function respondWithResult(_0x5685ec,_0x413fde){_0x413fde=_0x413fde||0xc8;return function(_0x376909){if(_0x376909){return _0x5685ec['status'](_0x413fde)[_0x2b16('0x1b')](_0x376909);}};}function respondWithFilteredResult(_0x590db3,_0x2f101d){return function(_0x1e0da2){if(_0x1e0da2){var _0x468b42=typeof _0x2f101d['offset']===_0x2b16('0x1c')&&typeof _0x2f101d[_0x2b16('0x1d')]===_0x2b16('0x1c');var _0xd10fd8=_0x1e0da2['count'];var _0x20311c=_0x468b42?0x0:_0x2f101d['offset'];var _0x26287d=_0x468b42?_0x1e0da2[_0x2b16('0x1e')]:_0x2f101d[_0x2b16('0x1f')]+_0x2f101d[_0x2b16('0x1d')];var _0x555f34;if(_0x26287d>=_0xd10fd8){_0x26287d=_0xd10fd8;_0x555f34=0xc8;}else{_0x555f34=0xce;}_0x590db3['status'](_0x555f34);return _0x590db3[_0x2b16('0x20')](_0x2b16('0x21'),_0x20311c+'-'+_0x26287d+'/'+_0xd10fd8)[_0x2b16('0x1b')](_0x1e0da2);}return null;};}function patchUpdates(_0x26819c){return function(_0x4f88a3){try{jsonpatch[_0x2b16('0x22')](_0x4f88a3,_0x26819c,!![]);}catch(_0x411bbb){return BPromise['reject'](_0x411bbb);}return _0x4f88a3[_0x2b16('0x23')]();};}function saveUpdates(_0x4df4d5,_0xc32275){return function(_0x24eb40){if(_0x24eb40){return _0x24eb40[_0x2b16('0x24')](_0x4df4d5)[_0x2b16('0x25')](function(_0x8228bc){return _0x8228bc;});}return null;};}function removeEntity(_0x4e13bc,_0x5a49a4){return function(_0x59bd2e){if(_0x59bd2e){return _0x59bd2e[_0x2b16('0x26')]()[_0x2b16('0x25')](function(){_0x4e13bc[_0x2b16('0x19')](0xcc)[_0x2b16('0x1a')]();});}};}function handleEntityNotFound(_0x4c3a27,_0xde601e){return function(_0x51efcc){if(!_0x51efcc){_0x4c3a27[_0x2b16('0x18')](0x194);}return _0x51efcc;};}function handleError(_0x2bee79,_0x24799f){_0x24799f=_0x24799f||0x1f4;return function(_0x1e9d48){logger[_0x2b16('0x27')](_0x1e9d48[_0x2b16('0x28')]);if(_0x1e9d48[_0x2b16('0x29')]){delete _0x1e9d48[_0x2b16('0x29')];}_0x2bee79[_0x2b16('0x19')](_0x24799f)[_0x2b16('0x2a')](_0x1e9d48);};}exports[_0x2b16('0x2b')]=function(_0x545d47,_0xd2c6be){var _0xc565e3={},_0xa31ac3={},_0x41f323={'count':0x0,'rows':[]};var _0x13cc0d=_[_0x2b16('0x2c')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x5c216e){return{'name':_0x5c216e[_0x2b16('0x2d')],'type':_0x5c216e[_0x2b16('0x2e')]['key']};});_0xa31ac3['model']=_[_0x2b16('0x2c')](_0x13cc0d,_0x2b16('0x29'));_0xa31ac3[_0x2b16('0x2f')]=_[_0x2b16('0x30')](_0x545d47[_0x2b16('0x2f')]);_0xa31ac3[_0x2b16('0x31')]=_['intersection'](_0xa31ac3[_0x2b16('0x32')],_0xa31ac3[_0x2b16('0x2f')]);_0xc565e3[_0x2b16('0x33')]=_[_0x2b16('0x34')](_0xa31ac3[_0x2b16('0x32')],qs['fields'](_0x545d47[_0x2b16('0x2f')][_0x2b16('0x35')]));_0xc565e3[_0x2b16('0x33')]=_0xc565e3['attributes']['length']?_0xc565e3[_0x2b16('0x33')]:_0xa31ac3[_0x2b16('0x32')];if(!_0x545d47[_0x2b16('0x2f')][_0x2b16('0x36')]('nolimit')){_0xc565e3['limit']=qs['limit'](_0x545d47[_0x2b16('0x2f')]['limit']);_0xc565e3['offset']=qs['offset'](_0x545d47['query']['offset']);}_0xc565e3['order']=qs[_0x2b16('0x37')](_0x545d47[_0x2b16('0x2f')][_0x2b16('0x37')]);_0xc565e3[_0x2b16('0x38')]=qs[_0x2b16('0x31')](_[_0x2b16('0x39')](_0x545d47[_0x2b16('0x2f')],_0xa31ac3[_0x2b16('0x31')]),_0x13cc0d);if(_0x545d47[_0x2b16('0x2f')]['filter']){_0xc565e3[_0x2b16('0x38')]=_[_0x2b16('0x3a')](_0xc565e3[_0x2b16('0x38')],{'$or':_[_0x2b16('0x2c')](_0x13cc0d,function(_0x211c50){if(_0x211c50[_0x2b16('0x2e')]!==_0x2b16('0x3b')){var _0x2ba992={};_0x2ba992[_0x211c50[_0x2b16('0x29')]]={'$like':'%'+_0x545d47['query'][_0x2b16('0x3c')]+'%'};return _0x2ba992;}})});}_0xc565e3=_['merge']({},_0xc565e3,_0x545d47[_0x2b16('0x3d')]);var _0x5134a6={'where':_0xc565e3[_0x2b16('0x38')]};return db['OpenchannelQueueReport']['count'](_0x5134a6)[_0x2b16('0x25')](function(_0x42e0db){_0x41f323[_0x2b16('0x1e')]=_0x42e0db;if(_0x545d47['query']['includeAll']){_0xc565e3[_0x2b16('0x3e')]=[{'all':!![]}];}return db[_0x2b16('0x3f')][_0x2b16('0x40')](_0xc565e3);})[_0x2b16('0x25')](function(_0x56fd71){_0x41f323[_0x2b16('0x41')]=_0x56fd71;return _0x41f323;})[_0x2b16('0x25')](respondWithFilteredResult(_0xd2c6be,_0xc565e3))[_0x2b16('0x42')](handleError(_0xd2c6be,null));};exports[_0x2b16('0x43')]=function(_0x41b3af,_0x5d25e2){var _0x4513f9={'raw':!![],'where':{'id':_0x41b3af[_0x2b16('0x44')]['id']}},_0x56184c={};_0x56184c[_0x2b16('0x32')]=_[_0x2b16('0x30')](db[_0x2b16('0x3f')]['rawAttributes']);_0x56184c[_0x2b16('0x2f')]=_[_0x2b16('0x30')](_0x41b3af['query']);_0x56184c[_0x2b16('0x31')]=_['intersection'](_0x56184c['model'],_0x56184c['query']);_0x4513f9['attributes']=_[_0x2b16('0x34')](_0x56184c[_0x2b16('0x32')],qs[_0x2b16('0x35')](_0x41b3af[_0x2b16('0x2f')][_0x2b16('0x35')]));_0x4513f9[_0x2b16('0x33')]=_0x4513f9[_0x2b16('0x33')][_0x2b16('0x45')]?_0x4513f9[_0x2b16('0x33')]:_0x56184c[_0x2b16('0x32')];if(_0x41b3af['query'][_0x2b16('0x46')]){_0x4513f9['include']=[{'all':!![]}];}_0x4513f9=_[_0x2b16('0x3a')]({},_0x4513f9,_0x41b3af[_0x2b16('0x3d')]);return db[_0x2b16('0x3f')][_0x2b16('0x47')](_0x4513f9)[_0x2b16('0x25')](handleEntityNotFound(_0x5d25e2,null))[_0x2b16('0x25')](respondWithResult(_0x5d25e2,null))[_0x2b16('0x42')](handleError(_0x5d25e2,null));};exports[_0x2b16('0x48')]=function(_0x26eec5,_0x23c01d){return db[_0x2b16('0x3f')][_0x2b16('0x48')](_0x26eec5['body'],{})[_0x2b16('0x25')](respondWithResult(_0x23c01d,0xc9))[_0x2b16('0x42')](handleError(_0x23c01d,null));};exports[_0x2b16('0x24')]=function(_0x21f1c1,_0x2b3726){if(_0x21f1c1[_0x2b16('0x49')]['id']){delete _0x21f1c1[_0x2b16('0x49')]['id'];}return db[_0x2b16('0x3f')][_0x2b16('0x47')]({'where':{'id':_0x21f1c1['params']['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x2b3726,null))[_0x2b16('0x25')](saveUpdates(_0x21f1c1[_0x2b16('0x49')],null))['then'](respondWithResult(_0x2b3726,null))[_0x2b16('0x42')](handleError(_0x2b3726,null));};exports['destroy']=function(_0x40f2b2,_0x2a9d48){return db[_0x2b16('0x3f')][_0x2b16('0x47')]({'where':{'id':_0x40f2b2[_0x2b16('0x44')]['id']}})[_0x2b16('0x25')](handleEntityNotFound(_0x2a9d48,null))[_0x2b16('0x25')](removeEntity(_0x2a9d48,null))[_0x2b16('0x42')](handleError(_0x2a9d48,null));};exports['describe']=function(_0x22f51c,_0x16d100){return db[_0x2b16('0x3f')]['describe']()['then'](respondWithResult(_0x16d100,null))[_0x2b16('0x42')](handleError(_0x16d100,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 4136f6a..a58036b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash'];(function(_0x33f3c7,_0x163022){var _0xed7591=function(_0xe0bf48){while(--_0xe0bf48){_0x33f3c7['push'](_0x33f3c7['shift']());}};_0xed7591(++_0x163022);}(_0x326f,0xd1));var _0xf326=function(_0x5e15c3,_0x495c81){_0x5e15c3=_0x5e15c3-0x0;var _0x577d7a=_0x326f[_0x5e15c3];return _0x577d7a;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _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 diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index a267bc1..fd7aa49 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 _0xcae2=['where','attributes','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','then','stringify','update','body'];(function(_0x4e7f65,_0x36ae52){var _0x41efa5=function(_0x3a100c){while(--_0x3a100c){_0x4e7f65['push'](_0x4e7f65['shift']());}};_0x41efa5(++_0x36ae52);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rs=require(_0x2cae('0x4'));var fs=require('fs');var Redis=require(_0x2cae('0x5'));var db=require(_0x2cae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cae('0x7'))(_0x2cae('0x8'));var config=require(_0x2cae('0x9'));var jayson=require(_0x2cae('0xa'));var client=jayson['client'][_0x2cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feff6,_0x1e1a3d,_0x25b6a2){return new BPromise(function(_0x2e7498,_0x49e1d1){return client['request'](_0x1feff6,_0x25b6a2)['then'](function(_0x49f0d3){logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));logger[_0x2cae('0xf')](_0x2cae('0x10'),_0x1e1a3d,_0x2cae('0xe'),JSON['stringify'](_0x49f0d3));if(_0x49f0d3[_0x2cae('0x11')]){if(_0x49f0d3['error'][_0x2cae('0x12')]===0x1f4){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x49e1d1(_0x49f0d3[_0x2cae('0x11')]['message']);}logger[_0x2cae('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x2e7498(_0x49f0d3['error'][_0x2cae('0x13')]);}else{logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));_0x2e7498(_0x49f0d3['result'][_0x2cae('0x13')]);}})[_0x2cae('0x14')](function(_0x4a89e1){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x4a89e1);_0x49e1d1(_0x4a89e1);});});}exports[_0x2cae('0x15')]=function(_0xe6314f){var _0x2813b1=this;return new Promise(function(_0x164aee,_0x398290){return db[_0x2cae('0x16')]['create'](_0xe6314f['body'],{'raw':_0xe6314f[_0x2cae('0x17')]?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![]})[_0x2cae('0x19')](function(_0x2f4f5c){logger[_0x2cae('0xc')](_0x2cae('0x15'),_0xe6314f);logger['debug']('CreateOpenchannelQueueReport',_0xe6314f,JSON[_0x2cae('0x1a')](_0x2f4f5c));_0x164aee(_0x2f4f5c);})[_0x2cae('0x14')](function(_0x5d800e){logger['error']('CreateOpenchannelQueueReport',_0x5d800e[_0x2cae('0x13')],_0xe6314f);_0x398290(_0x2813b1[_0x2cae('0x11')](0x1f4,_0x5d800e['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x309ae3){var _0x1c8063=this;return new Promise(function(_0x407324,_0x2fdc92){return db[_0x2cae('0x16')][_0x2cae('0x1b')](_0x309ae3[_0x2cae('0x1c')],{'raw':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x1d')]||null:null,'attributes':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x1e')]||null:null,'limit':_0x309ae3['options']?_0x309ae3['options']['limit']||null:null})['then'](function(_0x7d5421){logger[_0x2cae('0xc')](_0x2cae('0x1f'),_0x309ae3);logger[_0x2cae('0xf')]('UpdateOpenchannelQueueReport',_0x309ae3,JSON[_0x2cae('0x1a')](_0x7d5421));_0x407324(_0x7d5421);})[_0x2cae('0x14')](function(_0xd53da6){logger['error'](_0x2cae('0x1f'),_0xd53da6['message'],_0x309ae3);_0x2fdc92(_0x1c8063[_0x2cae('0x11')](0x1f4,_0xd53da6['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index e3e9e71..c2052a8 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 _0x0bd3=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x0bd3,0x12b));var _0x30bd=function(_0x58c20f,_0x4cdb1b){_0x58c20f=_0x58c20f-0x0;var _0x3b0318=_0x0bd3[_0x58c20f];return _0x3b0318;};'use strict';var multer=require(_0x30bd('0x0'));var util=require(_0x30bd('0x1'));var path=require(_0x30bd('0x2'));var timeout=require(_0x30bd('0x3'));var express=require(_0x30bd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x30bd('0x5'));var interaction=require(_0x30bd('0x6'));var config=require(_0x30bd('0x7'));var controller=require(_0x30bd('0x8'));router[_0x30bd('0x9')]('/',auth[_0x30bd('0xa')](),controller[_0x30bd('0xb')]);router[_0x30bd('0x9')](_0x30bd('0xc'),auth[_0x30bd('0xa')](),controller[_0x30bd('0xd')]);router[_0x30bd('0x9')](_0x30bd('0xe'),auth[_0x30bd('0xa')](),controller['show']);router[_0x30bd('0xf')]('/',auth[_0x30bd('0xa')](),controller['create']);router[_0x30bd('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x30bd('0x11')]);router[_0x30bd('0x12')](_0x30bd('0xe'),auth['isAuthenticated'](),controller[_0x30bd('0x13')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index f4d394d..bd88f1c 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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x58b85f,_0x1cbd5e){var _0x1e6703=function(_0x580d71){while(--_0x580d71){_0x58b85f['push'](_0x58b85f['shift']());}};_0x1e6703(++_0x1cbd5e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xcb91[_0x4de1b1];return _0x639f27;};'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 _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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 0f906c8..817024b 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 _0x3385=['to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','OpenchannelTransferReport','rows','catch','show','params','options','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x3385,0x8e));var _0x5338=function(_0x450bf9,_0x1895de){_0x450bf9=_0x450bf9-0x0;var _0x268350=_0x3385[_0x450bf9];return _0x268350;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5338('0x0'));var zipdir=require(_0x5338('0x1'));var jsonpatch=require(_0x5338('0x2'));var rp=require(_0x5338('0x3'));var moment=require(_0x5338('0x4'));var BPromise=require(_0x5338('0x5'));var Mustache=require(_0x5338('0x6'));var util=require(_0x5338('0x7'));var path=require(_0x5338('0x8'));var sox=require(_0x5338('0x9'));var csv=require(_0x5338('0xa'));var ejs=require(_0x5338('0xb'));var fs=require('fs');var fs_extra=require(_0x5338('0xc'));var _=require(_0x5338('0xd'));var squel=require('squel');var crypto=require(_0x5338('0xe'));var jsforce=require(_0x5338('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5338('0xa'));var querystring=require(_0x5338('0x10'));var Papa=require(_0x5338('0x11'));var Redis=require(_0x5338('0x12'));var authService=require(_0x5338('0x13'));var qs=require(_0x5338('0x14'));var as=require(_0x5338('0x15'));var hardwareService=require(_0x5338('0x16'));var logger=require(_0x5338('0x17'))(_0x5338('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5338('0x19'));var db=require(_0x5338('0x1a'))['db'];function respondWithStatusCode(_0xc0eaf1,_0x14e788){_0x14e788=_0x14e788||0xcc;return function(_0x3dde3e){if(_0x3dde3e){return _0xc0eaf1[_0x5338('0x1b')](_0x14e788);}return _0xc0eaf1[_0x5338('0x1c')](_0x14e788)[_0x5338('0x1d')]();};}function respondWithResult(_0x52e838,_0x597899){_0x597899=_0x597899||0xc8;return function(_0x16d4e5){if(_0x16d4e5){return _0x52e838[_0x5338('0x1c')](_0x597899)[_0x5338('0x1e')](_0x16d4e5);}};}function respondWithFilteredResult(_0x58d811,_0x50ae0a){return function(_0x3e163f){if(_0x3e163f){var _0x44e925=typeof _0x50ae0a['offset']==='undefined'&&typeof _0x50ae0a['limit']===_0x5338('0x1f');var _0x286acb=_0x3e163f['count'];var _0x4246a3=_0x44e925?0x0:_0x50ae0a['offset'];var _0x8fbb2d=_0x44e925?_0x3e163f[_0x5338('0x20')]:_0x50ae0a[_0x5338('0x21')]+_0x50ae0a[_0x5338('0x22')];var _0x4f0a57;if(_0x8fbb2d>=_0x286acb){_0x8fbb2d=_0x286acb;_0x4f0a57=0xc8;}else{_0x4f0a57=0xce;}_0x58d811['status'](_0x4f0a57);return _0x58d811[_0x5338('0x23')]('Content-Range',_0x4246a3+'-'+_0x8fbb2d+'/'+_0x286acb)['json'](_0x3e163f);}return null;};}function patchUpdates(_0x3374f1){return function(_0x3568ce){try{jsonpatch['apply'](_0x3568ce,_0x3374f1,!![]);}catch(_0x30ee89){return BPromise[_0x5338('0x24')](_0x30ee89);}return _0x3568ce[_0x5338('0x25')]();};}function saveUpdates(_0x5b45fb,_0x197a1d){return function(_0x415594){if(_0x415594){return _0x415594[_0x5338('0x26')](_0x5b45fb)[_0x5338('0x27')](function(_0x4b087f){return _0x4b087f;});}return null;};}function removeEntity(_0x3093dc,_0x4f151d){return function(_0x2cfbdc){if(_0x2cfbdc){return _0x2cfbdc[_0x5338('0x28')]()['then'](function(){_0x3093dc['status'](0xcc)[_0x5338('0x1d')]();});}};}function handleEntityNotFound(_0x35001d,_0x25d96a){return function(_0x1dd554){if(!_0x1dd554){_0x35001d[_0x5338('0x1b')](0x194);}return _0x1dd554;};}function handleError(_0x1b0b39,_0x2af817){_0x2af817=_0x2af817||0x1f4;return function(_0xe11363){logger[_0x5338('0x29')](_0xe11363['stack']);if(_0xe11363[_0x5338('0x2a')]){delete _0xe11363['name'];}_0x1b0b39[_0x5338('0x1c')](_0x2af817)[_0x5338('0x2b')](_0xe11363);};}exports[_0x5338('0x2c')]=function(_0x1b1896,_0x123738){var _0x563484={},_0x3a4401={},_0x2ba6ea={'count':0x0,'rows':[]};var _0x26ee50=_[_0x5338('0x2d')](db['OpenchannelTransferReport'][_0x5338('0x2e')],function(_0x1b3c48){return{'name':_0x1b3c48['fieldName'],'type':_0x1b3c48[_0x5338('0x2f')][_0x5338('0x30')]};});_0x3a4401[_0x5338('0x31')]=_[_0x5338('0x2d')](_0x26ee50,_0x5338('0x2a'));_0x3a4401[_0x5338('0x32')]=_[_0x5338('0x33')](_0x1b1896[_0x5338('0x32')]);_0x3a4401[_0x5338('0x34')]=_[_0x5338('0x35')](_0x3a4401['model'],_0x3a4401[_0x5338('0x32')]);_0x563484[_0x5338('0x36')]=_['intersection'](_0x3a4401[_0x5338('0x31')],qs[_0x5338('0x37')](_0x1b1896[_0x5338('0x32')]['fields']));_0x563484[_0x5338('0x36')]=_0x563484[_0x5338('0x36')][_0x5338('0x38')]?_0x563484[_0x5338('0x36')]:_0x3a4401[_0x5338('0x31')];if(!_0x1b1896[_0x5338('0x32')][_0x5338('0x39')]('nolimit')){_0x563484['limit']=qs[_0x5338('0x22')](_0x1b1896[_0x5338('0x32')][_0x5338('0x22')]);_0x563484[_0x5338('0x21')]=qs[_0x5338('0x21')](_0x1b1896[_0x5338('0x32')][_0x5338('0x21')]);}_0x563484[_0x5338('0x3a')]=qs[_0x5338('0x3b')](_0x1b1896[_0x5338('0x32')]['sort']);_0x563484[_0x5338('0x3c')]=qs[_0x5338('0x34')](_[_0x5338('0x3d')](_0x1b1896['query'],_0x3a4401[_0x5338('0x34')]),_0x26ee50);if(_0x1b1896['query'][_0x5338('0x3e')]){_0x563484[_0x5338('0x3c')]=_['merge'](_0x563484[_0x5338('0x3c')],{'$or':_[_0x5338('0x2d')](_0x26ee50,function(_0xfa22af){if(_0xfa22af[_0x5338('0x2f')]!==_0x5338('0x3f')){var _0x5ebe8f={};_0x5ebe8f[_0xfa22af['name']]={'$like':'%'+_0x1b1896['query'][_0x5338('0x3e')]+'%'};return _0x5ebe8f;}})});}_0x563484=_[_0x5338('0x40')]({},_0x563484,_0x1b1896['options']);var _0x48afb6={'where':_0x563484['where']};return db['OpenchannelTransferReport']['count'](_0x48afb6)[_0x5338('0x27')](function(_0x5285dd){_0x2ba6ea[_0x5338('0x20')]=_0x5285dd;if(_0x1b1896['query'][_0x5338('0x41')]){_0x563484[_0x5338('0x42')]=[{'all':!![]}];}return db[_0x5338('0x43')]['findAll'](_0x563484);})[_0x5338('0x27')](function(_0x6fea2d){_0x2ba6ea[_0x5338('0x44')]=_0x6fea2d;return _0x2ba6ea;})[_0x5338('0x27')](respondWithFilteredResult(_0x123738,_0x563484))[_0x5338('0x45')](handleError(_0x123738,null));};exports[_0x5338('0x46')]=function(_0x2a6ad0,_0x5f253b){var _0x449be8={'raw':!![],'where':{'id':_0x2a6ad0[_0x5338('0x47')]['id']}},_0x29ca8c={};_0x29ca8c[_0x5338('0x31')]=_[_0x5338('0x33')](db[_0x5338('0x43')][_0x5338('0x2e')]);_0x29ca8c[_0x5338('0x32')]=_[_0x5338('0x33')](_0x2a6ad0[_0x5338('0x32')]);_0x29ca8c['filters']=_[_0x5338('0x35')](_0x29ca8c[_0x5338('0x31')],_0x29ca8c[_0x5338('0x32')]);_0x449be8['attributes']=_[_0x5338('0x35')](_0x29ca8c[_0x5338('0x31')],qs['fields'](_0x2a6ad0[_0x5338('0x32')][_0x5338('0x37')]));_0x449be8['attributes']=_0x449be8[_0x5338('0x36')][_0x5338('0x38')]?_0x449be8[_0x5338('0x36')]:_0x29ca8c[_0x5338('0x31')];if(_0x2a6ad0[_0x5338('0x32')][_0x5338('0x41')]){_0x449be8[_0x5338('0x42')]=[{'all':!![]}];}_0x449be8=_[_0x5338('0x40')]({},_0x449be8,_0x2a6ad0[_0x5338('0x48')]);return db[_0x5338('0x43')][_0x5338('0x49')](_0x449be8)[_0x5338('0x27')](handleEntityNotFound(_0x5f253b,null))['then'](respondWithResult(_0x5f253b,null))[_0x5338('0x45')](handleError(_0x5f253b,null));};exports['create']=function(_0x58c096,_0x7f8732){return db['OpenchannelTransferReport']['create'](_0x58c096[_0x5338('0x4a')],{})[_0x5338('0x27')](respondWithResult(_0x7f8732,0xc9))[_0x5338('0x45')](handleError(_0x7f8732,null));};exports[_0x5338('0x26')]=function(_0x1a525e,_0x48240c){if(_0x1a525e[_0x5338('0x4a')]['id']){delete _0x1a525e[_0x5338('0x4a')]['id'];}return db[_0x5338('0x43')][_0x5338('0x49')]({'where':{'id':_0x1a525e[_0x5338('0x47')]['id']}})[_0x5338('0x27')](handleEntityNotFound(_0x48240c,null))[_0x5338('0x27')](saveUpdates(_0x1a525e[_0x5338('0x4a')],null))[_0x5338('0x27')](respondWithResult(_0x48240c,null))[_0x5338('0x45')](handleError(_0x48240c,null));};exports['destroy']=function(_0x18bf46,_0x29f267){return db[_0x5338('0x43')][_0x5338('0x49')]({'where':{'id':_0x18bf46['params']['id']}})[_0x5338('0x27')](handleEntityNotFound(_0x29f267,null))['then'](removeEntity(_0x29f267,null))[_0x5338('0x45')](handleError(_0x29f267,null));};exports[_0x5338('0x4b')]=function(_0xa7cbfc,_0x531cec){return db[_0x5338('0x43')]['describe']()[_0x5338('0x27')](respondWithResult(_0x531cec,null))['catch'](handleError(_0x531cec,null));}; \ No newline at end of file +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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index bdd9cb7..c73624b 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 _0x1d43=['uniqueid','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','report_openchannel_transfer'];(function(_0x59fdcc,_0x5f18fa){var _0x1235a0=function(_0x4c1622){while(--_0x4c1622){_0x59fdcc['push'](_0x59fdcc['shift']());}};_0x1235a0(++_0x5f18fa);}(_0x1d43,0x139));var _0x31d4=function(_0x159062,_0x5ad4e0){_0x159062=_0x159062-0x0;var _0x5cc553=_0x1d43[_0x159062];return _0x5cc553;};'use strict';var _=require(_0x31d4('0x0'));var util=require(_0x31d4('0x1'));var logger=require(_0x31d4('0x2'))('api');var moment=require(_0x31d4('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x31d4('0x4'));var rimraf=require(_0x31d4('0x5'));var config=require(_0x31d4('0x6'));var attributes=require(_0x31d4('0x7'));module[_0x31d4('0x8')]=function(_0x4aee96,_0x30b023){return _0x4aee96[_0x31d4('0x9')]('OpenchannelTransferReport',attributes,{'tableName':_0x31d4('0xa'),'paranoid':![],'indexes':[{'name':_0x31d4('0xb'),'fields':[_0x31d4('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index d5cf232..f477ad4 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 _0xc3b5=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x319891,_0x9b28dc){var _0x8df70c=function(_0x3301f4){while(--_0x3301f4){_0x319891['push'](_0x319891['shift']());}};_0x8df70c(++_0x9b28dc);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x1dd752,_0x1b1b34){_0x1dd752=_0x1dd752-0x0;var _0x21469c=_0xc3b5[_0x1dd752];return _0x21469c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5c3b('0x0'));var BPromise=require(_0x5c3b('0x1'));var rs=require(_0x5c3b('0x2'));var fs=require('fs');var Redis=require(_0x5c3b('0x3'));var db=require(_0x5c3b('0x4'))['db'];var utils=require(_0x5c3b('0x5'));var logger=require(_0x5c3b('0x6'))(_0x5c3b('0x7'));var config=require('../../config/environment');var jayson=require(_0x5c3b('0x8'));var client=jayson[_0x5c3b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x568a28,_0x30a08f,_0x420839){return new BPromise(function(_0x3892ad,_0x5be9ee){return client[_0x5c3b('0xa')](_0x568a28,_0x420839)[_0x5c3b('0xb')](function(_0x159db5){logger[_0x5c3b('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x30a08f,_0x5c3b('0xd'));logger[_0x5c3b('0xe')](_0x5c3b('0xf'),_0x30a08f,_0x5c3b('0xd'),JSON[_0x5c3b('0x10')](_0x159db5));if(_0x159db5['error']){if(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x12')]===0x1f4){logger['error'](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')]['message']);return _0x5be9ee(_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);}logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x159db5[_0x5c3b('0x11')][_0x5c3b('0x14')]);return _0x3892ad(_0x159db5[_0x5c3b('0x11')]['message']);}else{logger[_0x5c3b('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x30a08f,'request\x20sent');_0x3892ad(_0x159db5[_0x5c3b('0x15')][_0x5c3b('0x14')]);}})[_0x5c3b('0x16')](function(_0x589797){logger[_0x5c3b('0x11')](_0x5c3b('0x13'),_0x30a08f,_0x589797);_0x5be9ee(_0x589797);});});} \ No newline at end of file +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 diff --git a/server/api/pause/index.js b/server/api/pause/index.js index e2ff10f..0ce9ddf 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 _0x8b03=['update','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','post','put'];(function(_0x29bef7,_0x5127f0){var _0x1ba0c1=function(_0x90b156){while(--_0x90b156){_0x29bef7['push'](_0x29bef7['shift']());}};_0x1ba0c1(++_0x5127f0);}(_0x8b03,0x179));var _0x38b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b03[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x38b0('0x0'));var util=require(_0x38b0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x38b0('0x2'));var router=express[_0x38b0('0x3')]();var fs_extra=require(_0x38b0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x38b0('0x5'));var config=require(_0x38b0('0x6'));var controller=require(_0x38b0('0x7'));router['get']('/',auth[_0x38b0('0x8')](),controller[_0x38b0('0x9')]);router[_0x38b0('0xa')](_0x38b0('0xb'),auth[_0x38b0('0x8')](),controller['show']);router[_0x38b0('0xc')]('/',auth[_0x38b0('0x8')](),controller['create']);router[_0x38b0('0xd')](_0x38b0('0xb'),auth['isAuthenticated'](),controller[_0x38b0('0xe')]);router[_0x38b0('0xf')](_0x38b0('0xb'),auth[_0x38b0('0x8')](),controller[_0x38b0('0x10')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 3c57ea8..1ee4b2a 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 _0x889c=['name','sequelize','STRING'];(function(_0xeb175e,_0x2c9bda){var _0x5e6b1d=function(_0x548cb9){while(--_0x548cb9){_0xeb175e['push'](_0xeb175e['shift']());}};_0x5e6b1d(++_0x2c9bda);}(_0x889c,0x1db));var _0xc889=function(_0x317b89,_0x35ce92){_0x317b89=_0x317b89-0x0;var _0x497d59=_0x889c[_0x317b89];return _0x497d59;};'use strict';var Sequelize=require(_0xc889('0x0'));module['exports']={'name':{'type':Sequelize[_0xc889('0x1')],'unique':_0xc889('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc889('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 154d2fe..87627f9 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 _0x82ca=['apply','save','update','then','destroy','get','Pauses','UserProfileResource','stack','name','send','index','map','Pause','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x15a04d,_0x3bb9cb){var _0x4dc5cb=function(_0x50ff05){while(--_0x50ff05){_0x15a04d['push'](_0x15a04d['shift']());}};_0x4dc5cb(++_0x3bb9cb);}(_0x82ca,0x1bb));var _0xa82c=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0x82ca[_0x307086];return _0x699043;};'use strict';var emlformat=require(_0xa82c('0x0'));var rimraf=require(_0xa82c('0x1'));var zipdir=require(_0xa82c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa82c('0x3'));var moment=require('moment');var BPromise=require(_0xa82c('0x4'));var Mustache=require('mustache');var util=require(_0xa82c('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa82c('0x6'));var fs=require('fs');var fs_extra=require(_0xa82c('0x7'));var _=require(_0xa82c('0x8'));var squel=require(_0xa82c('0x9'));var crypto=require(_0xa82c('0xa'));var jsforce=require(_0xa82c('0xb'));var deskjs=require(_0xa82c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa82c('0xd'));var Papa=require(_0xa82c('0xe'));var Redis=require('ioredis');var authService=require(_0xa82c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xa82c('0x10'));var hardwareService=require(_0xa82c('0x11'));var logger=require(_0xa82c('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa82c('0x13'));var licenseUtil=require(_0xa82c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2839f4,_0x66706){_0x66706=_0x66706||0xcc;return function(_0x1aff45){if(_0x1aff45){return _0x2839f4[_0xa82c('0x15')](_0x66706);}return _0x2839f4[_0xa82c('0x16')](_0x66706)[_0xa82c('0x17')]();};}function respondWithResult(_0x11319a,_0x5200ac){_0x5200ac=_0x5200ac||0xc8;return function(_0x42ed0c){if(_0x42ed0c){return _0x11319a[_0xa82c('0x16')](_0x5200ac)[_0xa82c('0x18')](_0x42ed0c);}};}function respondWithFilteredResult(_0x44d55d,_0x16bc29){return function(_0x46b329){if(_0x46b329){var _0x47f0ad=typeof _0x16bc29[_0xa82c('0x19')]===_0xa82c('0x1a')&&typeof _0x16bc29[_0xa82c('0x1b')]==='undefined';var _0x682b4c=_0x46b329['count'];var _0x297500=_0x47f0ad?0x0:_0x16bc29[_0xa82c('0x19')];var _0xfac1f5=_0x47f0ad?_0x46b329[_0xa82c('0x1c')]:_0x16bc29['offset']+_0x16bc29[_0xa82c('0x1b')];var _0x390f24;if(_0xfac1f5>=_0x682b4c){_0xfac1f5=_0x682b4c;_0x390f24=0xc8;}else{_0x390f24=0xce;}_0x44d55d[_0xa82c('0x16')](_0x390f24);return _0x44d55d[_0xa82c('0x1d')](_0xa82c('0x1e'),_0x297500+'-'+_0xfac1f5+'/'+_0x682b4c)[_0xa82c('0x18')](_0x46b329);}return null;};}function patchUpdates(_0x2c66c5){return function(_0x4db4a7){try{jsonpatch[_0xa82c('0x1f')](_0x4db4a7,_0x2c66c5,!![]);}catch(_0x2e0a6e){return BPromise['reject'](_0x2e0a6e);}return _0x4db4a7[_0xa82c('0x20')]();};}function saveUpdates(_0x1c654c,_0x1b9441){return function(_0x4d72ce){if(_0x4d72ce){return _0x4d72ce[_0xa82c('0x21')](_0x1c654c)[_0xa82c('0x22')](function(_0x4e6ae5){return _0x4e6ae5;});}return null;};}function removeEntity(_0x2faad9,_0x5bac56){return function(_0x1aaaf0){if(_0x1aaaf0){return _0x1aaaf0[_0xa82c('0x23')]()[_0xa82c('0x22')](function(){var _0x52aded=_0x1aaaf0[_0xa82c('0x24')]({'plain':!![]});var _0x3f3e6b=_0xa82c('0x25');return db[_0xa82c('0x26')][_0xa82c('0x23')]({'where':{'type':_0x3f3e6b,'resourceId':_0x52aded['id']}})[_0xa82c('0x22')](function(){return _0x1aaaf0;});})['then'](function(){_0x2faad9[_0xa82c('0x16')](0xcc)[_0xa82c('0x17')]();});}};}function handleEntityNotFound(_0x2abf87,_0x118bab){return function(_0x2c5d1c){if(!_0x2c5d1c){_0x2abf87[_0xa82c('0x15')](0x194);}return _0x2c5d1c;};}function handleError(_0x5c6283,_0x1a5591){_0x1a5591=_0x1a5591||0x1f4;return function(_0x49218f){logger['error'](_0x49218f[_0xa82c('0x27')]);if(_0x49218f[_0xa82c('0x28')]){delete _0x49218f['name'];}_0x5c6283[_0xa82c('0x16')](_0x1a5591)[_0xa82c('0x29')](_0x49218f);};}exports[_0xa82c('0x2a')]=function(_0xb555a1,_0x567942){var _0x5f2c19={},_0x4de756={},_0x317df4={'count':0x0,'rows':[]};var _0x5c30aa=_[_0xa82c('0x2b')](db[_0xa82c('0x2c')][_0xa82c('0x2d')],function(_0x120cdf){return{'name':_0x120cdf['fieldName'],'type':_0x120cdf[_0xa82c('0x2e')][_0xa82c('0x2f')]};});_0x4de756[_0xa82c('0x30')]=_[_0xa82c('0x2b')](_0x5c30aa,_0xa82c('0x28'));_0x4de756[_0xa82c('0x31')]=_[_0xa82c('0x32')](_0xb555a1['query']);_0x4de756[_0xa82c('0x33')]=_[_0xa82c('0x34')](_0x4de756[_0xa82c('0x30')],_0x4de756[_0xa82c('0x31')]);_0x5f2c19[_0xa82c('0x35')]=_[_0xa82c('0x34')](_0x4de756[_0xa82c('0x30')],qs['fields'](_0xb555a1[_0xa82c('0x31')]['fields']));_0x5f2c19[_0xa82c('0x35')]=_0x5f2c19[_0xa82c('0x35')][_0xa82c('0x36')]?_0x5f2c19[_0xa82c('0x35')]:_0x4de756[_0xa82c('0x30')];if(!_0xb555a1['query'][_0xa82c('0x37')]('nolimit')){_0x5f2c19['limit']=qs['limit'](_0xb555a1[_0xa82c('0x31')][_0xa82c('0x1b')]);_0x5f2c19[_0xa82c('0x19')]=qs['offset'](_0xb555a1[_0xa82c('0x31')][_0xa82c('0x19')]);}_0x5f2c19['order']=qs[_0xa82c('0x38')](_0xb555a1[_0xa82c('0x31')]['sort']);_0x5f2c19['where']=qs['filters'](_[_0xa82c('0x39')](_0xb555a1['query'],_0x4de756[_0xa82c('0x33')]),_0x5c30aa);if(_0xb555a1[_0xa82c('0x31')][_0xa82c('0x3a')]){_0x5f2c19[_0xa82c('0x3b')]=_[_0xa82c('0x3c')](_0x5f2c19[_0xa82c('0x3b')],{'$or':_[_0xa82c('0x2b')](_0x5c30aa,function(_0xb3bb24){if(_0xb3bb24[_0xa82c('0x2e')]!==_0xa82c('0x3d')){var _0x534159={};_0x534159[_0xb3bb24[_0xa82c('0x28')]]={'$like':'%'+_0xb555a1[_0xa82c('0x31')][_0xa82c('0x3a')]+'%'};return _0x534159;}})});}_0x5f2c19=_[_0xa82c('0x3c')]({},_0x5f2c19,_0xb555a1[_0xa82c('0x3e')]);var _0x2cfe08={'where':_0x5f2c19[_0xa82c('0x3b')]};return db['Pause'][_0xa82c('0x1c')](_0x2cfe08)[_0xa82c('0x22')](function(_0x4f2f5e){_0x317df4[_0xa82c('0x1c')]=_0x4f2f5e;if(_0xb555a1[_0xa82c('0x31')][_0xa82c('0x3f')]){_0x5f2c19['include']=[{'all':!![]}];}return db[_0xa82c('0x2c')][_0xa82c('0x40')](_0x5f2c19);})[_0xa82c('0x22')](function(_0x5b1027){_0x317df4[_0xa82c('0x41')]=_0x5b1027;return _0x317df4;})[_0xa82c('0x22')](respondWithFilteredResult(_0x567942,_0x5f2c19))[_0xa82c('0x42')](handleError(_0x567942,null));};exports['show']=function(_0x20450b,_0xdd425e){var _0x39e518={'raw':!![],'where':{'id':_0x20450b['params']['id']}},_0x5b62c6={};_0x5b62c6[_0xa82c('0x30')]=_[_0xa82c('0x32')](db['Pause'][_0xa82c('0x2d')]);_0x5b62c6[_0xa82c('0x31')]=_[_0xa82c('0x32')](_0x20450b[_0xa82c('0x31')]);_0x5b62c6['filters']=_['intersection'](_0x5b62c6[_0xa82c('0x30')],_0x5b62c6[_0xa82c('0x31')]);_0x39e518[_0xa82c('0x35')]=_[_0xa82c('0x34')](_0x5b62c6[_0xa82c('0x30')],qs['fields'](_0x20450b[_0xa82c('0x31')][_0xa82c('0x43')]));_0x39e518['attributes']=_0x39e518[_0xa82c('0x35')][_0xa82c('0x36')]?_0x39e518[_0xa82c('0x35')]:_0x5b62c6[_0xa82c('0x30')];if(_0x20450b[_0xa82c('0x31')][_0xa82c('0x3f')]){_0x39e518['include']=[{'all':!![]}];}_0x39e518=_[_0xa82c('0x3c')]({},_0x39e518,_0x20450b['options']);return db['Pause'][_0xa82c('0x44')](_0x39e518)['then'](handleEntityNotFound(_0xdd425e,null))[_0xa82c('0x22')](respondWithResult(_0xdd425e,null))[_0xa82c('0x42')](handleError(_0xdd425e,null));};exports[_0xa82c('0x45')]=function(_0x22d983,_0x20179a){return db[_0xa82c('0x2c')][_0xa82c('0x45')](_0x22d983['body'],{})['then'](function(_0x24ded0){var _0x40d9b2=_0x22d983[_0xa82c('0x46')][_0xa82c('0x24')]({'plain':!![]});if(!_0x40d9b2)throw new Error(_0xa82c('0x47'));if(_0x40d9b2[_0xa82c('0x48')]===_0xa82c('0x46')){var _0x296006=_0x24ded0[_0xa82c('0x24')]({'plain':!![]});var _0x321f5d=_0xa82c('0x25');return db['UserProfileSection'][_0xa82c('0x44')]({'where':{'name':_0x321f5d,'userProfileId':_0x40d9b2[_0xa82c('0x49')]},'raw':!![]})['then'](function(_0x3ddff2){if(_0x3ddff2&&_0x3ddff2[_0xa82c('0x4a')]===0x0){return db['UserProfileResource'][_0xa82c('0x45')]({'name':_0x296006[_0xa82c('0x28')],'resourceId':_0x296006['id'],'type':_0x3ddff2[_0xa82c('0x28')],'sectionId':_0x3ddff2['id']},{})['then'](function(){return _0x24ded0;});}else{return _0x24ded0;}})[_0xa82c('0x42')](function(_0xee540a){logger[_0xa82c('0x4b')](_0xa82c('0x4c'),_0xee540a);throw _0xee540a;});}return _0x24ded0;})[_0xa82c('0x22')](respondWithResult(_0x20179a,0xc9))[_0xa82c('0x42')](handleError(_0x20179a,null));};exports[_0xa82c('0x21')]=function(_0x369634,_0x2515c8){if(_0x369634['body']['id']){delete _0x369634[_0xa82c('0x4d')]['id'];}return db[_0xa82c('0x2c')][_0xa82c('0x44')]({'where':{'id':_0x369634[_0xa82c('0x4e')]['id']}})[_0xa82c('0x22')](handleEntityNotFound(_0x2515c8,null))[_0xa82c('0x22')](saveUpdates(_0x369634[_0xa82c('0x4d')],null))['then'](respondWithResult(_0x2515c8,null))[_0xa82c('0x42')](handleError(_0x2515c8,null));};exports[_0xa82c('0x23')]=function(_0x11f381,_0xa8a4cc){return db[_0xa82c('0x2c')][_0xa82c('0x44')]({'where':{'id':_0x11f381[_0xa82c('0x4e')]['id']}})[_0xa82c('0x22')](handleEntityNotFound(_0xa8a4cc,null))[_0xa82c('0x22')](removeEntity(_0xa8a4cc,null))['catch'](handleError(_0xa8a4cc,null));}; \ No newline at end of file +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 diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index a7e7f67..243f4c7 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x6aa7,0x178));var _0x76aa=function(_0x21e230,_0x3d269b){_0x21e230=_0x21e230-0x0;var _0x44a6b8=_0x6aa7[_0x21e230];return _0x44a6b8;};'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 _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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index b8a10e3..2acd11c 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x55995a,_0x259dc0){var _0x600fbb=function(_0x344aee){while(--_0x344aee){_0x55995a['push'](_0x55995a['shift']());}};_0x600fbb(++_0x259dc0);}(_0xb10b,0x12a));var _0xbb10=function(_0x37087e,_0x719222){_0x37087e=_0x37087e-0x0;var _0x117e6f=_0xb10b[_0x37087e];return _0x117e6f;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_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 diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index d136950..4cd9174 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 _0x9b9b=['single','file','webhookPost','put','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','root','server/files/plugins','originalname','format','basename','extname','now','post'];(function(_0x2d9eff,_0x1a3929){var _0x4c1b93=function(_0x78d332){while(--_0x78d332){_0x2d9eff['push'](_0x2d9eff['shift']());}};_0x4c1b93(++_0x1a3929);}(_0x9b9b,0x114));var _0xb9b9=function(_0x243de9,_0x1897bb){_0x243de9=_0x243de9-0x0;var _0x58e4bd=_0x9b9b[_0x243de9];return _0x58e4bd;};'use strict';var multer=require('multer');var util=require(_0xb9b9('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb9b9('0x1'));var router=express[_0xb9b9('0x2')]();var fs_extra=require(_0xb9b9('0x3'));var auth=require(_0xb9b9('0x4'));var interaction=require(_0xb9b9('0x5'));var config=require(_0xb9b9('0x6'));var controller=require(_0xb9b9('0x7'));router[_0xb9b9('0x8')]('/',auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xa')]);router[_0xb9b9('0x8')](_0xb9b9('0xb'),controller[_0xb9b9('0xc')]);router[_0xb9b9('0x8')](_0xb9b9('0xd'),auth[_0xb9b9('0x9')](),controller['show']);router['get'](_0xb9b9('0xe'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3949d0,_0x3b6bb9,_0x1122bb){_0x1122bb(null,path['join'](config[_0xb9b9('0x10')],_0xb9b9('0x11')));},'filename':function(_0xbc5a42,_0x26fa04,_0x230fea){_0x26fa04[_0xb9b9('0x12')]=_0x26fa04['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x230fea(null,util[_0xb9b9('0x13')]('%s-%s%s',path[_0xb9b9('0x14')](_0x26fa04['originalname'],path[_0xb9b9('0x15')](_0x26fa04[_0xb9b9('0x12')])),Date[_0xb9b9('0x16')](),path[_0xb9b9('0x15')](_0x26fa04[_0xb9b9('0x12')])));}})});router[_0xb9b9('0x17')]('/',upload[_0xb9b9('0x18')](_0xb9b9('0x19')),controller['upload']);router[_0xb9b9('0x17')]('/webhook',controller[_0xb9b9('0x1a')]);router[_0xb9b9('0x1b')](_0xb9b9('0xd'),auth[_0xb9b9('0x9')](),controller['update']);router[_0xb9b9('0x1c')](_0xb9b9('0xd'),auth[_0xb9b9('0x9')](),controller[_0xb9b9('0x1c')]);module[_0xb9b9('0x1d')]=router; \ No newline at end of file +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 diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index cbc0a06..8db9567 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 _0x7b9d=['Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN'];(function(_0x5e4ba7,_0x288a11){var _0x2adf5b=function(_0x16e46e){while(--_0x16e46e){_0x5e4ba7['push'](_0x5e4ba7['shift']());}};_0x2adf5b(++_0x288a11);}(_0x7b9d,0x180));var _0xd7b9=function(_0x5233e5,_0x4e1b19){_0x5233e5=_0x5233e5-0x0;var _0x2a6caf=_0x7b9d[_0x5233e5];return _0x2a6caf;};'use strict';var Sequelize=require('sequelize');module[_0xd7b9('0x0')]={'name':{'type':Sequelize[_0xd7b9('0x1')]},'type':{'type':Sequelize[_0xd7b9('0x2')](_0xd7b9('0x3'),_0xd7b9('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xd7b9('0x5')]},'path':{'type':Sequelize[_0xd7b9('0x1')],'comment':_0xd7b9('0x6')},'active':{'type':Sequelize[_0xd7b9('0x7')],'defaultValue':0x0,'comment':_0xd7b9('0x8')},'sidebar':{'type':Sequelize[_0xd7b9('0x2')](_0xd7b9('0x9'),_0xd7b9('0xa'),_0xd7b9('0xb'),_0xd7b9('0xc')),'defaultValue':_0xd7b9('0xb'),'comment':_0xd7b9('0xd')},'icon':{'type':Sequelize[_0xd7b9('0x1')]},'adminUrl':{'type':Sequelize[_0xd7b9('0x1')]},'agentUrl':{'type':Sequelize[_0xd7b9('0x1')]},'scriptName':{'type':Sequelize[_0xd7b9('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 9c51ef9..1d73e28 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 _0xc4c1=['isDirectory','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','script','create','role','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','unlinkSync','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','port','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','then','Plugins','destroy','error','name','send','index','map','rawAttributes','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Plugin','include','findAll','rows','catch','params','keys','length','includeAll','download','find','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure'];(function(_0x42ae99,_0x1d41f2){var _0x25e682=function(_0x56c0e2){while(--_0x56c0e2){_0x42ae99['push'](_0x42ae99['shift']());}};_0x25e682(++_0x1d41f2);}(_0xc4c1,0xe5));var _0x1c4c=function(_0x56637c,_0x2a71fe){_0x56637c=_0x56637c-0x0;var _0x464ce1=_0xc4c1[_0x56637c];return _0x464ce1;};'use strict';var emlformat=require(_0x1c4c('0x0'));var rimraf=require(_0x1c4c('0x1'));var zipdir=require(_0x1c4c('0x2'));var jsonpatch=require(_0x1c4c('0x3'));var rp=require('request-promise');var moment=require(_0x1c4c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1c4c('0x5'));var sox=require(_0x1c4c('0x6'));var csv=require(_0x1c4c('0x7'));var ejs=require(_0x1c4c('0x8'));var fs=require('fs');var fs_extra=require(_0x1c4c('0x9'));var _=require(_0x1c4c('0xa'));var squel=require(_0x1c4c('0xb'));var crypto=require(_0x1c4c('0xc'));var jsforce=require(_0x1c4c('0xd'));var deskjs=require(_0x1c4c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1c4c('0xf'));var Papa=require(_0x1c4c('0x10'));var extract=require(_0x1c4c('0x11'));var rimraf=require(_0x1c4c('0x1'));var archiver=require(_0x1c4c('0x12'));var Redis=require('ioredis');var authService=require(_0x1c4c('0x13'));var qs=require(_0x1c4c('0x14'));var as=require(_0x1c4c('0x15'));var hardwareService=require(_0x1c4c('0x16'));var logger=require(_0x1c4c('0x17'))('api');var utils=require(_0x1c4c('0x18'));var config=require(_0x1c4c('0x19'));var licenseUtil=require(_0x1c4c('0x1a'));var db=require(_0x1c4c('0x1b'))['db'];config['redis']=_[_0x1c4c('0x1c')](config['redis'],{'host':_0x1c4c('0x1d'),'port':0x18eb});var socket=require(_0x1c4c('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0x1c4c('0x1f')](socket);function respondWithStatusCode(_0x4f634d,_0x1c8dba){_0x1c8dba=_0x1c8dba||0xcc;return function(_0x3c3d98){if(_0x3c3d98){return _0x4f634d[_0x1c4c('0x20')](_0x1c8dba);}return _0x4f634d['status'](_0x1c8dba)[_0x1c4c('0x21')]();};}function respondWithResult(_0x47a7ba,_0x56d280){_0x56d280=_0x56d280||0xc8;return function(_0x8a0ebc){if(_0x8a0ebc){return _0x47a7ba[_0x1c4c('0x22')](_0x56d280)[_0x1c4c('0x23')](_0x8a0ebc);}};}function respondWithFilteredResult(_0xfeb341,_0x1be6c0){return function(_0x579ec4){if(_0x579ec4){var _0x292848=typeof _0x1be6c0[_0x1c4c('0x24')]===_0x1c4c('0x25')&&typeof _0x1be6c0[_0x1c4c('0x26')]===_0x1c4c('0x25');var _0x244ab5=_0x579ec4['count'];var _0x4c30ef=_0x292848?0x0:_0x1be6c0[_0x1c4c('0x24')];var _0x1b4713=_0x292848?_0x579ec4[_0x1c4c('0x27')]:_0x1be6c0[_0x1c4c('0x24')]+_0x1be6c0[_0x1c4c('0x26')];var _0x1d1f97;if(_0x1b4713>=_0x244ab5){_0x1b4713=_0x244ab5;_0x1d1f97=0xc8;}else{_0x1d1f97=0xce;}_0xfeb341[_0x1c4c('0x22')](_0x1d1f97);return _0xfeb341[_0x1c4c('0x28')]('Content-Range',_0x4c30ef+'-'+_0x1b4713+'/'+_0x244ab5)['json'](_0x579ec4);}return null;};}function patchUpdates(_0xa63db3){return function(_0x217a02){try{jsonpatch[_0x1c4c('0x29')](_0x217a02,_0xa63db3,!![]);}catch(_0x2d92e6){return BPromise[_0x1c4c('0x2a')](_0x2d92e6);}return _0x217a02['save']();};}function saveUpdates(_0x2a3bf7,_0x81d787){return function(_0x1f76e0){if(_0x1f76e0){return _0x1f76e0[_0x1c4c('0x2b')](_0x2a3bf7)[_0x1c4c('0x2c')](function(_0x34b888){return _0x34b888;});}return null;};}function removeEntity(_0x2e41fc,_0x33cb04){return function(_0x73fd99){if(_0x73fd99){return _0x73fd99['destroy']()[_0x1c4c('0x2c')](function(){var _0x5bc2c2=_0x73fd99['get']({'plain':!![]});var _0x1e290c=_0x1c4c('0x2d');return db['UserProfileResource'][_0x1c4c('0x2e')]({'where':{'type':_0x1e290c,'resourceId':_0x5bc2c2['id']}})[_0x1c4c('0x2c')](function(){return _0x73fd99;});})[_0x1c4c('0x2c')](function(){_0x2e41fc[_0x1c4c('0x22')](0xcc)[_0x1c4c('0x21')]();});}};}function handleEntityNotFound(_0x4b0be4,_0xfc8e5d){return function(_0x397516){if(!_0x397516){_0x4b0be4['sendStatus'](0x194);}return _0x397516;};}function handleError(_0x132828,_0x1190d1){_0x1190d1=_0x1190d1||0x1f4;return function(_0x56752f){logger[_0x1c4c('0x2f')](_0x56752f['stack']);if(_0x56752f['name']){delete _0x56752f[_0x1c4c('0x30')];}_0x132828[_0x1c4c('0x22')](_0x1190d1)[_0x1c4c('0x31')](_0x56752f);};}exports[_0x1c4c('0x32')]=function(_0x2220ff,_0x511e65){var _0x32e89a={},_0x1416cd={},_0x27b9a3={'count':0x0,'rows':[]};var _0x1639c2=_[_0x1c4c('0x33')](db['Plugin'][_0x1c4c('0x34')],function(_0x2d5d69){return{'name':_0x2d5d69['fieldName'],'type':_0x2d5d69['type'][_0x1c4c('0x35')]};});_0x1416cd[_0x1c4c('0x36')]=_[_0x1c4c('0x33')](_0x1639c2,'name');_0x1416cd[_0x1c4c('0x37')]=_['keys'](_0x2220ff[_0x1c4c('0x37')]);_0x1416cd[_0x1c4c('0x38')]=_[_0x1c4c('0x39')](_0x1416cd[_0x1c4c('0x36')],_0x1416cd[_0x1c4c('0x37')]);_0x32e89a[_0x1c4c('0x3a')]=_[_0x1c4c('0x39')](_0x1416cd['model'],qs[_0x1c4c('0x3b')](_0x2220ff[_0x1c4c('0x37')][_0x1c4c('0x3b')]));_0x32e89a[_0x1c4c('0x3a')]=_0x32e89a[_0x1c4c('0x3a')]['length']?_0x32e89a['attributes']:_0x1416cd[_0x1c4c('0x36')];if(!_0x2220ff['query'][_0x1c4c('0x3c')]('nolimit')){_0x32e89a[_0x1c4c('0x26')]=qs[_0x1c4c('0x26')](_0x2220ff[_0x1c4c('0x37')][_0x1c4c('0x26')]);_0x32e89a[_0x1c4c('0x24')]=qs[_0x1c4c('0x24')](_0x2220ff['query'][_0x1c4c('0x24')]);}_0x32e89a[_0x1c4c('0x3d')]=qs[_0x1c4c('0x3e')](_0x2220ff['query'][_0x1c4c('0x3e')]);_0x32e89a[_0x1c4c('0x3f')]=qs['filters'](_[_0x1c4c('0x40')](_0x2220ff[_0x1c4c('0x37')],_0x1416cd['filters']),_0x1639c2);if(_0x2220ff[_0x1c4c('0x37')][_0x1c4c('0x41')]){_0x32e89a[_0x1c4c('0x3f')]=_[_0x1c4c('0x42')](_0x32e89a['where'],{'$or':_['map'](_0x1639c2,function(_0xc8e5c5){if(_0xc8e5c5[_0x1c4c('0x43')]!==_0x1c4c('0x44')){var _0x41d253={};_0x41d253[_0xc8e5c5[_0x1c4c('0x30')]]={'$like':'%'+_0x2220ff['query'][_0x1c4c('0x41')]+'%'};return _0x41d253;}})});}_0x32e89a=_[_0x1c4c('0x42')]({},_0x32e89a,_0x2220ff[_0x1c4c('0x45')]);var _0x3a6329={'where':_0x32e89a['where']};return db[_0x1c4c('0x46')]['count'](_0x3a6329)[_0x1c4c('0x2c')](function(_0x1f3caf){_0x27b9a3[_0x1c4c('0x27')]=_0x1f3caf;if(_0x2220ff[_0x1c4c('0x37')]['includeAll']){_0x32e89a[_0x1c4c('0x47')]=[{'all':!![]}];}return db[_0x1c4c('0x46')][_0x1c4c('0x48')](_0x32e89a);})[_0x1c4c('0x2c')](function(_0x2480d2){_0x27b9a3[_0x1c4c('0x49')]=_0x2480d2;return _0x27b9a3;})[_0x1c4c('0x2c')](respondWithFilteredResult(_0x511e65,_0x32e89a))[_0x1c4c('0x4a')](handleError(_0x511e65,null));};exports['show']=function(_0x34b82b,_0x117a30){var _0x46ca49={'raw':!![],'where':{'id':_0x34b82b[_0x1c4c('0x4b')]['id']}},_0x1dce92={};_0x1dce92[_0x1c4c('0x36')]=_[_0x1c4c('0x4c')](db[_0x1c4c('0x46')]['rawAttributes']);_0x1dce92[_0x1c4c('0x37')]=_[_0x1c4c('0x4c')](_0x34b82b[_0x1c4c('0x37')]);_0x1dce92[_0x1c4c('0x38')]=_[_0x1c4c('0x39')](_0x1dce92[_0x1c4c('0x36')],_0x1dce92[_0x1c4c('0x37')]);_0x46ca49['attributes']=_[_0x1c4c('0x39')](_0x1dce92[_0x1c4c('0x36')],qs[_0x1c4c('0x3b')](_0x34b82b[_0x1c4c('0x37')][_0x1c4c('0x3b')]));_0x46ca49['attributes']=_0x46ca49[_0x1c4c('0x3a')][_0x1c4c('0x4d')]?_0x46ca49[_0x1c4c('0x3a')]:_0x1dce92[_0x1c4c('0x36')];if(_0x34b82b[_0x1c4c('0x37')][_0x1c4c('0x4e')]){_0x46ca49[_0x1c4c('0x47')]=[{'all':!![]}];}_0x46ca49=_[_0x1c4c('0x42')]({},_0x46ca49,_0x34b82b[_0x1c4c('0x45')]);return db['Plugin']['find'](_0x46ca49)['then'](handleEntityNotFound(_0x117a30,null))['then'](respondWithResult(_0x117a30,null))['catch'](handleError(_0x117a30,null));};exports[_0x1c4c('0x4f')]=function(_0x112fe7,_0x2cc8d2,_0x485eaa){return db[_0x1c4c('0x46')][_0x1c4c('0x50')]({'where':{'id':_0x112fe7[_0x1c4c('0x4b')]['id']},'attributes':[_0x1c4c('0x30'),'path'],'raw':!![]})[_0x1c4c('0x2c')](handleEntityNotFound(_0x2cc8d2,null))[_0x1c4c('0x2c')](function(_0x5d737a){if(_0x5d737a){var _0x4bcef5=path[_0x1c4c('0x51')](config[_0x1c4c('0x52')],_0x1c4c('0x53'),util[_0x1c4c('0x54')](_0x1c4c('0x55'),path[_0x1c4c('0x56')](_0x5d737a[_0x1c4c('0x5')])));var _0x10e261=fs[_0x1c4c('0x57')](_0x4bcef5);var _0x4ad81a=archiver(_0x1c4c('0x58'),{'zlib':{'level':0x9}});_0x4ad81a['on'](_0x1c4c('0x59'),function(_0x547f26){if(_0x547f26[_0x1c4c('0x5a')]==='ENOENT'){logger[_0x1c4c('0x2f')](_0x547f26);}else{throw new db[(_0x1c4c('0x5b'))][(_0x1c4c('0x5c'))](_0x1c4c('0x5d'));}});_0x4ad81a['on'](_0x1c4c('0x2f'),function(_0x4e2e67){throw new db[(_0x1c4c('0x5b'))][(_0x1c4c('0x5c'))](_0x1c4c('0x5d'));});_0x4ad81a['pipe'](_0x10e261);_0x4ad81a[_0x1c4c('0x5e')](_0x1c4c('0x5f'),{'cwd':path[_0x1c4c('0x51')](config[_0x1c4c('0x52')],_0x1c4c('0x53'),path[_0x1c4c('0x60')](_0x5d737a[_0x1c4c('0x5')])),'ignore':[path[_0x1c4c('0x51')](path[_0x1c4c('0x56')](_0x5d737a['path']),_0x1c4c('0x61')),path[_0x1c4c('0x51')](path[_0x1c4c('0x56')](_0x5d737a[_0x1c4c('0x5')]),'attachments/**/*')],'nodir':!![]})['finalize']();_0x10e261['on'](_0x1c4c('0x62'),function(){if(!fs[_0x1c4c('0x63')](_0x4bcef5)){throw new db[(_0x1c4c('0x5b'))][(_0x1c4c('0x5c'))](_0x1c4c('0x64'));}return _0x2cc8d2[_0x1c4c('0x4f')](_0x4bcef5,util['format'](_0x1c4c('0x55'),path['basename'](_0x5d737a[_0x1c4c('0x5')])),function(_0x467a89){if(_0x467a89){throw new db[(_0x1c4c('0x5b'))][(_0x1c4c('0x5c'))](_0x1c4c('0x65'));}fs['unlinkSync'](_0x4bcef5);logger[_0x1c4c('0x66')](_0x1c4c('0x67'));logger[_0x1c4c('0x66')](_0x1c4c('0x68'));});});}return null;})[_0x1c4c('0x4a')](handleError(_0x2cc8d2,null));};exports[_0x1c4c('0x69')]=function(_0x4d3482,_0x12e747,_0x3c1467){var _0x4aff96=path[_0x1c4c('0x56')](_0x4d3482[_0x1c4c('0x6a')][_0x1c4c('0x6b')],path[_0x1c4c('0x6c')](_0x4d3482[_0x1c4c('0x6a')]['filename']));var _0x207923=path['join'](config[_0x1c4c('0x52')],'server/files/plugins',_0x4d3482[_0x1c4c('0x6a')][_0x1c4c('0x6b')]);var _0x53f778=path[_0x1c4c('0x51')](config[_0x1c4c('0x52')],_0x1c4c('0x53'),_0x4aff96);logger[_0x1c4c('0x66')](_0x1c4c('0x6d'),_0x207923);logger[_0x1c4c('0x66')](_0x1c4c('0x6e'),_0x53f778);try{fs[_0x1c4c('0x6f')](_0x207923,parseInt(_0x1c4c('0x70'),0x8));extract(_0x207923,{'dir':_0x53f778},function(_0xd5920){if(_0xd5920){logger['error'](_0xd5920);handleError(_0xd5920,!![]);};var _0x3ded44=fs[_0x1c4c('0x71')](_0x53f778);if(_0x3ded44[_0x1c4c('0x4d')]>0x1){removeReferences(_0x207923,_0x53f778);logger[_0x1c4c('0x2f')](_0x1c4c('0x72'));return _0x3c1467(new Error(_0x1c4c('0x72')));}var _0x3a07cd=fs['lstatSync'](path[_0x1c4c('0x51')](_0x53f778,_0x3ded44[0x0]));if(_0x3a07cd['isFile']()){removeReferences(_0x207923,_0x53f778);logger[_0x1c4c('0x2f')]('Invalid\x20plugin\x20structure');return _0x3c1467(new Error('Invalid\x20plugin\x20structure'));}if(_0x3a07cd[_0x1c4c('0x73')]()){var _0xc40cd6=fs['readdirSync'](path[_0x1c4c('0x51')](_0x53f778,_0x3ded44[0x0]));if(_0xc40cd6[_0x1c4c('0x4d')]===0x0){removeReferences(_0x207923,_0x53f778);logger[_0x1c4c('0x2f')](_0x1c4c('0x72'));return _0x3c1467(new Error(_0x1c4c('0x72')));}var _0x167b9f=_0xc40cd6['some'](function(_0xb3bd37){return _0xb3bd37==='manifest.json';});if(!_0x167b9f){return _0x3c1467(new Error(_0x1c4c('0x74')));}var _0x5a2a88=fs[_0x1c4c('0x75')](path[_0x1c4c('0x51')](_0x53f778,_0x3ded44[0x0],_0x1c4c('0x76')));var _0x4de793=JSON[_0x1c4c('0x77')](_0x5a2a88);if('undefined'==typeof _0x4de793[_0x1c4c('0x30')]){return _0x3c1467(new Error(_0x1c4c('0x78')));}if(_0x1c4c('0x25')==typeof _0x4de793[_0x1c4c('0x43')]){return _0x3c1467(new Error(_0x1c4c('0x79')));}if(_0x1c4c('0x25')==typeof _0x4de793[_0x1c4c('0x7a')]){return _0x3c1467(new Error(_0x1c4c('0x7b')));}if(_0x1c4c('0x25')==typeof _0x4de793[_0x1c4c('0x7c')]){return _0x3c1467(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x4de793['type']===_0x1c4c('0x7d')){if(_0x1c4c('0x25')==typeof _0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x7e')]){return _0x3c1467(new Error(_0x1c4c('0x7f')));}if(_0x1c4c('0x25')==typeof _0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x7e')][_0x1c4c('0x80')]&&'undefined'==typeof _0x4de793[_0x1c4c('0x7c')]['views'][_0x1c4c('0x81')]){return _0x3c1467(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x4de793[_0x1c4c('0x43')]==='script'){if(_0x1c4c('0x25')==typeof _0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x82')]){return _0x3c1467(new Error(_0x1c4c('0x83')));}if('undefined'==typeof _0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x84')]){return _0x3c1467(new Error(_0x1c4c('0x85')));}}else{return _0x3c1467(new Error(_0x1c4c('0x86')));}var _0x316a4=_0x4de793[_0x1c4c('0x30')];var _0x2ec911=_0x4de793[_0x1c4c('0x87')];var _0x16535f=_0x4de793[_0x1c4c('0x43')];var _0x39617c=_0x4de793[_0x1c4c('0x88')]?_0x4de793['sidebar']:_0x1c4c('0x89');var _0x441c9d=_0x4de793[_0x1c4c('0x8a')]?_0x4de793[_0x1c4c('0x8a')]:_0x1c4c('0x8b');var _0x2e2ca1='';var _0x3ffa67='';var _0x4e5342='';var _0xe39821='';var _0x462807=_0x4de793[_0x1c4c('0x7a')];if(_0x16535f==='html'){if(_0x1c4c('0x25')!=typeof _0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x7e')][_0x1c4c('0x80')]){var _0x5065da=_0x4de793['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x5065da)){_0x2e2ca1=path[_0x1c4c('0x51')](_0x1c4c('0x8c'),_0x4aff96,_0x3ded44[0x0],_0x5065da);}else{_0x2e2ca1=_0x5065da;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x1c4c('0x25')!=typeof _0x4de793['parameters']['views'][_0x1c4c('0x81')]){var _0xe86ef5=_0x4de793['parameters'][_0x1c4c('0x7e')][_0x1c4c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x1c4c('0x8d')](_0xe86ef5)){_0x3ffa67=path[_0x1c4c('0x51')](_0x1c4c('0x8c'),_0x4aff96,_0x3ded44[0x0],_0xe86ef5);}else{_0x3ffa67=_0xe86ef5;}}else{logger['info'](_0x1c4c('0x8e'));}}else if(_0x16535f===_0x1c4c('0x8f')){_0x4e5342=_0x4de793[_0x1c4c('0x7c')]['scriptName'];_0xe39821=_0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x84')];if('undefined'!=typeof _0x4de793[_0x1c4c('0x7c')][_0x1c4c('0x7e')]){if(_0x1c4c('0x25')!=typeof _0x4de793[_0x1c4c('0x7c')]['views'][_0x1c4c('0x80')]){var _0x5065da=_0x4de793['parameters'][_0x1c4c('0x7e')][_0x1c4c('0x80')];if(!/^(f|ht)tps?:\/\//i[_0x1c4c('0x8d')](_0x5065da)){_0x2e2ca1=path[_0x1c4c('0x51')](_0x1c4c('0x8c'),_0x4aff96,_0x3ded44[0x0],_0x5065da);}else{_0x2e2ca1=_0x5065da;}}if('undefined'!=typeof _0x4de793['parameters'][_0x1c4c('0x7e')][_0x1c4c('0x81')]){var _0xe86ef5=_0x4de793['parameters'][_0x1c4c('0x7e')][_0x1c4c('0x81')];if(!/^(f|ht)tps?:\/\//i[_0x1c4c('0x8d')](_0xe86ef5)){_0x3ffa67=path['join'](_0x1c4c('0x8c'),_0x4aff96,_0x3ded44[0x0],_0xe86ef5);}else{_0x3ffa67=_0xe86ef5;}}}}var _0x3ce6ef={'name':_0x316a4,'description':_0x2ec911,'path':path['join'](_0x4aff96,_0x3ded44[0x0]),'type':_0x16535f,'sidebar':_0x39617c,'icon':_0x441c9d,'adminUrl':_0x2e2ca1,'agentUrl':_0x3ffa67,'scriptName':_0x4e5342,'scriptPath':_0xe39821,'version':_0x462807};removeReferences(_0x207923,null);return db[_0x1c4c('0x46')][_0x1c4c('0x90')](_0x3ce6ef)[_0x1c4c('0x2c')](function(_0x4540aa){var _0x5e9ace={'role':_0x4d3482['body'][_0x1c4c('0x91')],'userProfileId':_0x4d3482[_0x1c4c('0x92')]['userProfileId']};if(!_0x5e9ace)throw new Error(_0x1c4c('0x93'));if(_0x5e9ace[_0x1c4c('0x91')]==='user'){var _0x56b13a=_0x4540aa[_0x1c4c('0x94')]({'plain':!![]});return db[_0x1c4c('0x95')][_0x1c4c('0x50')]({'where':{'name':_0x1c4c('0x2d'),'userProfileId':_0x5e9ace[_0x1c4c('0x96')]},'raw':!![]})[_0x1c4c('0x2c')](function(_0x5357e9){if(_0x5357e9&&_0x5357e9[_0x1c4c('0x97')]===0x0){return db[_0x1c4c('0x98')][_0x1c4c('0x90')]({'name':_0x56b13a[_0x1c4c('0x30')],'resourceId':_0x56b13a['id'],'type':_0x5357e9[_0x1c4c('0x30')],'sectionId':_0x5357e9['id']},{})[_0x1c4c('0x2c')](function(){return _0x4540aa;});}else{return _0x4540aa;}})[_0x1c4c('0x4a')](function(_0x390665){logger[_0x1c4c('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x390665);throw _0x390665;});}return _0x4540aa;})[_0x1c4c('0x2c')](respondWithResult(_0x12e747,null))[_0x1c4c('0x4a')](handleError(_0x12e747,null));}});}catch(_0x20f54b){_0x12e747['status'](0x1f4)['send'](_0x20f54b);}};function removeReferences(_0x1b3bbc,_0x1cf17b){try{if(_0x1b3bbc){fs[_0x1c4c('0x99')](_0x1b3bbc);logger[_0x1c4c('0x66')](_0x1c4c('0x9a'));}if(_0x1cf17b){rimraf(_0x1cf17b,function(){});logger[_0x1c4c('0x66')]('Extracted\x20folder\x20removed');}}catch(_0x539984){logger[_0x1c4c('0x2f')](_0x539984);}}exports[_0x1c4c('0x2b')]=function(_0x2f054d,_0x5da16c,_0x1e171d){return db[_0x1c4c('0x46')][_0x1c4c('0x50')]({'where':{'id':_0x2f054d[_0x1c4c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5da16c,null))[_0x1c4c('0x2c')](saveUpdates(_0x2f054d[_0x1c4c('0x92')],null))[_0x1c4c('0x2c')](respondWithResult(_0x5da16c,null))['catch'](handleError(_0x5da16c,null));};exports[_0x1c4c('0x9b')]=function(_0x5c1084,_0x38df4d,_0x18a4d3){return db[_0x1c4c('0x46')]['find']({'where':{'id':_0x5c1084[_0x1c4c('0x4b')]['id']}})[_0x1c4c('0x2c')](function(_0x2ea422){if(_0x2ea422){return _0x2ea422[_0x1c4c('0x2e')]();}})['then'](function(_0x131faa){rimraf(path['join'](config[_0x1c4c('0x52')],'server/files/plugins',path[_0x1c4c('0x60')](_0x131faa[_0x1c4c('0x5')])),function(){});return _0x131faa;})[_0x1c4c('0x2c')](handleEntityNotFound(_0x38df4d,null))[_0x1c4c('0x2c')](respondWithStatusCode(_0x38df4d,null))['catch'](handleError(_0x38df4d,null));};exports[_0x1c4c('0x9c')]=function(_0xcea8d7,_0x199f6a,_0x54ffc2){return BPromise[_0x1c4c('0x9d')]()['then'](function(){if(!_0xcea8d7[_0x1c4c('0x37')][_0x1c4c('0x5')]){throw new Error(_0x1c4c('0x9e'));}if(!_0xcea8d7[_0x1c4c('0x37')]['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x270b49=_0xcea8d7['query'][_0x1c4c('0x9f')]?_0xcea8d7[_0x1c4c('0x37')][_0x1c4c('0x9f')]+':'+_0xcea8d7[_0x1c4c('0x37')]['port']:_0x1c4c('0xa0')+_0xcea8d7[_0x1c4c('0x37')][_0x1c4c('0xa1')];var _0x5f9748=_0xcea8d7[_0x1c4c('0x37')][_0x1c4c('0x23')]?_0xcea8d7['query'][_0x1c4c('0x23')]:!![];var _0x2d8389=_0xcea8d7[_0x1c4c('0x37')]['encoding']?_0xcea8d7['query']['encoding']:null;var _0x28a75f={'method':_0xcea8d7[_0x1c4c('0xa2')],'uri':util[_0x1c4c('0x54')](_0x1c4c('0xa3'),_0x270b49,_0xcea8d7['query']['path']),'json':_0x5f9748,'resolveWithFullResponse':!![],'encoding':_0x2d8389,'qs':_0xcea8d7[_0x1c4c('0x37')]};if(_0xcea8d7[_0x1c4c('0xa4')]){_0x28a75f['headers']=_0xcea8d7[_0x1c4c('0xa4')];if(_0x28a75f[_0x1c4c('0xa4')][_0x1c4c('0xa5')]){delete _0x28a75f[_0x1c4c('0xa4')]['content-length'];}}if(_0x28a75f[_0x1c4c('0xa4')][_0x1c4c('0xa6')]){delete _0x28a75f[_0x1c4c('0xa4')][_0x1c4c('0xa6')];}return rp(_0x28a75f);})['then'](function(_0x36a867){if(_0x36a867){_0x199f6a[_0x1c4c('0x28')](_0x36a867['headers']);logger['info'](_0x36a867[_0x1c4c('0x92')]);if(_[_0x1c4c('0xa7')](_0xcea8d7[_0x1c4c('0x37')][_0x1c4c('0x5')],_0x1c4c('0x4f'))&&_0x36a867[_0x1c4c('0xa8')]==0x1f4){return _0x199f6a[_0x1c4c('0x20')](_0x36a867['statusCode']);}else{return _0x199f6a[_0x1c4c('0x22')](_0x36a867['statusCode'])[_0x1c4c('0x31')](_0x36a867[_0x1c4c('0x92')]);}}else{return _0x199f6a[_0x1c4c('0x20')](0xc8);}})['catch'](handleError(_0x199f6a,null));};exports[_0x1c4c('0xa9')]=function(_0x2e81e9,_0x4204cb,_0x45347a){return BPromise['resolve']()[_0x1c4c('0x2c')](function(){if(!_0x2e81e9['query']['path']){throw new Error(_0x1c4c('0x9e'));}if(!_0x2e81e9[_0x1c4c('0x37')][_0x1c4c('0xa1')]){throw new Error(_0x1c4c('0xaa'));}var _0xd176ac=_0x2e81e9['query'][_0x1c4c('0x9f')]?_0x2e81e9['query']['hostname']+':'+_0x2e81e9[_0x1c4c('0x37')][_0x1c4c('0xa1')]:_0x1c4c('0xa0')+_0x2e81e9[_0x1c4c('0x37')][_0x1c4c('0xa1')];var _0x11d7ba=_0x2e81e9['query'][_0x1c4c('0x23')]?_0x2e81e9[_0x1c4c('0x37')][_0x1c4c('0x23')]:!![];var _0x4fcb4b=_0x2e81e9[_0x1c4c('0x37')][_0x1c4c('0xab')]?_0x2e81e9[_0x1c4c('0x37')][_0x1c4c('0xab')]:null;var _0x37110f={'method':_0x2e81e9[_0x1c4c('0xa2')],'uri':util[_0x1c4c('0x54')](_0x1c4c('0xa3'),_0xd176ac,_0x2e81e9['query'][_0x1c4c('0x5')]),'json':_0x11d7ba,'resolveWithFullResponse':!![],'encoding':_0x4fcb4b,'body':_0x2e81e9[_0x1c4c('0x92')]};if(_0x2e81e9['headers']){_0x37110f[_0x1c4c('0xa4')]=_0x2e81e9['headers'];if(_0x37110f['headers'][_0x1c4c('0xa5')]){delete _0x37110f[_0x1c4c('0xa4')][_0x1c4c('0xa5')];}}if(_0x37110f[_0x1c4c('0xa4')][_0x1c4c('0xa6')]){delete _0x37110f[_0x1c4c('0xa4')][_0x1c4c('0xa6')];}return rp(_0x37110f);})[_0x1c4c('0x2c')](function(_0x3d3e9e){if(_0x3d3e9e){_0x4204cb[_0x1c4c('0x28')](_0x3d3e9e[_0x1c4c('0xa4')]);logger[_0x1c4c('0x66')](_0x3d3e9e['body']);return _0x4204cb[_0x1c4c('0x22')](_0x3d3e9e[_0x1c4c('0xa8')])['send'](_0x3d3e9e['body']);}else{return _0x4204cb[_0x1c4c('0x20')](0xc8);}})[_0x1c4c('0x4a')](handleError(_0x4204cb,null));}; \ No newline at end of file +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 diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 5597528..29aad9d 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 _0x7fd6=['Plugin','setMaxListeners','save','update','remove','hook','exports','events'];(function(_0x529be6,_0x1584c8){var _0x355720=function(_0x44b27a){while(--_0x44b27a){_0x529be6['push'](_0x529be6['shift']());}};_0x355720(++_0x1584c8);}(_0x7fd6,0x157));var _0x67fd=function(_0x42c997,_0x433ce0){_0x42c997=_0x42c997-0x0;var _0x37e0b5=_0x7fd6[_0x42c997];return _0x37e0b5;};'use strict';var EventEmitter=require(_0x67fd('0x0'));var Plugin=require('../../mysqldb')['db'][_0x67fd('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0x67fd('0x2')](0x0);var events={'afterCreate':_0x67fd('0x3'),'afterUpdate':_0x67fd('0x4'),'afterDestroy':_0x67fd('0x5')};function emitEvent(_0xbdd0c0){return function(_0x4f52bc,_0x187f3e,_0x50238d){PluginEvents['emit'](_0xbdd0c0+':'+_0x4f52bc['id'],_0x4f52bc);PluginEvents['emit'](_0xbdd0c0,_0x4f52bc);_0x50238d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin[_0x67fd('0x6')](e,emitEvent(event));}}module[_0x67fd('0x7')]=PluginEvents; \ No newline at end of file +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 diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 089386a..262a1dd 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 _0x5717=['lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x5717,0x11e));var _0x7571=function(_0x245c37,_0x28da40){_0x245c37=_0x245c37-0x0;var _0x29a17c=_0x5717[_0x245c37];return _0x29a17c;};'use strict';var _=require(_0x7571('0x0'));var util=require(_0x7571('0x1'));var logger=require(_0x7571('0x2'))(_0x7571('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7571('0x4'));var fs=require('fs');var path=require(_0x7571('0x5'));var rimraf=require(_0x7571('0x6'));var config=require(_0x7571('0x7'));var attributes=require(_0x7571('0x8'));module[_0x7571('0x9')]=function(_0x418a53,_0x27a0cb){return _0x418a53[_0x7571('0xa')](_0x7571('0xb'),attributes,{'tableName':_0x7571('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index df55d3e..f4f7e93 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 _0x6c05=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','CreatePlugin','create','body','options','raw','catch','lodash','util'];(function(_0x19f5e1,_0x46d063){var _0x144c2d=function(_0xebec8a){while(--_0xebec8a){_0x19f5e1['push'](_0x19f5e1['shift']());}};_0x144c2d(++_0x46d063);}(_0x6c05,0x64));var _0x56c0=function(_0x7f048d,_0x23a1de){_0x7f048d=_0x7f048d-0x0;var _0x5f4bb2=_0x6c05[_0x7f048d];return _0x5f4bb2;};'use strict';var _=require(_0x56c0('0x0'));var util=require(_0x56c0('0x1'));var moment=require(_0x56c0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56c0('0x3'));var db=require(_0x56c0('0x4'))['db'];var utils=require(_0x56c0('0x5'));var logger=require(_0x56c0('0x6'))(_0x56c0('0x7'));var config=require(_0x56c0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x56c0('0x9')]({'port':0x232a});config[_0x56c0('0xa')]=_[_0x56c0('0xb')](config[_0x56c0('0xa')],{'host':_0x56c0('0xc'),'port':0x18eb});var socket=require(_0x56c0('0xd'))(new Redis(config[_0x56c0('0xa')]));require(_0x56c0('0xe'))[_0x56c0('0xf')](socket);function respondWithRpcPromise(_0x31d309,_0x40219d,_0xb4bf5b){return new BPromise(function(_0x48b2e2,_0x10ff4c){return client[_0x56c0('0x10')](_0x31d309,_0xb4bf5b)[_0x56c0('0x11')](function(_0x324473){logger[_0x56c0('0x12')](_0x56c0('0x13'),_0x40219d,'request\x20sent');logger[_0x56c0('0x14')](_0x56c0('0x15'),_0x40219d,'request\x20sent',JSON[_0x56c0('0x16')](_0x324473));if(_0x324473[_0x56c0('0x17')]){if(_0x324473[_0x56c0('0x17')][_0x56c0('0x18')]===0x1f4){logger[_0x56c0('0x17')]('Plugin,\x20%s,\x20%s',_0x40219d,_0x324473[_0x56c0('0x17')][_0x56c0('0x19')]);return _0x10ff4c(_0x324473[_0x56c0('0x17')]['message']);}logger['error'](_0x56c0('0x13'),_0x40219d,_0x324473['error']['message']);return _0x48b2e2(_0x324473[_0x56c0('0x17')][_0x56c0('0x19')]);}else{logger['info'](_0x56c0('0x13'),_0x40219d,_0x56c0('0x1a'));_0x48b2e2(_0x324473[_0x56c0('0x1b')][_0x56c0('0x19')]);}})['catch'](function(_0x1075c3){logger['error']('Plugin,\x20%s,\x20%s',_0x40219d,_0x1075c3);_0x10ff4c(_0x1075c3);});});}exports[_0x56c0('0x1c')]=function(_0x5cf011){var _0x28ae53=this;return new Promise(function(_0x2e95af,_0x276507){return db['Plugin'][_0x56c0('0x1d')](_0x5cf011[_0x56c0('0x1e')],{'raw':_0x5cf011['options']?_0x5cf011[_0x56c0('0x1f')][_0x56c0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x149705){logger['info'](_0x56c0('0x1c'),_0x5cf011);logger['debug'](_0x56c0('0x1c'),_0x5cf011,JSON[_0x56c0('0x16')](_0x149705));_0x2e95af(_0x149705);})[_0x56c0('0x21')](function(_0x278fc7){logger[_0x56c0('0x17')](_0x56c0('0x1c'),_0x278fc7[_0x56c0('0x19')],_0x5cf011);_0x276507(_0x28ae53['error'](0x1f4,_0x278fc7[_0x56c0('0x19')]));});});}; \ No newline at end of file +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 diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 5a97bee..2ad5ce8 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 _0x0e38=['removeListener','length','./plugin.events','save','remove','update','emit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0e38,0x160));var _0x80e3=function(_0x363145,_0x3c43e9){_0x363145=_0x363145-0x0;var _0x4dc6cb=_0x0e38[_0x363145];return _0x4dc6cb;};'use strict';var PluginEvents=require(_0x80e3('0x0'));var events=[_0x80e3('0x1'),_0x80e3('0x2'),_0x80e3('0x3')];function createListener(_0x53e203,_0x1e0664){return function(_0xd547a7){_0x1e0664[_0x80e3('0x4')](_0x53e203,_0xd547a7);};}function removeListener(_0x549928,_0x7991a){return function(){PluginEvents[_0x80e3('0x5')](_0x549928,_0x7991a);};}exports['register']=function(_0xc7c885){for(var _0x19a304=0x0,_0xce0325=events[_0x80e3('0x6')];_0x19a304<_0xce0325;_0x19a304++){var _0x10894d=events[_0x19a304];var _0x3b5c92=createListener('plugin:'+_0x10894d,_0xc7c885);PluginEvents['on'](_0x10894d,_0x3b5c92);}}; \ No newline at end of file +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 diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index c6869ba..6993ef2 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(_0x4c9380,_0x2fefc0){var _0x49a523=function(_0x165e85){while(--_0x165e85){_0x4c9380['push'](_0x4c9380['shift']());}};_0x49a523(++_0x2fefc0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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(_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 diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 8b9bfc6..0382e8b 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 _0x0565=['script','../../files/plugins','cwd','chdir','send','update','restart','stop','hasOwnProperty','params','Unknown\x20status','delete','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','error','stack','name','status','npm\x20install','index','list','then','reject','express','length','catch','show','describe','body'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x0565,0xf2));var _0x5056=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x0565[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x5056('0x0'));var pm2=require(_0x5056('0x1'));var logger=require(_0x5056('0x2'))(_0x5056('0x3'));var path=require(_0x5056('0x4'));var exec=require(_0x5056('0x5'))[_0x5056('0x6')];var BPromise=require(_0x5056('0x7'));function handleEntityNotFound(_0x3657a8,_0x2b0883){return function(_0x554040){if(!_0x554040){_0x3657a8[_0x5056('0x8')](0x194);;}return _0x554040;};}function respondWithResult(_0x105ea8,_0x1143df){_0x1143df=_0x1143df||0xc8;return function(_0x22afb7){if(_0x22afb7){return _0x105ea8['status'](_0x1143df)['json'](_0x22afb7);}return null;};}function handleError(_0x38f74,_0x223c92){_0x223c92=_0x223c92||0x1f4;return function(_0x417065){logger[_0x5056('0x9')](_0x417065[_0x5056('0xa')]);if(_0x417065[_0x5056('0xb')]){delete _0x417065[_0x5056('0xb')];}_0x38f74[_0x5056('0xc')](_0x223c92)['send'](_0x417065);};}function execChildProcess(){return new BPromise(function(_0x78f7e4,_0xf04ea3){exec(_0x5056('0xd'),function(_0x5ab4b2,_0x4c0255,_0x17f43e){logger['info'](_0x4c0255);logger['info'](_0x17f43e);if(_0x5ab4b2){logger['error'](_0x5ab4b2);return _0xf04ea3(_0x5ab4b2);}return _0x78f7e4(_0x4c0255);});});}exports[_0x5056('0xe')]=function(_0x4b183a,_0x3e523b){return pm2[_0x5056('0xf')]()[_0x5056('0x10')](function(_0x543cee){if(_0x543cee){var _0x1e8b64=_[_0x5056('0x11')](_0x543cee,function(_0x15f52d){return _0x15f52d[_0x5056('0xb')]===_0x5056('0x12')||_0x15f52d[_0x5056('0xb')]==='motion2';});return{'rows':_0x1e8b64,'count':_0x1e8b64[_0x5056('0x13')]};}return null;})['then'](respondWithResult(_0x3e523b,null))[_0x5056('0x14')](handleError(_0x3e523b,null));};exports[_0x5056('0x15')]=function(_0x1c0ee9,_0x1f2ac6){return pm2[_0x5056('0x16')](_0x1c0ee9['params']['id'])[_0x5056('0x10')](respondWithResult(_0x1f2ac6,null))[_0x5056('0x10')](handleEntityNotFound(_0x1f2ac6,null))['catch'](handleError(_0x1f2ac6,null));};exports['create']=function(_0x20776c,_0x517bf3){if(_0x20776c[_0x5056('0x17')][_0x5056('0xb')]&&_0x20776c[_0x5056('0x17')][_0x5056('0x18')]){var _0x33035c=path['join'](__dirname,_0x5056('0x19'),_0x20776c[_0x5056('0x17')]['script']);var _0x271efc=process[_0x5056('0x1a')]();process[_0x5056('0x1b')](path['dirname'](_0x33035c));return execChildProcess()[_0x5056('0x10')](function(_0x26a3c2){process['chdir'](_0x271efc);return pm2['start']({'name':_0x20776c[_0x5056('0x17')][_0x5056('0xb')],'script':_0x33035c});})[_0x5056('0x10')](function(_0x37f7b5){pm2['dump']();return _0x37f7b5[0x0];})[_0x5056('0x10')](respondWithResult(_0x517bf3,0xc9))[_0x5056('0x14')](handleError(_0x517bf3,null));}else{return _0x517bf3['status'](0x1f4)[_0x5056('0x1c')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x5056('0x1d')]=function(_0x39d539,_0x1106e5){if(_0x39d539[_0x5056('0x17')]['id']){delete _0x39d539[_0x5056('0x17')]['id'];}var _0x50f2a8={'online':_0x5056('0x1e'),'stopped':_0x5056('0x1f')};if(_0x50f2a8[_0x5056('0x20')](_0x39d539[_0x5056('0x17')]['status'])){return pm2[_0x50f2a8[_0x39d539[_0x5056('0x17')]['status']]](_0x39d539[_0x5056('0x21')]['id'])['then'](respondWithResult(_0x1106e5,0xc8))['catch'](handleError(_0x1106e5,null));}else{return _0x1106e5['status'](0x1f4)[_0x5056('0x1c')]({'message':_0x5056('0x22')});}};exports['destroy']=function(_0x27f4be,_0x2c5728){if(_0x27f4be[_0x5056('0x17')]['id']){delete _0x27f4be[_0x5056('0x17')]['id'];}if(_0x27f4be[_0x5056('0x21')]['id']){return pm2[_0x5056('0x23')](_0x27f4be[_0x5056('0x21')]['id'])[_0x5056('0x10')](function(_0xd1aa24){pm2[_0x5056('0x24')]();return _0xd1aa24[0x0];})[_0x5056('0x10')](respondWithResult(_0x2c5728,null))['catch'](handleError(_0x2c5728,null));}else{return _0x2c5728['status'](0x1f4)[_0x5056('0x1c')]({'message':_0x5056('0x25')});}}; \ No newline at end of file +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 diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index ff43534..d3c0835 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 _0xd2ec=['/agents','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x5de10b,_0x5af540){var _0x477b4a=function(_0x1e0e2b){while(--_0x1e0e2b){_0x5de10b['push'](_0x5de10b['shift']());}};_0x477b4a(++_0x5af540);}(_0xd2ec,0x81));var _0xcd2e=function(_0x2d6df9,_0x45da50){_0x2d6df9=_0x2d6df9-0x0;var _0x429b18=_0xd2ec[_0x2d6df9];return _0x429b18;};'use strict';var express=require(_0xcd2e('0x0'));var router=express[_0xcd2e('0x1')]();var auth=require(_0xcd2e('0x2'));var controller=require('./realtime.controller');router['get'](_0xcd2e('0x3'),auth[_0xcd2e('0x4')](),controller['getAgents']);router['get']('/queues',auth[_0xcd2e('0x4')](),controller['getQueues']);module[_0xcd2e('0x5')]=router; \ No newline at end of file +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 diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index af50b7a..e3e9008 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 _0xa3dc=['UserProfile','findAndCountAll','rows','omit','globalStatus','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','openchannel','fax','includes','channel','toLowerCase','Invalid\x20channel','getOptions','userProfileId','QueueCampaigns','getResources','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','undefined','limit','count','set','Content-Range','json','error','stack','name','status','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','catch','voice','startCase','format','result','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','waiting','talking','paused','outbound','push','pTalking','originated','dialActive','dialMethod','startPredictive','erlangBusyFactor','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','agents','available','busy','find','merge','pick','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','loggedInDb','User','Queue','Pause','findAll','idle','unavailable','ringing','isNil','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','unknown','*pause','getAgents','userpic','lastLoginAt','lastPauseAt','pauseType','address','chatPause','openchannelCapacity','smsCapacity','whatsappCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','openchannelStatusTime','mailStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','routealias','faxPause','resolve','rawAttributes','fieldName','type','key','query','role','agent','raw','user','nolimit','sort'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa3dc,0x1d6));var _0xca3d=function(_0x5bbeaa,_0x2e8c53){_0x5bbeaa=_0x5bbeaa-0x0;var _0x4ef9ff=_0xa3dc[_0x5bbeaa];return _0x4ef9ff;};'use strict';var util=require(_0xca3d('0x0'));var _=require(_0xca3d('0x1'));var jayson=require(_0xca3d('0x2'));var qs=require(_0xca3d('0x3'));var logger=require(_0xca3d('0x4'))(_0xca3d('0x5'));var db=require(_0xca3d('0x6'))['db'];var amiClient=jayson[_0xca3d('0x7')][_0xca3d('0x8')]({'port':0x232a});var routingClient=jayson[_0xca3d('0x7')][_0xca3d('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x43af1e,_0x283a4c){return function(_0x8b0926){if(_0x8b0926){var _0x45d15a=typeof _0x283a4c['offset']===_0xca3d('0x9')&&typeof _0x283a4c[_0xca3d('0xa')]==='undefined';var _0x4ca9da=_0x8b0926[_0xca3d('0xb')];var _0x258aa4=_0x45d15a?0x0:_0x283a4c['offset'];var _0x428b75=_0x45d15a?_0x8b0926[_0xca3d('0xb')]:_0x283a4c['offset']+_0x283a4c[_0xca3d('0xa')];var _0x4a2dca;if(_0x428b75>=_0x4ca9da){_0x428b75=_0x4ca9da;_0x4a2dca=0xc8;}else{_0x4a2dca=0xce;}_0x43af1e['status'](_0x4a2dca);return _0x43af1e[_0xca3d('0xc')](_0xca3d('0xd'),_0x258aa4+'-'+_0x428b75+'/'+_0x4ca9da)[_0xca3d('0xe')](_0x8b0926);}return null;};}function handleError(_0x1e0651,_0x237207){_0x237207=_0x237207||0x1f4;return function(_0x47161e){logger[_0xca3d('0xf')](_0x47161e[_0xca3d('0x10')]);if(_0x47161e[_0xca3d('0x11')]){delete _0x47161e['name'];}_0x1e0651[_0xca3d('0x12')](_0x237207)[_0xca3d('0x13')](_0x47161e);};}function getRealtimeAgents(){return new Promise(function(_0x420c71,_0x12eb46){return amiClient[_0xca3d('0x14')](_0xca3d('0x15'),{})[_0xca3d('0x16')](function(_0xe92d3){if(_0xe92d3[_0xca3d('0xf')])throw new Error(_0xca3d('0x17'));var _0x2b2d2b=_0xe92d3['result'];return routingClient[_0xca3d('0x14')](_0xca3d('0x15'),{})[_0xca3d('0x16')](function(_0x52ca2c){if(_0x52ca2c['error'])throw new Error(_0xca3d('0x18'));var _0x4931f1=_0x52ca2c['result'];return _0x420c71(_['merge']({},_0x2b2d2b,_0x4931f1));});})[_0xca3d('0x19')](function(_0x3222bc){_0x12eb46(_0x3222bc);});});}function getRealtimeQueues(_0x5573b8,_0xe42750){return new Promise(function(_0x45b2ad,_0x4c1c9f){var _0x422eb4=_0xe42750===_0xca3d('0x1a')?amiClient:routingClient;return _0x422eb4[_0xca3d('0x14')](_[_0xca3d('0x1b')](_0xe42750)+'Queues',_0x5573b8)[_0xca3d('0x16')](function(_0x13a844){if(_0x13a844[_0xca3d('0xf')])throw new Error(util[_0xca3d('0x1c')]('Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues',_0xe42750));return _0x45b2ad(_0x13a844[_0xca3d('0x1d')]);})['catch'](function(_0x2a0d58){_0x4c1c9f(_0x2a0d58);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x2780e9,_0x1a19b4){return amiClient['request'](_0xca3d('0x1e'),{})['then'](function(_0x754bd7){if(_0x754bd7[_0xca3d('0xf')])throw new Error(_0xca3d('0x1f'));return _0x2780e9(_0x754bd7[_0xca3d('0x1d')]);})[_0xca3d('0x19')](function(_0x3be380){_0x1a19b4(_0x3be380);});});}function initializeQueues(_0x44dead,_0x1a5cf8,_0x44c9a9,_0x718854){var _0x56392e=[_0xca3d('0x20'),'available',_0xca3d('0x21'),_0xca3d('0x22'),_0xca3d('0x23')];if(_0x44c9a9===_0xca3d('0x1a')&&_0x718854===_0xca3d('0x24')){_0x56392e[_0xca3d('0x25')](_0xca3d('0x26'),_0xca3d('0x27'),'message',_0xca3d('0x28'),_0xca3d('0x29'),'Trunk',_0xca3d('0x2a'),'startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate',_0xca3d('0x2b'),'dialPredictiveInterval','dialPredictiveIntervalMaxThreshold',_0xca3d('0x2c'),_0xca3d('0x2d'),_0xca3d('0x2e'),_0xca3d('0x2f'),_0xca3d('0x30'),'predictiveIntervalDroppedCallsCallersExit',_0xca3d('0x31'),_0xca3d('0x32'));}return _0x44dead[_0xca3d('0x33')](function(_0x5bb203){var _0x34ce54=_0x5bb203[_0xca3d('0x34')]({'plain':!![]});_0x34ce54[_0xca3d('0x35')]=[];_0x34ce54['paused']=0x0;_0x34ce54['loggedInDb']=0x0;_0x34ce54[_0xca3d('0x20')]=0x0;_0x34ce54[_0xca3d('0x36')]=0x0;_0x34ce54[_0xca3d('0x21')]=0x0;if(_0x44c9a9===_0xca3d('0x1a')){_0x34ce54['talking']=0x0;_0x34ce54[_0xca3d('0x37')]=0x0;if(_0x718854===_0xca3d('0x24')){_0x34ce54[_0xca3d('0x26')]=0x0;_0x34ce54[_0xca3d('0x27')]=0x0;}}var _0x36c7cb=_[_0xca3d('0x38')](_0x1a5cf8,['id',_0x34ce54['id']]);if(_0x36c7cb)_[_0xca3d('0x39')](_0x34ce54,_[_0xca3d('0x3a')](_0x36c7cb,_0x56392e));return _0x34ce54;});}function updateAgentVoiceStatus(_0x2e3fe6,_0x2b6075,_0xa9bc1d){var _0x20a923=_['filter'](_0xa9bc1d,['queue',_0x2b6075[_0xca3d('0x11')]]);if(_0x20a923[_0xca3d('0x3b')]===0x0)return _0x2e3fe6[_0xca3d('0x37')]=!![];if(_[_0xca3d('0x3c')](_0x20a923,[_0xca3d('0x3d'),_0x2e3fe6[_0xca3d('0x3e')][_0xca3d('0x3f')]()]))return _0x2e3fe6[_0xca3d('0x22')]=!![];if(!_0x2e3fe6['talking'])return _0x2e3fe6['busy']=!![];}function getVoiceQueueAgents(_0x506e92,_0x1256d3,_0x2303a6,_0x257716){var _0x35c307=_[_0xca3d('0x38')](_0x1256d3,['id',_0x506e92['id']]);if(!_0x35c307)return _0x506e92;return _0x35c307[_0xca3d('0x40')]({'raw':!![]})[_0xca3d('0x16')](function(_0x225382){for(var _0x19cf7c=0x0;_0x19cf7c<_0x225382[_0xca3d('0x3b')];_0x19cf7c++){var _0x2e28e7=_[_0xca3d('0x38')](_0x2303a6,['id',_0x225382[_0x19cf7c]['UserId']]);if(!_0x2e28e7){_0x2e28e7={'id':_0x225382[_0x19cf7c][_0xca3d('0x41')],'name':_0x225382[_0x19cf7c][_0xca3d('0x41')],'accountcode':'','online':![]};}var _0x4cd155={'id':_0x2e28e7['id'],'name':_0x2e28e7[_0xca3d('0x11')],'internal':_0x2e28e7[_0xca3d('0x42')],'online':Boolean(_0x2e28e7[_0xca3d('0x43')]),'paused':Boolean(_0x225382[_0x19cf7c]['paused'])};if(_0x2e28e7[_0xca3d('0x44')]===_0xca3d('0x22'))updateAgentVoiceStatus(_0x4cd155,_0x506e92,_0x257716);if(_0x4cd155['online'])_0x506e92[_0xca3d('0x45')]++;if(_0x4cd155[_0xca3d('0x37')])_0x506e92[_0xca3d('0x37')]++;if(_0x4cd155[_0xca3d('0x23')]&&!_0x4cd155[_0xca3d('0x37')]&&!_0x4cd155[_0xca3d('0x22')])_0x506e92[_0xca3d('0x23')]++;_0x506e92['agents']['push'](_0x4cd155);}return _0x506e92;});}function getQueueAgents(_0x5c4396,_0x120618,_0x58f131){var _0x3f69eb=_0xca3d('0x46')+_[_0xca3d('0x1b')](_0x58f131)+_0xca3d('0x47');var _0x1c4ede=_0x58f131+_0xca3d('0x48');return db[_0x3f69eb][_0xca3d('0x49')]({'where':{[_[_0xca3d('0x1b')](_0x58f131)+'QueueId']:_0x5c4396['id']},'raw':!![]})[_0xca3d('0x16')](function(_0x5913f4){for(var _0x357ecc=0x0;_0x357ecc<_0x5913f4[_0xca3d('0x3b')];_0x357ecc++){var _0x31f133=_['find'](_0x120618,['id',_0x5913f4[_0x357ecc][_0xca3d('0x41')]]);if(!_0x31f133){_0x31f133={'id':_0x5913f4[_0x357ecc][_0xca3d('0x41')],'name':_0x5913f4[_0x357ecc][_0xca3d('0x41')],'online':![],['pauseField']:![]};}var _0x2c5acb={'id':_0x31f133['id'],'name':_0x31f133[_0xca3d('0x11')],'online':Boolean(_0x31f133[_0xca3d('0x43')]),'paused':Boolean(_0x31f133[_0x1c4ede])};if(_0x2c5acb[_0xca3d('0x43')])_0x5c4396[_0xca3d('0x45')]++;_0x5c4396[_0xca3d('0x35')]['push'](_0x2c5acb);}return _0x5c4396;});}function isIdle(_0x243652){return _0x243652===_0xca3d('0x4a')||_0x243652==='unknown'||_0x243652===_0xca3d('0x4b')||_0x243652===_0xca3d('0x4c')||_[_0xca3d('0x4d')](_0x243652);}function isAgentPaused(_0x56b8b5,_0x585f22){var _0x30b4c5=[_0x56b8b5['chatPause'],_0x56b8b5['faxPause'],_0x56b8b5[_0xca3d('0x4e')],_0x56b8b5[_0xca3d('0x4f')],_0x56b8b5[_0xca3d('0x50')],_0x56b8b5[_0xca3d('0x51')],_0x56b8b5[_0xca3d('0x52')]];if(!_0x585f22)return _[_0xca3d('0x53')](_0x30b4c5);var _0xff6af2=_[_0xca3d('0x54')](_0x30b4c5);return _0xff6af2[_0xca3d('0x3b')]>0x0&&_0xff6af2[_0xca3d('0x3b')]<_0x30b4c5[_0xca3d('0x3b')]?!![]:![];}function isAgentIdle(_0xf1c2ca){if(_0xf1c2ca['voiceStatus']!==_0xca3d('0x4a')&&_0xf1c2ca[_0xca3d('0x51')]){_0xf1c2ca[_0xca3d('0x44')]=_0xca3d('0x55');return![];}return _[_0xca3d('0x53')]([_0xf1c2ca[_0xca3d('0x56')],_0xf1c2ca[_0xca3d('0x57')],_0xf1c2ca[_0xca3d('0x58')],_0xf1c2ca[_0xca3d('0x59')],_0xf1c2ca['smsStatus'],_0xf1c2ca['voiceStatus'],_0xf1c2ca[_0xca3d('0x5a')]],isIdle);}function getAgentStatus(_0x50d2b4){var _0x4d1ce3=_0xca3d('0x5b');if(isAgentPaused(_0x50d2b4))_0x4d1ce3='pause';else if(isAgentPaused(_0x50d2b4,!![]))_0x4d1ce3=_0xca3d('0x5c');else if(isAgentIdle(_0x50d2b4))_0x4d1ce3=_0xca3d('0x4a');else _0x4d1ce3='busy';return _0x4d1ce3;}exports[_0xca3d('0x5d')]=function(_0x339f6c,_0x4a98d2){var _0x35ceaa={'count':0x0,'rows':[]},_0x49377e={},_0x69a7bf,_0x572856,_0x21b27f=[_0xca3d('0x5e'),_0xca3d('0x43'),_0xca3d('0x5f'),_0xca3d('0x60'),_0xca3d('0x61'),_0xca3d('0x60'),_0xca3d('0x3e'),_0xca3d('0x62'),_0xca3d('0x63'),'openchannelPause',_0xca3d('0x4e'),_0xca3d('0x50'),_0xca3d('0x52'),'faxPause',_0xca3d('0x51'),'chatCapacity',_0xca3d('0x64'),'mailCapacity',_0xca3d('0x65'),_0xca3d('0x66'),'faxCapacity',_0xca3d('0x67'),_0xca3d('0x68'),_0xca3d('0x69'),_0xca3d('0x6a'),'whatsappCurrentCapacity',_0xca3d('0x6b'),_0xca3d('0x56'),_0xca3d('0x59'),_0xca3d('0x58'),'smsStatus',_0xca3d('0x5a'),_0xca3d('0x57'),_0xca3d('0x44'),'chatStatusTime',_0xca3d('0x6c'),_0xca3d('0x6d'),'smsStatusTime',_0xca3d('0x6e'),_0xca3d('0x6f'),_0xca3d('0x70'),_0xca3d('0x71'),_0xca3d('0x72'),'screenrecording',_0xca3d('0x73'),'phoneBarEnableAutomaticScreenRecording',_0xca3d('0x74')],_0x353782=['chatPause',_0xca3d('0x4f'),_0xca3d('0x4e'),_0xca3d('0x50'),_0xca3d('0x52'),_0xca3d('0x75'),_0xca3d('0x51'),_0xca3d('0x43')];Promise[_0xca3d('0x76')]()['then'](function(){var _0x53f1c7=_['map'](db[_0xca3d('0x46')][_0xca3d('0x77')],function(_0x3d72fd){return{'name':_0x3d72fd[_0xca3d('0x78')],'type':_0x3d72fd[_0xca3d('0x79')][_0xca3d('0x7a')]};});_0x339f6c[_0xca3d('0x7b')][_0xca3d('0x7c')]=_0xca3d('0x7d');_0x339f6c[_0xca3d('0x7b')]['online']=!![];_0x49377e=qs['getOptions'](_0x53f1c7,_0x339f6c);_0x49377e[_0xca3d('0x7e')]=!![];if(_0x339f6c[_0xca3d('0x7f')][_0xca3d('0x7c')]===_0xca3d('0x7f')){var _0x46802d={'params':{'id':_0x339f6c[_0xca3d('0x7f')]['userProfileId']},'query':{'section':_0xca3d('0x15'),'role':'agent','online':!![],'nolimit':_0x339f6c['query'][_0xca3d('0x80')],'sort':_0x339f6c[_0xca3d('0x7b')][_0xca3d('0x81')],'filter':_0x339f6c[_0xca3d('0x7b')][_0xca3d('0x54')]},'raw':!![]};return db[_0xca3d('0x82')]['getResources'](_0x46802d);}return db[_0xca3d('0x46')][_0xca3d('0x83')](_0x49377e);})[_0xca3d('0x16')](function(_0x1e8758){_0x35ceaa[_0xca3d('0xb')]=_0x1e8758[_0xca3d('0xb')];_0x69a7bf=_0x1e8758[_0xca3d('0x84')];return getRealtimeAgents();})[_0xca3d('0x16')](function(_0x2ef674){_0x572856=_0x2ef674[_0xca3d('0x84')];return _0x69a7bf[_0xca3d('0x33')](function(_0x69493a){var _0x45eb2d=_[_0xca3d('0x38')](_0x572856,['id',_0x69493a['id']]);if(_0x45eb2d)_[_0xca3d('0x39')](_0x69493a,_['pick'](_[_0xca3d('0x85')](_0x45eb2d,_0x353782),_0x21b27f));_0x69493a[_0xca3d('0x86')]=getAgentStatus(_0x69493a);return _0x69493a;});})[_0xca3d('0x16')](function(_0x282840){if(_0x339f6c[_0xca3d('0x7b')][_0xca3d('0x87')]){var _0x364cf0=_[_0xca3d('0x54')](_0x282840,['globalStatus',_0x339f6c['query'][_0xca3d('0x87')]]);if(_0x339f6c['query'][_0xca3d('0x88')]){_0x364cf0=_[_0xca3d('0x54')](_0x364cf0,[_0xca3d('0x61'),_0x339f6c['query']['pauseTypeFilter']]);}}_0x35ceaa[_0xca3d('0x84')]=_0x364cf0||_0x282840;return _0x35ceaa;})['then'](respondWithFilteredResult(_0x4a98d2,_0x49377e))['catch'](handleError(_0x4a98d2,null));};exports[_0xca3d('0x89')]=function(_0x37c80d,_0x1f4b6e){var _0x117bf6=[_0xca3d('0x8a'),_0xca3d('0x8b'),'sms',_0xca3d('0x8c'),_0xca3d('0x8d'),'whatsapp',_0xca3d('0x1a')];var _0x1105cf={'count':0x0,'rows':[]},_0x5df8c8={},_0x1b4763,_0x581d6e,_0x1bd6a5,_0x597f10,_0x25b0c1;Promise[_0xca3d('0x76')]()[_0xca3d('0x16')](function(){if(_0x37c80d['query']['channel']){if(!_[_0xca3d('0x8e')](_0x117bf6,_0x37c80d['query'][_0xca3d('0x8f')][_0xca3d('0x90')]()))throw new Error(_0xca3d('0x91'));_0x1b4763=_0x37c80d[_0xca3d('0x7b')][_0xca3d('0x8f')][_0xca3d('0x90')]();}var _0x273ebe=_['startCase'](_0x1b4763)+'Queue';var _0x23dec4=_[_0xca3d('0x33')](db[_0x273ebe][_0xca3d('0x77')],function(_0x46b49c){return{'name':_0x46b49c[_0xca3d('0x78')],'type':_0x46b49c[_0xca3d('0x79')][_0xca3d('0x7a')]};});_0x5df8c8=qs[_0xca3d('0x92')](_0x23dec4,_0x37c80d);if(_0x37c80d['user'][_0xca3d('0x7c')]===_0xca3d('0x7f')){var _0x1461a9={'params':{'id':_0x37c80d[_0xca3d('0x7f')][_0xca3d('0x93')]},'query':{'section':_0x1b4763==='voice'&&_0x37c80d[_0xca3d('0x7b')]['type']===_0xca3d('0x24')?_0xca3d('0x94'):_['startCase'](_0x1b4763)+'Queues','type':_0x37c80d[_0xca3d('0x7b')][_0xca3d('0x79')],'nolimit':!![],'sort':_0xca3d('0x11'),'filter':_0x37c80d[_0xca3d('0x7b')][_0xca3d('0x54')]}};return db[_0xca3d('0x82')][_0xca3d('0x95')](_0x1461a9);}return db[_0x273ebe][_0xca3d('0x83')](_0x5df8c8);})[_0xca3d('0x16')](function(_0x50f0c3){_0x1105cf[_0xca3d('0xb')]=_0x50f0c3[_0xca3d('0xb')];_0x581d6e=_0x50f0c3[_0xca3d('0x84')];return getRealtimeQueues(_0x37c80d,_0x1b4763);})[_0xca3d('0x16')](function(_0x1cd6ad){_0x597f10=_0x1cd6ad[_0xca3d('0x84')];return getRealtimeAgents();})[_0xca3d('0x16')](function(_0xe371a4){_0x1bd6a5=_0xe371a4[_0xca3d('0x84')];if(_0x1b4763!='voice')return;return getRealtimeVoiceQueueChannels();})[_0xca3d('0x16')](function(_0x14fbd5){_0x25b0c1=_0x14fbd5?_0x14fbd5[_0xca3d('0x84')]:[];return initializeQueues(_0x581d6e,_0x597f10,_0x1b4763,_0x37c80d['query']['type']);})['then'](function(_0x36f8e0){var _0x220ef2=_0x36f8e0[_0xca3d('0x33')](function(_0x53d4e6){if(_0x1b4763===_0xca3d('0x1a'))return getVoiceQueueAgents(_0x53d4e6,_0x581d6e,_0x1bd6a5,_0x25b0c1);else return getQueueAgents(_0x53d4e6,_0x1bd6a5,_0x1b4763);});return Promise['all'](_0x220ef2);})['then'](function(_0x2c9e85){_0x1105cf['rows']=_0x2c9e85;return _0x1105cf;})[_0xca3d('0x16')](respondWithFilteredResult(_0x1f4b6e,_0x5df8c8))[_0xca3d('0x19')](handleError(_0x1f4b6e,null));}; \ No newline at end of file +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 diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 1adbc61..d60a460 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xc58c35,_0x3ca275){var _0x376e8b=function(_0x4e4432){while(--_0x4e4432){_0xc58c35['push'](_0xc58c35['shift']());}};_0x376e8b(++_0x3ca275);}(_0x70e0,0x17b));var _0x070e=function(_0x445b83,_0xbb1ed4){_0x445b83=_0x445b83-0x0;var _0x28e418=_0x70e0[_0x445b83];return _0x28e418;};'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(_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 diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 43b97d3..122f143 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 _0xbdb9=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x290b5a,_0x1905ba){var _0x2d6836=function(_0x265b63){while(--_0x265b63){_0x290b5a['push'](_0x290b5a['shift']());}};_0x2d6836(++_0x1905ba);}(_0xbdb9,0xac));var _0x9bdb=function(_0x4b9cd4,_0x107bab){_0x4b9cd4=_0x4b9cd4-0x0;var _0x268a99=_0xbdb9[_0x4b9cd4];return _0x268a99;};'use strict';var Sequelize=require(_0x9bdb('0x0'));module[_0x9bdb('0x1')]={'state':{'type':Sequelize[_0x9bdb('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x9bdb('0x3')]},'scheduledat':{'type':Sequelize[_0x9bdb('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9bdb('0x4')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x9bdb('0x3')]}}; \ No newline at end of file +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 diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 61d3f65..6c360fd 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 _0x8e2e=['exports','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird','rimraf'];(function(_0x139a4f,_0x5c6d66){var _0x46ed1c=function(_0x1190e4){while(--_0x1190e4){_0x139a4f['push'](_0x139a4f['shift']());}};_0x46ed1c(++_0x5c6d66);}(_0x8e2e,0xa5));var _0xe8e2=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x8e2e[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xe8e2('0x0'));var util=require(_0xe8e2('0x1'));var logger=require('../../config/logger')(_0xe8e2('0x2'));var moment=require(_0xe8e2('0x3'));var BPromise=require(_0xe8e2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8e2('0x5'));var config=require('../../config/environment');var attributes=require('./reportAgentPreview.attributes');module[_0xe8e2('0x6')]=function(_0x443595,_0x2d01f){return _0x443595['define'](_0xe8e2('0x7'),attributes,{'tableName':_0xe8e2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 45c63e8..1a0ccb5 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 _0xce9b=['stringify','error','message','CreateReportAgentPreview','ReportAgentPreview','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xce9b,0xed));var _0xbce9=function(_0x5f5d3d,_0x58bea5){_0x5f5d3d=_0x5f5d3d-0x0;var _0x2767b0=_0xce9b[_0x5f5d3d];return _0x2767b0;};'use strict';var _=require(_0xbce9('0x0'));var util=require(_0xbce9('0x1'));var moment=require(_0xbce9('0x2'));var BPromise=require('bluebird');var rs=require(_0xbce9('0x3'));var fs=require('fs');var Redis=require(_0xbce9('0x4'));var db=require(_0xbce9('0x5'))['db'];var utils=require(_0xbce9('0x6'));var logger=require(_0xbce9('0x7'))('rpc');var config=require(_0xbce9('0x8'));var jayson=require(_0xbce9('0x9'));var client=jayson[_0xbce9('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ee6f8,_0x113c0b,_0x5d2dc6){return new BPromise(function(_0x394a05,_0x4441d9){return client['request'](_0x2ee6f8,_0x5d2dc6)['then'](function(_0xfad0c7){logger[_0xbce9('0xb')](_0xbce9('0xc'),_0x113c0b,_0xbce9('0xd'));logger[_0xbce9('0xe')](_0xbce9('0xf'),_0x113c0b,_0xbce9('0xd'),JSON[_0xbce9('0x10')](_0xfad0c7));if(_0xfad0c7[_0xbce9('0x11')]){if(_0xfad0c7['error']['code']===0x1f4){logger[_0xbce9('0x11')](_0xbce9('0xc'),_0x113c0b,_0xfad0c7[_0xbce9('0x11')]['message']);return _0x4441d9(_0xfad0c7[_0xbce9('0x11')]['message']);}logger['error'](_0xbce9('0xc'),_0x113c0b,_0xfad0c7[_0xbce9('0x11')][_0xbce9('0x12')]);return _0x394a05(_0xfad0c7[_0xbce9('0x11')][_0xbce9('0x12')]);}else{logger[_0xbce9('0xb')](_0xbce9('0xc'),_0x113c0b,_0xbce9('0xd'));_0x394a05(_0xfad0c7['result']['message']);}})['catch'](function(_0x2d1cc3){logger[_0xbce9('0x11')](_0xbce9('0xc'),_0x113c0b,_0x2d1cc3);_0x4441d9(_0x2d1cc3);});});}exports[_0xbce9('0x13')]=function(_0x394376){var _0x43b06a=this;return new Promise(function(_0x2e328e,_0x3d96a0){return db[_0xbce9('0x14')]['create'](_0x394376[_0xbce9('0x15')],{'raw':_0x394376[_0xbce9('0x16')]?_0x394376[_0xbce9('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x359e3d){logger['info']('CreateReportAgentPreview',_0x394376);logger[_0xbce9('0xe')](_0xbce9('0x13'),_0x394376,JSON[_0xbce9('0x10')](_0x359e3d));_0x2e328e(_0x359e3d);})['catch'](function(_0x133bbc){logger[_0xbce9('0x11')](_0xbce9('0x13'),_0x133bbc[_0xbce9('0x12')],_0x394376);_0x3d96a0(_0x43b06a[_0xbce9('0x11')](0x1f4,_0x133bbc[_0xbce9('0x12')]));});});}; \ No newline at end of file +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 diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index bb57e95..33ac27f 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 _0x7381=['voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','/agents/:id/notify','exports','multer','express','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','get','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues'];(function(_0x8cbc94,_0x53c62d){var _0x284b48=function(_0xa85952){while(--_0xa85952){_0x8cbc94['push'](_0x8cbc94['shift']());}};_0x284b48(++_0x53c62d);}(_0x7381,0x133));var _0x1738=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0x7381[_0x2bcd1f];return _0x2381ca;};'use strict';var multer=require(_0x1738('0x0'));var util=require('util');var path=require('path');var express=require(_0x1738('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./rpc.controller');router['get']('/voice/channels',auth[_0x1738('0x2')](),controller[_0x1738('0x3')]);router['get'](_0x1738('0x4'),auth[_0x1738('0x2')](),controller[_0x1738('0x5')]);router[_0x1738('0x6')](_0x1738('0x7'),auth[_0x1738('0x2')](),controller['voiceChannelStopMixMonitor']);router[_0x1738('0x6')](_0x1738('0x8'),auth[_0x1738('0x2')](),controller[_0x1738('0x9')]);router[_0x1738('0x6')](_0x1738('0xa'),auth[_0x1738('0x2')](),controller[_0x1738('0xb')]);router['get'](_0x1738('0xc'),auth[_0x1738('0x2')](),controller[_0x1738('0xd')]);router[_0x1738('0x6')](_0x1738('0xe'),auth['isAuthenticated'](),controller[_0x1738('0xf')]);router[_0x1738('0x6')]('/openchannel/queues',auth[_0x1738('0x2')](),controller[_0x1738('0x10')]);router[_0x1738('0x6')](_0x1738('0x11'),auth[_0x1738('0x2')](),controller[_0x1738('0x12')]);router[_0x1738('0x6')](_0x1738('0x13'),auth[_0x1738('0x2')](),controller[_0x1738('0x14')]);router['get'](_0x1738('0x15'),auth['isAuthenticated'](),controller[_0x1738('0x16')]);router[_0x1738('0x6')]('/voice/queues/preview/:id',auth[_0x1738('0x2')](),controller[_0x1738('0x17')]);router['get']('/voice/queues/channels',auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x1738('0x6')](_0x1738('0x18'),auth[_0x1738('0x2')](),controller[_0x1738('0x19')]);router[_0x1738('0x6')](_0x1738('0x1a'),auth[_0x1738('0x2')](),controller['voiceQueuesChannelHangup']);router[_0x1738('0x6')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x1738('0x2')](),controller['voiceQueuesChannelRedirect']);router[_0x1738('0x6')](_0x1738('0x1b'),auth[_0x1738('0x2')](),controller[_0x1738('0x1c')]);router[_0x1738('0x1d')]('/voice/queues/:id',auth[_0x1738('0x2')](),controller[_0x1738('0x1e')]);router[_0x1738('0x6')](_0x1738('0x1f'),auth['isAuthenticated'](),controller[_0x1738('0x20')]);router[_0x1738('0x6')](_0x1738('0x21'),auth[_0x1738('0x2')](),controller[_0x1738('0x22')]);router['get'](_0x1738('0x23'),auth['isAuthenticated'](),controller[_0x1738('0x24')]);router['put'](_0x1738('0x25'),auth[_0x1738('0x2')](),controller[_0x1738('0x26')]);router[_0x1738('0x6')](_0x1738('0x27'),auth[_0x1738('0x2')](),controller['telephones']);router['get'](_0x1738('0x28'),auth[_0x1738('0x2')](),controller[_0x1738('0x29')]);router[_0x1738('0x6')](_0x1738('0x2a'),auth[_0x1738('0x2')](),controller[_0x1738('0x2b')]);router[_0x1738('0x6')](_0x1738('0x2c'),auth['isAuthenticated'](),controller[_0x1738('0x2d')]);router[_0x1738('0x6')](_0x1738('0x2e'),auth['isAuthenticated'](),controller[_0x1738('0x2f')]);router[_0x1738('0x6')](_0x1738('0x30'),auth['isAuthenticated'](),controller[_0x1738('0x31')]);router[_0x1738('0x6')](_0x1738('0x32'),auth['isAuthenticated'](),controller['openchannelQueuesWaitingInteractions']);router[_0x1738('0x6')](_0x1738('0x33'),auth[_0x1738('0x2')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1738('0x6')](_0x1738('0x34'),auth[_0x1738('0x2')](),controller[_0x1738('0x35')]);router[_0x1738('0x6')](_0x1738('0x36'),auth[_0x1738('0x2')](),controller['whatsappQueuesWaitingInteractions']);router[_0x1738('0x6')]('/fax/queues/waitinginteractions',auth[_0x1738('0x2')](),controller[_0x1738('0x37')]);router[_0x1738('0x38')](_0x1738('0x39'),auth['isAuthenticated'](),controller[_0x1738('0x3a')]('mail'));router[_0x1738('0x6')]('/mail/queues/:id',auth[_0x1738('0x2')](),controller[_0x1738('0x3b')]);router['post'](_0x1738('0x3c'),auth[_0x1738('0x2')](),controller[_0x1738('0x3a')](_0x1738('0x3d')));router[_0x1738('0x6')](_0x1738('0x3e'),auth['isAuthenticated'](),controller[_0x1738('0x3f')]);router[_0x1738('0x38')](_0x1738('0x40'),auth[_0x1738('0x2')](),controller[_0x1738('0x3a')](_0x1738('0x41')));router[_0x1738('0x6')]('/fax/queues/:id',auth[_0x1738('0x2')](),controller[_0x1738('0x42')]);router['post'](_0x1738('0x43'),auth[_0x1738('0x2')](),controller[_0x1738('0x3a')]('openchannel'));router['get'](_0x1738('0x44'),auth[_0x1738('0x2')](),controller[_0x1738('0x45')]);router[_0x1738('0x38')](_0x1738('0x46'),auth['isAuthenticated'](),controller[_0x1738('0x3a')](_0x1738('0x47')));router[_0x1738('0x38')](_0x1738('0x48'),auth[_0x1738('0x2')](),controller[_0x1738('0x3a')](_0x1738('0x49')));router['get']('/sms/queues/:id',auth[_0x1738('0x2')](),controller[_0x1738('0x4a')]);router['get'](_0x1738('0x4b'),auth['isAuthenticated'](),controller[_0x1738('0x4c')]);router[_0x1738('0x38')](_0x1738('0x4d'),auth['isAuthenticated'](),controller['agentNotify']);module[_0x1738('0x4e')]=router; \ No newline at end of file +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 diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 5eb1d40..8b29a51 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 _0x6aa7=['rows','find','VoiceChannels','query','then','voiceChannelMixMonitor','VoiceChannelMixMonitor','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','merge','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','user','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','mailQueues','showMailQueues','MailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','queue_id','uniq','value','indexOf','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','Website','Account','Queue','\x20Queue\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','update','Interaction','queue','MessageId','InteractionId','From','TransferReport','create','Start','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','capitalize','chat','User','findOne','Agent\x20not\x20found','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','code','message','result','catch','status','json','sendStatus','name','send','isNil'];(function(_0x602dda,_0x96f3c){var _0x3a14ac=function(_0x269fd5){while(--_0x269fd5){_0x602dda['push'](_0x602dda['shift']());}};_0x3a14ac(++_0x96f3c);}(_0x6aa7,0x178));var _0x76aa=function(_0x371d9e,_0x6e5ca8){_0x371d9e=_0x371d9e-0x0;var _0x41bc3b=_0x6aa7[_0x371d9e];return _0x41bc3b;};'use strict';var BPromise=require(_0x76aa('0x0'));var moment=require('moment');var _=require(_0x76aa('0x1'));var util=require(_0x76aa('0x2'));var db=require(_0x76aa('0x3'))['db'];var logger=require(_0x76aa('0x4'))('api');var jayson=require(_0x76aa('0x5'));var amiClient=jayson[_0x76aa('0x6')][_0x76aa('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x76aa('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){var _0x266bd5=_0xa9b695?_0xa9b695:amiClient;return _0x266bd5[_0x76aa('0x8')](_0x32dee5,_0x36d12b)['then'](function(_0xcd99aa){if(_0xcd99aa[_0x76aa('0x9')]){if(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xa')]===0x1f4){return _0x3dae33(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xb')]);}return _0x56d6bc(_0xcd99aa[_0x76aa('0x9')][_0x76aa('0xb')]);}else{_0x56d6bc(_0xcd99aa[_0x76aa('0xc')]);}})[_0x76aa('0xd')](function(_0x5e5f47){_0x3dae33(_0x5e5f47);});});}function respondWithResult(_0x112c39,_0x5df49c){_0x5df49c=_0x5df49c||0xc8;return function(_0x226536){if(_0x226536){return _0x112c39[_0x76aa('0xe')](_0x5df49c)[_0x76aa('0xf')](_0x226536);}return _0x112c39[_0x76aa('0x10')](0x194);};}function handleError(_0x10432c,_0x4e309f){_0x4e309f=_0x4e309f||0x1f4;return function(_0x5f5b59){logger[_0x76aa('0x9')](_0x5f5b59['stack']);if(_0x5f5b59[_0x76aa('0x11')]){delete _0x5f5b59[_0x76aa('0x11')];}_0x10432c['status'](_0x4e309f)[_0x76aa('0x12')](_0x5f5b59);};}function findById(_0x550d9a){return function(_0x328381){if(!_['isNil'](_0x550d9a)&&!_[_0x76aa('0x13')](_0x328381)&&!_[_0x76aa('0x13')](_0x328381[_0x76aa('0x14')])){return _[_0x76aa('0x15')](_0x328381[_0x76aa('0x14')],function(_0x3ead3f){return _0x3ead3f['id']==_0x550d9a;});}return null;};}exports['voiceChannels']=function(_0x5d6202,_0x256636){return respondWithRpcPromise(_0x76aa('0x16'),_0x5d6202[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x256636,null))[_0x76aa('0xd')](handleError(_0x256636,null));};exports[_0x76aa('0x19')]=function(_0x19af92,_0x2eaf48){return respondWithRpcPromise(_0x76aa('0x1a'),_['merge'](_0x19af92[_0x76aa('0x17')],_0x19af92[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x2eaf48,null))['catch'](handleError(_0x2eaf48,null));};exports[_0x76aa('0x1c')]=function(_0x189cb6,_0x31252f){return respondWithRpcPromise(_0x76aa('0x1d'),_[_0x76aa('0x1e')](_0x189cb6[_0x76aa('0x17')],_0x189cb6[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x31252f,null))[_0x76aa('0xd')](handleError(_0x31252f,null));};exports[_0x76aa('0x1f')]=function(_0x37f1ab,_0x26b75e){return respondWithRpcPromise(_0x76aa('0x20'),_0x37f1ab['query'])[_0x76aa('0x18')](respondWithResult(_0x26b75e,null))[_0x76aa('0xd')](handleError(_0x26b75e,null));};exports[_0x76aa('0x21')]=function(_0x2e7ab4,_0xa1e6){return respondWithRpcPromise(_0x76aa('0x20'),_0x2e7ab4[_0x76aa('0x17')])[_0x76aa('0x18')](findById(_0x2e7ab4[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xa1e6,null))['catch'](handleError(_0xa1e6,null));};exports[_0x76aa('0x22')]=function(_0x5a8030,_0x994550){return respondWithRpcPromise(_0x76aa('0x23'),_[_0x76aa('0x1e')](_0x5a8030[_0x76aa('0x24')],_0x5a8030[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x994550,null))[_0x76aa('0xd')](handleError(_0x994550,null));};exports[_0x76aa('0x25')]=function(_0x19fd4f,_0x3ea05a){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x76aa('0x1e')](_0x19fd4f[_0x76aa('0x17')],_0x19fd4f[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x3ea05a,null))[_0x76aa('0xd')](handleError(_0x3ea05a,null));};exports[_0x76aa('0x26')]=function(_0x35a705,_0x4eb57a){return respondWithRpcPromise(_0x76aa('0x27'),_0x35a705[_0x76aa('0x17')])['then'](respondWithResult(_0x4eb57a,null))[_0x76aa('0xd')](handleError(_0x4eb57a,null));};exports['voiceQueuesChannel']=function(_0x2e2ba3,_0x4c90b6){return respondWithRpcPromise(_0x76aa('0x28'),_['merge'](_0x2e2ba3['query'],_0x2e2ba3[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x4c90b6,null))[_0x76aa('0xd')](handleError(_0x4c90b6,null));};exports[_0x76aa('0x29')]=function(_0x595a0f,_0x592596){return respondWithRpcPromise(_0x76aa('0x2a'),_[_0x76aa('0x1e')](_0x595a0f[_0x76aa('0x17')],_0x595a0f[_0x76aa('0x1b')]))[_0x76aa('0x18')](respondWithResult(_0x592596,null))['catch'](handleError(_0x592596,null));};exports[_0x76aa('0x2b')]=function(_0x5c77f1,_0x5086f5){return respondWithRpcPromise(_0x76aa('0x2c'),_[_0x76aa('0x1e')](_0x5c77f1[_0x76aa('0x17')],_0x5c77f1[_0x76aa('0x1b')]))['then'](respondWithResult(_0x5086f5,null))[_0x76aa('0xd')](handleError(_0x5086f5,null));};exports[_0x76aa('0x2d')]=function(_0x2eea79,_0x4e131a){return respondWithRpcPromise(_0x76aa('0x2e'),_0x2eea79[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x4e131a,null))[_0x76aa('0xd')](handleError(_0x4e131a,null));};exports[_0x76aa('0x2f')]=function(_0x982e62,_0x878903){return respondWithRpcPromise(_0x76aa('0x30'),_0x982e62[_0x76aa('0x17')])['then'](respondWithResult(_0x878903,null))[_0x76aa('0xd')](handleError(_0x878903,null));};exports[_0x76aa('0x31')]=function(_0x4a5a96,_0xa824e8){var _0x64612e;return respondWithRpcPromise(_0x76aa('0x32'),_0x4a5a96['query'])['then'](function(_0x153a47){_0x64612e=_0x153a47;return respondWithRpcPromise(_0x76aa('0x32'),_0x4a5a96[_0x76aa('0x17')],routingClient);})[_0x76aa('0x18')](function(_0x50599f){return _[_0x76aa('0x1e')]({},_0x50599f,_0x64612e);})[_0x76aa('0x18')](respondWithResult(_0xa824e8,null))[_0x76aa('0xd')](handleError(_0xa824e8,null));};exports[_0x76aa('0x33')]=function(_0x1138b5,_0x4aa2f3){if(_0x1138b5[_0x76aa('0x24')]&&_0x1138b5['body'][_0x76aa('0x34')]&&_0x1138b5['user']&&_0x1138b5['user']['name']){for(var _0x144f0a in _0x1138b5['body']['interaction']){if(_0x1138b5['body'][_0x76aa('0x34')][_0x76aa('0x35')](_0x144f0a)){db[_0x76aa('0x36')][_0x76aa('0x37')]({'where':{'channel':_0x144f0a,'membername':_0x1138b5[_0x76aa('0x38')]['name'],'type':_0x76aa('0x39'),'exitAt':null,'uniqueid':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]&&_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]['length']?{'$notIn':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a]}:{'$ne':null}}})['then'](function(_0x2d3441){var _0x5a984e=moment()[_0x76aa('0x3a')](_0x76aa('0x3b'));for(var _0x31930b=0x0,_0x18fd3e=_0x2d3441[_0x76aa('0x3c')];_0x31930b<_0x18fd3e;_0x31930b+=0x1){_0x2d3441[_0x31930b][_0x76aa('0x3d')]({'exitAt':_0x5a984e});}});for(var _0x2e229d=0x0;_0x2e229d<_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a][_0x76aa('0x3c')];_0x2e229d+=0x1){db['MemberReport'][_0x76aa('0x3e')]({'where':{'channel':_0x144f0a,'membername':_0x1138b5['user'][_0x76aa('0x11')],'type':_0x76aa('0x39'),'uniqueid':_0x1138b5[_0x76aa('0x24')][_0x76aa('0x34')][_0x144f0a][_0x2e229d],'exitAt':null},'defaults':{'channel':_0x144f0a,'membername':_0x1138b5['user']['name'],'interface':_[_0x76aa('0x13')](_0x1138b5['user'][_0x76aa('0x3f')])?util[_0x76aa('0x3a')](_0x76aa('0x40'),_0x1138b5[_0x76aa('0x38')][_0x76aa('0x11')]):_0x1138b5[_0x76aa('0x38')]['interface'],'type':'INTERACTION','enterAt':moment()[_0x76aa('0x3a')](_0x76aa('0x3b')),'role':_0x76aa('0x41'),'internal':_0x1138b5[_0x76aa('0x38')][_0x76aa('0x42')],'uniqueid':_0x1138b5[_0x76aa('0x24')]['interaction'][_0x144f0a][_0x2e229d]}});}}}}return respondWithRpcPromise(_0x76aa('0x43'),{'id':_0x1138b5[_0x76aa('0x1b')]['id'],'capacity':_0x1138b5[_0x76aa('0x24')]['capacity']},routingClient)[_0x76aa('0x18')](respondWithResult(_0x4aa2f3,null))['catch'](handleError(_0x4aa2f3,null));};exports[_0x76aa('0x44')]=function(_0x5e1d84,_0x339b0d){return respondWithRpcPromise(_0x76aa('0x45'),_0x5e1d84[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x339b0d,null))[_0x76aa('0xd')](handleError(_0x339b0d,null));};exports[_0x76aa('0x46')]=function(_0x953726,_0x4f2c2b){return respondWithRpcPromise(_0x76aa('0x47'),_0x953726['query'])[_0x76aa('0x18')](respondWithResult(_0x4f2c2b,null))[_0x76aa('0xd')](handleError(_0x4f2c2b,null));};exports[_0x76aa('0x48')]=function(_0x53be10,_0x3fa7ec){return respondWithRpcPromise(_0x76aa('0x49'),_0x53be10[_0x76aa('0x17')])['then'](respondWithResult(_0x3fa7ec,null))[_0x76aa('0xd')](handleError(_0x3fa7ec,null));};exports[_0x76aa('0x4a')]=function(_0x27fc84,_0x1fd2b6){return respondWithRpcPromise('ChatQueues',_0x27fc84[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x1fd2b6,null))[_0x76aa('0xd')](handleError(_0x1fd2b6,null));};exports[_0x76aa('0x4b')]=function(_0x2027f8,_0xf7732){return respondWithRpcPromise('ChatQueues',_0x2027f8[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x2027f8[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xf7732,null))[_0x76aa('0xd')](handleError(_0xf7732,null));};exports[_0x76aa('0x4c')]=function(_0x37babe,_0x51893b){return respondWithRpcPromise('MailQueues',_0x37babe[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x51893b,null))['catch'](handleError(_0x51893b,null));};exports[_0x76aa('0x4d')]=function(_0x1e6f3c,_0x4f832d){return respondWithRpcPromise(_0x76aa('0x4e'),_0x1e6f3c[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x1e6f3c[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0x4f832d,null))[_0x76aa('0xd')](handleError(_0x4f832d,null));};exports[_0x76aa('0x4f')]=function(_0x30573a,_0x69b1af){return respondWithRpcPromise('MailAccounts',_0x30573a[_0x76aa('0x17')],mailClient)['then'](respondWithResult(_0x69b1af,null))[_0x76aa('0xd')](handleError(_0x69b1af,null));};exports[_0x76aa('0x50')]=function(_0x2fef92,_0x16cc85){return respondWithRpcPromise(_0x76aa('0x51'),_0x2fef92[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x16cc85,null))[_0x76aa('0xd')](handleError(_0x16cc85,null));};exports[_0x76aa('0x52')]=function(_0x5eceba,_0x267fcf){return respondWithRpcPromise(_0x76aa('0x51'),_0x5eceba[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x5eceba[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0x267fcf,null))[_0x76aa('0xd')](handleError(_0x267fcf,null));};exports[_0x76aa('0x53')]=function(_0x5546b6,_0x364d05){return respondWithRpcPromise('SmsQueues',_0x5546b6[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x364d05,null))[_0x76aa('0xd')](handleError(_0x364d05,null));};exports[_0x76aa('0x54')]=function(_0x3a82fe,_0x234dc4){return respondWithRpcPromise(_0x76aa('0x55'),_0x3a82fe['query'],routingClient)[_0x76aa('0x18')](findById(_0x3a82fe[_0x76aa('0x1b')]['id']))['then'](respondWithResult(_0x234dc4,null))['catch'](handleError(_0x234dc4,null));};exports[_0x76aa('0x56')]=function(_0x13389d,_0x5295a7){return respondWithRpcPromise(_0x76aa('0x57'),_0x13389d[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x5295a7,null))['catch'](handleError(_0x5295a7,null));};exports[_0x76aa('0x58')]=function(_0x47f733,_0xf31e1f){return respondWithRpcPromise(_0x76aa('0x57'),_0x47f733[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x47f733['params']['id']))['then'](respondWithResult(_0xf31e1f,null))[_0x76aa('0xd')](handleError(_0xf31e1f,null));};exports['faxQueues']=function(_0x2a8fd3,_0x28feb2){return respondWithRpcPromise(_0x76aa('0x59'),_0x2a8fd3[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x28feb2,null))[_0x76aa('0xd')](handleError(_0x28feb2,null));};exports[_0x76aa('0x5a')]=function(_0x223c92,_0xa19c1c){return respondWithRpcPromise('FaxQueues',_0x223c92[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](findById(_0x223c92[_0x76aa('0x1b')]['id']))[_0x76aa('0x18')](respondWithResult(_0xa19c1c,null))['catch'](handleError(_0xa19c1c,null));};exports['faxAccounts']=function(_0x557c11,_0x1a01ac){return respondWithRpcPromise('FaxAccounts',_0x557c11[_0x76aa('0x17')])[_0x76aa('0x18')](respondWithResult(_0x1a01ac,null))[_0x76aa('0xd')](handleError(_0x1a01ac,null));};exports[_0x76aa('0x5b')]=function(_0x5754fa,_0x7eb34e){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x5754fa[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x7eb34e,null))[_0x76aa('0xd')](handleError(_0x7eb34e,null));};exports[_0x76aa('0x5c')]=function(_0x1037fb,_0x496e66){return respondWithRpcPromise(_0x76aa('0x5d'),_0x1037fb[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x496e66,null))[_0x76aa('0xd')](handleError(_0x496e66,null));};exports[_0x76aa('0x5e')]=function(_0x22432d,_0x1d9c6e){return respondWithRpcPromise(_0x76aa('0x5f'),_0x22432d['query'],routingClient)[_0x76aa('0x18')](respondWithResult(_0x1d9c6e,null))[_0x76aa('0xd')](handleError(_0x1d9c6e,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x3c1b98,_0x215463){return respondWithRpcPromise(_0x76aa('0x5f'),_0x3c1b98[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](function(_0x51b101){if(_0x3c1b98[_0x76aa('0x17')]['type']!==undefined){var _0xdb821b=_(_0x51b101['rows'])['filter']([_0x3c1b98[_0x76aa('0x17')][_0x76aa('0x60')],_0x3c1b98['params']['id']])['map'](_0x76aa('0x61'))[_0x76aa('0x62')]()[_0x76aa('0x63')]();return _0x51b101['rows']['filter'](function(_0x17efc6){return _0xdb821b[_0x76aa('0x64')](_0x17efc6[_0x76aa('0x61')])>-0x1;});}else{return _0x51b101['rows'][_0x76aa('0x65')](function(_0x4c773a){return _0x4c773a[_0x76aa('0x61')]===parseInt(_0x3c1b98[_0x76aa('0x1b')]['id']);});}})[_0x76aa('0x18')](respondWithResult(_0x215463,null))[_0x76aa('0xd')](handleError(_0x215463,null));};exports[_0x76aa('0x66')]=function(_0x486d86,_0x5a79ba){return respondWithRpcPromise(_0x76aa('0x67'),_0x486d86[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0x5a79ba,null))['catch'](handleError(_0x5a79ba,null));};exports[_0x76aa('0x68')]=function(_0x3b6e44,_0x2ce07f){return respondWithRpcPromise(_0x76aa('0x69'),_0x3b6e44[_0x76aa('0x17')],routingClient)['then'](respondWithResult(_0x2ce07f,null))[_0x76aa('0xd')](handleError(_0x2ce07f,null));};exports['faxQueuesWaitingInteractions']=function(_0x213f7f,_0xca8769){return respondWithRpcPromise(_0x76aa('0x6a'),_0x213f7f[_0x76aa('0x17')],routingClient)[_0x76aa('0x18')](respondWithResult(_0xca8769,null))[_0x76aa('0xd')](handleError(_0xca8769,null));};exports['queueNotify']=function(_0x555682){return function(_0x547411,_0x47dd29){var _0x490fa4,_0x2203c3;var _0x22f44f=_['capitalize'](_0x555682);var _0x5c2c91=_0x555682==='chat'?_0x76aa('0x6b'):_0x76aa('0x6c');return db[_0x22f44f+_0x76aa('0x6d')]['findOne']({'raw':!![],'where':{'id':_0x547411['params']['id']}})[_0x76aa('0x18')](function(_0x45edd0){if(_[_0x76aa('0x13')](_0x45edd0)){throw new Error(_0x22f44f+_0x76aa('0x6e'));}_0x490fa4=_0x45edd0;return db[_0x22f44f+_0x76aa('0x6f')]['findOne']({'where':{'id':_0x547411['body'][_0x76aa('0x70')]},'include':[{'model':db[_0x22f44f+'Interaction'],'as':'Interaction'},{'model':db[_0x22f44f+_0x5c2c91],'as':'Account'}]});})[_0x76aa('0x18')](function(_0xbb1ccd){if(_['isNil'](_0xbb1ccd)){throw new Error(_0x22f44f+_0x76aa('0x71'));}_0x2203c3=_0xbb1ccd;return _0xbb1ccd[_0x76aa('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x22063f={'uniqueid':_0x555682+'.'+_0x2203c3['id']+'.'+_0x2203c3[_0x76aa('0x73')]['id'],'FromUserId':_0x547411[_0x76aa('0x38')]['id'],'type':_0x76aa('0x74')};_0x22063f[_0x22f44f+_0x76aa('0x75')]=_0x2203c3['id'];_0x22063f[_0x22f44f+_0x76aa('0x76')]=_0x2203c3[_0x76aa('0x73')]['id'];_0x22063f[_0x76aa('0x77')+_0x22f44f+_0x5c2c91+'Id']=_0x2203c3[_0x76aa('0x6c')]['id'];_0x22063f['To'+_0x22f44f+'QueueId']=_0x490fa4['id'];return db[_0x22f44f+_0x76aa('0x78')][_0x76aa('0x79')](_0x22063f);})['then'](function(){return respondWithRpcPromise(_0x76aa('0x7a'),{'channel':_0x555682,'interaction':_0x2203c3[_0x76aa('0x73')],'message':_0x2203c3,'account':_0x2203c3[_0x76aa('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x490fa4[_0x76aa('0x11')]+','+(_0x2203c3[_0x76aa('0x6c')]['queueTransferTimeout']||0x12c),'interval':_0x76aa('0x7b')}]},routingClient);})[_0x76aa('0x18')](respondWithResult(_0x47dd29,null))[_0x76aa('0xd')](handleError(_0x47dd29,null));};};exports['agentNotify']=function(_0xae152a,_0x202acb){var _0x50a51f,_0x5aabe5;if(_['isNil'](_0xae152a[_0x76aa('0x24')][_0x76aa('0x7c')])){throw new Error(_0x76aa('0x7d'));}var _0x16643e=_0xae152a['body']['channel'];var _0x4a449c=_[_0x76aa('0x7e')](_0x16643e);var _0x59876c=_0x16643e===_0x76aa('0x7f')?_0x76aa('0x6b'):'Account';return db[_0x76aa('0x80')][_0x76aa('0x81')]({'raw':!![],'where':{'id':_0xae152a['params']['id'],'role':_0x76aa('0x41')}})[_0x76aa('0x18')](function(_0x41200c){if(_[_0x76aa('0x13')](_0x41200c)){throw new Error(_0x76aa('0x82'));}_0x50a51f=_0x41200c;return db[_0x4a449c+_0x76aa('0x6f')]['findOne']({'where':{'id':_0xae152a[_0x76aa('0x24')]['messageId']},'include':[{'model':db[_0x4a449c+'Interaction'],'as':'Interaction'},{'model':db[_0x4a449c+_0x59876c],'as':'Account'}]});})['then'](function(_0xb65e0b){if(_[_0x76aa('0x13')](_0xb65e0b)){throw new Error(_0x4a449c+_0x76aa('0x71'));}_0x5aabe5=_0xb65e0b;return _0xb65e0b[_0x76aa('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x447103={'uniqueid':_0x16643e+'.'+_0x5aabe5['id']+'.'+_0x5aabe5[_0x76aa('0x73')]['id'],'FromUserId':_0xae152a[_0x76aa('0x38')]['id'],'type':_0x76aa('0x74'),'ToUserId':_0x50a51f['id']};_0x447103[_0x4a449c+_0x76aa('0x75')]=_0x5aabe5['id'];_0x447103[_0x4a449c+'InteractionId']=_0x5aabe5[_0x76aa('0x73')]['id'];_0x447103[_0x76aa('0x77')+_0x4a449c+_0x59876c+'Id']=_0x5aabe5[_0x76aa('0x6c')]['id'];return db[_0x4a449c+_0x76aa('0x78')][_0x76aa('0x79')](_0x447103);})[_0x76aa('0x18')](function(){return respondWithRpcPromise(_0x76aa('0x7a'),{'channel':_0x16643e,'interaction':_0x5aabe5['Interaction'],'message':_0x5aabe5,'account':_0x5aabe5[_0x76aa('0x6c')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76aa('0x41'),'appdata':_0x50a51f['name']+','+(_0x5aabe5['Account'][_0x76aa('0x83')]||0x12c),'interval':_0x76aa('0x7b')}]},routingClient);})['then'](respondWithResult(_0x202acb,null))[_0x76aa('0xd')](handleError(_0x202acb,null));}; \ No newline at end of file +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 diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index b667b3e..c64dafe 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 _0x415b=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/run','run','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x249ab3,_0x5e3e7f){var _0x16d665=function(_0x4d98c8){while(--_0x4d98c8){_0x249ab3['push'](_0x249ab3['shift']());}};_0x16d665(++_0x5e3e7f);}(_0x415b,0x1c7));var _0xb415=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x415b[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xb415('0x0'));var util=require(_0xb415('0x1'));var path=require(_0xb415('0x2'));var timeout=require(_0xb415('0x3'));var express=require(_0xb415('0x4'));var router=express[_0xb415('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb415('0x6'));var interaction=require(_0xb415('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0xb415('0x8')]('/',auth[_0xb415('0x9')](),controller[_0xb415('0xa')]);router[_0xb415('0x8')](_0xb415('0xb'),auth[_0xb415('0x9')](),controller['show']);router[_0xb415('0x8')](_0xb415('0xc'),auth[_0xb415('0x9')](),controller[_0xb415('0xd')]);router['post']('/',auth[_0xb415('0x9')](),controller[_0xb415('0xe')]);router[_0xb415('0xf')](_0xb415('0xb'),auth[_0xb415('0x9')](),controller[_0xb415('0x10')]);router[_0xb415('0x11')]('/:id',auth[_0xb415('0x9')](),controller[_0xb415('0x12')]);module[_0xb415('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index b036ca9..acfc514 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 _0xc5a6=['days','csv','pdf','xlsx','custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','weeks','hours'];(function(_0x282530,_0x5a31b2){var _0x266c57=function(_0x4a0df2){while(--_0x4a0df2){_0x282530['push'](_0x282530['shift']());}};_0x266c57(++_0x5a31b2);}(_0xc5a6,0x102));var _0x6c5a=function(_0x4f4c65,_0x518801){_0x4f4c65=_0x4f4c65-0x0;var _0x1540c9=_0xc5a6[_0x4f4c65];return _0x1540c9;};'use strict';var Sequelize=require(_0x6c5a('0x0'));module[_0x6c5a('0x1')]={'name':{'type':Sequelize[_0x6c5a('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6c5a('0x2')]},'active':{'type':Sequelize[_0x6c5a('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x6c5a('0x2')],'allowNull':![],'defaultValue':_0x6c5a('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x6c5a('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x6c5a('0x6')](_0x6c5a('0x7'),_0x6c5a('0x8'),_0x6c5a('0x9'),_0x6c5a('0xa'),'days',_0x6c5a('0xb'),'minutes'),'allowNull':![],'defaultValue':_0x6c5a('0xc')},'output':{'type':Sequelize[_0x6c5a('0x6')](_0x6c5a('0xd'),_0x6c5a('0xe'),_0x6c5a('0xf')),'allowNull':![],'defaultValue':_0x6c5a('0xd')},'type':{'type':Sequelize['ENUM'](_0x6c5a('0x10'),'default'),'allowNull':![],'defaultValue':_0x6c5a('0x10')},'sendMail':{'type':Sequelize[_0x6c5a('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6c5a('0x2')]},'cc':{'type':Sequelize[_0x6c5a('0x11')]},'bcc':{'type':Sequelize[_0x6c5a('0x11')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +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 diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e0c9bd7..10941ad 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 _0x17d5=['filter','where','type','options','includeAll','rows','catch','show','params','include','merge','find','create','body','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','../../config/schedule','run','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','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','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','destroy','then','Scheduler','UserProfileResource','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filters'];(function(_0x447232,_0x143c48){var _0xfe0559=function(_0x9c87aa){while(--_0x9c87aa){_0x447232['push'](_0x447232['shift']());}};_0xfe0559(++_0x143c48);}(_0x17d5,0x118));var _0x517d=function(_0x316a4e,_0x2fc5a8){_0x316a4e=_0x316a4e-0x0;var _0x572f3c=_0x17d5[_0x316a4e];return _0x572f3c;};'use strict';var emlformat=require(_0x517d('0x0'));var rimraf=require(_0x517d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x517d('0x2'));var rp=require(_0x517d('0x3'));var moment=require('moment');var BPromise=require(_0x517d('0x4'));var Mustache=require(_0x517d('0x5'));var util=require(_0x517d('0x6'));var path=require(_0x517d('0x7'));var sox=require('sox');var csv=require(_0x517d('0x8'));var ejs=require(_0x517d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x517d('0xa'));var crypto=require(_0x517d('0xb'));var jsforce=require(_0x517d('0xc'));var deskjs=require(_0x517d('0xd'));var toCsv=require(_0x517d('0x8'));var querystring=require('querystring');var Papa=require(_0x517d('0xe'));var Redis=require(_0x517d('0xf'));var authService=require(_0x517d('0x10'));var qs=require(_0x517d('0x11'));var as=require(_0x517d('0x12'));var hardwareService=require(_0x517d('0x13'));var logger=require(_0x517d('0x14'))(_0x517d('0x15'));var utils=require(_0x517d('0x16'));var config=require(_0x517d('0x17'));var licenseUtil=require(_0x517d('0x18'));var db=require(_0x517d('0x19'))['db'];function respondWithStatusCode(_0x4bae65,_0x384206){_0x384206=_0x384206||0xcc;return function(_0x3fd0af){if(_0x3fd0af){return _0x4bae65[_0x517d('0x1a')](_0x384206);}return _0x4bae65[_0x517d('0x1b')](_0x384206)[_0x517d('0x1c')]();};}function respondWithResult(_0x805379,_0x1bc6d9){_0x1bc6d9=_0x1bc6d9||0xc8;return function(_0x162114){if(_0x162114){return _0x805379[_0x517d('0x1b')](_0x1bc6d9)[_0x517d('0x1d')](_0x162114);}};}function respondWithFilteredResult(_0x80dabe,_0x55081d){return function(_0x4dfea9){if(_0x4dfea9){var _0x3b2204=typeof _0x55081d['offset']===_0x517d('0x1e')&&typeof _0x55081d[_0x517d('0x1f')]===_0x517d('0x1e');var _0x166589=_0x4dfea9[_0x517d('0x20')];var _0x35caee=_0x3b2204?0x0:_0x55081d[_0x517d('0x21')];var _0x262194=_0x3b2204?_0x4dfea9[_0x517d('0x20')]:_0x55081d[_0x517d('0x21')]+_0x55081d[_0x517d('0x1f')];var _0x9a1e32;if(_0x262194>=_0x166589){_0x262194=_0x166589;_0x9a1e32=0xc8;}else{_0x9a1e32=0xce;}_0x80dabe['status'](_0x9a1e32);return _0x80dabe['set']('Content-Range',_0x35caee+'-'+_0x262194+'/'+_0x166589)[_0x517d('0x1d')](_0x4dfea9);}return null;};}function patchUpdates(_0x534ced){return function(_0x41bda0){try{jsonpatch[_0x517d('0x22')](_0x41bda0,_0x534ced,!![]);}catch(_0x529752){return BPromise[_0x517d('0x23')](_0x529752);}return _0x41bda0[_0x517d('0x24')]();};}function saveUpdates(_0x2234b7,_0x225bab){return function(_0x31a5ef){if(_0x31a5ef){return _0x31a5ef['update'](_0x2234b7)['then'](function(_0x102b82){return _0x102b82;});}return null;};}function removeEntity(_0x496b44,_0x52ca51){return function(_0x4a5b0d){if(_0x4a5b0d){return _0x4a5b0d[_0x517d('0x25')]()[_0x517d('0x26')](function(){var _0x26d5a2=_0x4a5b0d['get']({'plain':!![]});var _0xc371a7=_0x517d('0x27');return db[_0x517d('0x28')][_0x517d('0x25')]({'where':{'type':_0xc371a7,'resourceId':_0x26d5a2['id']}})[_0x517d('0x26')](function(){return _0x4a5b0d;});})[_0x517d('0x26')](function(){_0x496b44[_0x517d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ed9fa,_0x25fdc0){return function(_0x1afd9a){if(!_0x1afd9a){_0x4ed9fa['sendStatus'](0x194);}return _0x1afd9a;};}function handleError(_0x3a667e,_0x1acebb){_0x1acebb=_0x1acebb||0x1f4;return function(_0x12b6b8){logger[_0x517d('0x29')](_0x12b6b8[_0x517d('0x2a')]);if(_0x12b6b8[_0x517d('0x2b')]){delete _0x12b6b8[_0x517d('0x2b')];}_0x3a667e[_0x517d('0x1b')](_0x1acebb)[_0x517d('0x2c')](_0x12b6b8);};}exports[_0x517d('0x2d')]=function(_0x43e986,_0x5f1db1){var _0x2f7f28={},_0x4046a6={},_0x3a43d4={'count':0x0,'rows':[]};var _0xc11196=_[_0x517d('0x2e')](db[_0x517d('0x2f')][_0x517d('0x30')],function(_0x1ff6a2){return{'name':_0x1ff6a2[_0x517d('0x31')],'type':_0x1ff6a2['type'][_0x517d('0x32')]};});_0x4046a6[_0x517d('0x33')]=_[_0x517d('0x2e')](_0xc11196,'name');_0x4046a6[_0x517d('0x34')]=_[_0x517d('0x35')](_0x43e986[_0x517d('0x34')]);_0x4046a6['filters']=_[_0x517d('0x36')](_0x4046a6[_0x517d('0x33')],_0x4046a6[_0x517d('0x34')]);_0x2f7f28['attributes']=_[_0x517d('0x36')](_0x4046a6[_0x517d('0x33')],qs[_0x517d('0x37')](_0x43e986[_0x517d('0x34')][_0x517d('0x37')]));_0x2f7f28[_0x517d('0x38')]=_0x2f7f28[_0x517d('0x38')][_0x517d('0x39')]?_0x2f7f28[_0x517d('0x38')]:_0x4046a6[_0x517d('0x33')];if(!_0x43e986[_0x517d('0x34')][_0x517d('0x3a')](_0x517d('0x3b'))){_0x2f7f28[_0x517d('0x1f')]=qs['limit'](_0x43e986[_0x517d('0x34')]['limit']);_0x2f7f28[_0x517d('0x21')]=qs[_0x517d('0x21')](_0x43e986['query'][_0x517d('0x21')]);}_0x2f7f28[_0x517d('0x3c')]=qs[_0x517d('0x3d')](_0x43e986[_0x517d('0x34')]['sort']);_0x2f7f28['where']=qs['filters'](_[_0x517d('0x3e')](_0x43e986[_0x517d('0x34')],_0x4046a6[_0x517d('0x3f')]),_0xc11196);if(_0x43e986[_0x517d('0x34')][_0x517d('0x40')]){_0x2f7f28[_0x517d('0x41')]=_['merge'](_0x2f7f28[_0x517d('0x41')],{'$or':_[_0x517d('0x2e')](_0xc11196,function(_0x29e77a){if(_0x29e77a[_0x517d('0x42')]!=='VIRTUAL'){var _0x39f656={};_0x39f656[_0x29e77a[_0x517d('0x2b')]]={'$like':'%'+_0x43e986[_0x517d('0x34')]['filter']+'%'};return _0x39f656;}})});}_0x2f7f28=_['merge']({},_0x2f7f28,_0x43e986[_0x517d('0x43')]);var _0x5af224={'where':_0x2f7f28[_0x517d('0x41')]};return db[_0x517d('0x2f')][_0x517d('0x20')](_0x5af224)[_0x517d('0x26')](function(_0x352b0e){_0x3a43d4['count']=_0x352b0e;if(_0x43e986[_0x517d('0x34')][_0x517d('0x44')]){_0x2f7f28['include']=[{'all':!![]}];}return db[_0x517d('0x2f')]['findAll'](_0x2f7f28);})[_0x517d('0x26')](function(_0x3bef79){_0x3a43d4[_0x517d('0x45')]=_0x3bef79;return _0x3a43d4;})['then'](respondWithFilteredResult(_0x5f1db1,_0x2f7f28))[_0x517d('0x46')](handleError(_0x5f1db1,null));};exports[_0x517d('0x47')]=function(_0x4913df,_0x56650c){var _0x767adf={'raw':![],'where':{'id':_0x4913df[_0x517d('0x48')]['id']}},_0x201fcc={};_0x201fcc[_0x517d('0x33')]=_[_0x517d('0x35')](db[_0x517d('0x2f')][_0x517d('0x30')]);_0x201fcc[_0x517d('0x34')]=_[_0x517d('0x35')](_0x4913df[_0x517d('0x34')]);_0x201fcc[_0x517d('0x3f')]=_['intersection'](_0x201fcc[_0x517d('0x33')],_0x201fcc[_0x517d('0x34')]);_0x767adf[_0x517d('0x38')]=_[_0x517d('0x36')](_0x201fcc['model'],qs['fields'](_0x4913df[_0x517d('0x34')][_0x517d('0x37')]));_0x767adf[_0x517d('0x38')]=_0x767adf['attributes']['length']?_0x767adf[_0x517d('0x38')]:_0x201fcc[_0x517d('0x33')];if(_0x4913df[_0x517d('0x34')][_0x517d('0x44')]){_0x767adf[_0x517d('0x49')]=[{'all':!![]}];}_0x767adf=_[_0x517d('0x4a')]({},_0x767adf,_0x4913df['options']);return db[_0x517d('0x2f')][_0x517d('0x4b')](_0x767adf)[_0x517d('0x26')](handleEntityNotFound(_0x56650c,null))['then'](respondWithResult(_0x56650c,null))[_0x517d('0x46')](handleError(_0x56650c,null));};exports[_0x517d('0x4c')]=function(_0x2230fd,_0x14403c){return db['Schedule'][_0x517d('0x4c')](_0x2230fd[_0x517d('0x4d')],{})[_0x517d('0x26')](function(_0x231425){var _0x154786=_0x2230fd['user'][_0x517d('0x4e')]({'plain':!![]});if(!_0x154786)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x154786[_0x517d('0x4f')]==='user'){var _0x3bb6d4=_0x231425[_0x517d('0x4e')]({'plain':!![]});var _0x59887b=_0x517d('0x27');return db[_0x517d('0x50')][_0x517d('0x4b')]({'where':{'name':_0x59887b,'userProfileId':_0x154786[_0x517d('0x51')]},'raw':!![]})['then'](function(_0x297d79){if(_0x297d79&&_0x297d79['autoAssociation']===0x0){return db['UserProfileResource'][_0x517d('0x4c')]({'name':_0x3bb6d4[_0x517d('0x2b')],'resourceId':_0x3bb6d4['id'],'type':_0x297d79[_0x517d('0x2b')],'sectionId':_0x297d79['id']},{})[_0x517d('0x26')](function(){return _0x231425;});}else{return _0x231425;}})[_0x517d('0x46')](function(_0x5f0ae4){logger[_0x517d('0x29')](_0x517d('0x52'),_0x5f0ae4);throw _0x5f0ae4;});}return _0x231425;})[_0x517d('0x26')](respondWithResult(_0x14403c,0xc9))[_0x517d('0x46')](handleError(_0x14403c,null));};exports[_0x517d('0x53')]=function(_0x63d86c,_0x5ee9e9){if(_0x63d86c['body']['id']){delete _0x63d86c[_0x517d('0x4d')]['id'];}return db['Schedule'][_0x517d('0x4b')]({'where':{'id':_0x63d86c[_0x517d('0x48')]['id']}})[_0x517d('0x26')](handleEntityNotFound(_0x5ee9e9,null))[_0x517d('0x26')](saveUpdates(_0x63d86c[_0x517d('0x4d')],null))[_0x517d('0x26')](respondWithResult(_0x5ee9e9,null))[_0x517d('0x46')](handleError(_0x5ee9e9,null));};exports[_0x517d('0x25')]=function(_0x2125fd,_0x5da6e3){return db[_0x517d('0x2f')]['find']({'where':{'id':_0x2125fd[_0x517d('0x48')]['id']}})['then'](handleEntityNotFound(_0x5da6e3,null))[_0x517d('0x26')](removeEntity(_0x5da6e3,null))[_0x517d('0x46')](handleError(_0x5da6e3,null));};exports['run']=function(_0x1944a7,_0x327662,_0x2b4652){var _0x4f4b8c=require(_0x517d('0x54'));return db[_0x517d('0x2f')][_0x517d('0x4b')]({'where':{'id':_0x1944a7[_0x517d('0x48')]['id']},'raw':!![]})[_0x517d('0x26')](handleEntityNotFound(_0x327662,null))[_0x517d('0x26')](function(){_0x4f4b8c[_0x517d('0x55')](_0x1944a7[_0x517d('0x48')]['id']);})['then'](respondWithStatusCode(_0x327662,null))[_0x517d('0x46')](handleError(_0x327662,null));}; \ No newline at end of file +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 diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 37a37a1..32b04ea 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 _0x7c43=['lodash','api','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules'];(function(_0x2e9fd9,_0xf5890f){var _0x1ca1b9=function(_0x169d7f){while(--_0x169d7f){_0x2e9fd9['push'](_0x2e9fd9['shift']());}};_0x1ca1b9(++_0xf5890f);}(_0x7c43,0x1d6));var _0x37c4=function(_0x2e1e39,_0x531c17){_0x2e1e39=_0x2e1e39-0x0;var _0x449526=_0x7c43[_0x2e1e39];return _0x449526;};'use strict';var _=require(_0x37c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x37c4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x37c4('0x2'));var fs=require('fs');var path=require(_0x37c4('0x3'));var rimraf=require(_0x37c4('0x4'));var config=require(_0x37c4('0x5'));var attributes=require(_0x37c4('0x6'));module[_0x37c4('0x7')]=function(_0x2bbaa1,_0x1cd34f){return _0x2bbaa1['define'](_0x37c4('0x8'),attributes,{'tableName':_0x37c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 8feb289..1c3961f 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 _0x78fb=['request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','Schedule,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client'];(function(_0x4a9ddd,_0x7e447f){var _0x2fe101=function(_0x5b748b){while(--_0x5b748b){_0x4a9ddd['push'](_0x4a9ddd['shift']());}};_0x2fe101(++_0x7e447f);}(_0x78fb,0x1c4));var _0xb78f=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x78fb[_0x432682];return _0x463d05;};'use strict';var _=require(_0xb78f('0x0'));var util=require(_0xb78f('0x1'));var moment=require(_0xb78f('0x2'));var BPromise=require(_0xb78f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb78f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb78f('0x5'))(_0xb78f('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb78f('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54b851,_0x57de52,_0x3d3abb){return new BPromise(function(_0x37b5e8,_0x36b4c8){return client[_0xb78f('0x8')](_0x54b851,_0x3d3abb)[_0xb78f('0x9')](function(_0x7fa8a3){logger[_0xb78f('0xa')]('Schedule,\x20%s,\x20%s',_0x57de52,_0xb78f('0xb'));logger[_0xb78f('0xc')](_0xb78f('0xd'),_0x57de52,'request\x20sent',JSON[_0xb78f('0xe')](_0x7fa8a3));if(_0x7fa8a3['error']){if(_0x7fa8a3['error']['code']===0x1f4){logger['error'](_0xb78f('0xf'),_0x57de52,_0x7fa8a3[_0xb78f('0x10')][_0xb78f('0x11')]);return _0x36b4c8(_0x7fa8a3['error']['message']);}logger[_0xb78f('0x10')](_0xb78f('0xf'),_0x57de52,_0x7fa8a3[_0xb78f('0x10')][_0xb78f('0x11')]);return _0x37b5e8(_0x7fa8a3[_0xb78f('0x10')][_0xb78f('0x11')]);}else{logger[_0xb78f('0xa')]('Schedule,\x20%s,\x20%s',_0x57de52,_0xb78f('0xb'));_0x37b5e8(_0x7fa8a3[_0xb78f('0x12')][_0xb78f('0x11')]);}})[_0xb78f('0x13')](function(_0x44dee7){logger['error'](_0xb78f('0xf'),_0x57de52,_0x44dee7);_0x36b4c8(_0x44dee7);});});} \ No newline at end of file +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 diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 5a82957..f484ada 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 _0x9b8c=['/:id','/:id/download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./screenRecording.controller','get','isAuthenticated','/describe'];(function(_0x425f5e,_0x25f351){var _0x4f53d3=function(_0x2275c8){while(--_0x2275c8){_0x425f5e['push'](_0x425f5e['shift']());}};_0x4f53d3(++_0x25f351);}(_0x9b8c,0x1ed));var _0xc9b8=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0x9b8c[_0x383158];return _0x507985;};'use strict';var multer=require(_0xc9b8('0x0'));var util=require(_0xc9b8('0x1'));var path=require(_0xc9b8('0x2'));var timeout=require(_0xc9b8('0x3'));var express=require(_0xc9b8('0x4'));var router=express[_0xc9b8('0x5')]();var fs_extra=require(_0xc9b8('0x6'));var auth=require(_0xc9b8('0x7'));var interaction=require(_0xc9b8('0x8'));var config=require('../../config/environment');var controller=require(_0xc9b8('0x9'));router[_0xc9b8('0xa')]('/',auth[_0xc9b8('0xb')](),controller['index']);router[_0xc9b8('0xa')](_0xc9b8('0xc'),auth[_0xc9b8('0xb')](),controller['describe']);router[_0xc9b8('0xa')](_0xc9b8('0xd'),auth[_0xc9b8('0xb')](),controller['show']);router[_0xc9b8('0xa')](_0xc9b8('0xe'),auth[_0xc9b8('0xb')](),controller['download']);router[_0xc9b8('0xf')]('/',auth['isAuthenticated'](),controller[_0xc9b8('0x10')]);router[_0xc9b8('0x11')](_0xc9b8('0xd'),auth[_0xc9b8('0xb')](),controller[_0xc9b8('0x12')]);router[_0xc9b8('0x13')](_0xc9b8('0xd'),auth[_0xc9b8('0xb')](),controller[_0xc9b8('0x14')]);module[_0xc9b8('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 985615d..1c14f11 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 _0x8ba6=['value','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','toString','format','MM-DD-YYYY\x20HH:mm','DATE','sequelize','path','exports','VIRTUAL','getDataValue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x8ba6,0x11b));var _0x68ba=function(_0x1b31dc,_0x38dcb7){_0x1b31dc=_0x1b31dc-0x0;var _0x2c481=_0x8ba6[_0x1b31dc];return _0x2c481;};'use strict';var Sequelize=require(_0x68ba('0x0'));var moment=require('moment');var path=require(_0x68ba('0x1'));var config=require('../../config/environment');module[_0x68ba('0x2')]={'format':{'type':Sequelize[_0x68ba('0x3')],'get':function(){return this[_0x68ba('0x4')](_0x68ba('0x5'))?path['extname'](this['getDataValue'](_0x68ba('0x5'))):undefined;}},'interactionid':{'type':Sequelize[_0x68ba('0x6')]},'channel':{'type':Sequelize[_0x68ba('0x6')]},'value':{'type':Sequelize[_0x68ba('0x6')],'set':function(_0x2ad848){var _0x1ba7fa=_0x2ad848[_0x68ba('0x7')](/\\/g,'/');this[_0x68ba('0x8')]('value',_0x1ba7fa);}},'rating':{'type':Sequelize[_0x68ba('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x68ba('0x9')],'set':function(_0x1ec922){this[_0x68ba('0x8')](_0x68ba('0xa'),moment()[_0x68ba('0xb')](_0x1ec922,'ms'));this[_0x68ba('0x8')](_0x68ba('0xc'),moment());this[_0x68ba('0x8')](_0x68ba('0xd'),_0x1ec922);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x68ba('0x4')](_0x68ba('0xa')))['format']('MM-DD-YYYY\x20HH:mm')[_0x68ba('0xe')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x68ba('0x4')](_0x68ba('0xc')))[_0x68ba('0xf')](_0x68ba('0x10'))[_0x68ba('0xe')]();}},'createdAt':{'type':Sequelize[_0x68ba('0x11')],'get':function(){return moment(this[_0x68ba('0x4')]('createdAt'))[_0x68ba('0xf')](_0x68ba('0x10'))[_0x68ba('0xe')]();}},'updatedAt':{'type':Sequelize[_0x68ba('0x11')],'get':function(){return moment(this[_0x68ba('0x4')]('updatedAt'))[_0x68ba('0xf')](_0x68ba('0x10'))['toString']();}}}; \ No newline at end of file +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 diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 6542f5d..249b989 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 _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x3fe913,_0x6c6469){var _0x502051=function(_0x15eb5e){while(--_0x15eb5e){_0x3fe913['push'](_0x3fe913['shift']());}};_0x502051(++_0x6c6469);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));}; \ No newline at end of file +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 diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index e9134fa..77ca80c 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 _0x969f=['ScreenRecording','screen_recordings','interactionid','util','moment','request-promise','path','../../config/environment','./screenRecording.attributes','exports','define'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x969f,0x9d));var _0xf969=function(_0x42fb06,_0xc8e815){_0x42fb06=_0x42fb06-0x0;var _0x5580ad=_0x969f[_0x42fb06];return _0x5580ad;};'use strict';var _=require('lodash');var util=require(_0xf969('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf969('0x1'));var BPromise=require('bluebird');var rp=require(_0xf969('0x2'));var fs=require('fs');var path=require(_0xf969('0x3'));var rimraf=require('rimraf');var config=require(_0xf969('0x4'));var attributes=require(_0xf969('0x5'));module[_0xf969('0x6')]=function(_0x27e54a,_0x1fcf56){return _0x27e54a[_0xf969('0x7')](_0xf969('0x8'),attributes,{'tableName':_0xf969('0x9'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0xf969('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index a753611..d41b269 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 _0xde26=['error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x467bb0,_0x1ee3f4){var _0x2dea67=function(_0x3dd435){while(--_0x3dd435){_0x467bb0['push'](_0x467bb0['shift']());}};_0x2dea67(++_0x1ee3f4);}(_0xde26,0x1b2));var _0x6de2=function(_0x571c00,_0x3ae028){_0x571c00=_0x571c00-0x0;var _0x2887df=_0xde26[_0x571c00];return _0x2887df;};'use strict';var _=require(_0x6de2('0x0'));var util=require(_0x6de2('0x1'));var moment=require(_0x6de2('0x2'));var BPromise=require(_0x6de2('0x3'));var rs=require(_0x6de2('0x4'));var fs=require('fs');var Redis=require(_0x6de2('0x5'));var db=require(_0x6de2('0x6'))['db'];var utils=require(_0x6de2('0x7'));var logger=require(_0x6de2('0x8'))(_0x6de2('0x9'));var config=require(_0x6de2('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x6de2('0xb')][_0x6de2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3606c0,_0x10bebb,_0x4d2483){return new BPromise(function(_0x409afd,_0x533440){return client[_0x6de2('0xd')](_0x3606c0,_0x4d2483)[_0x6de2('0xe')](function(_0x42a5e4){logger[_0x6de2('0xf')](_0x6de2('0x10'),_0x10bebb,_0x6de2('0x11'));logger[_0x6de2('0x12')](_0x6de2('0x13'),_0x10bebb,_0x6de2('0x11'),JSON[_0x6de2('0x14')](_0x42a5e4));if(_0x42a5e4['error']){if(_0x42a5e4['error'][_0x6de2('0x15')]===0x1f4){logger[_0x6de2('0x16')]('ScreenRecording,\x20%s,\x20%s',_0x10bebb,_0x42a5e4['error'][_0x6de2('0x17')]);return _0x533440(_0x42a5e4[_0x6de2('0x16')][_0x6de2('0x17')]);}logger[_0x6de2('0x16')](_0x6de2('0x10'),_0x10bebb,_0x42a5e4[_0x6de2('0x16')][_0x6de2('0x17')]);return _0x409afd(_0x42a5e4[_0x6de2('0x16')][_0x6de2('0x17')]);}else{logger['info'](_0x6de2('0x10'),_0x10bebb,_0x6de2('0x11'));_0x409afd(_0x42a5e4['result'][_0x6de2('0x17')]);}})['catch'](function(_0x1a8c7e){logger[_0x6de2('0x16')](_0x6de2('0x10'),_0x10bebb,_0x1a8c7e);_0x533440(_0x1a8c7e);});});} \ No newline at end of file +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 diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 109e558..47265ad 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 _0x970e=['isAuthenticated','index','/now','getDate','show','getLogo','/:id/logo_login','getLogoLogin','gdpr','getPreferred','/:id/favicon','%s%s','extname','originalname','post','/:id/logo','single','addLogo','diskStorage','join','server/files/images/logos/','format','logologin','file','addLogoLogin','preferred','/:id/preferred','favicon','addFavicon','put','/:id','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x381d3c,_0x4bc7d0){var _0x12542e=function(_0xc3e0c7){while(--_0xc3e0c7){_0x381d3c['push'](_0x381d3c['shift']());}};_0x12542e(++_0x4bc7d0);}(_0x970e,0x14d));var _0xe970=function(_0xf4573c,_0x1d0366){_0xf4573c=_0xf4573c-0x0;var _0x10f118=_0x970e[_0xf4573c];return _0x10f118;};'use strict';var multer=require(_0xe970('0x0'));var util=require(_0xe970('0x1'));var path=require(_0xe970('0x2'));var timeout=require(_0xe970('0x3'));var express=require(_0xe970('0x4'));var router=express[_0xe970('0x5')]();var fs_extra=require(_0xe970('0x6'));var auth=require(_0xe970('0x7'));var interaction=require(_0xe970('0x8'));var config=require(_0xe970('0x9'));var controller=require('./setting.controller');router[_0xe970('0xa')]('/',auth[_0xe970('0xb')](),controller[_0xe970('0xc')]);router['get'](_0xe970('0xd'),controller[_0xe970('0xe')]);router[_0xe970('0xa')]('/:id',controller[_0xe970('0xf')]);router['get']('/:id/logo',controller[_0xe970('0x10')]);router[_0xe970('0xa')](_0xe970('0x11'),controller[_0xe970('0x12')]);router[_0xe970('0xa')]('/:id/gdpr',controller[_0xe970('0x13')]);router[_0xe970('0xa')]('/:id/preferred',controller[_0xe970('0x14')]);router['get'](_0xe970('0x15'),controller['getFavicon']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x133bd9,_0x1a3392,_0x137f9a){_0x137f9a(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x4086ef,_0x122d8c,_0x50cd64){_0x50cd64(null,util['format'](_0xe970('0x16'),'logo',path[_0xe970('0x17')](_0x122d8c[_0xe970('0x18')])));}})});router[_0xe970('0x19')](_0xe970('0x1a'),upload[_0xe970('0x1b')]('file'),controller[_0xe970('0x1c')]);var upload=multer({'storage':multer[_0xe970('0x1d')]({'destination':function(_0x14902f,_0x52c0c0,_0x1ab01d){_0x1ab01d(null,path[_0xe970('0x1e')](config['root'],_0xe970('0x1f')));},'filename':function(_0xa95741,_0x5054bc,_0x3be800){_0x3be800(null,util[_0xe970('0x20')](_0xe970('0x16'),_0xe970('0x21'),path['extname'](_0x5054bc[_0xe970('0x18')])));}})});router[_0xe970('0x19')](_0xe970('0x11'),upload['single'](_0xe970('0x22')),controller[_0xe970('0x23')]);var upload=multer({'storage':multer[_0xe970('0x1d')]({'destination':function(_0x4abd2e,_0x101bbb,_0x3ac320){_0x3ac320(null,path[_0xe970('0x1e')](config['root'],_0xe970('0x1f')));},'filename':function(_0x52ed67,_0x5b4e3e,_0x18edad){_0x18edad(null,util[_0xe970('0x20')]('%s%s',_0xe970('0x24'),path[_0xe970('0x17')](_0x5b4e3e[_0xe970('0x18')])));}})});router[_0xe970('0x19')](_0xe970('0x25'),upload['single']('file'),controller['addPreferred']);var upload=multer({'storage':multer[_0xe970('0x1d')]({'destination':function(_0x6b37f5,_0xd1e428,_0x2f742a){_0x2f742a(null,path[_0xe970('0x1e')](config['root'],'server/files/images/logos/'));},'filename':function(_0x14150e,_0x2aba80,_0x21c4e6){_0x21c4e6(null,util[_0xe970('0x20')]('%s%s',_0xe970('0x26'),path[_0xe970('0x17')](_0x2aba80['originalname'])));}})});router['post'](_0xe970('0x15'),upload['single'](_0xe970('0x22')),controller[_0xe970('0x27')]);router[_0xe970('0x28')](_0xe970('0x29'),auth[_0xe970('0xb')](),controller['update']);module[_0xe970('0x2a')]=router; \ No newline at end of file +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 diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index f957264..28b572c 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 _0xceef=['sequelize','exports','INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xceef,0x13f));var _0xfcee=function(_0x592ca0,_0x30d956){_0x592ca0=_0x592ca0-0x0;var _0x2c2e71=_0xceef[_0x592ca0];return _0x2c2e71;};'use strict';var Sequelize=require(_0xfcee('0x0'));module[_0xfcee('0x1')]={'min_internal':{'type':Sequelize[_0xfcee('0x2')](0xb),'unique':_0xfcee('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xfcee('0x2')](0xb),'unique':_0xfcee('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xfcee('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xfcee('0x5')],'defaultValue':_0xfcee('0x6')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xfcee('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0xfcee('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xfcee('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xfcee('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xfcee('0x5')],'defaultValue':_0xfcee('0x8')},'enableEmailPreview':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'split':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xfcee('0x5')],'defaultValue':_0xfcee('0x9')},'chatTimeout':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xfcee('0x5')]},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xfcee('0x5')]},'defaultFavicon':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xfcee('0x2')]},'transcribeRegion':{'type':Sequelize[_0xfcee('0x5')]},'sentiment':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xfcee('0x2')]},'sentimentRegion':{'type':Sequelize[_0xfcee('0x5')]},'language':{'type':Sequelize[_0xfcee('0x5')]},'bucket':{'type':Sequelize[_0xfcee('0x5')]},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xfcee('0x2')](0x2)[_0xfcee('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xfcee('0x2')](0x2)[_0xfcee('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize['INTEGER'](0x2)[_0xfcee('0xa')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0xfcee('0x2')](0x2)[_0xfcee('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xfcee('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0xfcee('0x7')],'defaultValue':!![]}}; \ No newline at end of file +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 diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 65a6e25..3aa2eef 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 _0xf013=['loginLogo','../../config/license/util','getLogo','server/files/images/logos','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','ValidationError','\x20not\x20found','download','getLogoLogin','getLicense','defaultLoginLogo','default_loginLogo.svg','default','Sequelize','gdpr','addPreferred','default_preferred.png','getFavicon','default_favicon.ico','getDate','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','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','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','then','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','stack','name','send','map','Setting','rawAttributes','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','options','includeAll','findAll','rows','keys','intersection','include','find','body','params','addLogo','file','logo','filename','addLogoLogin'];(function(_0x1b8f82,_0x383537){var _0x5a4c8d=function(_0x380a68){while(--_0x380a68){_0x1b8f82['push'](_0x1b8f82['shift']());}};_0x5a4c8d(++_0x383537);}(_0xf013,0x118));var _0x3f01=function(_0x3cd97d,_0x323a37){_0x3cd97d=_0x3cd97d-0x0;var _0x5f49b5=_0xf013[_0x3cd97d];return _0x5f49b5;};'use strict';var emlformat=require(_0x3f01('0x0'));var rimraf=require(_0x3f01('0x1'));var zipdir=require(_0x3f01('0x2'));var jsonpatch=require(_0x3f01('0x3'));var rp=require('request-promise');var moment=require(_0x3f01('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3f01('0x5'));var util=require(_0x3f01('0x6'));var path=require(_0x3f01('0x7'));var sox=require(_0x3f01('0x8'));var csv=require(_0x3f01('0x9'));var ejs=require(_0x3f01('0xa'));var fs=require('fs');var fs_extra=require(_0x3f01('0xb'));var _=require(_0x3f01('0xc'));var squel=require(_0x3f01('0xd'));var crypto=require(_0x3f01('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3f01('0xf'));var toCsv=require(_0x3f01('0x9'));var querystring=require('querystring');var Papa=require(_0x3f01('0x10'));var Redis=require(_0x3f01('0x11'));var authService=require(_0x3f01('0x12'));var qs=require(_0x3f01('0x13'));var as=require(_0x3f01('0x14'));var hardwareService=require(_0x3f01('0x15'));var logger=require(_0x3f01('0x16'))(_0x3f01('0x17'));var utils=require(_0x3f01('0x18'));var config=require(_0x3f01('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x3f01('0x1a'))['db'];var jayson=require(_0x3f01('0x1b'));var client=jayson['client'][_0x3f01('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1b191b,_0x180df9,_0x3e32ce,_0x4a0388){return new BPromise(function(_0x2ac401,_0x32effe){var _0x4092d2=_0x4a0388||client;return _0x4092d2['request'](_0x1b191b,_0x3e32ce)[_0x3f01('0x1d')](function(_0x5e7412){logger['info']('Setting,\x20%s,\x20%s',_0x180df9,_0x3f01('0x1e'));logger[_0x3f01('0x1f')](_0x3f01('0x20'),_0x180df9,'request\x20sent',JSON['stringify'](_0x5e7412));if(_0x5e7412[_0x3f01('0x21')]){if(_0x5e7412['error'][_0x3f01('0x22')]===0x1f4){logger[_0x3f01('0x21')](_0x3f01('0x23'),_0x180df9,_0x5e7412[_0x3f01('0x21')][_0x3f01('0x24')]);return _0x32effe(_0x5e7412['error'][_0x3f01('0x24')]);}logger[_0x3f01('0x21')](_0x3f01('0x23'),_0x180df9,_0x5e7412[_0x3f01('0x21')][_0x3f01('0x24')]);return _0x2ac401(_0x5e7412[_0x3f01('0x21')][_0x3f01('0x24')]);}else{logger[_0x3f01('0x25')]('Setting,\x20%s,\x20%s',_0x180df9,_0x3f01('0x1e'));_0x2ac401(_0x5e7412[_0x3f01('0x26')]['message']);}})[_0x3f01('0x27')](function(_0x5096d4){logger[_0x3f01('0x21')](_0x3f01('0x23'),_0x180df9,_0x5096d4);_0x32effe(_0x5096d4);});});}function respondWithStatusCode(_0x59e26e,_0x1266bb){_0x1266bb=_0x1266bb||0xcc;return function(_0x4c2588){if(_0x4c2588){return _0x59e26e[_0x3f01('0x28')](_0x1266bb);}return _0x59e26e[_0x3f01('0x29')](_0x1266bb)[_0x3f01('0x2a')]();};}function respondWithResult(_0x4e0e02,_0x538c27){_0x538c27=_0x538c27||0xc8;return function(_0x1d37f9){if(_0x1d37f9){return _0x4e0e02['status'](_0x538c27)[_0x3f01('0x2b')](_0x1d37f9);}};}function respondWithFilteredResult(_0x10fd81,_0x4b3b9c){return function(_0x56f4e5){if(_0x56f4e5){var _0x503115=typeof _0x4b3b9c[_0x3f01('0x2c')]===_0x3f01('0x2d')&&typeof _0x4b3b9c[_0x3f01('0x2e')]===_0x3f01('0x2d');var _0x2caba1=_0x56f4e5['count'];var _0x3a767a=_0x503115?0x0:_0x4b3b9c[_0x3f01('0x2c')];var _0x166424=_0x503115?_0x56f4e5[_0x3f01('0x2f')]:_0x4b3b9c[_0x3f01('0x2c')]+_0x4b3b9c[_0x3f01('0x2e')];var _0x5b2292;if(_0x166424>=_0x2caba1){_0x166424=_0x2caba1;_0x5b2292=0xc8;}else{_0x5b2292=0xce;}_0x10fd81['status'](_0x5b2292);return _0x10fd81['set'](_0x3f01('0x30'),_0x3a767a+'-'+_0x166424+'/'+_0x2caba1)[_0x3f01('0x2b')](_0x56f4e5);}return null;};}function patchUpdates(_0x172fef){return function(_0x336c39){try{jsonpatch['apply'](_0x336c39,_0x172fef,!![]);}catch(_0x33e938){return BPromise[_0x3f01('0x31')](_0x33e938);}return _0x336c39[_0x3f01('0x32')]();};}function saveUpdates(_0x3e93d3,_0x1c15ba){return function(_0x25826c){if(_0x25826c){return _0x25826c[_0x3f01('0x33')](_0x3e93d3)[_0x3f01('0x1d')](function(_0x897186){return _0x897186;});}return null;};}function removeEntity(_0x4035ba,_0x49f987){return function(_0x3862d7){if(_0x3862d7){return _0x3862d7[_0x3f01('0x34')]()[_0x3f01('0x1d')](function(){_0x4035ba[_0x3f01('0x29')](0xcc)[_0x3f01('0x2a')]();});}};}function handleEntityNotFound(_0x113e96,_0x4cf771){return function(_0x501ba4){if(!_0x501ba4){_0x113e96[_0x3f01('0x28')](0x194);}return _0x501ba4;};}function handleError(_0x548571,_0x58abc0){_0x58abc0=_0x58abc0||0x1f4;return function(_0x373d20){logger[_0x3f01('0x21')](_0x373d20[_0x3f01('0x35')]);if(_0x373d20[_0x3f01('0x36')]){delete _0x373d20['name'];}_0x548571[_0x3f01('0x29')](_0x58abc0)[_0x3f01('0x37')](_0x373d20);};}exports['index']=function(_0x24efa3,_0x9f3dd9){var _0x2be144={},_0x54c21c={},_0x10b51e={'count':0x0,'rows':[]};var _0x458fcf=_[_0x3f01('0x38')](db[_0x3f01('0x39')][_0x3f01('0x3a')],function(_0x553426){return{'name':_0x553426['fieldName'],'type':_0x553426[_0x3f01('0x3b')][_0x3f01('0x3c')]};});_0x54c21c[_0x3f01('0x3d')]=_[_0x3f01('0x38')](_0x458fcf,_0x3f01('0x36'));_0x54c21c[_0x3f01('0x3e')]=_['keys'](_0x24efa3[_0x3f01('0x3e')]);_0x54c21c[_0x3f01('0x3f')]=_['intersection'](_0x54c21c[_0x3f01('0x3d')],_0x54c21c[_0x3f01('0x3e')]);_0x2be144[_0x3f01('0x40')]=_['intersection'](_0x54c21c[_0x3f01('0x3d')],qs[_0x3f01('0x41')](_0x24efa3[_0x3f01('0x3e')]['fields']));_0x2be144[_0x3f01('0x40')]=_0x2be144['attributes'][_0x3f01('0x42')]?_0x2be144[_0x3f01('0x40')]:_0x54c21c[_0x3f01('0x3d')];if(!_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x43')](_0x3f01('0x44'))){_0x2be144[_0x3f01('0x2e')]=qs[_0x3f01('0x2e')](_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x2e')]);_0x2be144[_0x3f01('0x2c')]=qs[_0x3f01('0x2c')](_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x2c')]);}_0x2be144[_0x3f01('0x45')]=qs[_0x3f01('0x46')](_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x46')]);_0x2be144['where']=qs[_0x3f01('0x3f')](_[_0x3f01('0x47')](_0x24efa3[_0x3f01('0x3e')],_0x54c21c['filters']),_0x458fcf);if(_0x24efa3['query']['filter']){_0x2be144['where']=_['merge'](_0x2be144[_0x3f01('0x48')],{'$or':_[_0x3f01('0x38')](_0x458fcf,function(_0x497d8){if(_0x497d8[_0x3f01('0x3b')]!=='VIRTUAL'){var _0x28d08d={};_0x28d08d[_0x497d8[_0x3f01('0x36')]]={'$like':'%'+_0x24efa3[_0x3f01('0x3e')]['filter']+'%'};return _0x28d08d;}})});}_0x2be144=_[_0x3f01('0x49')]({},_0x2be144,_0x24efa3[_0x3f01('0x4a')]);var _0x62a723={'where':_0x2be144[_0x3f01('0x48')]};return db['Setting'][_0x3f01('0x2f')](_0x62a723)[_0x3f01('0x1d')](function(_0x1d1b05){_0x10b51e['count']=_0x1d1b05;if(_0x24efa3[_0x3f01('0x3e')][_0x3f01('0x4b')]){_0x2be144['include']=[{'all':!![]}];}return db[_0x3f01('0x39')][_0x3f01('0x4c')](_0x2be144);})['then'](function(_0xe99c67){_0x10b51e[_0x3f01('0x4d')]=_0xe99c67;return _0x10b51e;})['then'](respondWithFilteredResult(_0x9f3dd9,_0x2be144))['catch'](handleError(_0x9f3dd9,null));};exports['show']=function(_0x215d14,_0x63fd86){var _0x5ca7d6={'raw':![],'where':{'id':_0x215d14['params']['id']}},_0x4b9629={};_0x4b9629[_0x3f01('0x3d')]=_[_0x3f01('0x4e')](db[_0x3f01('0x39')][_0x3f01('0x3a')]);_0x4b9629[_0x3f01('0x3e')]=_[_0x3f01('0x4e')](_0x215d14[_0x3f01('0x3e')]);_0x4b9629[_0x3f01('0x3f')]=_['intersection'](_0x4b9629[_0x3f01('0x3d')],_0x4b9629[_0x3f01('0x3e')]);_0x5ca7d6[_0x3f01('0x40')]=_[_0x3f01('0x4f')](_0x4b9629['model'],qs[_0x3f01('0x41')](_0x215d14[_0x3f01('0x3e')][_0x3f01('0x41')]));_0x5ca7d6[_0x3f01('0x40')]=_0x5ca7d6['attributes'][_0x3f01('0x42')]?_0x5ca7d6[_0x3f01('0x40')]:_0x4b9629['model'];if(_0x215d14[_0x3f01('0x3e')]['includeAll']){_0x5ca7d6[_0x3f01('0x50')]=[{'all':!![]}];}_0x5ca7d6=_[_0x3f01('0x49')]({},_0x5ca7d6,_0x215d14['options']);return db[_0x3f01('0x39')][_0x3f01('0x51')](_0x5ca7d6)['then'](handleEntityNotFound(_0x63fd86,null))[_0x3f01('0x1d')](respondWithResult(_0x63fd86,null))['catch'](handleError(_0x63fd86,null));};exports[_0x3f01('0x33')]=function(_0x3691da,_0x51a70e){if(_0x3691da[_0x3f01('0x52')]['id']){delete _0x3691da[_0x3f01('0x52')]['id'];}return db['Setting']['find']({'where':{'id':_0x3691da[_0x3f01('0x53')]['id']}})[_0x3f01('0x1d')](handleEntityNotFound(_0x51a70e,null))[_0x3f01('0x1d')](saveUpdates(_0x3691da['body'],null))[_0x3f01('0x1d')](respondWithResult(_0x51a70e,null))[_0x3f01('0x27')](handleError(_0x51a70e,null));};exports[_0x3f01('0x54')]=function(_0x54d31f,_0x9c7ae7,_0x1a32a5){if(_0x54d31f[_0x3f01('0x55')]&&_0x54d31f[_0x3f01('0x55')]['filename']){_0x54d31f[_0x3f01('0x52')][_0x3f01('0x56')]=_0x54d31f[_0x3f01('0x55')][_0x3f01('0x57')];}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x54d31f[_0x3f01('0x53')]['id']}})[_0x3f01('0x1d')](handleEntityNotFound(_0x9c7ae7,null))[_0x3f01('0x1d')](saveUpdates(_0x54d31f['body'],null))[_0x3f01('0x1d')](respondWithResult(_0x9c7ae7,null))['catch'](handleError(_0x9c7ae7,null));};exports[_0x3f01('0x58')]=function(_0x35a15b,_0x146a6e,_0x267b8b){if(_0x35a15b[_0x3f01('0x55')]&&_0x35a15b[_0x3f01('0x55')][_0x3f01('0x57')]){_0x35a15b[_0x3f01('0x52')][_0x3f01('0x59')]=_0x35a15b[_0x3f01('0x55')][_0x3f01('0x57')];}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x35a15b['params']['id']}})['then'](handleEntityNotFound(_0x146a6e,null))[_0x3f01('0x1d')](saveUpdates(_0x35a15b['body'],null))[_0x3f01('0x1d')](respondWithResult(_0x146a6e,null))[_0x3f01('0x27')](handleError(_0x146a6e,null));};var utilLicense=require(_0x3f01('0x5a'));exports[_0x3f01('0x5b')]=function(_0x1f8707,_0x5d70f4,_0x1697ea){var _0x548753=_0x3f01('0x5c');var _0x5779d0={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x300179){if(_0x300179){_0x5779d0=_0x300179;}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x1f8707['params']['id']},'attributes':[_0x3f01('0x56'),_0x3f01('0x59'),_0x3f01('0x5d'),_0x3f01('0x5e'),_0x3f01('0x5f'),'defaultLoginLogo',_0x3f01('0x60'),_0x3f01('0x61')],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x5d70f4,null))[_0x3f01('0x1d')](function(_0x33ff5a){if(_0x33ff5a){var _0xd8bcfb=_0x33ff5a[_0x3f01('0x56')]&&fs[_0x3f01('0x62')](path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')](_0x33ff5a[_0x3f01('0x56')])))?path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')](_0x33ff5a[_0x3f01('0x56')])):path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')]('default_logo.svg'));var _0x22d045='default'+_[_0x3f01('0x66')]('logo');if(_0x33ff5a[_0x22d045]||!_0x5779d0[_0x3f01('0x67')]){_0xd8bcfb=path['join'](config[_0x3f01('0x64')],_0x548753,_[_0x3f01('0x65')](_0x3f01('0x68')));}if(!fs[_0x3f01('0x62')](_0xd8bcfb)){throw new db['Sequelize'][(_0x3f01('0x69'))](_[_0x3f01('0x66')](_0x3f01('0x56'))+_0x3f01('0x6a'));}return _0x5d70f4[_0x3f01('0x6b')](_0xd8bcfb);}})['catch'](handleError(_0x5d70f4,null));};var utilLicense=require('../../config/license/util');exports[_0x3f01('0x6c')]=function(_0x1ddfb7,_0x5a4fd6,_0x2ed345){var _0x35034f=_0x3f01('0x5c');var _0x3fa83f={'custom':![]};return utilLicense[_0x3f01('0x6d')]()[_0x3f01('0x1d')](function(_0x548882){if(_0x548882){_0x3fa83f=_0x548882;}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x1ddfb7[_0x3f01('0x53')]['id']},'attributes':[_0x3f01('0x56'),_0x3f01('0x59'),_0x3f01('0x5d'),_0x3f01('0x5e'),_0x3f01('0x5f'),_0x3f01('0x6e'),_0x3f01('0x60'),_0x3f01('0x61')],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x5a4fd6,null))[_0x3f01('0x1d')](function(_0x49f6db){if(_0x49f6db){var _0x1ff26d=_0x49f6db['loginLogo']&&fs[_0x3f01('0x62')](path['join'](config[_0x3f01('0x64')],_0x35034f,_[_0x3f01('0x65')](_0x49f6db[_0x3f01('0x59')])))?path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x35034f,_[_0x3f01('0x65')](_0x49f6db[_0x3f01('0x59')])):path[_0x3f01('0x63')](config['root'],_0x35034f,_[_0x3f01('0x65')](_0x3f01('0x6f')));var _0x7bee9f=_0x3f01('0x70')+_[_0x3f01('0x66')](_0x3f01('0x59'));if(_0x49f6db[_0x7bee9f]||!_0x3fa83f[_0x3f01('0x67')]){_0x1ff26d=path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x35034f,_[_0x3f01('0x65')](_0x3f01('0x6f')));}if(!fs[_0x3f01('0x62')](_0x1ff26d)){throw new db[(_0x3f01('0x71'))][(_0x3f01('0x69'))](_[_0x3f01('0x66')]('loginLogo')+_0x3f01('0x6a'));}return _0x5a4fd6[_0x3f01('0x6b')](_0x1ff26d);}})[_0x3f01('0x27')](handleError(_0x5a4fd6,null));};exports[_0x3f01('0x72')]=function(_0x532b8c,_0x40f159){return db['Setting'][_0x3f01('0x51')]({'where':{'id':_0x532b8c['params']['id']},'attributes':['securePassword']})[_0x3f01('0x1d')](respondWithResult(_0x40f159,null))[_0x3f01('0x27')](handleError(_0x40f159,null));};exports[_0x3f01('0x73')]=function(_0x347336,_0x466534,_0xc872e8){if(_0x347336[_0x3f01('0x55')]&&_0x347336['file']['filename']){_0x347336[_0x3f01('0x52')][_0x3f01('0x5d')]=_0x347336[_0x3f01('0x55')][_0x3f01('0x57')];}return db[_0x3f01('0x39')][_0x3f01('0x51')]({'where':{'id':_0x347336['params']['id']}})['then'](handleEntityNotFound(_0x466534,null))['then'](saveUpdates(_0x347336['body'],null))['then'](respondWithResult(_0x466534,null))[_0x3f01('0x27')](handleError(_0x466534,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x24ee81,_0x165ecc,_0x68e3d5){var _0x866286='server/files/images/logos';var _0x3a63dd={'custom':![]};return utilLicense['getLicense']()[_0x3f01('0x1d')](function(_0x59f347){if(_0x59f347){_0x3a63dd=_0x59f347;}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x24ee81[_0x3f01('0x53')]['id']},'attributes':[_0x3f01('0x56'),_0x3f01('0x59'),_0x3f01('0x5d'),_0x3f01('0x5e'),'defaultLogo',_0x3f01('0x6e'),_0x3f01('0x60'),'defaultFavicon'],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x165ecc,null))['then'](function(_0x170019){if(_0x170019){var _0x17352a=_0x170019[_0x3f01('0x5d')]&&fs[_0x3f01('0x62')](path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x866286,_[_0x3f01('0x65')](_0x170019[_0x3f01('0x5d')])))?path['join'](config['root'],_0x866286,_['toLower'](_0x170019[_0x3f01('0x5d')])):path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x866286,_[_0x3f01('0x65')]('default_preferred.png'));var _0x5618e9=_0x3f01('0x70')+_[_0x3f01('0x66')](_0x3f01('0x5d'));if(_0x170019[_0x5618e9]||!_0x3a63dd[_0x3f01('0x67')]||!_0x3a63dd[_0x3f01('0x5d')]){_0x17352a=path[_0x3f01('0x63')](config['root'],_0x866286,_['toLower'](_0x3f01('0x74')));}if(!fs[_0x3f01('0x62')](_0x17352a)){throw new db[(_0x3f01('0x71'))]['ValidationError'](_[_0x3f01('0x66')]('preferred')+_0x3f01('0x6a'));}return _0x165ecc[_0x3f01('0x6b')](_0x17352a);}})[_0x3f01('0x27')](handleError(_0x165ecc,null));};exports['addFavicon']=function(_0x523204,_0x57bc20,_0x3dd0f4){if(_0x523204[_0x3f01('0x55')]&&_0x523204[_0x3f01('0x55')][_0x3f01('0x57')]){_0x523204[_0x3f01('0x52')][_0x3f01('0x5e')]=_0x523204[_0x3f01('0x55')]['filename'];}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x523204[_0x3f01('0x53')]['id']}})[_0x3f01('0x1d')](handleEntityNotFound(_0x57bc20,null))[_0x3f01('0x1d')](saveUpdates(_0x523204[_0x3f01('0x52')],null))[_0x3f01('0x1d')](respondWithResult(_0x57bc20,null))['catch'](handleError(_0x57bc20,null));};var utilLicense=require(_0x3f01('0x5a'));exports[_0x3f01('0x75')]=function(_0x50779e,_0x1705cd,_0x244dc6){var _0x5a19c8='server/files/images/logos';var _0x4bd8cb={'custom':![]};return utilLicense[_0x3f01('0x6d')]()[_0x3f01('0x1d')](function(_0x21e0a8){if(_0x21e0a8){_0x4bd8cb=_0x21e0a8;}return db[_0x3f01('0x39')]['find']({'where':{'id':_0x50779e[_0x3f01('0x53')]['id']},'attributes':['logo','loginLogo','preferred','favicon',_0x3f01('0x5f'),'defaultLoginLogo',_0x3f01('0x60'),_0x3f01('0x61')],'raw':!![]});})[_0x3f01('0x1d')](handleEntityNotFound(_0x1705cd,null))[_0x3f01('0x1d')](function(_0x2f45af){if(_0x2f45af){var _0x411350=_0x2f45af[_0x3f01('0x5e')]&&fs[_0x3f01('0x62')](path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x5a19c8,_[_0x3f01('0x65')](_0x2f45af[_0x3f01('0x5e')])))?path[_0x3f01('0x63')](config['root'],_0x5a19c8,_[_0x3f01('0x65')](_0x2f45af[_0x3f01('0x5e')])):path[_0x3f01('0x63')](config[_0x3f01('0x64')],_0x5a19c8,_[_0x3f01('0x65')](_0x3f01('0x76')));var _0x186198=_0x3f01('0x70')+_[_0x3f01('0x66')]('favicon');if(_0x2f45af[_0x186198]||!_0x4bd8cb[_0x3f01('0x67')]){_0x411350=path['join'](config[_0x3f01('0x64')],_0x5a19c8,_['toLower']('default_favicon.ico'));}if(!fs[_0x3f01('0x62')](_0x411350)){throw new db['Sequelize'][(_0x3f01('0x69'))](_[_0x3f01('0x66')](_0x3f01('0x5e'))+_0x3f01('0x6a'));}return _0x1705cd[_0x3f01('0x6b')](_0x411350);}})[_0x3f01('0x27')](handleError(_0x1705cd,null));};exports[_0x3f01('0x77')]=function(_0x2a79ce,_0x58dc17){var _0x197584={'offset':moment()[_0x3f01('0x78')]()};_0x197584['now']=moment()[_0x3f01('0x78')](_0x197584['offset'])[_0x3f01('0x79')](_0x3f01('0x7a'));return _0x58dc17['status'](0xc8)[_0x3f01('0x37')](_0x197584);}; \ No newline at end of file +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 diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 73696b2..5a80728 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x447725,_0x49753b){var _0x399167=function(_0x1e47d9){while(--_0x1e47d9){_0x447725['push'](_0x447725['shift']());}};_0x399167(++_0x49753b);}(_0x3e74,0x175));var _0x43e7=function(_0x1a2b50,_0x20ef87){_0x1a2b50=_0x1a2b50-0x0;var _0x563993=_0x3e74[_0x1a2b50];return _0x563993;};'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 _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 diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 7af48ea..c6f7ca5 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 _0x5347=['code','message','catch','ShowSetting','find','options','raw','attributes','include','model','map','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5347,0xf3));var _0x7534=function(_0x5d28e2,_0x1e2167){_0x5d28e2=_0x5d28e2-0x0;var _0x5d748e=_0x5347[_0x5d28e2];return _0x5d748e;};'use strict';var _=require(_0x7534('0x0'));var util=require(_0x7534('0x1'));var moment=require(_0x7534('0x2'));var BPromise=require(_0x7534('0x3'));var rs=require(_0x7534('0x4'));var fs=require('fs');var Redis=require(_0x7534('0x5'));var db=require(_0x7534('0x6'))['db'];var utils=require(_0x7534('0x7'));var logger=require(_0x7534('0x8'))(_0x7534('0x9'));var config=require(_0x7534('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7534('0xb')][_0x7534('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a9ecd,_0x9c6944,_0x404dcf){return new BPromise(function(_0x23a4ab,_0x265454){return client[_0x7534('0xd')](_0x5a9ecd,_0x404dcf)[_0x7534('0xe')](function(_0x48d91b){logger['info'](_0x7534('0xf'),_0x9c6944,_0x7534('0x10'));logger[_0x7534('0x11')](_0x7534('0x12'),_0x9c6944,_0x7534('0x10'),JSON[_0x7534('0x13')](_0x48d91b));if(_0x48d91b[_0x7534('0x14')]){if(_0x48d91b[_0x7534('0x14')][_0x7534('0x15')]===0x1f4){logger[_0x7534('0x14')]('Setting,\x20%s,\x20%s',_0x9c6944,_0x48d91b[_0x7534('0x14')][_0x7534('0x16')]);return _0x265454(_0x48d91b[_0x7534('0x14')][_0x7534('0x16')]);}logger[_0x7534('0x14')]('Setting,\x20%s,\x20%s',_0x9c6944,_0x48d91b[_0x7534('0x14')]['message']);return _0x23a4ab(_0x48d91b[_0x7534('0x14')][_0x7534('0x16')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x9c6944,_0x7534('0x10'));_0x23a4ab(_0x48d91b['result'][_0x7534('0x16')]);}})[_0x7534('0x17')](function(_0x425bb4){logger[_0x7534('0x14')](_0x7534('0xf'),_0x9c6944,_0x425bb4);_0x265454(_0x425bb4);});});}exports[_0x7534('0x18')]=function(_0x33e2c9){var _0x4fabe4=this;return new Promise(function(_0x33271f,_0x1dd7b4){return db['Setting'][_0x7534('0x19')]({'raw':_0x33e2c9['options']?_0x33e2c9[_0x7534('0x1a')][_0x7534('0x1b')]===undefined?!![]:![]:!![],'where':_0x33e2c9[_0x7534('0x1a')]?_0x33e2c9[_0x7534('0x1a')]['where']||null:null,'attributes':_0x33e2c9[_0x7534('0x1a')]?_0x33e2c9[_0x7534('0x1a')][_0x7534('0x1c')]||null:null,'include':_0x33e2c9['options']?_0x33e2c9[_0x7534('0x1a')][_0x7534('0x1d')]?_['map'](_0x33e2c9['options'][_0x7534('0x1d')],function(_0xb37c76){return{'model':db[_0xb37c76[_0x7534('0x1e')]],'as':_0xb37c76['as'],'attributes':_0xb37c76[_0x7534('0x1c')],'include':_0xb37c76['include']?_[_0x7534('0x1f')](_0xb37c76[_0x7534('0x1d')],function(_0x44b54e){return{'model':db[_0x44b54e[_0x7534('0x1e')]],'as':_0x44b54e['as'],'attributes':_0x44b54e[_0x7534('0x1c')],'include':_0x44b54e[_0x7534('0x1d')]?_[_0x7534('0x1f')](_0x44b54e[_0x7534('0x1d')],function(_0x5bc9e4){return{'model':db[_0x5bc9e4['model']],'as':_0x5bc9e4['as'],'attributes':_0x5bc9e4[_0x7534('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7534('0xe')](function(_0x549d0b){logger[_0x7534('0x20')](_0x7534('0x18'),_0x33e2c9);logger[_0x7534('0x11')](_0x7534('0x18'),_0x33e2c9,JSON['stringify'](_0x549d0b));_0x33271f(_0x549d0b);})[_0x7534('0x17')](function(_0x3465da){logger[_0x7534('0x14')]('ShowSetting',_0x3465da[_0x7534('0x16')],_0x33e2c9);_0x1dd7b4(_0x4fabe4[_0x7534('0x14')](0x1f4,_0x3465da[_0x7534('0x16')]));});});}; \ No newline at end of file +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 diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index c10f36c..9af6569 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x21ef94,_0x294aac){var _0x544fb5=function(_0x224fcf){while(--_0x224fcf){_0x21ef94['push'](_0x21ef94['shift']());}};_0x544fb5(++_0x294aac);}(_0xabce,0x103));var _0xeabc=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xabce[_0x4bb66f];return _0xf2772f;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +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 diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index cc81960..375f6c2 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 _0x0a96=['twilio','skebby','connectel','plivo','clickatell','bandwidth','csc','infobip','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0x0a96,0x1c3));var _0x60a9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0a96[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x60a9('0x0'));var rs=require('randomstring');module[_0x60a9('0x1')]={'name':{'type':Sequelize[_0x60a9('0x2')],'unique':_0x60a9('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x60a9('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x60a9('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x60a9('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x60a9('0x2')]},'type':{'type':Sequelize[_0x60a9('0x4')](_0x60a9('0x5'),_0x60a9('0x6'),_0x60a9('0x7'),'clicksend',_0x60a9('0x8'),_0x60a9('0x9'),_0x60a9('0xa'),_0x60a9('0xb'),_0x60a9('0xc'),'intelepeer')},'accountSid':{'type':Sequelize[_0x60a9('0x2')]},'authId':{'type':Sequelize[_0x60a9('0x2')]},'authToken':{'type':Sequelize[_0x60a9('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x60a9('0x2')]},'password':{'type':Sequelize[_0x60a9('0x2')]},'apiKey':{'type':Sequelize[_0x60a9('0x2')]},'applicationId':{'type':Sequelize[_0x60a9('0x2')]},'accountId':{'type':Sequelize[_0x60a9('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x60a9('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x60a9('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x60a9('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x60a9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x60a9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x60a9('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x60a9('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x60a9('0xe')],'comment':_0x60a9('0xf')},'mandatoryDisposition':{'type':Sequelize[_0x60a9('0xd')],'defaultValue':![],'comment':_0x60a9('0x10'),'set':function(_0x35acd4){if(!_0x35acd4)this[_0x60a9('0x11')]('mandatoryDispositionPauseId',null);this[_0x60a9('0x11')](_0x60a9('0x12'),_0x35acd4);}}}; \ No newline at end of file +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 diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 6b235ac..4491388 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 _0x361b=['jayson/promise','then','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SmsAccount','includeAll','include','findAll','rows','show','fields','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','Disposition','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','sms','SmsApplication','Applications','account','orderBy','priority','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','CompanyId','from','From','Body','messageId','skebby','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','ListId','Contacts','DESC','omit','defaults','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','push','SmsAccount,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','userSmsAccount:remove','rimraf','zip-dir','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x361b,0x1a9));var _0xb361=function(_0x66d66f,_0x3a007b){_0x66d66f=_0x66d66f-0x0;var _0xa9fe65=_0x361b[_0x66d66f];return _0xa9fe65;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb361('0x0'));var zipdir=require(_0xb361('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb361('0x2'));var BPromise=require(_0xb361('0x3'));var Mustache=require('mustache');var util=require(_0xb361('0x4'));var path=require(_0xb361('0x5'));var sox=require(_0xb361('0x6'));var csv=require('to-csv');var ejs=require(_0xb361('0x7'));var fs=require('fs');var fs_extra=require(_0xb361('0x8'));var _=require(_0xb361('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb361('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb361('0xb'));var querystring=require(_0xb361('0xc'));var Papa=require(_0xb361('0xd'));var Redis=require(_0xb361('0xe'));var authService=require(_0xb361('0xf'));var qs=require(_0xb361('0x10'));var as=require(_0xb361('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb361('0x12'));var utils=require(_0xb361('0x13'));var config=require(_0xb361('0x14'));var licenseUtil=require(_0xb361('0x15'));var db=require(_0xb361('0x16'))['db'];config[_0xb361('0x17')]=_['defaults'](config[_0xb361('0x17')],{'host':_0xb361('0x18'),'port':0x18eb});var socket=require(_0xb361('0x19'))(new Redis(config[_0xb361('0x17')]));require('./smsAccount.socket')[_0xb361('0x1a')](socket);var jayson=require(_0xb361('0x1b'));var client=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x869cb9,_0x6fe768,_0x1762f1,_0xbd0bd6){return new BPromise(function(_0x338b58,_0x12bd45){var _0x3e0405=_0xbd0bd6||client;return _0x3e0405['request'](_0x869cb9,_0x1762f1)[_0xb361('0x1c')](function(_0xf52ca3){logger['info'](_0xb361('0x1d'),_0x6fe768,'request\x20sent');logger[_0xb361('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6fe768,_0xb361('0x1f'),JSON[_0xb361('0x20')](_0xf52ca3));if(_0xf52ca3[_0xb361('0x21')]){if(_0xf52ca3['error'][_0xb361('0x22')]===0x1f4){logger['error'](_0xb361('0x1d'),_0x6fe768,_0xf52ca3[_0xb361('0x21')]['message']);return _0x12bd45(_0xf52ca3[_0xb361('0x21')]['message']);}logger[_0xb361('0x21')](_0xb361('0x1d'),_0x6fe768,_0xf52ca3['error'][_0xb361('0x23')]);return _0x338b58(_0xf52ca3[_0xb361('0x21')]['message']);}else{logger[_0xb361('0x24')](_0xb361('0x1d'),_0x6fe768,_0xb361('0x1f'));_0x338b58(_0xf52ca3['result']['message']);}})[_0xb361('0x25')](function(_0xf80dfd){logger[_0xb361('0x21')]('SmsAccount,\x20%s,\x20%s',_0x6fe768,_0xf80dfd);_0x12bd45(_0xf80dfd);});});}function respondWithStatusCode(_0x16e6f0,_0x3cbb45){_0x3cbb45=_0x3cbb45||0xcc;return function(_0xfcfd77){if(_0xfcfd77){return _0x16e6f0[_0xb361('0x26')](_0x3cbb45);}return _0x16e6f0['status'](_0x3cbb45)[_0xb361('0x27')]();};}function respondWithResult(_0x4a5af8,_0x34f9be){_0x34f9be=_0x34f9be||0xc8;return function(_0x146e27){if(_0x146e27){return _0x4a5af8['status'](_0x34f9be)[_0xb361('0x28')](_0x146e27);}};}function respondWithFilteredResult(_0x54ebee,_0x29166a){return function(_0x17d7e9){if(_0x17d7e9){var _0x1eb65b=typeof _0x29166a[_0xb361('0x29')]===_0xb361('0x2a')&&typeof _0x29166a[_0xb361('0x2b')]===_0xb361('0x2a');var _0xc7829b=_0x17d7e9[_0xb361('0x2c')];var _0x7db99b=_0x1eb65b?0x0:_0x29166a['offset'];var _0x41d4b1=_0x1eb65b?_0x17d7e9['count']:_0x29166a[_0xb361('0x29')]+_0x29166a[_0xb361('0x2b')];var _0x17691a;if(_0x41d4b1>=_0xc7829b){_0x41d4b1=_0xc7829b;_0x17691a=0xc8;}else{_0x17691a=0xce;}_0x54ebee[_0xb361('0x2d')](_0x17691a);return _0x54ebee[_0xb361('0x2e')]('Content-Range',_0x7db99b+'-'+_0x41d4b1+'/'+_0xc7829b)['json'](_0x17d7e9);}return null;};}function patchUpdates(_0x52d734){return function(_0x4c2754){try{jsonpatch[_0xb361('0x2f')](_0x4c2754,_0x52d734,!![]);}catch(_0x4a9b29){return BPromise[_0xb361('0x30')](_0x4a9b29);}return _0x4c2754[_0xb361('0x31')]();};}function saveUpdates(_0x136fee,_0x42c953){return function(_0x2149ef){if(_0x2149ef){return _0x2149ef[_0xb361('0x32')](_0x136fee)[_0xb361('0x1c')](function(_0x4f4523){return _0x4f4523;});}return null;};}function removeEntity(_0x643ddc,_0x2b884d){return function(_0x22f693){if(_0x22f693){return _0x22f693[_0xb361('0x33')]()['then'](function(){var _0x3e19b4=_0x22f693[_0xb361('0x34')]({'plain':!![]});var _0x51151f='SmsAccounts';return db[_0xb361('0x35')]['destroy']({'where':{'type':_0x51151f,'resourceId':_0x3e19b4['id']}})[_0xb361('0x1c')](function(){return _0x22f693;});})[_0xb361('0x1c')](function(){_0x643ddc['status'](0xcc)[_0xb361('0x27')]();});}};}function handleEntityNotFound(_0xdaa53b,_0x26c826){return function(_0x36d805){if(!_0x36d805){_0xdaa53b[_0xb361('0x26')](0x194);}return _0x36d805;};}function handleError(_0x36f0fd,_0x42d94d){_0x42d94d=_0x42d94d||0x1f4;return function(_0x1841c2){logger[_0xb361('0x21')](_0x1841c2[_0xb361('0x36')]);if(_0x1841c2[_0xb361('0x37')]){delete _0x1841c2[_0xb361('0x37')];}_0x36f0fd['status'](_0x42d94d)[_0xb361('0x38')](_0x1841c2);};}exports[_0xb361('0x39')]=function(_0x6b1b17,_0x2a5ab8){var _0xd79cfb={'include':[{'model':db[_0xb361('0x3a')],'as':_0xb361('0x3b')}]},_0x5d840e={},_0x3582ca={'count':0x0,'rows':[]};var _0x242811=_['map'](db['SmsAccount'][_0xb361('0x3c')],function(_0xf1cad9){return{'name':_0xf1cad9[_0xb361('0x3d')],'type':_0xf1cad9[_0xb361('0x3e')][_0xb361('0x3f')]};});_0x5d840e['model']=_[_0xb361('0x40')](_0x242811,_0xb361('0x37'));_0x5d840e['query']=_[_0xb361('0x41')](_0x6b1b17[_0xb361('0x42')]);_0x5d840e[_0xb361('0x43')]=_[_0xb361('0x44')](_0x5d840e[_0xb361('0x45')],_0x5d840e[_0xb361('0x42')]);_0xd79cfb[_0xb361('0x46')]=_[_0xb361('0x44')](_0x5d840e[_0xb361('0x45')],qs['fields'](_0x6b1b17[_0xb361('0x42')]['fields']));_0xd79cfb[_0xb361('0x46')]=_0xd79cfb[_0xb361('0x46')][_0xb361('0x47')]?_0xd79cfb[_0xb361('0x46')]:_0x5d840e[_0xb361('0x45')];if(!_0x6b1b17[_0xb361('0x42')][_0xb361('0x48')](_0xb361('0x49'))){_0xd79cfb[_0xb361('0x2b')]=qs['limit'](_0x6b1b17['query'][_0xb361('0x2b')]);_0xd79cfb[_0xb361('0x29')]=qs['offset'](_0x6b1b17[_0xb361('0x42')][_0xb361('0x29')]);}_0xd79cfb['order']=qs['sort'](_0x6b1b17[_0xb361('0x42')][_0xb361('0x4a')]);_0xd79cfb[_0xb361('0x4b')]=qs[_0xb361('0x43')](_[_0xb361('0x4c')](_0x6b1b17[_0xb361('0x42')],_0x5d840e['filters']),_0x242811);if(_0x6b1b17[_0xb361('0x42')][_0xb361('0x4d')]){_0xd79cfb[_0xb361('0x4b')]=_['merge'](_0xd79cfb['where'],{'$or':_['map'](_0x242811,function(_0x2a0e87){if(_0x2a0e87[_0xb361('0x3e')]!==_0xb361('0x4e')){var _0x4ec301={};_0x4ec301[_0x2a0e87[_0xb361('0x37')]]={'$like':'%'+_0x6b1b17['query'][_0xb361('0x4d')]+'%'};return _0x4ec301;}})});}_0xd79cfb=_[_0xb361('0x4f')]({},_0xd79cfb,_0x6b1b17[_0xb361('0x50')]);var _0x33e460={'where':_0xd79cfb[_0xb361('0x4b')]};return db[_0xb361('0x51')][_0xb361('0x2c')](_0x33e460)['then'](function(_0x558c9e){_0x3582ca['count']=_0x558c9e;if(_0x6b1b17[_0xb361('0x42')][_0xb361('0x52')]){_0xd79cfb[_0xb361('0x53')]=[{'all':!![]}];}return db[_0xb361('0x51')][_0xb361('0x54')](_0xd79cfb);})[_0xb361('0x1c')](function(_0x43f0cf){_0x3582ca[_0xb361('0x55')]=_0x43f0cf;return _0x3582ca;})['then'](respondWithFilteredResult(_0x2a5ab8,_0xd79cfb))['catch'](handleError(_0x2a5ab8,null));};exports[_0xb361('0x56')]=function(_0x4e234a,_0x3ba486){var _0x1358c9={'raw':![],'where':{'id':_0x4e234a['params']['id']},'include':[{'model':db['Pause'],'as':_0xb361('0x3b')}]},_0x1728e1={};_0x1728e1[_0xb361('0x45')]=_[_0xb361('0x41')](db[_0xb361('0x51')]['rawAttributes']);_0x1728e1['query']=_['keys'](_0x4e234a[_0xb361('0x42')]);_0x1728e1[_0xb361('0x43')]=_[_0xb361('0x44')](_0x1728e1[_0xb361('0x45')],_0x1728e1['query']);_0x1358c9[_0xb361('0x46')]=_[_0xb361('0x44')](_0x1728e1[_0xb361('0x45')],qs[_0xb361('0x57')](_0x4e234a['query'][_0xb361('0x57')]));_0x1358c9[_0xb361('0x46')]=_0x1358c9[_0xb361('0x46')][_0xb361('0x47')]?_0x1358c9['attributes']:_0x1728e1['model'];if(_0x4e234a[_0xb361('0x42')][_0xb361('0x52')]){_0x1358c9[_0xb361('0x53')]=[{'all':!![]}];}_0x1358c9=_['merge']({},_0x1358c9,_0x4e234a[_0xb361('0x50')]);return db[_0xb361('0x51')]['find'](_0x1358c9)['then'](handleEntityNotFound(_0x3ba486,null))[_0xb361('0x1c')](respondWithResult(_0x3ba486,null))['catch'](handleError(_0x3ba486,null));};exports['create']=function(_0x370479,_0x5bcbc6){return db[_0xb361('0x51')]['create'](_0x370479[_0xb361('0x58')],{})['then'](function(_0x36d984){var _0x40118e=_0x370479[_0xb361('0x59')]['get']({'plain':!![]});if(!_0x40118e)throw new Error(_0xb361('0x5a'));if(_0x40118e[_0xb361('0x5b')]===_0xb361('0x59')){var _0x8d672f=_0x36d984['get']({'plain':!![]});var _0x165d0f='SmsAccounts';return db[_0xb361('0x5c')][_0xb361('0x5d')]({'where':{'name':_0x165d0f,'userProfileId':_0x40118e['userProfileId']},'raw':!![]})[_0xb361('0x1c')](function(_0x2505fb){if(_0x2505fb&&_0x2505fb[_0xb361('0x5e')]===0x0){return db[_0xb361('0x35')][_0xb361('0x5f')]({'name':_0x8d672f[_0xb361('0x37')],'resourceId':_0x8d672f['id'],'type':_0x2505fb[_0xb361('0x37')],'sectionId':_0x2505fb['id']},{})[_0xb361('0x1c')](function(){return _0x36d984;});}else{return _0x36d984;}})['catch'](function(_0x3b3bde){logger['error'](_0xb361('0x60'),_0x3b3bde);throw _0x3b3bde;});}return _0x36d984;})[_0xb361('0x1c')](respondWithResult(_0x5bcbc6,0xc9))[_0xb361('0x25')](handleError(_0x5bcbc6,null));};exports[_0xb361('0x32')]=function(_0x5870d4,_0xf7e6ad){if(_0x5870d4[_0xb361('0x58')]['id']){delete _0x5870d4[_0xb361('0x58')]['id'];}return db['SmsAccount'][_0xb361('0x5d')]({'where':{'id':_0x5870d4[_0xb361('0x61')]['id']},'include':[{'model':db[_0xb361('0x3a')],'as':'mandatoryDispositionPause'}]})[_0xb361('0x1c')](handleEntityNotFound(_0xf7e6ad,null))[_0xb361('0x1c')](saveUpdates(_0x5870d4['body'],null))[_0xb361('0x1c')](respondWithResult(_0xf7e6ad,null))['catch'](handleError(_0xf7e6ad,null));};exports[_0xb361('0x33')]=function(_0x16d9b8,_0x2a0c93){return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x16d9b8['params']['id']}})['then'](handleEntityNotFound(_0x2a0c93,null))['then'](removeEntity(_0x2a0c93,null))[_0xb361('0x25')](handleError(_0x2a0c93,null));};exports[_0xb361('0x62')]=function(_0x4a3a53,_0x1ef025){return db[_0xb361('0x51')]['describe']()['then'](respondWithResult(_0x1ef025,null))['catch'](handleError(_0x1ef025,null));};exports[_0xb361('0x63')]=function(_0x276f45,_0x339d53,_0x52d0bd){if(_0x276f45[_0xb361('0x58')]['id']){delete _0x276f45[_0xb361('0x58')]['id'];}return db[_0xb361('0x51')]['find']({'where':{'id':_0x276f45[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x339d53,null))[_0xb361('0x1c')](function(_0x3cc445){if(_0x3cc445){_0x276f45[_0xb361('0x58')][_0xb361('0x64')]=_0x3cc445['id'];return db[_0xb361('0x65')][_0xb361('0x5f')](_0x276f45[_0xb361('0x58')]);}})[_0xb361('0x1c')](respondWithResult(_0x339d53,null))[_0xb361('0x25')](handleError(_0x339d53,null));};exports['getDispositions']=function(_0x5923d3,_0x154ab9,_0x236c66){var _0x4e909a={'raw':![],'where':{}};var _0x2501e0={};var _0x33a276={'count':0x0,'rows':[]};return db[_0xb361('0x51')][_0xb361('0x66')]({'where':{'id':_0x5923d3[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x154ab9,null))[_0xb361('0x1c')](function(_0x77340a){if(_0x77340a){_0x2501e0[_0xb361('0x45')]=_[_0xb361('0x41')](db['Disposition']['rawAttributes']);_0x2501e0[_0xb361('0x42')]=_[_0xb361('0x41')](_0x5923d3['query']);_0x2501e0[_0xb361('0x43')]=_['intersection'](_0x2501e0[_0xb361('0x45')],_0x2501e0[_0xb361('0x42')]);_0x4e909a['attributes']=_['intersection'](_0x2501e0[_0xb361('0x45')],qs[_0xb361('0x57')](_0x5923d3['query']['fields']));_0x4e909a[_0xb361('0x46')]=_0x4e909a[_0xb361('0x46')]['length']?_0x4e909a[_0xb361('0x46')]:_0x2501e0[_0xb361('0x45')];if(!_0x5923d3[_0xb361('0x42')][_0xb361('0x48')](_0xb361('0x49'))){_0x4e909a['limit']=qs[_0xb361('0x2b')](_0x5923d3['query'][_0xb361('0x2b')]);_0x4e909a[_0xb361('0x29')]=qs['offset'](_0x5923d3['query'][_0xb361('0x29')]);}_0x4e909a[_0xb361('0x67')]=qs[_0xb361('0x4a')](_0x5923d3[_0xb361('0x42')][_0xb361('0x4a')]);_0x4e909a[_0xb361('0x4b')]=qs[_0xb361('0x43')](_[_0xb361('0x4c')](_0x5923d3['query'],_0x2501e0[_0xb361('0x43')]));_0x4e909a[_0xb361('0x4b')][_0xb361('0x64')]=_0x77340a['id'];if(_0x5923d3[_0xb361('0x42')]['filter']){_0x4e909a[_0xb361('0x4b')]=_[_0xb361('0x4f')](_0x4e909a['where'],{'$or':_[_0xb361('0x40')](_0x4e909a[_0xb361('0x46')],function(_0x8a7981){var _0x271ea8={};_0x271ea8[_0x8a7981]={'$like':'%'+_0x5923d3['query'][_0xb361('0x4d')]+'%'};return _0x271ea8;})});}_0x4e909a=_[_0xb361('0x4f')]({},_0x4e909a,_0x5923d3[_0xb361('0x50')]);return db[_0xb361('0x65')][_0xb361('0x2c')]({'where':_0x4e909a['where']})[_0xb361('0x1c')](function(_0x1e4d1d){_0x33a276[_0xb361('0x2c')]=_0x1e4d1d;if(_0x5923d3['query'][_0xb361('0x52')]){_0x4e909a[_0xb361('0x53')]=[{'all':!![]}];}return db['Disposition'][_0xb361('0x54')](_0x4e909a);})[_0xb361('0x1c')](function(_0x463a59){_0x33a276[_0xb361('0x55')]=_0x463a59;return _0x33a276;});}})[_0xb361('0x1c')](respondWithFilteredResult(_0x154ab9,_0x4e909a))[_0xb361('0x25')](handleError(_0x154ab9,null));};exports[_0xb361('0x68')]=function(_0x3a04a8,_0x442a91,_0x556d71){return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x3a04a8[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x442a91,null))[_0xb361('0x1c')](function(_0xa90933){if(_0xa90933){return _0xa90933['removeDispositions'](_0x3a04a8[_0xb361('0x42')][_0xb361('0x69')]);}})[_0xb361('0x1c')](respondWithStatusCode(_0x442a91,null))[_0xb361('0x25')](handleError(_0x442a91,null));};exports[_0xb361('0x6a')]=function(_0x148ef9,_0x3a2ff3,_0xea7f81){if(_0x148ef9[_0xb361('0x58')]['id']){delete _0x148ef9[_0xb361('0x58')]['id'];}return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x148ef9[_0xb361('0x61')]['id']}})['then'](handleEntityNotFound(_0x3a2ff3,null))['then'](function(_0x5edfa8){if(_0x5edfa8){_0x148ef9[_0xb361('0x58')][_0xb361('0x64')]=_0x5edfa8['id'];return db[_0xb361('0x6b')][_0xb361('0x5f')](_0x148ef9[_0xb361('0x58')]);}})[_0xb361('0x1c')](respondWithResult(_0x3a2ff3,null))[_0xb361('0x25')](handleError(_0x3a2ff3,null));};exports[_0xb361('0x6c')]=function(_0xca91bf,_0x301edf,_0x30e92b){var _0x431789={'raw':![],'where':{}};var _0x47a4be={};var _0x14ffec={'count':0x0,'rows':[]};return db['SmsAccount'][_0xb361('0x66')]({'where':{'id':_0xca91bf[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x301edf,null))[_0xb361('0x1c')](function(_0x28cca5){if(_0x28cca5){_0x47a4be['model']=_['keys'](db[_0xb361('0x6b')][_0xb361('0x3c')]);_0x47a4be['query']=_[_0xb361('0x41')](_0xca91bf[_0xb361('0x42')]);_0x47a4be['filters']=_['intersection'](_0x47a4be[_0xb361('0x45')],_0x47a4be[_0xb361('0x42')]);_0x431789[_0xb361('0x46')]=_['intersection'](_0x47a4be[_0xb361('0x45')],qs['fields'](_0xca91bf['query']['fields']));_0x431789[_0xb361('0x46')]=_0x431789[_0xb361('0x46')][_0xb361('0x47')]?_0x431789[_0xb361('0x46')]:_0x47a4be[_0xb361('0x45')];if(!_0xca91bf[_0xb361('0x42')][_0xb361('0x48')](_0xb361('0x49'))){_0x431789['limit']=qs[_0xb361('0x2b')](_0xca91bf[_0xb361('0x42')][_0xb361('0x2b')]);_0x431789[_0xb361('0x29')]=qs[_0xb361('0x29')](_0xca91bf[_0xb361('0x42')][_0xb361('0x29')]);}_0x431789[_0xb361('0x67')]=qs[_0xb361('0x4a')](_0xca91bf[_0xb361('0x42')]['sort']);_0x431789[_0xb361('0x4b')]=qs[_0xb361('0x43')](_[_0xb361('0x4c')](_0xca91bf[_0xb361('0x42')],_0x47a4be[_0xb361('0x43')]));_0x431789[_0xb361('0x4b')][_0xb361('0x64')]=_0x28cca5['id'];if(_0xca91bf[_0xb361('0x42')]['filter']){_0x431789[_0xb361('0x4b')]=_[_0xb361('0x4f')](_0x431789[_0xb361('0x4b')],{'$or':_[_0xb361('0x40')](_0x431789[_0xb361('0x46')],function(_0x5a91d9){var _0x35cddd={};_0x35cddd[_0x5a91d9]={'$like':'%'+_0xca91bf[_0xb361('0x42')][_0xb361('0x4d')]+'%'};return _0x35cddd;})});}_0x431789=_[_0xb361('0x4f')]({},_0x431789,_0xca91bf[_0xb361('0x50')]);return db['CannedAnswer'][_0xb361('0x2c')]({'where':_0x431789[_0xb361('0x4b')]})[_0xb361('0x1c')](function(_0x211327){_0x14ffec[_0xb361('0x2c')]=_0x211327;if(_0xca91bf[_0xb361('0x42')][_0xb361('0x52')]){_0x431789[_0xb361('0x53')]=[{'all':!![]}];}return db[_0xb361('0x6b')][_0xb361('0x54')](_0x431789);})['then'](function(_0xab16b7){_0x14ffec['rows']=_0xab16b7;return _0x14ffec;});}})[_0xb361('0x1c')](respondWithFilteredResult(_0x301edf,_0x431789))['catch'](handleError(_0x301edf,null));};exports['removeAnswers']=function(_0x7343fb,_0x5d55eb,_0x3b2731){return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x7343fb[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x5d55eb,null))[_0xb361('0x1c')](function(_0x3d2313){if(_0x3d2313){return _0x3d2313[_0xb361('0x6d')](_0x7343fb['query'][_0xb361('0x69')]);}})[_0xb361('0x1c')](respondWithStatusCode(_0x5d55eb,null))['catch'](handleError(_0x5d55eb,null));};exports[_0xb361('0x6e')]=function(_0x3d65af,_0x1d0926,_0x4cf716){var _0x322086={'channel':_0xb361('0x6f')};var _0x49e530=[];var _0x41712c=[];var _0xa6e07d={};return db['SmsAccount']['find']({'where':{'id':_0x3d65af[_0xb361('0x61')]['id']},'include':[{'model':db[_0xb361('0x70')],'as':_0xb361('0x71')}]})[_0xb361('0x1c')](handleEntityNotFound(_0x1d0926,null))[_0xb361('0x1c')](function(_0x37f9f7){_0x322086[_0xb361('0x72')]=_0x37f9f7;_0x322086['applications']=_[_0xb361('0x73')](_0x37f9f7['Applications'],[_0xb361('0x74')],[_0xb361('0x75')]);if(_0x322086['account'][_0xb361('0x71')]){delete _0x322086[_0xb361('0x72')]['Applications'];}return db[_0xb361('0x76')][_0xb361('0x62')]();})[_0xb361('0x1c')](function(_0x25e09f){if(!_0x25e09f){throw new db[(_0xb361('0x77'))][(_0xb361('0x78'))](_0xb361('0x79'));}_0x49e530=_['difference'](_[_0xb361('0x41')](_0x25e09f),['createdAt','updatedAt']);_0x41712c=_[_0xb361('0x7a')](_['keys'](_0x25e09f),['createdAt','updatedAt',_0xb361('0x7b'),'ListId']);_0x322086[_0xb361('0x58')]={'mapKey':'mobile'};if(_0x322086[_0xb361('0x72')][_0xb361('0x3e')]){switch(_0x322086['account'][_0xb361('0x3e')]){case'twilio':_0x322086[_0xb361('0x58')][_0xb361('0x7c')]=_0x3d65af['body'][_0xb361('0x7d')];_0x322086[_0xb361('0x58')]['body']=_0x3d65af[_0xb361('0x58')][_0xb361('0x7e')];_0x322086[_0xb361('0x58')][_0xb361('0x7f')]=_0x3d65af[_0xb361('0x58')]['MessageSid'];break;case _0xb361('0x80'):_0x322086['body'][_0xb361('0x7c')]='+'+_0x3d65af[_0xb361('0x58')]['sender'];_0x322086[_0xb361('0x58')][_0xb361('0x58')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x81')];break;case _0xb361('0x82'):_0x322086[_0xb361('0x58')][_0xb361('0x7c')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x7c')];_0x322086[_0xb361('0x58')]['body']=_0x3d65af['body']['message'];break;case _0xb361('0x83'):_0x322086[_0xb361('0x58')]['from']=_0x3d65af[_0xb361('0x58')][_0xb361('0x7c')];_0x322086[_0xb361('0x58')][_0xb361('0x58')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x58')];_0x322086[_0xb361('0x58')][_0xb361('0x7f')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x84')];break;case _0xb361('0x85'):_0x322086[_0xb361('0x58')][_0xb361('0x7c')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x7d')];_0x322086[_0xb361('0x58')][_0xb361('0x58')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x86')];_0x322086['body']['messageId']=_0x3d65af['body'][_0xb361('0x87')];break;case _0xb361('0x88'):_0x322086[_0xb361('0x58')]['from']='+'+_0x3d65af[_0xb361('0x58')]['results'][0x0]['from'];_0x322086['body'][_0xb361('0x58')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x89')][0x0][_0xb361('0x81')];_0x322086[_0xb361('0x58')][_0xb361('0x7f')]=_0x3d65af[_0xb361('0x58')]['results'][0x0]['messageId'];break;case _0xb361('0x8a'):_0x322086[_0xb361('0x58')][_0xb361('0x7c')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x8b')];_0x322086['body']['body']=_0x3d65af['body'][_0xb361('0x8c')][_0xb361('0x23')];break;case _0xb361('0x8d'):_0x322086[_0xb361('0x58')]['from']=_0x3d65af[_0xb361('0x58')][_0xb361('0x8e')];_0x322086[_0xb361('0x58')][_0xb361('0x58')]=_0x3d65af['body'][_0xb361('0x81')];_0x322086[_0xb361('0x58')]['messageId']=_0x3d65af[_0xb361('0x58')][_0xb361('0x8f')];break;case _0xb361('0x90'):_0x322086[_0xb361('0x58')][_0xb361('0x7f')]=_0x3d65af[_0xb361('0x58')][0x0]['message']['id'];_0x322086[_0xb361('0x58')][_0xb361('0x7c')]=_0x3d65af[_0xb361('0x58')][0x0][_0xb361('0x23')]['from'];_0x322086['body'][_0xb361('0x58')]=_0x3d65af[_0xb361('0x58')][0x0][_0xb361('0x23')]['text'];break;case _0xb361('0x91'):_0x322086['body'][_0xb361('0x7c')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x7c')];_0x322086[_0xb361('0x58')][_0xb361('0x58')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x23')];_0x322086['body'][_0xb361('0x7f')]=_0x3d65af[_0xb361('0x58')][_0xb361('0x92')];break;}}if(_0x322086[_0xb361('0x58')]['id']){delete _0x322086['body']['id'];}if(_[_0xb361('0x93')](_0x322086[_0xb361('0x58')][_0xb361('0x7c')])){throw new db[(_0xb361('0x77'))][(_0xb361('0x78'))](_0xb361('0x94'));}if(_['isNil'](_0x322086['body'][_0xb361('0x58')])||_0x322086[_0xb361('0x58')][_0xb361('0x58')]===''){throw new db[(_0xb361('0x77'))][(_0xb361('0x78'))](_0xb361('0x95'));}if(_[_0xb361('0x93')](_0x322086[_0xb361('0x58')][_0xb361('0x96')])){throw new db['Sequelize'][(_0xb361('0x78'))](_0xb361('0x97')+_0x41712c);}if(!_[_0xb361('0x98')](_0x41712c,_0x322086[_0xb361('0x58')][_0xb361('0x96')])){throw new db[(_0xb361('0x77'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x41712c);}_0xa6e07d[_0x322086['body'][_0xb361('0x96')]]=_0x322086[_0xb361('0x58')][_0xb361('0x7c')];return db[_0xb361('0x99')][_0xb361('0x5d')]({'where':{'id':_0x322086[_0xb361('0x72')][_0xb361('0x9a')]},'include':[{'model':db[_0xb361('0x76')],'as':_0xb361('0x9b'),'where':_0xa6e07d,'limit':0x1,'order':[['updatedAt',_0xb361('0x9c')]]}]});})['then'](handleEntityNotFound(_0x1d0926,null))['then'](function(_0x31fa13){if(_0x31fa13){_0x322086['list']=_[_0xb361('0x9d')](_0x31fa13,[_0xb361('0x9b')]);if(_0x31fa13[_0xb361('0x9b')]['length']){return _0x31fa13[_0xb361('0x9b')][0x0];}var _0x280f23=_[_0xb361('0x9e')](_0x322086['body'],{'firstName':_0x322086[_0xb361('0x58')]['from'],'ListId':_0x31fa13['id']});_0x280f23[_0x322086[_0xb361('0x58')][_0xb361('0x96')]]=_0x322086[_0xb361('0x58')]['from'];return db[_0xb361('0x76')][_0xb361('0x5f')](_0x280f23,{'fields':_0x49e530,'raw':!![]});}})[_0xb361('0x1c')](handleEntityNotFound(_0x1d0926,null))['then'](function(_0x57a601){if(_0x57a601){_0x322086[_0xb361('0x9f')]=_0x57a601;var _0x48338f={'ContactId':_0x57a601['id'],'phone':_0x322086[_0xb361('0x58')][_0xb361('0x7c')],'SmsAccountId':_0x3d65af[_0xb361('0x61')]['id']};var _0x8c4d={'ContactId':_0x57a601['id'],'SmsAccountId':_0x3d65af[_0xb361('0x61')]['id'],'closed':![]};return db[_0xb361('0xa0')][_0xb361('0x5d')]({'where':_0x8c4d})[_0xb361('0x1c')](function(_0x54348e){if(_0x54348e){return[_0x54348e,![]];}return db[_0xb361('0xa0')][_0xb361('0x5f')](_0x48338f)[_0xb361('0x1c')](function(_0x5d4092){return[_0x5d4092,!![]];});});}})[_0xb361('0xa1')](function(_0xd0a910,_0x2ba6ae){_0x322086[_0xb361('0xa2')]=_0xd0a910[_0xb361('0x34')]({'plain':!![]});_0x322086['interaction'][_0xb361('0xa3')]=![];if(_0x2ba6ae){if(_0x322086[_0xb361('0x72')][_0xb361('0xa4')]){_0x322086[_0xb361('0xa5')]['push']({'id':0x0,'priority':_0x322086[_0xb361('0xa5')][_0xb361('0x47')]+0x1,'app':_0xb361('0xa6'),'appdata':'unmanaged','interval':_0xb361('0xa7')});}_0x322086['interaction'][_0xb361('0xa3')]=!![];}return db[_0xb361('0xa8')]['create']({'phone':_0x322086['body']['from'],'messageId':_0x322086['body'][_0xb361('0x7f')],'body':_0x322086[_0xb361('0x58')][_0xb361('0x58')],'SmsAccountId':_0x3d65af[_0xb361('0x61')]['id'],'SmsInteractionId':_0xd0a910['id'],'direction':'in','ContactId':_0xd0a910[_0xb361('0xa9')],'AttachmentId':_0x322086['body'][_0xb361('0xaa')]});})['then'](function(_0x39b844){_0x322086[_0xb361('0x23')]=_0x39b844;if(_0x322086['interaction']['UserId']){return db[_0xb361('0xab')][_0xb361('0x5d')]({'attributes':['id',_0xb361('0x37')],'where':{'id':_0x322086[_0xb361('0xa2')][_0xb361('0xac')]}})[_0xb361('0x1c')](function(_0xa47202){if(_0xa47202){_0x322086[_0xb361('0xa5')][_0xb361('0xad')]({'id':0x0,'priority':0x0,'app':_0xb361('0xae'),'appdata':_0xa47202[_0xb361('0x37')]+','+(_0x322086['account'][_0xb361('0xaf')]||0xa),'interval':_0xb361('0xa7')});}return respondWithRpcPromise(_0xb361('0xb0'),'startRouting',_0x322086);});}return respondWithRpcPromise(_0xb361('0xb0'),_0xb361('0xb1'),_0x322086);})[_0xb361('0x1c')](function(_0x3f5c6b){if(_0x3f5c6b){var _0x255930=0xc8;var _0x119b9f='receiveMessage';logger[_0xb361('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x119b9f,_0x255930,_0xb361('0xb2'));logger[_0xb361('0x1e')](_0xb361('0xb3'),_0x119b9f,_0x255930,_0xb361('0xb2'),JSON[_0xb361('0x20')](_0x3f5c6b));if(_0x322086['account'][_0xb361('0x3e')]===_0xb361('0xb4')){return _0x1d0926['status'](_0x255930)['set'](_0xb361('0xb5'),_0xb361('0xb6'))[_0xb361('0x38')](_0xb361('0xb7'));}else{return _0x1d0926['status'](_0x255930)[_0xb361('0x28')](_0x3f5c6b);}}})[_0xb361('0x25')](handleError(_0x1d0926,null));};exports[_0xb361('0xb8')]=function(_0x505b44,_0x4818c9,_0x2e7eac){return db[_0xb361('0x51')][_0xb361('0x66')]({'where':{'id':_0x505b44[_0xb361('0x61')]['id']}})['then'](handleEntityNotFound(_0x4818c9,null))[_0xb361('0x1c')](function(_0x4607bc){if(_0x4607bc){return db[_0xb361('0xb9')][_0xb361('0xba')](function(_0x3bfafd){return db['SmsApplication'][_0xb361('0x33')]({'where':{'SmsAccountId':_0x505b44[_0xb361('0x61')]['id']},'transaction':_0x3bfafd})['then'](function(_0x5bc329){var _0x8d63c6=_[_0xb361('0x40')](_0x505b44[_0xb361('0x58')],function(_0xfa161d){_0xfa161d[_0xb361('0x64')]=_0x505b44[_0xb361('0x61')]['id'];return _0xfa161d;});return db[_0xb361('0x70')][_0xb361('0xbb')](_0x8d63c6,{'transaction':_0x3bfafd});});})[_0xb361('0x1c')](function(){return db[_0xb361('0x70')][_0xb361('0xbc')]({'where':{'SmsAccountId':_0x505b44[_0xb361('0x61')]['id']},'order':_0xb361('0x74')});});}})[_0xb361('0x1c')](respondWithResult(_0x4818c9,null))[_0xb361('0x25')](handleError(_0x4818c9,null));};exports[_0xb361('0xbd')]=function(_0x5421f,_0xd9d195,_0x14151f){var _0xff6eab={};var _0x468e6d={};var _0x1bc7fe;var _0x27cb91;return db[_0xb361('0x51')][_0xb361('0x66')]({'where':{'id':_0x5421f[_0xb361('0x61')]['id']}})['then'](handleEntityNotFound(_0xd9d195,null))[_0xb361('0x1c')](function(_0x3ff03d){if(_0x3ff03d){_0x1bc7fe=_0x3ff03d;_0x468e6d['model']=_[_0xb361('0x41')](db[_0xb361('0x70')][_0xb361('0x3c')]);_0x468e6d[_0xb361('0x42')]=_[_0xb361('0x41')](_0x5421f[_0xb361('0x42')]);_0x468e6d[_0xb361('0x43')]=_[_0xb361('0x44')](_0x468e6d[_0xb361('0x45')],_0x468e6d[_0xb361('0x42')]);_0xff6eab[_0xb361('0x46')]=_[_0xb361('0x44')](_0x468e6d[_0xb361('0x45')],qs[_0xb361('0x57')](_0x5421f['query'][_0xb361('0x57')]));_0xff6eab['attributes']=_0xff6eab['attributes'][_0xb361('0x47')]?_0xff6eab[_0xb361('0x46')]:_0x468e6d[_0xb361('0x45')];_0xff6eab[_0xb361('0x67')]=qs[_0xb361('0x4a')](_0x5421f[_0xb361('0x42')][_0xb361('0x4a')]);_0xff6eab[_0xb361('0x4b')]=qs[_0xb361('0x43')](_[_0xb361('0x4c')](_0x5421f[_0xb361('0x42')],_0x468e6d[_0xb361('0x43')]));if(_0x5421f[_0xb361('0x42')][_0xb361('0x4d')]){_0xff6eab[_0xb361('0x4b')]=_[_0xb361('0x4f')](_0xff6eab[_0xb361('0x4b')],{'$or':_[_0xb361('0x40')](_0xff6eab[_0xb361('0x46')],function(_0x5d98d5){var _0x549eaa={};_0x549eaa[_0x5d98d5]={'$like':'%'+_0x5421f['query'][_0xb361('0x4d')]+'%'};return _0x549eaa;})});}_0xff6eab=_[_0xb361('0x4f')]({},_0xff6eab,_0x5421f['options']);return _0x1bc7fe['getApplications'](_0xff6eab);}})[_0xb361('0x1c')](function(_0x417fdb){if(_0x417fdb){_0x27cb91=_0x417fdb[_0xb361('0x47')];if(!_0x5421f[_0xb361('0x42')][_0xb361('0x48')](_0xb361('0x49'))){_0xff6eab[_0xb361('0x2b')]=qs['limit'](_0x5421f['query'][_0xb361('0x2b')]);_0xff6eab[_0xb361('0x29')]=qs['offset'](_0x5421f['query']['offset']);}return _0x1bc7fe[_0xb361('0xbd')](_0xff6eab);}})[_0xb361('0x1c')](function(_0x3b81f3){if(_0x3b81f3){return _0x3b81f3?{'count':_0x27cb91,'rows':_0x3b81f3}:null;}})[_0xb361('0x1c')](respondWithResult(_0xd9d195,null))[_0xb361('0x25')](handleError(_0xd9d195,null));};exports[_0xb361('0xbe')]=function(_0x225e08,_0x47a60e,_0x5da711){var _0xbd3efe={'raw':![],'where':{}};var _0x5958b2={};var _0x5a6bb0={'count':0x0,'rows':[]};return db[_0xb361('0x51')][_0xb361('0x66')]({'where':{'id':_0x225e08[_0xb361('0x61')]['id']}})['then'](handleEntityNotFound(_0x47a60e,null))['then'](function(_0x1d5790){if(_0x1d5790){_0x5958b2['model']=_[_0xb361('0x41')](db['SmsInteraction'][_0xb361('0x3c')]);_0x5958b2[_0xb361('0x42')]=_['keys'](_0x225e08[_0xb361('0x42')]);_0x5958b2[_0xb361('0x43')]=_['intersection'](_0x5958b2[_0xb361('0x45')],_0x5958b2[_0xb361('0x42')]);_0xbd3efe['attributes']=_[_0xb361('0x44')](_0x5958b2['model'],qs[_0xb361('0x57')](_0x225e08[_0xb361('0x42')]['fields']));_0xbd3efe[_0xb361('0x46')]=_0xbd3efe['attributes'][_0xb361('0x47')]?_0xbd3efe['attributes']:_0x5958b2[_0xb361('0x45')];if(!_0x225e08['query']['hasOwnProperty'](_0xb361('0x49'))){_0xbd3efe[_0xb361('0x2b')]=qs[_0xb361('0x2b')](_0x225e08[_0xb361('0x42')][_0xb361('0x2b')]);_0xbd3efe[_0xb361('0x29')]=qs[_0xb361('0x29')](_0x225e08['query'][_0xb361('0x29')]);}_0xbd3efe[_0xb361('0x67')]=qs[_0xb361('0x4a')](_0x225e08[_0xb361('0x42')][_0xb361('0x4a')]);_0xbd3efe[_0xb361('0x4b')]=qs[_0xb361('0x43')](_[_0xb361('0x4c')](_0x225e08[_0xb361('0x42')],_0x5958b2[_0xb361('0x43')]));_0xbd3efe[_0xb361('0x4b')][_0xb361('0x64')]=_0x1d5790['id'];if(_0x225e08[_0xb361('0x42')][_0xb361('0x4d')]){_0xbd3efe[_0xb361('0x4b')]=_[_0xb361('0x4f')](_0xbd3efe[_0xb361('0x4b')],{'$or':_['map'](_0xbd3efe['attributes'],function(_0x449dd4){var _0x17dce1={};_0x17dce1[_0x449dd4]={'$like':'%'+_0x225e08[_0xb361('0x42')][_0xb361('0x4d')]+'%'};return _0x17dce1;})});}_0xbd3efe=_['merge']({},_0xbd3efe,_0x225e08[_0xb361('0x50')]);return db['SmsInteraction'][_0xb361('0x2c')]({'where':_0xbd3efe['where']})[_0xb361('0x1c')](function(_0x4d142b){_0x5a6bb0[_0xb361('0x2c')]=_0x4d142b;if(_0x225e08[_0xb361('0x42')][_0xb361('0x52')]){_0xbd3efe[_0xb361('0x53')]=[{'model':db[_0xb361('0x76')],'as':_0xb361('0xbf'),'required':![]},{'model':db[_0xb361('0xab')],'as':_0xb361('0xc0'),'attributes':[_0xb361('0x37'),_0xb361('0xc1'),_0xb361('0xc2')],'required':![]},{'model':db[_0xb361('0xc3')],'as':'Tags','attributes':['id',_0xb361('0x37'),_0xb361('0xc4')],'where':_0x225e08['query'][_0xb361('0xc5')]?{'id':_0x225e08[_0xb361('0x42')][_0xb361('0xc5')]}:undefined,'required':_0x225e08[_0xb361('0x42')][_0xb361('0xc5')]?!![]:![]}];}return db[_0xb361('0xa0')][_0xb361('0x54')](_0xbd3efe);})[_0xb361('0x1c')](function(_0x2e039d){_0x5a6bb0[_0xb361('0x55')]=_0x2e039d;return _0x5a6bb0;});}})[_0xb361('0x1c')](respondWithFilteredResult(_0x47a60e,_0xbd3efe))[_0xb361('0x25')](handleError(_0x47a60e,null));};exports['send']=function(_0xc450e1,_0x4503cf,_0x286c70){var _0x440959,_0x273c90,_0x1163d8;if(_[_0xb361('0x93')](_0xc450e1[_0xb361('0x58')][_0xb361('0x58')])||_0xc450e1[_0xb361('0x58')][_0xb361('0x58')]===''){throw new db[(_0xb361('0x77'))][(_0xb361('0x78'))](_0xb361('0x95'));}if(_[_0xb361('0x93')](_0xc450e1[_0xb361('0x58')]['to'])){throw new db[(_0xb361('0x77'))]['ValidationError'](_0xb361('0xc6'));}_0x440959=_0xc450e1[_0xb361('0x58')]['to'];return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0xc450e1[_0xb361('0x61')]['id']},'include':[{'model':db[_0xb361('0x99')],'as':_0xb361('0xc7'),'include':[{'model':db['CmContact'],'as':_0xb361('0x9b'),'where':{'mobile':_0x440959},'limit':0x1,'order':[['updatedAt',_0xb361('0x9c')]]}]}]})['then'](handleEntityNotFound(_0x4503cf,null))[_0xb361('0x1c')](function(_0x3f76df){if(_0x3f76df&&_0x3f76df[_0xb361('0xc7')]){_0x273c90=_0x3f76df[_0xb361('0x34')]({'plain':!![]});if(_0x273c90[_0xb361('0xc7')]&&_0x273c90['List'][_0xb361('0x9b')][_0xb361('0x47')]){return _0x273c90[_0xb361('0xc7')][_0xb361('0x9b')][0x0];}return db[_0xb361('0x76')][_0xb361('0x5f')](_[_0xb361('0x9e')](_0xc450e1[_0xb361('0x58')],{'firstName':_0x440959,'mobile':_0x440959,'phone':_0x440959,'ListId':_0x273c90[_0xb361('0x9a')]}));}})['then'](handleEntityNotFound(_0x4503cf,null))[_0xb361('0x1c')](function(_0x4a89d1){if(_0x4a89d1){_0x1163d8=_0x4a89d1;return db[_0xb361('0xa0')][_0xb361('0x5d')]({'where':{'ContactId':_0x1163d8['id'],'closed':![],'SmsAccountId':_0x273c90['id']}})[_0xb361('0x1c')](function(_0x44a984){if(_0x44a984){return[_0x44a984,![]];}return db[_0xb361('0xa0')][_0xb361('0x5f')]({'UserId':_0xc450e1[_0xb361('0x59')]['id'],'ContactId':_0x1163d8['id'],'SmsAccountId':_0x273c90['id'],'phone':_0x440959,'firstMsgDirection':_0xb361('0xc8'),'Messages':[_[_0xb361('0x4f')](_0xc450e1[_0xb361('0x58')],{'read':![],'body':_0xc450e1[_0xb361('0x58')]['body'],'phone':_0x440959,'SmsAccountId':_0x273c90['id'],'UserId':_0xc450e1[_0xb361('0x59')]['id'],'ContactId':_0x1163d8['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0xb361('0xc9')}]})[_0xb361('0x1c')](function(_0xad7669){return[_0xad7669,!![]];});});}})[_0xb361('0xa1')](function(_0x80d088,_0x62e2fc){if(_0x62e2fc){return _0x80d088;}return db[_0xb361('0xa8')][_0xb361('0x5f')](_[_0xb361('0x4f')](_0xc450e1['body'],{'read':![],'body':_0xc450e1[_0xb361('0x58')]['body'],'phone':_0x440959,'SmsAccountId':_0x273c90['id'],'SmsInteractionId':_0x80d088['id'],'UserId':_0xc450e1['user']['id'],'ContactId':_0x1163d8['id']}))[_0xb361('0x1c')](function(_0x65922){_0x80d088['dataValues']['Messages']=[];_0x80d088[_0xb361('0xca')][_0xb361('0xc9')][_0xb361('0xcb')](_0x65922[_0xb361('0xca')]);return _0x80d088;});})[_0xb361('0x1c')](respondWithResult(_0x4503cf,null))['catch'](handleError(_0x4503cf,null));};exports[_0xb361('0x2d')]=function(_0x12ab1d,_0x3ad8c5,_0x26e76b){if(_0x12ab1d[_0xb361('0x58')]['id']){delete _0x12ab1d[_0xb361('0x58')]['id'];}var _0x26bc94,_0x3b8aa4,_0x5898c8;return db[_0xb361('0x51')]['find']({'where':{'id':_0x12ab1d['params']['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x3ad8c5,null))[_0xb361('0x1c')](function(_0xa01824){if(_0xa01824){_0x5898c8=_0xa01824;logger[_0xb361('0x1e')](_0xb361('0xcc'),_0xb361('0x2d'),_0xb361('0xcd'),_0xa01824[_0xb361('0x3e')],util[_0xb361('0xce')](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));switch(_0xa01824[_0xb361('0x3e')]){case _0xb361('0x80'):if(_0x12ab1d['body'][_0xb361('0xcf')]&&_0x12ab1d[_0xb361('0x58')][_0xb361('0x2d')]){_0x3b8aa4=_0x12ab1d[_0xb361('0x58')][_0xb361('0x2d')];return db[_0xb361('0xa8')][_0xb361('0x5d')]({'where':{'messageId':_0x12ab1d['body'][_0xb361('0xcf')]}});}break;case _0xb361('0x82'):if(_0x12ab1d[_0xb361('0x58')][_0xb361('0xd0')]&&_0x12ab1d[_0xb361('0x58')][_0xb361('0xd1')]){_0x3b8aa4=_0x12ab1d[_0xb361('0x58')][_0xb361('0xd1')];return db['SmsMessage'][_0xb361('0x5d')]({'where':{'messageId':_0x12ab1d[_0xb361('0x58')][_0xb361('0xd0')]}});}break;case'clicksend':if(_0x12ab1d[_0xb361('0x58')][_0xb361('0x84')]&&_0x12ab1d[_0xb361('0x58')][_0xb361('0xd2')]){_0x3b8aa4=_0x12ab1d[_0xb361('0x58')][_0xb361('0xd2')];return db['SmsMessage'][_0xb361('0x5d')]({'where':{'messageId':_0x12ab1d[_0xb361('0x58')][_0xb361('0x84')]}});}break;case'infobip':var _0x29f13e=_0x12ab1d[_0xb361('0x58')][_0xb361('0x89')][0x0];if(_0x29f13e[_0xb361('0x7f')]&&_0x29f13e[_0xb361('0x2d')][_0xb361('0xd3')]===_0xb361('0xd4')){_0x3b8aa4=_0x29f13e[_0xb361('0x2d')]['groupName'];return db[_0xb361('0xa8')]['find']({'where':{'messageId':_0x29f13e['messageId']}});}break;case'clickatell':if(_0x12ab1d[_0xb361('0x58')]['messageId']&&_0x12ab1d[_0xb361('0x58')][_0xb361('0x2d')]){_0x3b8aa4=_0x12ab1d[_0xb361('0x58')][_0xb361('0x2d')];return db[_0xb361('0xa8')][_0xb361('0x5d')]({'where':{'messageId':_0x12ab1d[_0xb361('0x58')][_0xb361('0x7f')]}});}break;case _0xb361('0x90'):if(_0x12ab1d[_0xb361('0x58')][0x0][_0xb361('0x23')]['id']){_0x3b8aa4=_0x12ab1d['body'][0x0][_0xb361('0x3e')];return db['SmsMessage'][_0xb361('0x5d')]({'where':{'messageId':_0x12ab1d[_0xb361('0x58')][0x0][_0xb361('0x23')]['id']}});}break;case'intelepeer':if(_0x12ab1d[_0xb361('0x58')][_0xb361('0xd5')]&&_0x12ab1d[_0xb361('0x58')][_0xb361('0x2d')]){_0x3b8aa4=_0x12ab1d['body'][_0xb361('0x2d')];return db[_0xb361('0xa8')][_0xb361('0x5d')]({'where':{'messageId':_0x12ab1d['body']['redif']}});}break;}}})[_0xb361('0x1c')](handleEntityNotFound(_0x3ad8c5,null))[_0xb361('0x1c')](function(_0x32f80c){if(_0x32f80c){_0x26bc94=_0x32f80c;switch(_0x5898c8['type']){case _0xb361('0x80'):if(_0x3b8aa4===_0xb361('0xd4')){return _0x26bc94['update']({'read':!![]});}else{logger[_0xb361('0x21')](_0xb361('0xcc'),_0xb361('0x2d'),_0xb361('0x80'),util[_0xb361('0xce')](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb361('0x82'):if(_0x3b8aa4==='1'){return _0x26bc94[_0xb361('0x32')]({'read':!![]});}else{logger[_0xb361('0x21')](_0xb361('0xcc'),_0xb361('0x2d'),_0xb361('0x80'),util[_0xb361('0xce')](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb361('0x83'):if(!_0x12ab1d['body']['error_code']&&_0x3b8aa4>=0xc8&&_0x3b8aa4<=0xce){return _0x26bc94[_0xb361('0x32')]({'read':!![]});}else{logger[_0xb361('0x21')](_0xb361('0xcc'),_0xb361('0x2d'),_0xb361('0x83'),util['inspect'](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x160d63=_0x12ab1d['body'][_0xb361('0x89')][0x0];if(_0x160d63['status'][_0xb361('0xd3')]===_0xb361('0xd4')){return _0x26bc94[_0xb361('0x32')]({'read':!![]});}else{logger[_0xb361('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb361('0x2d'),_0xb361('0x88'),util[_0xb361('0xce')](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x3b8aa4==_0xb361('0xd6')||_0x3b8aa4==_0xb361('0xd7')){return _0x26bc94[_0xb361('0x32')]({'read':!![]});}else{logger[_0xb361('0x21')](_0xb361('0xcc'),'status','clickatell',util[_0xb361('0xce')](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3b8aa4==_0xb361('0xd8')){return _0x26bc94[_0xb361('0x32')]({'read':!![]});}else{logger[_0xb361('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb361('0x2d'),_0xb361('0x90'),util[_0xb361('0xce')](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb361('0x91'):if(_0x3b8aa4===_0xb361('0xd9')||_0x3b8aa4===_0xb361('0xda')){return _0x26bc94['update']({'read':!![]});}else{logger[_0xb361('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xb361('0x91'),util['inspect'](_0x12ab1d[_0xb361('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x26bc94;}})[_0xb361('0x1c')](respondWithResult(_0x3ad8c5,null))[_0xb361('0x25')](handleError(_0x3ad8c5,null));};exports['statusGet']=function(_0x161d37,_0x5a43a9,_0x1f5f8e){var _0x3df258,_0x35cf0a,_0x2c0b4a;return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x161d37['params']['id']}})['then'](handleEntityNotFound(_0x5a43a9,null))[_0xb361('0x1c')](function(_0x3aad11){if(_0x3aad11){_0x2c0b4a=_0x3aad11;logger['debug'](_0xb361('0xcc'),_0xb361('0x2d'),_0xb361('0xcd'),_0x3aad11[_0xb361('0x3e')],util[_0xb361('0xce')](_0x161d37['query'],{'showHidden':![],'depth':null}));switch(_0x3aad11['type']){case _0xb361('0x8a'):if(_0x161d37[_0xb361('0x42')][_0xb361('0xdb')]&&_0x161d37[_0xb361('0x42')][_0xb361('0xdc')]){_0x35cf0a=_0x161d37[_0xb361('0x42')]['state'];return db['SmsMessage'][_0xb361('0x5d')]({'where':{'messageId':_0x161d37[_0xb361('0x42')][_0xb361('0xdb')]}});}break;}}})[_0xb361('0x1c')](handleEntityNotFound(_0x5a43a9,null))[_0xb361('0x1c')](function(_0x1432e2){if(_0x1432e2){_0x3df258=_0x1432e2;switch(_0x2c0b4a[_0xb361('0x3e')]){case _0xb361('0x8a'):if(_0x35cf0a==='2'||_0x35cf0a==='6'){return _0x3df258[_0xb361('0x32')]({'read':!![]});}else{logger[_0xb361('0x21')](_0xb361('0xcc'),_0xb361('0x2d'),_0xb361('0x8a'),util['inspect'](_0x161d37[_0xb361('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x3df258;}})[_0xb361('0x1c')](respondWithResult(_0x5a43a9,null))[_0xb361('0x25')](handleError(_0x5a43a9,null));};exports[_0xb361('0xdd')]=function(_0x5222aa,_0xec7805,_0x1df2c2){return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x5222aa[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0xec7805,null))[_0xb361('0x1c')](function(_0x1007f4){if(_0x1007f4){return _0x1007f4[_0xb361('0xdd')](_0x5222aa[_0xb361('0x58')][_0xb361('0x69')],_[_0xb361('0x9d')](_0x5222aa[_0xb361('0x58')],[_0xb361('0x69'),'id'])||{})['spread'](function(_0x6d7a60){for(var _0x2b7434=0x0;_0x2b7434<_0x5222aa[_0xb361('0x58')][_0xb361('0x69')]['length'];_0x2b7434+=0x1){socket[_0xb361('0xde')](_0xb361('0xdf'),{'UserId':Number(_0x5222aa[_0xb361('0x58')]['ids'][_0x2b7434]),'SmsAccountId':Number(_0x5222aa[_0xb361('0x61')]['id'])});}return _0x6d7a60;});}})[_0xb361('0x1c')](respondWithResult(_0xec7805,null))[_0xb361('0x25')](handleError(_0xec7805,null));};exports[_0xb361('0xe0')]=function(_0x2b36ff,_0x40b2a3,_0x733faf){return db[_0xb361('0x51')][_0xb361('0x5d')]({'where':{'id':_0x2b36ff[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x40b2a3,null))['then'](function(_0x4f6a25){if(_0x4f6a25){return _0x4f6a25[_0xb361('0xe0')](_0x2b36ff[_0xb361('0x42')][_0xb361('0x69')])[_0xb361('0x1c')](function(){if(_['isArray'](_0x2b36ff[_0xb361('0x42')]['ids'])){for(var _0x4a6682=0x0;_0x4a6682<_0x2b36ff[_0xb361('0x42')]['ids']['length'];_0x4a6682+=0x1){socket[_0xb361('0xde')](_0xb361('0xe1'),{'UserId':Number(_0x2b36ff[_0xb361('0x42')][_0xb361('0x69')][_0x4a6682]),'SmsAccountId':Number(_0x2b36ff[_0xb361('0x61')]['id'])});}}else{socket[_0xb361('0xde')](_0xb361('0xe1'),{'UserId':Number(_0x2b36ff[_0xb361('0x42')][_0xb361('0x69')]),'SmsAccountId':Number(_0x2b36ff[_0xb361('0x61')]['id'])});}});}})[_0xb361('0x1c')](respondWithStatusCode(_0x40b2a3,null))['catch'](handleError(_0x40b2a3,null));};exports['getAgents']=function(_0x570216,_0x1976dc,_0x46ec25){var _0x189d7f={};var _0x416b48={};var _0x31959a;var _0x429331;return db['SmsAccount'][_0xb361('0x66')]({'where':{'id':_0x570216[_0xb361('0x61')]['id']}})[_0xb361('0x1c')](handleEntityNotFound(_0x1976dc,null))['then'](function(_0x440b7a){if(_0x440b7a){_0x31959a=_0x440b7a;_0x416b48[_0xb361('0x45')]=_[_0xb361('0x41')](db[_0xb361('0xab')][_0xb361('0x3c')]);_0x416b48[_0xb361('0x42')]=_[_0xb361('0x41')](_0x570216[_0xb361('0x42')]);_0x416b48[_0xb361('0x43')]=_[_0xb361('0x44')](_0x416b48['model'],_0x416b48[_0xb361('0x42')]);_0x189d7f[_0xb361('0x46')]=_[_0xb361('0x44')](_0x416b48[_0xb361('0x45')],qs[_0xb361('0x57')](_0x570216[_0xb361('0x42')][_0xb361('0x57')]));_0x189d7f['attributes']=_0x189d7f[_0xb361('0x46')][_0xb361('0x47')]?_0x189d7f['attributes']:_0x416b48[_0xb361('0x45')];_0x189d7f[_0xb361('0x67')]=qs[_0xb361('0x4a')](_0x570216[_0xb361('0x42')]['sort']);_0x189d7f[_0xb361('0x4b')]=qs[_0xb361('0x43')](_['pick'](_0x570216[_0xb361('0x42')],_0x416b48[_0xb361('0x43')]));if(_0x570216[_0xb361('0x42')][_0xb361('0x4d')]){_0x189d7f[_0xb361('0x4b')]=_[_0xb361('0x4f')](_0x189d7f[_0xb361('0x4b')],{'$or':_[_0xb361('0x40')](_0x189d7f[_0xb361('0x46')],function(_0x495803){var _0x49dc19={};_0x49dc19[_0x495803]={'$like':'%'+_0x570216[_0xb361('0x42')][_0xb361('0x4d')]+'%'};return _0x49dc19;})});}_0x189d7f=_[_0xb361('0x4f')]({},_0x189d7f,_0x570216['options']);return _0x31959a['getAgents'](_0x189d7f);}})[_0xb361('0x1c')](function(_0x419122){if(_0x419122){_0x429331=_0x419122[_0xb361('0x47')];if(!_0x570216[_0xb361('0x42')][_0xb361('0x48')](_0xb361('0x49'))){_0x189d7f['limit']=qs[_0xb361('0x2b')](_0x570216[_0xb361('0x42')][_0xb361('0x2b')]);_0x189d7f[_0xb361('0x29')]=qs[_0xb361('0x29')](_0x570216[_0xb361('0x42')][_0xb361('0x29')]);}return _0x31959a['getAgents'](_0x189d7f);}})[_0xb361('0x1c')](function(_0x233203){if(_0x233203){return _0x233203?{'count':_0x429331,'rows':_0x233203}:null;}})[_0xb361('0x1c')](respondWithResult(_0x1976dc,null))[_0xb361('0x25')](handleError(_0x1976dc,null));}; \ No newline at end of file +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 diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a828409..58ac331 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 _0x1569=['SmsAccount','setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x1a4a3b,_0x3c1677){var _0x33a831=function(_0x481bf3){while(--_0x481bf3){_0x1a4a3b['push'](_0x1a4a3b['shift']());}};_0x33a831(++_0x3c1677);}(_0x1569,0x1b6));var _0x9156=function(_0x37673e,_0x10c2bc){_0x37673e=_0x37673e-0x0;var _0x438db6=_0x1569[_0x37673e];return _0x438db6;};'use strict';var EventEmitter=require(_0x9156('0x0'));var SmsAccount=require(_0x9156('0x1'))['db'][_0x9156('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9156('0x3')](0x0);var events={'afterCreate':_0x9156('0x4'),'afterUpdate':_0x9156('0x5'),'afterDestroy':_0x9156('0x6')};function emitEvent(_0x3c78fe){return function(_0x4b7e7c,_0x8f549f,_0x56c8a8){SmsAccountEvents[_0x9156('0x7')](_0x3c78fe+':'+_0x4b7e7c['id'],_0x4b7e7c);SmsAccountEvents[_0x9156('0x7')](_0x3c78fe,_0x4b7e7c);_0x56c8a8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x9156('0x8')](e,emitEvent(event));}}module[_0x9156('0x9')]=SmsAccountEvents; \ No newline at end of file +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 diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 9542edc..651c7ce 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 _0x84b3=['rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount','sms_accounts','moment','bluebird','request-promise','path'];(function(_0x58ab22,_0x42c988){var _0x3bedba=function(_0x121f16){while(--_0x121f16){_0x58ab22['push'](_0x58ab22['shift']());}};_0x3bedba(++_0x42c988);}(_0x84b3,0x88));var _0x384b=function(_0x4eeb02,_0x1ba621){_0x4eeb02=_0x4eeb02-0x0;var _0x2f7232=_0x84b3[_0x4eeb02];return _0x2f7232;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x384b('0x0'));var BPromise=require(_0x384b('0x1'));var rp=require(_0x384b('0x2'));var fs=require('fs');var path=require(_0x384b('0x3'));var rimraf=require(_0x384b('0x4'));var config=require(_0x384b('0x5'));var attributes=require(_0x384b('0x6'));module[_0x384b('0x7')]=function(_0x3c3b7b,_0x53bb3d){return _0x3c3b7b['define'](_0x384b('0x8'),attributes,{'tableName':_0x384b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index 15b57c5..444110c 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 _0x981b=['error','code','message','result','catch','ShowSmsAccount','SmsAccount','options','raw','include','map','model','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x29c988,_0x343806){var _0x5c7a31=function(_0x1de412){while(--_0x1de412){_0x29c988['push'](_0x29c988['shift']());}};_0x5c7a31(++_0x343806);}(_0x981b,0x1d3));var _0xb981=function(_0x55160f,_0x3e8090){_0x55160f=_0x55160f-0x0;var _0x43dd52=_0x981b[_0x55160f];return _0x43dd52;};'use strict';var _=require('lodash');var util=require(_0xb981('0x0'));var moment=require(_0xb981('0x1'));var BPromise=require(_0xb981('0x2'));var rs=require(_0xb981('0x3'));var fs=require('fs');var Redis=require(_0xb981('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb981('0x5'));var logger=require(_0xb981('0x6'))(_0xb981('0x7'));var config=require(_0xb981('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb981('0x9')][_0xb981('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb981('0xb')],{'host':_0xb981('0xc'),'port':0x18eb});var socket=require(_0xb981('0xd'))(new Redis(config[_0xb981('0xb')]));require(_0xb981('0xe'))[_0xb981('0xf')](socket);function respondWithRpcPromise(_0xa235cd,_0x50b34c,_0x211634){return new BPromise(function(_0x1ffbab,_0x3b6802){return client[_0xb981('0x10')](_0xa235cd,_0x211634)[_0xb981('0x11')](function(_0x1bb209){logger[_0xb981('0x12')](_0xb981('0x13'),_0x50b34c,_0xb981('0x14'));logger[_0xb981('0x15')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x50b34c,_0xb981('0x14'),JSON[_0xb981('0x16')](_0x1bb209));if(_0x1bb209[_0xb981('0x17')]){if(_0x1bb209[_0xb981('0x17')][_0xb981('0x18')]===0x1f4){logger['error'](_0xb981('0x13'),_0x50b34c,_0x1bb209[_0xb981('0x17')][_0xb981('0x19')]);return _0x3b6802(_0x1bb209[_0xb981('0x17')][_0xb981('0x19')]);}logger[_0xb981('0x17')](_0xb981('0x13'),_0x50b34c,_0x1bb209[_0xb981('0x17')][_0xb981('0x19')]);return _0x1ffbab(_0x1bb209[_0xb981('0x17')][_0xb981('0x19')]);}else{logger['info'](_0xb981('0x13'),_0x50b34c,_0xb981('0x14'));_0x1ffbab(_0x1bb209[_0xb981('0x1a')][_0xb981('0x19')]);}})[_0xb981('0x1b')](function(_0x26d79b){logger[_0xb981('0x17')](_0xb981('0x13'),_0x50b34c,_0x26d79b);_0x3b6802(_0x26d79b);});});}exports[_0xb981('0x1c')]=function(_0x366e2f){var _0x599ba6=this;return new Promise(function(_0x2f77d9,_0x25b3c7){return db[_0xb981('0x1d')]['find']({'raw':_0x366e2f[_0xb981('0x1e')]?_0x366e2f[_0xb981('0x1e')][_0xb981('0x1f')]===undefined?!![]:![]:!![],'where':_0x366e2f[_0xb981('0x1e')]?_0x366e2f[_0xb981('0x1e')]['where']||null:null,'attributes':_0x366e2f[_0xb981('0x1e')]?_0x366e2f[_0xb981('0x1e')]['attributes']||null:null,'include':_0x366e2f[_0xb981('0x1e')]?_0x366e2f['options'][_0xb981('0x20')]?_[_0xb981('0x21')](_0x366e2f[_0xb981('0x1e')][_0xb981('0x20')],function(_0x94b2a2){return{'model':db[_0x94b2a2[_0xb981('0x22')]],'as':_0x94b2a2['as'],'attributes':_0x94b2a2['attributes'],'include':_0x94b2a2['include']?_[_0xb981('0x21')](_0x94b2a2['include'],function(_0x4810cd){return{'model':db[_0x4810cd[_0xb981('0x22')]],'as':_0x4810cd['as'],'attributes':_0x4810cd['attributes'],'include':_0x4810cd[_0xb981('0x20')]?_[_0xb981('0x21')](_0x4810cd[_0xb981('0x20')],function(_0x3b64da){return{'model':db[_0x3b64da[_0xb981('0x22')]],'as':_0x3b64da['as'],'attributes':_0x3b64da['attributes']};}):[]};}):[]};}):[]:[]})[_0xb981('0x11')](function(_0x4d2c1b){logger[_0xb981('0x12')](_0xb981('0x1c'),_0x366e2f);logger[_0xb981('0x15')](_0xb981('0x1c'),_0x366e2f,JSON[_0xb981('0x16')](_0x4d2c1b));_0x2f77d9(_0x4d2c1b);})['catch'](function(_0x10ff37){logger[_0xb981('0x17')]('ShowSmsAccount',_0x10ff37[_0xb981('0x19')],_0x366e2f);_0x25b3c7(_0x599ba6[_0xb981('0x17')](0x1f4,_0x10ff37['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 9e81024..7adc6af 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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_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 diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index c081947..02ab143 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 _0xedd9=['post','create','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x4ad9d1,_0x536dff){var _0x160451=function(_0xdfc490){while(--_0xdfc490){_0x4ad9d1['push'](_0x4ad9d1['shift']());}};_0x160451(++_0x536dff);}(_0xedd9,0xfc));var _0x9edd=function(_0x290a86,_0x39f148){_0x290a86=_0x290a86-0x0;var _0x52354b=_0xedd9[_0x290a86];return _0x52354b;};'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('0xe')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['put'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_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 diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 6c3b99d..81769ef 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 _0x8f88=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8f88,0x105));var _0x88f8=function(_0x4dac5a,_0x37d35b){_0x4dac5a=_0x4dac5a-0x0;var _0x3efaa0=_0x8f88[_0x4dac5a];return _0x3efaa0;};'use strict';var Sequelize=require(_0x88f8('0x0'));module[_0x88f8('0x1')]={'priority':{'type':Sequelize[_0x88f8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x88f8('0x3')],'allowNull':![],'defaultValue':_0x88f8('0x4')},'appdata':{'type':Sequelize[_0x88f8('0x5')]()},'description':{'type':Sequelize[_0x88f8('0x3')]},'interval':{'type':Sequelize[_0x88f8('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +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 diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 4c52a00..e3090b7 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 _0x3b2c=['sendStatus','end','status','json','undefined','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','include','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x56caf4,_0x47973f){var _0x259d3c=function(_0x8f3cf4){while(--_0x8f3cf4){_0x56caf4['push'](_0x56caf4['shift']());}};_0x259d3c(++_0x47973f);}(_0x3b2c,0x1ed));var _0xc3b2=function(_0x22cf8a,_0x25da84){_0x22cf8a=_0x22cf8a-0x0;var _0x34ea4c=_0x3b2c[_0x22cf8a];return _0x34ea4c;};'use strict';var emlformat=require(_0xc3b2('0x0'));var rimraf=require(_0xc3b2('0x1'));var zipdir=require(_0xc3b2('0x2'));var jsonpatch=require(_0xc3b2('0x3'));var rp=require(_0xc3b2('0x4'));var moment=require('moment');var BPromise=require(_0xc3b2('0x5'));var Mustache=require('mustache');var util=require(_0xc3b2('0x6'));var path=require('path');var sox=require(_0xc3b2('0x7'));var csv=require('to-csv');var ejs=require(_0xc3b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc3b2('0x9'));var _=require(_0xc3b2('0xa'));var squel=require(_0xc3b2('0xb'));var crypto=require(_0xc3b2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc3b2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc3b2('0xe'));var Papa=require(_0xc3b2('0xf'));var Redis=require('ioredis');var authService=require(_0xc3b2('0x10'));var qs=require(_0xc3b2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3b2('0x12'));var logger=require(_0xc3b2('0x13'))(_0xc3b2('0x14'));var utils=require(_0xc3b2('0x15'));var config=require(_0xc3b2('0x16'));var licenseUtil=require(_0xc3b2('0x17'));var db=require(_0xc3b2('0x18'))['db'];function respondWithStatusCode(_0x59cf58,_0x4ad0c1){_0x4ad0c1=_0x4ad0c1||0xcc;return function(_0x59e19f){if(_0x59e19f){return _0x59cf58[_0xc3b2('0x19')](_0x4ad0c1);}return _0x59cf58['status'](_0x4ad0c1)[_0xc3b2('0x1a')]();};}function respondWithResult(_0x59e2b7,_0x5b7ce7){_0x5b7ce7=_0x5b7ce7||0xc8;return function(_0x118b85){if(_0x118b85){return _0x59e2b7[_0xc3b2('0x1b')](_0x5b7ce7)[_0xc3b2('0x1c')](_0x118b85);}};}function respondWithFilteredResult(_0x419b7,_0x213165){return function(_0x1aa9d6){if(_0x1aa9d6){var _0x75a755=typeof _0x213165['offset']==='undefined'&&typeof _0x213165['limit']===_0xc3b2('0x1d');var _0x50db6e=_0x1aa9d6[_0xc3b2('0x1e')];var _0x474892=_0x75a755?0x0:_0x213165[_0xc3b2('0x1f')];var _0x1b9095=_0x75a755?_0x1aa9d6[_0xc3b2('0x1e')]:_0x213165[_0xc3b2('0x1f')]+_0x213165['limit'];var _0x5f5d32;if(_0x1b9095>=_0x50db6e){_0x1b9095=_0x50db6e;_0x5f5d32=0xc8;}else{_0x5f5d32=0xce;}_0x419b7['status'](_0x5f5d32);return _0x419b7[_0xc3b2('0x20')]('Content-Range',_0x474892+'-'+_0x1b9095+'/'+_0x50db6e)[_0xc3b2('0x1c')](_0x1aa9d6);}return null;};}function patchUpdates(_0x4f74b0){return function(_0x132433){try{jsonpatch[_0xc3b2('0x21')](_0x132433,_0x4f74b0,!![]);}catch(_0x17dfb0){return BPromise[_0xc3b2('0x22')](_0x17dfb0);}return _0x132433[_0xc3b2('0x23')]();};}function saveUpdates(_0xfd4f7,_0x53cd76){return function(_0x5c2427){if(_0x5c2427){return _0x5c2427[_0xc3b2('0x24')](_0xfd4f7)[_0xc3b2('0x25')](function(_0x102492){return _0x102492;});}return null;};}function removeEntity(_0x4c2107,_0x5c97c1){return function(_0x3471a1){if(_0x3471a1){return _0x3471a1[_0xc3b2('0x26')]()[_0xc3b2('0x25')](function(){_0x4c2107['status'](0xcc)[_0xc3b2('0x1a')]();});}};}function handleEntityNotFound(_0x3894ef,_0x5258a3){return function(_0x3db25f){if(!_0x3db25f){_0x3894ef[_0xc3b2('0x19')](0x194);}return _0x3db25f;};}function handleError(_0x483a39,_0x5a6d6f){_0x5a6d6f=_0x5a6d6f||0x1f4;return function(_0x223041){logger['error'](_0x223041[_0xc3b2('0x27')]);if(_0x223041['name']){delete _0x223041[_0xc3b2('0x28')];}_0x483a39[_0xc3b2('0x1b')](_0x5a6d6f)[_0xc3b2('0x29')](_0x223041);};}exports[_0xc3b2('0x2a')]=function(_0x52e73f,_0x22d80e){var _0xbd65d3={},_0x5895dd={},_0x1d8e8e={'count':0x0,'rows':[]};var _0x24c552=_[_0xc3b2('0x2b')](db[_0xc3b2('0x2c')][_0xc3b2('0x2d')],function(_0x110978){return{'name':_0x110978[_0xc3b2('0x2e')],'type':_0x110978[_0xc3b2('0x2f')][_0xc3b2('0x30')]};});_0x5895dd['model']=_[_0xc3b2('0x2b')](_0x24c552,_0xc3b2('0x28'));_0x5895dd['query']=_[_0xc3b2('0x31')](_0x52e73f[_0xc3b2('0x32')]);_0x5895dd[_0xc3b2('0x33')]=_[_0xc3b2('0x34')](_0x5895dd[_0xc3b2('0x35')],_0x5895dd[_0xc3b2('0x32')]);_0xbd65d3[_0xc3b2('0x36')]=_['intersection'](_0x5895dd['model'],qs[_0xc3b2('0x37')](_0x52e73f[_0xc3b2('0x32')][_0xc3b2('0x37')]));_0xbd65d3[_0xc3b2('0x36')]=_0xbd65d3['attributes'][_0xc3b2('0x38')]?_0xbd65d3[_0xc3b2('0x36')]:_0x5895dd[_0xc3b2('0x35')];if(!_0x52e73f[_0xc3b2('0x32')][_0xc3b2('0x39')](_0xc3b2('0x3a'))){_0xbd65d3[_0xc3b2('0x3b')]=qs['limit'](_0x52e73f['query']['limit']);_0xbd65d3['offset']=qs['offset'](_0x52e73f[_0xc3b2('0x32')][_0xc3b2('0x1f')]);}_0xbd65d3['order']=qs[_0xc3b2('0x3c')](_0x52e73f[_0xc3b2('0x32')][_0xc3b2('0x3c')]);_0xbd65d3[_0xc3b2('0x3d')]=qs[_0xc3b2('0x33')](_[_0xc3b2('0x3e')](_0x52e73f[_0xc3b2('0x32')],_0x5895dd[_0xc3b2('0x33')]),_0x24c552);if(_0x52e73f[_0xc3b2('0x32')][_0xc3b2('0x3f')]){_0xbd65d3[_0xc3b2('0x3d')]=_[_0xc3b2('0x40')](_0xbd65d3[_0xc3b2('0x3d')],{'$or':_['map'](_0x24c552,function(_0x12bc19){if(_0x12bc19[_0xc3b2('0x2f')]!=='VIRTUAL'){var _0x3f95ca={};_0x3f95ca[_0x12bc19[_0xc3b2('0x28')]]={'$like':'%'+_0x52e73f[_0xc3b2('0x32')][_0xc3b2('0x3f')]+'%'};return _0x3f95ca;}})});}_0xbd65d3=_[_0xc3b2('0x40')]({},_0xbd65d3,_0x52e73f['options']);var _0x389525={'where':_0xbd65d3['where']};return db[_0xc3b2('0x2c')]['count'](_0x389525)[_0xc3b2('0x25')](function(_0x5179d1){_0x1d8e8e[_0xc3b2('0x1e')]=_0x5179d1;if(_0x52e73f[_0xc3b2('0x32')]['includeAll']){_0xbd65d3[_0xc3b2('0x41')]=[{'all':!![]}];}return db['SmsApplication'][_0xc3b2('0x42')](_0xbd65d3);})[_0xc3b2('0x25')](function(_0x88bda5){_0x1d8e8e['rows']=_0x88bda5;return _0x1d8e8e;})[_0xc3b2('0x25')](respondWithFilteredResult(_0x22d80e,_0xbd65d3))[_0xc3b2('0x43')](handleError(_0x22d80e,null));};exports[_0xc3b2('0x44')]=function(_0x162f01,_0x55760f){var _0x1457fd={'raw':!![],'where':{'id':_0x162f01[_0xc3b2('0x45')]['id']}},_0x99a688={};_0x99a688[_0xc3b2('0x35')]=_[_0xc3b2('0x31')](db[_0xc3b2('0x2c')][_0xc3b2('0x2d')]);_0x99a688[_0xc3b2('0x32')]=_['keys'](_0x162f01[_0xc3b2('0x32')]);_0x99a688['filters']=_[_0xc3b2('0x34')](_0x99a688[_0xc3b2('0x35')],_0x99a688[_0xc3b2('0x32')]);_0x1457fd[_0xc3b2('0x36')]=_['intersection'](_0x99a688[_0xc3b2('0x35')],qs[_0xc3b2('0x37')](_0x162f01['query'][_0xc3b2('0x37')]));_0x1457fd[_0xc3b2('0x36')]=_0x1457fd[_0xc3b2('0x36')][_0xc3b2('0x38')]?_0x1457fd['attributes']:_0x99a688[_0xc3b2('0x35')];if(_0x162f01[_0xc3b2('0x32')]['includeAll']){_0x1457fd[_0xc3b2('0x41')]=[{'all':!![]}];}_0x1457fd=_[_0xc3b2('0x40')]({},_0x1457fd,_0x162f01[_0xc3b2('0x46')]);return db[_0xc3b2('0x2c')][_0xc3b2('0x47')](_0x1457fd)[_0xc3b2('0x25')](handleEntityNotFound(_0x55760f,null))[_0xc3b2('0x25')](respondWithResult(_0x55760f,null))[_0xc3b2('0x43')](handleError(_0x55760f,null));};exports[_0xc3b2('0x48')]=function(_0x12c7e0,_0x1e73d6){return db[_0xc3b2('0x2c')]['create'](_0x12c7e0[_0xc3b2('0x49')],{})[_0xc3b2('0x25')](respondWithResult(_0x1e73d6,0xc9))[_0xc3b2('0x43')](handleError(_0x1e73d6,null));};exports[_0xc3b2('0x24')]=function(_0x3d5a01,_0x5108c3){if(_0x3d5a01['body']['id']){delete _0x3d5a01[_0xc3b2('0x49')]['id'];}return db[_0xc3b2('0x2c')]['find']({'where':{'id':_0x3d5a01[_0xc3b2('0x45')]['id']}})[_0xc3b2('0x25')](handleEntityNotFound(_0x5108c3,null))[_0xc3b2('0x25')](saveUpdates(_0x3d5a01[_0xc3b2('0x49')],null))[_0xc3b2('0x25')](respondWithResult(_0x5108c3,null))['catch'](handleError(_0x5108c3,null));};exports[_0xc3b2('0x26')]=function(_0x50b1a6,_0x1ad9b4){return db[_0xc3b2('0x2c')]['find']({'where':{'id':_0x50b1a6[_0xc3b2('0x45')]['id']}})[_0xc3b2('0x25')](handleEntityNotFound(_0x1ad9b4,null))[_0xc3b2('0x25')](removeEntity(_0x1ad9b4,null))[_0xc3b2('0x43')](handleError(_0x1ad9b4,null));}; \ No newline at end of file +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 diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index bce2493..3082f97 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 _0x81c2=['sms_applications','utf8mb4','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsApplication'];(function(_0x8a71ba,_0x4a3157){var _0x30efdc=function(_0x3cb10a){while(--_0x3cb10a){_0x8a71ba['push'](_0x8a71ba['shift']());}};_0x30efdc(++_0x4a3157);}(_0x81c2,0xdf));var _0x281c=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0x81c2[_0x11deef];return _0xe9ba85;};'use strict';var _=require(_0x281c('0x0'));var util=require(_0x281c('0x1'));var logger=require('../../config/logger')(_0x281c('0x2'));var moment=require(_0x281c('0x3'));var BPromise=require(_0x281c('0x4'));var rp=require(_0x281c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x281c('0x6'));var config=require(_0x281c('0x7'));var attributes=require('./smsApplication.attributes');module[_0x281c('0x8')]=function(_0x227a27,_0x2e52f7){return _0x227a27[_0x281c('0x9')](_0x281c('0xa'),attributes,{'tableName':_0x281c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x281c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +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 diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 5e026de..15f3bcb 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 _0x0936=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x177e41,_0x3e2b67){var _0x327423=function(_0x5e00a2){while(--_0x5e00a2){_0x177e41['push'](_0x177e41['shift']());}};_0x327423(++_0x3e2b67);}(_0x0936,0xde));var _0x6093=function(_0x17ced7,_0x4e7908){_0x17ced7=_0x17ced7-0x0;var _0xa6f3c=_0x0936[_0x17ced7];return _0xa6f3c;};'use strict';var _=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var moment=require(_0x6093('0x2'));var BPromise=require(_0x6093('0x3'));var rs=require(_0x6093('0x4'));var fs=require('fs');var Redis=require(_0x6093('0x5'));var db=require(_0x6093('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6093('0x7'));var config=require(_0x6093('0x8'));var jayson=require(_0x6093('0x9'));var client=jayson[_0x6093('0xa')][_0x6093('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7d812e,_0x478323,_0x54df66){return new BPromise(function(_0x5280b8,_0x219592){return client[_0x6093('0xc')](_0x7d812e,_0x54df66)[_0x6093('0xd')](function(_0x178aba){logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));logger[_0x6093('0x11')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x478323,'request\x20sent',JSON[_0x6093('0x12')](_0x178aba));if(_0x178aba[_0x6093('0x13')]){if(_0x178aba[_0x6093('0x13')][_0x6093('0x14')]===0x1f4){logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x219592(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}logger[_0x6093('0x13')](_0x6093('0xf'),_0x478323,_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);return _0x5280b8(_0x178aba[_0x6093('0x13')][_0x6093('0x15')]);}else{logger[_0x6093('0xe')](_0x6093('0xf'),_0x478323,_0x6093('0x10'));_0x5280b8(_0x178aba[_0x6093('0x16')][_0x6093('0x15')]);}})[_0x6093('0x17')](function(_0x5c8f2a){logger['error'](_0x6093('0xf'),_0x478323,_0x5c8f2a);_0x219592(_0x5c8f2a);});});} \ No newline at end of file +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 diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index cd34403..33ee9d3 100644 --- a/server/api/smsInteraction/index.js +++ b/server/api/smsInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xefda=['../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2282fa,_0x2bdfe0){var _0x466e22=function(_0x924c52){while(--_0x924c52){_0x2282fa['push'](_0x2282fa['shift']());}};_0x466e22(++_0x2bdfe0);}(_0xefda,0x96));var _0xaefd=function(_0x501069,_0x2203b4){_0x501069=_0x501069-0x0;var _0x468114=_0xefda[_0x501069];return _0x468114;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['describe']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['show']);router['get']('/:id/messages',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0x8')](_0xaefd('0xe'),auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0x10')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0x11')]);router[_0xaefd('0x10')](_0xaefd('0x12'),auth['isAuthenticated'](),controller[_0xaefd('0x13')]);router['post'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),'smsinteraction:addtags'),controller[_0xaefd('0x17')]);router[_0xaefd('0x18')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x19')),controller[_0xaefd('0x1a')]);router['delete'](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x1b')),controller[_0xaefd('0x1c')]);router['delete'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x1d')]);module[_0xaefd('0x1e')]=router; \ No newline at end of file +var _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 diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 4317434..8adb388 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 _0x93bb=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment','exports'];(function(_0x191163,_0x4084ac){var _0x3acac3=function(_0x2e1a8d){while(--_0x2e1a8d){_0x191163['push'](_0x191163['shift']());}};_0x3acac3(++_0x4084ac);}(_0x93bb,0x135));var _0xb93b=function(_0x390c68,_0x2a3cdc){_0x390c68=_0x390c68-0x0;var _0x17ab51=_0x93bb[_0x390c68];return _0x17ab51;};'use strict';var Sequelize=require(_0xb93b('0x0'));var moment=require(_0xb93b('0x1'));module[_0xb93b('0x2')]={'closed':{'type':Sequelize[_0xb93b('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xb93b('0x4')]},'disposition':{'type':Sequelize[_0xb93b('0x5')]},'secondDisposition':{'type':Sequelize[_0xb93b('0x5')]},'thirdDisposition':{'type':Sequelize[_0xb93b('0x5')]},'note':{'type':Sequelize[_0xb93b('0x5')]},'phone':{'type':Sequelize[_0xb93b('0x5')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xb93b('0x6')]('in',_0xb93b('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb93b('0x6')]('in',_0xb93b('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index d146c8a..bf8f765 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 _0x0b0e=['map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','select','field','color','tools_tags','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_messages','sms_interaction_has_tags','expr','parseSearch','sqlOperator','conditions','find','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IN\x20?','sequelize','toString','SmsInteraction','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.lastName','c.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','merge','create','update','destroy','describe','SmsMessage','addMessage','ids','omit','getMessages','rawAttributes','hasOwnProperty','pick','YYYY-MM-DD\x20HH:mm:ss','options','findAll','addTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','root','server','files','tmp','join','format','CmContact','firstName','Messages','secret','read','SmsAccount','Account','Owner','get','mkdirSync','closed','closedAt','disposition','out','System','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Sms','createPdfFromHTML','err','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','end','json','limit','count','offset','apply','reject','then','error','stack','name','send','fullname','TagIds','Tags','split','push','catch','index','fieldName','type','key'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3ff0f0,_0x5523bf){_0x3ff0f0=_0x3ff0f0-0x0;var _0x5dc82a=_0x0b0e[_0x3ff0f0];return _0x5dc82a;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);function respondWithStatusCode(_0x177c24,_0x55d884){_0x55d884=_0x55d884||0xcc;return function(_0x41a7e2){if(_0x41a7e2){return _0x177c24['sendStatus'](_0x55d884);}return _0x177c24[_0xe0b0('0x1e')](_0x55d884)[_0xe0b0('0x1f')]();};}function respondWithResult(_0x519ae8,_0x11fdca){_0x11fdca=_0x11fdca||0xc8;return function(_0x4a4cc0){if(_0x4a4cc0){return _0x519ae8[_0xe0b0('0x1e')](_0x11fdca)[_0xe0b0('0x20')](_0x4a4cc0);}};}function respondWithFilteredResult(_0x56bcc7,_0x54a3eb){return function(_0x46bb44){if(_0x46bb44){var _0x50a441=typeof _0x54a3eb['offset']==='undefined'&&typeof _0x54a3eb[_0xe0b0('0x21')]==='undefined';var _0x52598b=_0x46bb44[_0xe0b0('0x22')];var _0x59dff5=_0x50a441?0x0:_0x54a3eb[_0xe0b0('0x23')];var _0x5dba2f=_0x50a441?_0x46bb44[_0xe0b0('0x22')]:_0x54a3eb[_0xe0b0('0x23')]+_0x54a3eb[_0xe0b0('0x21')];var _0x310a6d;if(_0x5dba2f>=_0x52598b){_0x5dba2f=_0x52598b;_0x310a6d=0xc8;}else{_0x310a6d=0xce;}_0x56bcc7[_0xe0b0('0x1e')](_0x310a6d);return _0x56bcc7['set']('Content-Range',_0x59dff5+'-'+_0x5dba2f+'/'+_0x52598b)[_0xe0b0('0x20')](_0x46bb44);}return null;};}function patchUpdates(_0x5512bb){return function(_0x12b260){try{jsonpatch[_0xe0b0('0x24')](_0x12b260,_0x5512bb,!![]);}catch(_0x513e63){return BPromise[_0xe0b0('0x25')](_0x513e63);}return _0x12b260['save']();};}function saveUpdates(_0x2208d0,_0x49a727){return function(_0x28586d){if(_0x28586d){return _0x28586d['update'](_0x2208d0)[_0xe0b0('0x26')](function(_0x4de537){return _0x4de537;});}return null;};}function removeEntity(_0x4700cc,_0x4aafbe){return function(_0x3c221d){if(_0x3c221d){return _0x3c221d['destroy']()[_0xe0b0('0x26')](function(){_0x4700cc[_0xe0b0('0x1e')](0xcc)[_0xe0b0('0x1f')]();});}};}function handleEntityNotFound(_0x1d91ad,_0x3ec2){return function(_0x10745d){if(!_0x10745d){_0x1d91ad['sendStatus'](0x194);}return _0x10745d;};}function handleError(_0x1444b9,_0x1b8aa8){_0x1b8aa8=_0x1b8aa8||0x1f4;return function(_0x5b7a64){logger[_0xe0b0('0x27')](_0x5b7a64[_0xe0b0('0x28')]);if(_0x5b7a64[_0xe0b0('0x29')]){delete _0x5b7a64[_0xe0b0('0x29')];}_0x1444b9[_0xe0b0('0x1e')](_0x1b8aa8)[_0xe0b0('0x2a')](_0x5b7a64);};}function getInteractionUsers(_0x136bd4,_0x4fb3b7){return new BPromise(function(_0x1854b8,_0x3c0109){try{if(_0x4fb3b7[_0x136bd4['id']]){_0x136bd4['Users']=_['map'](_0x4fb3b7[_0x136bd4['id']],function(_0x158b7f){return{'id':_0x158b7f['id'],'fullname':_0x158b7f[_0xe0b0('0x2b')]};});}}catch(_0x422575){_0x3c0109(_0x422575);}_0x1854b8(_0x136bd4);});}function getInteractionTags(_0x3f81d5,_0x2ab1b1){return new BPromise(function(_0x5866e5,_0x32acfe){try{if(_0x3f81d5[_0xe0b0('0x2c')]){_0x3f81d5[_0xe0b0('0x2d')]=[];_0x3f81d5[_0xe0b0('0x2c')][_0xe0b0('0x2e')](',')['forEach'](function(_0x3ebf2a){_0x3f81d5[_0xe0b0('0x2d')][_0xe0b0('0x2f')](_0x2ab1b1[_0x3ebf2a]);});}delete _0x3f81d5[_0xe0b0('0x2c')];}catch(_0x3575bc){_0x32acfe(_0x3575bc);}_0x5866e5(_0x3f81d5);});}function updateSmsInteraction(_0x12eeb8,_0xf54999,_0x20908f){return new BPromise(function(_0x2125d5,_0x1dd010){return getInteractionUsers(_0x12eeb8,_0x20908f)[_0xe0b0('0x26')](function(_0x1a0c90){return getInteractionTags(_0x1a0c90,_0xf54999);})[_0xe0b0('0x26')](function(_0x2a1c44){_0x2125d5(_0x2a1c44);})[_0xe0b0('0x30')](function(_0x4cf80c){_0x1dd010(_0x4cf80c);});});}exports[_0xe0b0('0x31')]=function(_0x135be5,_0xace58a){var _0x1eb3f9={},_0x1a2d24={},_0x2c6e60={'count':0x0,'rows':[]};var _0x12024d=_['map'](db['SmsInteraction']['rawAttributes'],function(_0x5317df){return{'name':_0x5317df[_0xe0b0('0x32')],'type':_0x5317df[_0xe0b0('0x33')][_0xe0b0('0x34')]};});_0x1a2d24['model']=_[_0xe0b0('0x35')](_0x12024d,_0xe0b0('0x29'));_0x1a2d24[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x135be5['query']);_0x1a2d24[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x1a2d24[_0xe0b0('0x3a')],_0x1a2d24[_0xe0b0('0x36')]);_0x1eb3f9[_0xe0b0('0x3b')]=_[_0xe0b0('0x39')](_0x1a2d24[_0xe0b0('0x3a')],qs[_0xe0b0('0x3c')](_0x135be5[_0xe0b0('0x36')]['fields']));_0x1eb3f9[_0xe0b0('0x3b')]=_0x1eb3f9['attributes'][_0xe0b0('0x3d')]?_0x1eb3f9[_0xe0b0('0x3b')]:_0x1a2d24[_0xe0b0('0x3a')];if(!_0x135be5[_0xe0b0('0x36')]['hasOwnProperty'](_0xe0b0('0x3e'))){_0x1eb3f9[_0xe0b0('0x21')]=qs[_0xe0b0('0x21')](_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x21')]);_0x1eb3f9[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x135be5[_0xe0b0('0x36')]['offset']);}_0x1eb3f9[_0xe0b0('0x3f')]=qs[_0xe0b0('0x40')](_0x135be5['query']['sort']);_0x1eb3f9[_0xe0b0('0x41')]=qs[_0xe0b0('0x38')](_['pick'](_0x135be5[_0xe0b0('0x36')],_0x1a2d24[_0xe0b0('0x38')]),_0x12024d);var _0x6bca5c=[];var _0x1c869d=squel[_0xe0b0('0x42')]()['field']('id')['field']('name')[_0xe0b0('0x43')](_0xe0b0('0x44'))['from'](_0xe0b0('0x45'));var _0x1d897f=squel[_0xe0b0('0x42')]()[_0xe0b0('0x43')](_0xe0b0('0x46'))['field']('u.fullname')[_0xe0b0('0x43')](_0xe0b0('0x47'))[_0xe0b0('0x48')](_0xe0b0('0x49'),'ui')[_0xe0b0('0x4a')]('users','u',_0xe0b0('0x4b'));var _0x11d4fd=squel['select']()['from']('sms_interactions','i')[_0xe0b0('0x4a')](_0xe0b0('0x4c'),'c',_0xe0b0('0x4d'))[_0xe0b0('0x4a')]('users','o',_0xe0b0('0x4e'))[_0xe0b0('0x4a')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0xe0b0('0x4a')](_0xe0b0('0x4f'),'me','me.SmsInteractionId\x20=\x20i.id')[_0xe0b0('0x4a')](_0xe0b0('0x50'),'it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0xe0b0('0x45'),'t','t.id\x20=\x20it.TagId');var _0x165dc8=squel[_0xe0b0('0x51')]();var _0x400c8d=[];var _0x45cc4e=squel[_0xe0b0('0x51')]();var _0xf9e694;if(_0x135be5['query']['search']){_0xf9e694=as[_0xe0b0('0x52')](_0x135be5['query']['search']);var _0x249d9a=_0xf9e694[_0xe0b0('0x53')];for(var _0x54cf7b=0x0;_0x54cf7b<_0xf9e694['conditions'][_0xe0b0('0x3d')];_0x54cf7b++){var _0x10b5a6=_0xf9e694[_0xe0b0('0x54')][_0x54cf7b];var _0x4365d1='i';var _0x1df9e6=_[_0xe0b0('0x55')](_0x12024d,[_0xe0b0('0x29'),_0x10b5a6['field']]);if(!_0x1df9e6){switch(_0x10b5a6[_0xe0b0('0x43')]){case'unreadMessages':if(_0x10b5a6[_0xe0b0('0x56')]==0x1){_0x11d4fd['having']('`'+_0x10b5a6['field']+_0xe0b0('0x57'));}else{_0x11d4fd[_0xe0b0('0x58')]('`'+_0x10b5a6[_0xe0b0('0x43')]+_0xe0b0('0x59'));}break;case _0xe0b0('0x5a'):if(_0x10b5a6[_0xe0b0('0x5b')]===_0xe0b0('0x5c')){if(_0x10b5a6[_0xe0b0('0x56')][_0xe0b0('0x2e')]('\x20')['length']>0x1){_0x165dc8[_0x249d9a](_0xe0b0('0x5d'),qs['getFullTextValue'](_0x10b5a6[_0xe0b0('0x56')]),null);}else{var _0x3ae36e='%'+_0x10b5a6[_0xe0b0('0x56')]+'%';_0x165dc8[_0x249d9a](_0xe0b0('0x5e'),_0x3ae36e,_0x3ae36e,_0x3ae36e);}}else{_0x1df9e6=_[_0xe0b0('0x55')](_0x12024d,[_0xe0b0('0x29'),'ContactId']);_0x10b5a6[_0xe0b0('0x43')]=_0xe0b0('0x5f');_0x30b3ae=as[_0xe0b0('0x60')](_0x4365d1,_0x1df9e6[_0xe0b0('0x33')],_0x10b5a6);_0x165dc8[_0x249d9a](_0x30b3ae[_0xe0b0('0x61')],_0x30b3ae[_0xe0b0('0x56')][_0xe0b0('0x62')],_0x30b3ae[_0xe0b0('0x56')][_0xe0b0('0x1f')]);}break;case _0xe0b0('0x63'):var _0x1eb5d6=_0x10b5a6[_0xe0b0('0x56')][_0xe0b0('0x2e')](',')[_0xe0b0('0x35')](function(_0xcdf97){return Number(_0xcdf97);});_0x1eb5d6[_0xe0b0('0x64')](function(_0x4c7661){_0x45cc4e['or'](_0xe0b0('0x65'),'%,'+_0x4c7661+',%');});_0x400c8d=_['union'](_0x400c8d,_0x1eb5d6);break;case _0xe0b0('0x66'):if(_0x10b5a6[_0xe0b0('0x5b')]===_0xe0b0('0x5c')){_0x165dc8[_0x249d9a](_0xe0b0('0x67'),'%'+_0x10b5a6[_0xe0b0('0x56')]+'%',null);}else{_0x1df9e6=_[_0xe0b0('0x55')](_0x12024d,[_0xe0b0('0x29'),'UserId']);_0x10b5a6['field']=_0xe0b0('0x68');_0x30b3ae=as[_0xe0b0('0x60')](_0x4365d1,_0x1df9e6[_0xe0b0('0x33')],_0x10b5a6);_0x165dc8[_0x249d9a](_0x30b3ae['text'],_0x30b3ae[_0xe0b0('0x56')][_0xe0b0('0x62')],_0x30b3ae[_0xe0b0('0x56')][_0xe0b0('0x1f')]);}break;case _0xe0b0('0x69'):_0x30b3ae=as['buildExpression']('me',null,_0x10b5a6);_0x165dc8[_0x249d9a](_0x30b3ae[_0xe0b0('0x61')],_0x30b3ae[_0xe0b0('0x56')][_0xe0b0('0x62')],_0x30b3ae['value'][_0xe0b0('0x1f')]);break;}}else{var _0x30b3ae=as['buildExpression'](_0x4365d1,_0x1df9e6[_0xe0b0('0x33')],_0x10b5a6);_0x165dc8[_0x249d9a](_0x30b3ae['text'],_0x30b3ae['value'][_0xe0b0('0x62')],_0x30b3ae['value']['end']);}}}else{var _0x416e0c=_(_0x135be5[_0xe0b0('0x36')])[_0xe0b0('0x37')]()[_0xe0b0('0x35')](function(_0x5a7913){return _[_0xe0b0('0x6a')](_0x12024d,[_0xe0b0('0x29'),_0x5a7913])?_0x5a7913:undefined;})[_0xe0b0('0x6b')]()[_0xe0b0('0x56')]();if(!_[_0xe0b0('0x6c')](_0x416e0c)){_0x416e0c[_0xe0b0('0x64')](function(_0xc5e88c){if(_0xc5e88c===_0xe0b0('0x6d')){_0x11d4fd['where']('i.SmsAccountId\x20IN\x20?',[][_0xe0b0('0x6e')](_0x135be5[_0xe0b0('0x36')][_0xc5e88c]));}else if(_0xc5e88c===_0xe0b0('0x6f')){var _0x4c5229=JSON['parse'](_0x135be5[_0xe0b0('0x36')][_0xc5e88c])[_0xe0b0('0x70')];var _0x5d7cf4=JSON['parse'](_0x135be5[_0xe0b0('0x36')][_0xc5e88c])[_0xe0b0('0x71')];_0x11d4fd[_0xe0b0('0x41')](_0xe0b0('0x72'),_0x4c5229,_0x5d7cf4);}else{if(_0x135be5[_0xe0b0('0x36')][_0xc5e88c]===_0xe0b0('0x73')){_0x11d4fd[_0xe0b0('0x41')]('i.'+_0xc5e88c+_0xe0b0('0x74'));}else{_0x11d4fd['where']('i.'+_0xc5e88c+_0xe0b0('0x75'),_0x135be5[_0xe0b0('0x36')][_0xc5e88c]);}}});}if(_0x135be5[_0xe0b0('0x36')]['read']){if(_0x135be5['query']['read']==0x1){_0x11d4fd['having']('`unreadMessages`\x20=\x200');}else{_0x11d4fd['having'](_0xe0b0('0x76'));}}if(_0x135be5['query']['tag']){_0x400c8d=_[_0xe0b0('0x77')](_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x78')])?_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x78')]:new Array(_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x78')]);_0x400c8d[_0xe0b0('0x64')](function(_0x599332){_0x45cc4e['or'](_0xe0b0('0x65'),'%,'+_0x599332+',%');});}if(_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x79')]){var _0x1ec731=_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x79')][_0xe0b0('0x7a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xe0b0('0x7b')](_0x1ec731)){_0x165dc8['or']('i.id\x20LIKE\x20?',_0x1ec731+'%')['or'](_0xe0b0('0x7c'),_0x1ec731+'%');}else{_0x165dc8['or'](_0xe0b0('0x7d'),qs[_0xe0b0('0x7e')](_0x1ec731))['or'](_0xe0b0('0x7f'),_0x1ec731+'%');}}}_0x11d4fd['where'](_0x165dc8);_0x11d4fd[_0xe0b0('0x80')](_0xe0b0('0x81'));var _0x49deef={'type':db['Sequelize'][_0xe0b0('0x82')][_0xe0b0('0x83')],'raw':!![]};var _0x196625=_0x11d4fd[_0xe0b0('0x84')]();_0x196625[_0xe0b0('0x43')](_0xe0b0('0x81'));_0x196625[_0xe0b0('0x43')](_0xe0b0('0x85'),_0xe0b0('0x86'));if(_0x1eb3f9[_0xe0b0('0x3f')]){_0x1eb3f9['order']['forEach'](function(_0xa21370){var _0x4880d5=_0xa21370[0x0]==='contactName'?_0xa21370[0x0]:'i.'+_0xa21370[0x0];_0x11d4fd['order'](_0x4880d5,_0xa21370[0x1]==='DESC'?![]:!![]);});}if(!_[_0xe0b0('0x6c')](_0x400c8d)){_0x11d4fd['having'](_0x45cc4e);_0x196625[_0xe0b0('0x41')](_0xe0b0('0x87'),_0x400c8d);}BPromise[_0xe0b0('0x88')]()[_0xe0b0('0x26')](function(){if(!_0xf9e694){if(_0x135be5['query'][_0xe0b0('0x6d')])return;_0x196625[_0xe0b0('0x41')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x11d4fd[_0xe0b0('0x41')](_0xe0b0('0x89'));return;}if(_0x135be5[_0xe0b0('0x8a')][_0xe0b0('0x8b')]!==_0xe0b0('0x8c'))return;return _0x135be5['user']['getSmsAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x545694){if(_['isEmpty'](_0x545694)){_0x196625[_0xe0b0('0x41')]('i.SmsAccountId\x20IS\x20NULL');_0x11d4fd[_0xe0b0('0x41')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x196625[_0xe0b0('0x41')](_0xe0b0('0x8d'),_[_0xe0b0('0x35')](_0x545694,'id'));_0x11d4fd[_0xe0b0('0x41')](_0xe0b0('0x8d'),_[_0xe0b0('0x35')](_0x545694,'id'));}});})['then'](function(){if(_0x135be5['user']['role']==='agent'&&!_0xf9e694&&!_0x135be5[_0xe0b0('0x36')][_0xe0b0('0x6d')])return[];return db[_0xe0b0('0x8e')][_0xe0b0('0x36')](_0x196625[_0xe0b0('0x8f')](),_0x49deef);})['then'](function(_0x234716){_0x2c6e60[_0xe0b0('0x22')]=_0x234716[_0xe0b0('0x3d')];if(_0x2c6e60[_0xe0b0('0x22')]===0x0)return[];return db[_0xe0b0('0x8e')][_0xe0b0('0x36')](_0x1c869d[_0xe0b0('0x8f')](),_0x49deef)[_0xe0b0('0x26')](function(_0x14f721){_0x6bca5c=_['keyBy'](_0x14f721,'id');_0x49deef=_['merge'](_0x49deef,{'model':db[_0xe0b0('0x90')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x135be5[_0xe0b0('0x36')]['fields']){_0x1eb3f9[_0xe0b0('0x3b')][_0xe0b0('0x64')](function(_0x44c475){_0x11d4fd[_0xe0b0('0x43')]('i.'+_0x44c475);});}else{_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x85'),_0xe0b0('0x86'));_0x11d4fd[_0xe0b0('0x43')]('a.key','Account.key');_0x11d4fd['field'](_0xe0b0('0x91'),_0xe0b0('0x92'));_0x11d4fd['field'](_0xe0b0('0x93'),_0xe0b0('0x94'));_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x95'));_0x11d4fd['field']('c.firstName','Contact.firstName');_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x96'),'Contact.lastName');_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x97'),'Contact.email');_0x11d4fd['field'](_0xe0b0('0x98'),'Contact.phone');_0x11d4fd[_0xe0b0('0x43')]('c.mobile',_0xe0b0('0x99'));_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x9a'),_0xe0b0('0x9b'));_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x9c'),_0xe0b0('0x9d'));_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x9e'),'Owner.internal');_0x11d4fd[_0xe0b0('0x43')](_0xe0b0('0x9f'),_0xe0b0('0x2c'));}if(_0x1eb3f9['limit'])_0x11d4fd[_0xe0b0('0x21')](_0x1eb3f9['limit']);if(_0x1eb3f9[_0xe0b0('0x23')])_0x11d4fd[_0xe0b0('0x23')](_0x1eb3f9['offset']);return db[_0xe0b0('0x8e')]['query'](_0x11d4fd['toString'](),_0x49deef);})[_0xe0b0('0x26')](function(_0x54b57a){if(_0x54b57a['length']>0x0)_0x1d897f[_0xe0b0('0x41')](_0xe0b0('0xa0'),_[_0xe0b0('0x35')](_0x54b57a,'id'));return db[_0xe0b0('0x8e')][_0xe0b0('0x36')](_0x1d897f[_0xe0b0('0x8f')](),_0x49deef)['then'](function(_0x2af9d8){var _0x4609d5=_[_0xe0b0('0xa1')](_0x2af9d8,'SmsInteractionId');var _0x2a4f5d=[];_0x54b57a[_0xe0b0('0x64')](function(_0x5817aa){_0x2a4f5d['push'](updateSmsInteraction(_0x5817aa,_0x6bca5c,_0x4609d5));});return BPromise[_0xe0b0('0xa2')](_0x2a4f5d);});});})['then'](function(_0x46ab89){_0x2c6e60[_0xe0b0('0xa3')]=_0x46ab89;return _0x2c6e60;})[_0xe0b0('0x26')](respondWithFilteredResult(_0xace58a,_0x1eb3f9))[_0xe0b0('0x30')](handleError(_0xace58a,null));};exports[_0xe0b0('0xa4')]=function(_0x333d53,_0x3d70d7){var _0x504483={'raw':![],'where':{'id':_0x333d53[_0xe0b0('0xa5')]['id']}},_0x355edf={};_0x355edf[_0xe0b0('0x3a')]=_[_0xe0b0('0x37')](db[_0xe0b0('0x90')]['rawAttributes']);_0x355edf['query']=_[_0xe0b0('0x37')](_0x333d53[_0xe0b0('0x36')]);_0x355edf[_0xe0b0('0x38')]=_[_0xe0b0('0x39')](_0x355edf[_0xe0b0('0x3a')],_0x355edf[_0xe0b0('0x36')]);_0x504483[_0xe0b0('0x3b')]=_[_0xe0b0('0x39')](_0x355edf[_0xe0b0('0x3a')],qs[_0xe0b0('0x3c')](_0x333d53['query'][_0xe0b0('0x3c')]));_0x504483[_0xe0b0('0x3b')]=_0x504483[_0xe0b0('0x3b')][_0xe0b0('0x3d')]?_0x504483['attributes']:_0x355edf[_0xe0b0('0x3a')];if(_0x333d53[_0xe0b0('0x36')][_0xe0b0('0xa6')]){_0x504483[_0xe0b0('0xa7')]=[{'all':!![]}];}_0x504483=_[_0xe0b0('0xa8')]({},_0x504483,_0x333d53['options']);return db[_0xe0b0('0x90')]['find'](_0x504483)[_0xe0b0('0x26')](handleEntityNotFound(_0x3d70d7,null))[_0xe0b0('0x26')](respondWithResult(_0x3d70d7,null))[_0xe0b0('0x30')](handleError(_0x3d70d7,null));};exports[_0xe0b0('0xa9')]=function(_0x28f3e6,_0x5159b8){return db['SmsInteraction'][_0xe0b0('0xa9')](_0x28f3e6['body'],{})[_0xe0b0('0x26')](respondWithResult(_0x5159b8,0xc9))['catch'](handleError(_0x5159b8,null));};exports[_0xe0b0('0xaa')]=function(_0x474fbb,_0x205c53){if(_0x474fbb[_0xe0b0('0x69')]['id']){delete _0x474fbb[_0xe0b0('0x69')]['id'];}return db[_0xe0b0('0x90')][_0xe0b0('0x55')]({'where':{'id':_0x474fbb['params']['id']}})['then'](handleEntityNotFound(_0x205c53,null))[_0xe0b0('0x26')](saveUpdates(_0x474fbb[_0xe0b0('0x69')],null))[_0xe0b0('0x26')](respondWithResult(_0x205c53,null))[_0xe0b0('0x30')](handleError(_0x205c53,null));};exports[_0xe0b0('0xab')]=function(_0x2b4d49,_0x3b7a7a){return db[_0xe0b0('0x90')][_0xe0b0('0x55')]({'where':{'id':_0x2b4d49[_0xe0b0('0xa5')]['id']}})['then'](handleEntityNotFound(_0x3b7a7a,null))['then'](removeEntity(_0x3b7a7a,null))[_0xe0b0('0x30')](handleError(_0x3b7a7a,null));};exports[_0xe0b0('0xac')]=function(_0x187465,_0x3f9e6b){return db[_0xe0b0('0x90')][_0xe0b0('0xac')]()[_0xe0b0('0x26')](respondWithResult(_0x3f9e6b,null))['catch'](handleError(_0x3f9e6b,null));};exports['addMessage']=function(_0x302f9f,_0x1ea4d5,_0x4437d8){return db[_0xe0b0('0xad')][_0xe0b0('0x55')]({'where':{'id':_0x302f9f[_0xe0b0('0xa5')]['id']}})[_0xe0b0('0x26')](handleEntityNotFound(_0x1ea4d5,null))[_0xe0b0('0x26')](function(_0x6ef3b2){if(_0x6ef3b2){return _0x6ef3b2[_0xe0b0('0xae')](_0x302f9f['body'][_0xe0b0('0xaf')],_[_0xe0b0('0xb0')](_0x302f9f['body'],[_0xe0b0('0xaf'),'id'])||{});}})[_0xe0b0('0x26')](respondWithResult(_0x1ea4d5,null))[_0xe0b0('0x30')](handleError(_0x1ea4d5,null));};exports[_0xe0b0('0xb1')]=function(_0x41fdef,_0x594f91,_0x14a778){var _0x38f9af={'raw':![],'where':{}};var _0x31f4df={};var _0x333697={'count':0x0,'rows':[]};return db[_0xe0b0('0x90')]['findOne']({'where':{'id':_0x41fdef[_0xe0b0('0xa5')]['id']}})['then'](handleEntityNotFound(_0x594f91,null))[_0xe0b0('0x26')](function(_0x42dfa9){if(_0x42dfa9){_0x31f4df[_0xe0b0('0x3a')]=_['keys'](db['SmsMessage'][_0xe0b0('0xb2')]);_0x31f4df[_0xe0b0('0x36')]=_[_0xe0b0('0x37')](_0x41fdef['query']);_0x31f4df['filters']=_['intersection'](_0x31f4df['model'],_0x31f4df['query']);_0x38f9af['attributes']=_[_0xe0b0('0x39')](_0x31f4df[_0xe0b0('0x3a')],qs['fields'](_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0x3c')]));_0x38f9af[_0xe0b0('0x3b')]=_0x38f9af[_0xe0b0('0x3b')][_0xe0b0('0x3d')]?_0x38f9af['attributes']:_0x31f4df['model'];if(!_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0xb3')](_0xe0b0('0x3e'))){_0x38f9af['limit']=qs[_0xe0b0('0x21')](_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0x21')]);_0x38f9af[_0xe0b0('0x23')]=qs[_0xe0b0('0x23')](_0x41fdef[_0xe0b0('0x36')]['offset']);}_0x38f9af['order']=qs['sort'](_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0x40')]);_0x38f9af[_0xe0b0('0x41')]=qs[_0xe0b0('0x38')](_[_0xe0b0('0xb4')](_0x41fdef[_0xe0b0('0x36')],_0x31f4df[_0xe0b0('0x38')]));_0x38f9af[_0xe0b0('0x41')]['SmsInteractionId']=_0x42dfa9['id'];if(_0x41fdef['query'][_0xe0b0('0x79')]){_0x38f9af[_0xe0b0('0x41')]=_[_0xe0b0('0xa8')](_0x38f9af['where'],{'$or':_[_0xe0b0('0x35')](_0x38f9af[_0xe0b0('0x3b')],function(_0x9f1fb){var _0x4949fe={};_0x4949fe[_0x9f1fb]={'$like':'%'+_0x41fdef[_0xe0b0('0x36')]['filter']+'%'};return _0x4949fe;})});}if(_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0x70')]){var _0x1e74a0=_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0x70')][_0xe0b0('0x2e')](',');var _0x12e46f={};_0x12e46f[_0x1e74a0[0x0]]={'$gte':moment(_0x1e74a0[0x1])['format'](_0xe0b0('0xb5'))};_0x38f9af[_0xe0b0('0x41')]=_['merge'](_0x38f9af[_0xe0b0('0x41')],_0x12e46f);}_0x38f9af=_[_0xe0b0('0xa8')]({},_0x38f9af,_0x41fdef[_0xe0b0('0xb6')]);return db['SmsMessage'][_0xe0b0('0x22')]({'where':_0x38f9af[_0xe0b0('0x41')]})[_0xe0b0('0x26')](function(_0x566a6e){_0x333697[_0xe0b0('0x22')]=_0x566a6e;if(_0x41fdef[_0xe0b0('0x36')][_0xe0b0('0xa6')]){_0x38f9af[_0xe0b0('0xa7')]=[{'all':!![]}];}return db[_0xe0b0('0xad')][_0xe0b0('0xb7')](_0x38f9af);})['then'](function(_0x44da91){_0x333697[_0xe0b0('0xa3')]=_0x44da91;return _0x333697;});}})[_0xe0b0('0x26')](respondWithFilteredResult(_0x594f91,_0x38f9af))[_0xe0b0('0x30')](handleError(_0x594f91,null));};exports[_0xe0b0('0xb8')]=function(_0xaca03c,_0x38b2cf,_0x31b01a){return db[_0xe0b0('0x90')][_0xe0b0('0x55')]({'where':{'id':_0xaca03c[_0xe0b0('0xa5')]['id']}})['then'](handleEntityNotFound(_0x38b2cf,null))[_0xe0b0('0x26')](function(_0x51bab6){if(_0x51bab6){return _0x51bab6['setTags'](_0xaca03c[_0xe0b0('0x69')][_0xe0b0('0xaf')],_['omit'](_0xaca03c[_0xe0b0('0x69')],[_0xe0b0('0xaf'),'id'])||{})[_0xe0b0('0xb9')](function(){return db[_0xe0b0('0x63')][_0xe0b0('0xb7')]({'attributes':['id',_0xe0b0('0x29'),_0xe0b0('0x44')],'where':{'id':_0xaca03c[_0xe0b0('0x69')][_0xe0b0('0xaf')]}});})['then'](function(_0x466df0){socket[_0xe0b0('0xba')](_0xe0b0('0xbb'),{'id':Number(_0xaca03c[_0xe0b0('0xa5')]['id']),'tags':_0x466df0||[]});return{'id':Number(_0xaca03c['params']['id']),'tags':_0x466df0||[]};});}})['then'](respondWithResult(_0x38b2cf,null))[_0xe0b0('0x30')](handleError(_0x38b2cf,null));};exports[_0xe0b0('0xbc')]=function(_0x333c2a,_0x2cd7db,_0x308d03){return db[_0xe0b0('0x90')][_0xe0b0('0x55')]({'where':{'id':_0x333c2a[_0xe0b0('0xa5')]['id']}})[_0xe0b0('0x26')](handleEntityNotFound(_0x2cd7db,null))[_0xe0b0('0x26')](function(_0x240a1b){if(_0x240a1b){return _0x240a1b[_0xe0b0('0xbc')](_0x333c2a[_0xe0b0('0x36')][_0xe0b0('0xaf')]);}})[_0xe0b0('0x26')](respondWithStatusCode(_0x2cd7db,null))[_0xe0b0('0x30')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xbd')]=function(_0x261641,_0x344388){var _0x498722=moment()[_0xe0b0('0xbe')]()[_0xe0b0('0x8f')]();var _0x36a006=path['join'](config[_0xe0b0('0xbf')],_0xe0b0('0xc0'),_0xe0b0('0xc1'),_0xe0b0('0xc2'));var _0x1f9062=path[_0xe0b0('0xc3')](config[_0xe0b0('0xbf')],'server',_0xe0b0('0xc1'),'attachments');var _0x1cfa9f=path['join'](_0x36a006,_0x498722);var _0x2307bb=util[_0xe0b0('0xc4')]('transcript-%d-%s.zip',_0x261641[_0xe0b0('0xa5')]['id'],_0x498722);var _0x4f0cbe=path[_0xe0b0('0xc3')](_0x36a006,_0x2307bb);var _0x3f147f=[];_0x3f147f[_0xe0b0('0x2f')]({'model':db[_0xe0b0('0x66')],'as':_0xe0b0('0x66'),'attributes':['id',_0xe0b0('0x2b')],'raw':!![]});_0x3f147f[_0xe0b0('0x2f')]({'model':db[_0xe0b0('0xc5')],'as':'Contact','attributes':['id',_0xe0b0('0xc6'),'lastName'],'raw':!![]});var _0x5a7fbe=[{'model':db[_0xe0b0('0xad')],'as':_0xe0b0('0xc7'),'attributes':['id',_0xe0b0('0x69'),'createdAt','direction',_0xe0b0('0xc8'),_0xe0b0('0xc9')],'include':_0x3f147f}];_0x5a7fbe['push']({'model':db[_0xe0b0('0xca')],'as':_0xe0b0('0xcb'),'attributes':['id',_0xe0b0('0x29')]});_0x5a7fbe[_0xe0b0('0x2f')]({'model':db[_0xe0b0('0x66')],'as':_0xe0b0('0xcc'),'attributes':['id',_0xe0b0('0x2b')]});return db[_0xe0b0('0x90')][_0xe0b0('0x55')]({'where':{'id':_0x261641['params']['id']},'include':_0x5a7fbe})['then'](handleEntityNotFound(_0x344388,null))[_0xe0b0('0x26')](function(_0x420b99){if(_0x420b99){var _0x42e201=_0x420b99[_0xe0b0('0xcd')]({'plain':!![]});fs[_0xe0b0('0xce')](_0x1cfa9f);var _0xb116cd={'channel':'Sms','account':_0x42e201[_0xe0b0('0xcb')][_0xe0b0('0x29')],'agent':_0x42e201[_0xe0b0('0xcc')]?_0x42e201[_0xe0b0('0xcc')][_0xe0b0('0x2b')]:'N.A.','createdAt':moment(_0x42e201[_0xe0b0('0x6f')])[_0xe0b0('0xc4')](_0xe0b0('0xb5'))[_0xe0b0('0x8f')](),'closedAt':_0x42e201[_0xe0b0('0xcf')]?moment(_0x42e201[_0xe0b0('0xd0')])[_0xe0b0('0xc4')](_0xe0b0('0xb5'))[_0xe0b0('0x8f')]():'','disposition':_0x42e201[_0xe0b0('0xd1')],'messages':_(_0x42e201['Messages'])[_0xe0b0('0x79')]({'secret':![]})[_0xe0b0('0x35')](function(_0x4f0db7){return{'date':moment(_0x4f0db7[_0xe0b0('0x6f')])['format'](_0xe0b0('0xb5'))[_0xe0b0('0x8f')](),'sender':_0x4f0db7['direction']===_0xe0b0('0xd2')?_0x4f0db7[_0xe0b0('0x66')]?_0x4f0db7[_0xe0b0('0x66')][_0xe0b0('0x2b')]:_0xe0b0('0xd3'):_0x4f0db7[_0xe0b0('0x5a')][_0xe0b0('0xc6')]+(_0x4f0db7['Contact']['lastName']?'\x20'+_0x4f0db7[_0xe0b0('0x5a')][_0xe0b0('0xd4')]:''),'body':_0x4f0db7[_0xe0b0('0x69')],'direction':_0x4f0db7['direction']===_0xe0b0('0xd2')?'A':'C','secret':_0x4f0db7[_0xe0b0('0xc8')],'read':_0x4f0db7[_0xe0b0('0xc9')]};})[_0xe0b0('0x56')]()};return ejs[_0xe0b0('0xd5')](path[_0xe0b0('0xc3')](config[_0xe0b0('0xbf')],_0xe0b0('0xc0'),_0xe0b0('0xd6'),_0xe0b0('0xd7')),{'interaction':_0xb116cd})['then'](function(_0x55123c){var _0x29d244=path[_0xe0b0('0xc3')](_0x1cfa9f,_0xe0b0('0xd8')+_0x42e201['id']+'-'+_0x498722+_0xe0b0('0xd9'));var _0x203351={'path':_0x29d244,'channel':_0xe0b0('0xda'),'interactionId':_0x42e201['id']};return pdf[_0xe0b0('0xdb')](_0x55123c,_0x203351);})['then'](function(){return new BPromise(function(_0x42207d,_0x2e7fe2){zipdir(_0x1cfa9f,{'saveTo':_0x4f0cbe},function(_0x15b1cb,_0x5c1375){if(_0x15b1cb)return _0x2e7fe2(_0x15b1cb);return _0x42207d(_0x5c1375);});})[_0xe0b0('0x26')](function(){return new BPromise(function(_0x10b668,_0x50fef5){rimraf(_0x1cfa9f,function(_0x5a5121){if(_0x5a5121)_0x50fef5(_0x5a5121);return _0x10b668();});});})[_0xe0b0('0x26')](function(){return _0x344388['download'](_0x4f0cbe,_0x2307bb,function(_0x7eef44){if(_0x7eef44){console['log'](_0xe0b0('0xdc'),_0x7eef44);}else{fs[_0xe0b0('0xdd')](_0x4f0cbe);}});});});}else{return _0x344388['sendStatus'](0xc8);}})[_0xe0b0('0x30')](handleError(_0x344388,null));}; \ No newline at end of file +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 diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bfc42ce..b113a11 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 _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x91f0f0,_0x1783a8){var _0x37cf58=function(_0x418e09){while(--_0x418e09){_0x91f0f0['push'](_0x91f0f0['shift']());}};_0x37cf58(++_0x1783a8);}(_0x3266,0x6a));var _0x6326=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0x3266[_0x469a3c];return _0x968f4;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents; \ No newline at end of file +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 diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index bfc2ee6..d4b69c4 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 _0xd567=['bluebird','request-promise','rimraf','../../config/environment','./smsInteraction.attributes','sms_interactions','changed','closed','format','lodash','util','api'];(function(_0x2df4f1,_0x44e6b6){var _0x83c2b8=function(_0x398e29){while(--_0x398e29){_0x2df4f1['push'](_0x2df4f1['shift']());}};_0x83c2b8(++_0x44e6b6);}(_0xd567,0x1a1));var _0x7d56=function(_0x325db1,_0x2fbcea){_0x325db1=_0x325db1-0x0;var _0x3419ac=_0xd567[_0x325db1];return _0x3419ac;};'use strict';var _=require(_0x7d56('0x0'));var util=require(_0x7d56('0x1'));var logger=require('../../config/logger')(_0x7d56('0x2'));var moment=require('moment');var BPromise=require(_0x7d56('0x3'));var rp=require(_0x7d56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d56('0x5'));var config=require(_0x7d56('0x6'));var attributes=require(_0x7d56('0x7'));module['exports']=function(_0x11a1f1,_0x3709c9){return _0x11a1f1['define']('SmsInteraction',attributes,{'tableName':_0x7d56('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f3c04,_0x56091e,_0x29b09d){if(_0x4f3c04[_0x7d56('0x9')](_0x7d56('0xa'))){_0x4f3c04['closedAt']=moment()[_0x7d56('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x29b09d(null,_0x4f3c04);}}});}; \ No newline at end of file +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 diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index ffea3d8..adc7a4d 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 _0x2462=['error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./smsInteraction.socket','register','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf4394d,_0x935dd0){var _0x556b2c=function(_0x1362f6){while(--_0x1362f6){_0xf4394d['push'](_0xf4394d['shift']());}};_0x556b2c(++_0x935dd0);}(_0x2462,0x14a));var _0x2246=function(_0x176d44,_0x5c97ec){_0x176d44=_0x176d44-0x0;var _0x565531=_0x2462[_0x176d44];return _0x565531;};'use strict';var _=require(_0x2246('0x0'));var util=require(_0x2246('0x1'));var moment=require(_0x2246('0x2'));var BPromise=require(_0x2246('0x3'));var rs=require(_0x2246('0x4'));var fs=require('fs');var Redis=require(_0x2246('0x5'));var db=require(_0x2246('0x6'))['db'];var utils=require(_0x2246('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x2246('0x8'));var jayson=require(_0x2246('0x9'));var client=jayson[_0x2246('0xa')][_0x2246('0xb')]({'port':0x232a});config[_0x2246('0xc')]=_[_0x2246('0xd')](config['redis'],{'host':_0x2246('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2246('0xf'))[_0x2246('0x10')](socket);function respondWithRpcPromise(_0x462643,_0x14f095,_0xe9f0dc){return new BPromise(function(_0x22bbcb,_0xa744e2){return client['request'](_0x462643,_0xe9f0dc)[_0x2246('0x11')](function(_0x35c3ca){logger['info'](_0x2246('0x12'),_0x14f095,_0x2246('0x13'));logger['debug'](_0x2246('0x14'),_0x14f095,'request\x20sent',JSON[_0x2246('0x15')](_0x35c3ca));if(_0x35c3ca[_0x2246('0x16')]){if(_0x35c3ca[_0x2246('0x16')][_0x2246('0x17')]===0x1f4){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x14f095,_0x35c3ca['error'][_0x2246('0x18')]);return _0xa744e2(_0x35c3ca['error'][_0x2246('0x18')]);}logger['error']('SmsInteraction,\x20%s,\x20%s',_0x14f095,_0x35c3ca[_0x2246('0x16')][_0x2246('0x18')]);return _0x22bbcb(_0x35c3ca[_0x2246('0x16')][_0x2246('0x18')]);}else{logger[_0x2246('0x19')](_0x2246('0x12'),_0x14f095,_0x2246('0x13'));_0x22bbcb(_0x35c3ca[_0x2246('0x1a')][_0x2246('0x18')]);}})[_0x2246('0x1b')](function(_0x173c8c){logger[_0x2246('0x16')](_0x2246('0x12'),_0x14f095,_0x173c8c);_0xa744e2(_0x173c8c);});});}exports[_0x2246('0x1c')]=function(_0x15a1f7){var _0x36d1f8=this;return new Promise(function(_0x57e7a4,_0x521bab){return db[_0x2246('0x1d')][_0x2246('0x1e')](_0x15a1f7[_0x2246('0x1f')],{'raw':_0x15a1f7[_0x2246('0x20')]?_0x15a1f7['options'][_0x2246('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15a1f7[_0x2246('0x20')]?_0x15a1f7[_0x2246('0x20')][_0x2246('0x22')]||null:null,'attributes':_0x15a1f7[_0x2246('0x20')]?_0x15a1f7[_0x2246('0x20')]['attributes']||null:null,'limit':_0x15a1f7[_0x2246('0x20')]?_0x15a1f7['options'][_0x2246('0x23')]||null:null})[_0x2246('0x11')](function(_0x18b119){logger[_0x2246('0x19')](_0x2246('0x1c'),_0x15a1f7);logger['debug'](_0x2246('0x1c'),_0x15a1f7,JSON[_0x2246('0x15')](_0x18b119));_0x57e7a4(_0x18b119);})[_0x2246('0x1b')](function(_0x38b43c){logger[_0x2246('0x16')](_0x2246('0x1c'),_0x38b43c['message'],_0x15a1f7);_0x521bab(_0x36d1f8['error'](0x1f4,_0x38b43c['message']));});});};exports[_0x2246('0x24')]=function(_0x1fdaf1){return new Promise(function(_0x175200,_0x20ed76){return db['SmsInteraction'][_0x2246('0x25')]({'where':_0x1fdaf1[_0x2246('0x20')]?_0x1fdaf1[_0x2246('0x20')][_0x2246('0x22')]||null:null})[_0x2246('0x11')](function(_0x584aa7){if(_0x584aa7){return _0x584aa7[_0x2246('0x26')](_0x1fdaf1[_0x2246('0x1f')][_0x2246('0x27')],_[_0x2246('0x28')](_0x1fdaf1[_0x2246('0x1f')],[_0x2246('0x27'),'id'])||{});}})[_0x2246('0x29')](function(_0x2d3200){logger[_0x2246('0x19')](_0x2246('0x2a'),_0x1fdaf1);logger[_0x2246('0x2b')](_0x2246('0x2a'),_0x1fdaf1,JSON[_0x2246('0x15')](_0x2d3200));_0x175200(_0x2d3200);})[_0x2246('0x1b')](function(_0x4e70b7){logger[_0x2246('0x16')](_0x2246('0x2a'),_0x4e70b7[_0x2246('0x18')],_0x1fdaf1);_0x20ed76(_this[_0x2246('0x16')](0x1f4,_0x4e70b7[_0x2246('0x18')]));});});}; \ No newline at end of file +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 diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index b1a21ef..bc4be62 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 _0x7ac4=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x1d2131,_0x36101a){var _0x44e9e3=function(_0x2fe4be){while(--_0x2fe4be){_0x1d2131['push'](_0x1d2131['shift']());}};_0x44e9e3(++_0x36101a);}(_0x7ac4,0x1c5));var _0x47ac=function(_0x80975b,_0x25f2a3){_0x80975b=_0x80975b-0x0;var _0x385320=_0x7ac4[_0x80975b];return _0x385320;};'use strict';var SmsInteractionEvents=require(_0x47ac('0x0'));var events=[_0x47ac('0x1'),_0x47ac('0x2'),'update'];function createListener(_0x1bf7a1,_0x36a495){return function(_0x192db0){_0x36a495[_0x47ac('0x3')](_0x1bf7a1,_0x192db0);};}function removeListener(_0x2737bd,_0x4a5a5d){return function(){SmsInteractionEvents[_0x47ac('0x4')](_0x2737bd,_0x4a5a5d);};}exports[_0x47ac('0x5')]=function(_0x1c17ce){for(var _0x1352a9=0x0,_0x4aa04e=events[_0x47ac('0x6')];_0x1352a9<_0x4aa04e;_0x1352a9++){var _0x1c8e9c=events[_0x1352a9];var _0x36885a=createListener(_0x47ac('0x7')+_0x1c8e9c,_0x1c17ce);SmsInteractionEvents['on'](_0x1c8e9c,_0x36885a);}}; \ No newline at end of file +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 diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index bc075a8..c34b296 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 _0xd868=['/:id','put','accept','/:id/reject','reject','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','index','get','/describe','describe','show','post','tracked','sms','smsmessage:create','create','/:id/status','status'];(function(_0x5f4209,_0x46d09b){var _0x76f8e0=function(_0x52f77e){while(--_0x52f77e){_0x5f4209['push'](_0x5f4209['shift']());}};_0x76f8e0(++_0x46d09b);}(_0xd868,0xf9));var _0x8d86=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xd868[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x8d86('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8d86('0x1'));var express=require(_0x8d86('0x2'));var router=express[_0x8d86('0x3')]();var fs_extra=require(_0x8d86('0x4'));var auth=require(_0x8d86('0x5'));var interaction=require(_0x8d86('0x6'));var config=require('../../config/environment');var controller=require(_0x8d86('0x7'));router['get']('/',auth[_0x8d86('0x8')](),controller[_0x8d86('0x9')]);router[_0x8d86('0xa')](_0x8d86('0xb'),auth['isAuthenticated'](),controller[_0x8d86('0xc')]);router['get']('/:id',auth[_0x8d86('0x8')](),controller[_0x8d86('0xd')]);router[_0x8d86('0xe')]('/',auth[_0x8d86('0x8')](),interaction[_0x8d86('0xf')](_0x8d86('0x10'),_0x8d86('0x11')),controller[_0x8d86('0x12')]);router['post'](_0x8d86('0x13'),controller[_0x8d86('0x14')]);router['put'](_0x8d86('0x15'),auth[_0x8d86('0x8')](),controller['update']);router[_0x8d86('0x16')]('/:id/accept',auth[_0x8d86('0x8')](),controller[_0x8d86('0x17')]);router['put'](_0x8d86('0x18'),auth[_0x8d86('0x8')](),controller[_0x8d86('0x19')]);router['delete'](_0x8d86('0x15'),auth['isAuthenticated'](),controller['destroy']);module[_0x8d86('0x1a')]=router; \ No newline at end of file +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 diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 725c308..62d23e5 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 _0x0aae=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize'];(function(_0x506e4e,_0x1e893b){var _0x23719c=function(_0x33e3c0){while(--_0x33e3c0){_0x506e4e['push'](_0x506e4e['shift']());}};_0x23719c(++_0x1e893b);}(_0x0aae,0xe0));var _0xe0aa=function(_0x3fa235,_0x4decfd){_0x3fa235=_0x3fa235-0x0;var _0x4d5bc8=_0x0aae[_0x3fa235];return _0x4d5bc8;};'use strict';var Sequelize=require(_0xe0aa('0x0'));module[_0xe0aa('0x1')]={'body':{'type':Sequelize[_0xe0aa('0x2')](_0xe0aa('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xe0aa('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe0aa('0x5')]('in',_0xe0aa('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xe0aa('0x7')](0xbe)},'phone':{'type':Sequelize[_0xe0aa('0x7')]},'readAt':{'type':Sequelize[_0xe0aa('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xe0aa('0x7')]},'providerResponse':{'type':Sequelize[_0xe0aa('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 53d425c..3a2847e 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 _0xccef=['RejectMessage','rejectMessage','QueryTypes','fullname','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','sent','delivered','plivio','infobip','results','groupName','DELIVERED','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','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','redis','defaults','localhost','./smsMessage.socket','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','map','SmsMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','where','VIRTUAL','options','includeAll','findAll','rows','catch','rawAttributes','include','create','body','find','params','describe','sms-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','SmsInteraction','isNil','read1stAt','format','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','SELECT','contact','User','internal','agent','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms','SmsInteractionId','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x17ebcc,_0x2327d7){var _0x552898=function(_0x5ba9ef){while(--_0x5ba9ef){_0x17ebcc['push'](_0x17ebcc['shift']());}};_0x552898(++_0x2327d7);}(_0xccef,0x1d4));var _0xfcce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xccef[_0x17d9e3];return _0x14192d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfcce('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfcce('0x1'));var rp=require(_0xfcce('0x2'));var moment=require(_0xfcce('0x3'));var BPromise=require(_0xfcce('0x4'));var Mustache=require(_0xfcce('0x5'));var util=require(_0xfcce('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xfcce('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcce('0x8'));var _=require(_0xfcce('0x9'));var squel=require(_0xfcce('0xa'));var crypto=require(_0xfcce('0xb'));var jsforce=require(_0xfcce('0xc'));var deskjs=require(_0xfcce('0xd'));var toCsv=require(_0xfcce('0x7'));var querystring=require('querystring');var Papa=require(_0xfcce('0xe'));var Redis=require(_0xfcce('0xf'));var authService=require(_0xfcce('0x10'));var qs=require(_0xfcce('0x11'));var as=require(_0xfcce('0x12'));var hardwareService=require(_0xfcce('0x13'));var logger=require(_0xfcce('0x14'))(_0xfcce('0x15'));var utils=require(_0xfcce('0x16'));var config=require(_0xfcce('0x17'));var licenseUtil=require(_0xfcce('0x18'));var db=require('../../mysqldb')['db'];config[_0xfcce('0x19')]=_[_0xfcce('0x1a')](config[_0xfcce('0x19')],{'host':_0xfcce('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfcce('0x19')]));require(_0xfcce('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xfcce('0x1d')][_0xfcce('0x1e')]({'port':0x232c});var client9002=jayson[_0xfcce('0x1d')][_0xfcce('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x10a161,_0x1caeb4,_0x12368a,_0xd82ab6){return new BPromise(function(_0x2d7611,_0x393163){var _0x2c4123=_0xd82ab6||client;return _0x2c4123[_0xfcce('0x1f')](_0x10a161,_0x12368a)[_0xfcce('0x20')](function(_0x60cee0){logger[_0xfcce('0x21')](_0xfcce('0x22'),_0x1caeb4,_0xfcce('0x23'));logger[_0xfcce('0x24')](_0xfcce('0x25'),_0x1caeb4,_0xfcce('0x23'),JSON[_0xfcce('0x26')](_0x60cee0));if(_0x60cee0[_0xfcce('0x27')]){if(_0x60cee0[_0xfcce('0x27')]['code']===0x1f4){logger['error'](_0xfcce('0x22'),_0x1caeb4,_0x60cee0['error'][_0xfcce('0x28')]);return _0x393163(_0x60cee0[_0xfcce('0x27')]['message']);}logger[_0xfcce('0x27')](_0xfcce('0x22'),_0x1caeb4,_0x60cee0[_0xfcce('0x27')][_0xfcce('0x28')]);return _0x2d7611(_0x60cee0[_0xfcce('0x27')][_0xfcce('0x28')]);}else{logger['info'](_0xfcce('0x22'),_0x1caeb4,_0xfcce('0x23'));_0x2d7611(_0x60cee0[_0xfcce('0x29')][_0xfcce('0x28')]);}})['catch'](function(_0x4ca849){logger[_0xfcce('0x27')](_0xfcce('0x22'),_0x1caeb4,_0x4ca849);_0x393163(_0x4ca849);});});}function respondWithStatusCode(_0x4372bc,_0x2872b0){_0x2872b0=_0x2872b0||0xcc;return function(_0x47b1dc){if(_0x47b1dc){return _0x4372bc[_0xfcce('0x2a')](_0x2872b0);}return _0x4372bc[_0xfcce('0x2b')](_0x2872b0)['end']();};}function respondWithResult(_0x47c28f,_0x413adf){_0x413adf=_0x413adf||0xc8;return function(_0x25337f){if(_0x25337f){return _0x47c28f[_0xfcce('0x2b')](_0x413adf)[_0xfcce('0x2c')](_0x25337f);}};}function respondWithFilteredResult(_0xb5cdc0,_0x5abfa7){return function(_0x1accb6){if(_0x1accb6){var _0x3b7592=typeof _0x5abfa7[_0xfcce('0x2d')]===_0xfcce('0x2e')&&typeof _0x5abfa7['limit']===_0xfcce('0x2e');var _0x57c2d9=_0x1accb6['count'];var _0x1aaddd=_0x3b7592?0x0:_0x5abfa7[_0xfcce('0x2d')];var _0x43dc0a=_0x3b7592?_0x1accb6[_0xfcce('0x2f')]:_0x5abfa7[_0xfcce('0x2d')]+_0x5abfa7[_0xfcce('0x30')];var _0x2fa5b5;if(_0x43dc0a>=_0x57c2d9){_0x43dc0a=_0x57c2d9;_0x2fa5b5=0xc8;}else{_0x2fa5b5=0xce;}_0xb5cdc0[_0xfcce('0x2b')](_0x2fa5b5);return _0xb5cdc0['set'](_0xfcce('0x31'),_0x1aaddd+'-'+_0x43dc0a+'/'+_0x57c2d9)[_0xfcce('0x2c')](_0x1accb6);}return null;};}function patchUpdates(_0x42224a){return function(_0x2dd7a5){try{jsonpatch[_0xfcce('0x32')](_0x2dd7a5,_0x42224a,!![]);}catch(_0x3a51c0){return BPromise[_0xfcce('0x33')](_0x3a51c0);}return _0x2dd7a5[_0xfcce('0x34')]();};}function saveUpdates(_0x472221,_0x1feb1e){return function(_0x14435f){if(_0x14435f){return _0x14435f[_0xfcce('0x35')](_0x472221)[_0xfcce('0x20')](function(_0x2ab42d){return _0x2ab42d;});}return null;};}function removeEntity(_0x4d2153,_0x44bdb6){return function(_0x4930d2){if(_0x4930d2){return _0x4930d2[_0xfcce('0x36')]()[_0xfcce('0x20')](function(){_0x4d2153[_0xfcce('0x2b')](0xcc)[_0xfcce('0x37')]();});}};}function handleEntityNotFound(_0x428cc6,_0x683920){return function(_0x2051cf){if(!_0x2051cf){_0x428cc6[_0xfcce('0x2a')](0x194);}return _0x2051cf;};}function handleError(_0x2f029a,_0x9e0bba){_0x9e0bba=_0x9e0bba||0x1f4;return function(_0x537892){logger[_0xfcce('0x27')](_0x537892[_0xfcce('0x38')]);if(_0x537892[_0xfcce('0x39')]){delete _0x537892[_0xfcce('0x39')];}_0x2f029a[_0xfcce('0x2b')](_0x9e0bba)['send'](_0x537892);};}exports[_0xfcce('0x3a')]=function(_0x1edf08,_0x4b58cd){var _0x405975={},_0x5cff9a={},_0x2f6051={'count':0x0,'rows':[]};var _0x20c6eb=_[_0xfcce('0x3b')](db[_0xfcce('0x3c')]['rawAttributes'],function(_0x420250){return{'name':_0x420250[_0xfcce('0x3d')],'type':_0x420250[_0xfcce('0x3e')][_0xfcce('0x3f')]};});_0x5cff9a[_0xfcce('0x40')]=_[_0xfcce('0x3b')](_0x20c6eb,'name');_0x5cff9a[_0xfcce('0x41')]=_[_0xfcce('0x42')](_0x1edf08[_0xfcce('0x41')]);_0x5cff9a[_0xfcce('0x43')]=_[_0xfcce('0x44')](_0x5cff9a[_0xfcce('0x40')],_0x5cff9a['query']);_0x405975[_0xfcce('0x45')]=_[_0xfcce('0x44')](_0x5cff9a['model'],qs[_0xfcce('0x46')](_0x1edf08[_0xfcce('0x41')][_0xfcce('0x46')]));_0x405975['attributes']=_0x405975[_0xfcce('0x45')][_0xfcce('0x47')]?_0x405975[_0xfcce('0x45')]:_0x5cff9a[_0xfcce('0x40')];if(!_0x1edf08[_0xfcce('0x41')][_0xfcce('0x48')](_0xfcce('0x49'))){_0x405975[_0xfcce('0x30')]=qs['limit'](_0x1edf08[_0xfcce('0x41')][_0xfcce('0x30')]);_0x405975[_0xfcce('0x2d')]=qs['offset'](_0x1edf08[_0xfcce('0x41')]['offset']);}_0x405975['order']=qs[_0xfcce('0x4a')](_0x1edf08[_0xfcce('0x41')][_0xfcce('0x4a')]);_0x405975['where']=qs[_0xfcce('0x43')](_[_0xfcce('0x4b')](_0x1edf08[_0xfcce('0x41')],_0x5cff9a[_0xfcce('0x43')]),_0x20c6eb);if(_0x1edf08[_0xfcce('0x41')]['filter']){_0x405975['where']=_[_0xfcce('0x4c')](_0x405975[_0xfcce('0x4d')],{'$or':_[_0xfcce('0x3b')](_0x20c6eb,function(_0x1ce80a){if(_0x1ce80a[_0xfcce('0x3e')]!==_0xfcce('0x4e')){var _0x4bb2f0={};_0x4bb2f0[_0x1ce80a[_0xfcce('0x39')]]={'$like':'%'+_0x1edf08[_0xfcce('0x41')]['filter']+'%'};return _0x4bb2f0;}})});}_0x405975=_['merge']({},_0x405975,_0x1edf08[_0xfcce('0x4f')]);var _0x5c0f92={'where':_0x405975[_0xfcce('0x4d')]};return db['SmsMessage'][_0xfcce('0x2f')](_0x5c0f92)[_0xfcce('0x20')](function(_0x25353b){_0x2f6051['count']=_0x25353b;if(_0x1edf08['query'][_0xfcce('0x50')]){_0x405975['include']=[{'all':!![]}];}return db[_0xfcce('0x3c')][_0xfcce('0x51')](_0x405975);})[_0xfcce('0x20')](function(_0x483bfb){_0x2f6051[_0xfcce('0x52')]=_0x483bfb;return _0x2f6051;})[_0xfcce('0x20')](respondWithFilteredResult(_0x4b58cd,_0x405975))[_0xfcce('0x53')](handleError(_0x4b58cd,null));};exports['show']=function(_0x1dd173,_0x5487b3){var _0x11b14d={'raw':!![],'where':{'id':_0x1dd173['params']['id']}},_0x2db38c={};_0x2db38c[_0xfcce('0x40')]=_['keys'](db['SmsMessage'][_0xfcce('0x54')]);_0x2db38c['query']=_[_0xfcce('0x42')](_0x1dd173['query']);_0x2db38c[_0xfcce('0x43')]=_['intersection'](_0x2db38c[_0xfcce('0x40')],_0x2db38c[_0xfcce('0x41')]);_0x11b14d[_0xfcce('0x45')]=_[_0xfcce('0x44')](_0x2db38c[_0xfcce('0x40')],qs[_0xfcce('0x46')](_0x1dd173['query'][_0xfcce('0x46')]));_0x11b14d[_0xfcce('0x45')]=_0x11b14d['attributes'][_0xfcce('0x47')]?_0x11b14d[_0xfcce('0x45')]:_0x2db38c['model'];if(_0x1dd173[_0xfcce('0x41')][_0xfcce('0x50')]){_0x11b14d[_0xfcce('0x55')]=[{'all':!![]}];}_0x11b14d=_[_0xfcce('0x4c')]({},_0x11b14d,_0x1dd173['options']);return db[_0xfcce('0x3c')]['find'](_0x11b14d)[_0xfcce('0x20')](handleEntityNotFound(_0x5487b3,null))[_0xfcce('0x20')](respondWithResult(_0x5487b3,null))[_0xfcce('0x53')](handleError(_0x5487b3,null));};exports['create']=function(_0x5f155e,_0x35cac4){return db['SmsMessage'][_0xfcce('0x56')](_0x5f155e['body'],{})[_0xfcce('0x20')](respondWithResult(_0x35cac4,0xc9))['catch'](handleError(_0x35cac4,null));};exports[_0xfcce('0x35')]=function(_0x59d85d,_0x3514db){if(_0x59d85d[_0xfcce('0x57')]['id']){delete _0x59d85d[_0xfcce('0x57')]['id'];}return db[_0xfcce('0x3c')][_0xfcce('0x58')]({'where':{'id':_0x59d85d[_0xfcce('0x59')]['id']}})[_0xfcce('0x20')](handleEntityNotFound(_0x3514db,null))['then'](saveUpdates(_0x59d85d['body'],null))[_0xfcce('0x20')](respondWithResult(_0x3514db,null))[_0xfcce('0x53')](handleError(_0x3514db,null));};exports[_0xfcce('0x36')]=function(_0x4405f6,_0x30299a){return db[_0xfcce('0x3c')]['find']({'where':{'id':_0x4405f6['params']['id']}})['then'](handleEntityNotFound(_0x30299a,null))['then'](removeEntity(_0x30299a,null))[_0xfcce('0x53')](handleError(_0x30299a,null));};exports['describe']=function(_0x49f00e,_0x3837a1){return db[_0xfcce('0x3c')][_0xfcce('0x5a')]()[_0xfcce('0x20')](respondWithResult(_0x3837a1,null))[_0xfcce('0x53')](handleError(_0x3837a1,null));};var interaction_log=require(_0xfcce('0x14'))(_0xfcce('0x5b'));exports[_0xfcce('0x5c')]=function(_0x5e8fed,_0x4b9af8,_0x1af7ff){var _0x3262db={'agent':{},'channel':'sms'};if(_0x5e8fed[_0xfcce('0x57')]['id']){delete _0x5e8fed[_0xfcce('0x57')]['id'];}_0x5e8fed[_0xfcce('0x57')][_0xfcce('0x5d')]=!![];_0x5e8fed['body'][_0xfcce('0x5e')]=moment()['format'](_0xfcce('0x5f'));_0x5e8fed['body'][_0xfcce('0x60')]=_0x5e8fed[_0xfcce('0x57')][_0xfcce('0x60')]||_0x5e8fed[_0xfcce('0x61')]['id'];_0x3262db['agent']['id']=_0x5e8fed['body'][_0xfcce('0x60')];return db[_0xfcce('0x3c')][_0xfcce('0x58')]({'where':{'id':_0x5e8fed[_0xfcce('0x59')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b9af8,null))['then'](saveUpdates(_0x5e8fed[_0xfcce('0x57')],null))['then'](function(_0x54f74a){if(_0x54f74a){_0x3262db[_0xfcce('0x28')]=_0x54f74a['get']({'plain':!![]});return db[_0xfcce('0x62')][_0xfcce('0x58')]({'where':{'id':_0x54f74a['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4b9af8,null))[_0xfcce('0x20')](function(_0x489a69){if(_0x489a69){return _0x489a69[_0xfcce('0x35')]({'UserId':_0x5e8fed['body'][_0xfcce('0x60')],'read1stAt':_[_0xfcce('0x63')](_0x489a69[_0xfcce('0x64')])?moment()[_0xfcce('0x65')](_0xfcce('0x5f')):undefined});}return null;})['then'](function(_0x5c7c5a){if(_0x5c7c5a){_0x3262db[_0xfcce('0x66')]=_0x5c7c5a['get']({'plain':!![]});interaction_log[_0xfcce('0x21')](_0xfcce('0x67'),_0x5e8fed['user']['id'],_0x5e8fed[_0xfcce('0x61')][_0xfcce('0x39')],_0x5e8fed[_0xfcce('0x61')][_0xfcce('0x68')],_0x3262db[_0xfcce('0x66')]['id'],_0x5e8fed[_0xfcce('0x57')]?JSON[_0xfcce('0x26')](_0x5e8fed[_0xfcce('0x57')]):_0xfcce('0x69'));return respondWithRpcPromise(_0xfcce('0x6a'),_0xfcce('0x6b'),_0x3262db);}return null;})['then'](function(_0x65c183){var _0x39b50c=_0xfcce('0x6c')+_0x65c183[_0xfcce('0x28')][_0xfcce('0x6d')];return db[_0xfcce('0x6e')][_0xfcce('0x41')](_0x39b50c,{'type':db[_0xfcce('0x6f')]['QueryTypes'][_0xfcce('0x70')],'raw':!![]})[_0xfcce('0x20')](function(_0x4a2c3d){return _0x4a2c3d;});})[_0xfcce('0x20')](function(_0x87e8f){if(_0x87e8f){_0x3262db['message'][_0xfcce('0x71')]=_0x87e8f[0x0];if(!_0x5e8fed['body'][_0xfcce('0x60')])return;return db[_0xfcce('0x72')]['find']({'where':{'id':_0x5e8fed[_0xfcce('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0xfcce('0x39'),'fullname','email',_0xfcce('0x73')],'raw':!![]});}return null;})[_0xfcce('0x20')](function(_0x19d9d2){if(!_0x19d9d2)return null;_0x3262db[_0xfcce('0x28')][_0xfcce('0x74')]=_0x19d9d2;return _0x3262db;})[_0xfcce('0x20')](function(_0x4e32b5){if(_0x4e32b5){if(_0x5e8fed['body'][_0xfcce('0x75')]){_0x3262db[_0xfcce('0x28')]['interface']=util['format'](_0xfcce('0x76'),_0x5e8fed[_0xfcce('0x61')][_0xfcce('0x39')]);_0x3262db[_0xfcce('0x28')][_0xfcce('0x77')]=_0x3262db['channel'];_0x3262db[_0xfcce('0x28')][_0xfcce('0x78')]=_0x3262db[_0xfcce('0x77')];_0x3262db[_0xfcce('0x28')][_0xfcce('0x79')]='accept';return respondWithRpcPromise(_0xfcce('0x7a'),_0xfcce('0x7a'),{'event':_0xfcce('0x7b'),'message':_0x3262db[_0xfcce('0x28')]},client9002)['then'](function(){return _0x3262db;});}return _0x3262db;}return null;})[_0xfcce('0x20')](respondWithResult(_0x4b9af8,null))[_0xfcce('0x53')](handleError(_0x4b9af8,null));};var interaction_log=require(_0xfcce('0x14'))(_0xfcce('0x5b'));exports[_0xfcce('0x33')]=function(_0x2b360c,_0x5cde3a,_0x47b5e3){var _0x3f3569={'agent':{},'channel':_0xfcce('0x7c')};if(_0x2b360c['body']['id']){delete _0x2b360c[_0xfcce('0x57')]['id'];}_0x2b360c[_0xfcce('0x57')]['UserId']=_0x2b360c['body'][_0xfcce('0x60')]||_0x2b360c['user']['id'];_0x3f3569[_0xfcce('0x74')]['id']=_0x2b360c[_0xfcce('0x57')][_0xfcce('0x60')];return db[_0xfcce('0x3c')][_0xfcce('0x58')]({'where':{'id':_0x2b360c[_0xfcce('0x59')]['id'],'UserId':null}})[_0xfcce('0x20')](handleEntityNotFound(_0x5cde3a,null))[_0xfcce('0x20')](function(_0x41d58c){if(_0x41d58c){_0x3f3569['message']=_0x41d58c['get']({'plain':!![]});return db[_0xfcce('0x62')][_0xfcce('0x58')]({'where':{'id':_0x41d58c[_0xfcce('0x7d')]}});}return null;})[_0xfcce('0x20')](handleEntityNotFound(_0x5cde3a,null))[_0xfcce('0x20')](function(_0x28cf0e){if(_0x28cf0e){_0x3f3569[_0xfcce('0x66')]=_0x28cf0e[_0xfcce('0x7e')]({'plain':!![]});interaction_log[_0xfcce('0x21')](_0xfcce('0x7f'),_0x2b360c[_0xfcce('0x61')]['id'],_0x2b360c[_0xfcce('0x61')]['name'],_0x2b360c[_0xfcce('0x61')][_0xfcce('0x68')],_0x3f3569['interaction']['id'],_0x2b360c[_0xfcce('0x57')]?JSON[_0xfcce('0x26')](_0x2b360c[_0xfcce('0x57')]):_0xfcce('0x69'));return respondWithRpcPromise(_0xfcce('0x80'),_0xfcce('0x81'),_0x3f3569);}return null;})['then'](function(_0xb88d56){var _0x331651=_0xfcce('0x6c')+_0xb88d56['message'][_0xfcce('0x6d')];return db[_0xfcce('0x6e')][_0xfcce('0x41')](_0x331651,{'type':db['Sequelize'][_0xfcce('0x82')][_0xfcce('0x70')],'raw':!![]})[_0xfcce('0x20')](function(_0x244801){return _0x244801;});})['then'](function(_0x3161d6){if(_0x3161d6){_0x3f3569[_0xfcce('0x28')][_0xfcce('0x71')]=_0x3161d6[0x0];if(!_0x2b360c[_0xfcce('0x57')][_0xfcce('0x60')])return;return db[_0xfcce('0x72')][_0xfcce('0x58')]({'where':{'id':_0x2b360c[_0xfcce('0x57')][_0xfcce('0x60')],'role':_0xfcce('0x74')},'attributes':['id',_0xfcce('0x39'),_0xfcce('0x83'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x14e7c3){if(!_0x14e7c3)return null;_0x3f3569[_0xfcce('0x28')][_0xfcce('0x74')]=_0x14e7c3;return _0x3f3569;})[_0xfcce('0x20')](function(_0x3311f3){if(_0x3311f3){_0x3311f3[_0xfcce('0x28')][_0xfcce('0x84')]=util[_0xfcce('0x65')](_0xfcce('0x76'),_0x2b360c[_0xfcce('0x61')][_0xfcce('0x39')]);_0x3311f3[_0xfcce('0x28')][_0xfcce('0x77')]=_0x3f3569[_0xfcce('0x77')];_0x3311f3[_0xfcce('0x28')][_0xfcce('0x78')]=_0x3f3569[_0xfcce('0x77')];_0x3311f3[_0xfcce('0x28')][_0xfcce('0x79')]=_0xfcce('0x33');respondWithRpcPromise(_0xfcce('0x7a'),'EventManager',{'event':_0xfcce('0x85'),'message':_0x3311f3[_0xfcce('0x28')]},client9002);return _0x3f3569;}return null;})['then'](respondWithResult(_0x5cde3a,null))['catch'](handleError(_0x5cde3a,null));};exports[_0xfcce('0x2b')]=function(_0x3d3a14,_0x42cb65,_0x401801){if(_0x3d3a14[_0xfcce('0x57')]['id']){delete _0x3d3a14[_0xfcce('0x57')]['id'];}var _0x1910f3;return db['SmsMessage'][_0xfcce('0x58')]({'where':{'id':_0x3d3a14['params']['id']}})[_0xfcce('0x20')](handleEntityNotFound(_0x42cb65,null))[_0xfcce('0x20')](function(_0x38c78a){if(_0x38c78a){_0x1910f3=_0x38c78a;return db[_0xfcce('0x86')][_0xfcce('0x58')]({'where':{'id':_0x38c78a[_0xfcce('0x87')]}});}})[_0xfcce('0x20')](handleEntityNotFound(_0x42cb65,null))[_0xfcce('0x20')](function(_0x5cc247){if(_0x5cc247){logger[_0xfcce('0x24')](_0xfcce('0x25'),_0xfcce('0x2b'),_0xfcce('0x88'),_0x5cc247['type'],util[_0xfcce('0x89')](_0x3d3a14[_0xfcce('0x57')],{'showHidden':![],'depth':null}));switch(_0x5cc247[_0xfcce('0x3e')]){case _0xfcce('0x8a'):if(_0x3d3a14[_0xfcce('0x57')][_0xfcce('0x8b')]&&_0x3d3a14['body']['MessageSid']===_0x1910f3['messageId']){return _0x1910f3['update']({'read':!![]});}else{logger[_0xfcce('0x27')](_0xfcce('0x8c'),_0xfcce('0x2b'),_0xfcce('0x8a'),util[_0xfcce('0x89')](_0x3d3a14[_0xfcce('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3d3a14[_0xfcce('0x57')][_0xfcce('0x8d')]&&_0x3d3a14[_0xfcce('0x57')][_0xfcce('0x8d')]===_0x1910f3['messageId']&&_['indexOf']([_0xfcce('0x8e'),_0xfcce('0x8f')],_0x3d3a14[_0xfcce('0x57')]['Status'])>=0x0){return _0x1910f3['update']({'read':!![]});}else{logger[_0xfcce('0x27')](_0xfcce('0x8c'),_0xfcce('0x2b'),_0xfcce('0x90'),util[_0xfcce('0x89')](_0x3d3a14[_0xfcce('0x57')],{'showHidden':![],'depth':null}));}break;case _0xfcce('0x91'):var _0x5269c6=_0x3d3a14[_0xfcce('0x57')][_0xfcce('0x92')][0x0];if(_0x5269c6['status'][_0xfcce('0x93')]===_0xfcce('0x94')){return _0x1910f3[_0xfcce('0x35')]({'read':!![]});}else{logger[_0xfcce('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfcce('0x2b'),_0xfcce('0x91'),util['inspect'](_0x3d3a14[_0xfcce('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x1910f3;}})['then'](respondWithResult(_0x42cb65,null))[_0xfcce('0x53')](handleError(_0x42cb65,null));}; \ No newline at end of file +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 diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 2e8716b..9122440 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 _0x8ca5=['../../mysqldb','SmsMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x3bceea,_0x58af75){var _0x30a8d3=function(_0x1550b5){while(--_0x1550b5){_0x3bceea['push'](_0x3bceea['shift']());}};_0x30a8d3(++_0x58af75);}(_0x8ca5,0xe0));var _0x58ca=function(_0xc2d599,_0x38c3df){_0xc2d599=_0xc2d599-0x0;var _0x47d07a=_0x8ca5[_0xc2d599];return _0x47d07a;};'use strict';var EventEmitter=require(_0x58ca('0x0'));var SmsMessage=require(_0x58ca('0x1'))['db'][_0x58ca('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x58ca('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x58ca('0x4'),'afterDestroy':_0x58ca('0x5')};function emitEvent(_0x19051a){return function(_0x1af52f,_0x597ea0,_0x1724fb){SmsMessageEvents[_0x58ca('0x6')](_0x19051a+':'+_0x1af52f['id'],_0x1af52f);SmsMessageEvents['emit'](_0x19051a,_0x1af52f);_0x1724fb(null);};}for(var e in events){if(events[_0x58ca('0x7')](e)){var event=events[e];SmsMessage[_0x58ca('0x8')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +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 diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index cd783a7..d999426 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 _0x643a=['uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','SmsMessage','sms_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','catch','error','SmsAccount','type','twilio','authToken','phone','messages','create','remote','/status?token=','token','sid','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','password','body','smsMethod','sender','login?username=','username','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','Missing\x20parameters:\x20username,\x20password','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','queued_count','message_id','clickSend','plivo','senderString','/api/sms/messages/','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','messageId','Missing\x20parameters:\x20base_url','timestamp','keys','sort','apiKey','createHash','md5','hex','signature=','/external/get/send.php?','id_sms','csc','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages'];(function(_0x67f95e,_0x3ca797){var _0x538f5a=function(_0xc919e9){while(--_0xc919e9){_0x67f95e['push'](_0x67f95e['shift']());}};_0x538f5a(++_0x3ca797);}(_0x643a,0x10a));var _0xa643=function(_0x5c2cd5,_0x1c2fbb){_0x5c2cd5=_0x5c2cd5-0x0;var _0x5180e9=_0x643a[_0x5c2cd5];return _0x5180e9;};'use strict';var _=require(_0xa643('0x0'));var util=require('util');var logger=require(_0xa643('0x1'))(_0xa643('0x2'));var moment=require(_0xa643('0x3'));var BPromise=require(_0xa643('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xa643('0x5'));var config=require(_0xa643('0x6'));var attributes=require('./smsMessage.attributes');module[_0xa643('0x7')]=function(_0x472a81,_0x23395a){return _0x472a81[_0xa643('0x8')](_0xa643('0x9'),attributes,{'tableName':_0xa643('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_sms_messages','fields':['body'],'type':_0xa643('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1bf984,_0x598c83,_0x488229){var _0x37840c=_0x472a81[_0xa643('0xc')];var _0x44dca2=_0x1bf984[_0xa643('0xd')]({'plain':!![]});if(_0x44dca2['direction']['toLowerCase']()==='in'||_0x44dca2[_0xa643('0xe')][_0xa643('0xf')]()===_0xa643('0x10')&&!_0x44dca2[_0xa643('0x11')]&&!_[_0xa643('0x12')](_0x44dca2[_0xa643('0x13')])&&!_['isNil'](_0x44dca2[_0xa643('0x14')])){_0x37840c[_0xa643('0x15')][_0xa643('0x16')]({'where':{'id':_0x44dca2['SmsInteractionId']}})[_0xa643('0x17')](function(_0x14a3ce){if(_0x14a3ce){_0x14a3ce[_0xa643('0x18')]({'lastMsgAt':_0x44dca2[_0xa643('0x19')],'lastMsgDirection':_0x44dca2[_0xa643('0xe')][_0xa643('0xf')]()});}})[_0xa643('0x1a')](function(_0x384d36){console[_0xa643('0x1b')](_0x384d36);});}if(_0x44dca2[_0xa643('0xe')]===_0xa643('0x10')&&!_0x44dca2[_0xa643('0x11')]){var _0x4b4903;_0x37840c[_0xa643('0x1c')]['find']({'where':{'id':_0x44dca2['SmsAccountId']},'raw':!![]})[_0xa643('0x17')](function(_0x605372){_0x4b4903=_0x605372;if(_0x4b4903&&_0x4b4903['type']){switch(_0x4b4903[_0xa643('0x1d')]){case _0xa643('0x1e'):var _0x545294=require(_0xa643('0x1e'));if(_0x4b4903['accountSid']&&_0x4b4903[_0xa643('0x1f')]&&_0x4b4903[_0xa643('0x20')]){var _0x5ae7d5=new _0x545294(_0x4b4903['accountSid'],_0x4b4903[_0xa643('0x1f')]);_0x5ae7d5[_0xa643('0x21')][_0xa643('0x22')]({'body':_0x44dca2['body'],'to':_0x44dca2[_0xa643('0x20')],'from':_0x4b4903[_0xa643('0x20')],'statusCallback':_0x4b4903[_0xa643('0x23')]+'/api/sms/messages/'+_0x44dca2['id']+_0xa643('0x24')+_0x4b4903[_0xa643('0x25')]})[_0xa643('0x17')](function(_0x34fd32){if(_0x34fd32[_0xa643('0x26')]){return _0x1bf984[_0xa643('0x18')]({'messageId':_0x34fd32[_0xa643('0x26')]});}})[_0xa643('0x1a')](function(_0x1af61b){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa643('0x27'),_0xa643('0x1e'),util[_0xa643('0x28')](_0x1af61b,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa643('0x27'),'twilio',_0xa643('0x29'));}break;case'skebby':var _0x171cc9=_0xa643('0x2a');if(_0x4b4903['username']&&_0x4b4903[_0xa643('0x2b')]){var _0x4b3ff4={'recipient':[_0x44dca2[_0xa643('0x20')]],'message':_0x44dca2[_0xa643('0x2c')],'message_type':_0x4b4903[_0xa643('0x2d')]};if(_0x4b4903[_0xa643('0x2d')]&&_0x4b4903[_0xa643('0x2d')]!=='SI'){_0x4b3ff4[_0xa643('0x2e')]=_0x4b4903[_0xa643('0x20')];}var _0x368844={'url':_0x171cc9+_0xa643('0x2f')+_0x4b4903[_0xa643('0x30')]+_0xa643('0x31')+_0x4b4903[_0xa643('0x2b')],'method':_0xa643('0x32')};rp(_0x368844)['then'](function(_0x1233a2){var _0x16618c=_0x1233a2[_0xa643('0x33')](';');var _0x34dadf={'user_key':_0x16618c[0x0],'session_key':_0x16618c[0x1]};_0x368844={'url':_0x171cc9+_0xa643('0x34'),'method':_0xa643('0x35'),'headers':{'user_key':_0x34dadf[_0xa643('0x36')],'Session_key':_0x34dadf[_0xa643('0x37')]},'json':!![],'body':_0x4b3ff4};return rp(_0x368844);})[_0xa643('0x17')](function(_0x21905e){if(_0x21905e[_0xa643('0x38')]>=0x1){var _0x8e27e2={'messageId':_0x21905e[_0xa643('0x39')]};if(_0x4b4903['smsMethod']!=='GP'||!_0x4b4903[_0xa643('0x3a')]){_0x8e27e2[_0xa643('0x3b')]=!![];}return _0x1bf984[_0xa643('0x18')](_0x8e27e2);}else{return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x3d'),util[_0xa643('0x28')](_0x21905e,{'showHidden':![],'depth':null}));}})[_0xa643('0x1a')](function(_0x32f51f){return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x3d'),util[_0xa643('0x28')](_0x32f51f,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x3d'),_0xa643('0x3e'));}break;case'connectel':if(_0x4b4903[_0xa643('0x1f')]){var _0x41a5e3={'recipient':_0x44dca2[_0xa643('0x20')],'message':_0x44dca2['body'],'sender':_0x4b4903['senderString']||_0x4b4903[_0xa643('0x20')],'authorization':_0x4b4903[_0xa643('0x1f')]};var _0x598c83={'method':_0xa643('0x35'),'uri':_0xa643('0x3f'),'body':_0x41a5e3,'json':!![]};rp(_0x598c83)['then'](function(_0x5693d5){var _0x1c28f6={'messageId':_0x5693d5[_0xa643('0x40')]};if(!_0x4b4903[_0xa643('0x3a')]){_0x1c28f6['read']=!![];}return _0x1bf984[_0xa643('0x18')](_0x1c28f6);})['catch'](function(_0x237115){logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x41'),util['inspect'](_0x237115,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x41'),_0xa643('0x42'));}break;case _0xa643('0x43'):if(_0x4b4903[_0xa643('0x30')]&&_0x4b4903[_0xa643('0x2b')]){var _0x41a5e3={'messages':[{'source':'xCALLY\x20Motion','to':_0x44dca2[_0xa643('0x20')],'body':_0x44dca2['body'],'from':_0x4b4903['senderString']||_0x4b4903[_0xa643('0x20')]}]};var _0x5bbf9b=util[_0xa643('0x44')](_0xa643('0x45'),_0x4b4903[_0xa643('0x30')],_0x4b4903['password']);var _0x598c83={'method':'POST','uri':_0xa643('0x46'),'body':_0x41a5e3,'headers':{'Authorization':util[_0xa643('0x44')](_0xa643('0x47'),new Buffer(_0x5bbf9b)[_0xa643('0x48')](_0xa643('0x49')))},'json':!![]};rp(_0x598c83)[_0xa643('0x17')](function(_0x1211b3){if(_0x1211b3['http_code']>=0xc8&&_0x1211b3[_0xa643('0x4a')]<=0xce){if(_0x1211b3[_0xa643('0x4b')]&&_0x1211b3[_0xa643('0x4b')][_0xa643('0x4c')]>0x0){var _0x18d127=_['head'](_0x1211b3[_0xa643('0x4b')][_0xa643('0x21')]);var _0x4e27cd={'messageId':_0x18d127[_0xa643('0x4d')]};if(!_0x4b4903['deliveryReport']){_0x4e27cd[_0xa643('0x3b')]=!![];}return _0x1bf984[_0xa643('0x18')](_0x4e27cd);}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x4e'),util[_0xa643('0x28')](_0x1211b3,{'showHidden':![],'depth':null}));}}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),'clickSend',util[_0xa643('0x28')](_0x1211b3,{'showHidden':![],'depth':null}));}})[_0xa643('0x1a')](function(_0x13b25b){logger[_0xa643('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util[_0xa643('0x28')](_0x13b25b,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa643('0x27'),_0xa643('0x4e'),_0xa643('0x3e'));}break;case _0xa643('0x4f'):if(_0x4b4903['authId']&&_0x4b4903[_0xa643('0x1f')]){var _0x41a5e3={'dst':_0x44dca2['phone'],'text':_0x44dca2[_0xa643('0x2c')],'src':_0x4b4903[_0xa643('0x50')]||_0x4b4903[_0xa643('0x20')],'url':_0x4b4903[_0xa643('0x23')]+_0xa643('0x51')+_0x44dca2['id']+_0xa643('0x24')+_0x4b4903[_0xa643('0x25')]};var _0x5bbf9b=util[_0xa643('0x44')](_0xa643('0x45'),_0x4b4903[_0xa643('0x52')],_0x4b4903[_0xa643('0x1f')]);var _0x598c83={'method':_0xa643('0x35'),'uri':util['format'](_0xa643('0x53'),_0x4b4903[_0xa643('0x52')]),'body':_0x41a5e3,'headers':{'Authorization':util['format'](_0xa643('0x47'),new Buffer(_0x5bbf9b)[_0xa643('0x48')]('base64'))},'json':!![]};rp(_0x598c83)[_0xa643('0x17')](function(_0x527b59){var _0x2a7fa0={'messageId':_0x527b59[_0xa643('0x54')][0x0]};return _0x1bf984[_0xa643('0x18')](_0x2a7fa0);})[_0xa643('0x1a')](function(_0x3e9ac2){logger['error'](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x4f'),util[_0xa643('0x28')](_0x3e9ac2,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),'plivo','Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xa643('0x55'):if(_0x4b4903[_0xa643('0x30')]&&_0x4b4903[_0xa643('0x2b')]){if(_0x4b4903['baseUrl']){var _0x514657={'method':_0xa643('0x35'),'uri':_0x4b4903['baseUrl']+_0xa643('0x56'),'body':{'username':_0x4b4903[_0xa643('0x30')],'password':_0x4b4903[_0xa643('0x2b')]},'json':!![]};return rp(_0x514657)[_0xa643('0x17')](function(_0x38f3de){var _0xa22bf5={'method':_0xa643('0x35'),'uri':_0x4b4903[_0xa643('0x57')]+_0xa643('0x58'),'body':{'messages':[{'from':_0x4b4903['phone'],'destinations':[{'to':_0x44dca2[_0xa643('0x20')]}],'text':_0x44dca2['body'],'notifyUrl':_0x4b4903[_0xa643('0x23')]+'/api/sms/messages/'+_0x44dca2['id']+_0xa643('0x24')+_0x4b4903[_0xa643('0x25')],'notifyContentType':_0xa643('0x59'),'callbackData':_0x4b4903[_0xa643('0x20')]+';'+_0x44dca2['body']}]},'headers':{'Authorization':_0xa643('0x5a')+_0x38f3de['token']},'json':!![]};return rp(_0xa22bf5)['then'](function(_0x4ba9e4){if(_0x4ba9e4['messages']){var _0x5e1f8d={'messageId':_0x4ba9e4['messages'][0x0][_0xa643('0x5b')]};if(!_0x4b4903[_0xa643('0x3a')]){_0x5e1f8d[_0xa643('0x3b')]=!![];}return _0x1bf984[_0xa643('0x18')](_0x5e1f8d);}else{return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x55'),util[_0xa643('0x28')](_0x4ba9e4,{'showHidden':![],'depth':null}));}});})[_0xa643('0x1a')](function(_0x5013a1){return logger['error'](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x55'),util['inspect'](_0x5013a1,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0xa643('0x5c'));}}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),'afterCreate',_0xa643('0x55'),_0xa643('0x3e'));}break;case'csc':var _0x1b792e=require('crypto');if(_0x4b4903['apiKey']){var _0x4d8d11={};_0x4d8d11['login']=_0x4b4903[_0xa643('0x30')];_0x4d8d11[_0xa643('0x20')]=_0x44dca2['phone'];_0x4d8d11[_0xa643('0x2e')]=_0x4b4903[_0xa643('0x20')];_0x4d8d11['text']=_0x44dca2['body'];_0x4d8d11[_0xa643('0x5d')]=+new Date();var _0x48093a='';var _0x2a3171='';var _0x1e1117=Object[_0xa643('0x5e')](_0x4d8d11);_0x1e1117[_0xa643('0x5f')]();for(var _0x2a1f5c=0x0;_0x2a1f5c<_0x1e1117['length'];_0x2a1f5c++){if(_0x48093a!=''){_0x48093a+='&';}_0x48093a+=_0x1e1117[_0x2a1f5c]+'='+encodeURIComponent(_0x4d8d11[_0x1e1117[_0x2a1f5c]]);_0x2a3171+=_0x4d8d11[_0x1e1117[_0x2a1f5c]];}_0x2a3171+=_0x4b4903[_0xa643('0x60')];_0x2a3171=_0x1b792e[_0xa643('0x61')](_0xa643('0x62'))['update'](_0x2a3171)['digest'](_0xa643('0x63'));if(_0x48093a!==''){_0x48093a+='&';}_0x48093a+=_0xa643('0x64')+_0x2a3171;var _0x368844={'method':_0xa643('0x32'),'uri':_0x4b4903[_0xa643('0x57')]+_0xa643('0x65')+_0x48093a,'json':!![]};return rp(_0x368844)[_0xa643('0x17')](function(_0x116431){var _0x571274=Object[_0xa643('0x5e')](_0x116431);if(_0x116431[_0x571274[0x0]][_0xa643('0x1b')]&&parseInt(_0x116431[_0x571274[0x0]][_0xa643('0x1b')])===0x0){var _0x4b7618={'messageId':_0x116431[_0x571274[0x0]][_0xa643('0x66')]};if(!_0x4b4903['deliveryReport']){_0x4b7618['read']=!![];}return _0x1bf984[_0xa643('0x18')](_0x4b7618);}else{return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x67'),util['inspect'](_0x116431[_0xa643('0x1b')],{'showHidden':![],'depth':null}));}})[_0xa643('0x1a')](function(_0x53c081){return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),'csc',util[_0xa643('0x28')](_0x53c081,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa643('0x3c'),'afterCreate',_0xa643('0x67'),_0xa643('0x68'));}break;case'clickatell':if(_0x4b4903[_0xa643('0x60')]){var _0x1b9eec={'method':_0xa643('0x35'),'uri':_0xa643('0x69'),'headers':{'Authorization':_0x4b4903[_0xa643('0x60')]},'body':{'content':_0x44dca2[_0xa643('0x2c')],'to':[_0x44dca2[_0xa643('0x20')]],'from':_0x4b4903[_0xa643('0x20')],'binary':![],'clientMessageId':_0xa643('0x6a'),'charset':_0xa643('0x6b')},'json':!![]};rp(_0x1b9eec)[_0xa643('0x17')](function(_0x3eb570){if(!_0x3eb570[_0xa643('0x1b')]){var _0x17a249={'messageId':_0x3eb570['messages'][0x0][_0xa643('0x6c')]};if(!_0x4b4903[_0xa643('0x3a')]){_0x17a249[_0xa643('0x3b')]=!![];}return _0x1bf984[_0xa643('0x18')](_0x17a249);}else{return logger['error'](_0xa643('0x3c'),'afterCreate',_0xa643('0x6d'),util[_0xa643('0x28')](_0x3eb570[_0xa643('0x1b')],{'showHidden':![],'depth':null}));}})[_0xa643('0x1a')](function(_0x50695b){return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x6d'),util[_0xa643('0x28')](_0x50695b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x6d'),_0xa643('0x68'));}break;case _0xa643('0x6e'):if(_0x4b4903[_0xa643('0x30')]&&_0x4b4903['password']){var _0x5bbf9b=util[_0xa643('0x44')](_0xa643('0x45'),_0x4b4903[_0xa643('0x30')],_0x4b4903[_0xa643('0x2b')]);var _0x598c83={'method':'POST','uri':_0xa643('0x6f')+_0x4b4903['accountId']+_0xa643('0x70'),'body':{'to':[_0x44dca2[_0xa643('0x20')]],'text':_0x44dca2[_0xa643('0x2c')],'from':_0x4b4903[_0xa643('0x20')],'applicationId':_0x4b4903[_0xa643('0x71')]},'headers':{'Authorization':util[_0xa643('0x44')](_0xa643('0x47'),new Buffer(_0x5bbf9b)[_0xa643('0x48')]('base64'))},'json':!![]};rp(_0x598c83)['then'](function(_0x37bf16){if(_0x37bf16['id']){var _0x25498f={'messageId':_0x37bf16['id']};return _0x1bf984[_0xa643('0x18')](_0x25498f);}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),'bandwidth',util[_0xa643('0x28')](_0x37bf16,{'showHidden':![],'depth':null}));}})[_0xa643('0x1a')](function(_0x355df5){logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x6e'),util[_0xa643('0x28')](_0x355df5,{'showHidden':![],'depth':null}));});}else{logger[_0xa643('0x1b')](_0xa643('0x3c'),'afterCreate',_0xa643('0x6e'),_0xa643('0x3e'));}break;case _0xa643('0x72'):if(_0x4b4903[_0xa643('0x60')]){var _0x3bd515={};var _0x368844={'method':_0xa643('0x35'),'uri':_0xa643('0x73'),'headers':{'Authorization':_0xa643('0x74')+_0x4b4903[_0xa643('0x60')],'Content-Type':_0xa643('0x59')},'body':{'from':_0x4b4903[_0xa643('0x20')],'to':_0x44dca2['phone'],'text':_0x44dca2['body']},'json':!![]};return rp(_0x368844)[_0xa643('0x17')](function(_0x13ef03){if(_0x13ef03[_0xa643('0x75')]==0xca){_0x3bd515[_0xa643('0x76')]=_0x13ef03;var _0x44daef={'method':_0xa643('0x35'),'uri':_0xa643('0x77'),'headers':{'Authorization':_0xa643('0x74')+_0x4b4903[_0xa643('0x60')],'Content-Type':_0xa643('0x59')},'body':{'refid':_0x3bd515[_0xa643('0x76')][_0xa643('0x78')]},'json':!![]};return rp(_0x44daef)[_0xa643('0x17')](function(_0xf4d10b){_0x3bd515['status']=_0xf4d10b;var _0x4617b3={'messageId':_0x3bd515['message']['refid'],'read':!![]};return _0x1bf984[_0xa643('0x18')](_0x4617b3);});}else{return logger[_0xa643('0x1b')](_0xa643('0x3c'),_0xa643('0x27'),_0xa643('0x72'),util['inspect'](_0x13ef03,{'showHidden':![],'depth':null}));}})[_0xa643('0x1a')](function(_0x4c70b1){return logger[_0xa643('0x1b')](_0xa643('0x3c'),'afterCreate','intelepeer',util[_0xa643('0x28')](_0x4c70b1,{'showHidden':![],'depth':null}));});}else{return logger[_0xa643('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa643('0x72'),_0xa643('0x79'));}break;}}})['finally'](function(){_0x488229();});}else{_0x488229();}}},'charset':_0xa643('0x7a'),'collate':_0xa643('0x7b')});}; \ No newline at end of file +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 diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 0b3be0a..fef49f1 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 _0x16e7=['error','code','message','result','catch','CreateSmsMessage','create','options','raw','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x374eb3,_0x478e95){var _0x9f8f35=function(_0x14aab3){while(--_0x14aab3){_0x374eb3['push'](_0x374eb3['shift']());}};_0x9f8f35(++_0x478e95);}(_0x16e7,0x17d));var _0x716e=function(_0x3ee48d,_0x3395ae){_0x3ee48d=_0x3ee48d-0x0;var _0x1c3cea=_0x16e7[_0x3ee48d];return _0x1c3cea;};'use strict';var _=require(_0x716e('0x0'));var util=require('util');var moment=require(_0x716e('0x1'));var BPromise=require(_0x716e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x716e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x716e('0x4'));var logger=require(_0x716e('0x5'))('rpc');var config=require(_0x716e('0x6'));var jayson=require(_0x716e('0x7'));var client=jayson[_0x716e('0x8')][_0x716e('0x9')]({'port':0x232a});config[_0x716e('0xa')]=_[_0x716e('0xb')](config[_0x716e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x716e('0xc'))(new Redis(config[_0x716e('0xa')]));require(_0x716e('0xd'))['register'](socket);function respondWithRpcPromise(_0x124635,_0x28661b,_0xe697d5){return new BPromise(function(_0x3bba09,_0x4f0f00){return client[_0x716e('0xe')](_0x124635,_0xe697d5)[_0x716e('0xf')](function(_0xb5c2ae){logger[_0x716e('0x10')](_0x716e('0x11'),_0x28661b,_0x716e('0x12'));logger[_0x716e('0x13')](_0x716e('0x14'),_0x28661b,_0x716e('0x12'),JSON[_0x716e('0x15')](_0xb5c2ae));if(_0xb5c2ae[_0x716e('0x16')]){if(_0xb5c2ae['error'][_0x716e('0x17')]===0x1f4){logger[_0x716e('0x16')](_0x716e('0x11'),_0x28661b,_0xb5c2ae[_0x716e('0x16')]['message']);return _0x4f0f00(_0xb5c2ae[_0x716e('0x16')][_0x716e('0x18')]);}logger[_0x716e('0x16')](_0x716e('0x11'),_0x28661b,_0xb5c2ae[_0x716e('0x16')][_0x716e('0x18')]);return _0x3bba09(_0xb5c2ae[_0x716e('0x16')][_0x716e('0x18')]);}else{logger[_0x716e('0x10')](_0x716e('0x11'),_0x28661b,_0x716e('0x12'));_0x3bba09(_0xb5c2ae[_0x716e('0x19')][_0x716e('0x18')]);}})[_0x716e('0x1a')](function(_0x12e1e0){logger[_0x716e('0x16')](_0x716e('0x11'),_0x28661b,_0x12e1e0);_0x4f0f00(_0x12e1e0);});});}exports[_0x716e('0x1b')]=function(_0x2b9a7a){var _0x35fcba=this;return new Promise(function(_0x1c75b8,_0x5656bc){return db['SmsMessage'][_0x716e('0x1c')](_0x2b9a7a['body'],{'raw':_0x2b9a7a[_0x716e('0x1d')]?_0x2b9a7a[_0x716e('0x1d')][_0x716e('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x4f766c){logger[_0x716e('0x10')](_0x716e('0x1b'),_0x2b9a7a);logger[_0x716e('0x13')](_0x716e('0x1b'),_0x2b9a7a,JSON[_0x716e('0x15')](_0x4f766c));_0x1c75b8(_0x4f766c);})[_0x716e('0x1a')](function(_0x31f54f){logger['error'](_0x716e('0x1b'),_0x31f54f['message'],_0x2b9a7a);_0x5656bc(_0x35fcba[_0x716e('0x16')](0x1f4,_0x31f54f[_0x716e('0x18')]));});});}; \ No newline at end of file +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 diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f0ac786..b9f2916 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 _0xec59=['remove','removeListener','smsMessage:','./smsMessage.events','save'];(function(_0x2abd5e,_0x1a6994){var _0x389391=function(_0x3c4a7b){while(--_0x3c4a7b){_0x2abd5e['push'](_0x2abd5e['shift']());}};_0x389391(++_0x1a6994);}(_0xec59,0x71));var _0x9ec5=function(_0xd421d7,_0x59635e){_0xd421d7=_0xd421d7-0x0;var _0x4a8eb4=_0xec59[_0xd421d7];return _0x4a8eb4;};'use strict';var SmsMessageEvents=require(_0x9ec5('0x0'));var events=[_0x9ec5('0x1'),_0x9ec5('0x2'),'update'];function createListener(_0x75dfe7,_0x556b41){return function(_0x155d6b){_0x556b41['emit'](_0x75dfe7,_0x155d6b);};}function removeListener(_0x13737e,_0x25dcf9){return function(){SmsMessageEvents[_0x9ec5('0x3')](_0x13737e,_0x25dcf9);};}exports['register']=function(_0x58ad70){for(var _0x53e15c=0x0,_0x4ff951=events['length'];_0x53e15c<_0x4ff951;_0x53e15c++){var _0x18ec0f=events[_0x53e15c];var _0x678f2c=createListener(_0x9ec5('0x4')+_0x18ec0f,_0x58ad70);SmsMessageEvents['on'](_0x18ec0f,_0x678f2c);}}; \ No newline at end of file +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 diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 67a1c6a..9499c6d 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 _0x66e8=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0x66e8,0x10e));var _0x866e=function(_0x3017bb,_0x5b6b7b){_0x3017bb=_0x3017bb-0x0;var _0x268f07=_0x66e8[_0x3017bb];return _0x268f07;};'use strict';var multer=require(_0x866e('0x0'));var util=require(_0x866e('0x1'));var path=require(_0x866e('0x2'));var timeout=require('connect-timeout');var express=require(_0x866e('0x3'));var router=express[_0x866e('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x866e('0x5'));var config=require(_0x866e('0x6'));var controller=require(_0x866e('0x7'));router[_0x866e('0x8')]('/',auth['isAuthenticated'](),controller[_0x866e('0x9')]);router['get'](_0x866e('0xa'),auth[_0x866e('0xb')](),controller[_0x866e('0xc')]);router[_0x866e('0x8')](_0x866e('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x866e('0xe'),auth[_0x866e('0xb')](),controller['getMembers']);router['get'](_0x866e('0xf'),auth[_0x866e('0xb')](),controller[_0x866e('0x10')]);router[_0x866e('0x8')]('/:id/users',auth[_0x866e('0xb')](),controller[_0x866e('0x11')]);router['post']('/',auth[_0x866e('0xb')](),controller['create']);router[_0x866e('0x12')]('/:id/teams',auth[_0x866e('0xb')](),controller[_0x866e('0x13')]);router[_0x866e('0x12')]('/:id/users',auth[_0x866e('0xb')](),controller[_0x866e('0x14')]);router[_0x866e('0x15')](_0x866e('0xd'),auth[_0x866e('0xb')](),controller['update']);router[_0x866e('0x16')](_0x866e('0xd'),auth[_0x866e('0xb')](),controller['destroy']);router['delete'](_0x866e('0xf'),auth[_0x866e('0xb')](),controller[_0x866e('0x17')]);router[_0x866e('0x16')](_0x866e('0x18'),auth['isAuthenticated'](),controller[_0x866e('0x19')]);module[_0x866e('0x1a')]=router; \ No newline at end of file +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 diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index ad9e1a0..6bfeebe 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 _0xc136=['name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports'];(function(_0x3078ad,_0x496a9c){var _0x2ad4c2=function(_0x8d1d66){while(--_0x8d1d66){_0x3078ad['push'](_0x3078ad['shift']());}};_0x2ad4c2(++_0x496a9c);}(_0xc136,0xc4));var _0x6c13=function(_0x49e8f8,_0x462a0f){_0x49e8f8=_0x49e8f8-0x0;var _0x4c0cc4=_0xc136[_0x49e8f8];return _0x4c0cc4;};'use strict';var Sequelize=require(_0x6c13('0x0'));module[_0x6c13('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x6c13('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x6c13('0x3')]},'timeout':{'type':Sequelize[_0x6c13('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6c13('0x5')](_0x6c13('0x6'),_0x6c13('0x7'),_0x6c13('0x8'))}}; \ No newline at end of file +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 diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 2c6a711..9d90cc7 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 _0x0852=['nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','create','body','user','role','SmsQueues','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','agent','smsPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','findOne','addTeams','ids','Team','Agents','online','voicePause','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','all','compact','value','transaction','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x5baf05,_0x353e83){var _0x30463a=function(_0x5e2d83){while(--_0x5e2d83){_0x5baf05['push'](_0x5baf05['shift']());}};_0x30463a(++_0x353e83);}(_0x0852,0xe5));var _0x2085=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x0852[_0x49b207];return _0x2dc8fa;};'use strict';var emlformat=require(_0x2085('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2085('0x1'));var jsonpatch=require(_0x2085('0x2'));var rp=require('request-promise');var moment=require(_0x2085('0x3'));var BPromise=require(_0x2085('0x4'));var Mustache=require(_0x2085('0x5'));var util=require(_0x2085('0x6'));var path=require(_0x2085('0x7'));var sox=require('sox');var csv=require(_0x2085('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2085('0x9'));var squel=require(_0x2085('0xa'));var crypto=require('crypto');var jsforce=require(_0x2085('0xb'));var deskjs=require(_0x2085('0xc'));var toCsv=require(_0x2085('0x8'));var querystring=require(_0x2085('0xd'));var Papa=require(_0x2085('0xe'));var Redis=require(_0x2085('0xf'));var authService=require(_0x2085('0x10'));var qs=require(_0x2085('0x11'));var as=require(_0x2085('0x12'));var hardwareService=require(_0x2085('0x13'));var logger=require(_0x2085('0x14'))(_0x2085('0x15'));var utils=require('../../config/utils');var config=require(_0x2085('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2085('0x17'))['db'];config[_0x2085('0x18')]=_[_0x2085('0x19')](config[_0x2085('0x18')],{'host':_0x2085('0x1a'),'port':0x18eb});var socket=require(_0x2085('0x1b'))(new Redis(config['redis']));require('./smsQueue.socket')[_0x2085('0x1c')](socket);function respondWithStatusCode(_0x2b533a,_0x4ceacb){_0x4ceacb=_0x4ceacb||0xcc;return function(_0xc9038c){if(_0xc9038c){return _0x2b533a[_0x2085('0x1d')](_0x4ceacb);}return _0x2b533a['status'](_0x4ceacb)[_0x2085('0x1e')]();};}function respondWithResult(_0x15b770,_0x2432ad){_0x2432ad=_0x2432ad||0xc8;return function(_0x5338c7){if(_0x5338c7){return _0x15b770['status'](_0x2432ad)[_0x2085('0x1f')](_0x5338c7);}};}function respondWithFilteredResult(_0x51eccc,_0x2c82b0){return function(_0x52fd81){if(_0x52fd81){var _0x14967f=typeof _0x2c82b0[_0x2085('0x20')]===_0x2085('0x21')&&typeof _0x2c82b0[_0x2085('0x22')]===_0x2085('0x21');var _0x159522=_0x52fd81[_0x2085('0x23')];var _0x4d2481=_0x14967f?0x0:_0x2c82b0['offset'];var _0x4496a0=_0x14967f?_0x52fd81[_0x2085('0x23')]:_0x2c82b0['offset']+_0x2c82b0[_0x2085('0x22')];var _0x49d9a1;if(_0x4496a0>=_0x159522){_0x4496a0=_0x159522;_0x49d9a1=0xc8;}else{_0x49d9a1=0xce;}_0x51eccc[_0x2085('0x24')](_0x49d9a1);return _0x51eccc['set'](_0x2085('0x25'),_0x4d2481+'-'+_0x4496a0+'/'+_0x159522)[_0x2085('0x1f')](_0x52fd81);}return null;};}function patchUpdates(_0x533b24){return function(_0x12ed76){try{jsonpatch[_0x2085('0x26')](_0x12ed76,_0x533b24,!![]);}catch(_0x10bdae){return BPromise[_0x2085('0x27')](_0x10bdae);}return _0x12ed76[_0x2085('0x28')]();};}function saveUpdates(_0x11fb07,_0x40afb5){return function(_0x530679){if(_0x530679){return _0x530679[_0x2085('0x29')](_0x11fb07)[_0x2085('0x2a')](function(_0x12e6c7){return _0x12e6c7;});}return null;};}function removeEntity(_0x522e7a,_0x53b293){return function(_0x3374f7){if(_0x3374f7){return _0x3374f7[_0x2085('0x2b')]()[_0x2085('0x2a')](function(){var _0x8231=_0x3374f7[_0x2085('0x2c')]({'plain':!![]});var _0x4c524c='SmsQueues';return db[_0x2085('0x2d')]['destroy']({'where':{'type':_0x4c524c,'resourceId':_0x8231['id']}})[_0x2085('0x2a')](function(){return _0x3374f7;});})[_0x2085('0x2a')](function(){_0x522e7a[_0x2085('0x24')](0xcc)[_0x2085('0x1e')]();});}};}function handleEntityNotFound(_0x1785fc,_0x53e121){return function(_0x35c9a4){if(!_0x35c9a4){_0x1785fc[_0x2085('0x1d')](0x194);}return _0x35c9a4;};}function handleError(_0x208914,_0x5c1660){_0x5c1660=_0x5c1660||0x1f4;return function(_0x21150e){logger[_0x2085('0x2e')](_0x21150e[_0x2085('0x2f')]);if(_0x21150e[_0x2085('0x30')]){delete _0x21150e[_0x2085('0x30')];}_0x208914[_0x2085('0x24')](_0x5c1660)[_0x2085('0x31')](_0x21150e);};}exports[_0x2085('0x32')]=function(_0x288c6e,_0xfb6ac0){var _0x4151ef={},_0x28fbb6={},_0x3a97a3={'count':0x0,'rows':[]};var _0x3d3ddd=_[_0x2085('0x33')](db[_0x2085('0x34')][_0x2085('0x35')],function(_0x13ff3f){return{'name':_0x13ff3f['fieldName'],'type':_0x13ff3f[_0x2085('0x36')]['key']};});_0x28fbb6[_0x2085('0x37')]=_['map'](_0x3d3ddd,_0x2085('0x30'));_0x28fbb6[_0x2085('0x38')]=_[_0x2085('0x39')](_0x288c6e[_0x2085('0x38')]);_0x28fbb6['filters']=_[_0x2085('0x3a')](_0x28fbb6[_0x2085('0x37')],_0x28fbb6[_0x2085('0x38')]);_0x4151ef['attributes']=_[_0x2085('0x3a')](_0x28fbb6[_0x2085('0x37')],qs['fields'](_0x288c6e[_0x2085('0x38')][_0x2085('0x3b')]));_0x4151ef[_0x2085('0x3c')]=_0x4151ef[_0x2085('0x3c')][_0x2085('0x3d')]?_0x4151ef[_0x2085('0x3c')]:_0x28fbb6[_0x2085('0x37')];if(!_0x288c6e[_0x2085('0x38')][_0x2085('0x3e')](_0x2085('0x3f'))){_0x4151ef['limit']=qs[_0x2085('0x22')](_0x288c6e['query'][_0x2085('0x22')]);_0x4151ef[_0x2085('0x20')]=qs[_0x2085('0x20')](_0x288c6e[_0x2085('0x38')][_0x2085('0x20')]);}_0x4151ef[_0x2085('0x40')]=qs[_0x2085('0x41')](_0x288c6e[_0x2085('0x38')][_0x2085('0x41')]);_0x4151ef[_0x2085('0x42')]=qs[_0x2085('0x43')](_[_0x2085('0x44')](_0x288c6e[_0x2085('0x38')],_0x28fbb6[_0x2085('0x43')]),_0x3d3ddd);if(_0x288c6e[_0x2085('0x38')][_0x2085('0x45')]){_0x4151ef[_0x2085('0x42')]=_[_0x2085('0x46')](_0x4151ef[_0x2085('0x42')],{'$or':_['map'](_0x3d3ddd,function(_0x1dfac6){if(_0x1dfac6[_0x2085('0x36')]!==_0x2085('0x47')){var _0x1f0c2a={};_0x1f0c2a[_0x1dfac6[_0x2085('0x30')]]={'$like':'%'+_0x288c6e[_0x2085('0x38')][_0x2085('0x45')]+'%'};return _0x1f0c2a;}})});}_0x4151ef=_[_0x2085('0x46')]({},_0x4151ef,_0x288c6e[_0x2085('0x48')]);var _0xc1271e={'where':_0x4151ef['where']};return db[_0x2085('0x34')][_0x2085('0x23')](_0xc1271e)[_0x2085('0x2a')](function(_0x4c92a3){_0x3a97a3[_0x2085('0x23')]=_0x4c92a3;if(_0x288c6e[_0x2085('0x38')]['includeAll']){_0x4151ef[_0x2085('0x49')]=[{'all':!![]}];}return db[_0x2085('0x34')][_0x2085('0x4a')](_0x4151ef);})[_0x2085('0x2a')](function(_0xed3aeb){_0x3a97a3[_0x2085('0x4b')]=_0xed3aeb;return _0x3a97a3;})['then'](respondWithFilteredResult(_0xfb6ac0,_0x4151ef))[_0x2085('0x4c')](handleError(_0xfb6ac0,null));};exports[_0x2085('0x4d')]=function(_0xa4f55c,_0x3f78bd){var _0x376bc9={'raw':!![],'where':{'id':_0xa4f55c['params']['id']}},_0x35383f={};_0x35383f[_0x2085('0x37')]=_[_0x2085('0x39')](db[_0x2085('0x34')][_0x2085('0x35')]);_0x35383f[_0x2085('0x38')]=_[_0x2085('0x39')](_0xa4f55c['query']);_0x35383f[_0x2085('0x43')]=_['intersection'](_0x35383f['model'],_0x35383f[_0x2085('0x38')]);_0x376bc9[_0x2085('0x3c')]=_[_0x2085('0x3a')](_0x35383f[_0x2085('0x37')],qs[_0x2085('0x3b')](_0xa4f55c[_0x2085('0x38')][_0x2085('0x3b')]));_0x376bc9['attributes']=_0x376bc9['attributes'][_0x2085('0x3d')]?_0x376bc9[_0x2085('0x3c')]:_0x35383f[_0x2085('0x37')];if(_0xa4f55c[_0x2085('0x38')][_0x2085('0x4e')]){_0x376bc9[_0x2085('0x49')]=[{'all':!![]}];}_0x376bc9=_[_0x2085('0x46')]({},_0x376bc9,_0xa4f55c[_0x2085('0x48')]);return db['SmsQueue']['find'](_0x376bc9)[_0x2085('0x2a')](handleEntityNotFound(_0x3f78bd,null))[_0x2085('0x2a')](respondWithResult(_0x3f78bd,null))['catch'](handleError(_0x3f78bd,null));};exports[_0x2085('0x4f')]=function(_0x3a2daa,_0x1e9eae){return db[_0x2085('0x34')][_0x2085('0x4f')](_0x3a2daa[_0x2085('0x50')],{})[_0x2085('0x2a')](function(_0xc22cf1){var _0x23691b=_0x3a2daa[_0x2085('0x51')][_0x2085('0x2c')]({'plain':!![]});if(!_0x23691b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23691b[_0x2085('0x52')]===_0x2085('0x51')){var _0xd2fbdf=_0xc22cf1[_0x2085('0x2c')]({'plain':!![]});var _0x349b1f=_0x2085('0x53');return db[_0x2085('0x54')][_0x2085('0x55')]({'where':{'name':_0x349b1f,'userProfileId':_0x23691b['userProfileId']},'raw':!![]})[_0x2085('0x2a')](function(_0x54730f){if(_0x54730f&&_0x54730f[_0x2085('0x56')]===0x0){return db['UserProfileResource'][_0x2085('0x4f')]({'name':_0xd2fbdf[_0x2085('0x30')],'resourceId':_0xd2fbdf['id'],'type':_0x54730f['name'],'sectionId':_0x54730f['id']},{})['then'](function(){return _0xc22cf1;});}else{return _0xc22cf1;}})[_0x2085('0x4c')](function(_0x199321){logger['error'](_0x2085('0x57'),_0x199321);throw _0x199321;});}return _0xc22cf1;})[_0x2085('0x2a')](respondWithResult(_0x1e9eae,0xc9))[_0x2085('0x4c')](handleError(_0x1e9eae,null));};exports[_0x2085('0x29')]=function(_0x189524,_0x412bc8){if(_0x189524[_0x2085('0x50')]['id']){delete _0x189524[_0x2085('0x50')]['id'];}return db['SmsQueue'][_0x2085('0x55')]({'where':{'id':_0x189524[_0x2085('0x58')]['id']}})[_0x2085('0x2a')](handleEntityNotFound(_0x412bc8,null))[_0x2085('0x2a')](saveUpdates(_0x189524[_0x2085('0x50')],null))['then'](respondWithResult(_0x412bc8,null))['catch'](handleError(_0x412bc8,null));};exports[_0x2085('0x2b')]=function(_0xc3a75b,_0x2f3d6c){return db[_0x2085('0x34')]['find']({'where':{'id':_0xc3a75b['params']['id']}})[_0x2085('0x2a')](handleEntityNotFound(_0x2f3d6c,null))[_0x2085('0x2a')](removeEntity(_0x2f3d6c,null))[_0x2085('0x4c')](handleError(_0x2f3d6c,null));};exports[_0x2085('0x59')]=function(_0x1a5d1d,_0xdef834){return db[_0x2085('0x34')][_0x2085('0x59')]()[_0x2085('0x2a')](respondWithResult(_0xdef834,null))[_0x2085('0x4c')](handleError(_0xdef834,null));};exports[_0x2085('0x5a')]=function(_0x257fa7,_0x5ae09b,_0x22e771){var _0x351d0f={'raw':!![],'where':{}},_0xd25420={},_0x3a47a4;return db[_0x2085('0x34')]['findOne']({'where':{'id':_0x257fa7['params']['id']}})[_0x2085('0x2a')](handleEntityNotFound(_0x5ae09b,null))[_0x2085('0x2a')](function(_0x299e45){if(_0x299e45){_0x3a47a4=_0x299e45[_0x2085('0x2c')]({'plain':!![]});_0xd25420[_0x2085('0x37')]=_['keys'](db['UserSmsQueue'][_0x2085('0x35')]);_0xd25420[_0x2085('0x38')]=_[_0x2085('0x39')](_0x257fa7[_0x2085('0x38')]);_0xd25420[_0x2085('0x43')]=_[_0x2085('0x3a')](_0xd25420['model'],_0xd25420[_0x2085('0x38')]);_0x351d0f[_0x2085('0x3c')]=_['intersection'](_0xd25420[_0x2085('0x37')],qs['fields'](_0x257fa7[_0x2085('0x38')][_0x2085('0x3b')]));_0x351d0f['attributes']=_0x351d0f[_0x2085('0x3c')][_0x2085('0x3d')]?_0x351d0f[_0x2085('0x3c')]:_0xd25420[_0x2085('0x37')];if(!_0x257fa7[_0x2085('0x38')][_0x2085('0x3e')]('nolimit')){_0x351d0f[_0x2085('0x22')]=qs['limit'](_0x257fa7[_0x2085('0x38')][_0x2085('0x22')]);_0x351d0f['offset']=qs[_0x2085('0x20')](_0x257fa7[_0x2085('0x38')]['offset']);}_0x351d0f['order']=qs[_0x2085('0x41')](_0x257fa7[_0x2085('0x38')]['sort']);_0x351d0f['where']=qs[_0x2085('0x43')](_['pick'](_0x257fa7[_0x2085('0x38')],_0xd25420[_0x2085('0x43')]));_0x351d0f['where'][_0x2085('0x5b')]=_0x299e45['id'];if(_0x257fa7[_0x2085('0x38')][_0x2085('0x45')]){_0x351d0f[_0x2085('0x42')]=_['merge'](_0x351d0f[_0x2085('0x42')],{'$or':_[_0x2085('0x33')](_0x351d0f[_0x2085('0x3c')],function(_0x56e11d){var _0x167a34={};_0x167a34[_0x56e11d]={'$like':'%'+_0x257fa7[_0x2085('0x38')][_0x2085('0x45')]+'%'};return _0x167a34;})});}_0x351d0f=_['merge']({},_0x351d0f,_0x257fa7[_0x2085('0x48')]);return db[_0x2085('0x5c')][_0x2085('0x4a')](_0x351d0f);}})[_0x2085('0x2a')](function(_0x50cc3d){if(_0x50cc3d){return db[_0x2085('0x5d')][_0x2085('0x5e')]({'where':{'id':_['map'](_0x50cc3d,_0x2085('0x5f')),'role':_0x2085('0x60')},'attributes':['id',_0x2085('0x30'),_0x2085('0x61'),_0x2085('0x62'),'createdAt']});}})[_0x2085('0x2a')](function(_0x386488){if(_0x386488){return{'count':_0x386488[_0x2085('0x23')],'rows':_[_0x2085('0x33')](_0x386488['rows'],function(_0x1f2260){return{'membername':_0x1f2260['name'],'UserId':_0x1f2260['id'],'queue_name':_0x3a47a4[_0x2085('0x30')],'SmsQueueId':_0x3a47a4['id'],'interface':util[_0x2085('0x63')](_0x2085('0x64'),_0x2085('0x65'),_0x1f2260[_0x2085('0x30')]),'penalty':0x0,'paused':_0x1f2260[_0x2085('0x61')],'createdAt':_0x1f2260[_0x2085('0x66')],'updatedAt':_0x1f2260[_0x2085('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5ae09b,_0x351d0f))[_0x2085('0x4c')](handleError(_0x5ae09b,null));};exports[_0x2085('0x67')]=function(_0x4ccfd0,_0x6f6aa0,_0x4e2f29){var _0x17f428={};var _0x27064b={};var _0x54364b;var _0x462b05;return db['SmsQueue'][_0x2085('0x68')]({'where':{'id':_0x4ccfd0[_0x2085('0x58')]['id']}})['then'](handleEntityNotFound(_0x6f6aa0,null))['then'](function(_0x49e917){if(_0x49e917){_0x54364b=_0x49e917;_0x27064b[_0x2085('0x37')]=_['keys'](db['Team']['rawAttributes']);_0x27064b[_0x2085('0x38')]=_[_0x2085('0x39')](_0x4ccfd0[_0x2085('0x38')]);_0x27064b[_0x2085('0x43')]=_[_0x2085('0x3a')](_0x27064b[_0x2085('0x37')],_0x27064b[_0x2085('0x38')]);_0x17f428[_0x2085('0x3c')]=_['intersection'](_0x27064b[_0x2085('0x37')],qs['fields'](_0x4ccfd0[_0x2085('0x38')][_0x2085('0x3b')]));_0x17f428['attributes']=_0x17f428[_0x2085('0x3c')]['length']?_0x17f428[_0x2085('0x3c')]:_0x27064b[_0x2085('0x37')];_0x17f428[_0x2085('0x40')]=qs['sort'](_0x4ccfd0[_0x2085('0x38')][_0x2085('0x41')]);_0x17f428[_0x2085('0x42')]=qs[_0x2085('0x43')](_[_0x2085('0x44')](_0x4ccfd0['query'],_0x27064b[_0x2085('0x43')]));if(_0x4ccfd0[_0x2085('0x38')][_0x2085('0x45')]){_0x17f428[_0x2085('0x42')]=_['merge'](_0x17f428[_0x2085('0x42')],{'$or':_[_0x2085('0x33')](_0x17f428[_0x2085('0x3c')],function(_0x56d1a4){var _0x5eda1f={};_0x5eda1f[_0x56d1a4]={'$like':'%'+_0x4ccfd0['query'][_0x2085('0x45')]+'%'};return _0x5eda1f;})});}_0x17f428=_[_0x2085('0x46')]({},_0x17f428,_0x4ccfd0[_0x2085('0x48')]);return _0x54364b['getTeams'](_0x17f428);}})['then'](function(_0x4ed196){if(_0x4ed196){_0x462b05=_0x4ed196[_0x2085('0x3d')];if(!_0x4ccfd0[_0x2085('0x38')]['hasOwnProperty'](_0x2085('0x3f'))){_0x17f428['limit']=qs[_0x2085('0x22')](_0x4ccfd0[_0x2085('0x38')][_0x2085('0x22')]);_0x17f428[_0x2085('0x20')]=qs['offset'](_0x4ccfd0[_0x2085('0x38')]['offset']);}return _0x54364b[_0x2085('0x67')](_0x17f428);}})[_0x2085('0x2a')](function(_0x58636c){if(_0x58636c){return _0x58636c?{'count':_0x462b05,'rows':_0x58636c}:null;}})[_0x2085('0x2a')](respondWithResult(_0x6f6aa0,null))['catch'](handleError(_0x6f6aa0,null));};exports[_0x2085('0x69')]=function(_0x2a8f08,_0x6086b5,_0x1c90d2){var _0x3b128d=_0x2a8f08[_0x2085('0x50')][_0x2085('0x6a')];return db[_0x2085('0x6b')][_0x2085('0x4a')]({'where':{'id':_0x3b128d},'attributes':['id'],'include':[{'model':db[_0x2085('0x5d')],'as':_0x2085('0x6c'),'attributes':['id','name',_0x2085('0x6d'),_0x2085('0x6e'),'interface'],'raw':!![]}]})[_0x2085('0x2a')](function(_0x2b4b30){if(_0x2b4b30){var _0xbab072=_['flatMap'](_0x2b4b30,function(_0x3fec36){var _0x46acc8=_0x3fec36[_0x2085('0x2c')]({'plain':!![]});return _0x46acc8[_0x2085('0x6c')];});return db[_0x2085('0x34')][_0x2085('0x55')]({'where':{'id':_0x2a8f08[_0x2085('0x58')]['id']}})[_0x2085('0x2a')](function(_0x971189){return db['sequelize']['transaction'](function(_0x14711a){return _0x971189[_0x2085('0x69')](_0x3b128d,{'transaction':_0x14711a})[_0x2085('0x2a')](function(){return BPromise[_0x2085('0x6f')](_0xbab072,function(_0x2b552c){return db[_0x2085('0x5c')][_0x2085('0x70')]({'where':{'UserId':_0x2b552c['id'],'SmsQueueId':_0x2a8f08[_0x2085('0x58')]['id']},'transaction':_0x14711a});});})['then'](function(){_0xbab072[_0x2085('0x71')](function(_0x5edd55){socket[_0x2085('0x72')]('userSmsQueue:save',{'UserId':_0x5edd55['id'],'SmsQueueId':_0x971189['id']});});});});});}})['then'](respondWithStatusCode(_0x6086b5,null))[_0x2085('0x4c')](handleError(_0x6086b5,null));};exports[_0x2085('0x73')]=function(_0x15ad36,_0x5b1c1e,_0x227107){return db[_0x2085('0x6b')][_0x2085('0x4a')]({'where':{'id':_0x15ad36['query'][_0x2085('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x2085('0x5d')],'as':_0x2085('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x2085('0x2a')](handleEntityNotFound(_0x5b1c1e,null))[_0x2085('0x2a')](function(_0x11fda6){var _0x59c9d7=_['map'](_0x11fda6,'id');var _0x33bd56=[];var _0x5379ce=[];var _0x371a4c=squel[_0x2085('0x74')]();_0x371a4c[_0x2085('0x75')](_0x2085('0x76'))[_0x2085('0x77')](_0x2085('0x78'),'tq')[_0x2085('0x79')](_0x2085('0x7a'),'ut',_0x2085('0x7b'))[_0x2085('0x42')](_0x2085('0x7c'),_0x15ad36['params']['id']);for(var _0x140063=0x0;_0x140063<_0x11fda6[_0x2085('0x3d')];_0x140063+=0x1){let _0x1cb19c=_0x11fda6[_0x140063];for(var _0x56b24d=0x0;_0x56b24d<_0x1cb19c[_0x2085('0x6c')][_0x2085('0x3d')];_0x56b24d+=0x1){let _0x50f315=_0x1cb19c[_0x2085('0x6c')][_0x56b24d];var _0x469dd5=_0x371a4c[_0x2085('0x7d')]();_0x469dd5[_0x2085('0x42')](_0x2085('0x7e'),_0x50f315['id']);_0x5379ce[_0x2085('0x7f')](db[_0x2085('0x80')][_0x2085('0x38')](_0x469dd5[_0x2085('0x81')](),{'type':db[_0x2085('0x80')][_0x2085('0x82')][_0x2085('0x83')]})[_0x2085('0x2a')](function(_0x697f8a){if(_0x697f8a[_0x2085('0x3d')]===0x1){return _0x50f315['id'];}else{var _0x227dab=_['every'](_[_0x2085('0x33')](_0x697f8a,_0x2085('0x84')),function(_0x5a9e91){return _['includes'](_0x59c9d7,_0x5a9e91);});if(_0x227dab){return _0x50f315['id'];}}}));}}return BPromise[_0x2085('0x85')](_0x5379ce)[_0x2085('0x2a')](function(_0x2ff44e){_0x33bd56=_(_0x33bd56)['union'](_0x2ff44e)[_0x2085('0x86')]()[_0x2085('0x87')]();return db[_0x2085('0x34')][_0x2085('0x55')]({'where':{'id':_0x15ad36[_0x2085('0x58')]['id']}})[_0x2085('0x2a')](function(_0x5f3cce){return db[_0x2085('0x80')][_0x2085('0x88')](function(_0x44c639){return _0x5f3cce[_0x2085('0x73')](_0x15ad36[_0x2085('0x38')][_0x2085('0x6a')],{'transaction':_0x44c639})[_0x2085('0x2a')](function(){if(!_[_0x2085('0x89')](_0x33bd56)){return _0x5f3cce['removeAgents'](_0x33bd56,{'transaction':_0x44c639});}})[_0x2085('0x2a')](function(){_0x33bd56[_0x2085('0x71')](function(_0x3ec0c9){socket[_0x2085('0x72')](_0x2085('0x8a'),{'UserId':_0x3ec0c9,'SmsQueueId':_0x5f3cce['id']});});});});});});})[_0x2085('0x2a')](respondWithStatusCode(_0x5b1c1e,null))['catch'](handleError(_0x5b1c1e,null));};exports[_0x2085('0x8b')]=function(_0x5df059,_0x4342b4,_0x3cfaa8){return db[_0x2085('0x34')][_0x2085('0x55')]({'where':{'id':_0x5df059['params']['id']}})[_0x2085('0x2a')](handleEntityNotFound(_0x4342b4,null))['then'](function(_0x5aa1ee){if(_0x5aa1ee){return _0x5aa1ee['addAgents'](_0x5df059[_0x2085('0x50')][_0x2085('0x6a')],_[_0x2085('0x8c')](_0x5df059['body'],[_0x2085('0x6a'),'id'])||{})[_0x2085('0x8d')](function(_0x584ddb){for(var _0x3392d8=0x0;_0x3392d8<_0x5df059['body'][_0x2085('0x6a')]['length'];_0x3392d8+=0x1){socket[_0x2085('0x72')](_0x2085('0x8e'),{'UserId':Number(_0x5df059['body']['ids'][_0x3392d8]),'SmsQueueId':Number(_0x5df059[_0x2085('0x58')]['id'])});}return _0x584ddb;});}})['then'](respondWithResult(_0x4342b4,null))[_0x2085('0x4c')](handleError(_0x4342b4,null));};exports['removeAgents']=function(_0x5d5842,_0xecc1ab,_0x2affa3){return db[_0x2085('0x34')][_0x2085('0x55')]({'where':{'id':_0x5d5842[_0x2085('0x58')]['id']}})[_0x2085('0x2a')](handleEntityNotFound(_0xecc1ab,null))[_0x2085('0x2a')](function(_0x31d150){if(_0x31d150){return _0x31d150[_0x2085('0x8f')](_0x5d5842[_0x2085('0x38')][_0x2085('0x6a')])['then'](function(){if(_[_0x2085('0x90')](_0x5d5842['query'][_0x2085('0x6a')])){for(var _0x2a5b92=0x0;_0x2a5b92<_0x5d5842[_0x2085('0x38')][_0x2085('0x6a')][_0x2085('0x3d')];_0x2a5b92+=0x1){socket[_0x2085('0x72')](_0x2085('0x8a'),{'UserId':Number(_0x5d5842[_0x2085('0x38')][_0x2085('0x6a')][_0x2a5b92]),'SmsQueueId':Number(_0x5d5842[_0x2085('0x58')]['id'])});}}else{socket['emit'](_0x2085('0x8a'),{'UserId':Number(_0x5d5842['query'][_0x2085('0x6a')]),'SmsQueueId':Number(_0x5d5842[_0x2085('0x58')]['id'])});}});}})[_0x2085('0x2a')](respondWithStatusCode(_0xecc1ab,null))[_0x2085('0x4c')](handleError(_0xecc1ab,null));};exports[_0x2085('0x91')]=function(_0x381b94,_0x5342f8,_0x58cb58){var _0x4b712a={};var _0x5511a2={};var _0x2e9ce7;var _0x13c095;return db[_0x2085('0x34')][_0x2085('0x68')]({'where':{'id':_0x381b94[_0x2085('0x58')]['id']}})[_0x2085('0x2a')](handleEntityNotFound(_0x5342f8,null))[_0x2085('0x2a')](function(_0x4a5808){if(_0x4a5808){_0x2e9ce7=_0x4a5808;_0x5511a2[_0x2085('0x37')]=_[_0x2085('0x39')](db['User']['rawAttributes']);_0x5511a2[_0x2085('0x38')]=_[_0x2085('0x39')](_0x381b94['query']);_0x5511a2['filters']=_[_0x2085('0x3a')](_0x5511a2[_0x2085('0x37')],_0x5511a2[_0x2085('0x38')]);_0x4b712a[_0x2085('0x3c')]=_[_0x2085('0x3a')](_0x5511a2[_0x2085('0x37')],qs[_0x2085('0x3b')](_0x381b94[_0x2085('0x38')]['fields']));_0x4b712a['attributes']=_0x4b712a[_0x2085('0x3c')][_0x2085('0x3d')]?_0x4b712a['attributes']:_0x5511a2[_0x2085('0x37')];_0x4b712a[_0x2085('0x40')]=qs[_0x2085('0x41')](_0x381b94['query'][_0x2085('0x41')]);_0x4b712a[_0x2085('0x42')]=qs['filters'](_[_0x2085('0x44')](_0x381b94[_0x2085('0x38')],_0x5511a2[_0x2085('0x43')]));if(_0x381b94[_0x2085('0x38')]['filter']){_0x4b712a[_0x2085('0x42')]=_[_0x2085('0x46')](_0x4b712a['where'],{'$or':_[_0x2085('0x33')](_0x4b712a[_0x2085('0x3c')],function(_0x1604ce){var _0x59a913={};_0x59a913[_0x1604ce]={'$like':'%'+_0x381b94['query'][_0x2085('0x45')]+'%'};return _0x59a913;})});}_0x4b712a=_[_0x2085('0x46')]({},_0x4b712a,_0x381b94[_0x2085('0x48')]);return _0x2e9ce7[_0x2085('0x91')](_0x4b712a);}})['then'](function(_0x2a51f6){if(_0x2a51f6){_0x13c095=_0x2a51f6[_0x2085('0x3d')];if(!_0x381b94['query'][_0x2085('0x3e')](_0x2085('0x3f'))){_0x4b712a['limit']=qs['limit'](_0x381b94[_0x2085('0x38')][_0x2085('0x22')]);_0x4b712a[_0x2085('0x20')]=qs[_0x2085('0x20')](_0x381b94[_0x2085('0x38')][_0x2085('0x20')]);}return _0x2e9ce7[_0x2085('0x91')](_0x4b712a);}})[_0x2085('0x2a')](function(_0x51aa92){if(_0x51aa92){return _0x51aa92?{'count':_0x13c095,'rows':_0x51aa92}:null;}})['then'](respondWithResult(_0x5342f8,null))[_0x2085('0x4c')](handleError(_0x5342f8,null));}; \ No newline at end of file +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 diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index d27e2fe..3a32003 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 _0x269e=['exports','../../mysqldb','SmsQueue','remove','emit','hasOwnProperty','hook'];(function(_0x56d4f3,_0xe302e4){var _0x2ab925=function(_0x55a811){while(--_0x55a811){_0x56d4f3['push'](_0x56d4f3['shift']());}};_0x2ab925(++_0xe302e4);}(_0x269e,0x158));var _0xe269=function(_0x3b4fe7,_0x33dc73){_0x3b4fe7=_0x3b4fe7-0x0;var _0x3f8ffc=_0x269e[_0x3b4fe7];return _0x3f8ffc;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xe269('0x0'))['db'][_0xe269('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xe269('0x2')};function emitEvent(_0x425422){return function(_0x3ed762,_0x1452ae,_0x2cc56b){SmsQueueEvents[_0xe269('0x3')](_0x425422+':'+_0x3ed762['id'],_0x3ed762);SmsQueueEvents[_0xe269('0x3')](_0x425422,_0x3ed762);_0x2cc56b(null);};}for(var e in events){if(events[_0xe269('0x4')](e)){var event=events[e];SmsQueue[_0xe269('0x5')](e,emitEvent(event));}}module[_0xe269('0x6')]=SmsQueueEvents; \ No newline at end of file +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 diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 3ca4b4b..595e31f 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 _0xc6dc=['util','../../config/logger','moment','bluebird','path','rimraf','./smsQueue.attributes','define','sms_queues','lodash'];(function(_0x30cb98,_0x2734cb){var _0x2d4f5b=function(_0x3b6519){while(--_0x3b6519){_0x30cb98['push'](_0x30cb98['shift']());}};_0x2d4f5b(++_0x2734cb);}(_0xc6dc,0x18f));var _0xcc6d=function(_0x4edc36,_0x501676){_0x4edc36=_0x4edc36-0x0;var _0x1d3738=_0xc6dc[_0x4edc36];return _0x1d3738;};'use strict';var _=require(_0xcc6d('0x0'));var util=require(_0xcc6d('0x1'));var logger=require(_0xcc6d('0x2'))('api');var moment=require(_0xcc6d('0x3'));var BPromise=require(_0xcc6d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc6d('0x5'));var rimraf=require(_0xcc6d('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc6d('0x7'));module['exports']=function(_0x3aee14,_0x2a5d02){return _0x3aee14[_0xcc6d('0x8')]('SmsQueue',attributes,{'tableName':_0xcc6d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 80d8a78..de6b859 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 _0x2668=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','options','raw','where','map','include','model','attributes','stringify','ShowSmsQueue','find','lodash','util','moment','bluebird'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x2668,0x98));var _0x8266=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x2668[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x8266('0x0'));var util=require(_0x8266('0x1'));var moment=require(_0x8266('0x2'));var BPromise=require(_0x8266('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8266('0x4'));var db=require(_0x8266('0x5'))['db'];var utils=require(_0x8266('0x6'));var logger=require(_0x8266('0x7'))(_0x8266('0x8'));var config=require(_0x8266('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8266('0xa')][_0x8266('0xb')]({'port':0x232a});config[_0x8266('0xc')]=_[_0x8266('0xd')](config[_0x8266('0xc')],{'host':_0x8266('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2fe92e,_0x4b63e6,_0x29893a){return new BPromise(function(_0x30a73e,_0x588207){return client[_0x8266('0xf')](_0x2fe92e,_0x29893a)[_0x8266('0x10')](function(_0x44978a){logger['info'](_0x8266('0x11'),_0x4b63e6,_0x8266('0x12'));logger[_0x8266('0x13')](_0x8266('0x14'),_0x4b63e6,'request\x20sent',JSON['stringify'](_0x44978a));if(_0x44978a[_0x8266('0x15')]){if(_0x44978a[_0x8266('0x15')][_0x8266('0x16')]===0x1f4){logger[_0x8266('0x15')](_0x8266('0x11'),_0x4b63e6,_0x44978a[_0x8266('0x15')][_0x8266('0x17')]);return _0x588207(_0x44978a[_0x8266('0x15')][_0x8266('0x17')]);}logger['error']('SmsQueue,\x20%s,\x20%s',_0x4b63e6,_0x44978a[_0x8266('0x15')]['message']);return _0x30a73e(_0x44978a[_0x8266('0x15')][_0x8266('0x17')]);}else{logger[_0x8266('0x18')](_0x8266('0x11'),_0x4b63e6,'request\x20sent');_0x30a73e(_0x44978a[_0x8266('0x19')][_0x8266('0x17')]);}})[_0x8266('0x1a')](function(_0x4bdba2){logger[_0x8266('0x15')](_0x8266('0x11'),_0x4b63e6,_0x4bdba2);_0x588207(_0x4bdba2);});});}exports[_0x8266('0x1b')]=function(_0x2ebf54){var _0x5684f0=this;return new Promise(function(_0x3a5fa1,_0x36d777){return db[_0x8266('0x1c')]['findAll']({'raw':_0x2ebf54['options']?_0x2ebf54[_0x8266('0x1d')][_0x8266('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ebf54[_0x8266('0x1d')]?_0x2ebf54[_0x8266('0x1d')][_0x8266('0x1f')]||null:null,'attributes':_0x2ebf54['options']?_0x2ebf54[_0x8266('0x1d')]['attributes']||null:null,'limit':_0x2ebf54['options']?_0x2ebf54[_0x8266('0x1d')]['limit']||null:null,'include':_0x2ebf54['options']?_0x2ebf54[_0x8266('0x1d')]['include']?_[_0x8266('0x20')](_0x2ebf54[_0x8266('0x1d')][_0x8266('0x21')],function(_0x3cd3d7){return{'model':db[_0x3cd3d7[_0x8266('0x22')]],'as':_0x3cd3d7['as'],'attributes':_0x3cd3d7[_0x8266('0x23')],'include':_0x3cd3d7[_0x8266('0x21')]?_['map'](_0x3cd3d7[_0x8266('0x21')],function(_0x585ac6){return{'model':db[_0x585ac6['model']],'as':_0x585ac6['as'],'attributes':_0x585ac6[_0x8266('0x23')],'include':_0x585ac6[_0x8266('0x21')]?_[_0x8266('0x20')](_0x585ac6['include'],function(_0x29f2c7){return{'model':db[_0x29f2c7[_0x8266('0x22')]],'as':_0x29f2c7['as'],'attributes':_0x29f2c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8266('0x10')](function(_0x4e1f11){logger[_0x8266('0x18')]('GetSmsQueue',_0x2ebf54);logger[_0x8266('0x13')]('GetSmsQueue',_0x2ebf54,JSON[_0x8266('0x24')](_0x4e1f11));_0x3a5fa1(_0x4e1f11);})[_0x8266('0x1a')](function(_0x498b11){logger[_0x8266('0x15')](_0x8266('0x1b'),_0x498b11[_0x8266('0x17')],_0x2ebf54);_0x36d777(_0x5684f0[_0x8266('0x15')](0x1f4,_0x498b11[_0x8266('0x17')]));});});};exports[_0x8266('0x25')]=function(_0x5914e6){var _0x513972=this;return new Promise(function(_0x3cc444,_0x3ff8a1){return db['SmsQueue'][_0x8266('0x26')]({'raw':_0x5914e6[_0x8266('0x1d')]?_0x5914e6[_0x8266('0x1d')][_0x8266('0x1e')]===undefined?!![]:![]:!![],'where':_0x5914e6[_0x8266('0x1d')]?_0x5914e6['options'][_0x8266('0x1f')]||null:null,'attributes':_0x5914e6[_0x8266('0x1d')]?_0x5914e6[_0x8266('0x1d')]['attributes']||null:null,'include':_0x5914e6['options']?_0x5914e6[_0x8266('0x1d')][_0x8266('0x21')]?_[_0x8266('0x20')](_0x5914e6[_0x8266('0x1d')][_0x8266('0x21')],function(_0xe43022){return{'model':db[_0xe43022[_0x8266('0x22')]],'as':_0xe43022['as'],'attributes':_0xe43022[_0x8266('0x23')],'include':_0xe43022[_0x8266('0x21')]?_[_0x8266('0x20')](_0xe43022[_0x8266('0x21')],function(_0xac81e4){return{'model':db[_0xac81e4[_0x8266('0x22')]],'as':_0xac81e4['as'],'attributes':_0xac81e4['attributes'],'include':_0xac81e4[_0x8266('0x21')]?_[_0x8266('0x20')](_0xac81e4[_0x8266('0x21')],function(_0xc99b4b){return{'model':db[_0xc99b4b[_0x8266('0x22')]],'as':_0xc99b4b['as'],'attributes':_0xc99b4b[_0x8266('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a1990){logger[_0x8266('0x18')]('ShowSmsQueue',_0x5914e6);logger[_0x8266('0x13')](_0x8266('0x25'),_0x5914e6,JSON[_0x8266('0x24')](_0x4a1990));_0x3cc444(_0x4a1990);})[_0x8266('0x1a')](function(_0x43304){logger[_0x8266('0x15')](_0x8266('0x25'),_0x43304[_0x8266('0x17')],_0x5914e6);_0x3ff8a1(_0x513972['error'](0x1f4,_0x43304[_0x8266('0x17')]));});});}; \ No newline at end of file +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 diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 2ac2f20..f07b531 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 _0x71aa=['register','./smsQueue.events','save','remove'];(function(_0x133dc2,_0x4a515f){var _0x4792da=function(_0x43fd6e){while(--_0x43fd6e){_0x133dc2['push'](_0x133dc2['shift']());}};_0x4792da(++_0x4a515f);}(_0x71aa,0x111));var _0xa71a=function(_0x39580c,_0x22425c){_0x39580c=_0x39580c-0x0;var _0x1a4cd8=_0x71aa[_0x39580c];return _0x1a4cd8;};'use strict';var SmsQueueEvents=require(_0xa71a('0x0'));var events=[_0xa71a('0x1'),_0xa71a('0x2'),'update'];function createListener(_0x32a4ac,_0x5eb217){return function(_0x37ddbb){_0x5eb217['emit'](_0x32a4ac,_0x37ddbb);};}function removeListener(_0x3529b2,_0x4e288c){return function(){SmsQueueEvents['removeListener'](_0x3529b2,_0x4e288c);};}exports[_0xa71a('0x3')]=function(_0x36d661){for(var _0x48648f=0x0,_0x3a547a=events['length'];_0x48648f<_0x3a547a;_0x48648f++){var _0x102f68=events[_0x48648f];var _0x4b91a3=createListener('smsQueue:'+_0x102f68,_0x36d661);SmsQueueEvents['on'](_0x102f68,_0x4b91a3);}}; \ No newline at end of file +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 diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 837999e..036cf97 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 _0xb182=['/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0x1c5497,_0x204290){var _0x4735e1=function(_0x2919b6){while(--_0x2919b6){_0x1c5497['push'](_0x1c5497['shift']());}};_0x4735e1(++_0x204290);}(_0xb182,0x121));var _0x2b18=function(_0x31b9cf,_0x1a809b){_0x31b9cf=_0x31b9cf-0x0;var _0x357b8a=_0xb182[_0x31b9cf];return _0x357b8a;};'use strict';var multer=require('multer');var util=require(_0x2b18('0x0'));var path=require(_0x2b18('0x1'));var timeout=require(_0x2b18('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2b18('0x3'));var auth=require(_0x2b18('0x4'));var interaction=require(_0x2b18('0x5'));var config=require('../../config/environment');var controller=require(_0x2b18('0x6'));router[_0x2b18('0x7')]('/',auth[_0x2b18('0x8')](),controller[_0x2b18('0x9')]);router[_0x2b18('0x7')](_0x2b18('0xa'),auth[_0x2b18('0x8')](),controller['describe']);router[_0x2b18('0x7')](_0x2b18('0xb'),auth[_0x2b18('0x8')](),controller[_0x2b18('0xc')]);router[_0x2b18('0xd')]('/',auth[_0x2b18('0x8')](),controller[_0x2b18('0xe')]);router[_0x2b18('0xf')](_0x2b18('0xb'),auth[_0x2b18('0x8')](),controller[_0x2b18('0x10')]);router[_0x2b18('0x11')](_0x2b18('0xb'),auth['isAuthenticated'](),controller[_0x2b18('0x12')]);module[_0x2b18('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 5981996..ec78aef 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 _0xa0f5=['STRING','DATE','sequelize'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0xa0f5,0x1ac));var _0x5a0f=function(_0x4e36b2,_0x19464f){_0x4e36b2=_0x4e36b2-0x0;var _0x3210bf=_0xa0f5[_0x4e36b2];return _0x3210bf;};'use strict';var moment=require('moment');var Sequelize=require(_0x5a0f('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x5a0f('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5a0f('0x1')]},'joinAt':{'type':Sequelize[_0x5a0f('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5a0f('0x2')]},'exitAt':{'type':Sequelize[_0x5a0f('0x2')]},'reason':{'type':Sequelize[_0x5a0f('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 4755e44..87abef2 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 _0xaecd=['key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','SmsQueueReport','includeAll','include','findAll','catch','params','find','create','body','describe','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type'];(function(_0x484cac,_0x30ad3a){var _0x1d6e77=function(_0x4f5f16){while(--_0x4f5f16){_0x484cac['push'](_0x484cac['shift']());}};_0x1d6e77(++_0x30ad3a);}(_0xaecd,0xa5));var _0xdaec=function(_0x352844,_0x5d6d87){_0x352844=_0x352844-0x0;var _0xa2bafd=_0xaecd[_0x352844];return _0xa2bafd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdaec('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdaec('0x1'));var rp=require('request-promise');var moment=require(_0xdaec('0x2'));var BPromise=require(_0xdaec('0x3'));var Mustache=require('mustache');var util=require(_0xdaec('0x4'));var path=require(_0xdaec('0x5'));var sox=require(_0xdaec('0x6'));var csv=require(_0xdaec('0x7'));var ejs=require(_0xdaec('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xdaec('0x9'));var crypto=require(_0xdaec('0xa'));var jsforce=require(_0xdaec('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdaec('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdaec('0xc'));var qs=require(_0xdaec('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdaec('0xe'))(_0xdaec('0xf'));var utils=require(_0xdaec('0x10'));var config=require(_0xdaec('0x11'));var licenseUtil=require(_0xdaec('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe9e06,_0x442742){_0x442742=_0x442742||0xcc;return function(_0x18f948){if(_0x18f948){return _0xe9e06[_0xdaec('0x13')](_0x442742);}return _0xe9e06[_0xdaec('0x14')](_0x442742)[_0xdaec('0x15')]();};}function respondWithResult(_0x224453,_0x5d052f){_0x5d052f=_0x5d052f||0xc8;return function(_0x527cb4){if(_0x527cb4){return _0x224453[_0xdaec('0x14')](_0x5d052f)['json'](_0x527cb4);}};}function respondWithFilteredResult(_0x2658b2,_0x2c5d86){return function(_0x3b20ac){if(_0x3b20ac){var _0x139c1e=typeof _0x2c5d86[_0xdaec('0x16')]===_0xdaec('0x17')&&typeof _0x2c5d86[_0xdaec('0x18')]===_0xdaec('0x17');var _0x33f72b=_0x3b20ac[_0xdaec('0x19')];var _0x28acf8=_0x139c1e?0x0:_0x2c5d86[_0xdaec('0x16')];var _0x3a117b=_0x139c1e?_0x3b20ac[_0xdaec('0x19')]:_0x2c5d86[_0xdaec('0x16')]+_0x2c5d86[_0xdaec('0x18')];var _0x5dce48;if(_0x3a117b>=_0x33f72b){_0x3a117b=_0x33f72b;_0x5dce48=0xc8;}else{_0x5dce48=0xce;}_0x2658b2[_0xdaec('0x14')](_0x5dce48);return _0x2658b2['set'](_0xdaec('0x1a'),_0x28acf8+'-'+_0x3a117b+'/'+_0x33f72b)['json'](_0x3b20ac);}return null;};}function patchUpdates(_0x21bec6){return function(_0x5095c8){try{jsonpatch[_0xdaec('0x1b')](_0x5095c8,_0x21bec6,!![]);}catch(_0x2c83df){return BPromise[_0xdaec('0x1c')](_0x2c83df);}return _0x5095c8[_0xdaec('0x1d')]();};}function saveUpdates(_0x59fc28,_0xc31c99){return function(_0x32071d){if(_0x32071d){return _0x32071d[_0xdaec('0x1e')](_0x59fc28)['then'](function(_0x243205){return _0x243205;});}return null;};}function removeEntity(_0xe5931,_0x215cf3){return function(_0x335731){if(_0x335731){return _0x335731[_0xdaec('0x1f')]()[_0xdaec('0x20')](function(){_0xe5931[_0xdaec('0x14')](0xcc)[_0xdaec('0x15')]();});}};}function handleEntityNotFound(_0x7facf5,_0x459214){return function(_0x537d36){if(!_0x537d36){_0x7facf5[_0xdaec('0x13')](0x194);}return _0x537d36;};}function handleError(_0x39f017,_0x144ce1){_0x144ce1=_0x144ce1||0x1f4;return function(_0x586cb3){logger[_0xdaec('0x21')](_0x586cb3[_0xdaec('0x22')]);if(_0x586cb3[_0xdaec('0x23')]){delete _0x586cb3['name'];}_0x39f017[_0xdaec('0x14')](_0x144ce1)[_0xdaec('0x24')](_0x586cb3);};}exports[_0xdaec('0x25')]=function(_0x34a2a4,_0x15229e){var _0x2eae9b={},_0x2d75dc={},_0x41fde6={'count':0x0,'rows':[]};var _0x2f0945=_[_0xdaec('0x26')](db['SmsQueueReport'][_0xdaec('0x27')],function(_0x2d5ad1){return{'name':_0x2d5ad1[_0xdaec('0x28')],'type':_0x2d5ad1[_0xdaec('0x29')][_0xdaec('0x2a')]};});_0x2d75dc[_0xdaec('0x2b')]=_['map'](_0x2f0945,_0xdaec('0x23'));_0x2d75dc[_0xdaec('0x2c')]=_[_0xdaec('0x2d')](_0x34a2a4[_0xdaec('0x2c')]);_0x2d75dc[_0xdaec('0x2e')]=_[_0xdaec('0x2f')](_0x2d75dc[_0xdaec('0x2b')],_0x2d75dc[_0xdaec('0x2c')]);_0x2eae9b[_0xdaec('0x30')]=_['intersection'](_0x2d75dc[_0xdaec('0x2b')],qs['fields'](_0x34a2a4[_0xdaec('0x2c')][_0xdaec('0x31')]));_0x2eae9b[_0xdaec('0x30')]=_0x2eae9b[_0xdaec('0x30')][_0xdaec('0x32')]?_0x2eae9b[_0xdaec('0x30')]:_0x2d75dc['model'];if(!_0x34a2a4[_0xdaec('0x2c')]['hasOwnProperty']('nolimit')){_0x2eae9b['limit']=qs[_0xdaec('0x18')](_0x34a2a4[_0xdaec('0x2c')][_0xdaec('0x18')]);_0x2eae9b[_0xdaec('0x16')]=qs[_0xdaec('0x16')](_0x34a2a4[_0xdaec('0x2c')]['offset']);}_0x2eae9b[_0xdaec('0x33')]=qs['sort'](_0x34a2a4[_0xdaec('0x2c')][_0xdaec('0x34')]);_0x2eae9b[_0xdaec('0x35')]=qs[_0xdaec('0x2e')](_[_0xdaec('0x36')](_0x34a2a4['query'],_0x2d75dc[_0xdaec('0x2e')]),_0x2f0945);if(_0x34a2a4[_0xdaec('0x2c')][_0xdaec('0x37')]){_0x2eae9b[_0xdaec('0x35')]=_[_0xdaec('0x38')](_0x2eae9b[_0xdaec('0x35')],{'$or':_['map'](_0x2f0945,function(_0x23b429){if(_0x23b429[_0xdaec('0x29')]!==_0xdaec('0x39')){var _0x117815={};_0x117815[_0x23b429[_0xdaec('0x23')]]={'$like':'%'+_0x34a2a4[_0xdaec('0x2c')][_0xdaec('0x37')]+'%'};return _0x117815;}})});}_0x2eae9b=_[_0xdaec('0x38')]({},_0x2eae9b,_0x34a2a4[_0xdaec('0x3a')]);var _0x4938d7={'where':_0x2eae9b[_0xdaec('0x35')]};return db[_0xdaec('0x3b')][_0xdaec('0x19')](_0x4938d7)[_0xdaec('0x20')](function(_0x7f678){_0x41fde6[_0xdaec('0x19')]=_0x7f678;if(_0x34a2a4[_0xdaec('0x2c')][_0xdaec('0x3c')]){_0x2eae9b[_0xdaec('0x3d')]=[{'all':!![]}];}return db[_0xdaec('0x3b')][_0xdaec('0x3e')](_0x2eae9b);})['then'](function(_0x697e12){_0x41fde6['rows']=_0x697e12;return _0x41fde6;})[_0xdaec('0x20')](respondWithFilteredResult(_0x15229e,_0x2eae9b))[_0xdaec('0x3f')](handleError(_0x15229e,null));};exports['show']=function(_0x278bb0,_0x24ae4c){var _0x53b37d={'raw':!![],'where':{'id':_0x278bb0[_0xdaec('0x40')]['id']}},_0x3f9c8c={};_0x3f9c8c[_0xdaec('0x2b')]=_[_0xdaec('0x2d')](db['SmsQueueReport']['rawAttributes']);_0x3f9c8c[_0xdaec('0x2c')]=_[_0xdaec('0x2d')](_0x278bb0[_0xdaec('0x2c')]);_0x3f9c8c[_0xdaec('0x2e')]=_[_0xdaec('0x2f')](_0x3f9c8c['model'],_0x3f9c8c[_0xdaec('0x2c')]);_0x53b37d['attributes']=_[_0xdaec('0x2f')](_0x3f9c8c[_0xdaec('0x2b')],qs[_0xdaec('0x31')](_0x278bb0[_0xdaec('0x2c')]['fields']));_0x53b37d[_0xdaec('0x30')]=_0x53b37d['attributes'][_0xdaec('0x32')]?_0x53b37d[_0xdaec('0x30')]:_0x3f9c8c[_0xdaec('0x2b')];if(_0x278bb0['query'][_0xdaec('0x3c')]){_0x53b37d[_0xdaec('0x3d')]=[{'all':!![]}];}_0x53b37d=_[_0xdaec('0x38')]({},_0x53b37d,_0x278bb0['options']);return db[_0xdaec('0x3b')][_0xdaec('0x41')](_0x53b37d)[_0xdaec('0x20')](handleEntityNotFound(_0x24ae4c,null))[_0xdaec('0x20')](respondWithResult(_0x24ae4c,null))[_0xdaec('0x3f')](handleError(_0x24ae4c,null));};exports[_0xdaec('0x42')]=function(_0x287ebc,_0x59c270){return db[_0xdaec('0x3b')]['create'](_0x287ebc[_0xdaec('0x43')],{})[_0xdaec('0x20')](respondWithResult(_0x59c270,0xc9))[_0xdaec('0x3f')](handleError(_0x59c270,null));};exports[_0xdaec('0x1e')]=function(_0x119f33,_0x179bca){if(_0x119f33[_0xdaec('0x43')]['id']){delete _0x119f33['body']['id'];}return db[_0xdaec('0x3b')][_0xdaec('0x41')]({'where':{'id':_0x119f33[_0xdaec('0x40')]['id']}})[_0xdaec('0x20')](handleEntityNotFound(_0x179bca,null))['then'](saveUpdates(_0x119f33[_0xdaec('0x43')],null))[_0xdaec('0x20')](respondWithResult(_0x179bca,null))[_0xdaec('0x3f')](handleError(_0x179bca,null));};exports[_0xdaec('0x1f')]=function(_0x4a3704,_0x3651b7){return db[_0xdaec('0x3b')][_0xdaec('0x41')]({'where':{'id':_0x4a3704[_0xdaec('0x40')]['id']}})[_0xdaec('0x20')](handleEntityNotFound(_0x3651b7,null))[_0xdaec('0x20')](removeEntity(_0x3651b7,null))[_0xdaec('0x3f')](handleError(_0x3651b7,null));};exports[_0xdaec('0x44')]=function(_0x47a93a,_0x462be0){return db['SmsQueueReport'][_0xdaec('0x44')]()[_0xdaec('0x20')](respondWithResult(_0x462be0,null))['catch'](handleError(_0x462be0,null));}; \ No newline at end of file +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 diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1594da3..830c9f8 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 _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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 +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 diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 8aec8f6..6581f9f 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 _0xa905=['SmsQueueReport','options','raw','CreateSmsQueueReport','UpdateSmsQueueReport','update','body','where','limit','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0xc1f00b,_0x34f3be){var _0x265d6d=function(_0x1e0806){while(--_0x1e0806){_0xc1f00b['push'](_0xc1f00b['shift']());}};_0x265d6d(++_0x34f3be);}(_0xa905,0xa9));var _0x5a90=function(_0xe3a0b,_0x31ff4b){_0xe3a0b=_0xe3a0b-0x0;var _0x4eb361=_0xa905[_0xe3a0b];return _0x4eb361;};'use strict';var _=require('lodash');var util=require(_0x5a90('0x0'));var moment=require(_0x5a90('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a90('0x2'));var fs=require('fs');var Redis=require(_0x5a90('0x3'));var db=require(_0x5a90('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a90('0x5'))(_0x5a90('0x6'));var config=require(_0x5a90('0x7'));var jayson=require(_0x5a90('0x8'));var client=jayson[_0x5a90('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5586b6,_0x33bc82,_0x5932f2){return new BPromise(function(_0x57c132,_0x2120fd){return client[_0x5a90('0xa')](_0x5586b6,_0x5932f2)[_0x5a90('0xb')](function(_0x2589d0){logger[_0x5a90('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x33bc82,_0x5a90('0xd'));logger[_0x5a90('0xe')](_0x5a90('0xf'),_0x33bc82,_0x5a90('0xd'),JSON[_0x5a90('0x10')](_0x2589d0));if(_0x2589d0[_0x5a90('0x11')]){if(_0x2589d0[_0x5a90('0x11')][_0x5a90('0x12')]===0x1f4){logger[_0x5a90('0x11')](_0x5a90('0x13'),_0x33bc82,_0x2589d0[_0x5a90('0x11')][_0x5a90('0x14')]);return _0x2120fd(_0x2589d0['error'][_0x5a90('0x14')]);}logger[_0x5a90('0x11')](_0x5a90('0x13'),_0x33bc82,_0x2589d0[_0x5a90('0x11')][_0x5a90('0x14')]);return _0x57c132(_0x2589d0[_0x5a90('0x11')]['message']);}else{logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x33bc82,_0x5a90('0xd'));_0x57c132(_0x2589d0[_0x5a90('0x15')][_0x5a90('0x14')]);}})[_0x5a90('0x16')](function(_0x849fae){logger[_0x5a90('0x11')](_0x5a90('0x13'),_0x33bc82,_0x849fae);_0x2120fd(_0x849fae);});});}exports['CreateSmsQueueReport']=function(_0x15331a){var _0x45e86a=this;return new Promise(function(_0x54a39f,_0x5808bd){return db[_0x5a90('0x17')]['create'](_0x15331a['body'],{'raw':_0x15331a[_0x5a90('0x18')]?_0x15331a[_0x5a90('0x18')][_0x5a90('0x19')]===undefined?!![]:![]:!![]})[_0x5a90('0xb')](function(_0x5d8f4c){logger[_0x5a90('0xc')](_0x5a90('0x1a'),_0x15331a);logger[_0x5a90('0xe')](_0x5a90('0x1a'),_0x15331a,JSON['stringify'](_0x5d8f4c));_0x54a39f(_0x5d8f4c);})[_0x5a90('0x16')](function(_0x27e741){logger[_0x5a90('0x11')](_0x5a90('0x1a'),_0x27e741[_0x5a90('0x14')],_0x15331a);_0x5808bd(_0x45e86a[_0x5a90('0x11')](0x1f4,_0x27e741[_0x5a90('0x14')]));});});};exports[_0x5a90('0x1b')]=function(_0x32315a){var _0x4c07aa=this;return new Promise(function(_0x1b68d2,_0x384c34){return db[_0x5a90('0x17')][_0x5a90('0x1c')](_0x32315a[_0x5a90('0x1d')],{'raw':_0x32315a[_0x5a90('0x18')]?_0x32315a['options'][_0x5a90('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32315a[_0x5a90('0x18')]?_0x32315a[_0x5a90('0x18')][_0x5a90('0x1e')]||null:null,'attributes':_0x32315a['options']?_0x32315a[_0x5a90('0x18')]['attributes']||null:null,'limit':_0x32315a[_0x5a90('0x18')]?_0x32315a['options'][_0x5a90('0x1f')]||null:null})[_0x5a90('0xb')](function(_0x332e97){logger[_0x5a90('0xc')](_0x5a90('0x1b'),_0x32315a);logger[_0x5a90('0xe')](_0x5a90('0x1b'),_0x32315a,JSON[_0x5a90('0x10')](_0x332e97));_0x1b68d2(_0x332e97);})['catch'](function(_0x377590){logger['error'](_0x5a90('0x1b'),_0x377590[_0x5a90('0x14')],_0x32315a);_0x384c34(_0x4c07aa[_0x5a90('0x11')](0x1f4,_0x377590[_0x5a90('0x14')]));});});}; \ No newline at end of file +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 diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index c0f515b..72b7b37 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 _0x08d9=['fs-extra','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','multer','path','express','Router'];(function(_0x2f544e,_0x99c662){var _0x5d6eaa=function(_0x827737){while(--_0x827737){_0x2f544e['push'](_0x2f544e['shift']());}};_0x5d6eaa(++_0x99c662);}(_0x08d9,0xc2));var _0x908d=function(_0x212eee,_0x2cb8d4){_0x212eee=_0x212eee-0x0;var _0x415cfd=_0x08d9[_0x212eee];return _0x415cfd;};'use strict';var multer=require(_0x908d('0x0'));var util=require('util');var path=require(_0x908d('0x1'));var timeout=require('connect-timeout');var express=require(_0x908d('0x2'));var router=express[_0x908d('0x3')]();var fs_extra=require(_0x908d('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x908d('0x5'));var controller=require(_0x908d('0x6'));router[_0x908d('0x7')]('/',auth[_0x908d('0x8')](),controller[_0x908d('0x9')]);router['get'](_0x908d('0xa'),auth[_0x908d('0x8')](),controller[_0x908d('0xb')]);router[_0x908d('0x7')](_0x908d('0xc'),auth[_0x908d('0x8')](),controller[_0x908d('0xd')]);router[_0x908d('0xe')]('/',auth[_0x908d('0x8')](),controller[_0x908d('0xf')]);router['put'](_0x908d('0xc'),auth[_0x908d('0x8')](),controller[_0x908d('0x10')]);router[_0x908d('0x11')](_0x908d('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index d0885d3..2f3393b 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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x316371,_0x3c225f){var _0x576f72=function(_0x109308){while(--_0x109308){_0x316371['push'](_0x316371['shift']());}};_0x576f72(++_0x3c225f);}(_0x54ef,0x112));var _0xf54e=function(_0x4a627a,_0x5d5437){_0x4a627a=_0x4a627a-0x0;var _0x211c39=_0x54ef[_0x4a627a];return _0x211c39;};'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 +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 diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7a372e8..9f49451 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 _0x8282=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','length','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js'];(function(_0x334473,_0x22608a){var _0xda025d=function(_0x38881f){while(--_0x38881f){_0x334473['push'](_0x334473['shift']());}};_0xda025d(++_0x22608a);}(_0x8282,0xd5));var _0x2828=function(_0x25bedd,_0x12f0eb){_0x25bedd=_0x25bedd-0x0;var _0x19d9fa=_0x8282[_0x25bedd];return _0x19d9fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2828('0x0'));var zipdir=require(_0x2828('0x1'));var jsonpatch=require(_0x2828('0x2'));var rp=require(_0x2828('0x3'));var moment=require(_0x2828('0x4'));var BPromise=require(_0x2828('0x5'));var Mustache=require(_0x2828('0x6'));var util=require(_0x2828('0x7'));var path=require(_0x2828('0x8'));var sox=require('sox');var csv=require(_0x2828('0x9'));var ejs=require(_0x2828('0xa'));var fs=require('fs');var fs_extra=require(_0x2828('0xb'));var _=require('lodash');var squel=require(_0x2828('0xc'));var crypto=require('crypto');var jsforce=require(_0x2828('0xd'));var deskjs=require(_0x2828('0xe'));var toCsv=require(_0x2828('0x9'));var querystring=require(_0x2828('0xf'));var Papa=require(_0x2828('0x10'));var Redis=require('ioredis');var authService=require(_0x2828('0x11'));var qs=require(_0x2828('0x12'));var as=require(_0x2828('0x13'));var hardwareService=require(_0x2828('0x14'));var logger=require(_0x2828('0x15'))('api');var utils=require(_0x2828('0x16'));var config=require(_0x2828('0x17'));var licenseUtil=require(_0x2828('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x563511,_0x3ebf1a){_0x3ebf1a=_0x3ebf1a||0xcc;return function(_0x47b5f0){if(_0x47b5f0){return _0x563511[_0x2828('0x19')](_0x3ebf1a);}return _0x563511[_0x2828('0x1a')](_0x3ebf1a)[_0x2828('0x1b')]();};}function respondWithResult(_0x166a55,_0x2ba936){_0x2ba936=_0x2ba936||0xc8;return function(_0x21537f){if(_0x21537f){return _0x166a55[_0x2828('0x1a')](_0x2ba936)[_0x2828('0x1c')](_0x21537f);}};}function respondWithFilteredResult(_0x11aed7,_0x2cc61b){return function(_0xe4062b){if(_0xe4062b){var _0x2bdf3a=typeof _0x2cc61b[_0x2828('0x1d')]===_0x2828('0x1e')&&typeof _0x2cc61b['limit']===_0x2828('0x1e');var _0x2a71a6=_0xe4062b['count'];var _0x597760=_0x2bdf3a?0x0:_0x2cc61b['offset'];var _0x1da87a=_0x2bdf3a?_0xe4062b[_0x2828('0x1f')]:_0x2cc61b['offset']+_0x2cc61b['limit'];var _0x45c2d3;if(_0x1da87a>=_0x2a71a6){_0x1da87a=_0x2a71a6;_0x45c2d3=0xc8;}else{_0x45c2d3=0xce;}_0x11aed7['status'](_0x45c2d3);return _0x11aed7['set'](_0x2828('0x20'),_0x597760+'-'+_0x1da87a+'/'+_0x2a71a6)[_0x2828('0x1c')](_0xe4062b);}return null;};}function patchUpdates(_0x48b0ac){return function(_0x124dd6){try{jsonpatch[_0x2828('0x21')](_0x124dd6,_0x48b0ac,!![]);}catch(_0x2b0d95){return BPromise[_0x2828('0x22')](_0x2b0d95);}return _0x124dd6['save']();};}function saveUpdates(_0x47864a,_0x23efd1){return function(_0x141ce1){if(_0x141ce1){return _0x141ce1[_0x2828('0x23')](_0x47864a)[_0x2828('0x24')](function(_0x12e9f4){return _0x12e9f4;});}return null;};}function removeEntity(_0x4b1a67,_0x24d395){return function(_0x29899c){if(_0x29899c){return _0x29899c[_0x2828('0x25')]()[_0x2828('0x24')](function(){_0x4b1a67[_0x2828('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x321383,_0x108650){return function(_0x3856be){if(!_0x3856be){_0x321383[_0x2828('0x19')](0x194);}return _0x3856be;};}function handleError(_0x1197db,_0x175b64){_0x175b64=_0x175b64||0x1f4;return function(_0x3286ea){logger[_0x2828('0x26')](_0x3286ea[_0x2828('0x27')]);if(_0x3286ea[_0x2828('0x28')]){delete _0x3286ea[_0x2828('0x28')];}_0x1197db['status'](_0x175b64)[_0x2828('0x29')](_0x3286ea);};}exports['index']=function(_0x2648aa,_0x94706a){var _0x3b9bb3={},_0xa63a53={},_0x6b48ea={'count':0x0,'rows':[]};var _0x1c99f1=_[_0x2828('0x2a')](db[_0x2828('0x2b')][_0x2828('0x2c')],function(_0x1edf44){return{'name':_0x1edf44[_0x2828('0x2d')],'type':_0x1edf44[_0x2828('0x2e')][_0x2828('0x2f')]};});_0xa63a53[_0x2828('0x30')]=_[_0x2828('0x2a')](_0x1c99f1,'name');_0xa63a53['query']=_[_0x2828('0x31')](_0x2648aa[_0x2828('0x32')]);_0xa63a53['filters']=_[_0x2828('0x33')](_0xa63a53[_0x2828('0x30')],_0xa63a53[_0x2828('0x32')]);_0x3b9bb3[_0x2828('0x34')]=_['intersection'](_0xa63a53['model'],qs[_0x2828('0x35')](_0x2648aa[_0x2828('0x32')][_0x2828('0x35')]));_0x3b9bb3[_0x2828('0x34')]=_0x3b9bb3['attributes']['length']?_0x3b9bb3[_0x2828('0x34')]:_0xa63a53[_0x2828('0x30')];if(!_0x2648aa[_0x2828('0x32')]['hasOwnProperty'](_0x2828('0x36'))){_0x3b9bb3[_0x2828('0x37')]=qs[_0x2828('0x37')](_0x2648aa[_0x2828('0x32')][_0x2828('0x37')]);_0x3b9bb3['offset']=qs[_0x2828('0x1d')](_0x2648aa[_0x2828('0x32')]['offset']);}_0x3b9bb3[_0x2828('0x38')]=qs[_0x2828('0x39')](_0x2648aa[_0x2828('0x32')][_0x2828('0x39')]);_0x3b9bb3[_0x2828('0x3a')]=qs[_0x2828('0x3b')](_[_0x2828('0x3c')](_0x2648aa['query'],_0xa63a53[_0x2828('0x3b')]),_0x1c99f1);if(_0x2648aa[_0x2828('0x32')][_0x2828('0x3d')]){_0x3b9bb3[_0x2828('0x3a')]=_[_0x2828('0x3e')](_0x3b9bb3[_0x2828('0x3a')],{'$or':_[_0x2828('0x2a')](_0x1c99f1,function(_0x54eb93){if(_0x54eb93['type']!==_0x2828('0x3f')){var _0x3d4a48={};_0x3d4a48[_0x54eb93[_0x2828('0x28')]]={'$like':'%'+_0x2648aa[_0x2828('0x32')][_0x2828('0x3d')]+'%'};return _0x3d4a48;}})});}_0x3b9bb3=_[_0x2828('0x3e')]({},_0x3b9bb3,_0x2648aa[_0x2828('0x40')]);var _0x1ce5cc={'where':_0x3b9bb3[_0x2828('0x3a')]};return db[_0x2828('0x2b')][_0x2828('0x1f')](_0x1ce5cc)[_0x2828('0x24')](function(_0x4c884c){_0x6b48ea[_0x2828('0x1f')]=_0x4c884c;if(_0x2648aa['query'][_0x2828('0x41')]){_0x3b9bb3['include']=[{'all':!![]}];}return db[_0x2828('0x2b')]['findAll'](_0x3b9bb3);})[_0x2828('0x24')](function(_0x59829b){_0x6b48ea[_0x2828('0x42')]=_0x59829b;return _0x6b48ea;})[_0x2828('0x24')](respondWithFilteredResult(_0x94706a,_0x3b9bb3))[_0x2828('0x43')](handleError(_0x94706a,null));};exports[_0x2828('0x44')]=function(_0x33fc2f,_0x34f1d3){var _0x329a8d={'raw':!![],'where':{'id':_0x33fc2f[_0x2828('0x45')]['id']}},_0x58b642={};_0x58b642[_0x2828('0x30')]=_[_0x2828('0x31')](db['SmsTransferReport'][_0x2828('0x2c')]);_0x58b642['query']=_[_0x2828('0x31')](_0x33fc2f[_0x2828('0x32')]);_0x58b642[_0x2828('0x3b')]=_['intersection'](_0x58b642[_0x2828('0x30')],_0x58b642[_0x2828('0x32')]);_0x329a8d['attributes']=_['intersection'](_0x58b642[_0x2828('0x30')],qs[_0x2828('0x35')](_0x33fc2f['query'][_0x2828('0x35')]));_0x329a8d['attributes']=_0x329a8d[_0x2828('0x34')][_0x2828('0x46')]?_0x329a8d[_0x2828('0x34')]:_0x58b642['model'];if(_0x33fc2f[_0x2828('0x32')][_0x2828('0x41')]){_0x329a8d[_0x2828('0x47')]=[{'all':!![]}];}_0x329a8d=_[_0x2828('0x3e')]({},_0x329a8d,_0x33fc2f[_0x2828('0x40')]);return db[_0x2828('0x2b')][_0x2828('0x48')](_0x329a8d)[_0x2828('0x24')](handleEntityNotFound(_0x34f1d3,null))[_0x2828('0x24')](respondWithResult(_0x34f1d3,null))[_0x2828('0x43')](handleError(_0x34f1d3,null));};exports[_0x2828('0x49')]=function(_0x46f902,_0x130d27){return db['SmsTransferReport'][_0x2828('0x49')](_0x46f902[_0x2828('0x4a')],{})[_0x2828('0x24')](respondWithResult(_0x130d27,0xc9))[_0x2828('0x43')](handleError(_0x130d27,null));};exports['update']=function(_0x818791,_0x140d4d){if(_0x818791[_0x2828('0x4a')]['id']){delete _0x818791['body']['id'];}return db['SmsTransferReport'][_0x2828('0x48')]({'where':{'id':_0x818791[_0x2828('0x45')]['id']}})[_0x2828('0x24')](handleEntityNotFound(_0x140d4d,null))[_0x2828('0x24')](saveUpdates(_0x818791[_0x2828('0x4a')],null))['then'](respondWithResult(_0x140d4d,null))[_0x2828('0x43')](handleError(_0x140d4d,null));};exports['destroy']=function(_0x521dae,_0x5e8209){return db['SmsTransferReport'][_0x2828('0x48')]({'where':{'id':_0x521dae[_0x2828('0x45')]['id']}})['then'](handleEntityNotFound(_0x5e8209,null))[_0x2828('0x24')](removeEntity(_0x5e8209,null))['catch'](handleError(_0x5e8209,null));};exports[_0x2828('0x4b')]=function(_0x544335,_0x223701){return db[_0x2828('0x2b')][_0x2828('0x4b')]()[_0x2828('0x24')](respondWithResult(_0x223701,null))[_0x2828('0x43')](handleError(_0x223701,null));}; \ No newline at end of file +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 diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5a41178..2f48f20 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 _0x6d34=['rimraf','../../config/environment','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0xdf1678,_0xc50a60){var _0x59816d=function(_0x2f04c1){while(--_0x2f04c1){_0xdf1678['push'](_0xdf1678['shift']());}};_0x59816d(++_0xc50a60);}(_0x6d34,0xf7));var _0x46d3=function(_0x52dd9f,_0x5ed084){_0x52dd9f=_0x52dd9f-0x0;var _0x1eaf48=_0x6d34[_0x52dd9f];return _0x1eaf48;};'use strict';var _=require(_0x46d3('0x0'));var util=require(_0x46d3('0x1'));var logger=require(_0x46d3('0x2'))(_0x46d3('0x3'));var moment=require('moment');var BPromise=require(_0x46d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46d3('0x5'));var rimraf=require(_0x46d3('0x6'));var config=require(_0x46d3('0x7'));var attributes=require('./smsTransferReport.attributes');module['exports']=function(_0x57dcc8,_0x3fb1d9){return _0x57dcc8[_0x46d3('0x8')](_0x46d3('0x9'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x46d3('0xa'),'fields':[_0x46d3('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index b4e6eb2..b784901 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 _0x7aaf=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','moment','bluebird'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x7aaf,0x1eb));var _0xf7aa=function(_0x48206c,_0x15861d){_0x48206c=_0x48206c-0x0;var _0x41b3aa=_0x7aaf[_0x48206c];return _0x41b3aa;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var moment=require(_0xf7aa('0x1'));var BPromise=require(_0xf7aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7aa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7aa('0x4'))('rpc');var config=require(_0xf7aa('0x5'));var jayson=require(_0xf7aa('0x6'));var client=jayson[_0xf7aa('0x7')][_0xf7aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47f259,_0x46d632,_0x5d0495){return new BPromise(function(_0x598c54,_0x16c0c7){return client[_0xf7aa('0x9')](_0x47f259,_0x5d0495)['then'](function(_0x581dd0){logger['info'](_0xf7aa('0xa'),_0x46d632,_0xf7aa('0xb'));logger[_0xf7aa('0xc')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x46d632,_0xf7aa('0xb'),JSON['stringify'](_0x581dd0));if(_0x581dd0['error']){if(_0x581dd0[_0xf7aa('0xd')][_0xf7aa('0xe')]===0x1f4){logger[_0xf7aa('0xd')](_0xf7aa('0xa'),_0x46d632,_0x581dd0[_0xf7aa('0xd')][_0xf7aa('0xf')]);return _0x16c0c7(_0x581dd0[_0xf7aa('0xd')][_0xf7aa('0xf')]);}logger[_0xf7aa('0xd')](_0xf7aa('0xa'),_0x46d632,_0x581dd0['error'][_0xf7aa('0xf')]);return _0x598c54(_0x581dd0[_0xf7aa('0xd')][_0xf7aa('0xf')]);}else{logger[_0xf7aa('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x46d632,'request\x20sent');_0x598c54(_0x581dd0[_0xf7aa('0x11')]['message']);}})[_0xf7aa('0x12')](function(_0x15d263){logger[_0xf7aa('0xd')](_0xf7aa('0xa'),_0x46d632,_0x15d263);_0x16c0c7(_0x15d263);});});} \ No newline at end of file +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 diff --git a/server/api/sound/index.js b/server/api/sound/index.js index d115592..515a137 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 _0xae7b=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./sound.controller','get','index','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','create','put','/:id','update','delete','exports','util'];(function(_0x11c858,_0xf35077){var _0x20d5d5=function(_0x122c2f){while(--_0x122c2f){_0x11c858['push'](_0x11c858['shift']());}};_0x20d5d5(++_0xf35077);}(_0xae7b,0x1df));var _0xbae7=function(_0x4725e6,_0x1a8d00){_0x4725e6=_0x4725e6-0x0;var _0xb9cb59=_0xae7b[_0x4725e6];return _0xb9cb59;};'use strict';var multer=require('multer');var util=require(_0xbae7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbae7('0x1'));var router=express[_0xbae7('0x2')]();var fs_extra=require(_0xbae7('0x3'));var auth=require(_0xbae7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbae7('0x5'));var controller=require(_0xbae7('0x6'));router[_0xbae7('0x7')]('/',auth['isAuthenticated'](),controller[_0xbae7('0x8')]);router[_0xbae7('0x7')]('/:id',auth[_0xbae7('0x9')](),controller[_0xbae7('0xa')]);router['get'](_0xbae7('0xb'),auth[_0xbae7('0x9')](),controller[_0xbae7('0xc')]);var upload=multer({'storage':multer[_0xbae7('0xd')]({'destination':function(_0x26d832,_0x1c412b,_0xbae1b1){_0xbae1b1(null,path[_0xbae7('0xe')](config[_0xbae7('0xf')],_0xbae7('0x10')));},'filename':function(_0x2357ae,_0x5845c6,_0x45ac55){_0x5845c6['originalname']=_0x5845c6[_0xbae7('0x11')][_0xbae7('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x45ac55(null,util[_0xbae7('0x13')](_0xbae7('0x14'),path[_0xbae7('0x15')](_0x5845c6['originalname'],path[_0xbae7('0x16')](_0x5845c6['originalname'])),Date[_0xbae7('0x17')](),path[_0xbae7('0x16')](_0x5845c6[_0xbae7('0x11')])));}})});router['post']('/',upload['single']('file'),controller[_0xbae7('0x18')]);router[_0xbae7('0x19')](_0xbae7('0x1a'),auth[_0xbae7('0x9')](),controller[_0xbae7('0x1b')]);router[_0xbae7('0x1c')](_0xbae7('0x1a'),auth[_0xbae7('0x9')](),controller['delete']);module[_0xbae7('0x1d')]=router; \ No newline at end of file +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 diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 869e820..a479486 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 _0xa74a=['name','FLOAT','BIGINT','INTEGER','sequelize','exports','STRING'];(function(_0x4b0237,_0x2f2e1e){var _0x2a9a01=function(_0x5a8f99){while(--_0x5a8f99){_0x4b0237['push'](_0x4b0237['shift']());}};_0x2a9a01(++_0x2f2e1e);}(_0xa74a,0x66));var _0xaa74=function(_0x43dbac,_0x60da4c){_0x43dbac=_0x43dbac-0x0;var _0x14a8b1=_0xa74a[_0x43dbac];return _0x14a8b1;};'use strict';var Sequelize=require(_0xaa74('0x0'));module[_0xaa74('0x1')]={'name':{'type':Sequelize[_0xaa74('0x2')],'unique':_0xaa74('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xaa74('0x2')]},'display_name':{'type':Sequelize[_0xaa74('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0xaa74('0x2')]},'original_duration':{'type':Sequelize[_0xaa74('0x4')]},'original_sampleCount':{'type':Sequelize[_0xaa74('0x5')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xaa74('0x6')]},'converted_format':{'type':Sequelize[_0xaa74('0x2')]},'converted_duration':{'type':Sequelize[_0xaa74('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xaa74('0x5')]},'converted_channelCount':{'type':Sequelize[_0xaa74('0x6')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xaa74('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 59b6bbf..684b8ea 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 _0xb903=['nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','Sound','includeAll','include','findAll','rows','show','params','model','find','catch','save_name','converted_format','existsSync','root','Sequelize','ValidationError','download','format','create','file','originalname','extname','basename','filename','substring','wav','join','server/files/sounds/original','server/files/sounds/converted','%s.%s','Sound\x20upload\x20filepath:\x20%s','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','start','description','original_format','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','limit','undefined','count','offset','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length'];(function(_0x25010f,_0x3aca63){var _0xf2858b=function(_0xa1cd76){while(--_0xa1cd76){_0x25010f['push'](_0x25010f['shift']());}};_0xf2858b(++_0x3aca63);}(_0xb903,0x13b));var _0x3b90=function(_0x16c6af,_0x4b87f6){_0x16c6af=_0x16c6af-0x0;var _0x1d099a=_0xb903[_0x16c6af];return _0x1d099a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3b90('0x0'));var jsonpatch=require(_0x3b90('0x1'));var rp=require(_0x3b90('0x2'));var moment=require(_0x3b90('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3b90('0x4'));var path=require(_0x3b90('0x5'));var sox=require(_0x3b90('0x6'));var csv=require(_0x3b90('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3b90('0x8'));var squel=require('squel');var crypto=require(_0x3b90('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3b90('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3b90('0xb'));var Papa=require('papaparse');var Redis=require(_0x3b90('0xc'));var authService=require(_0x3b90('0xd'));var qs=require(_0x3b90('0xe'));var as=require(_0x3b90('0xf'));var hardwareService=require(_0x3b90('0x10'));var logger=require(_0x3b90('0x11'))('api');var utils=require(_0x3b90('0x12'));var config=require(_0x3b90('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa34c9e,_0x46f647){_0x46f647=_0x46f647||0xcc;return function(_0x4182a1){if(_0x4182a1){return _0xa34c9e['sendStatus'](_0x46f647);}return _0xa34c9e[_0x3b90('0x14')](_0x46f647)[_0x3b90('0x15')]();};}function respondWithResult(_0x56b5ef,_0x2bc37f){_0x2bc37f=_0x2bc37f||0xc8;return function(_0x5dc67c){if(_0x5dc67c){return _0x56b5ef[_0x3b90('0x14')](_0x2bc37f)[_0x3b90('0x16')](_0x5dc67c);}};}function respondWithFilteredResult(_0x10395e,_0x3bf242){return function(_0x4f6b26){if(_0x4f6b26){var _0x1e06b1=typeof _0x3bf242['offset']==='undefined'&&typeof _0x3bf242[_0x3b90('0x17')]===_0x3b90('0x18');var _0x499bdb=_0x4f6b26[_0x3b90('0x19')];var _0x1ea9ae=_0x1e06b1?0x0:_0x3bf242[_0x3b90('0x1a')];var _0x387364=_0x1e06b1?_0x4f6b26[_0x3b90('0x19')]:_0x3bf242[_0x3b90('0x1a')]+_0x3bf242[_0x3b90('0x17')];var _0xa05b3e;if(_0x387364>=_0x499bdb){_0x387364=_0x499bdb;_0xa05b3e=0xc8;}else{_0xa05b3e=0xce;}_0x10395e[_0x3b90('0x14')](_0xa05b3e);return _0x10395e['set'](_0x3b90('0x1b'),_0x1ea9ae+'-'+_0x387364+'/'+_0x499bdb)[_0x3b90('0x16')](_0x4f6b26);}return null;};}function patchUpdates(_0x14e63a){return function(_0x27f305){try{jsonpatch['apply'](_0x27f305,_0x14e63a,!![]);}catch(_0x1309c1){return BPromise[_0x3b90('0x1c')](_0x1309c1);}return _0x27f305[_0x3b90('0x1d')]();};}function saveUpdates(_0x262057,_0x31a4dc){return function(_0x144f3b){if(_0x144f3b){return _0x144f3b[_0x3b90('0x1e')](_0x262057)[_0x3b90('0x1f')](function(_0x35bb1b){return _0x35bb1b;});}return null;};}function removeEntity(_0x25396a,_0x2fc2e6){return function(_0x1592d0){if(_0x1592d0){return _0x1592d0[_0x3b90('0x20')]()[_0x3b90('0x1f')](function(){var _0x4211e1=_0x1592d0[_0x3b90('0x21')]({'plain':!![]});var _0x34eced='Sounds';return db[_0x3b90('0x22')][_0x3b90('0x20')]({'where':{'type':_0x34eced,'resourceId':_0x4211e1['id']}})['then'](function(){return _0x1592d0;});})[_0x3b90('0x1f')](function(){_0x25396a[_0x3b90('0x14')](0xcc)[_0x3b90('0x15')]();});}};}function handleEntityNotFound(_0x295b4e,_0x5a1d2d){return function(_0x13e8c4){if(!_0x13e8c4){_0x295b4e[_0x3b90('0x23')](0x194);}return _0x13e8c4;};}function handleError(_0x1f84da,_0x476024){_0x476024=_0x476024||0x1f4;return function(_0x1318aa){logger[_0x3b90('0x24')](_0x1318aa[_0x3b90('0x25')]);if(_0x1318aa[_0x3b90('0x26')]){delete _0x1318aa['name'];}_0x1f84da['status'](_0x476024)[_0x3b90('0x27')](_0x1318aa);};}exports[_0x3b90('0x28')]=function(_0x59a753,_0x1d1dff){var _0x3cb9d0={},_0x4ad7a0={},_0x1d40ae={'count':0x0,'rows':[]};var _0x5010bb=_['map'](db['Sound'][_0x3b90('0x29')],function(_0x120a21){return{'name':_0x120a21['fieldName'],'type':_0x120a21[_0x3b90('0x2a')][_0x3b90('0x2b')]};});_0x4ad7a0['model']=_['map'](_0x5010bb,_0x3b90('0x26'));_0x4ad7a0[_0x3b90('0x2c')]=_[_0x3b90('0x2d')](_0x59a753[_0x3b90('0x2c')]);_0x4ad7a0[_0x3b90('0x2e')]=_[_0x3b90('0x2f')](_0x4ad7a0['model'],_0x4ad7a0[_0x3b90('0x2c')]);_0x3cb9d0[_0x3b90('0x30')]=_[_0x3b90('0x2f')](_0x4ad7a0['model'],qs[_0x3b90('0x31')](_0x59a753[_0x3b90('0x2c')][_0x3b90('0x31')]));_0x3cb9d0['attributes']=_0x3cb9d0[_0x3b90('0x30')][_0x3b90('0x32')]?_0x3cb9d0['attributes']:_0x4ad7a0['model'];if(!_0x59a753['query']['hasOwnProperty'](_0x3b90('0x33'))){_0x3cb9d0['limit']=qs[_0x3b90('0x17')](_0x59a753[_0x3b90('0x2c')][_0x3b90('0x17')]);_0x3cb9d0[_0x3b90('0x1a')]=qs['offset'](_0x59a753[_0x3b90('0x2c')][_0x3b90('0x1a')]);}_0x3cb9d0[_0x3b90('0x34')]=qs[_0x3b90('0x35')](_0x59a753[_0x3b90('0x2c')][_0x3b90('0x35')]);_0x3cb9d0['where']=qs[_0x3b90('0x2e')](_[_0x3b90('0x36')](_0x59a753[_0x3b90('0x2c')],_0x4ad7a0[_0x3b90('0x2e')]),_0x5010bb);if(_0x59a753[_0x3b90('0x2c')][_0x3b90('0x37')]){_0x3cb9d0[_0x3b90('0x38')]=_['merge'](_0x3cb9d0['where'],{'$or':_[_0x3b90('0x39')](_0x5010bb,function(_0x4d4f9e){if(_0x4d4f9e[_0x3b90('0x2a')]!==_0x3b90('0x3a')){var _0x158d87={};_0x158d87[_0x4d4f9e[_0x3b90('0x26')]]={'$like':'%'+_0x59a753[_0x3b90('0x2c')][_0x3b90('0x37')]+'%'};return _0x158d87;}})});}_0x3cb9d0=_[_0x3b90('0x3b')]({},_0x3cb9d0,_0x59a753[_0x3b90('0x3c')]);var _0x28f986={'where':_0x3cb9d0[_0x3b90('0x38')]};return db[_0x3b90('0x3d')]['count'](_0x28f986)['then'](function(_0x4ebd52){_0x1d40ae[_0x3b90('0x19')]=_0x4ebd52;if(_0x59a753[_0x3b90('0x2c')][_0x3b90('0x3e')]){_0x3cb9d0[_0x3b90('0x3f')]=[{'all':!![]}];}return db[_0x3b90('0x3d')][_0x3b90('0x40')](_0x3cb9d0);})['then'](function(_0x4688c9){_0x1d40ae[_0x3b90('0x41')]=_0x4688c9;return _0x1d40ae;})[_0x3b90('0x1f')](respondWithFilteredResult(_0x1d1dff,_0x3cb9d0))['catch'](handleError(_0x1d1dff,null));};exports[_0x3b90('0x42')]=function(_0x20f3f3,_0x576361){var _0x14c3ca={'raw':!![],'where':{'id':_0x20f3f3[_0x3b90('0x43')]['id']}},_0x6808a5={};_0x6808a5[_0x3b90('0x44')]=_[_0x3b90('0x2d')](db[_0x3b90('0x3d')][_0x3b90('0x29')]);_0x6808a5['query']=_[_0x3b90('0x2d')](_0x20f3f3['query']);_0x6808a5[_0x3b90('0x2e')]=_[_0x3b90('0x2f')](_0x6808a5[_0x3b90('0x44')],_0x6808a5[_0x3b90('0x2c')]);_0x14c3ca[_0x3b90('0x30')]=_['intersection'](_0x6808a5['model'],qs[_0x3b90('0x31')](_0x20f3f3[_0x3b90('0x2c')][_0x3b90('0x31')]));_0x14c3ca[_0x3b90('0x30')]=_0x14c3ca[_0x3b90('0x30')][_0x3b90('0x32')]?_0x14c3ca[_0x3b90('0x30')]:_0x6808a5[_0x3b90('0x44')];if(_0x20f3f3[_0x3b90('0x2c')]['includeAll']){_0x14c3ca[_0x3b90('0x3f')]=[{'all':!![]}];}_0x14c3ca=_[_0x3b90('0x3b')]({},_0x14c3ca,_0x20f3f3['options']);return db[_0x3b90('0x3d')][_0x3b90('0x45')](_0x14c3ca)[_0x3b90('0x1f')](handleEntityNotFound(_0x576361,null))[_0x3b90('0x1f')](respondWithResult(_0x576361,null))[_0x3b90('0x46')](handleError(_0x576361,null));};exports['download']=function(_0x829036,_0x4c4017,_0x3e6563){return db[_0x3b90('0x3d')][_0x3b90('0x45')]({'where':{'id':_0x829036[_0x3b90('0x43')]['id']},'attributes':[_0x3b90('0x26'),_0x3b90('0x47'),_0x3b90('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x4c4017,null))[_0x3b90('0x1f')](function(_0x30feaf){if(_0x30feaf){if(!fs[_0x3b90('0x49')](path['join'](config[_0x3b90('0x4a')],'server/files/sounds/converted',_0x30feaf[_0x3b90('0x47')]+'.'+_0x30feaf[_0x3b90('0x48')]))){throw new db[(_0x3b90('0x4b'))][(_0x3b90('0x4c'))]('Sound\x20not\x20found');}return _0x4c4017[_0x3b90('0x4d')](path['join'](config[_0x3b90('0x4a')],'server/files/sounds/converted',util[_0x3b90('0x4e')]('%s.%s',_0x30feaf[_0x3b90('0x47')],_0x30feaf[_0x3b90('0x48')])),util[_0x3b90('0x4e')]('%s.%s',_0x30feaf['name'],_0x30feaf[_0x3b90('0x48')]));}return null;})[_0x3b90('0x46')](handleError(_0x4c4017,null));};exports[_0x3b90('0x4f')]=function(_0x2ed8f7,_0x5e379a,_0x45fb6d){var _0x483fcc={'name':path['basename'](_0x2ed8f7[_0x3b90('0x50')][_0x3b90('0x51')],path[_0x3b90('0x52')](_0x2ed8f7[_0x3b90('0x50')][_0x3b90('0x51')])),'save_name':path[_0x3b90('0x53')](_0x2ed8f7[_0x3b90('0x50')][_0x3b90('0x54')],path[_0x3b90('0x52')](_0x2ed8f7['file'][_0x3b90('0x54')])),'original_format':path[_0x3b90('0x52')](_0x2ed8f7['file']['originalname'])[_0x3b90('0x55')](0x1),'converted_format':_0x3b90('0x56')};var _0x309655=path[_0x3b90('0x57')](config[_0x3b90('0x4a')],_0x3b90('0x58'),_0x2ed8f7[_0x3b90('0x50')][_0x3b90('0x54')]);var _0x276094=path[_0x3b90('0x57')](config[_0x3b90('0x4a')],_0x3b90('0x59'),util[_0x3b90('0x4e')](_0x3b90('0x5a'),path[_0x3b90('0x53')](_0x2ed8f7[_0x3b90('0x50')][_0x3b90('0x54')],path[_0x3b90('0x52')](_0x2ed8f7[_0x3b90('0x50')]['filename'])),_0x483fcc[_0x3b90('0x48')]));logger['info'](_0x3b90('0x5b'),_0x309655);logger[_0x3b90('0x5c')](_0x3b90('0x5d'),_0x276094);try{fs[_0x3b90('0x5e')](_0x309655,parseInt(_0x3b90('0x5f'),0x8));var _0x43234c=sox[_0x3b90('0x60')](_0x309655,_0x276094,{'sampleRate':0x1f40,'format':_0x3b90('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x43234c['on'](_0x3b90('0x24'),function(_0x12da0a){fs[_0x3b90('0x61')](_0x309655);_0x5e379a[_0x3b90('0x14')](0x1f4)[_0x3b90('0x27')](_0x12da0a);});_0x43234c['on']('src',function(_0x59e393){_0x483fcc[_0x3b90('0x62')]=isNaN(_0x59e393[_0x3b90('0x63')])?null:_0x59e393['duration']*0x3e8;_0x483fcc[_0x3b90('0x64')]=isNaN(_0x59e393[_0x3b90('0x65')])?null:_0x59e393[_0x3b90('0x65')];_0x483fcc[_0x3b90('0x66')]=isNaN(_0x59e393[_0x3b90('0x67')])?null:_0x59e393['channelCount'];_0x483fcc['original_bitRate']=isNaN(_0x59e393['bitRate'])?null:_0x59e393['bitRate'];_0x483fcc[_0x3b90('0x68')]=isNaN(_0x59e393[_0x3b90('0x69')])?null:_0x59e393[_0x3b90('0x69')];});_0x43234c['on'](_0x3b90('0x6a'),function(_0x19c3de){_0x483fcc[_0x3b90('0x6b')]=isNaN(_0x19c3de['duration'])?null:_0x19c3de['duration']*0x3e8;_0x483fcc[_0x3b90('0x6c')]=isNaN(_0x19c3de[_0x3b90('0x65')])?null:_0x19c3de[_0x3b90('0x65')];_0x483fcc[_0x3b90('0x6d')]=isNaN(_0x19c3de['channelCount'])?null:_0x19c3de[_0x3b90('0x67')];_0x483fcc[_0x3b90('0x6e')]=isNaN(_0x19c3de['bitRate'])?null:_0x19c3de[_0x3b90('0x6f')];_0x483fcc[_0x3b90('0x70')]=isNaN(_0x19c3de[_0x3b90('0x69')])?null:_0x19c3de['sampleRate'];});_0x43234c['on'](_0x3b90('0x15'),function(){fs['chmodSync'](_0x276094,parseInt('0777',0x8));return db[_0x3b90('0x3d')]['create'](_0x483fcc)[_0x3b90('0x1f')](function(_0xfbaaa7){var _0x361c6d={'role':_0x2ed8f7[_0x3b90('0x71')]['role'],'userProfileId':_0x2ed8f7[_0x3b90('0x71')][_0x3b90('0x72')]};if(!_0x361c6d)throw new Error(_0x3b90('0x73'));if(_0x361c6d['role']===_0x3b90('0x74')){var _0x59cd40=_0xfbaaa7[_0x3b90('0x21')]({'plain':!![]});return db[_0x3b90('0x75')]['find']({'where':{'name':'Sounds','userProfileId':_0x361c6d[_0x3b90('0x72')]},'raw':!![]})['then'](function(_0x421f65){if(_0x421f65&&_0x421f65[_0x3b90('0x76')]===0x0){return db['UserProfileResource']['create']({'name':_0x59cd40[_0x3b90('0x26')],'resourceId':_0x59cd40['id'],'type':_0x421f65[_0x3b90('0x26')],'sectionId':_0x421f65['id']},{})[_0x3b90('0x1f')](function(){return _0xfbaaa7;});}else{return _0xfbaaa7;}})['catch'](function(_0x13268a){logger[_0x3b90('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13268a);throw _0x13268a;});}return _0xfbaaa7;})[_0x3b90('0x1f')](respondWithResult(_0x5e379a,null))[_0x3b90('0x46')](handleError(_0x5e379a,null));});_0x43234c[_0x3b90('0x77')]();}catch(_0x1c8aa4){_0x5e379a[_0x3b90('0x14')](0x1f4)[_0x3b90('0x27')](_0x1c8aa4);}};exports[_0x3b90('0x1e')]=function(_0x1f053b,_0x7c1e32,_0x14ad50){return db[_0x3b90('0x3d')][_0x3b90('0x45')]({'where':{'id':_0x1f053b[_0x3b90('0x43')]['id']}})[_0x3b90('0x1f')](handleEntityNotFound(_0x7c1e32,null))['then'](saveUpdates(_[_0x3b90('0x36')](_0x1f053b[_0x3b90('0x71')],[_0x3b90('0x26'),_0x3b90('0x78')]),null))[_0x3b90('0x1f')](respondWithResult(_0x7c1e32,null))['catch'](handleError(_0x7c1e32,null));};exports['delete']=function(_0x4e72f2,_0x5d7f1b,_0x55a9e8){return db[_0x3b90('0x3d')]['find']({'where':{'id':_0x4e72f2[_0x3b90('0x43')]['id']}})[_0x3b90('0x1f')](function(_0x16461e){if(_0x16461e){return _0x16461e['destroy']();}})[_0x3b90('0x1f')](function(_0x429568){var _0x556fc7=path['join'](config[_0x3b90('0x4a')],_0x3b90('0x58'),util[_0x3b90('0x4e')](_0x3b90('0x5a'),_0x429568[_0x3b90('0x47')],_0x429568[_0x3b90('0x79')]));var _0x2ce8a6=path[_0x3b90('0x57')](config[_0x3b90('0x4a')],_0x3b90('0x59'),util[_0x3b90('0x4e')](_0x3b90('0x5a'),_0x429568[_0x3b90('0x47')],_0x429568[_0x3b90('0x48')]));fs[_0x3b90('0x61')](_0x556fc7);fs[_0x3b90('0x61')](_0x2ce8a6);return _0x429568;})['then'](function(_0x37ed9b){if(_0x37ed9b){return _0x5d7f1b[_0x3b90('0x14')](0xcc)['end']();}})[_0x3b90('0x1f')](handleEntityNotFound(_0x5d7f1b,null))[_0x3b90('0x46')](handleError(_0x5d7f1b,null));}; \ No newline at end of file +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 diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 57564dc..11432e5 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 _0x570d=['./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x590b9d,_0x340cf4){var _0x165365=function(_0x25020a){while(--_0x25020a){_0x590b9d['push'](_0x590b9d['shift']());}};_0x165365(++_0x340cf4);}(_0x570d,0x18b));var _0xd570=function(_0x1b4a91,_0x22755b){_0x1b4a91=_0x1b4a91-0x0;var _0x570b7c=_0x570d[_0x1b4a91];return _0x570b7c;};'use strict';var _=require(_0xd570('0x0'));var util=require('util');var logger=require(_0xd570('0x1'))(_0xd570('0x2'));var moment=require(_0xd570('0x3'));var BPromise=require('bluebird');var rp=require(_0xd570('0x4'));var fs=require('fs');var path=require(_0xd570('0x5'));var rimraf=require(_0xd570('0x6'));var config=require(_0xd570('0x7'));var attributes=require(_0xd570('0x8'));module[_0xd570('0x9')]=function(_0x5c6071,_0x459810){return _0x5c6071[_0xd570('0xa')](_0xd570('0xb'),attributes,{'tableName':_0xd570('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index d39ec99..9bcd4cf 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 _0x87db=['catch','ShowSound','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','request','then','debug','request\x20sent','stringify','error','code','Sound,\x20%s,\x20%s','message','info','result','find','options','raw','where','map','include','model','attributes'];(function(_0xd49418,_0x1e744b){var _0x47f430=function(_0x302e91){while(--_0x302e91){_0xd49418['push'](_0xd49418['shift']());}};_0x47f430(++_0x1e744b);}(_0x87db,0x1c2));var _0xb87d=function(_0x551008,_0x51b581){_0x551008=_0x551008-0x0;var _0x205a11=_0x87db[_0x551008];return _0x205a11;};'use strict';var _=require(_0xb87d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb87d('0x1'));var rs=require(_0xb87d('0x2'));var fs=require('fs');var Redis=require(_0xb87d('0x3'));var db=require(_0xb87d('0x4'))['db'];var utils=require(_0xb87d('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb87d('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27fc74,_0x292630,_0x3d6cf7){return new BPromise(function(_0x456494,_0x2bd957){return client[_0xb87d('0x7')](_0x27fc74,_0x3d6cf7)[_0xb87d('0x8')](function(_0x608732){logger['info']('Sound,\x20%s,\x20%s',_0x292630,'request\x20sent');logger[_0xb87d('0x9')]('Sound,\x20%s,\x20%s,\x20%s',_0x292630,_0xb87d('0xa'),JSON[_0xb87d('0xb')](_0x608732));if(_0x608732[_0xb87d('0xc')]){if(_0x608732[_0xb87d('0xc')][_0xb87d('0xd')]===0x1f4){logger[_0xb87d('0xc')](_0xb87d('0xe'),_0x292630,_0x608732[_0xb87d('0xc')][_0xb87d('0xf')]);return _0x2bd957(_0x608732[_0xb87d('0xc')][_0xb87d('0xf')]);}logger[_0xb87d('0xc')](_0xb87d('0xe'),_0x292630,_0x608732[_0xb87d('0xc')][_0xb87d('0xf')]);return _0x456494(_0x608732[_0xb87d('0xc')][_0xb87d('0xf')]);}else{logger[_0xb87d('0x10')](_0xb87d('0xe'),_0x292630,'request\x20sent');_0x456494(_0x608732[_0xb87d('0x11')][_0xb87d('0xf')]);}})['catch'](function(_0x546698){logger['error'](_0xb87d('0xe'),_0x292630,_0x546698);_0x2bd957(_0x546698);});});}exports['ShowSound']=function(_0x719edd){var _0x172b72=this;return new Promise(function(_0x32c7a5,_0x4ac0d3){return db['Sound'][_0xb87d('0x12')]({'raw':_0x719edd['options']?_0x719edd[_0xb87d('0x13')][_0xb87d('0x14')]===undefined?!![]:![]:!![],'where':_0x719edd['options']?_0x719edd[_0xb87d('0x13')][_0xb87d('0x15')]||null:null,'attributes':_0x719edd[_0xb87d('0x13')]?_0x719edd['options']['attributes']||null:null,'include':_0x719edd[_0xb87d('0x13')]?_0x719edd[_0xb87d('0x13')]['include']?_[_0xb87d('0x16')](_0x719edd[_0xb87d('0x13')][_0xb87d('0x17')],function(_0x38ab42){return{'model':db[_0x38ab42[_0xb87d('0x18')]],'as':_0x38ab42['as'],'attributes':_0x38ab42[_0xb87d('0x19')],'include':_0x38ab42['include']?_[_0xb87d('0x16')](_0x38ab42['include'],function(_0x9c333){return{'model':db[_0x9c333[_0xb87d('0x18')]],'as':_0x9c333['as'],'attributes':_0x9c333[_0xb87d('0x19')],'include':_0x9c333[_0xb87d('0x17')]?_['map'](_0x9c333['include'],function(_0x2919b6){return{'model':db[_0x2919b6[_0xb87d('0x18')]],'as':_0x2919b6['as'],'attributes':_0x2919b6[_0xb87d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xb87d('0x8')](function(_0x3de122){logger['info']('ShowSound',_0x719edd);logger[_0xb87d('0x9')]('ShowSound',_0x719edd,JSON[_0xb87d('0xb')](_0x3de122));_0x32c7a5(_0x3de122);})[_0xb87d('0x1a')](function(_0x2bc2a3){logger[_0xb87d('0xc')](_0xb87d('0x1b'),_0x2bc2a3['message'],_0x719edd);_0x4ac0d3(_0x172b72[_0xb87d('0xc')](0x1f4,_0x2bc2a3[_0xb87d('0xf')]));});});}; \ No newline at end of file +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 diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 0beef20..8781ae4 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 _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x116c04,_0x4963da){_0x116c04=_0x116c04-0x0;var _0x9e011d=_0x0b0e[_0x116c04];return _0x9e011d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index c6c647f..3b23cfe 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 _0xbfbc=['STRING','TEXT','medium','out','sequelize'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0xbfbc,0x185));var _0xcbfb=function(_0x246f0f,_0x5cd55b){_0x246f0f=_0x246f0f-0x0;var _0x1f6dfe=_0xbfbc[_0x246f0f];return _0x1f6dfe;};'use strict';var Sequelize=require(_0xcbfb('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xcbfb('0x1')]},'body':{'type':Sequelize[_0xcbfb('0x2')](_0xcbfb('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xcbfb('0x4')),'defaultValue':_0xcbfb('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xcbfb('0x1')]},'providerResponse':{'type':Sequelize[_0xcbfb('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index c0acf34..9781c4b 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 _0xfc64=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','SquareMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','show','params','keys','includeAll','options','catch','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x53735a,_0x3441b4){var _0xd9aa42=function(_0x4dbc63){while(--_0x4dbc63){_0x53735a['push'](_0x53735a['shift']());}};_0xd9aa42(++_0x3441b4);}(_0xfc64,0x1b3));var _0x4fc6=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xfc64[_0x521929];return _0x632436;};'use strict';var emlformat=require(_0x4fc6('0x0'));var rimraf=require(_0x4fc6('0x1'));var zipdir=require(_0x4fc6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4fc6('0x3'));var moment=require(_0x4fc6('0x4'));var BPromise=require(_0x4fc6('0x5'));var Mustache=require(_0x4fc6('0x6'));var util=require(_0x4fc6('0x7'));var path=require('path');var sox=require(_0x4fc6('0x8'));var csv=require(_0x4fc6('0x9'));var ejs=require(_0x4fc6('0xa'));var fs=require('fs');var fs_extra=require(_0x4fc6('0xb'));var _=require(_0x4fc6('0xc'));var squel=require(_0x4fc6('0xd'));var crypto=require(_0x4fc6('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x4fc6('0xf'));var toCsv=require(_0x4fc6('0x9'));var querystring=require(_0x4fc6('0x10'));var Papa=require(_0x4fc6('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4fc6('0x12'));var as=require(_0x4fc6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x4fc6('0x14'));var utils=require(_0x4fc6('0x15'));var config=require(_0x4fc6('0x16'));var licenseUtil=require(_0x4fc6('0x17'));var db=require(_0x4fc6('0x18'))['db'];function respondWithStatusCode(_0x21aaf4,_0x46bc71){_0x46bc71=_0x46bc71||0xcc;return function(_0x11c05d){if(_0x11c05d){return _0x21aaf4['sendStatus'](_0x46bc71);}return _0x21aaf4[_0x4fc6('0x19')](_0x46bc71)[_0x4fc6('0x1a')]();};}function respondWithResult(_0x49c1d7,_0x12a508){_0x12a508=_0x12a508||0xc8;return function(_0x49c0fb){if(_0x49c0fb){return _0x49c1d7['status'](_0x12a508)['json'](_0x49c0fb);}};}function respondWithFilteredResult(_0xc19535,_0x43e500){return function(_0x4810e3){if(_0x4810e3){var _0x55426f=typeof _0x43e500[_0x4fc6('0x1b')]==='undefined'&&typeof _0x43e500[_0x4fc6('0x1c')]===_0x4fc6('0x1d');var _0x275f31=_0x4810e3[_0x4fc6('0x1e')];var _0x53418d=_0x55426f?0x0:_0x43e500[_0x4fc6('0x1b')];var _0xcfe632=_0x55426f?_0x4810e3['count']:_0x43e500[_0x4fc6('0x1b')]+_0x43e500[_0x4fc6('0x1c')];var _0x37b2cd;if(_0xcfe632>=_0x275f31){_0xcfe632=_0x275f31;_0x37b2cd=0xc8;}else{_0x37b2cd=0xce;}_0xc19535[_0x4fc6('0x19')](_0x37b2cd);return _0xc19535[_0x4fc6('0x1f')](_0x4fc6('0x20'),_0x53418d+'-'+_0xcfe632+'/'+_0x275f31)[_0x4fc6('0x21')](_0x4810e3);}return null;};}function patchUpdates(_0x27afb1){return function(_0xce5a8e){try{jsonpatch[_0x4fc6('0x22')](_0xce5a8e,_0x27afb1,!![]);}catch(_0x541d58){return BPromise['reject'](_0x541d58);}return _0xce5a8e[_0x4fc6('0x23')]();};}function saveUpdates(_0x4ecefb,_0x274be0){return function(_0x56363d){if(_0x56363d){return _0x56363d[_0x4fc6('0x24')](_0x4ecefb)[_0x4fc6('0x25')](function(_0x8e5520){return _0x8e5520;});}return null;};}function removeEntity(_0x4a93c0,_0x44586a){return function(_0x4aeee3){if(_0x4aeee3){return _0x4aeee3[_0x4fc6('0x26')]()[_0x4fc6('0x25')](function(){_0x4a93c0[_0x4fc6('0x19')](0xcc)[_0x4fc6('0x1a')]();});}};}function handleEntityNotFound(_0x1a0596,_0x354ee7){return function(_0x4c62b3){if(!_0x4c62b3){_0x1a0596[_0x4fc6('0x27')](0x194);}return _0x4c62b3;};}function handleError(_0x3f6e3e,_0x5c64b5){_0x5c64b5=_0x5c64b5||0x1f4;return function(_0x2ef784){logger[_0x4fc6('0x28')](_0x2ef784[_0x4fc6('0x29')]);if(_0x2ef784[_0x4fc6('0x2a')]){delete _0x2ef784[_0x4fc6('0x2a')];}_0x3f6e3e[_0x4fc6('0x19')](_0x5c64b5)['send'](_0x2ef784);};}exports[_0x4fc6('0x2b')]=function(_0x48be65,_0x266d75){var _0x589bb1={},_0x1d0870={},_0x12fffe={'count':0x0,'rows':[]};var _0x2d0676=_[_0x4fc6('0x2c')](db[_0x4fc6('0x2d')][_0x4fc6('0x2e')],function(_0x1e452b){return{'name':_0x1e452b[_0x4fc6('0x2f')],'type':_0x1e452b['type'][_0x4fc6('0x30')]};});_0x1d0870[_0x4fc6('0x31')]=_[_0x4fc6('0x2c')](_0x2d0676,_0x4fc6('0x2a'));_0x1d0870[_0x4fc6('0x32')]=_['keys'](_0x48be65['query']);_0x1d0870[_0x4fc6('0x33')]=_[_0x4fc6('0x34')](_0x1d0870[_0x4fc6('0x31')],_0x1d0870[_0x4fc6('0x32')]);_0x589bb1[_0x4fc6('0x35')]=_['intersection'](_0x1d0870['model'],qs[_0x4fc6('0x36')](_0x48be65['query']['fields']));_0x589bb1[_0x4fc6('0x35')]=_0x589bb1[_0x4fc6('0x35')][_0x4fc6('0x37')]?_0x589bb1[_0x4fc6('0x35')]:_0x1d0870[_0x4fc6('0x31')];if(!_0x48be65[_0x4fc6('0x32')][_0x4fc6('0x38')](_0x4fc6('0x39'))){_0x589bb1[_0x4fc6('0x1c')]=qs[_0x4fc6('0x1c')](_0x48be65['query']['limit']);_0x589bb1[_0x4fc6('0x1b')]=qs[_0x4fc6('0x1b')](_0x48be65[_0x4fc6('0x32')]['offset']);}_0x589bb1[_0x4fc6('0x3a')]=qs[_0x4fc6('0x3b')](_0x48be65['query'][_0x4fc6('0x3b')]);_0x589bb1[_0x4fc6('0x3c')]=qs['filters'](_[_0x4fc6('0x3d')](_0x48be65['query'],_0x1d0870[_0x4fc6('0x33')]),_0x2d0676);if(_0x48be65[_0x4fc6('0x32')][_0x4fc6('0x3e')]){_0x589bb1[_0x4fc6('0x3c')]=_[_0x4fc6('0x3f')](_0x589bb1['where'],{'$or':_[_0x4fc6('0x2c')](_0x2d0676,function(_0x4e75da){if(_0x4e75da[_0x4fc6('0x40')]!==_0x4fc6('0x41')){var _0x2cf18b={};_0x2cf18b[_0x4e75da[_0x4fc6('0x2a')]]={'$like':'%'+_0x48be65[_0x4fc6('0x32')][_0x4fc6('0x3e')]+'%'};return _0x2cf18b;}})});}_0x589bb1=_[_0x4fc6('0x3f')]({},_0x589bb1,_0x48be65['options']);var _0x5514ac={'where':_0x589bb1[_0x4fc6('0x3c')]};return db[_0x4fc6('0x2d')][_0x4fc6('0x1e')](_0x5514ac)[_0x4fc6('0x25')](function(_0x1accb5){_0x12fffe[_0x4fc6('0x1e')]=_0x1accb5;if(_0x48be65[_0x4fc6('0x32')]['includeAll']){_0x589bb1[_0x4fc6('0x42')]=[{'all':!![]}];}return db[_0x4fc6('0x2d')][_0x4fc6('0x43')](_0x589bb1);})[_0x4fc6('0x25')](function(_0x5a08c9){_0x12fffe['rows']=_0x5a08c9;return _0x12fffe;})[_0x4fc6('0x25')](respondWithFilteredResult(_0x266d75,_0x589bb1))['catch'](handleError(_0x266d75,null));};exports[_0x4fc6('0x44')]=function(_0x4748bb,_0x43ec1c){var _0x3e775f={'raw':!![],'where':{'id':_0x4748bb[_0x4fc6('0x45')]['id']}},_0x54fb8c={};_0x54fb8c['model']=_['keys'](db[_0x4fc6('0x2d')][_0x4fc6('0x2e')]);_0x54fb8c[_0x4fc6('0x32')]=_[_0x4fc6('0x46')](_0x4748bb['query']);_0x54fb8c['filters']=_[_0x4fc6('0x34')](_0x54fb8c[_0x4fc6('0x31')],_0x54fb8c[_0x4fc6('0x32')]);_0x3e775f[_0x4fc6('0x35')]=_[_0x4fc6('0x34')](_0x54fb8c['model'],qs['fields'](_0x4748bb[_0x4fc6('0x32')]['fields']));_0x3e775f['attributes']=_0x3e775f['attributes'][_0x4fc6('0x37')]?_0x3e775f[_0x4fc6('0x35')]:_0x54fb8c[_0x4fc6('0x31')];if(_0x4748bb['query'][_0x4fc6('0x47')]){_0x3e775f[_0x4fc6('0x42')]=[{'all':!![]}];}_0x3e775f=_[_0x4fc6('0x3f')]({},_0x3e775f,_0x4748bb[_0x4fc6('0x48')]);return db[_0x4fc6('0x2d')]['find'](_0x3e775f)[_0x4fc6('0x25')](handleEntityNotFound(_0x43ec1c,null))[_0x4fc6('0x25')](respondWithResult(_0x43ec1c,null))[_0x4fc6('0x49')](handleError(_0x43ec1c,null));};exports[_0x4fc6('0x4a')]=function(_0x2472ce,_0x28c5d0){return db[_0x4fc6('0x2d')][_0x4fc6('0x4a')](_0x2472ce['body'],{})[_0x4fc6('0x25')](respondWithResult(_0x28c5d0,0xc9))[_0x4fc6('0x49')](handleError(_0x28c5d0,null));};exports[_0x4fc6('0x24')]=function(_0x1e3918,_0x13f781){if(_0x1e3918['body']['id']){delete _0x1e3918[_0x4fc6('0x4b')]['id'];}return db[_0x4fc6('0x2d')]['find']({'where':{'id':_0x1e3918[_0x4fc6('0x45')]['id']}})[_0x4fc6('0x25')](handleEntityNotFound(_0x13f781,null))[_0x4fc6('0x25')](saveUpdates(_0x1e3918['body'],null))[_0x4fc6('0x25')](respondWithResult(_0x13f781,null))[_0x4fc6('0x49')](handleError(_0x13f781,null));};exports[_0x4fc6('0x26')]=function(_0x46016b,_0xa3851){return db['SquareMessage']['find']({'where':{'id':_0x46016b[_0x4fc6('0x45')]['id']}})[_0x4fc6('0x25')](handleEntityNotFound(_0xa3851,null))[_0x4fc6('0x25')](removeEntity(_0xa3851,null))['catch'](handleError(_0xa3851,null));}; \ No newline at end of file +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 diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index cf1dfda..7f010d7 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 _0x6489=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0xbcba50,_0x400653){var _0xec3347=function(_0x2e31be){while(--_0x2e31be){_0xbcba50['push'](_0xbcba50['shift']());}};_0xec3347(++_0x400653);}(_0x6489,0x126));var _0x9648=function(_0x318d18,_0x312182){_0x318d18=_0x318d18-0x0;var _0x4bde67=_0x6489[_0x318d18];return _0x4bde67;};'use strict';var _=require(_0x9648('0x0'));var util=require(_0x9648('0x1'));var logger=require(_0x9648('0x2'))('api');var moment=require(_0x9648('0x3'));var BPromise=require('bluebird');var rp=require(_0x9648('0x4'));var fs=require('fs');var path=require(_0x9648('0x5'));var rimraf=require(_0x9648('0x6'));var config=require(_0x9648('0x7'));var attributes=require('./squareMessage.attributes');module[_0x9648('0x8')]=function(_0x302930,_0x17e6ec){return _0x302930[_0x9648('0x9')]('SquareMessage',attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 11b257e..fcca323 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 _0xb584=['request','then','info','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','SquareMessage,\x20%s,\x20%s','message','catch','CreateSquareMessage','SquareMessage','body','options','raw','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x274567,_0x13cfa3){var _0x5b4e33=function(_0x10bf51){while(--_0x10bf51){_0x274567['push'](_0x274567['shift']());}};_0x5b4e33(++_0x13cfa3);}(_0xb584,0xac));var _0x4b58=function(_0xdec1e0,_0x5d6e4e){_0xdec1e0=_0xdec1e0-0x0;var _0x378d2b=_0xb584[_0xdec1e0];return _0x378d2b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4b58('0x0'));var BPromise=require('bluebird');var rs=require(_0x4b58('0x1'));var fs=require('fs');var Redis=require(_0x4b58('0x2'));var db=require(_0x4b58('0x3'))['db'];var utils=require(_0x4b58('0x4'));var logger=require(_0x4b58('0x5'))(_0x4b58('0x6'));var config=require(_0x4b58('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4b58('0x8')][_0x4b58('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x377366,_0x32a286,_0x2f2f0f){return new BPromise(function(_0x460b9e,_0xb21d4f){return client[_0x4b58('0xa')](_0x377366,_0x2f2f0f)[_0x4b58('0xb')](function(_0x1b358c){logger[_0x4b58('0xc')]('SquareMessage,\x20%s,\x20%s',_0x32a286,_0x4b58('0xd'));logger[_0x4b58('0xe')](_0x4b58('0xf'),_0x32a286,_0x4b58('0xd'),JSON['stringify'](_0x1b358c));if(_0x1b358c[_0x4b58('0x10')]){if(_0x1b358c[_0x4b58('0x10')][_0x4b58('0x11')]===0x1f4){logger['error'](_0x4b58('0x12'),_0x32a286,_0x1b358c[_0x4b58('0x10')][_0x4b58('0x13')]);return _0xb21d4f(_0x1b358c[_0x4b58('0x10')]['message']);}logger[_0x4b58('0x10')]('SquareMessage,\x20%s,\x20%s',_0x32a286,_0x1b358c['error']['message']);return _0x460b9e(_0x1b358c[_0x4b58('0x10')][_0x4b58('0x13')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x32a286,_0x4b58('0xd'));_0x460b9e(_0x1b358c['result'][_0x4b58('0x13')]);}})[_0x4b58('0x14')](function(_0x4ee845){logger[_0x4b58('0x10')]('SquareMessage,\x20%s,\x20%s',_0x32a286,_0x4ee845);_0xb21d4f(_0x4ee845);});});}exports[_0x4b58('0x15')]=function(_0x49531a){var _0x47330f=this;return new Promise(function(_0x25ac1f,_0x24190f){return db[_0x4b58('0x16')]['create'](_0x49531a[_0x4b58('0x17')],{'raw':_0x49531a[_0x4b58('0x18')]?_0x49531a[_0x4b58('0x18')][_0x4b58('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x15dedf){logger[_0x4b58('0xc')]('CreateSquareMessage',_0x49531a);logger['debug'](_0x4b58('0x15'),_0x49531a,JSON['stringify'](_0x15dedf));_0x25ac1f(_0x15dedf);})[_0x4b58('0x14')](function(_0x4eae76){logger[_0x4b58('0x10')](_0x4b58('0x15'),_0x4eae76[_0x4b58('0x13')],_0x49531a);_0x24190f(_0x47330f[_0x4b58('0x10')](0x1f4,_0x4eae76[_0x4b58('0x13')]));});});}; \ No newline at end of file +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 diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 26f96b4..adf116e 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 _0x00ce=['../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','test','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x2918cb,_0x5ce880){var _0x4c5d63=function(_0x144cf4){while(--_0x144cf4){_0x2918cb['push'](_0x2918cb['shift']());}};_0x4c5d63(++_0x5ce880);}(_0x00ce,0x1b2));var _0xe00c=function(_0x523a9d,_0x34ce3c){_0x523a9d=_0x523a9d-0x0;var _0x5dcd15=_0x00ce[_0x523a9d];return _0x5dcd15;};'use strict';var multer=require(_0xe00c('0x0'));var util=require(_0xe00c('0x1'));var path=require(_0xe00c('0x2'));var timeout=require(_0xe00c('0x3'));var express=require('express');var router=express[_0xe00c('0x4')]();var fs_extra=require(_0xe00c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe00c('0x6'));var config=require(_0xe00c('0x7'));var controller=require(_0xe00c('0x8'));router[_0xe00c('0x9')]('/',auth[_0xe00c('0xa')](),controller[_0xe00c('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe00c('0xc')]);router[_0xe00c('0x9')](_0xe00c('0xd'),auth[_0xe00c('0xa')](),timeout('15s'),controller[_0xe00c('0xe')]);router[_0xe00c('0xf')]('/',auth[_0xe00c('0xa')](),controller[_0xe00c('0x10')]);router[_0xe00c('0x11')]('/:id',auth[_0xe00c('0xa')](),controller['update']);router[_0xe00c('0x12')](_0xe00c('0x13'),auth[_0xe00c('0xa')](),controller[_0xe00c('0x14')]);module[_0xe00c('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 5eb1921..efe600f 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 _0x2f5f=['STRING','name','sequelize','exports'];(function(_0x5493bd,_0x5dfdea){var _0x5e70c2=function(_0x2f0482){while(--_0x2f0482){_0x5493bd['push'](_0x5493bd['shift']());}};_0x5e70c2(++_0x5dfdea);}(_0x2f5f,0x6e));var _0xf2f5=function(_0x338ab8,_0x4d77ca){_0x338ab8=_0x338ab8-0x0;var _0x9eb3f2=_0x2f5f[_0x338ab8];return _0x9eb3f2;};'use strict';var Sequelize=require(_0xf2f5('0x0'));module[_0xf2f5('0x1')]={'name':{'type':Sequelize[_0xf2f5('0x2')],'unique':_0xf2f5('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf2f5('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 830ac24..8e250b9 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 _0x19ae=['rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','include','find','create','user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','test','odbc','openSync','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','set','json','apply','update','then','destroy','get','ODBC','end','name','send','index','map','SquareOdbc'];(function(_0xc9491c,_0x49a03b){var _0x80cee7=function(_0x857dfc){while(--_0x857dfc){_0xc9491c['push'](_0xc9491c['shift']());}};_0x80cee7(++_0x49a03b);}(_0x19ae,0x123));var _0xe19a=function(_0x5c121a,_0x114574){_0x5c121a=_0x5c121a-0x0;var _0x90c1b6=_0x19ae[_0x5c121a];return _0x90c1b6;};'use strict';var emlformat=require(_0xe19a('0x0'));var rimraf=require(_0xe19a('0x1'));var zipdir=require(_0xe19a('0x2'));var jsonpatch=require(_0xe19a('0x3'));var rp=require(_0xe19a('0x4'));var moment=require(_0xe19a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe19a('0x6'));var util=require('util');var path=require(_0xe19a('0x7'));var sox=require('sox');var csv=require(_0xe19a('0x8'));var ejs=require(_0xe19a('0x9'));var fs=require('fs');var fs_extra=require(_0xe19a('0xa'));var _=require('lodash');var squel=require(_0xe19a('0xb'));var crypto=require(_0xe19a('0xc'));var jsforce=require(_0xe19a('0xd'));var deskjs=require(_0xe19a('0xe'));var toCsv=require(_0xe19a('0x8'));var querystring=require(_0xe19a('0xf'));var Papa=require(_0xe19a('0x10'));var Redis=require(_0xe19a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xe19a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe19a('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe19a('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe19a('0x15'))['db'];function respondWithStatusCode(_0x3dbb0c,_0xa0e01){_0xa0e01=_0xa0e01||0xcc;return function(_0x35d8c2){if(_0x35d8c2){return _0x3dbb0c[_0xe19a('0x16')](_0xa0e01);}return _0x3dbb0c[_0xe19a('0x17')](_0xa0e01)['end']();};}function respondWithResult(_0x189074,_0x5bb373){_0x5bb373=_0x5bb373||0xc8;return function(_0x4e5649){if(_0x4e5649){return _0x189074[_0xe19a('0x17')](_0x5bb373)['json'](_0x4e5649);}};}function respondWithFilteredResult(_0x3270c1,_0x4c8474){return function(_0x5ced48){if(_0x5ced48){var _0x54aa7a=typeof _0x4c8474['offset']===_0xe19a('0x18')&&typeof _0x4c8474[_0xe19a('0x19')]===_0xe19a('0x18');var _0xd0bb29=_0x5ced48['count'];var _0x21168=_0x54aa7a?0x0:_0x4c8474['offset'];var _0x3f8210=_0x54aa7a?_0x5ced48[_0xe19a('0x1a')]:_0x4c8474['offset']+_0x4c8474['limit'];var _0x4ed9a8;if(_0x3f8210>=_0xd0bb29){_0x3f8210=_0xd0bb29;_0x4ed9a8=0xc8;}else{_0x4ed9a8=0xce;}_0x3270c1[_0xe19a('0x17')](_0x4ed9a8);return _0x3270c1[_0xe19a('0x1b')]('Content-Range',_0x21168+'-'+_0x3f8210+'/'+_0xd0bb29)[_0xe19a('0x1c')](_0x5ced48);}return null;};}function patchUpdates(_0x2780b3){return function(_0x290f43){try{jsonpatch[_0xe19a('0x1d')](_0x290f43,_0x2780b3,!![]);}catch(_0x582b38){return BPromise['reject'](_0x582b38);}return _0x290f43['save']();};}function saveUpdates(_0x5aad13,_0x10a808){return function(_0x2565c6){if(_0x2565c6){return _0x2565c6[_0xe19a('0x1e')](_0x5aad13)[_0xe19a('0x1f')](function(_0x3ef7b5){return _0x3ef7b5;});}return null;};}function removeEntity(_0x152388,_0x7e9d75){return function(_0x2e0b97){if(_0x2e0b97){return _0x2e0b97[_0xe19a('0x20')]()['then'](function(){var _0x35e69e=_0x2e0b97[_0xe19a('0x21')]({'plain':!![]});var _0xd5eb00=_0xe19a('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0xd5eb00,'resourceId':_0x35e69e['id']}})[_0xe19a('0x1f')](function(){return _0x2e0b97;});})[_0xe19a('0x1f')](function(){_0x152388[_0xe19a('0x17')](0xcc)[_0xe19a('0x23')]();});}};}function handleEntityNotFound(_0x840a23,_0x9409ba){return function(_0x173057){if(!_0x173057){_0x840a23['sendStatus'](0x194);}return _0x173057;};}function handleError(_0x4cc0d1,_0x3e1bb1){_0x3e1bb1=_0x3e1bb1||0x1f4;return function(_0x7a7e4a){logger['error'](_0x7a7e4a['stack']);if(_0x7a7e4a[_0xe19a('0x24')]){delete _0x7a7e4a[_0xe19a('0x24')];}_0x4cc0d1['status'](_0x3e1bb1)[_0xe19a('0x25')](_0x7a7e4a);};}exports[_0xe19a('0x26')]=function(_0x22d129,_0x265c53){var _0x1b2aa6={},_0x3f1e07={},_0x5d6603={'count':0x0,'rows':[]};var _0x43d312=_[_0xe19a('0x27')](db[_0xe19a('0x28')][_0xe19a('0x29')],function(_0x23c30b){return{'name':_0x23c30b['fieldName'],'type':_0x23c30b[_0xe19a('0x2a')]['key']};});_0x3f1e07[_0xe19a('0x2b')]=_[_0xe19a('0x27')](_0x43d312,_0xe19a('0x24'));_0x3f1e07[_0xe19a('0x2c')]=_['keys'](_0x22d129[_0xe19a('0x2c')]);_0x3f1e07[_0xe19a('0x2d')]=_[_0xe19a('0x2e')](_0x3f1e07['model'],_0x3f1e07[_0xe19a('0x2c')]);_0x1b2aa6[_0xe19a('0x2f')]=_[_0xe19a('0x2e')](_0x3f1e07['model'],qs['fields'](_0x22d129['query'][_0xe19a('0x30')]));_0x1b2aa6[_0xe19a('0x2f')]=_0x1b2aa6[_0xe19a('0x2f')][_0xe19a('0x31')]?_0x1b2aa6[_0xe19a('0x2f')]:_0x3f1e07['model'];if(!_0x22d129[_0xe19a('0x2c')][_0xe19a('0x32')](_0xe19a('0x33'))){_0x1b2aa6[_0xe19a('0x19')]=qs[_0xe19a('0x19')](_0x22d129[_0xe19a('0x2c')][_0xe19a('0x19')]);_0x1b2aa6[_0xe19a('0x34')]=qs['offset'](_0x22d129[_0xe19a('0x2c')][_0xe19a('0x34')]);}_0x1b2aa6[_0xe19a('0x35')]=qs[_0xe19a('0x36')](_0x22d129[_0xe19a('0x2c')]['sort']);_0x1b2aa6[_0xe19a('0x37')]=qs[_0xe19a('0x2d')](_[_0xe19a('0x38')](_0x22d129[_0xe19a('0x2c')],_0x3f1e07[_0xe19a('0x2d')]),_0x43d312);if(_0x22d129['query'][_0xe19a('0x39')]){_0x1b2aa6['where']=_[_0xe19a('0x3a')](_0x1b2aa6[_0xe19a('0x37')],{'$or':_[_0xe19a('0x27')](_0x43d312,function(_0x18bf90){if(_0x18bf90[_0xe19a('0x2a')]!==_0xe19a('0x3b')){var _0x29075f={};_0x29075f[_0x18bf90[_0xe19a('0x24')]]={'$like':'%'+_0x22d129[_0xe19a('0x2c')][_0xe19a('0x39')]+'%'};return _0x29075f;}})});}_0x1b2aa6=_[_0xe19a('0x3a')]({},_0x1b2aa6,_0x22d129[_0xe19a('0x3c')]);var _0xa1c203={'where':_0x1b2aa6['where']};return db[_0xe19a('0x28')][_0xe19a('0x1a')](_0xa1c203)[_0xe19a('0x1f')](function(_0x1f4278){_0x5d6603[_0xe19a('0x1a')]=_0x1f4278;if(_0x22d129[_0xe19a('0x2c')][_0xe19a('0x3d')]){_0x1b2aa6['include']=[{'all':!![]}];}return db[_0xe19a('0x28')]['findAll'](_0x1b2aa6);})['then'](function(_0x16e85d){_0x5d6603[_0xe19a('0x3e')]=_0x16e85d;return _0x5d6603;})['then'](respondWithFilteredResult(_0x265c53,_0x1b2aa6))[_0xe19a('0x3f')](handleError(_0x265c53,null));};exports[_0xe19a('0x40')]=function(_0xdcdd7f,_0x320c48){var _0x40757d={'raw':!![],'where':{'id':_0xdcdd7f[_0xe19a('0x41')]['id']}},_0x684691={};_0x684691[_0xe19a('0x2b')]=_[_0xe19a('0x42')](db[_0xe19a('0x28')][_0xe19a('0x29')]);_0x684691[_0xe19a('0x2c')]=_[_0xe19a('0x42')](_0xdcdd7f[_0xe19a('0x2c')]);_0x684691[_0xe19a('0x2d')]=_[_0xe19a('0x2e')](_0x684691[_0xe19a('0x2b')],_0x684691['query']);_0x40757d[_0xe19a('0x2f')]=_['intersection'](_0x684691[_0xe19a('0x2b')],qs[_0xe19a('0x30')](_0xdcdd7f['query']['fields']));_0x40757d[_0xe19a('0x2f')]=_0x40757d['attributes'][_0xe19a('0x31')]?_0x40757d[_0xe19a('0x2f')]:_0x684691[_0xe19a('0x2b')];if(_0xdcdd7f[_0xe19a('0x2c')][_0xe19a('0x3d')]){_0x40757d[_0xe19a('0x43')]=[{'all':!![]}];}_0x40757d=_['merge']({},_0x40757d,_0xdcdd7f[_0xe19a('0x3c')]);return db[_0xe19a('0x28')][_0xe19a('0x44')](_0x40757d)['then'](handleEntityNotFound(_0x320c48,null))[_0xe19a('0x1f')](respondWithResult(_0x320c48,null))[_0xe19a('0x3f')](handleError(_0x320c48,null));};exports['create']=function(_0x604ddb,_0x416bfd){return db[_0xe19a('0x28')][_0xe19a('0x45')](_0x604ddb['body'],{})[_0xe19a('0x1f')](function(_0x37dd29){var _0x275295=_0x604ddb[_0xe19a('0x46')][_0xe19a('0x21')]({'plain':!![]});if(!_0x275295)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x275295[_0xe19a('0x47')]==='user'){var _0x4419bd=_0x37dd29[_0xe19a('0x21')]({'plain':!![]});var _0x5a0fa8=_0xe19a('0x22');return db[_0xe19a('0x48')][_0xe19a('0x44')]({'where':{'name':_0x5a0fa8,'userProfileId':_0x275295[_0xe19a('0x49')]},'raw':!![]})[_0xe19a('0x1f')](function(_0x121505){if(_0x121505&&_0x121505['autoAssociation']===0x0){return db[_0xe19a('0x4a')]['create']({'name':_0x4419bd['name'],'resourceId':_0x4419bd['id'],'type':_0x121505[_0xe19a('0x24')],'sectionId':_0x121505['id']},{})[_0xe19a('0x1f')](function(){return _0x37dd29;});}else{return _0x37dd29;}})[_0xe19a('0x3f')](function(_0x1431dc){logger[_0xe19a('0x4b')](_0xe19a('0x4c'),_0x1431dc);throw _0x1431dc;});}return _0x37dd29;})[_0xe19a('0x1f')](respondWithResult(_0x416bfd,0xc9))[_0xe19a('0x3f')](handleError(_0x416bfd,null));};exports[_0xe19a('0x1e')]=function(_0x26bba2,_0x2604de){if(_0x26bba2[_0xe19a('0x4d')]['id']){delete _0x26bba2[_0xe19a('0x4d')]['id'];}return db[_0xe19a('0x28')][_0xe19a('0x44')]({'where':{'id':_0x26bba2['params']['id']}})[_0xe19a('0x1f')](handleEntityNotFound(_0x2604de,null))[_0xe19a('0x1f')](saveUpdates(_0x26bba2[_0xe19a('0x4d')],null))[_0xe19a('0x1f')](respondWithResult(_0x2604de,null))['catch'](handleError(_0x2604de,null));};exports[_0xe19a('0x20')]=function(_0x1d96ea,_0xf018d1){return db[_0xe19a('0x28')][_0xe19a('0x44')]({'where':{'id':_0x1d96ea[_0xe19a('0x41')]['id']}})[_0xe19a('0x1f')](handleEntityNotFound(_0xf018d1,null))[_0xe19a('0x1f')](removeEntity(_0xf018d1,null))[_0xe19a('0x3f')](handleError(_0xf018d1,null));};exports[_0xe19a('0x4e')]=function(_0x5386c6,_0x707206,_0x2c326f){var _0xd331cb;return db[_0xe19a('0x28')][_0xe19a('0x44')]({'where':{'id':_0x5386c6[_0xe19a('0x41')]['id']},'attributes':['id','dsn']})[_0xe19a('0x1f')](handleEntityNotFound(_0x707206,null))[_0xe19a('0x1f')](function(_0x4a8f51){if(_0x4a8f51){var _0x495a6d=require(_0xe19a('0x4f'))();_0x495a6d[_0xe19a('0x50')](_0x4a8f51[_0xe19a('0x51')]);_0x495a6d[_0xe19a('0x52')]();return _0x4a8f51;}})[_0xe19a('0x1f')](respondWithResult(_0x707206,null))[_0xe19a('0x3f')](handleError(_0x707206,null));}; \ No newline at end of file +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 diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 3fa8a9c..82b9366 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 _0x9886=['exports','define','SquareOdbc','square_odbc','util','api','bluebird','request-promise','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x252e9c,_0x1ce05b){var _0x3817fa=function(_0x4496e6){while(--_0x4496e6){_0x252e9c['push'](_0x252e9c['shift']());}};_0x3817fa(++_0x1ce05b);}(_0x9886,0x1dd));var _0x6988=function(_0x3cbc3b,_0x4f16f7){_0x3cbc3b=_0x3cbc3b-0x0;var _0x3ad213=_0x9886[_0x3cbc3b];return _0x3ad213;};'use strict';var _=require('lodash');var util=require(_0x6988('0x0'));var logger=require('../../config/logger')(_0x6988('0x1'));var moment=require('moment');var BPromise=require(_0x6988('0x2'));var rp=require(_0x6988('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6988('0x4'));var config=require(_0x6988('0x5'));var attributes=require(_0x6988('0x6'));module[_0x6988('0x7')]=function(_0xe2c491,_0x8930d9){return _0xe2c491[_0x6988('0x8')](_0x6988('0x9'),attributes,{'tableName':_0x6988('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index ca3bcf9..88861e1 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 _0x88f9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','map','include','model','lodash','bluebird','randomstring','ioredis'];(function(_0x176ce0,_0x4a4260){var _0x2180a5=function(_0x2d4835){while(--_0x2d4835){_0x176ce0['push'](_0x176ce0['shift']());}};_0x2180a5(++_0x4a4260);}(_0x88f9,0x167));var _0x988f=function(_0x2e5f9c,_0x134a52){_0x2e5f9c=_0x2e5f9c-0x0;var _0x538b44=_0x88f9[_0x2e5f9c];return _0x538b44;};'use strict';var _=require(_0x988f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x988f('0x1'));var rs=require(_0x988f('0x2'));var fs=require('fs');var Redis=require(_0x988f('0x3'));var db=require(_0x988f('0x4'))['db'];var utils=require(_0x988f('0x5'));var logger=require('../../config/logger')(_0x988f('0x6'));var config=require(_0x988f('0x7'));var jayson=require(_0x988f('0x8'));var client=jayson[_0x988f('0x9')][_0x988f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50e453,_0x591b9d,_0x17f4df){return new BPromise(function(_0x2d2314,_0x2764a0){return client[_0x988f('0xb')](_0x50e453,_0x17f4df)[_0x988f('0xc')](function(_0x2c6021){logger[_0x988f('0xd')](_0x988f('0xe'),_0x591b9d,_0x988f('0xf'));logger[_0x988f('0x10')](_0x988f('0x11'),_0x591b9d,_0x988f('0xf'),JSON[_0x988f('0x12')](_0x2c6021));if(_0x2c6021[_0x988f('0x13')]){if(_0x2c6021[_0x988f('0x13')][_0x988f('0x14')]===0x1f4){logger[_0x988f('0x13')](_0x988f('0xe'),_0x591b9d,_0x2c6021[_0x988f('0x13')][_0x988f('0x15')]);return _0x2764a0(_0x2c6021[_0x988f('0x13')]['message']);}logger['error'](_0x988f('0xe'),_0x591b9d,_0x2c6021[_0x988f('0x13')][_0x988f('0x15')]);return _0x2d2314(_0x2c6021['error'][_0x988f('0x15')]);}else{logger['info'](_0x988f('0xe'),_0x591b9d,_0x988f('0xf'));_0x2d2314(_0x2c6021[_0x988f('0x16')][_0x988f('0x15')]);}})[_0x988f('0x17')](function(_0x38a494){logger[_0x988f('0x13')](_0x988f('0xe'),_0x591b9d,_0x38a494);_0x2764a0(_0x38a494);});});}exports[_0x988f('0x18')]=function(_0x54ad71){var _0x3e49e6=this;return new Promise(function(_0x33e897,_0x2dca51){return db[_0x988f('0x19')][_0x988f('0x1a')]({'raw':_0x54ad71['options']?_0x54ad71[_0x988f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x54ad71[_0x988f('0x1b')]?_0x54ad71[_0x988f('0x1b')][_0x988f('0x1c')]||null:null,'attributes':_0x54ad71[_0x988f('0x1b')]?_0x54ad71[_0x988f('0x1b')][_0x988f('0x1d')]||null:null,'include':_0x54ad71[_0x988f('0x1b')]?_0x54ad71[_0x988f('0x1b')]['include']?_[_0x988f('0x1e')](_0x54ad71[_0x988f('0x1b')][_0x988f('0x1f')],function(_0x3ae3e4){return{'model':db[_0x3ae3e4[_0x988f('0x20')]],'as':_0x3ae3e4['as'],'attributes':_0x3ae3e4[_0x988f('0x1d')],'include':_0x3ae3e4[_0x988f('0x1f')]?_[_0x988f('0x1e')](_0x3ae3e4['include'],function(_0x16ffac){return{'model':db[_0x16ffac[_0x988f('0x20')]],'as':_0x16ffac['as'],'attributes':_0x16ffac[_0x988f('0x1d')],'include':_0x16ffac[_0x988f('0x1f')]?_[_0x988f('0x1e')](_0x16ffac[_0x988f('0x1f')],function(_0x4417bd){return{'model':db[_0x4417bd[_0x988f('0x20')]],'as':_0x4417bd['as'],'attributes':_0x4417bd[_0x988f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x988f('0xc')](function(_0x2cdb13){logger[_0x988f('0xd')](_0x988f('0x18'),_0x54ad71);logger[_0x988f('0x10')](_0x988f('0x18'),_0x54ad71,JSON['stringify'](_0x2cdb13));_0x33e897(_0x2cdb13);})[_0x988f('0x17')](function(_0xaecbeb){logger[_0x988f('0x13')](_0x988f('0x18'),_0xaecbeb[_0x988f('0x15')],_0x54ad71);_0x2dca51(_0x3e49e6[_0x988f('0x13')](0x1f4,_0xaecbeb['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 1c9ba2a..1574e8b 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 _0x31bd=['/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','index','show','/:id/users','isAuthenticated','getUsers','post','create','put','update','delete'];(function(_0x24f39b,_0x54dd8a){var _0x123156=function(_0x29d5a7){while(--_0x29d5a7){_0x24f39b['push'](_0x24f39b['shift']());}};_0x123156(++_0x54dd8a);}(_0x31bd,0xbb));var _0xd31b=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x31bd[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0xd31b('0x0'));var util=require(_0xd31b('0x1'));var path=require(_0xd31b('0x2'));var timeout=require(_0xd31b('0x3'));var express=require('express');var router=express[_0xd31b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd31b('0x5'));var interaction=require(_0xd31b('0x6'));var config=require(_0xd31b('0x7'));var controller=require(_0xd31b('0x8'));router[_0xd31b('0x9')]('/',auth['isAuthenticated'](),controller[_0xd31b('0xa')]);router[_0xd31b('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd31b('0xb')]);router[_0xd31b('0x9')](_0xd31b('0xc'),auth[_0xd31b('0xd')](),controller[_0xd31b('0xe')]);router[_0xd31b('0xf')]('/',auth[_0xd31b('0xd')](),controller[_0xd31b('0x10')]);router[_0xd31b('0xf')](_0xd31b('0xc'),auth['isAuthenticated'](),controller['addUsers']);router[_0xd31b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xd31b('0x12')]);router[_0xd31b('0x13')](_0xd31b('0x14'),auth[_0xd31b('0xd')](),controller[_0xd31b('0x15')]);router[_0xd31b('0x13')](_0xd31b('0xc'),auth[_0xd31b('0xd')](),controller['removeUsers']);module[_0xd31b('0x16')]=router; \ No newline at end of file +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 diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index b329932..7e41979 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 _0x8165=['getDataValue','preproduction','BLOB','production','toString','utf8','DATE','sequelize','exports','STRING','name','TEXT','long'];(function(_0x3a6c2a,_0x159794){var _0x599c91=function(_0x5a260a){while(--_0x5a260a){_0x3a6c2a['push'](_0x3a6c2a['shift']());}};_0x599c91(++_0x159794);}(_0x8165,0x96));var _0x5816=function(_0x43c89f,_0x32a64f){_0x43c89f=_0x43c89f-0x0;var _0x56a4fb=_0x8165[_0x43c89f];return _0x56a4fb;};'use strict';var Sequelize=require(_0x5816('0x0'));module[_0x5816('0x1')]={'name':{'type':Sequelize[_0x5816('0x2')],'unique':_0x5816('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5816('0x2')]},'notes':{'type':Sequelize[_0x5816('0x4')]},'preproduction':{'type':Sequelize['BLOB'](_0x5816('0x5')),'get':function(){if(this[_0x5816('0x6')](_0x5816('0x7'))){return this['getDataValue']('preproduction')['toString']('utf8');}}},'production':{'type':Sequelize[_0x5816('0x8')](_0x5816('0x5')),'get':function(){if(this['getDataValue']('production')){return this['getDataValue'](_0x5816('0x9'))[_0x5816('0xa')](_0x5816('0xb'));}}},'savedAt':{'type':Sequelize[_0x5816('0xc')]},'publishedAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +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 diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index efe54ed..678a394 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 _0x863c=['localhost','socket.io-emitter','register','sendStatus','status','json','limit','undefined','offset','count','apply','reject','save','then','get','UserProfileResource','end','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','findAll','rows','catch','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','update','destroy','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x277fdc,_0x3169a7){var _0x1b7398=function(_0xb8f5cd){while(--_0xb8f5cd){_0x277fdc['push'](_0x277fdc['shift']());}};_0x1b7398(++_0x3169a7);}(_0x863c,0x167));var _0xc863=function(_0x17488d,_0xcdaec9){_0x17488d=_0x17488d-0x0;var _0x512d8d=_0x863c[_0x17488d];return _0x512d8d;};'use strict';var emlformat=require(_0xc863('0x0'));var rimraf=require(_0xc863('0x1'));var zipdir=require(_0xc863('0x2'));var jsonpatch=require(_0xc863('0x3'));var rp=require('request-promise');var moment=require(_0xc863('0x4'));var BPromise=require(_0xc863('0x5'));var Mustache=require(_0xc863('0x6'));var util=require('util');var path=require(_0xc863('0x7'));var sox=require(_0xc863('0x8'));var csv=require(_0xc863('0x9'));var ejs=require(_0xc863('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc863('0xb'));var squel=require(_0xc863('0xc'));var crypto=require(_0xc863('0xd'));var jsforce=require(_0xc863('0xe'));var deskjs=require(_0xc863('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc863('0x10'));var Papa=require('papaparse');var Redis=require(_0xc863('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc863('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc863('0x13'));var utils=require(_0xc863('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc863('0x15'));var db=require(_0xc863('0x16'))['db'];config[_0xc863('0x17')]=_[_0xc863('0x18')](config['redis'],{'host':_0xc863('0x19'),'port':0x18eb});var socket=require(_0xc863('0x1a'))(new Redis(config[_0xc863('0x17')]));require('./squareProject.socket')[_0xc863('0x1b')](socket);function respondWithStatusCode(_0x502dc6,_0x124146){_0x124146=_0x124146||0xcc;return function(_0xee2db){if(_0xee2db){return _0x502dc6[_0xc863('0x1c')](_0x124146);}return _0x502dc6[_0xc863('0x1d')](_0x124146)['end']();};}function respondWithResult(_0x178dc9,_0x554c94){_0x554c94=_0x554c94||0xc8;return function(_0x5e281d){if(_0x5e281d){return _0x178dc9[_0xc863('0x1d')](_0x554c94)[_0xc863('0x1e')](_0x5e281d);}};}function respondWithFilteredResult(_0x33ab3e,_0x41ad72){return function(_0x427bb8){if(_0x427bb8){var _0x13618b=typeof _0x41ad72['offset']==='undefined'&&typeof _0x41ad72[_0xc863('0x1f')]===_0xc863('0x20');var _0x4ecc39=_0x427bb8['count'];var _0x3188db=_0x13618b?0x0:_0x41ad72[_0xc863('0x21')];var _0x1f847c=_0x13618b?_0x427bb8[_0xc863('0x22')]:_0x41ad72[_0xc863('0x21')]+_0x41ad72[_0xc863('0x1f')];var _0x41d1b7;if(_0x1f847c>=_0x4ecc39){_0x1f847c=_0x4ecc39;_0x41d1b7=0xc8;}else{_0x41d1b7=0xce;}_0x33ab3e[_0xc863('0x1d')](_0x41d1b7);return _0x33ab3e['set']('Content-Range',_0x3188db+'-'+_0x1f847c+'/'+_0x4ecc39)[_0xc863('0x1e')](_0x427bb8);}return null;};}function patchUpdates(_0x520d5d){return function(_0x2136b7){try{jsonpatch[_0xc863('0x23')](_0x2136b7,_0x520d5d,!![]);}catch(_0x4c99f5){return BPromise[_0xc863('0x24')](_0x4c99f5);}return _0x2136b7[_0xc863('0x25')]();};}function saveUpdates(_0x465156,_0xfb6a0d){return function(_0x55e570){if(_0x55e570){return _0x55e570['update'](_0x465156)[_0xc863('0x26')](function(_0x497988){return _0x497988;});}return null;};}function removeEntity(_0x59fce7,_0x4203ee){return function(_0x102050){if(_0x102050){return _0x102050['destroy']()[_0xc863('0x26')](function(){var _0x35143f=_0x102050[_0xc863('0x27')]({'plain':!![]});var _0x49d27d='SquareProjects';return db[_0xc863('0x28')]['destroy']({'where':{'type':_0x49d27d,'resourceId':_0x35143f['id']}})[_0xc863('0x26')](function(){return _0x102050;});})['then'](function(){_0x59fce7[_0xc863('0x1d')](0xcc)[_0xc863('0x29')]();});}};}function handleEntityNotFound(_0x4855ea,_0x21aed8){return function(_0x1e9fce){if(!_0x1e9fce){_0x4855ea[_0xc863('0x1c')](0x194);}return _0x1e9fce;};}function handleError(_0x4a81a1,_0x2025d0){_0x2025d0=_0x2025d0||0x1f4;return function(_0x478552){logger[_0xc863('0x2a')](_0x478552[_0xc863('0x2b')]);if(_0x478552[_0xc863('0x2c')]){delete _0x478552[_0xc863('0x2c')];}_0x4a81a1['status'](_0x2025d0)[_0xc863('0x2d')](_0x478552);};}exports[_0xc863('0x2e')]=function(_0x791df0,_0x5d19c6){var _0x48ffb4={},_0x3ce30c={},_0x328b7a={'count':0x0,'rows':[]};var _0x555bfd=_[_0xc863('0x2f')](db['SquareProject']['rawAttributes'],function(_0xd3d693){return{'name':_0xd3d693[_0xc863('0x30')],'type':_0xd3d693[_0xc863('0x31')][_0xc863('0x32')]};});_0x3ce30c[_0xc863('0x33')]=_[_0xc863('0x2f')](_0x555bfd,_0xc863('0x2c'));_0x3ce30c[_0xc863('0x34')]=_[_0xc863('0x35')](_0x791df0[_0xc863('0x34')]);_0x3ce30c['filters']=_[_0xc863('0x36')](_0x3ce30c[_0xc863('0x33')],_0x3ce30c[_0xc863('0x34')]);_0x48ffb4[_0xc863('0x37')]=_['intersection'](_0x3ce30c[_0xc863('0x33')],qs['fields'](_0x791df0[_0xc863('0x34')][_0xc863('0x38')]));_0x48ffb4['attributes']=_0x48ffb4['attributes']['length']?_0x48ffb4[_0xc863('0x37')]:_0x3ce30c['model'];if(!_0x791df0['query']['hasOwnProperty'](_0xc863('0x39'))){_0x48ffb4[_0xc863('0x1f')]=qs[_0xc863('0x1f')](_0x791df0['query'][_0xc863('0x1f')]);_0x48ffb4['offset']=qs[_0xc863('0x21')](_0x791df0[_0xc863('0x34')][_0xc863('0x21')]);}_0x48ffb4[_0xc863('0x3a')]=qs[_0xc863('0x3b')](_0x791df0[_0xc863('0x34')]['sort']);_0x48ffb4[_0xc863('0x3c')]=qs[_0xc863('0x3d')](_['pick'](_0x791df0[_0xc863('0x34')],_0x3ce30c[_0xc863('0x3d')]),_0x555bfd);if(_0x791df0[_0xc863('0x34')][_0xc863('0x3e')]){_0x48ffb4['where']=_[_0xc863('0x3f')](_0x48ffb4[_0xc863('0x3c')],{'$or':_[_0xc863('0x2f')](_0x555bfd,function(_0x5a2cbb){if(_0x5a2cbb['type']!==_0xc863('0x40')){var _0x5ceeae={};_0x5ceeae[_0x5a2cbb['name']]={'$like':'%'+_0x791df0[_0xc863('0x34')][_0xc863('0x3e')]+'%'};return _0x5ceeae;}})});}_0x48ffb4=_['merge']({},_0x48ffb4,_0x791df0[_0xc863('0x41')]);var _0x5dcc1c={'where':_0x48ffb4[_0xc863('0x3c')]};return db[_0xc863('0x42')][_0xc863('0x22')](_0x5dcc1c)[_0xc863('0x26')](function(_0x14ae7e){_0x328b7a['count']=_0x14ae7e;if(_0x791df0[_0xc863('0x34')][_0xc863('0x43')]){_0x48ffb4[_0xc863('0x44')]=[{'all':!![]}];}return db[_0xc863('0x42')][_0xc863('0x45')](_0x48ffb4);})[_0xc863('0x26')](function(_0x274f7f){_0x328b7a[_0xc863('0x46')]=_0x274f7f;return _0x328b7a;})[_0xc863('0x26')](respondWithFilteredResult(_0x5d19c6,_0x48ffb4))[_0xc863('0x47')](handleError(_0x5d19c6,null));};exports['show']=function(_0x1bf49b,_0x13ab6b){var _0x43a1cd={'raw':![],'where':{'id':_0x1bf49b[_0xc863('0x48')]['id']}},_0x91496e={};_0x91496e[_0xc863('0x33')]=_[_0xc863('0x35')](db[_0xc863('0x42')][_0xc863('0x49')]);_0x91496e[_0xc863('0x34')]=_[_0xc863('0x35')](_0x1bf49b[_0xc863('0x34')]);_0x91496e[_0xc863('0x3d')]=_[_0xc863('0x36')](_0x91496e['model'],_0x91496e['query']);_0x43a1cd[_0xc863('0x37')]=_['intersection'](_0x91496e[_0xc863('0x33')],qs['fields'](_0x1bf49b[_0xc863('0x34')][_0xc863('0x38')]));_0x43a1cd['attributes']=_0x43a1cd[_0xc863('0x37')][_0xc863('0x4a')]?_0x43a1cd[_0xc863('0x37')]:_0x91496e['model'];if(_0x1bf49b[_0xc863('0x34')][_0xc863('0x43')]){_0x43a1cd[_0xc863('0x44')]=[{'all':!![]}];}_0x43a1cd=_[_0xc863('0x3f')]({},_0x43a1cd,_0x1bf49b['options']);return db[_0xc863('0x42')][_0xc863('0x4b')](_0x43a1cd)[_0xc863('0x26')](handleEntityNotFound(_0x13ab6b,null))[_0xc863('0x26')](respondWithResult(_0x13ab6b,null))[_0xc863('0x47')](handleError(_0x13ab6b,null));};exports[_0xc863('0x4c')]=function(_0x4afb39,_0x4c4962){return db['SquareProject'][_0xc863('0x4c')](_0x4afb39[_0xc863('0x4d')],{})[_0xc863('0x26')](function(_0xd4ceff){var _0x5d77af=_0x4afb39[_0xc863('0x4e')][_0xc863('0x27')]({'plain':!![]});if(!_0x5d77af)throw new Error(_0xc863('0x4f'));if(_0x5d77af[_0xc863('0x50')]===_0xc863('0x4e')){var _0x3606c7=_0xd4ceff['get']({'plain':!![]});var _0x412c6f='SquareProjects';return db[_0xc863('0x51')][_0xc863('0x4b')]({'where':{'name':_0x412c6f,'userProfileId':_0x5d77af[_0xc863('0x52')]},'raw':!![]})[_0xc863('0x26')](function(_0x4bbbb0){if(_0x4bbbb0&&_0x4bbbb0['autoAssociation']===0x0){return db['UserProfileResource'][_0xc863('0x4c')]({'name':_0x3606c7[_0xc863('0x2c')],'resourceId':_0x3606c7['id'],'type':_0x4bbbb0['name'],'sectionId':_0x4bbbb0['id']},{})[_0xc863('0x26')](function(){return _0xd4ceff;});}else{return _0xd4ceff;}})[_0xc863('0x47')](function(_0x24b928){logger[_0xc863('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x24b928);throw _0x24b928;});}return _0xd4ceff;})[_0xc863('0x26')](respondWithResult(_0x4c4962,0xc9))[_0xc863('0x47')](handleError(_0x4c4962,null));};exports[_0xc863('0x53')]=function(_0xdd6b0a,_0x17de38){if(_0xdd6b0a[_0xc863('0x4d')]['id']){delete _0xdd6b0a[_0xc863('0x4d')]['id'];}return db[_0xc863('0x42')][_0xc863('0x4b')]({'where':{'id':_0xdd6b0a[_0xc863('0x48')]['id']}})[_0xc863('0x26')](handleEntityNotFound(_0x17de38,null))[_0xc863('0x26')](saveUpdates(_0xdd6b0a['body'],null))[_0xc863('0x26')](respondWithResult(_0x17de38,null))[_0xc863('0x47')](handleError(_0x17de38,null));};exports[_0xc863('0x54')]=function(_0x308f7f,_0x73f433){return db['SquareProject'][_0xc863('0x4b')]({'where':{'id':_0x308f7f[_0xc863('0x48')]['id']}})[_0xc863('0x26')](handleEntityNotFound(_0x73f433,null))['then'](removeEntity(_0x73f433,null))[_0xc863('0x47')](handleError(_0x73f433,null));};exports[_0xc863('0x55')]=function(_0x4f77c4,_0x511906,_0x154b04){return db[_0xc863('0x42')][_0xc863('0x4b')]({'where':{'id':_0x4f77c4[_0xc863('0x48')]['id']}})[_0xc863('0x26')](handleEntityNotFound(_0x511906,null))[_0xc863('0x26')](function(_0x4e6ff4){if(_0x4e6ff4){return _0x4e6ff4[_0xc863('0x55')](_0x4f77c4[_0xc863('0x4d')]['ids'],_[_0xc863('0x56')](_0x4f77c4['body'],[_0xc863('0x57'),'id'])||{});}})[_0xc863('0x26')](respondWithResult(_0x511906,null))[_0xc863('0x47')](handleError(_0x511906,null));};exports[_0xc863('0x58')]=function(_0x5eeb9a,_0xd5f4e6,_0x33f256){return db[_0xc863('0x42')]['find']({'where':{'id':_0x5eeb9a[_0xc863('0x48')]['id']}})[_0xc863('0x26')](handleEntityNotFound(_0xd5f4e6,null))['then'](function(_0x3fedef){if(_0x3fedef){return _0x3fedef[_0xc863('0x58')](_0x5eeb9a['query']['ids'])['then'](function(){if(_[_0xc863('0x59')](_0x5eeb9a[_0xc863('0x34')][_0xc863('0x57')])){for(var _0x3e8f8a=0x0;_0x3e8f8a<_0x5eeb9a[_0xc863('0x34')][_0xc863('0x57')][_0xc863('0x4a')];_0x3e8f8a+=0x1){socket[_0xc863('0x5a')](_0xc863('0x5b'),{'UserId':Number(_0x5eeb9a[_0xc863('0x34')][_0xc863('0x57')][_0x3e8f8a]),'SquareProjectId':Number(_0x5eeb9a['params']['id'])});}}else{socket[_0xc863('0x5a')](_0xc863('0x5b'),{'UserId':Number(_0x5eeb9a[_0xc863('0x34')]['ids']),'SquareProjectId':Number(_0x5eeb9a[_0xc863('0x48')]['id'])});}});}})[_0xc863('0x26')](respondWithStatusCode(_0xd5f4e6,null))[_0xc863('0x47')](handleError(_0xd5f4e6,null));};exports[_0xc863('0x5c')]=function(_0x2b8824,_0x131965,_0x4b626f){var _0x216180={};var _0x1f5036={};var _0x436e90;var _0x58a4b8;return db[_0xc863('0x42')][_0xc863('0x5d')]({'where':{'id':_0x2b8824[_0xc863('0x48')]['id']}})[_0xc863('0x26')](handleEntityNotFound(_0x131965,null))[_0xc863('0x26')](function(_0x2cdaf9){if(_0x2cdaf9){_0x436e90=_0x2cdaf9;_0x1f5036[_0xc863('0x33')]=_[_0xc863('0x35')](db[_0xc863('0x5e')][_0xc863('0x49')]);_0x1f5036[_0xc863('0x34')]=_[_0xc863('0x35')](_0x2b8824[_0xc863('0x34')]);_0x1f5036[_0xc863('0x3d')]=_[_0xc863('0x36')](_0x1f5036[_0xc863('0x33')],_0x1f5036[_0xc863('0x34')]);_0x216180[_0xc863('0x37')]=_[_0xc863('0x36')](_0x1f5036['model'],qs[_0xc863('0x38')](_0x2b8824[_0xc863('0x34')][_0xc863('0x38')]));_0x216180[_0xc863('0x37')]=_0x216180[_0xc863('0x37')][_0xc863('0x4a')]?_0x216180[_0xc863('0x37')]:_0x1f5036[_0xc863('0x33')];_0x216180[_0xc863('0x3a')]=qs['sort'](_0x2b8824[_0xc863('0x34')][_0xc863('0x3b')]);_0x216180[_0xc863('0x3c')]=qs['filters'](_['pick'](_0x2b8824['query'],_0x1f5036['filters']));if(_0x2b8824[_0xc863('0x34')]['filter']){_0x216180[_0xc863('0x3c')]=_['merge'](_0x216180[_0xc863('0x3c')],{'$or':_[_0xc863('0x2f')](_0x216180['attributes'],function(_0x26b360){var _0xa0f5fc={};_0xa0f5fc[_0x26b360]={'$like':'%'+_0x2b8824[_0xc863('0x34')][_0xc863('0x3e')]+'%'};return _0xa0f5fc;})});}_0x216180=_[_0xc863('0x3f')]({},_0x216180,_0x2b8824['options']);return _0x436e90['getUsers'](_0x216180);}})[_0xc863('0x26')](function(_0x46c32f){if(_0x46c32f){_0x58a4b8=_0x46c32f[_0xc863('0x4a')];if(!_0x2b8824['query'][_0xc863('0x5f')](_0xc863('0x39'))){_0x216180[_0xc863('0x1f')]=qs[_0xc863('0x1f')](_0x2b8824[_0xc863('0x34')][_0xc863('0x1f')]);_0x216180['offset']=qs['offset'](_0x2b8824[_0xc863('0x34')]['offset']);}return _0x436e90['getUsers'](_0x216180);}})[_0xc863('0x26')](function(_0xdad928){if(_0xdad928){return _0xdad928?{'count':_0x58a4b8,'rows':_0xdad928}:null;}})[_0xc863('0x26')](respondWithResult(_0x131965,null))['catch'](handleError(_0x131965,null));}; \ No newline at end of file +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 diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index e5fbcca..7b2d566 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 _0x145c=['hook','events','../../mysqldb','SquareProject','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x145c,0x1c3));var _0xc145=function(_0x435a2e,_0x20f3a4){_0x435a2e=_0x435a2e-0x0;var _0xe5877=_0x145c[_0x435a2e];return _0xe5877;};'use strict';var EventEmitter=require(_0xc145('0x0'));var SquareProject=require(_0xc145('0x1'))['db'][_0xc145('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc145('0x3')](0x0);var events={'afterCreate':_0xc145('0x4'),'afterUpdate':_0xc145('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4e75e5){return function(_0x4fe6de,_0x43ac16,_0x4f3fc){SquareProjectEvents[_0xc145('0x6')](_0x4e75e5+':'+_0x4fe6de['id'],_0x4fe6de);SquareProjectEvents[_0xc145('0x6')](_0x4e75e5,_0x4fe6de);_0x4f3fc(null);};}for(var e in events){if(events[_0xc145('0x7')](e)){var event=events[e];SquareProject[_0xc145('0x8')](e,emitEvent(event));}}module['exports']=SquareProjectEvents; \ No newline at end of file +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 diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2a5ca5e..2e65a1e 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 _0x19ca=['YYYY-MM-DD\x20HH:mm:ss','changed','production','publishedAt','format','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./squareProject.attributes','exports','define','SquareProject','square_projects','preproduction','savedAt'];(function(_0x4e9182,_0x3b49b1){var _0x17aef7=function(_0x516e65){while(--_0x516e65){_0x4e9182['push'](_0x4e9182['shift']());}};_0x17aef7(++_0x3b49b1);}(_0x19ca,0xd6));var _0xa19c=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x19ca[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xa19c('0x0'));var util=require(_0xa19c('0x1'));var logger=require(_0xa19c('0x2'))('api');var moment=require(_0xa19c('0x3'));var BPromise=require('bluebird');var rp=require(_0xa19c('0x4'));var fs=require('fs');var path=require(_0xa19c('0x5'));var rimraf=require(_0xa19c('0x6'));var config=require('../../config/environment');var attributes=require(_0xa19c('0x7'));module[_0xa19c('0x8')]=function(_0x185581,_0x2bfe43){return _0x185581[_0xa19c('0x9')](_0xa19c('0xa'),attributes,{'tableName':_0xa19c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5b5220,_0x5478e9,_0x4d00f5){if(_0x5b5220['changed'](_0xa19c('0xc'))){_0x5b5220[_0xa19c('0xd')]=moment()['format'](_0xa19c('0xe'));}if(_0x5b5220[_0xa19c('0xf')](_0xa19c('0x10'))){_0x5b5220[_0xa19c('0x11')]=moment()[_0xa19c('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4d00f5(null,_0x5b5220);}}});}; \ No newline at end of file +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 diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 1169689..ef0a04b 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 _0x689a=['model','ShowSquareProject','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','request','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','message','catch','SquareProject','find','options','where','attributes','map','include'];(function(_0x3cef00,_0x207272){var _0x3ceadc=function(_0x4615a3){while(--_0x4615a3){_0x3cef00['push'](_0x3cef00['shift']());}};_0x3ceadc(++_0x207272);}(_0x689a,0x161));var _0xa689=function(_0x28a655,_0x22a779){_0x28a655=_0x28a655-0x0;var _0x3f259f=_0x689a[_0x28a655];return _0x3f259f;};'use strict';var _=require(_0xa689('0x0'));var util=require(_0xa689('0x1'));var moment=require(_0xa689('0x2'));var BPromise=require(_0xa689('0x3'));var rs=require(_0xa689('0x4'));var fs=require('fs');var Redis=require(_0xa689('0x5'));var db=require(_0xa689('0x6'))['db'];var utils=require(_0xa689('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa689('0x8'));var jayson=require(_0xa689('0x9'));var client=jayson['client'][_0xa689('0xa')]({'port':0x232a});config[_0xa689('0xb')]=_[_0xa689('0xc')](config[_0xa689('0xb')],{'host':_0xa689('0xd'),'port':0x18eb});var socket=require(_0xa689('0xe'))(new Redis(config[_0xa689('0xb')]));require(_0xa689('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ca393,_0x201ca9,_0x1c2c7d){return new BPromise(function(_0x4a384c,_0x293722){return client[_0xa689('0x10')](_0x5ca393,_0x1c2c7d)[_0xa689('0x11')](function(_0x2a5a8d){logger[_0xa689('0x12')](_0xa689('0x13'),_0x201ca9,_0xa689('0x14'));logger['debug'](_0xa689('0x15'),_0x201ca9,_0xa689('0x14'),JSON['stringify'](_0x2a5a8d));if(_0x2a5a8d[_0xa689('0x16')]){if(_0x2a5a8d[_0xa689('0x16')]['code']===0x1f4){logger[_0xa689('0x16')](_0xa689('0x13'),_0x201ca9,_0x2a5a8d[_0xa689('0x16')][_0xa689('0x17')]);return _0x293722(_0x2a5a8d[_0xa689('0x16')][_0xa689('0x17')]);}logger['error'](_0xa689('0x13'),_0x201ca9,_0x2a5a8d[_0xa689('0x16')][_0xa689('0x17')]);return _0x4a384c(_0x2a5a8d[_0xa689('0x16')][_0xa689('0x17')]);}else{logger[_0xa689('0x12')](_0xa689('0x13'),_0x201ca9,'request\x20sent');_0x4a384c(_0x2a5a8d['result'][_0xa689('0x17')]);}})[_0xa689('0x18')](function(_0x2a1b79){logger['error'](_0xa689('0x13'),_0x201ca9,_0x2a1b79);_0x293722(_0x2a1b79);});});}exports['ShowSquareProject']=function(_0x599b27){var _0x5d663e=this;return new Promise(function(_0x5c4bdf,_0x39743c){return db[_0xa689('0x19')][_0xa689('0x1a')]({'raw':_0x599b27[_0xa689('0x1b')]?_0x599b27[_0xa689('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x599b27[_0xa689('0x1b')]?_0x599b27[_0xa689('0x1b')][_0xa689('0x1c')]||null:null,'attributes':_0x599b27[_0xa689('0x1b')]?_0x599b27[_0xa689('0x1b')][_0xa689('0x1d')]||null:null,'include':_0x599b27[_0xa689('0x1b')]?_0x599b27[_0xa689('0x1b')]['include']?_[_0xa689('0x1e')](_0x599b27[_0xa689('0x1b')][_0xa689('0x1f')],function(_0x54f771){return{'model':db[_0x54f771[_0xa689('0x20')]],'as':_0x54f771['as'],'attributes':_0x54f771[_0xa689('0x1d')],'include':_0x54f771[_0xa689('0x1f')]?_['map'](_0x54f771['include'],function(_0x236ccd){return{'model':db[_0x236ccd[_0xa689('0x20')]],'as':_0x236ccd['as'],'attributes':_0x236ccd[_0xa689('0x1d')],'include':_0x236ccd['include']?_[_0xa689('0x1e')](_0x236ccd['include'],function(_0x57049a){return{'model':db[_0x57049a[_0xa689('0x20')]],'as':_0x57049a['as'],'attributes':_0x57049a['attributes']};}):[]};}):[]};}):[]:[]})[_0xa689('0x11')](function(_0x42ee7b){logger[_0xa689('0x12')](_0xa689('0x21'),_0x599b27);logger['debug']('ShowSquareProject',_0x599b27,JSON[_0xa689('0x22')](_0x42ee7b));_0x5c4bdf(_0x42ee7b);})[_0xa689('0x18')](function(_0x4f358e){logger[_0xa689('0x16')](_0xa689('0x21'),_0x4f358e['message'],_0x599b27);_0x39743c(_0x5d663e['error'](0x1f4,_0x4f358e[_0xa689('0x17')]));});});}; \ No newline at end of file +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 diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5806dc6..8c4a83a 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 _0xce8b=['./squareProject.events','remove','update','emit','removeListener','register','length','squareProject:'];(function(_0x2f46db,_0x1e864e){var _0x3a24d1=function(_0x3cac9e){while(--_0x3cac9e){_0x2f46db['push'](_0x2f46db['shift']());}};_0x3a24d1(++_0x1e864e);}(_0xce8b,0xe8));var _0xbce8=function(_0x318840,_0x561b1e){_0x318840=_0x318840-0x0;var _0x223da4=_0xce8b[_0x318840];return _0x223da4;};'use strict';var SquareProjectEvents=require(_0xbce8('0x0'));var events=['save',_0xbce8('0x1'),_0xbce8('0x2')];function createListener(_0x10bb01,_0x1f697e){return function(_0x58dd9f){_0x1f697e[_0xbce8('0x3')](_0x10bb01,_0x58dd9f);};}function removeListener(_0x4e21dc,_0x1bd270){return function(){SquareProjectEvents[_0xbce8('0x4')](_0x4e21dc,_0x1bd270);};}exports[_0xbce8('0x5')]=function(_0x5b2017){for(var _0x49432c=0x0,_0x185ac7=events[_0xbce8('0x6')];_0x49432c<_0x185ac7;_0x49432c++){var _0x44fe2b=events[_0x49432c];var _0x26b158=createListener(_0xbce8('0x7')+_0x44fe2b,_0x5b2017);SquareProjectEvents['on'](_0x44fe2b,_0x26b158);}}; \ No newline at end of file +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 diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 8df1b77..9eb7aef 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x4671cd,_0x24a36e){var _0x5dca54=function(_0x229758){while(--_0x229758){_0x4671cd['push'](_0x4671cd['shift']());}};_0x5dca54(++_0x24a36e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1d0ef0,_0x39875a){_0x1d0ef0=_0x1d0ef0-0x0;var _0x5f2fef=_0x1cb9[_0x1d0ef0];return _0x5f2fef;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +var _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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 31a93de..c185371 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 _0x7fbe=['STRING','VIRTUAL','getDataValue','savePath','substring','lastIndexOf'];(function(_0xccece6,_0x9d3ffa){var _0x4e7e47=function(_0x18f2b9){while(--_0x18f2b9){_0xccece6['push'](_0xccece6['shift']());}};_0x4e7e47(++_0x9d3ffa);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x322efb,_0x539552){_0x322efb=_0x322efb-0x0;var _0x4245ca=_0x7fbe[_0x322efb];return _0x4245ca;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xe7fb('0x0')]},'callerid':{'type':Sequelize[_0xe7fb('0x0')]},'calleridname':{'type':Sequelize[_0xe7fb('0x0')]},'context':{'type':Sequelize[_0xe7fb('0x0')]},'extension':{'type':Sequelize[_0xe7fb('0x0')]},'priority':{'type':Sequelize[_0xe7fb('0x0')]},'accountcode':{'type':Sequelize[_0xe7fb('0x0')]},'dnid':{'type':Sequelize[_0xe7fb('0x0')]},'projectName':{'type':Sequelize[_0xe7fb('0x0')]},'saveName':{'type':Sequelize[_0xe7fb('0x0')]},'filename':{'type':Sequelize[_0xe7fb('0x0')]},'savePath':{'type':Sequelize[_0xe7fb('0x0')]},'format':{'type':Sequelize[_0xe7fb('0x1')],'get':function(){var _0x1f943f='';var _0x5ad75b=this[_0xe7fb('0x2')](_0xe7fb('0x3'));if(_0x5ad75b){_0x1f943f=_0x5ad75b[_0xe7fb('0x4')](_0x5ad75b[_0xe7fb('0x5')]('.'));}return _0x1f943f;}}}; \ No newline at end of file +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 diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 533ee6f..db94b67 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 _0x53ef=['send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','download','uniqueid','savePath','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','stack','name'];(function(_0x1a5403,_0xf05f0b){var _0x5a1e90=function(_0xeb63c6){while(--_0xeb63c6){_0x1a5403['push'](_0x1a5403['shift']());}};_0x5a1e90(++_0xf05f0b);}(_0x53ef,0x16a));var _0xf53e=function(_0x40911a,_0x55ec99){_0x40911a=_0x40911a-0x0;var _0x27e8e3=_0x53ef[_0x40911a];return _0x27e8e3;};'use strict';var emlformat=require(_0xf53e('0x0'));var rimraf=require(_0xf53e('0x1'));var zipdir=require(_0xf53e('0x2'));var jsonpatch=require(_0xf53e('0x3'));var rp=require(_0xf53e('0x4'));var moment=require(_0xf53e('0x5'));var BPromise=require(_0xf53e('0x6'));var Mustache=require(_0xf53e('0x7'));var util=require(_0xf53e('0x8'));var path=require(_0xf53e('0x9'));var sox=require(_0xf53e('0xa'));var csv=require(_0xf53e('0xb'));var ejs=require(_0xf53e('0xc'));var fs=require('fs');var fs_extra=require(_0xf53e('0xd'));var _=require(_0xf53e('0xe'));var squel=require(_0xf53e('0xf'));var crypto=require('crypto');var jsforce=require(_0xf53e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf53e('0xb'));var querystring=require('querystring');var Papa=require(_0xf53e('0x11'));var Redis=require(_0xf53e('0x12'));var authService=require(_0xf53e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf53e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf53e('0x15'))(_0xf53e('0x16'));var utils=require(_0xf53e('0x17'));var config=require(_0xf53e('0x18'));var licenseUtil=require(_0xf53e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x118207,_0x130490){_0x130490=_0x130490||0xcc;return function(_0x5ae088){if(_0x5ae088){return _0x118207['sendStatus'](_0x130490);}return _0x118207[_0xf53e('0x1a')](_0x130490)[_0xf53e('0x1b')]();};}function respondWithResult(_0x47f36e,_0x2ce7f3){_0x2ce7f3=_0x2ce7f3||0xc8;return function(_0x10fda0){if(_0x10fda0){return _0x47f36e[_0xf53e('0x1a')](_0x2ce7f3)[_0xf53e('0x1c')](_0x10fda0);}};}function respondWithFilteredResult(_0x5c59f3,_0x4ff36f){return function(_0x4161ec){if(_0x4161ec){var _0xef954a=typeof _0x4ff36f[_0xf53e('0x1d')]==='undefined'&&typeof _0x4ff36f[_0xf53e('0x1e')]===_0xf53e('0x1f');var _0x2caad3=_0x4161ec['count'];var _0x159b70=_0xef954a?0x0:_0x4ff36f[_0xf53e('0x1d')];var _0x383fa0=_0xef954a?_0x4161ec[_0xf53e('0x20')]:_0x4ff36f[_0xf53e('0x1d')]+_0x4ff36f[_0xf53e('0x1e')];var _0x408135;if(_0x383fa0>=_0x2caad3){_0x383fa0=_0x2caad3;_0x408135=0xc8;}else{_0x408135=0xce;}_0x5c59f3[_0xf53e('0x1a')](_0x408135);return _0x5c59f3[_0xf53e('0x21')](_0xf53e('0x22'),_0x159b70+'-'+_0x383fa0+'/'+_0x2caad3)[_0xf53e('0x1c')](_0x4161ec);}return null;};}function patchUpdates(_0x277a4e){return function(_0xd484f1){try{jsonpatch['apply'](_0xd484f1,_0x277a4e,!![]);}catch(_0x5991ac){return BPromise[_0xf53e('0x23')](_0x5991ac);}return _0xd484f1[_0xf53e('0x24')]();};}function saveUpdates(_0x412bd3,_0x3b1c76){return function(_0x556dba){if(_0x556dba){return _0x556dba[_0xf53e('0x25')](_0x412bd3)[_0xf53e('0x26')](function(_0xe92147){return _0xe92147;});}return null;};}function removeEntity(_0x1ac101,_0x17cd35){return function(_0x450678){if(_0x450678){return _0x450678[_0xf53e('0x27')]()[_0xf53e('0x26')](function(){_0x1ac101['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1cdf61,_0x11fd77){return function(_0x40f53b){if(!_0x40f53b){_0x1cdf61['sendStatus'](0x194);}return _0x40f53b;};}function handleError(_0x3d5789,_0x5358e0){_0x5358e0=_0x5358e0||0x1f4;return function(_0x3e5030){logger['error'](_0x3e5030[_0xf53e('0x28')]);if(_0x3e5030[_0xf53e('0x29')]){delete _0x3e5030[_0xf53e('0x29')];}_0x3d5789['status'](_0x5358e0)[_0xf53e('0x2a')](_0x3e5030);};}exports[_0xf53e('0x2b')]=function(_0x6c65dd,_0x544791){var _0x1c9382={},_0x459f0d={},_0x2fcfcb={'count':0x0,'rows':[]};var _0x56fefe=_[_0xf53e('0x2c')](db[_0xf53e('0x2d')][_0xf53e('0x2e')],function(_0x277026){return{'name':_0x277026[_0xf53e('0x2f')],'type':_0x277026[_0xf53e('0x30')][_0xf53e('0x31')]};});_0x459f0d[_0xf53e('0x32')]=_['map'](_0x56fefe,_0xf53e('0x29'));_0x459f0d[_0xf53e('0x33')]=_[_0xf53e('0x34')](_0x6c65dd[_0xf53e('0x33')]);_0x459f0d['filters']=_[_0xf53e('0x35')](_0x459f0d[_0xf53e('0x32')],_0x459f0d[_0xf53e('0x33')]);_0x1c9382['attributes']=_[_0xf53e('0x35')](_0x459f0d['model'],qs[_0xf53e('0x36')](_0x6c65dd[_0xf53e('0x33')][_0xf53e('0x36')]));_0x1c9382['attributes']=_0x1c9382[_0xf53e('0x37')][_0xf53e('0x38')]?_0x1c9382[_0xf53e('0x37')]:_0x459f0d[_0xf53e('0x32')];if(!_0x6c65dd[_0xf53e('0x33')][_0xf53e('0x39')](_0xf53e('0x3a'))){_0x1c9382[_0xf53e('0x1e')]=qs[_0xf53e('0x1e')](_0x6c65dd[_0xf53e('0x33')][_0xf53e('0x1e')]);_0x1c9382['offset']=qs[_0xf53e('0x1d')](_0x6c65dd[_0xf53e('0x33')][_0xf53e('0x1d')]);}_0x1c9382[_0xf53e('0x3b')]=qs[_0xf53e('0x3c')](_0x6c65dd['query'][_0xf53e('0x3c')]);_0x1c9382[_0xf53e('0x3d')]=qs[_0xf53e('0x3e')](_[_0xf53e('0x3f')](_0x6c65dd[_0xf53e('0x33')],_0x459f0d[_0xf53e('0x3e')]),_0x56fefe);if(_0x6c65dd['query'][_0xf53e('0x40')]){_0x1c9382[_0xf53e('0x3d')]=_[_0xf53e('0x41')](_0x1c9382['where'],{'$or':_[_0xf53e('0x2c')](_0x56fefe,function(_0x1f53f4){if(_0x1f53f4['type']!==_0xf53e('0x42')){var _0x5455b1={};_0x5455b1[_0x1f53f4['name']]={'$like':'%'+_0x6c65dd[_0xf53e('0x33')][_0xf53e('0x40')]+'%'};return _0x5455b1;}})});}_0x1c9382=_[_0xf53e('0x41')]({},_0x1c9382,_0x6c65dd[_0xf53e('0x43')]);var _0xf78e04={'where':_0x1c9382[_0xf53e('0x3d')]};return db[_0xf53e('0x2d')][_0xf53e('0x20')](_0xf78e04)['then'](function(_0x5f252d){_0x2fcfcb[_0xf53e('0x20')]=_0x5f252d;if(_0x6c65dd[_0xf53e('0x33')][_0xf53e('0x44')]){_0x1c9382['include']=[{'all':!![]}];}return db['SquareRecording'][_0xf53e('0x45')](_0x1c9382);})[_0xf53e('0x26')](function(_0x4e7d25){_0x2fcfcb[_0xf53e('0x46')]=_0x4e7d25;return _0x2fcfcb;})['then'](respondWithFilteredResult(_0x544791,_0x1c9382))[_0xf53e('0x47')](handleError(_0x544791,null));};exports[_0xf53e('0x48')]=function(_0x3bd128,_0x1a9d74){var _0x536d99={'raw':!![],'where':{'id':_0x3bd128[_0xf53e('0x49')]['id']}},_0xa983bb={};_0xa983bb[_0xf53e('0x32')]=_[_0xf53e('0x34')](db[_0xf53e('0x2d')][_0xf53e('0x2e')]);_0xa983bb[_0xf53e('0x33')]=_[_0xf53e('0x34')](_0x3bd128['query']);_0xa983bb[_0xf53e('0x3e')]=_[_0xf53e('0x35')](_0xa983bb[_0xf53e('0x32')],_0xa983bb[_0xf53e('0x33')]);_0x536d99[_0xf53e('0x37')]=_['intersection'](_0xa983bb[_0xf53e('0x32')],qs[_0xf53e('0x36')](_0x3bd128[_0xf53e('0x33')]['fields']));_0x536d99[_0xf53e('0x37')]=_0x536d99['attributes'][_0xf53e('0x38')]?_0x536d99[_0xf53e('0x37')]:_0xa983bb[_0xf53e('0x32')];if(_0x3bd128[_0xf53e('0x33')]['includeAll']){_0x536d99[_0xf53e('0x4a')]=[{'all':!![]}];}_0x536d99=_['merge']({},_0x536d99,_0x3bd128['options']);return db[_0xf53e('0x2d')][_0xf53e('0x4b')](_0x536d99)[_0xf53e('0x26')](handleEntityNotFound(_0x1a9d74,null))['then'](respondWithResult(_0x1a9d74,null))[_0xf53e('0x47')](handleError(_0x1a9d74,null));};exports[_0xf53e('0x4c')]=function(_0x3fd1bc,_0x28bcc1){return db[_0xf53e('0x2d')][_0xf53e('0x4c')](_0x3fd1bc['body'],{})[_0xf53e('0x26')](respondWithResult(_0x28bcc1,0xc9))[_0xf53e('0x47')](handleError(_0x28bcc1,null));};exports[_0xf53e('0x25')]=function(_0x4eb0fc,_0x46a11c){if(_0x4eb0fc[_0xf53e('0x4d')]['id']){delete _0x4eb0fc[_0xf53e('0x4d')]['id'];}return db[_0xf53e('0x2d')]['find']({'where':{'id':_0x4eb0fc[_0xf53e('0x49')]['id']}})['then'](handleEntityNotFound(_0x46a11c,null))[_0xf53e('0x26')](saveUpdates(_0x4eb0fc[_0xf53e('0x4d')],null))[_0xf53e('0x26')](respondWithResult(_0x46a11c,null))[_0xf53e('0x47')](handleError(_0x46a11c,null));};exports[_0xf53e('0x4e')]=function(_0x7c5f68,_0x39f6e0,_0x596a84){var _0x3a0891=require('../../components/encryptor');var _0x4bf5fd=![];var _0x243d3f={};if(_0x7c5f68['query']['type']&&_0x7c5f68[_0xf53e('0x33')]['type']==='uniqueid'){_0x243d3f[_0xf53e('0x4f')]=_0x7c5f68[_0xf53e('0x49')]['id'];}else{_0x243d3f['id']=_0x7c5f68[_0xf53e('0x49')]['id'];}return db[_0xf53e('0x2d')][_0xf53e('0x4b')]({'where':_0x243d3f,'attributes':['id',_0xf53e('0x50'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x39f6e0,null))[_0xf53e('0x26')](function(_0x50b9e5){if(_0x50b9e5){var _0x2bd569=_0x50b9e5[_0xf53e('0x50')];var _0x131b95=util['format'](_0xf53e('0x51'),_0x2bd569);if(fs[_0xf53e('0x52')](_0x131b95)){_0x4bf5fd=!![];return _0x3a0891[_0xf53e('0x53')](_0x131b95,_0x2bd569,config[_0xf53e('0x54')][_0xf53e('0x55')])['then'](function(){return _0x50b9e5;});}return _0x50b9e5;}})[_0xf53e('0x26')](function(_0x23258c){if(_0x23258c){var _0x1cdfa5=_0x23258c[_0xf53e('0x50')];if(!fs[_0xf53e('0x52')](_0x1cdfa5)){throw new db[(_0xf53e('0x56'))][(_0xf53e('0x57'))](_0xf53e('0x58'));}if(_0x23258c[_0xf53e('0x59')]){return _0x39f6e0[_0xf53e('0x4e')](_0x1cdfa5,_0x23258c[_0xf53e('0x59')]+path[_0xf53e('0x5a')](_0x1cdfa5),function(){if(_0x4bf5fd){fs[_0xf53e('0x5b')](_0x1cdfa5);}});}else{return _0x39f6e0[_0xf53e('0x4e')](_0x1cdfa5,function(_0x17ff4a){if(_0x4bf5fd){fs['unlink'](_0x1cdfa5);}});}}})[_0xf53e('0x47')](function(_0x38bcac){if(_0x38bcac[_0xf53e('0x5c')]===_0xf53e('0x58')){_0x39f6e0[_0xf53e('0x1a')](0x194)[_0xf53e('0x2a')](_0xf53e('0x5d'));}else{return handleError(_0x39f6e0,null);}});};exports[_0xf53e('0x27')]=function(_0x26ac56,_0x1e009b){return db[_0xf53e('0x2d')][_0xf53e('0x4b')]({'where':{'id':_0x26ac56[_0xf53e('0x49')]['id']}})['then'](function(_0x3139ce){if(_[_0xf53e('0x5e')](_0x3139ce)){throw new ReferenceError(_0xf53e('0x5f'));}return _0x3139ce;})[_0xf53e('0x26')](function(_0x3d27f4){var _0x547d65=_0x3d27f4[_0xf53e('0x50')];logger[_0xf53e('0x60')](_0xf53e('0x61'),_0x547d65);if(!_[_0xf53e('0x5e')](_0x3d27f4['savePath'])&&fs['existsSync'](_0x547d65)){logger[_0xf53e('0x60')]('File:\x20\x22'+_0x547d65+_0xf53e('0x62'));fs['unlinkSync'](_0x547d65);}_0x547d65=_0x547d65+_0xf53e('0x63');if(!_[_0xf53e('0x5e')](_0x3d27f4[_0xf53e('0x50')])&&fs[_0xf53e('0x52')](_0x547d65)){logger[_0xf53e('0x60')](_0xf53e('0x64')+_0x547d65+_0xf53e('0x62'));fs['unlinkSync'](_0x547d65);}return _0x3d27f4;})[_0xf53e('0x26')](function(_0x5ef29a){if(!_0x5ef29a)throw new InternalError();return _0x5ef29a[_0xf53e('0x27')]();})['then'](function(){_0x1e009b[_0xf53e('0x1a')](0xcc)[_0xf53e('0x1b')]();})[_0xf53e('0x47')](handleError(_0x1e009b,null));}; \ No newline at end of file +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 diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index dbbca60..c6a6296 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 _0x2c24=['moment','bluebird','request-promise','path','rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api'];(function(_0x41ee03,_0x1889f8){var _0x267456=function(_0x550646){while(--_0x550646){_0x41ee03['push'](_0x41ee03['shift']());}};_0x267456(++_0x1889f8);}(_0x2c24,0x1e6));var _0x42c2=function(_0x3ecde9,_0x13c564){_0x3ecde9=_0x3ecde9-0x0;var _0x3df71b=_0x2c24[_0x3ecde9];return _0x3df71b;};'use strict';var _=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var logger=require(_0x42c2('0x2'))(_0x42c2('0x3'));var moment=require(_0x42c2('0x4'));var BPromise=require(_0x42c2('0x5'));var rp=require(_0x42c2('0x6'));var fs=require('fs');var path=require(_0x42c2('0x7'));var rimraf=require(_0x42c2('0x8'));var config=require('../../config/environment');var attributes=require(_0x42c2('0x9'));module[_0x42c2('0xa')]=function(_0x4950c1,_0x20d310){return _0x4950c1[_0x42c2('0xb')](_0x42c2('0xc'),attributes,{'tableName':_0x42c2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 3226cf8..5de686a 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 _0x2cd4=['error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x39bc92,_0x48e0f7){var _0x5d05ea=function(_0x1946b0){while(--_0x1946b0){_0x39bc92['push'](_0x39bc92['shift']());}};_0x5d05ea(++_0x48e0f7);}(_0x2cd4,0x1bb));var _0x42cd=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x2cd4[_0x33554b];return _0x256954;};'use strict';var _=require(_0x42cd('0x0'));var util=require('util');var moment=require(_0x42cd('0x1'));var BPromise=require(_0x42cd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x42cd('0x3'))['db'];var utils=require(_0x42cd('0x4'));var logger=require(_0x42cd('0x5'))(_0x42cd('0x6'));var config=require('../../config/environment');var jayson=require(_0x42cd('0x7'));var client=jayson['client'][_0x42cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1e4880,_0x49287f,_0x2cec40){return new BPromise(function(_0x4281c1,_0x38011c){return client[_0x42cd('0x9')](_0x1e4880,_0x2cec40)['then'](function(_0x17dd2d){logger[_0x42cd('0xa')](_0x42cd('0xb'),_0x49287f,_0x42cd('0xc'));logger[_0x42cd('0xd')](_0x42cd('0xe'),_0x49287f,'request\x20sent',JSON[_0x42cd('0xf')](_0x17dd2d));if(_0x17dd2d[_0x42cd('0x10')]){if(_0x17dd2d[_0x42cd('0x10')][_0x42cd('0x11')]===0x1f4){logger[_0x42cd('0x10')]('SquareRecording,\x20%s,\x20%s',_0x49287f,_0x17dd2d[_0x42cd('0x10')][_0x42cd('0x12')]);return _0x38011c(_0x17dd2d[_0x42cd('0x10')]['message']);}logger['error'](_0x42cd('0xb'),_0x49287f,_0x17dd2d[_0x42cd('0x10')][_0x42cd('0x12')]);return _0x4281c1(_0x17dd2d[_0x42cd('0x10')]['message']);}else{logger[_0x42cd('0xa')](_0x42cd('0xb'),_0x49287f,_0x42cd('0xc'));_0x4281c1(_0x17dd2d[_0x42cd('0x13')][_0x42cd('0x12')]);}})[_0x42cd('0x14')](function(_0x451163){logger[_0x42cd('0x10')](_0x42cd('0xb'),_0x49287f,_0x451163);_0x38011c(_0x451163);});});}exports[_0x42cd('0x15')]=function(_0x5df44c){var _0x4365b3=this;return new Promise(function(_0x3b9cc4,_0x27a85c){return db[_0x42cd('0x16')][_0x42cd('0x17')](_0x5df44c[_0x42cd('0x18')],{'raw':_0x5df44c[_0x42cd('0x19')]?_0x5df44c[_0x42cd('0x19')][_0x42cd('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3b526d){logger[_0x42cd('0xa')]('CreateSquareRecording',_0x5df44c);logger[_0x42cd('0xd')](_0x42cd('0x15'),_0x5df44c,JSON[_0x42cd('0xf')](_0x3b526d));_0x3b9cc4(_0x3b526d);})[_0x42cd('0x14')](function(_0x56ebbc){logger[_0x42cd('0x10')](_0x42cd('0x15'),_0x56ebbc['message'],_0x5df44c);_0x27a85c(_0x4365b3['error'](0x1f4,_0x56ebbc['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index fac1e68..5fce303 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4a3e45,_0x1e8ef3){var _0x48db76=function(_0x33d341){while(--_0x33d341){_0x4a3e45['push'](_0x4a3e45['shift']());}};_0x48db76(++_0x1e8ef3);}(_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 +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 diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 7a60bd3..1fcd535 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 _0x184c=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0xe3c536,_0x5ac453){var _0x5d92f3=function(_0x53c479){while(--_0x53c479){_0xe3c536['push'](_0xe3c536['shift']());}};_0x5d92f3(++_0x5ac453);}(_0x184c,0x1c3));var _0xc184=function(_0xe68689,_0x178ade){_0xe68689=_0xe68689-0x0;var _0x701b3c=_0x184c[_0xe68689];return _0x701b3c;};'use strict';var Sequelize=require(_0xc184('0x0'));module[_0xc184('0x1')]={'network':{'type':Sequelize[_0xc184('0x2')]},'network_script':{'type':Sequelize[_0xc184('0x2')]},'request':{'type':Sequelize[_0xc184('0x2')]},'channel':{'type':Sequelize[_0xc184('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xc184('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xc184('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0xc184('0x2')]},'callingani2':{'type':Sequelize[_0xc184('0x2')]},'callington':{'type':Sequelize[_0xc184('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0xc184('0x2')]},'rdnis':{'type':Sequelize[_0xc184('0x2')]},'context':{'type':Sequelize[_0xc184('0x2')]},'extension':{'type':Sequelize[_0xc184('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xc184('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xc184('0x2')]},'joinAt':{'type':Sequelize[_0xc184('0x3')]},'leaveAt':{'type':Sequelize[_0xc184('0x3')]},'bot':{'type':Sequelize[_0xc184('0x4')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d8e270b..0fd3315 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 _0x5f9a=['squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x5d3f98,_0x2fbe7e){var _0x1ea873=function(_0x2b4eaa){while(--_0x2b4eaa){_0x5d3f98['push'](_0x5d3f98['shift']());}};_0x1ea873(++_0x2fbe7e);}(_0x5f9a,0x17d));var _0xa5f9=function(_0x2db33d,_0x38233b){_0x2db33d=_0x2db33d-0x0;var _0x4f8535=_0x5f9a[_0x2db33d];return _0x4f8535;};'use strict';var emlformat=require(_0xa5f9('0x0'));var rimraf=require(_0xa5f9('0x1'));var zipdir=require(_0xa5f9('0x2'));var jsonpatch=require(_0xa5f9('0x3'));var rp=require(_0xa5f9('0x4'));var moment=require(_0xa5f9('0x5'));var BPromise=require(_0xa5f9('0x6'));var Mustache=require(_0xa5f9('0x7'));var util=require(_0xa5f9('0x8'));var path=require('path');var sox=require(_0xa5f9('0x9'));var csv=require(_0xa5f9('0xa'));var ejs=require(_0xa5f9('0xb'));var fs=require('fs');var fs_extra=require(_0xa5f9('0xc'));var _=require(_0xa5f9('0xd'));var squel=require(_0xa5f9('0xe'));var crypto=require(_0xa5f9('0xf'));var jsforce=require(_0xa5f9('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xa5f9('0xa'));var querystring=require(_0xa5f9('0x11'));var Papa=require(_0xa5f9('0x12'));var Redis=require(_0xa5f9('0x13'));var authService=require(_0xa5f9('0x14'));var qs=require(_0xa5f9('0x15'));var as=require(_0xa5f9('0x16'));var hardwareService=require(_0xa5f9('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa5f9('0x18'));var licenseUtil=require(_0xa5f9('0x19'));var db=require(_0xa5f9('0x1a'))['db'];function respondWithStatusCode(_0x438aee,_0x1c8dc8){_0x1c8dc8=_0x1c8dc8||0xcc;return function(_0x243596){if(_0x243596){return _0x438aee[_0xa5f9('0x1b')](_0x1c8dc8);}return _0x438aee[_0xa5f9('0x1c')](_0x1c8dc8)[_0xa5f9('0x1d')]();};}function respondWithResult(_0x4b7088,_0x572f76){_0x572f76=_0x572f76||0xc8;return function(_0x5eaf94){if(_0x5eaf94){return _0x4b7088[_0xa5f9('0x1c')](_0x572f76)[_0xa5f9('0x1e')](_0x5eaf94);}};}function respondWithFilteredResult(_0x4d8beb,_0x71a90c){return function(_0x3fff93){if(_0x3fff93){var _0x541f65=typeof _0x71a90c[_0xa5f9('0x1f')]===_0xa5f9('0x20')&&typeof _0x71a90c[_0xa5f9('0x21')]===_0xa5f9('0x20');var _0xdd15d0=_0x3fff93[_0xa5f9('0x22')];var _0x3e3804=_0x541f65?0x0:_0x71a90c['offset'];var _0x28cc3d=_0x541f65?_0x3fff93[_0xa5f9('0x22')]:_0x71a90c[_0xa5f9('0x1f')]+_0x71a90c[_0xa5f9('0x21')];var _0x13e489;if(_0x28cc3d>=_0xdd15d0){_0x28cc3d=_0xdd15d0;_0x13e489=0xc8;}else{_0x13e489=0xce;}_0x4d8beb[_0xa5f9('0x1c')](_0x13e489);return _0x4d8beb[_0xa5f9('0x23')]('Content-Range',_0x3e3804+'-'+_0x28cc3d+'/'+_0xdd15d0)['json'](_0x3fff93);}return null;};}function patchUpdates(_0x3b7562){return function(_0x44200a){try{jsonpatch[_0xa5f9('0x24')](_0x44200a,_0x3b7562,!![]);}catch(_0x17441e){return BPromise[_0xa5f9('0x25')](_0x17441e);}return _0x44200a[_0xa5f9('0x26')]();};}function saveUpdates(_0x4482fb,_0x159982){return function(_0x2ecdd4){if(_0x2ecdd4){return _0x2ecdd4[_0xa5f9('0x27')](_0x4482fb)[_0xa5f9('0x28')](function(_0x5a5954){return _0x5a5954;});}return null;};}function removeEntity(_0xa1c456,_0xc06619){return function(_0x209738){if(_0x209738){return _0x209738[_0xa5f9('0x29')]()['then'](function(){_0xa1c456[_0xa5f9('0x1c')](0xcc)[_0xa5f9('0x1d')]();});}};}function handleEntityNotFound(_0x44b5c5,_0x5297ce){return function(_0x12b6e0){if(!_0x12b6e0){_0x44b5c5[_0xa5f9('0x1b')](0x194);}return _0x12b6e0;};}function handleError(_0x2da91c,_0x31219f){_0x31219f=_0x31219f||0x1f4;return function(_0x3727ab){logger[_0xa5f9('0x2a')](_0x3727ab[_0xa5f9('0x2b')]);if(_0x3727ab[_0xa5f9('0x2c')]){delete _0x3727ab[_0xa5f9('0x2c')];}_0x2da91c[_0xa5f9('0x1c')](_0x31219f)[_0xa5f9('0x2d')](_0x3727ab);};}exports[_0xa5f9('0x2e')]=function(_0xcf9cd3,_0x351da0){var _0x417260={},_0x1d5618={},_0x33348f={'count':0x0,'rows':[]};var _0xd57869=_[_0xa5f9('0x2f')](db[_0xa5f9('0x30')]['rawAttributes'],function(_0x564981){return{'name':_0x564981[_0xa5f9('0x31')],'type':_0x564981[_0xa5f9('0x32')][_0xa5f9('0x33')]};});_0x1d5618[_0xa5f9('0x34')]=_[_0xa5f9('0x2f')](_0xd57869,_0xa5f9('0x2c'));_0x1d5618[_0xa5f9('0x35')]=_[_0xa5f9('0x36')](_0xcf9cd3[_0xa5f9('0x35')]);_0x1d5618[_0xa5f9('0x37')]=_[_0xa5f9('0x38')](_0x1d5618[_0xa5f9('0x34')],_0x1d5618['query']);_0x417260[_0xa5f9('0x39')]=_['intersection'](_0x1d5618[_0xa5f9('0x34')],qs[_0xa5f9('0x3a')](_0xcf9cd3[_0xa5f9('0x35')][_0xa5f9('0x3a')]));_0x417260[_0xa5f9('0x39')]=_0x417260[_0xa5f9('0x39')][_0xa5f9('0x3b')]?_0x417260[_0xa5f9('0x39')]:_0x1d5618[_0xa5f9('0x34')];if(!_0xcf9cd3['query'][_0xa5f9('0x3c')](_0xa5f9('0x3d'))){_0x417260['limit']=qs[_0xa5f9('0x21')](_0xcf9cd3[_0xa5f9('0x35')]['limit']);_0x417260['offset']=qs['offset'](_0xcf9cd3['query'][_0xa5f9('0x1f')]);}_0x417260[_0xa5f9('0x3e')]=qs['sort'](_0xcf9cd3[_0xa5f9('0x35')][_0xa5f9('0x3f')]);_0x417260[_0xa5f9('0x40')]=qs[_0xa5f9('0x37')](_[_0xa5f9('0x41')](_0xcf9cd3[_0xa5f9('0x35')],_0x1d5618[_0xa5f9('0x37')]),_0xd57869);if(_0xcf9cd3[_0xa5f9('0x35')][_0xa5f9('0x42')]){_0x417260['where']=_[_0xa5f9('0x43')](_0x417260[_0xa5f9('0x40')],{'$or':_[_0xa5f9('0x2f')](_0xd57869,function(_0x8898c3){if(_0x8898c3[_0xa5f9('0x32')]!==_0xa5f9('0x44')){var _0x1e6c4f={};_0x1e6c4f[_0x8898c3[_0xa5f9('0x2c')]]={'$like':'%'+_0xcf9cd3[_0xa5f9('0x35')][_0xa5f9('0x42')]+'%'};return _0x1e6c4f;}})});}_0x417260=_[_0xa5f9('0x43')]({},_0x417260,_0xcf9cd3[_0xa5f9('0x45')]);var _0x495ca5={'where':_0x417260[_0xa5f9('0x40')]};return db[_0xa5f9('0x30')][_0xa5f9('0x22')](_0x495ca5)['then'](function(_0x4660d7){_0x33348f[_0xa5f9('0x22')]=_0x4660d7;if(_0xcf9cd3['query'][_0xa5f9('0x46')]){_0x417260['include']=[{'all':!![]}];}return db[_0xa5f9('0x30')]['findAll'](_0x417260);})['then'](function(_0x28bf2a){_0x33348f[_0xa5f9('0x47')]=_0x28bf2a;return _0x33348f;})[_0xa5f9('0x28')](respondWithFilteredResult(_0x351da0,_0x417260))[_0xa5f9('0x48')](handleError(_0x351da0,null));};exports[_0xa5f9('0x49')]=function(_0x490b64,_0x59fd72){var _0x2ee6e7={'raw':!![],'where':{'id':_0x490b64[_0xa5f9('0x4a')]['id']}},_0x3065b1={};_0x3065b1['model']=_['keys'](db['SquareReport']['rawAttributes']);_0x3065b1[_0xa5f9('0x35')]=_[_0xa5f9('0x36')](_0x490b64[_0xa5f9('0x35')]);_0x3065b1['filters']=_['intersection'](_0x3065b1[_0xa5f9('0x34')],_0x3065b1[_0xa5f9('0x35')]);_0x2ee6e7[_0xa5f9('0x39')]=_[_0xa5f9('0x38')](_0x3065b1['model'],qs['fields'](_0x490b64[_0xa5f9('0x35')][_0xa5f9('0x3a')]));_0x2ee6e7['attributes']=_0x2ee6e7[_0xa5f9('0x39')][_0xa5f9('0x3b')]?_0x2ee6e7[_0xa5f9('0x39')]:_0x3065b1[_0xa5f9('0x34')];if(_0x490b64[_0xa5f9('0x35')][_0xa5f9('0x46')]){_0x2ee6e7['include']=[{'all':!![]}];}_0x2ee6e7=_['merge']({},_0x2ee6e7,_0x490b64[_0xa5f9('0x45')]);return db[_0xa5f9('0x30')][_0xa5f9('0x4b')](_0x2ee6e7)[_0xa5f9('0x28')](handleEntityNotFound(_0x59fd72,null))['then'](respondWithResult(_0x59fd72,null))[_0xa5f9('0x48')](handleError(_0x59fd72,null));};exports[_0xa5f9('0x4c')]=function(_0x47f65d,_0x30cf2d){return db[_0xa5f9('0x30')][_0xa5f9('0x4c')](_0x47f65d[_0xa5f9('0x4d')],{})['then'](respondWithResult(_0x30cf2d,0xc9))[_0xa5f9('0x48')](handleError(_0x30cf2d,null));};exports[_0xa5f9('0x27')]=function(_0xb01756,_0xba40fd){if(_0xb01756[_0xa5f9('0x4d')]['id']){delete _0xb01756[_0xa5f9('0x4d')]['id'];}return db['SquareReport']['find']({'where':{'id':_0xb01756[_0xa5f9('0x4a')]['id']}})[_0xa5f9('0x28')](handleEntityNotFound(_0xba40fd,null))['then'](saveUpdates(_0xb01756['body'],null))[_0xa5f9('0x28')](respondWithResult(_0xba40fd,null))[_0xa5f9('0x48')](handleError(_0xba40fd,null));};exports[_0xa5f9('0x29')]=function(_0x10f0ca,_0xe0bab6){return db[_0xa5f9('0x30')]['find']({'where':{'id':_0x10f0ca[_0xa5f9('0x4a')]['id']}})[_0xa5f9('0x28')](handleEntityNotFound(_0xe0bab6,null))[_0xa5f9('0x28')](removeEntity(_0xe0bab6,null))[_0xa5f9('0x48')](handleError(_0xe0bab6,null));};exports[_0xa5f9('0x4e')]=function(_0x4010d2,_0x64c0ae){return db[_0xa5f9('0x30')][_0xa5f9('0x4e')]()[_0xa5f9('0x28')](respondWithResult(_0x64c0ae,null))[_0xa5f9('0x48')](handleError(_0x64c0ae,null));}; \ No newline at end of file +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 diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 42e3f0e..d3a7c14 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 _0xeca5=['uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./squareReport.attributes','define','report_square'];(function(_0x3ffff9,_0x591754){var _0x57a9a5=function(_0x985c48){while(--_0x985c48){_0x3ffff9['push'](_0x3ffff9['shift']());}};_0x57a9a5(++_0x591754);}(_0xeca5,0x130));var _0x5eca=function(_0x2e9aa0,_0xd5738){_0x2e9aa0=_0x2e9aa0-0x0;var _0x201fa7=_0xeca5[_0x2e9aa0];return _0x201fa7;};'use strict';var _=require(_0x5eca('0x0'));var util=require(_0x5eca('0x1'));var logger=require(_0x5eca('0x2'))(_0x5eca('0x3'));var moment=require(_0x5eca('0x4'));var BPromise=require(_0x5eca('0x5'));var rp=require(_0x5eca('0x6'));var fs=require('fs');var path=require(_0x5eca('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5eca('0x8'));module['exports']=function(_0x5a5671,_0x2b6235){return _0x5a5671[_0x5eca('0x9')]('SquareReport',attributes,{'tableName':_0x5eca('0xa'),'paranoid':![],'indexes':[{'name':_0x5eca('0xb'),'fields':[_0x5eca('0xc'),_0x5eca('0xd')]},{'name':'leaveAt','fields':[_0x5eca('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2b11a20..e65d318 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 _0x762d=['stringify','body','attributes','limit','debug','UpdateSquareReport','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','error','code','message','catch','SquareReport','create','options','raw','then','CreateSquareReport'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x762d,0xb4));var _0xd762=function(_0xaa8392,_0x554591){_0xaa8392=_0xaa8392-0x0;var _0x5ce1ef=_0x762d[_0xaa8392];return _0x5ce1ef;};'use strict';var _=require('lodash');var util=require(_0xd762('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd762('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd762('0x2'))['db'];var utils=require(_0xd762('0x3'));var logger=require(_0xd762('0x4'))(_0xd762('0x5'));var config=require(_0xd762('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xd762('0x7')][_0xd762('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1437f8,_0x39ccef,_0x16dda0){return new BPromise(function(_0x148dcd,_0x489632){return client[_0xd762('0x9')](_0x1437f8,_0x16dda0)['then'](function(_0x15ebd3){logger[_0xd762('0xa')](_0xd762('0xb'),_0x39ccef,'request\x20sent');logger['debug']('SquareReport,\x20%s,\x20%s,\x20%s',_0x39ccef,_0xd762('0xc'),JSON['stringify'](_0x15ebd3));if(_0x15ebd3[_0xd762('0xd')]){if(_0x15ebd3[_0xd762('0xd')][_0xd762('0xe')]===0x1f4){logger[_0xd762('0xd')](_0xd762('0xb'),_0x39ccef,_0x15ebd3[_0xd762('0xd')][_0xd762('0xf')]);return _0x489632(_0x15ebd3[_0xd762('0xd')][_0xd762('0xf')]);}logger[_0xd762('0xd')]('SquareReport,\x20%s,\x20%s',_0x39ccef,_0x15ebd3['error']['message']);return _0x148dcd(_0x15ebd3[_0xd762('0xd')][_0xd762('0xf')]);}else{logger['info'](_0xd762('0xb'),_0x39ccef,_0xd762('0xc'));_0x148dcd(_0x15ebd3['result'][_0xd762('0xf')]);}})[_0xd762('0x10')](function(_0x4af837){logger[_0xd762('0xd')](_0xd762('0xb'),_0x39ccef,_0x4af837);_0x489632(_0x4af837);});});}exports['CreateSquareReport']=function(_0x3ae4cb){var _0x236a9e=this;return new Promise(function(_0x4bd3ae,_0x181082){return db[_0xd762('0x11')][_0xd762('0x12')](_0x3ae4cb['body'],{'raw':_0x3ae4cb[_0xd762('0x13')]?_0x3ae4cb[_0xd762('0x13')][_0xd762('0x14')]===undefined?!![]:![]:!![]})[_0xd762('0x15')](function(_0x2269d7){logger[_0xd762('0xa')](_0xd762('0x16'),_0x3ae4cb);logger['debug'](_0xd762('0x16'),_0x3ae4cb,JSON[_0xd762('0x17')](_0x2269d7));_0x4bd3ae(_0x2269d7);})['catch'](function(_0x2b8e9d){logger[_0xd762('0xd')]('CreateSquareReport',_0x2b8e9d[_0xd762('0xf')],_0x3ae4cb);_0x181082(_0x236a9e[_0xd762('0xd')](0x1f4,_0x2b8e9d['message']));});});};exports['UpdateSquareReport']=function(_0x5b092d){var _0x1ba87f=this;return new Promise(function(_0x292d05,_0x1373c1){return db[_0xd762('0x11')]['update'](_0x5b092d[_0xd762('0x18')],{'raw':_0x5b092d['options']?_0x5b092d['options'][_0xd762('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5b092d[_0xd762('0x13')]?_0x5b092d['options']['where']||null:null,'attributes':_0x5b092d[_0xd762('0x13')]?_0x5b092d['options'][_0xd762('0x19')]||null:null,'limit':_0x5b092d[_0xd762('0x13')]?_0x5b092d['options'][_0xd762('0x1a')]||null:null})[_0xd762('0x15')](function(_0x49491e){logger[_0xd762('0xa')]('UpdateSquareReport',_0x5b092d);logger[_0xd762('0x1b')](_0xd762('0x1c'),_0x5b092d,JSON[_0xd762('0x17')](_0x49491e));_0x292d05(_0x49491e);})[_0xd762('0x10')](function(_0x1053a6){logger[_0xd762('0xd')]('UpdateSquareReport',_0x1053a6[_0xd762('0xf')],_0x5b092d);_0x1373c1(_0x1ba87f['error'](0x1f4,_0x1053a6['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index abeb322..302c1dc 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 _0xfc19=['put','update','delete','destroy','exports','multer','util','path','express','Router','../../config/environment','./squareReportDetail.controller','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x59beff,_0x28d13a){var _0x6e2979=function(_0x3b839d){while(--_0x3b839d){_0x59beff['push'](_0x59beff['shift']());}};_0x6e2979(++_0x28d13a);}(_0xfc19,0x71));var _0x9fc1=function(_0x911df2,_0x26d72e){_0x911df2=_0x911df2-0x0;var _0x20d341=_0xfc19[_0x911df2];return _0x20d341;};'use strict';var multer=require(_0x9fc1('0x0'));var util=require(_0x9fc1('0x1'));var path=require(_0x9fc1('0x2'));var timeout=require('connect-timeout');var express=require(_0x9fc1('0x3'));var router=express[_0x9fc1('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9fc1('0x5'));var controller=require(_0x9fc1('0x6'));router['get']('/',auth[_0x9fc1('0x7')](),controller[_0x9fc1('0x8')]);router[_0x9fc1('0x9')](_0x9fc1('0xa'),auth[_0x9fc1('0x7')](),controller['describe']);router[_0x9fc1('0x9')](_0x9fc1('0xb'),auth[_0x9fc1('0x7')](),controller[_0x9fc1('0xc')]);router['post']('/',auth[_0x9fc1('0x7')](),controller['create']);router[_0x9fc1('0xd')](_0x9fc1('0xb'),auth['isAuthenticated'](),controller[_0x9fc1('0xe')]);router[_0x9fc1('0xf')](_0x9fc1('0xb'),auth[_0x9fc1('0x7')](),controller[_0x9fc1('0x10')]);module[_0x9fc1('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 639d02c..ca37945 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 _0x6f7f=['exports','STRING','sequelize'];(function(_0x2018d7,_0x2f0c5e){var _0x39a351=function(_0x40d283){while(--_0x40d283){_0x2018d7['push'](_0x2018d7['shift']());}};_0x39a351(++_0x2f0c5e);}(_0x6f7f,0x11c));var _0xf6f7=function(_0x51b170,_0x7ed8fc){_0x51b170=_0x51b170-0x0;var _0x1757cc=_0x6f7f[_0x51b170];return _0x1757cc;};'use strict';var Sequelize=require(_0xf6f7('0x0'));module[_0xf6f7('0x1')]={'uniqueid':{'type':Sequelize[_0xf6f7('0x2')]},'node':{'type':Sequelize[_0xf6f7('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0xf6f7('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 8ebb048..062963b 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 _0x71e0=['filters','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where'];(function(_0x2e9187,_0x3763f6){var _0x1fc3a8=function(_0xb30d96){while(--_0xb30d96){_0x2e9187['push'](_0x2e9187['shift']());}};_0x1fc3a8(++_0x3763f6);}(_0x71e0,0x176));var _0x071e=function(_0x379ad5,_0x172a20){_0x379ad5=_0x379ad5-0x0;var _0x2858fe=_0x71e0[_0x379ad5];return _0x2858fe;};'use strict';var emlformat=require(_0x071e('0x0'));var rimraf=require(_0x071e('0x1'));var zipdir=require(_0x071e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x071e('0x3'));var moment=require(_0x071e('0x4'));var BPromise=require(_0x071e('0x5'));var Mustache=require(_0x071e('0x6'));var util=require(_0x071e('0x7'));var path=require('path');var sox=require(_0x071e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x071e('0x9'));var squel=require(_0x071e('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x071e('0xb'));var toCsv=require(_0x071e('0xc'));var querystring=require('querystring');var Papa=require(_0x071e('0xd'));var Redis=require(_0x071e('0xe'));var authService=require(_0x071e('0xf'));var qs=require(_0x071e('0x10'));var as=require(_0x071e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x071e('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x071e('0x13'));var licenseUtil=require(_0x071e('0x14'));var db=require(_0x071e('0x15'))['db'];function respondWithStatusCode(_0x3e931e,_0x5a6c41){_0x5a6c41=_0x5a6c41||0xcc;return function(_0xb405aa){if(_0xb405aa){return _0x3e931e[_0x071e('0x16')](_0x5a6c41);}return _0x3e931e[_0x071e('0x17')](_0x5a6c41)[_0x071e('0x18')]();};}function respondWithResult(_0x715419,_0x3ccc21){_0x3ccc21=_0x3ccc21||0xc8;return function(_0x296ddf){if(_0x296ddf){return _0x715419[_0x071e('0x17')](_0x3ccc21)[_0x071e('0x19')](_0x296ddf);}};}function respondWithFilteredResult(_0x287751,_0x2a604c){return function(_0x1c3397){if(_0x1c3397){var _0x2a48f2=typeof _0x2a604c[_0x071e('0x1a')]==='undefined'&&typeof _0x2a604c[_0x071e('0x1b')]===_0x071e('0x1c');var _0x55bf90=_0x1c3397[_0x071e('0x1d')];var _0x224d21=_0x2a48f2?0x0:_0x2a604c[_0x071e('0x1a')];var _0x3c6a42=_0x2a48f2?_0x1c3397['count']:_0x2a604c['offset']+_0x2a604c[_0x071e('0x1b')];var _0x27a5bc;if(_0x3c6a42>=_0x55bf90){_0x3c6a42=_0x55bf90;_0x27a5bc=0xc8;}else{_0x27a5bc=0xce;}_0x287751[_0x071e('0x17')](_0x27a5bc);return _0x287751['set'](_0x071e('0x1e'),_0x224d21+'-'+_0x3c6a42+'/'+_0x55bf90)[_0x071e('0x19')](_0x1c3397);}return null;};}function patchUpdates(_0x190a21){return function(_0x5ba76c){try{jsonpatch[_0x071e('0x1f')](_0x5ba76c,_0x190a21,!![]);}catch(_0x4369dd){return BPromise[_0x071e('0x20')](_0x4369dd);}return _0x5ba76c[_0x071e('0x21')]();};}function saveUpdates(_0x423208,_0x4d456c){return function(_0x38f5c9){if(_0x38f5c9){return _0x38f5c9[_0x071e('0x22')](_0x423208)[_0x071e('0x23')](function(_0x512220){return _0x512220;});}return null;};}function removeEntity(_0x2e9ffc,_0x3ace27){return function(_0x5dc4cc){if(_0x5dc4cc){return _0x5dc4cc[_0x071e('0x24')]()[_0x071e('0x23')](function(){_0x2e9ffc[_0x071e('0x17')](0xcc)[_0x071e('0x18')]();});}};}function handleEntityNotFound(_0x5b2156,_0x2efa68){return function(_0x4d5a92){if(!_0x4d5a92){_0x5b2156[_0x071e('0x16')](0x194);}return _0x4d5a92;};}function handleError(_0x8506c4,_0x37227c){_0x37227c=_0x37227c||0x1f4;return function(_0x3cd28a){logger[_0x071e('0x25')](_0x3cd28a[_0x071e('0x26')]);if(_0x3cd28a[_0x071e('0x27')]){delete _0x3cd28a[_0x071e('0x27')];}_0x8506c4[_0x071e('0x17')](_0x37227c)[_0x071e('0x28')](_0x3cd28a);};}exports[_0x071e('0x29')]=function(_0x3a38be,_0x686d33){var _0x4892a7={},_0x338141={},_0x528e79={'count':0x0,'rows':[]};var _0x3210e3=_[_0x071e('0x2a')](db[_0x071e('0x2b')][_0x071e('0x2c')],function(_0x4d6a09){return{'name':_0x4d6a09[_0x071e('0x2d')],'type':_0x4d6a09[_0x071e('0x2e')][_0x071e('0x2f')]};});_0x338141[_0x071e('0x30')]=_[_0x071e('0x2a')](_0x3210e3,_0x071e('0x27'));_0x338141[_0x071e('0x31')]=_[_0x071e('0x32')](_0x3a38be['query']);_0x338141['filters']=_[_0x071e('0x33')](_0x338141['model'],_0x338141['query']);_0x4892a7[_0x071e('0x34')]=_[_0x071e('0x33')](_0x338141[_0x071e('0x30')],qs[_0x071e('0x35')](_0x3a38be[_0x071e('0x31')][_0x071e('0x35')]));_0x4892a7[_0x071e('0x34')]=_0x4892a7[_0x071e('0x34')][_0x071e('0x36')]?_0x4892a7['attributes']:_0x338141[_0x071e('0x30')];if(!_0x3a38be['query']['hasOwnProperty']('nolimit')){_0x4892a7['limit']=qs['limit'](_0x3a38be[_0x071e('0x31')][_0x071e('0x1b')]);_0x4892a7[_0x071e('0x1a')]=qs[_0x071e('0x1a')](_0x3a38be[_0x071e('0x31')][_0x071e('0x1a')]);}_0x4892a7[_0x071e('0x37')]=qs[_0x071e('0x38')](_0x3a38be[_0x071e('0x31')]['sort']);_0x4892a7[_0x071e('0x39')]=qs[_0x071e('0x3a')](_['pick'](_0x3a38be[_0x071e('0x31')],_0x338141[_0x071e('0x3a')]),_0x3210e3);if(_0x3a38be[_0x071e('0x31')][_0x071e('0x3b')]){_0x4892a7[_0x071e('0x39')]=_['merge'](_0x4892a7[_0x071e('0x39')],{'$or':_[_0x071e('0x2a')](_0x3210e3,function(_0x57b11c){if(_0x57b11c[_0x071e('0x2e')]!==_0x071e('0x3c')){var _0x4377da={};_0x4377da[_0x57b11c[_0x071e('0x27')]]={'$like':'%'+_0x3a38be['query']['filter']+'%'};return _0x4377da;}})});}_0x4892a7=_[_0x071e('0x3d')]({},_0x4892a7,_0x3a38be['options']);var _0x3c95fd={'where':_0x4892a7[_0x071e('0x39')]};return db[_0x071e('0x2b')]['count'](_0x3c95fd)[_0x071e('0x23')](function(_0x54a69a){_0x528e79[_0x071e('0x1d')]=_0x54a69a;if(_0x3a38be[_0x071e('0x31')][_0x071e('0x3e')]){_0x4892a7[_0x071e('0x3f')]=[{'all':!![]}];}return db[_0x071e('0x2b')][_0x071e('0x40')](_0x4892a7);})[_0x071e('0x23')](function(_0x34f458){_0x528e79['rows']=_0x34f458;return _0x528e79;})[_0x071e('0x23')](respondWithFilteredResult(_0x686d33,_0x4892a7))[_0x071e('0x41')](handleError(_0x686d33,null));};exports[_0x071e('0x42')]=function(_0x38361b,_0x51130c){var _0x217a8f={'raw':!![],'where':{'id':_0x38361b[_0x071e('0x43')]['id']}},_0x243a42={};_0x243a42[_0x071e('0x30')]=_[_0x071e('0x32')](db[_0x071e('0x2b')][_0x071e('0x2c')]);_0x243a42[_0x071e('0x31')]=_[_0x071e('0x32')](_0x38361b[_0x071e('0x31')]);_0x243a42[_0x071e('0x3a')]=_[_0x071e('0x33')](_0x243a42['model'],_0x243a42[_0x071e('0x31')]);_0x217a8f[_0x071e('0x34')]=_[_0x071e('0x33')](_0x243a42[_0x071e('0x30')],qs[_0x071e('0x35')](_0x38361b['query']['fields']));_0x217a8f[_0x071e('0x34')]=_0x217a8f[_0x071e('0x34')][_0x071e('0x36')]?_0x217a8f[_0x071e('0x34')]:_0x243a42['model'];if(_0x38361b[_0x071e('0x31')][_0x071e('0x3e')]){_0x217a8f[_0x071e('0x3f')]=[{'all':!![]}];}_0x217a8f=_[_0x071e('0x3d')]({},_0x217a8f,_0x38361b[_0x071e('0x44')]);return db['SquareDetailsReport'][_0x071e('0x45')](_0x217a8f)[_0x071e('0x23')](handleEntityNotFound(_0x51130c,null))[_0x071e('0x23')](respondWithResult(_0x51130c,null))[_0x071e('0x41')](handleError(_0x51130c,null));};exports[_0x071e('0x46')]=function(_0x552939,_0x3ca061){return db[_0x071e('0x2b')][_0x071e('0x46')](_0x552939[_0x071e('0x47')],{})['then'](respondWithResult(_0x3ca061,0xc9))[_0x071e('0x41')](handleError(_0x3ca061,null));};exports[_0x071e('0x22')]=function(_0xd6893f,_0x39d5f7){if(_0xd6893f[_0x071e('0x47')]['id']){delete _0xd6893f[_0x071e('0x47')]['id'];}return db[_0x071e('0x2b')][_0x071e('0x45')]({'where':{'id':_0xd6893f['params']['id']}})[_0x071e('0x23')](handleEntityNotFound(_0x39d5f7,null))['then'](saveUpdates(_0xd6893f['body'],null))[_0x071e('0x23')](respondWithResult(_0x39d5f7,null))[_0x071e('0x41')](handleError(_0x39d5f7,null));};exports[_0x071e('0x24')]=function(_0x31d766,_0x127d5b){return db[_0x071e('0x2b')][_0x071e('0x45')]({'where':{'id':_0x31d766[_0x071e('0x43')]['id']}})[_0x071e('0x23')](handleEntityNotFound(_0x127d5b,null))[_0x071e('0x23')](removeEntity(_0x127d5b,null))[_0x071e('0x41')](handleError(_0x127d5b,null));};exports['describe']=function(_0x46c6f5,_0x9c00f0){return db['SquareDetailsReport']['describe']()[_0x071e('0x23')](respondWithResult(_0x9c00f0,null))[_0x071e('0x41')](handleError(_0x9c00f0,null));}; \ No newline at end of file +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 diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index c5d6fd2..c75c021 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 _0x0190=['moment','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','util','../../config/logger','api'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x0190,0x131));var _0x0019=function(_0x4babb1,_0x59df71){_0x4babb1=_0x4babb1-0x0;var _0x308156=_0x0190[_0x4babb1];return _0x308156;};'use strict';var _=require('lodash');var util=require(_0x0019('0x0'));var logger=require(_0x0019('0x1'))(_0x0019('0x2'));var moment=require(_0x0019('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0019('0x4'));var rimraf=require('rimraf');var config=require(_0x0019('0x5'));var attributes=require(_0x0019('0x6'));module[_0x0019('0x7')]=function(_0x23bdc3,_0x9897a9){return _0x23bdc3[_0x0019('0x8')](_0x0019('0x9'),attributes,{'tableName':_0x0019('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index fb0a076..09bbde8 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 _0x6b20=['error','code','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','then','stringify','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SquareDetailsReport,\x20%s,\x20%s','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2de54e,_0x5afd91){var _0x3d5384=function(_0x2cc26d){while(--_0x2cc26d){_0x2de54e['push'](_0x2de54e['shift']());}};_0x3d5384(++_0x5afd91);}(_0x6b20,0xd1));var _0x06b2=function(_0x29f437,_0x24252e){_0x29f437=_0x29f437-0x0;var _0xba67ce=_0x6b20[_0x29f437];return _0xba67ce;};'use strict';var _=require(_0x06b2('0x0'));var util=require(_0x06b2('0x1'));var moment=require('moment');var BPromise=require(_0x06b2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b2('0x3'));var db=require(_0x06b2('0x4'))['db'];var utils=require(_0x06b2('0x5'));var logger=require('../../config/logger')(_0x06b2('0x6'));var config=require(_0x06b2('0x7'));var jayson=require(_0x06b2('0x8'));var client=jayson[_0x06b2('0x9')][_0x06b2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x37b825,_0x26a325,_0x4e6d3b){return new BPromise(function(_0x21cd31,_0x1828e4){return client[_0x06b2('0xb')](_0x37b825,_0x4e6d3b)['then'](function(_0x37ace0){logger['info'](_0x06b2('0xc'),_0x26a325,'request\x20sent');logger['debug'](_0x06b2('0xd'),_0x26a325,_0x06b2('0xe'),JSON['stringify'](_0x37ace0));if(_0x37ace0[_0x06b2('0xf')]){if(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x10')]===0x1f4){logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x1828e4(_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);}logger[_0x06b2('0xf')](_0x06b2('0xc'),_0x26a325,_0x37ace0[_0x06b2('0xf')][_0x06b2('0x11')]);return _0x21cd31(_0x37ace0['error'][_0x06b2('0x11')]);}else{logger[_0x06b2('0x12')](_0x06b2('0xc'),_0x26a325,_0x06b2('0xe'));_0x21cd31(_0x37ace0[_0x06b2('0x13')][_0x06b2('0x11')]);}})['catch'](function(_0x17e69b){logger[_0x06b2('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x26a325,_0x17e69b);_0x1828e4(_0x17e69b);});});}exports[_0x06b2('0x14')]=function(_0x594b48){var _0x4c9cae=this;return new Promise(function(_0x192270,_0x1b4ab0){return db[_0x06b2('0x15')][_0x06b2('0x16')](_0x594b48['body'],{'raw':_0x594b48[_0x06b2('0x17')]?_0x594b48[_0x06b2('0x17')][_0x06b2('0x18')]===undefined?!![]:![]:!![]})[_0x06b2('0x19')](function(_0xe28985){logger[_0x06b2('0x12')](_0x06b2('0x14'),_0x594b48);logger['debug'](_0x06b2('0x14'),_0x594b48,JSON[_0x06b2('0x1a')](_0xe28985));_0x192270(_0xe28985);})[_0x06b2('0x1b')](function(_0x208384){logger['error']('CreateSquareDetailsReport',_0x208384[_0x06b2('0x11')],_0x594b48);_0x1b4ab0(_0x4c9cae[_0x06b2('0xf')](0x1f4,_0x208384['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/system/index.js b/server/api/system/index.js index cde2b22..10764bd 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 _0x431a=['express','Router','get','index','/process/:pid/kill','exports'];(function(_0x3d064a,_0x12cf18){var _0x5b2a83=function(_0x241866){while(--_0x241866){_0x3d064a['push'](_0x3d064a['shift']());}};_0x5b2a83(++_0x12cf18);}(_0x431a,0x102));var _0xa431=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x431a[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0xa431('0x0'));var router=express[_0xa431('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xa431('0x2')]('/',auth['isAuthenticated'](),controller[_0xa431('0x3')]);router[_0xa431('0x2')](_0xa431('0x4'),auth['isAuthenticated'](),controller['killProcess']);module[_0xa431('0x5')]=router; \ No newline at end of file +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 diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 679218c..1c83dc2 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 _0xf90c=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash','error','inspect','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split'];(function(_0x1c0b4a,_0x42bb0f){var _0x37238a=function(_0x2e3101){while(--_0x2e3101){_0x1c0b4a['push'](_0x1c0b4a['shift']());}};_0x37238a(++_0x42bb0f);}(_0xf90c,0x1a9));var _0xcf90=function(_0x4a252a,_0x40a33a){_0x4a252a=_0x4a252a-0x0;var _0x442245=_0xf90c[_0x4a252a];return _0x442245;};'use strict';var info=require(_0xcf90('0x0'));var exec=require(_0xcf90('0x1'))[_0xcf90('0x2')];var logger=require(_0xcf90('0x3'))(_0xcf90('0x4'));var util=require(_0xcf90('0x5'));var BPromise=require(_0xcf90('0x6'));var _=require(_0xcf90('0x7'));function handleError(_0x3a2e46,_0x13785f,_0x25f2ef){_0x13785f=_0x13785f||0x1f4;return function(_0x32e33f){logger[_0xcf90('0x8')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x25f2ef,_0x13785f,util[_0xcf90('0x9')](_0x32e33f,{'showHidden':![],'depth':null}));delete _0x32e33f['name'];_0x3a2e46[_0xcf90('0xa')](_0x13785f)[_0xcf90('0xb')](_0x32e33f);};}exports[_0xcf90('0xc')]=function(_0x5c8e73,_0x20fa5d){return info[_0xcf90('0xd')]()[_0xcf90('0xe')](function(_0x3bf85d){return _0x20fa5d[_0xcf90('0xa')](0xc8)[_0xcf90('0xf')](_0x3bf85d);})[_0xcf90('0x10')](function(_0x17ee43){return _0x20fa5d[_0xcf90('0xa')](0x1f4)[_0xcf90('0xf')](_0x17ee43);});};exports['killProcess']=function(_0x183aaf,_0x382092){var _0x326536=[_0xcf90('0x11')];return new BPromise(function(_0x4e43de,_0x3abaf8){return exec(util[_0xcf90('0x12')](_0xcf90('0x13'),_0x183aaf[_0xcf90('0x14')][_0xcf90('0x15')]),function(_0x413ca9,_0x584ef9,_0x3da761){if(_0x413ca9){return _0x3abaf8(_0x413ca9);}return _0x4e43de(_0x584ef9);});})[_0xcf90('0xe')](function(_0x1109b3){var _0xe4c42=![];var _0x37ebba=_0x1109b3[_0xcf90('0x16')](/\n/);for(var _0x2b2d27=0x0,_0x4c0698=_0x326536[_0xcf90('0x17')];_0x2b2d27<_0x4c0698,_0xe4c42===![];_0x2b2d27+=0x1){if(_0x1109b3[_0xcf90('0x18')](_0x326536[_0x2b2d27])>=0x0){_0xe4c42=!![];}}if(!_0xe4c42){throw new Error(util['format'](_0xcf90('0x19'),_0x183aaf[_0xcf90('0x14')][_0xcf90('0x15')]));}process['kill'](_0x183aaf[_0xcf90('0x14')][_0xcf90('0x15')],_0xcf90('0x1a'));return _0x382092['status'](0xc8)['json']({'message':util[_0xcf90('0x12')](_0xcf90('0x1b'),_0x183aaf['params']['pid'])});})[_0xcf90('0x10')](handleError(_0x382092,null,'killProcess'));}; \ No newline at end of file +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 diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 352dc4d..19367c9 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 _0xeb7e=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','index','show','put'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeb7e,0x1f2));var _0xeeb7=function(_0x543136,_0x4fba88){_0x543136=_0x543136-0x0;var _0x3438c4=_0xeb7e[_0x543136];return _0x3438c4;};'use strict';var multer=require(_0xeeb7('0x0'));var util=require(_0xeeb7('0x1'));var path=require(_0xeeb7('0x2'));var timeout=require(_0xeeb7('0x3'));var express=require(_0xeeb7('0x4'));var router=express[_0xeeb7('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeeb7('0x6'));var interaction=require(_0xeeb7('0x7'));var config=require(_0xeeb7('0x8'));var controller=require(_0xeeb7('0x9'));router[_0xeeb7('0xa')]('/',auth[_0xeeb7('0xb')](),controller[_0xeeb7('0xc')]);router[_0xeeb7('0xa')]('/:id',auth[_0xeeb7('0xb')](),controller[_0xeeb7('0xd')]);router['post']('/',auth[_0xeeb7('0xb')](),controller['create']);router[_0xeeb7('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xeeb7('0xf')](_0xeeb7('0x10'),auth[_0xeeb7('0xb')](),controller[_0xeeb7('0x11')]);module[_0xeeb7('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index a4c63a7..4eeb104 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 _0xf12a=['name','#0091EA','sequelize','exports','STRING'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xf12a,0x8e));var _0xaf12=function(_0xd3bcf8,_0x994fdb){_0xd3bcf8=_0xd3bcf8-0x0;var _0x296170=_0xf12a[_0xd3bcf8];return _0x296170;};'use strict';var Sequelize=require(_0xaf12('0x0'));module[_0xaf12('0x1')]={'name':{'type':Sequelize[_0xaf12('0x2')],'unique':_0xaf12('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaf12('0x2')],'defaultValue':_0xaf12('0x4')},'description':{'type':Sequelize[_0xaf12('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index b64ca55..8a7b69c 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 _0xec56=['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','../../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','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','Tag','include','findAll','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0xec56,0x1bd));var _0x6ec5=function(_0x6ee29e,_0x3bf4fb){_0x6ee29e=_0x6ee29e-0x0;var _0x3df99d=_0xec56[_0x6ee29e];return _0x3df99d;};'use strict';var emlformat=require(_0x6ec5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6ec5('0x1'));var rp=require(_0x6ec5('0x2'));var moment=require(_0x6ec5('0x3'));var BPromise=require(_0x6ec5('0x4'));var Mustache=require(_0x6ec5('0x5'));var util=require(_0x6ec5('0x6'));var path=require(_0x6ec5('0x7'));var sox=require(_0x6ec5('0x8'));var csv=require(_0x6ec5('0x9'));var ejs=require(_0x6ec5('0xa'));var fs=require('fs');var fs_extra=require(_0x6ec5('0xb'));var _=require(_0x6ec5('0xc'));var squel=require(_0x6ec5('0xd'));var crypto=require(_0x6ec5('0xe'));var jsforce=require(_0x6ec5('0xf'));var deskjs=require(_0x6ec5('0x10'));var toCsv=require(_0x6ec5('0x9'));var querystring=require(_0x6ec5('0x11'));var Papa=require(_0x6ec5('0x12'));var Redis=require('ioredis');var authService=require(_0x6ec5('0x13'));var qs=require(_0x6ec5('0x14'));var as=require(_0x6ec5('0x15'));var hardwareService=require(_0x6ec5('0x16'));var logger=require(_0x6ec5('0x17'))(_0x6ec5('0x18'));var utils=require(_0x6ec5('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x6ec5('0x1a'));var db=require(_0x6ec5('0x1b'))['db'];function respondWithStatusCode(_0x2b1f61,_0xb04ab6){_0xb04ab6=_0xb04ab6||0xcc;return function(_0x135aaf){if(_0x135aaf){return _0x2b1f61[_0x6ec5('0x1c')](_0xb04ab6);}return _0x2b1f61[_0x6ec5('0x1d')](_0xb04ab6)[_0x6ec5('0x1e')]();};}function respondWithResult(_0x5166ad,_0x3ed07a){_0x3ed07a=_0x3ed07a||0xc8;return function(_0x4d1510){if(_0x4d1510){return _0x5166ad[_0x6ec5('0x1d')](_0x3ed07a)[_0x6ec5('0x1f')](_0x4d1510);}};}function respondWithFilteredResult(_0x4a4e3c,_0x9fc0e7){return function(_0xdc0b10){if(_0xdc0b10){var _0x4d09fe=typeof _0x9fc0e7[_0x6ec5('0x20')]===_0x6ec5('0x21')&&typeof _0x9fc0e7[_0x6ec5('0x22')]===_0x6ec5('0x21');var _0x23b3e3=_0xdc0b10[_0x6ec5('0x23')];var _0x1dbee9=_0x4d09fe?0x0:_0x9fc0e7[_0x6ec5('0x20')];var _0x2608c0=_0x4d09fe?_0xdc0b10[_0x6ec5('0x23')]:_0x9fc0e7[_0x6ec5('0x20')]+_0x9fc0e7[_0x6ec5('0x22')];var _0x437f0f;if(_0x2608c0>=_0x23b3e3){_0x2608c0=_0x23b3e3;_0x437f0f=0xc8;}else{_0x437f0f=0xce;}_0x4a4e3c[_0x6ec5('0x1d')](_0x437f0f);return _0x4a4e3c[_0x6ec5('0x24')](_0x6ec5('0x25'),_0x1dbee9+'-'+_0x2608c0+'/'+_0x23b3e3)[_0x6ec5('0x1f')](_0xdc0b10);}return null;};}function patchUpdates(_0x4abd5d){return function(_0x272532){try{jsonpatch[_0x6ec5('0x26')](_0x272532,_0x4abd5d,!![]);}catch(_0xd045b){return BPromise[_0x6ec5('0x27')](_0xd045b);}return _0x272532[_0x6ec5('0x28')]();};}function saveUpdates(_0x38a821,_0x18243f){return function(_0x48733b){if(_0x48733b){return _0x48733b[_0x6ec5('0x29')](_0x38a821)[_0x6ec5('0x2a')](function(_0x358d18){return _0x358d18;});}return null;};}function removeEntity(_0x1560c6,_0x57060c){return function(_0x27f631){if(_0x27f631){return _0x27f631[_0x6ec5('0x2b')]()['then'](function(){var _0x2dc0a7=_0x27f631[_0x6ec5('0x2c')]({'plain':!![]});var _0xb4d269='Tags';return db[_0x6ec5('0x2d')][_0x6ec5('0x2b')]({'where':{'type':_0xb4d269,'resourceId':_0x2dc0a7['id']}})[_0x6ec5('0x2a')](function(){return _0x27f631;});})[_0x6ec5('0x2a')](function(){_0x1560c6[_0x6ec5('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x171e2a,_0x267a30){return function(_0x4a9860){if(!_0x4a9860){_0x171e2a[_0x6ec5('0x1c')](0x194);}return _0x4a9860;};}function handleError(_0x3f5ee0,_0x5c8c7d){_0x5c8c7d=_0x5c8c7d||0x1f4;return function(_0x3d36cb){logger[_0x6ec5('0x2e')](_0x3d36cb[_0x6ec5('0x2f')]);if(_0x3d36cb[_0x6ec5('0x30')]){delete _0x3d36cb[_0x6ec5('0x30')];}_0x3f5ee0['status'](_0x5c8c7d)[_0x6ec5('0x31')](_0x3d36cb);};}exports[_0x6ec5('0x32')]=function(_0x24aff9,_0x174164){var _0x3e6d33={},_0x22c3d3={},_0x394132={'count':0x0,'rows':[]};var _0x59a6de=_[_0x6ec5('0x33')](db['Tag'][_0x6ec5('0x34')],function(_0x5c6517){return{'name':_0x5c6517[_0x6ec5('0x35')],'type':_0x5c6517[_0x6ec5('0x36')]['key']};});_0x22c3d3['model']=_[_0x6ec5('0x33')](_0x59a6de,_0x6ec5('0x30'));_0x22c3d3['query']=_[_0x6ec5('0x37')](_0x24aff9[_0x6ec5('0x38')]);_0x22c3d3['filters']=_[_0x6ec5('0x39')](_0x22c3d3[_0x6ec5('0x3a')],_0x22c3d3[_0x6ec5('0x38')]);_0x3e6d33[_0x6ec5('0x3b')]=_[_0x6ec5('0x39')](_0x22c3d3[_0x6ec5('0x3a')],qs[_0x6ec5('0x3c')](_0x24aff9[_0x6ec5('0x38')]['fields']));_0x3e6d33[_0x6ec5('0x3b')]=_0x3e6d33['attributes'][_0x6ec5('0x3d')]?_0x3e6d33[_0x6ec5('0x3b')]:_0x22c3d3[_0x6ec5('0x3a')];if(!_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x3e')](_0x6ec5('0x3f'))){_0x3e6d33[_0x6ec5('0x22')]=qs[_0x6ec5('0x22')](_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x22')]);_0x3e6d33[_0x6ec5('0x20')]=qs['offset'](_0x24aff9['query'][_0x6ec5('0x20')]);}_0x3e6d33['order']=qs[_0x6ec5('0x40')](_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x40')]);_0x3e6d33[_0x6ec5('0x41')]=qs[_0x6ec5('0x42')](_[_0x6ec5('0x43')](_0x24aff9[_0x6ec5('0x38')],_0x22c3d3['filters']),_0x59a6de);if(_0x24aff9[_0x6ec5('0x38')][_0x6ec5('0x44')]){_0x3e6d33[_0x6ec5('0x41')]=_[_0x6ec5('0x45')](_0x3e6d33[_0x6ec5('0x41')],{'$or':_[_0x6ec5('0x33')](_0x59a6de,function(_0x74e78b){if(_0x74e78b[_0x6ec5('0x36')]!==_0x6ec5('0x46')){var _0x53dcd8={};_0x53dcd8[_0x74e78b[_0x6ec5('0x30')]]={'$like':'%'+_0x24aff9['query'][_0x6ec5('0x44')]+'%'};return _0x53dcd8;}})});}_0x3e6d33=_['merge']({},_0x3e6d33,_0x24aff9[_0x6ec5('0x47')]);var _0x45de3c={'where':_0x3e6d33['where']};return db[_0x6ec5('0x48')][_0x6ec5('0x23')](_0x45de3c)[_0x6ec5('0x2a')](function(_0x48c019){_0x394132[_0x6ec5('0x23')]=_0x48c019;if(_0x24aff9[_0x6ec5('0x38')]['includeAll']){_0x3e6d33[_0x6ec5('0x49')]=[{'all':!![]}];}return db[_0x6ec5('0x48')][_0x6ec5('0x4a')](_0x3e6d33);})[_0x6ec5('0x2a')](function(_0x43d858){_0x394132[_0x6ec5('0x4b')]=_0x43d858;return _0x394132;})[_0x6ec5('0x2a')](respondWithFilteredResult(_0x174164,_0x3e6d33))[_0x6ec5('0x4c')](handleError(_0x174164,null));};exports[_0x6ec5('0x4d')]=function(_0x5a7b9c,_0x96340b){var _0x4ee5f5={'raw':!![],'where':{'id':_0x5a7b9c[_0x6ec5('0x4e')]['id']}},_0x17cfed={};_0x17cfed[_0x6ec5('0x3a')]=_[_0x6ec5('0x37')](db['Tag'][_0x6ec5('0x34')]);_0x17cfed[_0x6ec5('0x38')]=_['keys'](_0x5a7b9c[_0x6ec5('0x38')]);_0x17cfed['filters']=_[_0x6ec5('0x39')](_0x17cfed[_0x6ec5('0x3a')],_0x17cfed[_0x6ec5('0x38')]);_0x4ee5f5[_0x6ec5('0x3b')]=_['intersection'](_0x17cfed['model'],qs[_0x6ec5('0x3c')](_0x5a7b9c['query'][_0x6ec5('0x3c')]));_0x4ee5f5[_0x6ec5('0x3b')]=_0x4ee5f5[_0x6ec5('0x3b')][_0x6ec5('0x3d')]?_0x4ee5f5[_0x6ec5('0x3b')]:_0x17cfed['model'];if(_0x5a7b9c['query'][_0x6ec5('0x4f')]){_0x4ee5f5[_0x6ec5('0x49')]=[{'all':!![]}];}_0x4ee5f5=_[_0x6ec5('0x45')]({},_0x4ee5f5,_0x5a7b9c[_0x6ec5('0x47')]);return db[_0x6ec5('0x48')][_0x6ec5('0x50')](_0x4ee5f5)[_0x6ec5('0x2a')](handleEntityNotFound(_0x96340b,null))[_0x6ec5('0x2a')](respondWithResult(_0x96340b,null))[_0x6ec5('0x4c')](handleError(_0x96340b,null));};exports[_0x6ec5('0x51')]=function(_0xd265c,_0x1c5e2f){return db[_0x6ec5('0x48')][_0x6ec5('0x51')](_0xd265c['body'],{})[_0x6ec5('0x2a')](function(_0x51709d){var _0x40b9cc=_0xd265c[_0x6ec5('0x52')]['get']({'plain':!![]});if(!_0x40b9cc)throw new Error(_0x6ec5('0x53'));if(_0x40b9cc[_0x6ec5('0x54')]==='user'){var _0x23a64d=_0x51709d[_0x6ec5('0x2c')]({'plain':!![]});var _0x486552='Tags';return db[_0x6ec5('0x55')]['find']({'where':{'name':_0x486552,'userProfileId':_0x40b9cc['userProfileId']},'raw':!![]})[_0x6ec5('0x2a')](function(_0x101966){if(_0x101966&&_0x101966[_0x6ec5('0x56')]===0x0){return db[_0x6ec5('0x2d')]['create']({'name':_0x23a64d[_0x6ec5('0x30')],'resourceId':_0x23a64d['id'],'type':_0x101966[_0x6ec5('0x30')],'sectionId':_0x101966['id']},{})[_0x6ec5('0x2a')](function(){return _0x51709d;});}else{return _0x51709d;}})[_0x6ec5('0x4c')](function(_0x9bde51){logger[_0x6ec5('0x2e')](_0x6ec5('0x57'),_0x9bde51);throw _0x9bde51;});}return _0x51709d;})[_0x6ec5('0x2a')](respondWithResult(_0x1c5e2f,0xc9))[_0x6ec5('0x4c')](handleError(_0x1c5e2f,null));};exports[_0x6ec5('0x29')]=function(_0x29317f,_0x4370f2){if(_0x29317f[_0x6ec5('0x58')]['id']){delete _0x29317f['body']['id'];}return db[_0x6ec5('0x48')][_0x6ec5('0x50')]({'where':{'id':_0x29317f['params']['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x4370f2,null))[_0x6ec5('0x2a')](saveUpdates(_0x29317f[_0x6ec5('0x58')],null))[_0x6ec5('0x2a')](respondWithResult(_0x4370f2,null))[_0x6ec5('0x4c')](handleError(_0x4370f2,null));};exports['destroy']=function(_0x5f3d3f,_0x282cbc){return db['Tag'][_0x6ec5('0x50')]({'where':{'id':_0x5f3d3f[_0x6ec5('0x4e')]['id']}})[_0x6ec5('0x2a')](handleEntityNotFound(_0x282cbc,null))[_0x6ec5('0x2a')](removeEntity(_0x282cbc,null))[_0x6ec5('0x4c')](handleError(_0x282cbc,null));}; \ No newline at end of file +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 diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 1e40854..52b86f0 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 _0xe702=['util','../../config/logger','api','moment','bluebird','rimraf','./tag.attributes','define','tools_tags','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe702,0x95));var _0x2e70=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xe702[_0x4154a6];return _0x3b2786;};'use strict';var _=require(_0x2e70('0x0'));var util=require(_0x2e70('0x1'));var logger=require(_0x2e70('0x2'))(_0x2e70('0x3'));var moment=require(_0x2e70('0x4'));var BPromise=require(_0x2e70('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2e70('0x6'));var config=require('../../config/environment');var attributes=require(_0x2e70('0x7'));module['exports']=function(_0x32c37e,_0x32ad67){return _0x32c37e[_0x2e70('0x8')]('Tag',attributes,{'tableName':_0x2e70('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 7f1bf92..7a91d8d 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 _0xb6b1=['catch','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','Tag,\x20%s,\x20%s','message','info','result'];(function(_0x4775e6,_0x20ce4a){var _0x34faa6=function(_0x32b1df){while(--_0x32b1df){_0x4775e6['push'](_0x4775e6['shift']());}};_0x34faa6(++_0x20ce4a);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb6b1[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x1b6b('0x0'));var util=require('util');var moment=require(_0x1b6b('0x1'));var BPromise=require('bluebird');var rs=require(_0x1b6b('0x2'));var fs=require('fs');var Redis=require(_0x1b6b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b6b('0x4'));var logger=require('../../config/logger')(_0x1b6b('0x5'));var config=require(_0x1b6b('0x6'));var jayson=require(_0x1b6b('0x7'));var client=jayson[_0x1b6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41d09e,_0x51cfed,_0xae4115){return new BPromise(function(_0x5042f7,_0x21f403){return client[_0x1b6b('0x9')](_0x41d09e,_0xae4115)[_0x1b6b('0xa')](function(_0x29258a){logger['info']('Tag,\x20%s,\x20%s',_0x51cfed,_0x1b6b('0xb'));logger[_0x1b6b('0xc')](_0x1b6b('0xd'),_0x51cfed,_0x1b6b('0xb'),JSON[_0x1b6b('0xe')](_0x29258a));if(_0x29258a[_0x1b6b('0xf')]){if(_0x29258a[_0x1b6b('0xf')]['code']===0x1f4){logger[_0x1b6b('0xf')](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')]['message']);return _0x21f403(_0x29258a[_0x1b6b('0xf')]['message']);}logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);return _0x5042f7(_0x29258a[_0x1b6b('0xf')][_0x1b6b('0x11')]);}else{logger[_0x1b6b('0x12')](_0x1b6b('0x10'),_0x51cfed,'request\x20sent');_0x5042f7(_0x29258a[_0x1b6b('0x13')][_0x1b6b('0x11')]);}})[_0x1b6b('0x14')](function(_0x33dc7e){logger['error'](_0x1b6b('0x10'),_0x51cfed,_0x33dc7e);_0x21f403(_0x33dc7e);});});} \ No newline at end of file +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 diff --git a/server/api/team/index.js b/server/api/team/index.js index bce7ba3..0e74d7a 100644 --- a/server/api/team/index.js +++ b/server/api/team/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_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 diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 416d2c7..049428f 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 _0xbaf0=['name','exports','STRING'];(function(_0x2261ce,_0x9ed8b6){var _0x524640=function(_0x3cbb90){while(--_0x3cbb90){_0x2261ce['push'](_0x2261ce['shift']());}};_0x524640(++_0x9ed8b6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'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 +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 diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index f9d9f70..597dbee 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 _0xd52d=['addAgents','isArray','ids','Voice','Sms','Openchannel','Whatsapp','through','penalty','User','emit','online','voicePause','interface','isNil','format','SIP/%s','TeamVoiceQueue','all','spread','removeAgents','Chat','Mail','transaction','Queue:remove','QueueId','UserVoiceQueueRt','VoicePrefixId','getAgents','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','error','name','send','index','map','Team','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','UserProfileResource','body','params','destroy','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','UserId','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','UserMailQueue','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','Teams','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','length','Queues','addQueues','ValidationError','add','removeQueues','remove'];(function(_0x41b16f,_0x4afe01){var _0xb84a94=function(_0x43f03a){while(--_0x43f03a){_0x41b16f['push'](_0x41b16f['shift']());}};_0xb84a94(++_0x4afe01);}(_0xd52d,0x149));var _0xdd52=function(_0x55fb42,_0x277397){_0x55fb42=_0x55fb42-0x0;var _0x289f9c=_0xd52d[_0x55fb42];return _0x289f9c;};'use strict';var emlformat=require(_0xdd52('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd52('0x1'));var moment=require('moment');var BPromise=require(_0xdd52('0x2'));var Mustache=require(_0xdd52('0x3'));var util=require(_0xdd52('0x4'));var path=require(_0xdd52('0x5'));var sox=require(_0xdd52('0x6'));var csv=require(_0xdd52('0x7'));var ejs=require(_0xdd52('0x8'));var fs=require('fs');var fs_extra=require(_0xdd52('0x9'));var _=require(_0xdd52('0xa'));var squel=require(_0xdd52('0xb'));var crypto=require(_0xdd52('0xc'));var jsforce=require(_0xdd52('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdd52('0x7'));var querystring=require(_0xdd52('0xe'));var Papa=require(_0xdd52('0xf'));var Redis=require('ioredis');var authService=require(_0xdd52('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xdd52('0x11'));var hardwareService=require(_0xdd52('0x12'));var logger=require(_0xdd52('0x13'))('api');var utils=require(_0xdd52('0x14'));var config=require(_0xdd52('0x15'));var licenseUtil=require(_0xdd52('0x16'));var db=require('../../mysqldb')['db'];config[_0xdd52('0x17')]=_[_0xdd52('0x18')](config[_0xdd52('0x17')],{'host':_0xdd52('0x19'),'port':0x18eb});var socket=require(_0xdd52('0x1a'))(new Redis(config[_0xdd52('0x17')]));require(_0xdd52('0x1b'))[_0xdd52('0x1c')](socket);function respondWithStatusCode(_0x497978,_0x17d7ec){_0x17d7ec=_0x17d7ec||0xcc;return function(_0x3f47b8){if(_0x3f47b8){return _0x497978[_0xdd52('0x1d')](_0x17d7ec);}return _0x497978[_0xdd52('0x1e')](_0x17d7ec)[_0xdd52('0x1f')]();};}function respondWithResult(_0x8b8d91,_0xc418ab){_0xc418ab=_0xc418ab||0xc8;return function(_0xcfe6bd){if(_0xcfe6bd){return _0x8b8d91[_0xdd52('0x1e')](_0xc418ab)['json'](_0xcfe6bd);}};}function respondWithFilteredResult(_0x1dd34c,_0x452061){return function(_0x4f3032){if(_0x4f3032){var _0x279b7d=typeof _0x452061[_0xdd52('0x20')]===_0xdd52('0x21')&&typeof _0x452061[_0xdd52('0x22')]===_0xdd52('0x21');var _0x1232e4=_0x4f3032[_0xdd52('0x23')];var _0x7c808a=_0x279b7d?0x0:_0x452061[_0xdd52('0x20')];var _0x93d155=_0x279b7d?_0x4f3032['count']:_0x452061[_0xdd52('0x20')]+_0x452061[_0xdd52('0x22')];var _0x596bf9;if(_0x93d155>=_0x1232e4){_0x93d155=_0x1232e4;_0x596bf9=0xc8;}else{_0x596bf9=0xce;}_0x1dd34c['status'](_0x596bf9);return _0x1dd34c[_0xdd52('0x24')](_0xdd52('0x25'),_0x7c808a+'-'+_0x93d155+'/'+_0x1232e4)[_0xdd52('0x26')](_0x4f3032);}return null;};}function patchUpdates(_0x59db65){return function(_0x4c6634){try{jsonpatch[_0xdd52('0x27')](_0x4c6634,_0x59db65,!![]);}catch(_0x1d00f8){return BPromise['reject'](_0x1d00f8);}return _0x4c6634['save']();};}function saveUpdates(_0x5d15f5,_0x3d6a67){return function(_0x1ba40d){if(_0x1ba40d){return _0x1ba40d[_0xdd52('0x28')](_0x5d15f5)[_0xdd52('0x29')](function(_0x59643d){return _0x59643d;});}return null;};}function handleEntityNotFound(_0x5806ac,_0x3e9f7b){return function(_0x518a10){if(!_0x518a10){_0x5806ac[_0xdd52('0x1d')](0x194);}return _0x518a10;};}function handleError(_0x56344f,_0x44187e){_0x44187e=_0x44187e||0x1f4;return function(_0x36bafd){logger[_0xdd52('0x2a')](_0x36bafd['stack']);if(_0x36bafd[_0xdd52('0x2b')]){delete _0x36bafd['name'];}_0x56344f['status'](_0x44187e)[_0xdd52('0x2c')](_0x36bafd);};}exports[_0xdd52('0x2d')]=function(_0x2cd235,_0xe40ab1){var _0x4eb36a={},_0x19d1cd={},_0x1e8ee6={'count':0x0,'rows':[]};var _0x5cdc29=_[_0xdd52('0x2e')](db[_0xdd52('0x2f')][_0xdd52('0x30')],function(_0x3fc79d){return{'name':_0x3fc79d[_0xdd52('0x31')],'type':_0x3fc79d[_0xdd52('0x32')][_0xdd52('0x33')]};});_0x19d1cd[_0xdd52('0x34')]=_['map'](_0x5cdc29,_0xdd52('0x2b'));_0x19d1cd[_0xdd52('0x35')]=_['keys'](_0x2cd235['query']);_0x19d1cd['filters']=_[_0xdd52('0x36')](_0x19d1cd[_0xdd52('0x34')],_0x19d1cd[_0xdd52('0x35')]);_0x4eb36a[_0xdd52('0x37')]=_[_0xdd52('0x36')](_0x19d1cd[_0xdd52('0x34')],qs[_0xdd52('0x38')](_0x2cd235[_0xdd52('0x35')][_0xdd52('0x38')]));_0x4eb36a[_0xdd52('0x37')]=_0x4eb36a['attributes']['length']?_0x4eb36a[_0xdd52('0x37')]:_0x19d1cd[_0xdd52('0x34')];if(!_0x2cd235['query']['hasOwnProperty'](_0xdd52('0x39'))){_0x4eb36a[_0xdd52('0x22')]=qs[_0xdd52('0x22')](_0x2cd235['query'][_0xdd52('0x22')]);_0x4eb36a[_0xdd52('0x20')]=qs[_0xdd52('0x20')](_0x2cd235[_0xdd52('0x35')]['offset']);}_0x4eb36a[_0xdd52('0x3a')]=qs['sort'](_0x2cd235[_0xdd52('0x35')][_0xdd52('0x3b')]);_0x4eb36a[_0xdd52('0x3c')]=qs['filters'](_[_0xdd52('0x3d')](_0x2cd235[_0xdd52('0x35')],_0x19d1cd[_0xdd52('0x3e')]),_0x5cdc29);if(_0x2cd235['query'][_0xdd52('0x3f')]){_0x4eb36a[_0xdd52('0x3c')]=_[_0xdd52('0x40')](_0x4eb36a[_0xdd52('0x3c')],{'$or':_[_0xdd52('0x2e')](_0x5cdc29,function(_0x17ce8b){if(_0x17ce8b['type']!=='VIRTUAL'){var _0x497275={};_0x497275[_0x17ce8b['name']]={'$like':'%'+_0x2cd235[_0xdd52('0x35')][_0xdd52('0x3f')]+'%'};return _0x497275;}})});}_0x4eb36a=_[_0xdd52('0x40')]({},_0x4eb36a,_0x2cd235[_0xdd52('0x41')]);var _0x2a9f18={'where':_0x4eb36a[_0xdd52('0x3c')]};return db[_0xdd52('0x2f')]['count'](_0x2a9f18)[_0xdd52('0x29')](function(_0x36051c){_0x1e8ee6['count']=_0x36051c;if(_0x2cd235['query'][_0xdd52('0x42')]){_0x4eb36a[_0xdd52('0x43')]=[{'all':!![]}];}return db['Team'][_0xdd52('0x44')](_0x4eb36a);})[_0xdd52('0x29')](function(_0x37f8ae){_0x1e8ee6[_0xdd52('0x45')]=_0x37f8ae;return _0x1e8ee6;})[_0xdd52('0x29')](respondWithFilteredResult(_0xe40ab1,_0x4eb36a))[_0xdd52('0x46')](handleError(_0xe40ab1,null));};exports[_0xdd52('0x47')]=function(_0x2ee9ed,_0x50af16){var _0x3d4c93={'raw':![],'where':{'id':_0x2ee9ed['params']['id']}},_0xfbd199={};_0xfbd199[_0xdd52('0x34')]=_[_0xdd52('0x48')](db[_0xdd52('0x2f')][_0xdd52('0x30')]);_0xfbd199['query']=_['keys'](_0x2ee9ed[_0xdd52('0x35')]);_0xfbd199[_0xdd52('0x3e')]=_['intersection'](_0xfbd199[_0xdd52('0x34')],_0xfbd199[_0xdd52('0x35')]);_0x3d4c93[_0xdd52('0x37')]=_['intersection'](_0xfbd199[_0xdd52('0x34')],qs[_0xdd52('0x38')](_0x2ee9ed[_0xdd52('0x35')]['fields']));_0x3d4c93['attributes']=_0x3d4c93[_0xdd52('0x37')]['length']?_0x3d4c93[_0xdd52('0x37')]:_0xfbd199[_0xdd52('0x34')];if(_0x2ee9ed[_0xdd52('0x35')][_0xdd52('0x42')]){_0x3d4c93[_0xdd52('0x43')]=[{'all':!![]}];}_0x3d4c93=_['merge']({},_0x3d4c93,_0x2ee9ed[_0xdd52('0x41')]);return db['Team'][_0xdd52('0x49')](_0x3d4c93)[_0xdd52('0x29')](handleEntityNotFound(_0x50af16,null))['then'](respondWithResult(_0x50af16,null))[_0xdd52('0x46')](handleError(_0x50af16,null));};exports[_0xdd52('0x4a')]=function(_0x52c38c,_0x863e8){return db['Team'][_0xdd52('0x4a')](_0x52c38c['body'],{})[_0xdd52('0x29')](function(_0x443d4f){var _0x22bab3=_0x52c38c[_0xdd52('0x4b')]['get']({'plain':!![]});if(!_0x22bab3)throw new Error(_0xdd52('0x4c'));if(_0x22bab3[_0xdd52('0x4d')]===_0xdd52('0x4b')){var _0x2fa743=_0x443d4f[_0xdd52('0x4e')]({'plain':!![]});var _0x5a743c='Teams';return db['UserProfileSection'][_0xdd52('0x49')]({'where':{'name':_0x5a743c,'userProfileId':_0x22bab3[_0xdd52('0x4f')]},'raw':!![]})[_0xdd52('0x29')](function(_0x4344aa){if(_0x4344aa&&_0x4344aa[_0xdd52('0x50')]===0x0){return db[_0xdd52('0x51')][_0xdd52('0x4a')]({'name':_0x2fa743[_0xdd52('0x2b')],'resourceId':_0x2fa743['id'],'type':_0x4344aa[_0xdd52('0x2b')],'sectionId':_0x4344aa['id']},{})['then'](function(){return _0x443d4f;});}else{return _0x443d4f;}})[_0xdd52('0x46')](function(_0x1973a1){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1973a1);throw _0x1973a1;});}return _0x443d4f;})[_0xdd52('0x29')](respondWithResult(_0x863e8,0xc9))['catch'](handleError(_0x863e8,null));};exports[_0xdd52('0x28')]=function(_0x334408,_0x2b7360){if(_0x334408[_0xdd52('0x52')]['id']){delete _0x334408[_0xdd52('0x52')]['id'];}return db[_0xdd52('0x2f')][_0xdd52('0x49')]({'where':{'id':_0x334408[_0xdd52('0x53')]['id']}})['then'](handleEntityNotFound(_0x2b7360,null))[_0xdd52('0x29')](saveUpdates(_0x334408[_0xdd52('0x52')],null))[_0xdd52('0x29')](respondWithResult(_0x2b7360,null))['catch'](handleError(_0x2b7360,null));};exports[_0xdd52('0x54')]=function(_0x53d8d2,_0x583bab){var _0x54ddb6=_0x53d8d2[_0xdd52('0x53')]['id'];var _0x209cce=[];return db['sequelize']['transaction'](function(_0x17e194){var _0x42a128=_0xdd52('0x55')+_0x54ddb6;return db[_0xdd52('0x56')]['query'](_0x42a128,{'type':db[_0xdd52('0x57')][_0xdd52('0x58')][_0xdd52('0x59')],'raw':!![],'transaction':_0x17e194})[_0xdd52('0x29')](function(_0x19f126){_0x209cce=_[_0xdd52('0x2e')](_0x19f126,function(_0x2d64f0){return Number(_0x2d64f0[_0xdd52('0x5a')]);});})[_0xdd52('0x29')](function(){var _0x552f0c='SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54ddb6;return db[_0xdd52('0x56')][_0xdd52('0x35')](_0x552f0c,{'type':db[_0xdd52('0x57')][_0xdd52('0x58')][_0xdd52('0x59')],'raw':!![],'transaction':_0x17e194});})['then'](function(_0x5a805c){var _0x13a4b9=_['map'](_0x5a805c,function(_0x74e431){return Number(_0x74e431[_0xdd52('0x5b')]);});return db[_0xdd52('0x5c')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'VoiceQueueId':{'$in':_0x13a4b9}},'transaction':_0x17e194});})[_0xdd52('0x29')](function(){var _0x493304=_0xdd52('0x5d')+_0x54ddb6;return db[_0xdd52('0x56')][_0xdd52('0x35')](_0x493304,{'type':db[_0xdd52('0x57')][_0xdd52('0x58')][_0xdd52('0x59')],'raw':!![],'transaction':_0x17e194});})['then'](function(_0x3defe9){var _0x4fc866=_[_0xdd52('0x2e')](_0x3defe9,function(_0x34edba){return Number(_0x34edba['MailQueueId']);});return db[_0xdd52('0x5e')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'MailQueueId':{'$in':_0x4fc866}},'transaction':_0x17e194});})['then'](function(){var _0x4ea243='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54ddb6;return db[_0xdd52('0x56')][_0xdd52('0x35')](_0x4ea243,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x17e194});})['then'](function(_0x334827){var _0x59e04b=_['map'](_0x334827,function(_0x2a0a7b){return Number(_0x2a0a7b['SmsQueueId']);});return db[_0xdd52('0x5f')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'SmsQueueId':{'$in':_0x59e04b}},'transaction':_0x17e194});})['then'](function(){var _0x4196a4=_0xdd52('0x60')+_0x54ddb6;return db[_0xdd52('0x56')][_0xdd52('0x35')](_0x4196a4,{'type':db[_0xdd52('0x57')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x17e194});})[_0xdd52('0x29')](function(_0x3b6233){var _0x5385ae=_[_0xdd52('0x2e')](_0x3b6233,function(_0x3385f6){return Number(_0x3385f6['ChatQueueId']);});return db[_0xdd52('0x61')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'ChatQueueId':{'$in':_0x5385ae}},'transaction':_0x17e194});})['then'](function(){var _0x1458a5=_0xdd52('0x62')+_0x54ddb6;return db[_0xdd52('0x56')]['query'](_0x1458a5,{'type':db[_0xdd52('0x57')][_0xdd52('0x58')][_0xdd52('0x59')],'raw':!![],'transaction':_0x17e194});})[_0xdd52('0x29')](function(_0x2dbd8f){var _0x31eb28=_[_0xdd52('0x2e')](_0x2dbd8f,function(_0x241160){return Number(_0x241160[_0xdd52('0x63')]);});return db[_0xdd52('0x64')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'FaxQueueId':{'$in':_0x31eb28}},'transaction':_0x17e194});})[_0xdd52('0x29')](function(){var _0x4d0d83='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x54ddb6;return db[_0xdd52('0x56')][_0xdd52('0x35')](_0x4d0d83,{'type':db[_0xdd52('0x57')][_0xdd52('0x58')]['SELECT'],'raw':!![],'transaction':_0x17e194});})['then'](function(_0x25b26c){var _0x34aefd=_['map'](_0x25b26c,function(_0x26c468){return Number(_0x26c468['OpenchannelQueueId']);});return db['UserOpenchannelQueue'][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'OpenchannelQueueId':{'$in':_0x34aefd}},'transaction':_0x17e194});})['then'](function(){var _0x330d37=_0xdd52('0x65')+_0x54ddb6;return db['sequelize']['query'](_0x330d37,{'type':db[_0xdd52('0x57')][_0xdd52('0x58')]['SELECT'],'raw':!![],'transaction':_0x17e194});})[_0xdd52('0x29')](function(_0x568170){var _0x228198=_[_0xdd52('0x2e')](_0x568170,function(_0x1863c2){return Number(_0x1863c2[_0xdd52('0x66')]);});return db[_0xdd52('0x67')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'WhatsappQueueId':{'$in':_0x228198}},'transaction':_0x17e194});})[_0xdd52('0x29')](function(){return db[_0xdd52('0x68')][_0xdd52('0x49')]({'where':{'TeamId':_0x54ddb6}});})['then'](function(_0x245e79){if(_0x245e79===null){return;}return db[_0xdd52('0x69')][_0xdd52('0x54')]({'where':{'UserId':{'$in':_0x209cce},'VoicePrefixId':_0x245e79['VoicePrefixId']},'transaction':_0x17e194});})[_0xdd52('0x29')](function(){return db['Team'][_0xdd52('0x54')]({'where':{'id':_0x54ddb6},'cascade':!![],'transaction':_0x17e194});})[_0xdd52('0x29')](function(_0x35bb85){if(_0x35bb85===0x0){_0x583bab[_0xdd52('0x1d')](0x194);}else{return db[_0xdd52('0x51')][_0xdd52('0x54')]({'where':{'type':_0xdd52('0x6a'),'resourceId':_0x54ddb6},'cascade':!![],'transaction':_0x17e194})[_0xdd52('0x29')](function(){_0x583bab[_0xdd52('0x1e')](0xcc)[_0xdd52('0x1f')]();});}})['catch'](function(_0x548c0b){_0x583bab[_0xdd52('0x1e')](0x1f4)['send'](_0x548c0b);});});};exports['getQueues']=function(_0x171c2b,_0x5bcc9c,_0x1f981e){return db[_0xdd52('0x2f')][_0xdd52('0x6b')]({'where':{'id':_0x171c2b[_0xdd52('0x53')]['id']}})['then'](handleEntityNotFound(_0x5bcc9c,null))[_0xdd52('0x29')](function(_0x2085c9){if(!_0x171c2b[_0xdd52('0x35')][_0xdd52('0x6c')]||!utils[_0xdd52('0x6d')](_0x171c2b[_0xdd52('0x35')][_0xdd52('0x6c')])){throw new db[(_0xdd52('0x57'))]['ValidationError'](_0xdd52('0x6e'));}var _0x57f47f={};var _0x2f052f={};_0x2f052f[_0xdd52('0x34')]=_['keys'](db[_[_0xdd52('0x6f')](_0x171c2b[_0xdd52('0x35')][_0xdd52('0x6c')][_0xdd52('0x70')]())+_0xdd52('0x71')][_0xdd52('0x30')]);_0x2f052f[_0xdd52('0x35')]=_[_0xdd52('0x48')](_0x171c2b[_0xdd52('0x35')]);_0x2f052f[_0xdd52('0x3e')]=_[_0xdd52('0x36')](_0x2f052f['model'],_0x2f052f[_0xdd52('0x35')]);_0x57f47f[_0xdd52('0x37')]=_[_0xdd52('0x36')](_0x2f052f['model'],qs['fields'](_0x171c2b[_0xdd52('0x35')]['fields']));_0x57f47f[_0xdd52('0x37')]=_0x57f47f[_0xdd52('0x37')][_0xdd52('0x72')]?_0x57f47f[_0xdd52('0x37')]:_0x2f052f[_0xdd52('0x34')];_0x57f47f[_0xdd52('0x22')]=qs[_0xdd52('0x22')](_0x171c2b['query'][_0xdd52('0x22')]);_0x57f47f[_0xdd52('0x20')]=qs[_0xdd52('0x20')](_0x171c2b[_0xdd52('0x35')]['offset']);_0x57f47f[_0xdd52('0x3a')]=qs['sort'](_0x171c2b['query'][_0xdd52('0x3b')]);_0x57f47f['where']=qs['filters'](_[_0xdd52('0x3d')](_0x171c2b[_0xdd52('0x35')],_0x2f052f['filters']));_0x57f47f=_['merge']({},_0x57f47f,_0x171c2b[_0xdd52('0x41')]);return _0x2085c9[_0xdd52('0x4e')+_['capitalize'](_0x171c2b['query'][_0xdd52('0x6c')][_0xdd52('0x70')]())+_0xdd52('0x73')](_0x57f47f);})[_0xdd52('0x29')](respondWithResult(_0x5bcc9c,null))[_0xdd52('0x46')](handleError(_0x5bcc9c,null));};exports[_0xdd52('0x74')]=function(_0x4811f9,_0x13e251,_0x135edd){return db['Team'][_0xdd52('0x6b')]({'where':{'id':_0x4811f9[_0xdd52('0x53')]['id']}})[_0xdd52('0x29')](function(_0x4d9da4){if(_0x4d9da4){if(!_0x4811f9[_0xdd52('0x52')][_0xdd52('0x6c')]||!utils[_0xdd52('0x6d')](_0x4811f9[_0xdd52('0x52')][_0xdd52('0x6c')])){throw new db[(_0xdd52('0x57'))][(_0xdd52('0x75'))]('Unknown\x20channel');}return _0x4d9da4[_0xdd52('0x76')+_[_0xdd52('0x6f')](_0x4811f9[_0xdd52('0x52')][_0xdd52('0x6c')][_0xdd52('0x70')]())+_0xdd52('0x73')](_0x4811f9[_0xdd52('0x52')]['ids']);}return null;})[_0xdd52('0x29')](handleEntityNotFound(_0x13e251,null))[_0xdd52('0x29')](respondWithStatusCode(_0x13e251,null))[_0xdd52('0x46')](handleError(_0x13e251,null));};exports[_0xdd52('0x77')]=function(_0x2af837,_0x5f14ea,_0x236571){return db[_0xdd52('0x2f')][_0xdd52('0x6b')]({'where':{'id':_0x2af837['params']['id']}})[_0xdd52('0x29')](function(_0x22e5ff){if(_0x22e5ff){if(!_0x2af837['query'][_0xdd52('0x6c')]||!utils[_0xdd52('0x6d')](_0x2af837[_0xdd52('0x35')][_0xdd52('0x6c')])){throw new db['Sequelize']['ValidationError'](_0xdd52('0x6e'));}return _0x22e5ff[_0xdd52('0x78')+_['capitalize'](_0x2af837[_0xdd52('0x35')][_0xdd52('0x6c')]['toLowerCase']())+_0xdd52('0x73')](_0x2af837[_0xdd52('0x35')]['ids']);}return null;})['then'](handleEntityNotFound(_0x5f14ea,null))[_0xdd52('0x29')](respondWithStatusCode(_0x5f14ea,null))[_0xdd52('0x46')](handleError(_0x5f14ea,null));};exports[_0xdd52('0x79')]=function(_0xfc17af,_0x2b8fad){var _0x494853=_[_0xdd52('0x7a')](_0xfc17af['body'][_0xdd52('0x7b')])?_0xfc17af[_0xdd52('0x52')]['ids']:[_0xfc17af[_0xdd52('0x52')][_0xdd52('0x7b')]];var _0x2b422c=_0xfc17af[_0xdd52('0x53')]['id'];return db[_0xdd52('0x2f')]['find']({'where':{'id':_0x2b422c}})[_0xdd52('0x29')](handleEntityNotFound(_0x2b8fad,null))[_0xdd52('0x29')](function(_0x3744ed){if(_0x3744ed){var _0x596582=[_0xdd52('0x7c'),'Chat','Mail',_0xdd52('0x7d'),'Fax',_0xdd52('0x7e'),_0xdd52('0x7f')];return db[_0xdd52('0x56')]['transaction'](function(_0x2cc66e){var _0x1ca41f=_['map'](_0x596582,function(_0x100e7a){var _0x43b3d2={'attributes':['id','name']};if(_0x100e7a==='Voice'){_0x43b3d2[_0xdd52('0x80')]={'attributes':[_0xdd52('0x81')]};}return _0x3744ed[_0xdd52('0x4e')+_0x100e7a+'Queues'](_0x43b3d2)[_0xdd52('0x29')](function(_0x223e7c){var _0x4a35dd=_[_0xdd52('0x2e')](_0x223e7c,function(_0x24c9b2){var _0x4d674a=_[_0xdd52('0x2e')](_0x494853,function(_0x368071){var _0x33c6b6={'where':{'UserId':_0x368071,[_0x100e7a+'QueueId']:_0x24c9b2['id']},'transaction':_0x2cc66e};if(_0x100e7a===_0xdd52('0x7c')){_0x33c6b6[_0xdd52('0x18')]={'penalty':_0x24c9b2['TeamVoiceQueue'][_0xdd52('0x81')]};}return db[_0xdd52('0x82')+_0x100e7a+_0xdd52('0x71')]['findOrCreate'](_0x33c6b6)[_0xdd52('0x29')](function(){socket[_0xdd52('0x83')](_0xdd52('0x4b')+_0x100e7a+'Queue:save',{'UserId':_0x368071,[_0x100e7a+'QueueId']:_0x24c9b2['id']});if(_0x100e7a!==_0xdd52('0x7c')){return;}return db['User'][_0xdd52('0x44')]({'where':{'id':_0x494853,'online':0x1},'attributes':['id',_0xdd52('0x2b'),_0xdd52('0x84'),_0xdd52('0x85'),_0xdd52('0x86')],'raw':!![]})[_0xdd52('0x29')](function(_0x396246){var _0x9401c=_[_0xdd52('0x2e')](_0x396246,function(_0x2658ac){return db['UserVoiceQueueRt']['upsert']({'membername':_0x2658ac[_0xdd52('0x2b')],'UserId':_0x2658ac['id'],'queue_name':_0x24c9b2['name'],'VoiceQueueId':_0x24c9b2['id'],'interface':_[_0xdd52('0x87')](_0x2658ac[_0xdd52('0x86')])?util[_0xdd52('0x88')](_0xdd52('0x89'),_0x2658ac[_0xdd52('0x2b')]):_0x2658ac[_0xdd52('0x86')],'paused':_0x2658ac[_0xdd52('0x85')]||![],'penalty':_0x24c9b2[_0xdd52('0x8a')]['penalty']},{'transaction':_0x2cc66e});});return Promise[_0xdd52('0x8b')](_0x9401c);});});});return Promise[_0xdd52('0x8b')](_0x4d674a);});return Promise['all'](_0x4a35dd);})[_0xdd52('0x29')](function(){return db['TeamVoicePrefix'][_0xdd52('0x6b')]({'where':{'teamId':_0x2b422c}})[_0xdd52('0x29')](function(_0x552759){if(_0x552759){var _0x19eb7b=_[_0xdd52('0x2e')](_0x494853,function(_0x4d69c7){db['UserVoicePrefix']['upsert']({'UserId':_0x4d69c7,'VoicePrefixId':_0x552759['VoicePrefixId']});});return Promise[_0xdd52('0x8b')](_0x19eb7b);}});});});return Promise[_0xdd52('0x8b')](_0x1ca41f)[_0xdd52('0x29')](function(){return _0x3744ed[_0xdd52('0x79')](_0x494853,{'transaction':_0x2cc66e})[_0xdd52('0x8c')](function(_0x25966c){return _0x25966c;});});});}})[_0xdd52('0x29')](respondWithResult(_0x2b8fad,null))[_0xdd52('0x46')](handleError(_0x2b8fad,null));};exports[_0xdd52('0x8d')]=function(_0x127fc8,_0x6e4c4d){var _0x4eb72e=_[_0xdd52('0x7a')](_0x127fc8[_0xdd52('0x35')]['ids'])?_0x127fc8[_0xdd52('0x35')][_0xdd52('0x7b')]:[_0x127fc8[_0xdd52('0x35')]['ids']];var _0x8691a8=_0x127fc8['params']['id'];return db[_0xdd52('0x2f')][_0xdd52('0x49')]({'where':{'id':_0x8691a8}})[_0xdd52('0x29')](handleEntityNotFound(_0x6e4c4d,null))[_0xdd52('0x29')](function(_0x231359){if(_0x231359){var _0x5bb059=[_0xdd52('0x7c'),_0xdd52('0x8e'),_0xdd52('0x8f'),_0xdd52('0x7d'),'Fax',_0xdd52('0x7e'),_0xdd52('0x7f')];return db[_0xdd52('0x56')][_0xdd52('0x90')](function(_0x45a68b){var _0x4e8c87=_[_0xdd52('0x2e')](_0x5bb059,function(_0x3eb2b0){var _0x3afcc3={'attributes':['id','name']};return _0x231359[_0xdd52('0x4e')+_0x3eb2b0+_0xdd52('0x73')](_0x3afcc3)[_0xdd52('0x29')](function(_0x53f793){var _0x259d81=_[_0xdd52('0x2e')](_0x53f793,function(_0x2ea159){return _0x2ea159[_0xdd52('0x8d')](_0x4eb72e,{'transaction':_0x45a68b})['then'](function(){var _0x3f20be=_[_0xdd52('0x2e')](_0x4eb72e,function(_0x48e24f){socket[_0xdd52('0x83')](_0xdd52('0x4b')+_0x3eb2b0+_0xdd52('0x91'),{'UserId':Number(_0x48e24f),[_0x3eb2b0+_0xdd52('0x92')]:_0x2ea159['id']});if(_0x3eb2b0!==_0xdd52('0x7c')){return;}return db[_0xdd52('0x93')][_0xdd52('0x54')]({'where':{'VoiceQueueId':_0x2ea159['id'],'UserId':_0x48e24f},'transaction':_0x45a68b});});return Promise[_0xdd52('0x8b')](_0x3f20be);});});return Promise['all'](_0x259d81);});});return Promise[_0xdd52('0x8b')](_0x4e8c87)[_0xdd52('0x29')](function(){return _0x231359[_0xdd52('0x8d')](_0x4eb72e,{'transaction':_0x45a68b});})[_0xdd52('0x29')](function(){return db[_0xdd52('0x68')][_0xdd52('0x6b')]({'where':{'teamId':_0x8691a8}})[_0xdd52('0x29')](function(_0x4548dd){if(_0x4548dd){var _0x1edb16=_[_0xdd52('0x2e')](_0x4eb72e,function(_0x327774){db['UserVoicePrefix'][_0xdd52('0x54')]({'where':{'UserId':_0x327774,'VoicePrefixId':_0x4548dd[_0xdd52('0x94')]}});});return Promise[_0xdd52('0x8b')](_0x1edb16);}});});});}})[_0xdd52('0x29')](respondWithStatusCode(_0x6e4c4d,null))[_0xdd52('0x46')](handleError(_0x6e4c4d,null));};exports['getAgents']=function(_0x42764f,_0x40bd77,_0x34e5ce){var _0x61724={};var _0x57bf4d={};var _0x491b0c;var _0x55599f;return db[_0xdd52('0x2f')]['findOne']({'where':{'id':_0x42764f[_0xdd52('0x53')]['id']}})[_0xdd52('0x29')](handleEntityNotFound(_0x40bd77,null))['then'](function(_0xc302b5){if(_0xc302b5){_0x491b0c=_0xc302b5;_0x57bf4d['model']=_[_0xdd52('0x48')](db[_0xdd52('0x82')][_0xdd52('0x30')]);_0x57bf4d[_0xdd52('0x35')]=_['keys'](_0x42764f[_0xdd52('0x35')]);_0x57bf4d[_0xdd52('0x3e')]=_['intersection'](_0x57bf4d[_0xdd52('0x34')],_0x57bf4d[_0xdd52('0x35')]);_0x61724[_0xdd52('0x37')]=_['intersection'](_0x57bf4d[_0xdd52('0x34')],qs[_0xdd52('0x38')](_0x42764f[_0xdd52('0x35')][_0xdd52('0x38')]));_0x61724[_0xdd52('0x37')]=_0x61724[_0xdd52('0x37')][_0xdd52('0x72')]?_0x61724[_0xdd52('0x37')]:_0x57bf4d[_0xdd52('0x34')];_0x61724[_0xdd52('0x3a')]=qs[_0xdd52('0x3b')](_0x42764f[_0xdd52('0x35')]['sort']);_0x61724[_0xdd52('0x3c')]=qs[_0xdd52('0x3e')](_['pick'](_0x42764f[_0xdd52('0x35')],_0x57bf4d[_0xdd52('0x3e')]));if(_0x42764f[_0xdd52('0x35')][_0xdd52('0x3f')]){_0x61724[_0xdd52('0x3c')]=_[_0xdd52('0x40')](_0x61724[_0xdd52('0x3c')],{'$or':_[_0xdd52('0x2e')](_0x61724[_0xdd52('0x37')],function(_0x4c9506){var _0x5af76e={};_0x5af76e[_0x4c9506]={'$like':'%'+_0x42764f[_0xdd52('0x35')][_0xdd52('0x3f')]+'%'};return _0x5af76e;})});}_0x61724=_[_0xdd52('0x40')]({},_0x61724,_0x42764f[_0xdd52('0x41')]);return _0x491b0c[_0xdd52('0x95')](_0x61724);}})[_0xdd52('0x29')](function(_0xa42661){if(_0xa42661){_0x55599f=_0xa42661['length'];if(!_0x42764f[_0xdd52('0x35')]['hasOwnProperty'](_0xdd52('0x39'))){_0x61724[_0xdd52('0x22')]=qs['limit'](_0x42764f[_0xdd52('0x35')][_0xdd52('0x22')]);_0x61724[_0xdd52('0x20')]=qs[_0xdd52('0x20')](_0x42764f[_0xdd52('0x35')]['offset']);}return _0x491b0c[_0xdd52('0x95')](_0x61724);}})[_0xdd52('0x29')](function(_0x401ad7){if(_0x401ad7){return _0x401ad7?{'count':_0x55599f,'rows':_0x401ad7}:null;}})[_0xdd52('0x29')](respondWithResult(_0x40bd77,null))[_0xdd52('0x46')](handleError(_0x40bd77,null));}; \ No newline at end of file +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 diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 7efd7d9..e5c5958 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 _0x0e4a=['Team','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x450253,_0x14caa1){var _0x404757=function(_0x50ecbc){while(--_0x50ecbc){_0x450253['push'](_0x450253['shift']());}};_0x404757(++_0x14caa1);}(_0x0e4a,0x68));var _0xa0e4=function(_0x55453b,_0x411296){_0x55453b=_0x55453b-0x0;var _0x401d5e=_0x0e4a[_0x55453b];return _0x401d5e;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xa0e4('0x0')];var TeamEvents=new EventEmitter();TeamEvents[_0xa0e4('0x1')](0x0);var events={'afterCreate':_0xa0e4('0x2'),'afterUpdate':_0xa0e4('0x3'),'afterDestroy':'remove'};function emitEvent(_0x580bfc){return function(_0x56df85,_0xa43151,_0x42060b){TeamEvents[_0xa0e4('0x4')](_0x580bfc+':'+_0x56df85['id'],_0x56df85);TeamEvents[_0xa0e4('0x4')](_0x580bfc,_0x56df85);_0x42060b(null);};}for(var e in events){if(events[_0xa0e4('0x5')](e)){var event=events[e];Team[_0xa0e4('0x6')](e,emitEvent(event));}}module[_0xa0e4('0x7')]=TeamEvents; \ No newline at end of file +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 diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 7df4c76..ce32389 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 _0x50f6=['moment','bluebird','path','./team.attributes','define','Team','teams','lodash','util','../../config/logger','api'];(function(_0x559d6c,_0x414e87){var _0x26bc6a=function(_0x58bf7a){while(--_0x58bf7a){_0x559d6c['push'](_0x559d6c['shift']());}};_0x26bc6a(++_0x414e87);}(_0x50f6,0x1d5));var _0x650f=function(_0x4da7f8,_0x5d836d){_0x4da7f8=_0x4da7f8-0x0;var _0x4968d0=_0x50f6[_0x4da7f8];return _0x4968d0;};'use strict';var _=require(_0x650f('0x0'));var util=require(_0x650f('0x1'));var logger=require(_0x650f('0x2'))(_0x650f('0x3'));var moment=require(_0x650f('0x4'));var BPromise=require(_0x650f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x650f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x650f('0x7'));module['exports']=function(_0x25de98,_0x403e37){return _0x25de98[_0x650f('0x8')](_0x650f('0x9'),attributes,{'tableName':_0x650f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 4685f45..87762a1 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 _0xb666=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x3f0b6b,_0xa82aec){var _0x2dd09c=function(_0x99f2b3){while(--_0x99f2b3){_0x3f0b6b['push'](_0x3f0b6b['shift']());}};_0x2dd09c(++_0xa82aec);}(_0xb666,0x1e3));var _0x6b66=function(_0x4b85a3,_0x55a93f){_0x4b85a3=_0x4b85a3-0x0;var _0xcf8bc7=_0xb666[_0x4b85a3];return _0xcf8bc7;};'use strict';var _=require(_0x6b66('0x0'));var util=require(_0x6b66('0x1'));var moment=require(_0x6b66('0x2'));var BPromise=require(_0x6b66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6b66('0x4'))['db'];var utils=require(_0x6b66('0x5'));var logger=require(_0x6b66('0x6'))(_0x6b66('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x6b66('0x8')]({'port':0x232a});config[_0x6b66('0x9')]=_['defaults'](config[_0x6b66('0x9')],{'host':_0x6b66('0xa'),'port':0x18eb});var socket=require(_0x6b66('0xb'))(new Redis(config['redis']));require(_0x6b66('0xc'))[_0x6b66('0xd')](socket);function respondWithRpcPromise(_0x4b97c,_0x28519f,_0x1566c9){return new BPromise(function(_0x45221f,_0x4a0ec4){return client[_0x6b66('0xe')](_0x4b97c,_0x1566c9)[_0x6b66('0xf')](function(_0x407cf0){logger[_0x6b66('0x10')](_0x6b66('0x11'),_0x28519f,_0x6b66('0x12'));logger[_0x6b66('0x13')](_0x6b66('0x14'),_0x28519f,_0x6b66('0x12'),JSON[_0x6b66('0x15')](_0x407cf0));if(_0x407cf0[_0x6b66('0x16')]){if(_0x407cf0[_0x6b66('0x16')][_0x6b66('0x17')]===0x1f4){logger['error'](_0x6b66('0x11'),_0x28519f,_0x407cf0[_0x6b66('0x16')]['message']);return _0x4a0ec4(_0x407cf0[_0x6b66('0x16')][_0x6b66('0x18')]);}logger[_0x6b66('0x16')](_0x6b66('0x11'),_0x28519f,_0x407cf0[_0x6b66('0x16')]['message']);return _0x45221f(_0x407cf0[_0x6b66('0x16')][_0x6b66('0x18')]);}else{logger[_0x6b66('0x10')](_0x6b66('0x11'),_0x28519f,'request\x20sent');_0x45221f(_0x407cf0[_0x6b66('0x19')][_0x6b66('0x18')]);}})[_0x6b66('0x1a')](function(_0x3a6a8a){logger[_0x6b66('0x16')](_0x6b66('0x11'),_0x28519f,_0x3a6a8a);_0x4a0ec4(_0x3a6a8a);});});} \ No newline at end of file +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 diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 6aae092..a6c518d 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 _0xb47f=['register','length','team:','./team.events','save','remove','update','removeListener'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb47f,0x15b));var _0xfb47=function(_0x5d5aaa,_0xf816eb){_0x5d5aaa=_0x5d5aaa-0x0;var _0xe4b7e=_0xb47f[_0x5d5aaa];return _0xe4b7e;};'use strict';var TeamEvents=require(_0xfb47('0x0'));var events=[_0xfb47('0x1'),_0xfb47('0x2'),_0xfb47('0x3')];function createListener(_0x3f845f,_0x50fa89){return function(_0x1ff42e){_0x50fa89['emit'](_0x3f845f,_0x1ff42e);};}function removeListener(_0x4418cd,_0x1da5dc){return function(){TeamEvents[_0xfb47('0x4')](_0x4418cd,_0x1da5dc);};}exports[_0xfb47('0x5')]=function(_0x2d9e64){for(var _0x4a505a=0x0,_0x2de8dd=events[_0xfb47('0x6')];_0x4a505a<_0x2de8dd;_0x4a505a++){var _0xdaf71d=events[_0x4a505a];var _0x6f108e=createListener(_0xfb47('0x7')+_0xdaf71d,_0x2d9e64);TeamEvents['on'](_0xdaf71d,_0x6f108e);}}; \ No newline at end of file +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 diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index dd37c37..c825022 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 _0xa581=['sequelize','exports','INTEGER'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0xa581,0x90));var _0x1a58=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa581[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1a58('0x0'));module[_0x1a58('0x1')]={'TeamId':{'type':Sequelize[_0x1a58('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x1a58('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 47ec16d..6276fcc 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 _0x0102=['api','moment','./teamVoicePrefix.attributes','exports','TeamVoicePrefix','util','../../config/logger'];(function(_0x242a4f,_0x369c57){var _0x122117=function(_0x55a797){while(--_0x55a797){_0x242a4f['push'](_0x242a4f['shift']());}};_0x122117(++_0x369c57);}(_0x0102,0x186));var _0x2010=function(_0x5ea77c,_0x1b9979){_0x5ea77c=_0x5ea77c-0x0;var _0x8272cc=_0x0102[_0x5ea77c];return _0x8272cc;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var logger=require(_0x2010('0x1'))(_0x2010('0x2'));var moment=require(_0x2010('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2010('0x4'));module[_0x2010('0x5')]=function(_0x130725,_0x304264){return _0x130725['define'](_0x2010('0x6'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b478647..531852d 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x14edef,_0x48f83d){var _0x2c9f5d=function(_0x37f262){while(--_0x37f262){_0x14edef['push'](_0x14edef['shift']());}};_0x2c9f5d(++_0x48f83d);}(_0xedd9,0xfc));var _0x9edd=function(_0xa94cee,_0x6c7963){_0xa94cee=_0xa94cee-0x0;var _0x42bad3=_0xedd9[_0xa94cee];return _0x42bad3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _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 diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 269bd33..26029ea 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 _0xc534=['exports','INTEGER'];(function(_0x469e9d,_0x4cc2ff){var _0x4cbac9=function(_0x43428f){while(--_0x43428f){_0x469e9d['push'](_0x469e9d['shift']());}};_0x4cbac9(++_0x4cc2ff);}(_0xc534,0x1ca));var _0x4c53=function(_0x41b4df,_0x15b067){_0x41b4df=_0x41b4df-0x0;var _0x55d4dc=_0xc534[_0x41b4df];return _0x55d4dc;};'use strict';var Sequelize=require('sequelize');module[_0x4c53('0x0')]={'penalty':{'type':Sequelize[_0x4c53('0x1')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 9f2ca4a..0b670df 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 _0xd737=['moment','bluebird','request-promise','../../config/environment','define','TeamVoiceQueue','team_has_voice_queues','lodash','../../config/logger'];(function(_0x2a4211,_0x5ab8aa){var _0x2fad41=function(_0x3a5d44){while(--_0x3a5d44){_0x2a4211['push'](_0x2a4211['shift']());}};_0x2fad41(++_0x5ab8aa);}(_0xd737,0x85));var _0x7d73=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xd737[_0x277af0];return _0x43bd7c;};'use strict';var _=require(_0x7d73('0x0'));var util=require('util');var logger=require(_0x7d73('0x1'))('api');var moment=require(_0x7d73('0x2'));var BPromise=require(_0x7d73('0x3'));var rp=require(_0x7d73('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7d73('0x5'));var attributes=require('./teamVoiceQueue.attributes');module['exports']=function(_0xaa37cc,_0x20b8a9){return _0xaa37cc[_0x7d73('0x6')](_0x7d73('0x7'),attributes,{'tableName':_0x7d73('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index bd040e4..c66a0fe 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 _0x9990=['error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x361dbf,_0x2de1e1){var _0x175b2d=function(_0x4ffe6b){while(--_0x4ffe6b){_0x361dbf['push'](_0x361dbf['shift']());}};_0x175b2d(++_0x2de1e1);}(_0x9990,0xf6));var _0x0999=function(_0x3c2e4e,_0x357207){_0x3c2e4e=_0x3c2e4e-0x0;var _0x773c58=_0x9990[_0x3c2e4e];return _0x773c58;};'use strict';var _=require('lodash');var util=require(_0x0999('0x0'));var moment=require(_0x0999('0x1'));var BPromise=require(_0x0999('0x2'));var rs=require(_0x0999('0x3'));var fs=require('fs');var Redis=require(_0x0999('0x4'));var db=require(_0x0999('0x5'))['db'];var utils=require(_0x0999('0x6'));var logger=require(_0x0999('0x7'))('rpc');var config=require(_0x0999('0x8'));var jayson=require(_0x0999('0x9'));var client=jayson[_0x0999('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a6f23,_0xb1d8f9,_0x3fe805){return new BPromise(function(_0x304f75,_0x384a4e){return client[_0x0999('0xb')](_0x1a6f23,_0x3fe805)[_0x0999('0xc')](function(_0x52d196){logger[_0x0999('0xd')](_0x0999('0xe'),_0xb1d8f9,_0x0999('0xf'));logger['debug'](_0x0999('0x10'),_0xb1d8f9,_0x0999('0xf'),JSON[_0x0999('0x11')](_0x52d196));if(_0x52d196['error']){if(_0x52d196[_0x0999('0x12')]['code']===0x1f4){logger[_0x0999('0x12')](_0x0999('0xe'),_0xb1d8f9,_0x52d196[_0x0999('0x12')][_0x0999('0x13')]);return _0x384a4e(_0x52d196[_0x0999('0x12')]['message']);}logger[_0x0999('0x12')](_0x0999('0xe'),_0xb1d8f9,_0x52d196[_0x0999('0x12')][_0x0999('0x13')]);return _0x304f75(_0x52d196[_0x0999('0x12')]['message']);}else{logger[_0x0999('0xd')](_0x0999('0xe'),_0xb1d8f9,_0x0999('0xf'));_0x304f75(_0x52d196[_0x0999('0x14')][_0x0999('0x13')]);}})[_0x0999('0x15')](function(_0x2fa43e){logger['error'](_0x0999('0xe'),_0xb1d8f9,_0x2fa43e);_0x384a4e(_0x2fa43e);});});} \ No newline at end of file +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 diff --git a/server/api/template/index.js b/server/api/template/index.js index 2dfb88a..5909c91 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 _0x199d=['../../config/environment','./template.controller','isAuthenticated','index','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service'];(function(_0x506a61,_0x5155ee){var _0x2c5b08=function(_0x110856){while(--_0x110856){_0x506a61['push'](_0x506a61['shift']());}};_0x2c5b08(++_0x5155ee);}(_0x199d,0x13d));var _0xd199=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x199d[_0x380307];return _0x9ea14b;};'use strict';var multer=require(_0xd199('0x0'));var util=require(_0xd199('0x1'));var path=require(_0xd199('0x2'));var timeout=require(_0xd199('0x3'));var express=require(_0xd199('0x4'));var router=express['Router']();var fs_extra=require(_0xd199('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd199('0x6'));var config=require(_0xd199('0x7'));var controller=require(_0xd199('0x8'));router['get']('/',auth[_0xd199('0x9')](),controller[_0xd199('0xa')]);router['get'](_0xd199('0xb'),auth[_0xd199('0x9')](),controller[_0xd199('0xc')]);router['post']('/',auth[_0xd199('0x9')](),controller[_0xd199('0xd')]);router[_0xd199('0xe')]('/:id',auth[_0xd199('0x9')](),controller[_0xd199('0xf')]);router['delete'](_0xd199('0xb'),auth['isAuthenticated'](),controller[_0xd199('0x10')]);module[_0xd199('0x11')]=router; \ No newline at end of file +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 diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index f3c6636..30d1b1b 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 _0x742c=['STRING','TEXT','sequelize','exports'];(function(_0x2c30e7,_0x4f1454){var _0xd48134=function(_0x331a37){while(--_0x331a37){_0x2c30e7['push'](_0x2c30e7['shift']());}};_0xd48134(++_0x4f1454);}(_0x742c,0x9e));var _0xc742=function(_0x2c7b86,_0x59ef3c){_0x2c7b86=_0x2c7b86-0x0;var _0x256735=_0x742c[_0x2c7b86];return _0x256735;};'use strict';var Sequelize=require(_0xc742('0x0'));module[_0xc742('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc742('0x2')]},'html':{'type':Sequelize[_0xc742('0x3')]}}; \ No newline at end of file +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 diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index dea32f5..8d2c20d 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 _0x6415=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','Templates','UserProfileResource','error','name','send','index','map','Template','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','findAll','catch','show','params','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf'];(function(_0x10d21b,_0x290ea4){var _0x460f5a=function(_0x365ab0){while(--_0x365ab0){_0x10d21b['push'](_0x10d21b['shift']());}};_0x460f5a(++_0x290ea4);}(_0x6415,0x13a));var _0x5641=function(_0x407c86,_0x1d853e){_0x407c86=_0x407c86-0x0;var _0x310b62=_0x6415[_0x407c86];return _0x310b62;};'use strict';var emlformat=require(_0x5641('0x0'));var rimraf=require(_0x5641('0x1'));var zipdir=require(_0x5641('0x2'));var jsonpatch=require(_0x5641('0x3'));var rp=require(_0x5641('0x4'));var moment=require('moment');var BPromise=require(_0x5641('0x5'));var Mustache=require('mustache');var util=require(_0x5641('0x6'));var path=require(_0x5641('0x7'));var sox=require('sox');var csv=require(_0x5641('0x8'));var ejs=require(_0x5641('0x9'));var fs=require('fs');var fs_extra=require(_0x5641('0xa'));var _=require('lodash');var squel=require(_0x5641('0xb'));var crypto=require(_0x5641('0xc'));var jsforce=require(_0x5641('0xd'));var deskjs=require(_0x5641('0xe'));var toCsv=require(_0x5641('0x8'));var querystring=require('querystring');var Papa=require(_0x5641('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5641('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5641('0x11'));var logger=require('../../config/logger')(_0x5641('0x12'));var utils=require(_0x5641('0x13'));var config=require(_0x5641('0x14'));var licenseUtil=require(_0x5641('0x15'));var db=require(_0x5641('0x16'))['db'];function respondWithStatusCode(_0x674a0c,_0xbaf4b2){_0xbaf4b2=_0xbaf4b2||0xcc;return function(_0x213e11){if(_0x213e11){return _0x674a0c[_0x5641('0x17')](_0xbaf4b2);}return _0x674a0c[_0x5641('0x18')](_0xbaf4b2)[_0x5641('0x19')]();};}function respondWithResult(_0x5abb3e,_0x3bc120){_0x3bc120=_0x3bc120||0xc8;return function(_0xe3a18){if(_0xe3a18){return _0x5abb3e[_0x5641('0x18')](_0x3bc120)[_0x5641('0x1a')](_0xe3a18);}};}function respondWithFilteredResult(_0x2a7b05,_0x17e310){return function(_0x255cd6){if(_0x255cd6){var _0x712a12=typeof _0x17e310[_0x5641('0x1b')]==='undefined'&&typeof _0x17e310['limit']===_0x5641('0x1c');var _0x212113=_0x255cd6[_0x5641('0x1d')];var _0x4f2deb=_0x712a12?0x0:_0x17e310[_0x5641('0x1b')];var _0x20dc99=_0x712a12?_0x255cd6[_0x5641('0x1d')]:_0x17e310[_0x5641('0x1b')]+_0x17e310[_0x5641('0x1e')];var _0x5091a9;if(_0x20dc99>=_0x212113){_0x20dc99=_0x212113;_0x5091a9=0xc8;}else{_0x5091a9=0xce;}_0x2a7b05['status'](_0x5091a9);return _0x2a7b05[_0x5641('0x1f')]('Content-Range',_0x4f2deb+'-'+_0x20dc99+'/'+_0x212113)[_0x5641('0x1a')](_0x255cd6);}return null;};}function patchUpdates(_0xb43c1e){return function(_0x23ddd4){try{jsonpatch[_0x5641('0x20')](_0x23ddd4,_0xb43c1e,!![]);}catch(_0x647da8){return BPromise['reject'](_0x647da8);}return _0x23ddd4[_0x5641('0x21')]();};}function saveUpdates(_0x5140d7,_0x46ee38){return function(_0xb435c){if(_0xb435c){return _0xb435c[_0x5641('0x22')](_0x5140d7)[_0x5641('0x23')](function(_0x1d53ff){return _0x1d53ff;});}return null;};}function removeEntity(_0x23e7b9,_0x3ded96){return function(_0x51e15a){if(_0x51e15a){return _0x51e15a[_0x5641('0x24')]()['then'](function(){var _0x417904=_0x51e15a[_0x5641('0x25')]({'plain':!![]});var _0x4eaf01=_0x5641('0x26');return db[_0x5641('0x27')][_0x5641('0x24')]({'where':{'type':_0x4eaf01,'resourceId':_0x417904['id']}})['then'](function(){return _0x51e15a;});})[_0x5641('0x23')](function(){_0x23e7b9[_0x5641('0x18')](0xcc)[_0x5641('0x19')]();});}};}function handleEntityNotFound(_0xcfd0d6,_0x5363a2){return function(_0x170f89){if(!_0x170f89){_0xcfd0d6['sendStatus'](0x194);}return _0x170f89;};}function handleError(_0x3b3f6b,_0x2c09a0){_0x2c09a0=_0x2c09a0||0x1f4;return function(_0x1b4fcb){logger[_0x5641('0x28')](_0x1b4fcb['stack']);if(_0x1b4fcb['name']){delete _0x1b4fcb[_0x5641('0x29')];}_0x3b3f6b[_0x5641('0x18')](_0x2c09a0)[_0x5641('0x2a')](_0x1b4fcb);};}exports[_0x5641('0x2b')]=function(_0x935aad,_0x1101f3){var _0x2aea04={},_0x436617={},_0x2376fb={'count':0x0,'rows':[]};var _0x1d69e7=_[_0x5641('0x2c')](db[_0x5641('0x2d')][_0x5641('0x2e')],function(_0x2dcfc9){return{'name':_0x2dcfc9[_0x5641('0x2f')],'type':_0x2dcfc9['type'][_0x5641('0x30')]};});_0x436617[_0x5641('0x31')]=_[_0x5641('0x2c')](_0x1d69e7,_0x5641('0x29'));_0x436617[_0x5641('0x32')]=_[_0x5641('0x33')](_0x935aad['query']);_0x436617[_0x5641('0x34')]=_[_0x5641('0x35')](_0x436617['model'],_0x436617['query']);_0x2aea04[_0x5641('0x36')]=_[_0x5641('0x35')](_0x436617['model'],qs[_0x5641('0x37')](_0x935aad[_0x5641('0x32')][_0x5641('0x37')]));_0x2aea04[_0x5641('0x36')]=_0x2aea04['attributes'][_0x5641('0x38')]?_0x2aea04['attributes']:_0x436617[_0x5641('0x31')];if(!_0x935aad['query'][_0x5641('0x39')](_0x5641('0x3a'))){_0x2aea04['limit']=qs[_0x5641('0x1e')](_0x935aad[_0x5641('0x32')][_0x5641('0x1e')]);_0x2aea04[_0x5641('0x1b')]=qs[_0x5641('0x1b')](_0x935aad['query'][_0x5641('0x1b')]);}_0x2aea04[_0x5641('0x3b')]=qs[_0x5641('0x3c')](_0x935aad[_0x5641('0x32')][_0x5641('0x3c')]);_0x2aea04[_0x5641('0x3d')]=qs[_0x5641('0x34')](_['pick'](_0x935aad[_0x5641('0x32')],_0x436617[_0x5641('0x34')]),_0x1d69e7);if(_0x935aad[_0x5641('0x32')][_0x5641('0x3e')]){_0x2aea04[_0x5641('0x3d')]=_[_0x5641('0x3f')](_0x2aea04[_0x5641('0x3d')],{'$or':_['map'](_0x1d69e7,function(_0x71e4f0){if(_0x71e4f0['type']!=='VIRTUAL'){var _0x31aa58={};_0x31aa58[_0x71e4f0[_0x5641('0x29')]]={'$like':'%'+_0x935aad['query'][_0x5641('0x3e')]+'%'};return _0x31aa58;}})});}_0x2aea04=_[_0x5641('0x3f')]({},_0x2aea04,_0x935aad[_0x5641('0x40')]);var _0x43fc9a={'where':_0x2aea04[_0x5641('0x3d')]};return db['Template']['count'](_0x43fc9a)[_0x5641('0x23')](function(_0x131f0d){_0x2376fb[_0x5641('0x1d')]=_0x131f0d;if(_0x935aad['query'][_0x5641('0x41')]){_0x2aea04['include']=[{'all':!![]}];}return db['Template'][_0x5641('0x42')](_0x2aea04);})[_0x5641('0x23')](function(_0x3c9776){_0x2376fb['rows']=_0x3c9776;return _0x2376fb;})['then'](respondWithFilteredResult(_0x1101f3,_0x2aea04))[_0x5641('0x43')](handleError(_0x1101f3,null));};exports[_0x5641('0x44')]=function(_0x532509,_0x3ce32f){var _0x17db92={'raw':!![],'where':{'id':_0x532509[_0x5641('0x45')]['id']}},_0x2d0d1d={};_0x2d0d1d['model']=_[_0x5641('0x33')](db['Template'][_0x5641('0x2e')]);_0x2d0d1d[_0x5641('0x32')]=_['keys'](_0x532509['query']);_0x2d0d1d[_0x5641('0x34')]=_['intersection'](_0x2d0d1d[_0x5641('0x31')],_0x2d0d1d[_0x5641('0x32')]);_0x17db92[_0x5641('0x36')]=_[_0x5641('0x35')](_0x2d0d1d[_0x5641('0x31')],qs['fields'](_0x532509[_0x5641('0x32')][_0x5641('0x37')]));_0x17db92[_0x5641('0x36')]=_0x17db92[_0x5641('0x36')][_0x5641('0x38')]?_0x17db92['attributes']:_0x2d0d1d['model'];if(_0x532509['query'][_0x5641('0x41')]){_0x17db92['include']=[{'all':!![]}];}_0x17db92=_[_0x5641('0x3f')]({},_0x17db92,_0x532509[_0x5641('0x40')]);return db['Template']['find'](_0x17db92)['then'](handleEntityNotFound(_0x3ce32f,null))['then'](respondWithResult(_0x3ce32f,null))['catch'](handleError(_0x3ce32f,null));};exports['create']=function(_0x59f571,_0xd7e6b1){return db[_0x5641('0x2d')]['create'](_0x59f571[_0x5641('0x46')],{})[_0x5641('0x23')](function(_0x19f503){var _0x51e794=_0x59f571[_0x5641('0x47')]['get']({'plain':!![]});if(!_0x51e794)throw new Error(_0x5641('0x48'));if(_0x51e794[_0x5641('0x49')]==='user'){var _0x1b8ec3=_0x19f503['get']({'plain':!![]});var _0x184ffa=_0x5641('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x184ffa,'userProfileId':_0x51e794[_0x5641('0x4a')]},'raw':!![]})[_0x5641('0x23')](function(_0x35d9d6){if(_0x35d9d6&&_0x35d9d6[_0x5641('0x4b')]===0x0){return db['UserProfileResource'][_0x5641('0x4c')]({'name':_0x1b8ec3[_0x5641('0x29')],'resourceId':_0x1b8ec3['id'],'type':_0x35d9d6[_0x5641('0x29')],'sectionId':_0x35d9d6['id']},{})['then'](function(){return _0x19f503;});}else{return _0x19f503;}})[_0x5641('0x43')](function(_0x219e29){logger[_0x5641('0x28')](_0x5641('0x4d'),_0x219e29);throw _0x219e29;});}return _0x19f503;})[_0x5641('0x23')](respondWithResult(_0xd7e6b1,0xc9))['catch'](handleError(_0xd7e6b1,null));};exports[_0x5641('0x22')]=function(_0x2e2787,_0x1c039f){if(_0x2e2787[_0x5641('0x46')]['id']){delete _0x2e2787[_0x5641('0x46')]['id'];}return db[_0x5641('0x2d')][_0x5641('0x4e')]({'where':{'id':_0x2e2787[_0x5641('0x45')]['id']}})[_0x5641('0x23')](handleEntityNotFound(_0x1c039f,null))[_0x5641('0x23')](saveUpdates(_0x2e2787[_0x5641('0x46')],null))['then'](respondWithResult(_0x1c039f,null))['catch'](handleError(_0x1c039f,null));};exports[_0x5641('0x24')]=function(_0x5e7618,_0x5e7cd2){return db[_0x5641('0x2d')]['find']({'where':{'id':_0x5e7618[_0x5641('0x45')]['id']}})[_0x5641('0x23')](handleEntityNotFound(_0x5e7cd2,null))['then'](removeEntity(_0x5e7cd2,null))[_0x5641('0x43')](handleError(_0x5e7cd2,null));}; \ No newline at end of file +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 diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 05032f3..b798f3d 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 _0x78aa=['tools_templates','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./template.attributes','exports','Template'];(function(_0xf35eed,_0x2e0b97){var _0x532dcc=function(_0x4c56a9){while(--_0x4c56a9){_0xf35eed['push'](_0xf35eed['shift']());}};_0x532dcc(++_0x2e0b97);}(_0x78aa,0x6d));var _0xa78a=function(_0x379ba9,_0x50959f){_0x379ba9=_0x379ba9-0x0;var _0x5a80f1=_0x78aa[_0x379ba9];return _0x5a80f1;};'use strict';var _=require('lodash');var util=require(_0xa78a('0x0'));var logger=require(_0xa78a('0x1'))(_0xa78a('0x2'));var moment=require(_0xa78a('0x3'));var BPromise=require(_0xa78a('0x4'));var rp=require(_0xa78a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa78a('0x6'));var config=require(_0xa78a('0x7'));var attributes=require(_0xa78a('0x8'));module[_0xa78a('0x9')]=function(_0x43d7ad,_0x4122f5){return _0x43d7ad['define'](_0xa78a('0xa'),attributes,{'tableName':_0xa78a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 52dc39b..5c5d0fe 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 _0xce6c=['debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','Template,\x20%s,\x20%s','result','catch','GetTemplate','findAll','raw','options','attributes','limit','include','map','model','stringify','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0xce6c,0x12a));var _0xcce6=function(_0x408941,_0x3847b){_0x408941=_0x408941-0x0;var _0x170360=_0xce6c[_0x408941];return _0x170360;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xcce6('0x0'));var fs=require('fs');var Redis=require(_0xcce6('0x1'));var db=require(_0xcce6('0x2'))['db'];var utils=require(_0xcce6('0x3'));var logger=require(_0xcce6('0x4'))(_0xcce6('0x5'));var config=require(_0xcce6('0x6'));var jayson=require(_0xcce6('0x7'));var client=jayson['client'][_0xcce6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d94e9,_0x261b3f,_0x43ed32){return new BPromise(function(_0x2cebcb,_0xee6245){return client['request'](_0x3d94e9,_0x43ed32)['then'](function(_0x195ee6){logger[_0xcce6('0x9')]('Template,\x20%s,\x20%s',_0x261b3f,'request\x20sent');logger[_0xcce6('0xa')](_0xcce6('0xb'),_0x261b3f,_0xcce6('0xc'),JSON['stringify'](_0x195ee6));if(_0x195ee6[_0xcce6('0xd')]){if(_0x195ee6[_0xcce6('0xd')]['code']===0x1f4){logger[_0xcce6('0xd')]('Template,\x20%s,\x20%s',_0x261b3f,_0x195ee6[_0xcce6('0xd')][_0xcce6('0xe')]);return _0xee6245(_0x195ee6['error']['message']);}logger[_0xcce6('0xd')](_0xcce6('0xf'),_0x261b3f,_0x195ee6['error'][_0xcce6('0xe')]);return _0x2cebcb(_0x195ee6['error'][_0xcce6('0xe')]);}else{logger[_0xcce6('0x9')](_0xcce6('0xf'),_0x261b3f,_0xcce6('0xc'));_0x2cebcb(_0x195ee6[_0xcce6('0x10')][_0xcce6('0xe')]);}})[_0xcce6('0x11')](function(_0x185257){logger['error']('Template,\x20%s,\x20%s',_0x261b3f,_0x185257);_0xee6245(_0x185257);});});}exports[_0xcce6('0x12')]=function(_0x3cde85){var _0x4be15f=this;return new Promise(function(_0xee281f,_0x461168){return db['Template'][_0xcce6('0x13')]({'raw':_0x3cde85['options']?_0x3cde85['options'][_0xcce6('0x14')]===undefined?!![]:![]:!![],'where':_0x3cde85[_0xcce6('0x15')]?_0x3cde85[_0xcce6('0x15')]['where']||null:null,'attributes':_0x3cde85['options']?_0x3cde85[_0xcce6('0x15')][_0xcce6('0x16')]||null:null,'limit':_0x3cde85[_0xcce6('0x15')]?_0x3cde85[_0xcce6('0x15')][_0xcce6('0x17')]||null:null,'include':_0x3cde85['options']?_0x3cde85[_0xcce6('0x15')][_0xcce6('0x18')]?_[_0xcce6('0x19')](_0x3cde85[_0xcce6('0x15')][_0xcce6('0x18')],function(_0x389177){return{'model':db[_0x389177['model']],'as':_0x389177['as'],'attributes':_0x389177[_0xcce6('0x16')],'include':_0x389177[_0xcce6('0x18')]?_[_0xcce6('0x19')](_0x389177[_0xcce6('0x18')],function(_0x1ea533){return{'model':db[_0x1ea533[_0xcce6('0x1a')]],'as':_0x1ea533['as'],'attributes':_0x1ea533['attributes'],'include':_0x1ea533[_0xcce6('0x18')]?_['map'](_0x1ea533[_0xcce6('0x18')],function(_0x7f6bc5){return{'model':db[_0x7f6bc5[_0xcce6('0x1a')]],'as':_0x7f6bc5['as'],'attributes':_0x7f6bc5['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x18e10a){logger['info'](_0xcce6('0x12'),_0x3cde85);logger[_0xcce6('0xa')](_0xcce6('0x12'),_0x3cde85,JSON[_0xcce6('0x1b')](_0x18e10a));_0xee281f(_0x18e10a);})[_0xcce6('0x11')](function(_0xaafb48){logger[_0xcce6('0xd')]('GetTemplate',_0xaafb48[_0xcce6('0xe')],_0x3cde85);_0x461168(_0x4be15f[_0xcce6('0xd')](0x1f4,_0xaafb48[_0xcce6('0xe')]));});});}; \ No newline at end of file +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 diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 64c3a31..caf0c46 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 _0x0cdd=['util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/:id','/:id/all_conditions','getAllConditions','getAnyConditions','/:id/actions','getActions','create','post','addAllCondition','/:id/any_conditions','addAction','put','update','destroy','multer'];(function(_0x3ae04e,_0x34920c){var _0x5c0fcd=function(_0x42b5dc){while(--_0x42b5dc){_0x3ae04e['push'](_0x3ae04e['shift']());}};_0x5c0fcd(++_0x34920c);}(_0x0cdd,0x158));var _0xd0cd=function(_0x18718,_0x39e8c1){_0x18718=_0x18718-0x0;var _0x17ff6c=_0x0cdd[_0x18718];return _0x17ff6c;};'use strict';var multer=require(_0xd0cd('0x0'));var util=require(_0xd0cd('0x1'));var path=require(_0xd0cd('0x2'));var timeout=require(_0xd0cd('0x3'));var express=require(_0xd0cd('0x4'));var router=express[_0xd0cd('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd0cd('0x6'));var controller=require('./trigger.controller');router[_0xd0cd('0x7')]('/',auth[_0xd0cd('0x8')](),controller['index']);router[_0xd0cd('0x7')](_0xd0cd('0x9'),auth[_0xd0cd('0x8')](),controller['show']);router[_0xd0cd('0x7')](_0xd0cd('0xa'),auth[_0xd0cd('0x8')](),controller[_0xd0cd('0xb')]);router[_0xd0cd('0x7')]('/:id/any_conditions',auth[_0xd0cd('0x8')](),controller[_0xd0cd('0xc')]);router['get'](_0xd0cd('0xd'),auth[_0xd0cd('0x8')](),controller[_0xd0cd('0xe')]);router['post']('/',auth[_0xd0cd('0x8')](),controller[_0xd0cd('0xf')]);router[_0xd0cd('0x10')]('/:id/all_conditions',auth[_0xd0cd('0x8')](),controller[_0xd0cd('0x11')]);router[_0xd0cd('0x10')](_0xd0cd('0x12'),auth['isAuthenticated'](),controller['addAnyCondition']);router[_0xd0cd('0x10')]('/:id/actions',auth[_0xd0cd('0x8')](),controller[_0xd0cd('0x13')]);router[_0xd0cd('0x14')](_0xd0cd('0x9'),auth['isAuthenticated'](),controller[_0xd0cd('0x15')]);router['delete'](_0xd0cd('0x9'),auth[_0xd0cd('0x8')](),controller[_0xd0cd('0x16')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ba5d64e..fa17aff 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 _0x21cd=['STRING','sequelize','exports'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x21cd,0x14b));var _0xd21c=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x21cd[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xd21c('0x0'));module[_0xd21c('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd21c('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 2caf829..7d62a1c 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 _0x7da9=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','filter','type','options','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','addAnyCondition','TriggerAnyId','findOne','sort','getAllConditions','getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','Triggers','UserProfileResource','destroy','end','stack','name','index','map','Trigger','fieldName','key','model','query','keys'];(function(_0x4a75dd,_0x54105e){var _0x3f1f74=function(_0x4ae3ce){while(--_0x4ae3ce){_0x4a75dd['push'](_0x4a75dd['shift']());}};_0x3f1f74(++_0x54105e);}(_0x7da9,0xef));var _0x97da=function(_0x303a3f,_0x36b6e8){_0x303a3f=_0x303a3f-0x0;var _0xccc83f=_0x7da9[_0x303a3f];return _0xccc83f;};'use strict';var emlformat=require(_0x97da('0x0'));var rimraf=require(_0x97da('0x1'));var zipdir=require(_0x97da('0x2'));var jsonpatch=require(_0x97da('0x3'));var rp=require(_0x97da('0x4'));var moment=require(_0x97da('0x5'));var BPromise=require(_0x97da('0x6'));var Mustache=require(_0x97da('0x7'));var util=require(_0x97da('0x8'));var path=require(_0x97da('0x9'));var sox=require(_0x97da('0xa'));var csv=require(_0x97da('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x97da('0xc'));var _=require(_0x97da('0xd'));var squel=require(_0x97da('0xe'));var crypto=require(_0x97da('0xf'));var jsforce=require(_0x97da('0x10'));var deskjs=require(_0x97da('0x11'));var toCsv=require(_0x97da('0xb'));var querystring=require(_0x97da('0x12'));var Papa=require('papaparse');var Redis=require(_0x97da('0x13'));var authService=require(_0x97da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x97da('0x15'));var hardwareService=require(_0x97da('0x16'));var logger=require(_0x97da('0x17'))(_0x97da('0x18'));var utils=require('../../config/utils');var config=require(_0x97da('0x19'));var licenseUtil=require(_0x97da('0x1a'));var db=require(_0x97da('0x1b'))['db'];function respondWithStatusCode(_0x212e92,_0x1dc462){_0x1dc462=_0x1dc462||0xcc;return function(_0x511680){if(_0x511680){return _0x212e92[_0x97da('0x1c')](_0x1dc462);}return _0x212e92['status'](_0x1dc462)['end']();};}function respondWithResult(_0x1ec4bf,_0x32f602){_0x32f602=_0x32f602||0xc8;return function(_0x15ba55){if(_0x15ba55){return _0x1ec4bf[_0x97da('0x1d')](_0x32f602)['json'](_0x15ba55);}};}function respondWithFilteredResult(_0xde63,_0x41848a){return function(_0x294e13){if(_0x294e13){var _0x407b4d=typeof _0x41848a[_0x97da('0x1e')]==='undefined'&&typeof _0x41848a[_0x97da('0x1f')]===_0x97da('0x20');var _0x39cb76=_0x294e13[_0x97da('0x21')];var _0x247f89=_0x407b4d?0x0:_0x41848a[_0x97da('0x1e')];var _0xd8b44f=_0x407b4d?_0x294e13['count']:_0x41848a[_0x97da('0x1e')]+_0x41848a['limit'];var _0x244344;if(_0xd8b44f>=_0x39cb76){_0xd8b44f=_0x39cb76;_0x244344=0xc8;}else{_0x244344=0xce;}_0xde63[_0x97da('0x1d')](_0x244344);return _0xde63[_0x97da('0x22')](_0x97da('0x23'),_0x247f89+'-'+_0xd8b44f+'/'+_0x39cb76)[_0x97da('0x24')](_0x294e13);}return null;};}function patchUpdates(_0x5bd6fd){return function(_0x156c7d){try{jsonpatch[_0x97da('0x25')](_0x156c7d,_0x5bd6fd,!![]);}catch(_0x49a225){return BPromise[_0x97da('0x26')](_0x49a225);}return _0x156c7d['save']();};}function saveUpdates(_0x28e6d7,_0x5628f0){return function(_0x23500e){if(_0x23500e){return _0x23500e[_0x97da('0x27')](_0x28e6d7)[_0x97da('0x28')](function(_0x4f122b){return _0x4f122b;});}return null;};}function removeEntity(_0x2a2501,_0x869529){return function(_0x1af60d){if(_0x1af60d){return _0x1af60d['destroy']()[_0x97da('0x28')](function(){var _0x3147f5=_0x1af60d['get']({'plain':!![]});var _0xb9f3c7=_0x97da('0x29');return db[_0x97da('0x2a')][_0x97da('0x2b')]({'where':{'type':_0xb9f3c7,'resourceId':_0x3147f5['id']}})[_0x97da('0x28')](function(){return _0x1af60d;});})[_0x97da('0x28')](function(){_0x2a2501['status'](0xcc)[_0x97da('0x2c')]();});}};}function handleEntityNotFound(_0x43b996,_0x255584){return function(_0x5dab38){if(!_0x5dab38){_0x43b996['sendStatus'](0x194);}return _0x5dab38;};}function handleError(_0x305591,_0x31c973){_0x31c973=_0x31c973||0x1f4;return function(_0x10ad42){logger['error'](_0x10ad42[_0x97da('0x2d')]);if(_0x10ad42[_0x97da('0x2e')]){delete _0x10ad42[_0x97da('0x2e')];}_0x305591[_0x97da('0x1d')](_0x31c973)['send'](_0x10ad42);};}exports[_0x97da('0x2f')]=function(_0x600626,_0x26855a){var _0x543249={},_0x39134c={},_0x3483b1={'count':0x0,'rows':[]};var _0x3ce336=_[_0x97da('0x30')](db[_0x97da('0x31')]['rawAttributes'],function(_0x4d4018){return{'name':_0x4d4018[_0x97da('0x32')],'type':_0x4d4018['type'][_0x97da('0x33')]};});_0x39134c[_0x97da('0x34')]=_[_0x97da('0x30')](_0x3ce336,'name');_0x39134c[_0x97da('0x35')]=_[_0x97da('0x36')](_0x600626['query']);_0x39134c[_0x97da('0x37')]=_[_0x97da('0x38')](_0x39134c['model'],_0x39134c[_0x97da('0x35')]);_0x543249['attributes']=_[_0x97da('0x38')](_0x39134c['model'],qs[_0x97da('0x39')](_0x600626[_0x97da('0x35')][_0x97da('0x39')]));_0x543249['attributes']=_0x543249[_0x97da('0x3a')][_0x97da('0x3b')]?_0x543249['attributes']:_0x39134c[_0x97da('0x34')];if(!_0x600626[_0x97da('0x35')][_0x97da('0x3c')](_0x97da('0x3d'))){_0x543249[_0x97da('0x1f')]=qs[_0x97da('0x1f')](_0x600626[_0x97da('0x35')]['limit']);_0x543249[_0x97da('0x1e')]=qs[_0x97da('0x1e')](_0x600626[_0x97da('0x35')]['offset']);}_0x543249[_0x97da('0x3e')]=qs['sort'](_0x600626[_0x97da('0x35')]['sort']);_0x543249[_0x97da('0x3f')]=qs[_0x97da('0x37')](_[_0x97da('0x40')](_0x600626['query'],_0x39134c[_0x97da('0x37')]),_0x3ce336);if(_0x600626['query'][_0x97da('0x41')]){_0x543249[_0x97da('0x3f')]=_['merge'](_0x543249[_0x97da('0x3f')],{'$or':_[_0x97da('0x30')](_0x3ce336,function(_0x1fb643){if(_0x1fb643[_0x97da('0x42')]!=='VIRTUAL'){var _0x1c1570={};_0x1c1570[_0x1fb643[_0x97da('0x2e')]]={'$like':'%'+_0x600626['query'][_0x97da('0x41')]+'%'};return _0x1c1570;}})});}_0x543249=_['merge']({},_0x543249,_0x600626[_0x97da('0x43')]);var _0x28a1a8={'where':_0x543249[_0x97da('0x3f')]};return db['Trigger'][_0x97da('0x21')](_0x28a1a8)[_0x97da('0x28')](function(_0x34bdc1){_0x3483b1[_0x97da('0x21')]=_0x34bdc1;if(_0x600626[_0x97da('0x35')]['includeAll']){_0x543249[_0x97da('0x44')]=[{'all':!![]}];}return db[_0x97da('0x31')][_0x97da('0x45')](_0x543249);})['then'](function(_0x4299f4){_0x3483b1[_0x97da('0x46')]=_0x4299f4;return _0x3483b1;})['then'](respondWithFilteredResult(_0x26855a,_0x543249))[_0x97da('0x47')](handleError(_0x26855a,null));};exports[_0x97da('0x48')]=function(_0x106dd3,_0x327c63){var _0xc8301e={'raw':![],'where':{'id':_0x106dd3[_0x97da('0x49')]['id']}},_0xc5cf29={};_0xc5cf29[_0x97da('0x34')]=_[_0x97da('0x36')](db[_0x97da('0x31')][_0x97da('0x4a')]);_0xc5cf29[_0x97da('0x35')]=_[_0x97da('0x36')](_0x106dd3[_0x97da('0x35')]);_0xc5cf29[_0x97da('0x37')]=_[_0x97da('0x38')](_0xc5cf29[_0x97da('0x34')],_0xc5cf29[_0x97da('0x35')]);_0xc8301e[_0x97da('0x3a')]=_['intersection'](_0xc5cf29['model'],qs[_0x97da('0x39')](_0x106dd3[_0x97da('0x35')]['fields']));_0xc8301e['attributes']=_0xc8301e[_0x97da('0x3a')][_0x97da('0x3b')]?_0xc8301e[_0x97da('0x3a')]:_0xc5cf29[_0x97da('0x34')];if(_0x106dd3[_0x97da('0x35')]['includeAll']){_0xc8301e['include']=[{'all':!![]}];}_0xc8301e=_[_0x97da('0x4b')]({},_0xc8301e,_0x106dd3[_0x97da('0x43')]);return db['Trigger'][_0x97da('0x4c')](_0xc8301e)[_0x97da('0x28')](handleEntityNotFound(_0x327c63,null))['then'](respondWithResult(_0x327c63,null))[_0x97da('0x47')](handleError(_0x327c63,null));};exports[_0x97da('0x4d')]=function(_0x3715a6,_0xd6da66){return db[_0x97da('0x31')]['create'](_0x3715a6[_0x97da('0x4e')],{})[_0x97da('0x28')](function(_0x42eeb2){var _0x223f6c=_0x3715a6[_0x97da('0x4f')]['get']({'plain':!![]});if(!_0x223f6c)throw new Error(_0x97da('0x50'));if(_0x223f6c[_0x97da('0x51')]==='user'){var _0x2fa4e2=_0x42eeb2[_0x97da('0x52')]({'plain':!![]});var _0x3e9faf=_0x97da('0x29');return db[_0x97da('0x53')][_0x97da('0x4c')]({'where':{'name':_0x3e9faf,'userProfileId':_0x223f6c['userProfileId']},'raw':!![]})[_0x97da('0x28')](function(_0x1f7615){if(_0x1f7615&&_0x1f7615['autoAssociation']===0x0){return db[_0x97da('0x2a')]['create']({'name':_0x2fa4e2[_0x97da('0x2e')],'resourceId':_0x2fa4e2['id'],'type':_0x1f7615['name'],'sectionId':_0x1f7615['id']},{})[_0x97da('0x28')](function(){return _0x42eeb2;});}else{return _0x42eeb2;}})[_0x97da('0x47')](function(_0x377622){logger[_0x97da('0x54')](_0x97da('0x55'),_0x377622);throw _0x377622;});}return _0x42eeb2;})[_0x97da('0x28')](respondWithResult(_0xd6da66,0xc9))[_0x97da('0x47')](handleError(_0xd6da66,null));};exports[_0x97da('0x27')]=function(_0x32a3af,_0x9820c8){if(_0x32a3af[_0x97da('0x4e')]['id']){delete _0x32a3af[_0x97da('0x4e')]['id'];}return db[_0x97da('0x31')]['find']({'where':{'id':_0x32a3af[_0x97da('0x49')]['id']}})[_0x97da('0x28')](handleEntityNotFound(_0x9820c8,null))[_0x97da('0x28')](saveUpdates(_0x32a3af[_0x97da('0x4e')],null))[_0x97da('0x28')](respondWithResult(_0x9820c8,null))[_0x97da('0x47')](handleError(_0x9820c8,null));};exports['destroy']=function(_0x4f2ef1,_0x413bba){return db['Trigger'][_0x97da('0x4c')]({'where':{'id':_0x4f2ef1[_0x97da('0x49')]['id']}})['then'](handleEntityNotFound(_0x413bba,null))[_0x97da('0x28')](removeEntity(_0x413bba,null))['catch'](handleError(_0x413bba,null));};exports[_0x97da('0x56')]=function(_0x3e994f,_0x3e37af,_0x574ca2){if(_0x3e994f[_0x97da('0x4e')]['id']){delete _0x3e994f[_0x97da('0x4e')]['id'];}return db['Trigger'][_0x97da('0x4c')]({'where':{'id':_0x3e994f[_0x97da('0x49')]['id']}})[_0x97da('0x28')](handleEntityNotFound(_0x3e37af,null))[_0x97da('0x28')](function(_0x48c914){if(_0x48c914){_0x3e994f[_0x97da('0x4e')][_0x97da('0x57')]=_0x48c914['id'];return db[_0x97da('0x58')][_0x97da('0x4d')](_0x3e994f[_0x97da('0x4e')]);}})[_0x97da('0x28')](respondWithResult(_0x3e37af,null))[_0x97da('0x47')](handleError(_0x3e37af,null));};exports[_0x97da('0x59')]=function(_0x42c94d,_0x4afc27,_0x35f7a9){if(_0x42c94d[_0x97da('0x4e')]['id']){delete _0x42c94d[_0x97da('0x4e')]['id'];}return db['Trigger'][_0x97da('0x4c')]({'where':{'id':_0x42c94d[_0x97da('0x49')]['id']}})[_0x97da('0x28')](handleEntityNotFound(_0x4afc27,null))[_0x97da('0x28')](function(_0x2bf968){if(_0x2bf968){_0x42c94d[_0x97da('0x4e')][_0x97da('0x5a')]=_0x2bf968['id'];return db['Condition'][_0x97da('0x4d')](_0x42c94d[_0x97da('0x4e')]);}})[_0x97da('0x28')](respondWithResult(_0x4afc27,null))[_0x97da('0x47')](handleError(_0x4afc27,null));};exports['getAllConditions']=function(_0x51a0dc,_0x3a34b4,_0x2b9323){var _0x43c21e={};var _0x4591bf={};var _0x4cc704;var _0x12e62e;return db[_0x97da('0x31')][_0x97da('0x5b')]({'where':{'id':_0x51a0dc[_0x97da('0x49')]['id']}})['then'](handleEntityNotFound(_0x3a34b4,null))[_0x97da('0x28')](function(_0x3ab852){if(_0x3ab852){_0x4cc704=_0x3ab852;_0x4591bf[_0x97da('0x34')]=_['keys'](db['Condition'][_0x97da('0x4a')]);_0x4591bf[_0x97da('0x35')]=_[_0x97da('0x36')](_0x51a0dc[_0x97da('0x35')]);_0x4591bf['filters']=_['intersection'](_0x4591bf[_0x97da('0x34')],_0x4591bf[_0x97da('0x35')]);_0x43c21e['attributes']=_[_0x97da('0x38')](_0x4591bf['model'],qs[_0x97da('0x39')](_0x51a0dc[_0x97da('0x35')][_0x97da('0x39')]));_0x43c21e[_0x97da('0x3a')]=_0x43c21e[_0x97da('0x3a')][_0x97da('0x3b')]?_0x43c21e['attributes']:_0x4591bf[_0x97da('0x34')];_0x43c21e[_0x97da('0x3e')]=qs[_0x97da('0x5c')](_0x51a0dc[_0x97da('0x35')]['sort']);_0x43c21e[_0x97da('0x3f')]=qs['filters'](_[_0x97da('0x40')](_0x51a0dc[_0x97da('0x35')],_0x4591bf[_0x97da('0x37')]));if(_0x51a0dc['query'][_0x97da('0x41')]){_0x43c21e[_0x97da('0x3f')]=_[_0x97da('0x4b')](_0x43c21e[_0x97da('0x3f')],{'$or':_['map'](_0x43c21e[_0x97da('0x3a')],function(_0x128eca){var _0x1b7971={};_0x1b7971[_0x128eca]={'$like':'%'+_0x51a0dc[_0x97da('0x35')][_0x97da('0x41')]+'%'};return _0x1b7971;})});}_0x43c21e=_['merge']({},_0x43c21e,_0x51a0dc[_0x97da('0x43')]);return _0x4cc704[_0x97da('0x5d')](_0x43c21e);}})[_0x97da('0x28')](function(_0x40e39f){if(_0x40e39f){_0x12e62e=_0x40e39f['length'];if(!_0x51a0dc[_0x97da('0x35')][_0x97da('0x3c')](_0x97da('0x3d'))){_0x43c21e[_0x97da('0x1f')]=qs['limit'](_0x51a0dc['query'][_0x97da('0x1f')]);_0x43c21e['offset']=qs[_0x97da('0x1e')](_0x51a0dc[_0x97da('0x35')]['offset']);}return _0x4cc704[_0x97da('0x5d')](_0x43c21e);}})[_0x97da('0x28')](function(_0x1612ac){if(_0x1612ac){return _0x1612ac?{'count':_0x12e62e,'rows':_0x1612ac}:null;}})[_0x97da('0x28')](respondWithResult(_0x3a34b4,null))[_0x97da('0x47')](handleError(_0x3a34b4,null));};exports[_0x97da('0x5e')]=function(_0x9e202d,_0x106e42,_0x1c756b){var _0x8ccc89={};var _0x3b1c18={};var _0x19a578;var _0xff3fa3;return db['Trigger'][_0x97da('0x5b')]({'where':{'id':_0x9e202d[_0x97da('0x49')]['id']}})['then'](handleEntityNotFound(_0x106e42,null))[_0x97da('0x28')](function(_0xdd7886){if(_0xdd7886){_0x19a578=_0xdd7886;_0x3b1c18[_0x97da('0x34')]=_[_0x97da('0x36')](db[_0x97da('0x58')]['rawAttributes']);_0x3b1c18[_0x97da('0x35')]=_[_0x97da('0x36')](_0x9e202d['query']);_0x3b1c18[_0x97da('0x37')]=_['intersection'](_0x3b1c18[_0x97da('0x34')],_0x3b1c18[_0x97da('0x35')]);_0x8ccc89[_0x97da('0x3a')]=_['intersection'](_0x3b1c18['model'],qs['fields'](_0x9e202d[_0x97da('0x35')]['fields']));_0x8ccc89[_0x97da('0x3a')]=_0x8ccc89[_0x97da('0x3a')][_0x97da('0x3b')]?_0x8ccc89[_0x97da('0x3a')]:_0x3b1c18[_0x97da('0x34')];_0x8ccc89[_0x97da('0x3e')]=qs[_0x97da('0x5c')](_0x9e202d[_0x97da('0x35')]['sort']);_0x8ccc89[_0x97da('0x3f')]=qs[_0x97da('0x37')](_[_0x97da('0x40')](_0x9e202d['query'],_0x3b1c18['filters']));if(_0x9e202d['query']['filter']){_0x8ccc89['where']=_[_0x97da('0x4b')](_0x8ccc89[_0x97da('0x3f')],{'$or':_[_0x97da('0x30')](_0x8ccc89[_0x97da('0x3a')],function(_0x5aeef6){var _0x5ec24f={};_0x5ec24f[_0x5aeef6]={'$like':'%'+_0x9e202d[_0x97da('0x35')]['filter']+'%'};return _0x5ec24f;})});}_0x8ccc89=_['merge']({},_0x8ccc89,_0x9e202d['options']);return _0x19a578[_0x97da('0x5e')](_0x8ccc89);}})[_0x97da('0x28')](function(_0x144038){if(_0x144038){_0xff3fa3=_0x144038[_0x97da('0x3b')];if(!_0x9e202d['query'][_0x97da('0x3c')](_0x97da('0x3d'))){_0x8ccc89[_0x97da('0x1f')]=qs[_0x97da('0x1f')](_0x9e202d[_0x97da('0x35')][_0x97da('0x1f')]);_0x8ccc89[_0x97da('0x1e')]=qs[_0x97da('0x1e')](_0x9e202d[_0x97da('0x35')][_0x97da('0x1e')]);}return _0x19a578[_0x97da('0x5e')](_0x8ccc89);}})[_0x97da('0x28')](function(_0x58cf07){if(_0x58cf07){return _0x58cf07?{'count':_0xff3fa3,'rows':_0x58cf07}:null;}})[_0x97da('0x28')](respondWithResult(_0x106e42,null))['catch'](handleError(_0x106e42,null));};exports[_0x97da('0x5f')]=function(_0x2cd76c,_0x11b69a,_0x2d4a15){if(_0x2cd76c[_0x97da('0x4e')]['id']){delete _0x2cd76c['body']['id'];}return db[_0x97da('0x31')][_0x97da('0x4c')]({'where':{'id':_0x2cd76c['params']['id']}})[_0x97da('0x28')](handleEntityNotFound(_0x11b69a,null))[_0x97da('0x28')](function(_0x4857d1){if(_0x4857d1){_0x2cd76c[_0x97da('0x4e')]['TriggerId']=_0x4857d1['id'];return db[_0x97da('0x60')][_0x97da('0x4d')](_0x2cd76c['body']);}})[_0x97da('0x28')](respondWithResult(_0x11b69a,null))[_0x97da('0x47')](handleError(_0x11b69a,null));};exports[_0x97da('0x61')]=function(_0x446b6b,_0x41b728,_0x11753b){var _0x16fcd6={};var _0x813305={};var _0x512088;var _0x4ed1a5;return db[_0x97da('0x31')][_0x97da('0x5b')]({'where':{'id':_0x446b6b[_0x97da('0x49')]['id']}})['then'](handleEntityNotFound(_0x41b728,null))[_0x97da('0x28')](function(_0x3338bd){if(_0x3338bd){_0x512088=_0x3338bd;_0x813305[_0x97da('0x34')]=_[_0x97da('0x36')](db[_0x97da('0x60')][_0x97da('0x4a')]);_0x813305[_0x97da('0x35')]=_[_0x97da('0x36')](_0x446b6b['query']);_0x813305[_0x97da('0x37')]=_['intersection'](_0x813305[_0x97da('0x34')],_0x813305[_0x97da('0x35')]);_0x16fcd6[_0x97da('0x3a')]=_['intersection'](_0x813305[_0x97da('0x34')],qs['fields'](_0x446b6b[_0x97da('0x35')]['fields']));_0x16fcd6['attributes']=_0x16fcd6['attributes'][_0x97da('0x3b')]?_0x16fcd6[_0x97da('0x3a')]:_0x813305['model'];_0x16fcd6['order']=qs[_0x97da('0x5c')](_0x446b6b['query']['sort']);_0x16fcd6['where']=qs[_0x97da('0x37')](_[_0x97da('0x40')](_0x446b6b[_0x97da('0x35')],_0x813305[_0x97da('0x37')]));if(_0x446b6b[_0x97da('0x35')][_0x97da('0x41')]){_0x16fcd6[_0x97da('0x3f')]=_[_0x97da('0x4b')](_0x16fcd6[_0x97da('0x3f')],{'$or':_[_0x97da('0x30')](_0x16fcd6['attributes'],function(_0x25ab9a){var _0x4fbe3c={};_0x4fbe3c[_0x25ab9a]={'$like':'%'+_0x446b6b[_0x97da('0x35')]['filter']+'%'};return _0x4fbe3c;})});}_0x16fcd6=_['merge']({},_0x16fcd6,_0x446b6b[_0x97da('0x43')]);return _0x512088[_0x97da('0x61')](_0x16fcd6);}})[_0x97da('0x28')](function(_0x35d78d){if(_0x35d78d){_0x4ed1a5=_0x35d78d[_0x97da('0x3b')];if(!_0x446b6b['query'][_0x97da('0x3c')](_0x97da('0x3d'))){_0x16fcd6[_0x97da('0x1f')]=qs[_0x97da('0x1f')](_0x446b6b[_0x97da('0x35')][_0x97da('0x1f')]);_0x16fcd6[_0x97da('0x1e')]=qs[_0x97da('0x1e')](_0x446b6b['query'][_0x97da('0x1e')]);}return _0x512088['getActions'](_0x16fcd6);}})[_0x97da('0x28')](function(_0x235aeb){if(_0x235aeb){return _0x235aeb?{'count':_0x4ed1a5,'rows':_0x235aeb}:null;}})[_0x97da('0x28')](respondWithResult(_0x41b728,null))[_0x97da('0x47')](handleError(_0x41b728,null));}; \ No newline at end of file +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 diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 056575a..cad15f9 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 _0xf7f3=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x2a4eec,_0x16bc0b){var _0x22c80e=function(_0x50286e){while(--_0x50286e){_0x2a4eec['push'](_0x2a4eec['shift']());}};_0x22c80e(++_0x16bc0b);}(_0xf7f3,0x12a));var _0x3f7f=function(_0x289799,_0x41d5a8){_0x289799=_0x289799-0x0;var _0x39a88e=_0xf7f3[_0x289799];return _0x39a88e;};'use strict';var _=require(_0x3f7f('0x0'));var util=require(_0x3f7f('0x1'));var logger=require(_0x3f7f('0x2'))(_0x3f7f('0x3'));var moment=require(_0x3f7f('0x4'));var BPromise=require(_0x3f7f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f7f('0x6'));var config=require(_0x3f7f('0x7'));var attributes=require('./trigger.attributes');module[_0x3f7f('0x8')]=function(_0x4876e8,_0x2198f7){return _0x4876e8[_0x3f7f('0x9')]('Trigger',attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index c703165..2718006 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 _0x8cb4=['request','then','Trigger,\x20%s,\x20%s','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','limit','include','model','attributes','map','debug','ShowTrigger','find','where','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x7bbab4,_0xd306ec){var _0x19e00b=function(_0x72bd0){while(--_0x72bd0){_0x7bbab4['push'](_0x7bbab4['shift']());}};_0x19e00b(++_0xd306ec);}(_0x8cb4,0xae));var _0x48cb=function(_0x332e8d,_0x3a66fa){_0x332e8d=_0x332e8d-0x0;var _0x32560b=_0x8cb4[_0x332e8d];return _0x32560b;};'use strict';var _=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var moment=require(_0x48cb('0x2'));var BPromise=require(_0x48cb('0x3'));var rs=require(_0x48cb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x48cb('0x5'));var logger=require(_0x48cb('0x6'))(_0x48cb('0x7'));var config=require('../../config/environment');var jayson=require(_0x48cb('0x8'));var client=jayson[_0x48cb('0x9')][_0x48cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ddf2d,_0x21b945,_0x6c0240){return new BPromise(function(_0x5ec1e3,_0x216e41){return client[_0x48cb('0xb')](_0x1ddf2d,_0x6c0240)[_0x48cb('0xc')](function(_0x59afd0){logger['info'](_0x48cb('0xd'),_0x21b945,'request\x20sent');logger['debug'](_0x48cb('0xe'),_0x21b945,_0x48cb('0xf'),JSON[_0x48cb('0x10')](_0x59afd0));if(_0x59afd0['error']){if(_0x59afd0[_0x48cb('0x11')][_0x48cb('0x12')]===0x1f4){logger[_0x48cb('0x11')]('Trigger,\x20%s,\x20%s',_0x21b945,_0x59afd0[_0x48cb('0x11')][_0x48cb('0x13')]);return _0x216e41(_0x59afd0['error'][_0x48cb('0x13')]);}logger[_0x48cb('0x11')](_0x48cb('0xd'),_0x21b945,_0x59afd0['error'][_0x48cb('0x13')]);return _0x5ec1e3(_0x59afd0[_0x48cb('0x11')][_0x48cb('0x13')]);}else{logger[_0x48cb('0x14')]('Trigger,\x20%s,\x20%s',_0x21b945,_0x48cb('0xf'));_0x5ec1e3(_0x59afd0[_0x48cb('0x15')]['message']);}})[_0x48cb('0x16')](function(_0x42b8ea){logger[_0x48cb('0x11')](_0x48cb('0xd'),_0x21b945,_0x42b8ea);_0x216e41(_0x42b8ea);});});}exports[_0x48cb('0x17')]=function(_0xe10e43){var _0x2e8188=this;return new Promise(function(_0x2ee397,_0x2abd1d){return db[_0x48cb('0x18')][_0x48cb('0x19')]({'raw':_0xe10e43[_0x48cb('0x1a')]?_0xe10e43['options'][_0x48cb('0x1b')]===undefined?!![]:![]:!![],'where':_0xe10e43[_0x48cb('0x1a')]?_0xe10e43['options']['where']||null:null,'attributes':_0xe10e43['options']?_0xe10e43[_0x48cb('0x1a')]['attributes']||null:null,'limit':_0xe10e43['options']?_0xe10e43['options'][_0x48cb('0x1c')]||null:null,'include':_0xe10e43[_0x48cb('0x1a')]?_0xe10e43[_0x48cb('0x1a')][_0x48cb('0x1d')]?_['map'](_0xe10e43[_0x48cb('0x1a')]['include'],function(_0xf466f1){return{'model':db[_0xf466f1[_0x48cb('0x1e')]],'as':_0xf466f1['as'],'attributes':_0xf466f1[_0x48cb('0x1f')],'include':_0xf466f1['include']?_[_0x48cb('0x20')](_0xf466f1['include'],function(_0x3a2cd9){return{'model':db[_0x3a2cd9[_0x48cb('0x1e')]],'as':_0x3a2cd9['as'],'attributes':_0x3a2cd9[_0x48cb('0x1f')],'include':_0x3a2cd9[_0x48cb('0x1d')]?_['map'](_0x3a2cd9['include'],function(_0x29433b){return{'model':db[_0x29433b[_0x48cb('0x1e')]],'as':_0x29433b['as'],'attributes':_0x29433b[_0x48cb('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d2e97){logger[_0x48cb('0x14')](_0x48cb('0x17'),_0xe10e43);logger[_0x48cb('0x21')](_0x48cb('0x17'),_0xe10e43,JSON[_0x48cb('0x10')](_0x4d2e97));_0x2ee397(_0x4d2e97);})[_0x48cb('0x16')](function(_0x2f9dfb){logger['error'](_0x48cb('0x17'),_0x2f9dfb[_0x48cb('0x13')],_0xe10e43);_0x2abd1d(_0x2e8188[_0x48cb('0x11')](0x1f4,_0x2f9dfb[_0x48cb('0x13')]));});});};exports[_0x48cb('0x22')]=function(_0x1529d5){var _0x3269b6=this;return new Promise(function(_0xaa9188,_0x3ae8c6){return db[_0x48cb('0x18')][_0x48cb('0x23')]({'raw':_0x1529d5['options']?_0x1529d5[_0x48cb('0x1a')][_0x48cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x1529d5[_0x48cb('0x1a')]?_0x1529d5[_0x48cb('0x1a')][_0x48cb('0x24')]||null:null,'attributes':_0x1529d5['options']?_0x1529d5['options'][_0x48cb('0x1f')]||null:null,'include':_0x1529d5[_0x48cb('0x1a')]?_0x1529d5[_0x48cb('0x1a')][_0x48cb('0x1d')]?_[_0x48cb('0x20')](_0x1529d5['options'][_0x48cb('0x1d')],function(_0x337484){return{'model':db[_0x337484[_0x48cb('0x1e')]],'as':_0x337484['as'],'attributes':_0x337484[_0x48cb('0x1f')],'include':_0x337484[_0x48cb('0x1d')]?_[_0x48cb('0x20')](_0x337484[_0x48cb('0x1d')],function(_0x3d5768){return{'model':db[_0x3d5768[_0x48cb('0x1e')]],'as':_0x3d5768['as'],'attributes':_0x3d5768[_0x48cb('0x1f')],'include':_0x3d5768[_0x48cb('0x1d')]?_['map'](_0x3d5768[_0x48cb('0x1d')],function(_0x4a797c){return{'model':db[_0x4a797c[_0x48cb('0x1e')]],'as':_0x4a797c['as'],'attributes':_0x4a797c[_0x48cb('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x48cb('0xc')](function(_0x11c67d){logger[_0x48cb('0x14')](_0x48cb('0x22'),_0x1529d5);logger[_0x48cb('0x21')](_0x48cb('0x22'),_0x1529d5,JSON['stringify'](_0x11c67d));_0xaa9188(_0x11c67d);})[_0x48cb('0x16')](function(_0x4eec10){logger['error'](_0x48cb('0x22'),_0x4eec10[_0x48cb('0x13')],_0x1529d5);_0x3ae8c6(_0x3269b6['error'](0x1f4,_0x4eec10[_0x48cb('0x13')]));});});}; \ No newline at end of file +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 diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d62d5d5..6c52a25 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 _0x13d4=['../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','clone','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x2dacff,_0x8b871a){var _0x33e0e8=function(_0x5ed839){while(--_0x5ed839){_0x2dacff['push'](_0x2dacff['shift']());}};_0x33e0e8(++_0x8b871a);}(_0x13d4,0x192));var _0x413d=function(_0x2b3921,_0x5b8ac8){_0x2b3921=_0x2b3921-0x0;var _0x272cba=_0x13d4[_0x2b3921];return _0x272cba;};'use strict';var multer=require('multer');var util=require(_0x413d('0x0'));var path=require(_0x413d('0x1'));var timeout=require(_0x413d('0x2'));var express=require('express');var router=express[_0x413d('0x3')]();var fs_extra=require(_0x413d('0x4'));var auth=require(_0x413d('0x5'));var interaction=require(_0x413d('0x6'));var config=require(_0x413d('0x7'));var controller=require('./trunk.controller');router[_0x413d('0x8')]('/',auth[_0x413d('0x9')](),controller['index']);router['get'](_0x413d('0xa'),auth['isAuthenticated'](),controller[_0x413d('0xb')]);router[_0x413d('0xc')]('/:id/clone',auth[_0x413d('0x9')](),controller[_0x413d('0xd')]);router[_0x413d('0xc')]('/',auth[_0x413d('0x9')](),controller['create']);router['put'](_0x413d('0xa'),auth[_0x413d('0x9')](),controller[_0x413d('0xe')]);router[_0x413d('0xf')](_0x413d('0xa'),auth[_0x413d('0x9')](),controller['destroy']);module[_0x413d('0x10')]=router; \ No newline at end of file +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 diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index c61f696..c45fd67 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 _0x3adf=['active','passive','BOOLEAN','exports','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','auto','rfc2833','yes','update','outgoing','nat','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','\x22\x22\x20<>','always','accept','originate','uac','uas','pai','fingerprint','certificate'];(function(_0x42c285,_0x4be1c2){var _0x5129e6=function(_0x160e13){while(--_0x160e13){_0x42c285['push'](_0x42c285['shift']());}};_0x5129e6(++_0x4be1c2);}(_0x3adf,0x1b3));var _0xf3ad=function(_0x4a60c2,_0x285d27){_0x4a60c2=_0x4a60c2-0x0;var _0x32a906=_0x3adf[_0x4a60c2];return _0x32a906;};'use strict';var Sequelize=require('sequelize');module[_0xf3ad('0x0')]={'name':{'type':Sequelize[_0xf3ad('0x1')],'allowNull':![],'unique':_0xf3ad('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x4'),_0xf3ad('0x5'),_0xf3ad('0x6')),'allowNull':![],'defaultValue':_0xf3ad('0x4')},'context':{'type':Sequelize[_0xf3ad('0x1')],'allowNull':![],'defaultValue':_0xf3ad('0x7')},'callingpres':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x8'),_0xf3ad('0x9'),_0xf3ad('0xa'),_0xf3ad('0xb'),_0xf3ad('0xc'),'PROHIB_PASSED_SCREEN',_0xf3ad('0xd'),_0xf3ad('0xe'))},'deny':{'type':Sequelize[_0xf3ad('0x1')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0xf3ad('0x1')]},'md5secret':{'type':Sequelize[_0xf3ad('0x1')]},'remotesecret':{'type':Sequelize[_0xf3ad('0x1')]},'transport':{'type':Sequelize[_0xf3ad('0x1')],'defaultValue':_0xf3ad('0xf'),'set':function(_0x464cec){this[_0xf3ad('0x10')]('transport',_0x464cec?_0x464cec[_0xf3ad('0x11')](','):null);},'get':function(){return this['getDataValue'](_0xf3ad('0x12'))?this[_0xf3ad('0x13')](_0xf3ad('0x12'))[_0xf3ad('0x14')](','):null;},'comment':_0xf3ad('0x15')},'dtmfmode':{'type':Sequelize[_0xf3ad('0x3')]('rfc2833','info',_0xf3ad('0x16'),_0xf3ad('0x17'),_0xf3ad('0x18')),'defaultValue':_0xf3ad('0x19')},'directmedia':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no','nonat',_0xf3ad('0x1b'),_0xf3ad('0x1c')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf3ad('0x3')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xf3ad('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x23c4fd){this[_0xf3ad('0x10')](_0xf3ad('0x1d'),_0x23c4fd?_0x23c4fd['join'](','):null);},'get':function(){return this[_0xf3ad('0x13')](_0xf3ad('0x1d'))?this[_0xf3ad('0x13')](_0xf3ad('0x1d'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xf3ad('0x1')]},'namedcallgroup':{'type':Sequelize[_0xf3ad('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xf3ad('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf3ad('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf3ad('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3dcebc){this[_0xf3ad('0x10')](_0xf3ad('0x1e'),_0x3dcebc?_0x3dcebc[_0xf3ad('0x11')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xf3ad('0x1e'))?this[_0xf3ad('0x13')](_0xf3ad('0x1e'))['split'](';'):null;},'comment':_0xf3ad('0x1f')},'autoframing':{'type':Sequelize['ENUM'](_0xf3ad('0x1a'),'no')},'insecure':{'type':Sequelize[_0xf3ad('0x1')],'defaultValue':_0xf3ad('0x20'),'set':function(_0x3dd0e3){this[_0xf3ad('0x10')](_0xf3ad('0x21'),_0x3dd0e3?_0x3dd0e3[_0xf3ad('0x11')](','):null);},'get':function(){return this[_0xf3ad('0x13')]('insecure')?this['getDataValue'](_0xf3ad('0x21'))[_0xf3ad('0x14')](','):null;},'comment':_0xf3ad('0x22')},'trustrpid':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf3ad('0x3')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no','never')},'promiscredir':{'type':Sequelize['ENUM'](_0xf3ad('0x1a'),'no')},'useclientcode':{'type':Sequelize[_0xf3ad('0x3')]('yes','no')},'accountcode':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'setvar':{'type':Sequelize[_0xf3ad('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xf3ad('0x24')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no'),'defaultValue':_0xf3ad('0x1a')},'busylevel':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0xf3ad('0x1a'),'no')},'allowsubscribe':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no')},'allowtransfer':{'type':Sequelize[_0xf3ad('0x3')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no')},'subscribecontext':{'type':Sequelize[_0xf3ad('0x1')]},'template':{'type':Sequelize[_0xf3ad('0x1')]},'videosupport':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no',_0xf3ad('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xf3ad('0x3')]('yes','no')},'mailbox':{'type':Sequelize[_0xf3ad('0x1')]},'session_timers':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x26'),'refuse',_0xf3ad('0x27'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'session_refresher':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x28'),_0xf3ad('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xf3ad('0x1')]},'fromdomain':{'type':Sequelize[_0xf3ad('0x1')]},'fromuser':{'type':Sequelize[_0xf3ad('0x1')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0xf3ad('0x3')]('yes','no'),'defaultValue':_0xf3ad('0x1a')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0xf3ad('0x1')]},'rtptimeout':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xf3ad('0x1a'),'no',_0xf3ad('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf3ad('0x1')]},'callbackextension':{'type':Sequelize[_0xf3ad('0x1')]},'timert1':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'timerb':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xf3ad('0x1')]},'contactdeny':{'type':Sequelize[_0xf3ad('0x1')]},'contactacl':{'type':Sequelize[_0xf3ad('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xf3ad('0x1')]},'use_q850_reason':{'type':Sequelize[_0xf3ad('0x1')]},'maxforwards':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0xf3ad('0x1a'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM']('yes','no')},'force_avp':{'type':Sequelize[_0xf3ad('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no')},'dtlsenable':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no')},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xf3ad('0x2b'),_0xf3ad('0x2c'))},'dtlsrekey':{'type':Sequelize[_0xf3ad('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf3ad('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0xf3ad('0x1')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0xf3ad('0x1')]},'dtlscapath':{'type':Sequelize[_0xf3ad('0x1')]},'dtlssetup':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x2d'),_0xf3ad('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf3ad('0x1')]},'usereqphone':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xf3ad('0x1')]},'call_limit':{'type':Sequelize[_0xf3ad('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xf3ad('0x1a'),'no')},'subscribemwi':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no')},'vmexten':{'type':Sequelize[_0xf3ad('0x1')]},'mohinterpret':{'type':Sequelize[_0xf3ad('0x1')]},'mohsuggest':{'type':Sequelize[_0xf3ad('0x1')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf3ad('0x1')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xf3ad('0x3')](_0xf3ad('0x1a'),'no','nonat',_0xf3ad('0x1b'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf3ad('0x1')]},'otherFields':{'type':Sequelize[_0xf3ad('0x1')]},'active':{'type':Sequelize[_0xf3ad('0x2f')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf3ad('0x1')],'defaultValue':'no'}}; \ No newline at end of file +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 diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index b6f2a09..ef341e6 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 _0x9bde=['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','../../config/license/util','../../mysqldb','client','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','offset','order','sort','where','pick','filter','VIRTUAL','merge','Trunk','includeAll','findAll','rows','show','params','fields','include','options','clone','find','omit','createdAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/registry.ejs','utf8','render','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','root','server/files/templates/trunk.ejs','writeFileSync','rimraf'];(function(_0x134999,_0x4de0c9){var _0x46e471=function(_0x2393aa){while(--_0x2393aa){_0x134999['push'](_0x134999['shift']());}};_0x46e471(++_0x4de0c9);}(_0x9bde,0xe1));var _0xe9bd=function(_0x590029,_0x528aed){_0x590029=_0x590029-0x0;var _0x344d2b=_0x9bde[_0x590029];return _0x344d2b;};'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'];var jayson=require('jayson/promise');var client=jayson[_0xe9bd('0x19')]['http']({'port':0x232a});function respondWithRpcPromise(_0x220d07,_0x429e88,_0x3435b4,_0x51109f){return new BPromise(function(_0x47ba5e,_0x46a95e){var _0x248818=_0x51109f||client;return _0x248818[_0xe9bd('0x1a')](_0x220d07,_0x3435b4)[_0xe9bd('0x1b')](function(_0x3360bd){logger[_0xe9bd('0x1c')](_0xe9bd('0x1d'),_0x429e88,'request\x20sent');logger[_0xe9bd('0x1e')](_0xe9bd('0x1f'),_0x429e88,_0xe9bd('0x20'),JSON['stringify'](_0x3360bd));if(_0x3360bd[_0xe9bd('0x21')]){if(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x22')]===0x1f4){logger[_0xe9bd('0x21')]('Trunk,\x20%s,\x20%s',_0x429e88,_0x3360bd[_0xe9bd('0x21')]['message']);return _0x46a95e(_0x3360bd[_0xe9bd('0x21')]['message']);}logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);return _0x47ba5e(_0x3360bd[_0xe9bd('0x21')][_0xe9bd('0x23')]);}else{logger[_0xe9bd('0x1c')]('Trunk,\x20%s,\x20%s',_0x429e88,_0xe9bd('0x20'));_0x47ba5e(_0x3360bd[_0xe9bd('0x24')]['message']);}})[_0xe9bd('0x25')](function(_0x505c23){logger[_0xe9bd('0x21')](_0xe9bd('0x1d'),_0x429e88,_0x505c23);_0x46a95e(_0x505c23);});});}function respondWithStatusCode(_0x36f8c0,_0xf02209){_0xf02209=_0xf02209||0xcc;return function(_0x5bc4bf){if(_0x5bc4bf){return _0x36f8c0[_0xe9bd('0x26')](_0xf02209);}return _0x36f8c0[_0xe9bd('0x27')](_0xf02209)[_0xe9bd('0x28')]();};}function respondWithResult(_0x39b206,_0x2641be){_0x2641be=_0x2641be||0xc8;return function(_0xb52d45){if(_0xb52d45){return _0x39b206[_0xe9bd('0x27')](_0x2641be)[_0xe9bd('0x29')](_0xb52d45);}};}function respondWithFilteredResult(_0x1ae889,_0x5987af){return function(_0x3c211a){if(_0x3c211a){var _0x38fdfa=typeof _0x5987af['offset']===_0xe9bd('0x2a')&&typeof _0x5987af[_0xe9bd('0x2b')]===_0xe9bd('0x2a');var _0x429055=_0x3c211a[_0xe9bd('0x2c')];var _0x183601=_0x38fdfa?0x0:_0x5987af['offset'];var _0x5b7f1d=_0x38fdfa?_0x3c211a[_0xe9bd('0x2c')]:_0x5987af['offset']+_0x5987af[_0xe9bd('0x2b')];var _0x1f2c0e;if(_0x5b7f1d>=_0x429055){_0x5b7f1d=_0x429055;_0x1f2c0e=0xc8;}else{_0x1f2c0e=0xce;}_0x1ae889[_0xe9bd('0x27')](_0x1f2c0e);return _0x1ae889[_0xe9bd('0x2d')](_0xe9bd('0x2e'),_0x183601+'-'+_0x5b7f1d+'/'+_0x429055)['json'](_0x3c211a);}return null;};}function patchUpdates(_0x4b7bc2){return function(_0x7f2c5){try{jsonpatch[_0xe9bd('0x2f')](_0x7f2c5,_0x4b7bc2,!![]);}catch(_0x3f96a0){return BPromise[_0xe9bd('0x30')](_0x3f96a0);}return _0x7f2c5[_0xe9bd('0x31')]();};}function saveUpdates(_0x1f0f9e,_0x3c31ee){return function(_0x66213a){if(_0x66213a){return _0x66213a[_0xe9bd('0x32')](_0x1f0f9e)['then'](function(_0x426004){return _0x426004;});}return null;};}function removeEntity(_0x81a31f,_0x390a43){return function(_0x5117bc){if(_0x5117bc){return _0x5117bc['destroy']()[_0xe9bd('0x1b')](function(){var _0x2e9593=_0x5117bc[_0xe9bd('0x33')]({'plain':!![]});var _0x3ed60a=_0xe9bd('0x34');return db[_0xe9bd('0x35')][_0xe9bd('0x36')]({'where':{'type':_0x3ed60a,'resourceId':_0x2e9593['id']}})[_0xe9bd('0x1b')](function(){return _0x5117bc;});})[_0xe9bd('0x1b')](function(){_0x81a31f[_0xe9bd('0x27')](0xcc)[_0xe9bd('0x28')]();});}};}function handleEntityNotFound(_0x549dd1,_0x2ad46e){return function(_0x199477){if(!_0x199477){_0x549dd1[_0xe9bd('0x26')](0x194);}return _0x199477;};}function handleError(_0x8ff624,_0x264ba0){_0x264ba0=_0x264ba0||0x1f4;return function(_0x147da5){logger['error'](_0x147da5[_0xe9bd('0x37')]);if(_0x147da5[_0xe9bd('0x38')]){delete _0x147da5['name'];}_0x8ff624[_0xe9bd('0x27')](_0x264ba0)[_0xe9bd('0x39')](_0x147da5);};}exports['index']=function(_0x4b1da0,_0x2785e6){var _0xdf43b9={},_0x4d2f3d={},_0x2d1289={'count':0x0,'rows':[]};var _0x3ea705=_[_0xe9bd('0x3a')](db['Trunk'][_0xe9bd('0x3b')],function(_0x4d1945){return{'name':_0x4d1945[_0xe9bd('0x3c')],'type':_0x4d1945[_0xe9bd('0x3d')][_0xe9bd('0x3e')]};});_0x4d2f3d[_0xe9bd('0x3f')]=_['map'](_0x3ea705,_0xe9bd('0x38'));_0x4d2f3d[_0xe9bd('0x40')]=_[_0xe9bd('0x41')](_0x4b1da0[_0xe9bd('0x40')]);_0x4d2f3d[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4d2f3d[_0xe9bd('0x3f')],_0x4d2f3d[_0xe9bd('0x40')]);_0xdf43b9[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x4d2f3d['model'],qs['fields'](_0x4b1da0[_0xe9bd('0x40')]['fields']));_0xdf43b9[_0xe9bd('0x44')]=_0xdf43b9[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xdf43b9['attributes']:_0x4d2f3d[_0xe9bd('0x3f')];if(!_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x46')]('nolimit')){_0xdf43b9[_0xe9bd('0x2b')]=qs[_0xe9bd('0x2b')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x2b')]);_0xdf43b9[_0xe9bd('0x47')]=qs[_0xe9bd('0x47')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x47')]);}_0xdf43b9[_0xe9bd('0x48')]=qs[_0xe9bd('0x49')](_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x49')]);_0xdf43b9[_0xe9bd('0x4a')]=qs[_0xe9bd('0x42')](_[_0xe9bd('0x4b')](_0x4b1da0['query'],_0x4d2f3d['filters']),_0x3ea705);if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x4c')]){_0xdf43b9[_0xe9bd('0x4a')]=_['merge'](_0xdf43b9['where'],{'$or':_[_0xe9bd('0x3a')](_0x3ea705,function(_0x3f6f22){if(_0x3f6f22[_0xe9bd('0x3d')]!==_0xe9bd('0x4d')){var _0x39fb61={};_0x39fb61[_0x3f6f22[_0xe9bd('0x38')]]={'$like':'%'+_0x4b1da0[_0xe9bd('0x40')]['filter']+'%'};return _0x39fb61;}})});}_0xdf43b9=_[_0xe9bd('0x4e')]({},_0xdf43b9,_0x4b1da0['options']);var _0x36726e={'where':_0xdf43b9[_0xe9bd('0x4a')]};return db[_0xe9bd('0x4f')][_0xe9bd('0x2c')](_0x36726e)[_0xe9bd('0x1b')](function(_0x4b7b67){_0x2d1289[_0xe9bd('0x2c')]=_0x4b7b67;if(_0x4b1da0[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xdf43b9['include']=[{'all':!![]}];}return db[_0xe9bd('0x4f')][_0xe9bd('0x51')](_0xdf43b9);})[_0xe9bd('0x1b')](function(_0x5a466b){_0x2d1289[_0xe9bd('0x52')]=_0x5a466b;return _0x2d1289;})[_0xe9bd('0x1b')](respondWithFilteredResult(_0x2785e6,_0xdf43b9))[_0xe9bd('0x25')](handleError(_0x2785e6,null));};exports[_0xe9bd('0x53')]=function(_0x1ee09c,_0x579d26){var _0x3f4833={'raw':![],'where':{'id':_0x1ee09c[_0xe9bd('0x54')]['id']}},_0x4b8ff9={};_0x4b8ff9[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0x4b8ff9['query']=_[_0xe9bd('0x41')](_0x1ee09c['query']);_0x4b8ff9[_0xe9bd('0x42')]=_[_0xe9bd('0x43')](_0x4b8ff9['model'],_0x4b8ff9['query']);_0x3f4833[_0xe9bd('0x44')]=_['intersection'](_0x4b8ff9[_0xe9bd('0x3f')],qs['fields'](_0x1ee09c[_0xe9bd('0x40')][_0xe9bd('0x55')]));_0x3f4833['attributes']=_0x3f4833[_0xe9bd('0x44')]['length']?_0x3f4833[_0xe9bd('0x44')]:_0x4b8ff9[_0xe9bd('0x3f')];if(_0x1ee09c[_0xe9bd('0x40')]['includeAll']){_0x3f4833[_0xe9bd('0x56')]=[{'all':!![]}];}_0x3f4833=_[_0xe9bd('0x4e')]({},_0x3f4833,_0x1ee09c[_0xe9bd('0x57')]);return db[_0xe9bd('0x4f')]['find'](_0x3f4833)['then'](handleEntityNotFound(_0x579d26,null))[_0xe9bd('0x1b')](respondWithResult(_0x579d26,null))['catch'](handleError(_0x579d26,null));};exports[_0xe9bd('0x58')]=function(_0x3c33b8,_0xc7dd2f){var _0xc818b4={'where':{'id':_0x3c33b8[_0xe9bd('0x54')]['id']}},_0x159f68={};_0x159f68[_0xe9bd('0x3f')]=_[_0xe9bd('0x41')](db[_0xe9bd('0x4f')][_0xe9bd('0x3b')]);_0xc818b4[_0xe9bd('0x44')]=_[_0xe9bd('0x43')](_0x159f68['model'],qs['fields'](_0x3c33b8['query'][_0xe9bd('0x55')]));_0xc818b4['attributes']=_0xc818b4[_0xe9bd('0x44')][_0xe9bd('0x45')]?_0xc818b4[_0xe9bd('0x44')]:_0x159f68[_0xe9bd('0x3f')];if(_0x3c33b8[_0xe9bd('0x40')][_0xe9bd('0x50')]){_0xc818b4[_0xe9bd('0x56')]=[{'all':!![]}];}_0xc818b4=_[_0xe9bd('0x4e')]({},_0xc818b4,_0x3c33b8[_0xe9bd('0x57')]);return db['Trunk'][_0xe9bd('0x59')](_0xc818b4)[_0xe9bd('0x1b')](handleEntityNotFound(_0xc7dd2f,null))[_0xe9bd('0x1b')](function(_0x3f848d){if(_0x3f848d){var _0x4d58c1=_0x3f848d[_0xe9bd('0x33')]({'plain':!![]});_0x4d58c1=qs[_0xe9bd('0x5a')](_0x4d58c1,['id',_0xe9bd('0x5b'),'updatedAt']);_0x3c33b8[_0xe9bd('0x5c')]=_[_0xe9bd('0x5a')](_0x3c33b8[_0xe9bd('0x5c')],['id',_0xe9bd('0x5b'),'updatedAt']);return db['Trunk'][_0xe9bd('0x5d')](_[_0xe9bd('0x4e')](_0x4d58c1,_0x3c33b8[_0xe9bd('0x5c')]),{'include':_0x3c33b8[_0xe9bd('0x40')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x305efa){var _0x20855b=_0x3c33b8[_0xe9bd('0x5e')][_0xe9bd('0x33')]({'plain':!![]});if(!_0x20855b)throw new Error(_0xe9bd('0x5f'));if(_0x20855b[_0xe9bd('0x60')]==='user'){var _0x179c8d=_0x305efa['get']({'plain':!![]});var _0x27e07c=_0xe9bd('0x34');return db[_0xe9bd('0x61')][_0xe9bd('0x59')]({'where':{'name':_0x27e07c,'userProfileId':_0x20855b['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x263ad9){if(_0x263ad9&&_0x263ad9[_0xe9bd('0x62')]===0x0){return db['UserProfileResource'][_0xe9bd('0x5d')]({'name':_0x179c8d[_0xe9bd('0x38')],'resourceId':_0x179c8d['id'],'type':_0x263ad9[_0xe9bd('0x38')],'sectionId':_0x263ad9['id']},{})[_0xe9bd('0x1b')](function(){return _0x305efa;});}else{return _0x305efa;}})[_0xe9bd('0x25')](function(_0x16b66c){logger[_0xe9bd('0x21')](_0xe9bd('0x63'),_0x16b66c);throw _0x16b66c;});}return _0x305efa;});}})[_0xe9bd('0x1b')](respondWithResult(_0xc7dd2f,0xc9))[_0xe9bd('0x25')](handleError(_0xc7dd2f,null));};exports[_0xe9bd('0x5d')]=function(_0x37d07a,_0x5d1e4b,_0x3a12e9){var _0x9d0603;return db['Trunk'][_0xe9bd('0x5d')](_0x37d07a[_0xe9bd('0x5c')],{'raw':!![]})['then'](function(_0x561165){_0x9d0603=_0x561165;return db[_0xe9bd('0x4f')][_0xe9bd('0x51')]({'raw':!![]});})['then'](function(_0x4ec8be){var _0x4a6422=fs[_0xe9bd('0x64')](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0x1fc88d=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x337284=ejs[_0xe9bd('0x68')](_0x4a6422,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x69'),_0x337284);if(_0x9d0603[_0xe9bd('0x6a')]){var _0x11ebcb=ejs['render'](_0x1fc88d,{'trunks':_0x4ec8be||[]});fs['writeFileSync'](_0xe9bd('0x6b'),_0x11ebcb);}})[_0xe9bd('0x1b')](function(){return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x5d'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x1b')](function(){var _0x3fda4c=_0x37d07a[_0xe9bd('0x5e')]['get']({'plain':!![]});if(!_0x3fda4c)throw new Error(_0xe9bd('0x5f'));if(_0x3fda4c[_0xe9bd('0x60')]===_0xe9bd('0x5e')){var _0x3db47a=_0x9d0603[_0xe9bd('0x33')]({'plain':!![]});return db['UserProfileSection'][_0xe9bd('0x59')]({'where':{'name':'Trunks','userProfileId':_0x3fda4c['userProfileId']},'raw':!![]})[_0xe9bd('0x1b')](function(_0x4496e3){if(_0x4496e3&&_0x4496e3['autoAssociation']===0x0){return db[_0xe9bd('0x35')][_0xe9bd('0x5d')]({'name':_0x3db47a[_0xe9bd('0x38')],'resourceId':_0x3db47a['id'],'type':_0x4496e3[_0xe9bd('0x38')],'sectionId':_0x4496e3['id']},{})['then'](function(){return _0x9d0603;});}else{return _0x9d0603;}})[_0xe9bd('0x25')](function(_0x41fb41){logger['error'](_0xe9bd('0x63'),_0x41fb41);throw _0x41fb41;});}return _0x9d0603;})[_0xe9bd('0x1b')](respondWithResult(_0x5d1e4b,0xc9))[_0xe9bd('0x25')](handleError(_0x5d1e4b,null));};exports[_0xe9bd('0x32')]=function(_0x2e63c7,_0x1a36aa,_0x466a89){var _0x5e127b;return db[_0xe9bd('0x4f')][_0xe9bd('0x59')]({'where':{'id':_0x2e63c7[_0xe9bd('0x54')]['id']}})[_0xe9bd('0x1b')](handleEntityNotFound(_0x1a36aa,null))[_0xe9bd('0x1b')](saveUpdates(_0x2e63c7[_0xe9bd('0x5c')],null))[_0xe9bd('0x1b')](function(_0x2adc49){if(_0x2adc49){_0x5e127b=_0x2adc49;return db[_0xe9bd('0x4f')]['findAll']({'raw':!![]});}})[_0xe9bd('0x1b')](function(_0x466952){if(_0x466952){var _0x256890=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),'utf8');var _0x18519d=fs[_0xe9bd('0x64')](path['join'](config[_0xe9bd('0x6e')],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x2083c4=ejs[_0xe9bd('0x68')](_0x256890,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x69'),_0x2083c4);var _0x4f3dc6=ejs['render'](_0x18519d,{'trunks':_0x466952||[]});fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x4f3dc6);return respondWithRpcPromise(_0xe9bd('0x6c'),_0xe9bd('0x32'),{'module':_0xe9bd('0x6d')});}return null;})[_0xe9bd('0x1b')](function(_0x1b46f4){if(_0x1b46f4){return _0x5e127b;}})['then'](respondWithResult(_0x1a36aa,null))[_0xe9bd('0x25')](handleError(_0x1a36aa,null));};exports[_0xe9bd('0x36')]=function(_0x29833b,_0x256862,_0x14cdd5){var _0x74063;return db[_0xe9bd('0x4f')]['find']({'where':{'id':_0x29833b['params']['id']}})['then'](handleEntityNotFound(_0x256862,null))[_0xe9bd('0x1b')](removeEntity(_0x256862,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xe9bd('0x1b')](function(_0x402ab2){var _0xf170d4=fs[_0xe9bd('0x64')](path[_0xe9bd('0x65')](config[_0xe9bd('0x6e')],_0xe9bd('0x6f')),_0xe9bd('0x67'));var _0x14ec42=fs['readFileSync'](path[_0xe9bd('0x65')](config['root'],_0xe9bd('0x66')),_0xe9bd('0x67'));var _0x22c67f=ejs[_0xe9bd('0x68')](_0xf170d4,{'trunks':_0x402ab2});var _0x416938=ejs['render'](_0x14ec42,{'trunks':_0x402ab2});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x22c67f);fs[_0xe9bd('0x70')](_0xe9bd('0x6b'),_0x416938);return respondWithRpcPromise('Reload',_0xe9bd('0x36'),{'module':_0xe9bd('0x6d')});})[_0xe9bd('0x25')](handleError(_0x256862,null));}; \ No newline at end of file +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 diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 3a05265..17c155b 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 _0x1825=['exports','define','Trunk','tools_trunks','lodash','../../config/logger','api','moment','bluebird','rimraf','./trunk.attributes'];(function(_0x1f6b00,_0x7253c1){var _0x335deb=function(_0x1b5948){while(--_0x1b5948){_0x1f6b00['push'](_0x1f6b00['shift']());}};_0x335deb(++_0x7253c1);}(_0x1825,0x1f3));var _0x5182=function(_0x58f27e,_0x193e37){_0x58f27e=_0x58f27e-0x0;var _0x1dc9fe=_0x1825[_0x58f27e];return _0x1dc9fe;};'use strict';var _=require(_0x5182('0x0'));var util=require('util');var logger=require(_0x5182('0x1'))(_0x5182('0x2'));var moment=require(_0x5182('0x3'));var BPromise=require(_0x5182('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5182('0x5'));var config=require('../../config/environment');var attributes=require(_0x5182('0x6'));module[_0x5182('0x7')]=function(_0x26b305,_0x5ba1cc){return _0x26b305[_0x5182('0x8')](_0x5182('0x9'),attributes,{'tableName':_0x5182('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 67145e6..d26c642 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 _0xc28f=['model','then','debug','ShowTrunk','find','where','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTrunk','Trunk','findAll','options','raw','attributes','include','map'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc28f,0xd3));var _0xfc28=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xc28f[_0x47b58b];return _0x46bebe;};'use strict';var _=require('lodash');var util=require(_0xfc28('0x0'));var moment=require(_0xfc28('0x1'));var BPromise=require(_0xfc28('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc28('0x3'))['db'];var utils=require(_0xfc28('0x4'));var logger=require(_0xfc28('0x5'))(_0xfc28('0x6'));var config=require(_0xfc28('0x7'));var jayson=require(_0xfc28('0x8'));var client=jayson[_0xfc28('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x529df4,_0x1bcf59,_0x1024ad){return new BPromise(function(_0x1c240b,_0x3d1710){return client[_0xfc28('0xa')](_0x529df4,_0x1024ad)['then'](function(_0xb8f221){logger[_0xfc28('0xb')](_0xfc28('0xc'),_0x1bcf59,'request\x20sent');logger['debug'](_0xfc28('0xd'),_0x1bcf59,'request\x20sent',JSON[_0xfc28('0xe')](_0xb8f221));if(_0xb8f221[_0xfc28('0xf')]){if(_0xb8f221[_0xfc28('0xf')][_0xfc28('0x10')]===0x1f4){logger[_0xfc28('0xf')](_0xfc28('0xc'),_0x1bcf59,_0xb8f221[_0xfc28('0xf')][_0xfc28('0x11')]);return _0x3d1710(_0xb8f221[_0xfc28('0xf')][_0xfc28('0x11')]);}logger[_0xfc28('0xf')](_0xfc28('0xc'),_0x1bcf59,_0xb8f221[_0xfc28('0xf')][_0xfc28('0x11')]);return _0x1c240b(_0xb8f221[_0xfc28('0xf')][_0xfc28('0x11')]);}else{logger[_0xfc28('0xb')](_0xfc28('0xc'),_0x1bcf59,'request\x20sent');_0x1c240b(_0xb8f221[_0xfc28('0x12')]['message']);}})['catch'](function(_0x406fbc){logger[_0xfc28('0xf')](_0xfc28('0xc'),_0x1bcf59,_0x406fbc);_0x3d1710(_0x406fbc);});});}exports[_0xfc28('0x13')]=function(_0x21c79){var _0x289099=this;return new Promise(function(_0x5e22b3,_0x9e468){return db[_0xfc28('0x14')][_0xfc28('0x15')]({'raw':_0x21c79['options']?_0x21c79[_0xfc28('0x16')][_0xfc28('0x17')]===undefined?!![]:![]:!![],'where':_0x21c79[_0xfc28('0x16')]?_0x21c79[_0xfc28('0x16')]['where']||null:null,'attributes':_0x21c79['options']?_0x21c79[_0xfc28('0x16')][_0xfc28('0x18')]||null:null,'limit':_0x21c79[_0xfc28('0x16')]?_0x21c79[_0xfc28('0x16')]['limit']||null:null,'include':_0x21c79[_0xfc28('0x16')]?_0x21c79[_0xfc28('0x16')][_0xfc28('0x19')]?_[_0xfc28('0x1a')](_0x21c79[_0xfc28('0x16')][_0xfc28('0x19')],function(_0x5f3d12){return{'model':db[_0x5f3d12[_0xfc28('0x1b')]],'as':_0x5f3d12['as'],'attributes':_0x5f3d12[_0xfc28('0x18')],'include':_0x5f3d12['include']?_['map'](_0x5f3d12[_0xfc28('0x19')],function(_0x1520df){return{'model':db[_0x1520df[_0xfc28('0x1b')]],'as':_0x1520df['as'],'attributes':_0x1520df[_0xfc28('0x18')],'include':_0x1520df[_0xfc28('0x19')]?_[_0xfc28('0x1a')](_0x1520df['include'],function(_0x3d7d04){return{'model':db[_0x3d7d04[_0xfc28('0x1b')]],'as':_0x3d7d04['as'],'attributes':_0x3d7d04[_0xfc28('0x18')]};}):[]};}):[]};}):[]:[]})[_0xfc28('0x1c')](function(_0x1e4aea){logger[_0xfc28('0xb')]('GetTrunk',_0x21c79);logger[_0xfc28('0x1d')](_0xfc28('0x13'),_0x21c79,JSON[_0xfc28('0xe')](_0x1e4aea));_0x5e22b3(_0x1e4aea);})['catch'](function(_0x20020e){logger[_0xfc28('0xf')](_0xfc28('0x13'),_0x20020e[_0xfc28('0x11')],_0x21c79);_0x9e468(_0x289099['error'](0x1f4,_0x20020e[_0xfc28('0x11')]));});});};exports[_0xfc28('0x1e')]=function(_0x58bece){var _0x18e70c=this;return new Promise(function(_0x101a20,_0x529688){return db[_0xfc28('0x14')][_0xfc28('0x1f')]({'raw':_0x58bece[_0xfc28('0x16')]?_0x58bece[_0xfc28('0x16')][_0xfc28('0x17')]===undefined?!![]:![]:!![],'where':_0x58bece[_0xfc28('0x16')]?_0x58bece[_0xfc28('0x16')][_0xfc28('0x20')]||null:null,'attributes':_0x58bece['options']?_0x58bece[_0xfc28('0x16')][_0xfc28('0x18')]||null:null,'include':_0x58bece[_0xfc28('0x16')]?_0x58bece[_0xfc28('0x16')][_0xfc28('0x19')]?_[_0xfc28('0x1a')](_0x58bece[_0xfc28('0x16')][_0xfc28('0x19')],function(_0x5b91f8){return{'model':db[_0x5b91f8[_0xfc28('0x1b')]],'as':_0x5b91f8['as'],'attributes':_0x5b91f8[_0xfc28('0x18')],'include':_0x5b91f8[_0xfc28('0x19')]?_[_0xfc28('0x1a')](_0x5b91f8['include'],function(_0x480721){return{'model':db[_0x480721[_0xfc28('0x1b')]],'as':_0x480721['as'],'attributes':_0x480721[_0xfc28('0x18')],'include':_0x480721[_0xfc28('0x19')]?_[_0xfc28('0x1a')](_0x480721[_0xfc28('0x19')],function(_0x185112){return{'model':db[_0x185112[_0xfc28('0x1b')]],'as':_0x185112['as'],'attributes':_0x185112[_0xfc28('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6618fc){logger['info'](_0xfc28('0x1e'),_0x58bece);logger['debug'](_0xfc28('0x1e'),_0x58bece,JSON['stringify'](_0x6618fc));_0x101a20(_0x6618fc);})[_0xfc28('0x21')](function(_0x1b0766){logger[_0xfc28('0xf')](_0xfc28('0x1e'),_0x1b0766[_0xfc28('0x11')],_0x58bece);_0x529688(_0x18e70c[_0xfc28('0xf')](0x1f4,_0x1b0766['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/user/index.js b/server/api/user/index.js index 38bde47..a8e42e0 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 _0x768a=['/:id/chat_interactions','removeChatInteractions','removeFaxInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','/:id/whatsapp_accounts','removeWhatsappAccounts','removeApiKey','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','addContacts','create','bulkCreate','addQueues','diskStorage','join','root','%s-%s','now','single','file','addAvatar','login','/:id/logout','logout','pause','unpause','addTeams','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','/:id/square_projects','addSquareProjects','/:id/api_key','createApiKey','put','update','/:id/password','delete','destroy'];(function(_0x104eb8,_0x65f83f){var _0x3f5b24=function(_0x51d72c){while(--_0x51d72c){_0x104eb8['push'](_0x104eb8['shift']());}};_0x3f5b24(++_0x65f83f);}(_0x768a,0x1c7));var _0xa768=function(_0x1db92d,_0x1d0ed2){_0x1db92d=_0x1db92d-0x0;var _0x19be36=_0x768a[_0x1db92d];return _0x19be36;};'use strict';var multer=require(_0xa768('0x0'));var util=require(_0xa768('0x1'));var path=require(_0xa768('0x2'));var timeout=require('connect-timeout');var express=require(_0xa768('0x3'));var router=express['Router']();var fs_extra=require(_0xa768('0x4'));var auth=require(_0xa768('0x5'));var interaction=require(_0xa768('0x6'));var config=require(_0xa768('0x7'));var controller=require(_0xa768('0x8'));router[_0xa768('0x9')]('/',auth[_0xa768('0xa')](),controller[_0xa768('0xb')]);router[_0xa768('0x9')](_0xa768('0xc'),auth['isAuthenticated'](),controller[_0xa768('0xd')]);router['get'](_0xa768('0xe'),auth['isAuthenticated'](),controller['whoami']);router[_0xa768('0x9')](_0xa768('0xf'),auth['isAuthenticated'](),controller['getPresence']);router['get'](_0xa768('0x10'),auth[_0xa768('0xa')](),controller[_0xa768('0x11')]);router[_0xa768('0x9')](_0xa768('0x12'),controller[_0xa768('0x13')]);router[_0xa768('0x9')](_0xa768('0x14'),auth[_0xa768('0xa')](),controller[_0xa768('0x15')]);router[_0xa768('0x9')](_0xa768('0x16'),auth['isAuthenticated'](),controller[_0xa768('0x17')]);router[_0xa768('0x9')](_0xa768('0x18'),auth[_0xa768('0xa')](),controller[_0xa768('0x19')]);router['get'](_0xa768('0x1a'),auth['isAuthenticated'](),controller[_0xa768('0x1b')]);router[_0xa768('0x9')](_0xa768('0x1c'),auth['isAuthenticated'](),controller[_0xa768('0x1d')]);router[_0xa768('0x9')](_0xa768('0x1e'),auth[_0xa768('0xa')](),controller[_0xa768('0x1f')]);router[_0xa768('0x9')]('/:id/screen_recordings',auth['isAuthenticated'](),controller[_0xa768('0x20')]);router['get'](_0xa768('0x21'),auth[_0xa768('0xa')](),controller['getChatInteractions']);router[_0xa768('0x9')](_0xa768('0x22'),auth['isAuthenticated'](),controller[_0xa768('0x23')]);router[_0xa768('0x9')](_0xa768('0x24'),auth[_0xa768('0xa')](),controller['getMailInteractions']);router[_0xa768('0x9')](_0xa768('0x25'),auth[_0xa768('0xa')](),controller[_0xa768('0x26')]);router['get'](_0xa768('0x27'),auth['isAuthenticated'](),controller[_0xa768('0x28')]);router['get'](_0xa768('0x29'),auth[_0xa768('0xa')](),controller[_0xa768('0x2a')]);router[_0xa768('0x9')](_0xa768('0x2b'),auth[_0xa768('0xa')](),controller[_0xa768('0x2c')]);router[_0xa768('0x9')](_0xa768('0x2d'),auth[_0xa768('0xa')](),controller['getLists']);router[_0xa768('0x9')](_0xa768('0x2e'),auth[_0xa768('0xa')](),controller[_0xa768('0x2f')]);router[_0xa768('0x9')](_0xa768('0x30'),auth[_0xa768('0xa')](),controller['getVoicePrefixes']);router[_0xa768('0x9')](_0xa768('0x31'),auth[_0xa768('0xa')](),controller[_0xa768('0x32')]);router['get'](_0xa768('0x33'),auth['isAuthenticated'](),controller[_0xa768('0x34')]);router['get'](_0xa768('0x35'),auth[_0xa768('0xa')](),controller[_0xa768('0x36')]);router[_0xa768('0x9')](_0xa768('0x37'),auth['isAuthenticated'](),controller[_0xa768('0x38')]);router['get']('/:id/chat_websites',auth[_0xa768('0xa')](),controller['getChatWebsites']);router['get']('/:id/whatsapp_accounts',auth[_0xa768('0xa')](),controller['getWhatsappAccounts']);router['get']('/:id/square_projects',auth['isAuthenticated'](),controller[_0xa768('0x39')]);router['get'](_0xa768('0x3a'),auth[_0xa768('0xa')](),controller[_0xa768('0x3b')]);router['get']('/:id/api_key',auth[_0xa768('0xa')](),controller['getApiKey']);router[_0xa768('0x3c')](_0xa768('0x16'),auth[_0xa768('0xa')](),controller[_0xa768('0x3d')]);router[_0xa768('0x3c')]('/',auth[_0xa768('0xa')](),controller[_0xa768('0x3e')]);router[_0xa768('0x3c')]('/create_many',auth[_0xa768('0xa')](),controller[_0xa768('0x3f')]);router[_0xa768('0x3c')](_0xa768('0x18'),auth[_0xa768('0xa')](),controller[_0xa768('0x40')]);var upload=multer({'storage':multer[_0xa768('0x41')]({'destination':function(_0x1ef937,_0x4007c4,_0x39ac2e){_0x39ac2e(null,path[_0xa768('0x42')](config[_0xa768('0x43')],'server/files/images/'));},'filename':function(_0xe23024,_0x206f2a,_0xb7725c){_0xb7725c(null,util['format'](_0xa768('0x44'),Date[_0xa768('0x45')](),_0x206f2a['originalname']));}})});router[_0xa768('0x3c')](_0xa768('0x12'),upload[_0xa768('0x46')](_0xa768('0x47')),controller[_0xa768('0x48')]);router['post']('/:id/login',auth[_0xa768('0xa')](),controller[_0xa768('0x49')]);router[_0xa768('0x3c')](_0xa768('0x4a'),auth[_0xa768('0xa')](),controller[_0xa768('0x4b')]);router[_0xa768('0x3c')]('/:id/pause',auth[_0xa768('0xa')](),controller[_0xa768('0x4c')]);router['post']('/:id/unpause',auth[_0xa768('0xa')](),controller[_0xa768('0x4d')]);router[_0xa768('0x3c')](_0xa768('0x2b'),auth[_0xa768('0xa')](),controller[_0xa768('0x4e')]);router[_0xa768('0x3c')]('/:id/chat_interactions',auth[_0xa768('0xa')](),controller['addChatInteractions']);router[_0xa768('0x3c')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0xa768('0x4f')]);router[_0xa768('0x3c')](_0xa768('0x50'),auth[_0xa768('0xa')](),controller['addFaxInteractions']);router[_0xa768('0x3c')](_0xa768('0x51'),auth[_0xa768('0xa')](),controller[_0xa768('0x52')]);router[_0xa768('0x3c')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller[_0xa768('0x53')]);router['post'](_0xa768('0x54'),auth['isAuthenticated'](),controller['addWhatsappInteractions']);router[_0xa768('0x3c')](_0xa768('0x31'),auth['isAuthenticated'](),controller[_0xa768('0x55')]);router['post']('/:id/mail_accounts',auth[_0xa768('0xa')](),controller[_0xa768('0x56')]);router[_0xa768('0x3c')](_0xa768('0x35'),auth['isAuthenticated'](),controller[_0xa768('0x57')]);router[_0xa768('0x3c')](_0xa768('0x37'),auth['isAuthenticated'](),controller['addSmsAccounts']);router['post'](_0xa768('0x58'),auth[_0xa768('0xa')](),controller[_0xa768('0x59')]);router[_0xa768('0x3c')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xa768('0x5a')]);router['post'](_0xa768('0x5b'),auth[_0xa768('0xa')](),controller[_0xa768('0x5c')]);router['post'](_0xa768('0x5d'),auth[_0xa768('0xa')](),controller[_0xa768('0x5e')]);router[_0xa768('0x5f')](_0xa768('0x10'),auth[_0xa768('0xa')](),controller[_0xa768('0x60')]);router[_0xa768('0x5f')](_0xa768('0x61'),auth[_0xa768('0xa')](),controller['changePassword']);router[_0xa768('0x62')](_0xa768('0x18'),auth['isAuthenticated'](),controller['removeQueues']);router[_0xa768('0x62')]('/:id/teams',auth[_0xa768('0xa')](),controller['removeTeams']);router[_0xa768('0x62')](_0xa768('0x10'),auth[_0xa768('0xa')](),controller[_0xa768('0x63')]);router[_0xa768('0x62')](_0xa768('0x64'),auth[_0xa768('0xa')](),controller[_0xa768('0x65')]);router[_0xa768('0x62')]('/:id/mail_interactions',auth[_0xa768('0xa')](),controller['removeMailInteractions']);router[_0xa768('0x62')](_0xa768('0x50'),auth[_0xa768('0xa')](),controller[_0xa768('0x66')]);router[_0xa768('0x62')](_0xa768('0x51'),auth[_0xa768('0xa')](),controller['removeSmsInteractions']);router[_0xa768('0x62')]('/:id/openchannel_interactions',auth['isAuthenticated'](),controller['removeOpenchannelInteractions']);router['delete'](_0xa768('0x54'),auth[_0xa768('0xa')](),controller['removeWhatsappInteractions']);router[_0xa768('0x62')](_0xa768('0x31'),auth[_0xa768('0xa')](),controller[_0xa768('0x67')]);router[_0xa768('0x62')](_0xa768('0x33'),auth[_0xa768('0xa')](),controller['removeMailAccounts']);router['delete'](_0xa768('0x35'),auth['isAuthenticated'](),controller[_0xa768('0x68')]);router['delete'](_0xa768('0x37'),auth[_0xa768('0xa')](),controller[_0xa768('0x69')]);router[_0xa768('0x62')](_0xa768('0x58'),auth['isAuthenticated'](),controller[_0xa768('0x6a')]);router[_0xa768('0x62')](_0xa768('0x6b'),auth[_0xa768('0xa')](),controller[_0xa768('0x6c')]);router['delete'](_0xa768('0x5b'),auth[_0xa768('0xa')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0xa768('0xa')](),controller[_0xa768('0x6d')]);module[_0xa768('0x6e')]=router; \ No newline at end of file +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 diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index d160e39..daf5a48 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 _0x3f49=['phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','lodash','exports','STRING','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','accountcode','DATE','BOOLEAN','INTEGER','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','rfc2833','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','get','isArray','udp','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x3f49,0x11f));var _0x93f4=function(_0x484564,_0x1b6e6c){_0x484564=_0x484564-0x0;var _0x5e4c3d=_0x3f49[_0x484564];return _0x5e4c3d;};'use strict';var Sequelize=require(_0x93f4('0x0'));var moment=require(_0x93f4('0x1'));var util=require('util');var _=require(_0x93f4('0x2'));module[_0x93f4('0x3')]={'name':{'type':Sequelize[_0x93f4('0x4')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x29b94d){this[_0x93f4('0x5')]('name',_0x29b94d);this['setDataValue'](_0x93f4('0x6'),_0x29b94d);},'comment':_0x93f4('0x7')},'fullname':{'type':Sequelize[_0x93f4('0x4')],'allowNull':![],'set':function(_0x5a86ad){this[_0x93f4('0x5')]('fullname',_0x5a86ad);this[_0x93f4('0x5')](_0x93f4('0x8'),util[_0x93f4('0x9')](_0x93f4('0xa'),_0x5a86ad,this[_0x93f4('0xb')](_0x93f4('0xc'))));}},'alias':{'type':Sequelize[_0x93f4('0x4')]},'email':{'type':Sequelize[_0x93f4('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x506b51){if(_0x506b51){this[_0x93f4('0x5')](_0x93f4('0xd'),_0x506b51[_0x93f4('0xe')]());}}},'role':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x10'),_0x93f4('0x11'),_0x93f4('0x12'),_0x93f4('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x93f4('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x93f4('0xc'),'set':function(_0x1d63ef){this[_0x93f4('0x5')]('internal',_0x1d63ef);this['setDataValue'](_0x93f4('0x14'),_0x1d63ef);this[_0x93f4('0x5')](_0x93f4('0x8'),util['format'](_0x93f4('0xa'),this[_0x93f4('0xb')]('fullname'),_0x1d63ef));}},'salt':{'type':Sequelize[_0x93f4('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x93f4('0x4')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0x93f4('0x4')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x93f4('0x15')]},'voicePause':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x93f4('0x4')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x93f4('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'description':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![],'defaultValue':_0x93f4('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x93f4('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x19'),_0x93f4('0x11'),_0x93f4('0x1a')),'allowNull':!![],'defaultValue':_0x93f4('0x19')},'context':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![],'defaultValue':_0x93f4('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0x93f4('0x1c'),_0x93f4('0x1d'),'ALLOWED_FAILED_SCREEN','ALLOWED',_0x93f4('0x1e'),'PROHIB_PASSED_SCREEN',_0x93f4('0x1f'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![],'defaultValue':'udp','set':function(_0x22666f){this[_0x93f4('0x5')](_0x93f4('0x20'),_0x22666f?_0x22666f[_0x93f4('0x21')](','):null);},'get':function(){return this[_0x93f4('0xb')](_0x93f4('0x20'))?this[_0x93f4('0xb')](_0x93f4('0x20'))['split'](','):null;},'comment':_0x93f4('0x22')},'dtmfmode':{'type':Sequelize[_0x93f4('0xf')]('rfc2833',_0x93f4('0x23'),_0x93f4('0x24'),'inband','auto'),'allowNull':!![],'defaultValue':_0x93f4('0x25')},'directmedia':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no',_0x93f4('0x27'),_0x93f4('0x28'),_0x93f4('0x29')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![],'defaultValue':_0x93f4('0x2a'),'set':function(_0x43ebb8){this[_0x93f4('0x5')](_0x93f4('0x2b'),_0x43ebb8?_0x43ebb8[_0x93f4('0x21')](','):null);},'get':function(){return this[_0x93f4('0xb')](_0x93f4('0x2b'))?this['getDataValue'](_0x93f4('0x2b'))['split'](','):null;},'comment':_0x93f4('0x2c')},'callgroup':{'type':Sequelize[_0x93f4('0x4')]},'namedcallgroup':{'type':Sequelize[_0x93f4('0x4')]},'pickupgroup':{'type':Sequelize[_0x93f4('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x93f4('0x4')]},'language':{'type':Sequelize[_0x93f4('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x93f4('0x4')]},'disallow':{'type':Sequelize[_0x93f4('0x4')],'allowNull':![],'defaultValue':_0x93f4('0x2d')},'allow':{'type':Sequelize[_0x93f4('0x4')],'allowNull':![],'defaultValue':_0x93f4('0x2e'),'set':function(_0x1cff88){this[_0x93f4('0x5')](_0x93f4('0x2f'),_0x1cff88?_0x1cff88[_0x93f4('0x21')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue']('allow')?this[_0x93f4('0xb')](_0x93f4('0x2f'))[_0x93f4('0x30')](';'):null;},'comment':_0x93f4('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0x93f4('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![],'set':function(_0x2238d0){this[_0x93f4('0x5')](_0x93f4('0x32'),_0x2238d0?_0x2238d0[_0x93f4('0x21')](','):null);},'get':function(){return this[_0x93f4('0xb')](_0x93f4('0x32'))?this[_0x93f4('0xb')](_0x93f4('0x32'))['split'](','):null;},'comment':_0x93f4('0x33')},'trustrpid':{'type':Sequelize['ENUM'](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x93f4('0x26'),'no',_0x93f4('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x93f4('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x93f4('0x35')},'amaflags':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':_0x93f4('0x26')},'busylevel':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no',_0x93f4('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x37'),'refuse',_0x93f4('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x93f4('0xf')]('uac',_0x93f4('0x39')),'allowNull':!![],'defaultValue':_0x93f4('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x93f4('0xf')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x93f4('0xf')]('yes','no',_0x93f4('0x3a'),_0x93f4('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x3c'),_0x93f4('0x3d'),_0x93f4('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x93f4('0x17')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x93f4('0xf')](_0x93f4('0x26'),'no',_0x93f4('0x27'),_0x93f4('0x28'),_0x93f4('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x93f4('0x15')]},'passwordResetAt':{'type':Sequelize[_0x93f4('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x93f4('0x40')]},'showWebBar':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x0,'set':function(_0x22e560){this[_0x93f4('0x5')](_0x93f4('0x41'),_0x22e560);var _0x22fdbe=this[_0x93f4('0x42')]({'plain':!![]});switch(_0x22e560){case 0x0:case 0x1:var _0x3066d2=_0x22fdbe[_0x93f4('0x20')]?_[_0x93f4('0x43')](_0x22fdbe[_0x93f4('0x20')])?_0x22fdbe[_0x93f4('0x20')][_0x93f4('0x21')]():_0x22fdbe[_0x93f4('0x20')]:_0x93f4('0x44');if(_0x3066d2===_0x93f4('0x45')){_0x3066d2=_0x93f4('0x44');}this['setDataValue'](_0x93f4('0x20'),_0x3066d2);this[_0x93f4('0x5')](_0x93f4('0x46'),'no');this[_0x93f4('0x5')]('avpf',null);this[_0x93f4('0x5')](_0x93f4('0x47'),null);this[_0x93f4('0x5')](_0x93f4('0x48'),null);this[_0x93f4('0x5')](_0x93f4('0x49'),null);this[_0x93f4('0x5')](_0x93f4('0x4a'),null);this[_0x93f4('0x5')](_0x93f4('0x4b'),null);this[_0x93f4('0x5')](_0x93f4('0x4c'),null);this[_0x93f4('0x5')](_0x93f4('0x4d'),null);this[_0x93f4('0x5')](_0x93f4('0x4e'),'no');break;case 0x2:this[_0x93f4('0x5')]('transport',_0x93f4('0x45'));this[_0x93f4('0x5')]('encryption',_0x93f4('0x26'));this[_0x93f4('0x5')](_0x93f4('0x4f'),_0x93f4('0x26'));this['setDataValue']('force_avp',_0x93f4('0x26'));this[_0x93f4('0x5')](_0x93f4('0x48'),'yes');this['setDataValue']('dtlsenable',_0x93f4('0x26'));this[_0x93f4('0x5')](_0x93f4('0x4a'),'no');this[_0x93f4('0x5')](_0x93f4('0x4b'),_0x93f4('0x3e'));this[_0x93f4('0x5')](_0x93f4('0x4c'),_0x22fdbe['dtlscertfile']||_0x93f4('0x50'));this['setDataValue'](_0x93f4('0x4d'),_0x22fdbe[_0x93f4('0x4d')]||_0x93f4('0x51'));this[_0x93f4('0x5')](_0x93f4('0x4e'),_0x93f4('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x93f4('0x40')],'set':function(_0xc56381){this[_0x93f4('0x5')](_0x93f4('0x52'),_0xc56381?_0xc56381[_0x93f4('0x21')](','):[]);},'get':function(){return this[_0x93f4('0xb')](_0x93f4('0x52'))?_[_0x93f4('0x53')](this['getDataValue'](_0x93f4('0x52'))['split'](','),function(_0xcfed34){return parseInt(_0xcfed34,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x93f4('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x93f4('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x93f4('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x93f4('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x93f4('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x93f4('0x54')],'get':function(){return this[_0x93f4('0xb')]('phoneBarEnableScreenRecordingByAgent')?this[_0x93f4('0xb')](_0x93f4('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x93f4('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0xd8c3fc){if(typeof _0xd8c3fc===_0x93f4('0x56')){var _0x3d9e5b=_0xd8c3fc==='1'?!![]:_0xd8c3fc==='0'?![]:_0xd8c3fc==='true'?!![]:_0xd8c3fc===_0x93f4('0x57')?![]:![];this[_0x93f4('0x5')](_0x93f4('0x58'),_0x3d9e5b);}else{this['setDataValue']('screenrecording',_0xd8c3fc);}}},'blocked':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![],'set':function(_0x16df63){this[_0x93f4('0x5')](_0x93f4('0x59'),_0x16df63);if(_0x16df63===!![]){this[_0x93f4('0x5')](_0x93f4('0x5a'),moment());this['setDataValue'](_0x93f4('0x5b'),0x0);}else{this['setDataValue'](_0x93f4('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0x93f4('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x93f4('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x93f4('0x17')](0x5)[_0x93f4('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x93f4('0x16')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 553c03c..a03b697 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(_0x37d1bb,_0x1f75bb){var _0x132b86=function(_0x2523f6){while(--_0x2523f6){_0x37d1bb['push'](_0x37d1bb['shift']());}};_0x132b86(++_0x1f75bb);}(_0x4c60,0xc1));var _0x04c6=function(_0x2f36a8,_0x128acc){_0x2f36a8=_0x2f36a8-0x0;var _0x19c2d4=_0x4c60[_0x2f36a8];return _0x19c2d4;};'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=_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=_0x3ae51d[_0x570f('0x51')]){throw new Error(_0x570f('0x52'));}})[_0x570f('0x25')](function(){if(_0x3c9648){return db['UserVoiceQueueRt'][_0x570f('0x53')]({'where':{'membername':_0x3c9648[_0x570f('0x29')]},'individualHooks':!![]});}})[_0x570f('0x25')](function(){if(_0x3c9648){return _0x3c9648[_0x570f('0x54')]({'raw':!![]});}})['then'](function(_0x147837){if(_0x3c9648){if(_0x147837){var _0x4fe78e=[];_0x3943d1=_0x147837;if(_0x3943d1[_0x570f('0x2f')]){for(var _0x3f31db=0x0;_0x3f31db<_0x3943d1['length'];_0x3f31db++){_0x4fe78e[_0x570f('0x47')](db[_0x570f('0x2c')][_0x570f('0x55')]({'membername':_0x3c9648[_0x570f('0x29')],'UserId':_0x3c9648['id'],'queue_name':_0x3943d1[_0x3f31db]['name'],'VoiceQueueId':_0x3943d1[_0x3f31db]['id'],'interface':_0x218a3c,'paused':_0x3c9648[_0x570f('0x4d')]||![],'penalty':_0x3943d1[_0x3f31db][_0x570f('0x56')]||0x0}));}return BPromise[_0x570f('0x48')](_0x4fe78e);}}}})[_0x570f('0x25')](function(){if(_0x3c9648){return db[_0x570f('0x39')][_0x570f('0x1c')]({'where':{'membername':_0x3c9648[_0x570f('0x29')],'exitAt':null}});}})[_0x570f('0x25')](function(_0x2de436){if(_0x3c9648){if(_0x2de436&&_0x2de436[_0x570f('0x2f')]){var _0x1ef640=[];_0x2de436[_0x570f('0x33')](function(_0x363e7d){_0x1ef640[_0x570f('0x47')](_0x363e7d[_0x570f('0x2d')]({'exitAt':moment()[_0x570f('0x30')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x570f('0x48')](_0x1ef640);}}})[_0x570f('0x25')](function(_0x1f4560){if(_0x3c9648){var _0x2da5c4=[];var _0x1870d0=[];var _0x4280bc=utils[_0x570f('0x32')]();var _0x24f265={'membername':_0x3c9648[_0x570f('0x29')],'interface':_0x218a3c,'enterAt':moment()[_0x570f('0x30')](_0x570f('0x31')),'role':_0x3c9648['role'],'internal':_0x3c9648[_0x570f('0x2a')]};_0x4280bc[_0x570f('0x33')](function(_0x1e42b8){_0x2da5c4[_0x570f('0x47')](_['merge']({'channel':_0x1e42b8,'type':_0x570f('0x57'),'data1':_0x570f('0x58'),'data2':_0x218a3c},_0x24f265));if(_0x3c9648[_0x570f('0x4d')]){_0x1870d0[_0x570f('0x47')](_['merge']({'channel':_0x1e42b8,'type':_0x570f('0x2e'),'data1':_0x570f('0x59')},_0x24f265));}});return db[_0x570f('0x39')][_0x570f('0x3a')](_0x2da5c4['concat'](_0x1870d0),{'individualHooks':!![]});}})[_0x570f('0x25')](function(){if(_0x3c9648){return _0x3c9648['update']({'online':!![],'lastLoginAt':moment()['format'](_0x570f('0x31')),'voicePause':_0x3c9648[_0x570f('0x4d')]||![],'mailPause':_0x3c9648[_0x570f('0x4d')]||![],'chatPause':_0x3c9648[_0x570f('0x4d')]||![],'faxPause':_0x3c9648[_0x570f('0x4d')]||![],'smsPause':_0x3c9648[_0x570f('0x4d')]||![],'openchannelPause':_0x3c9648[_0x570f('0x4d')]||![],'pauseType':_0x3c9648[_0x570f('0x4d')]?_0x570f('0x59'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x218a3c});}})[_0x570f('0x25')](function(_0x4ba74a){_0x4e1704(_0x4ba74a);})[_0x570f('0x26')](function(_0x20247e){_0x4ff149(_0x9a039e['error'](0x1f4,_0x20247e[_0x570f('0x18')]));});});}; \ No newline at end of file +var _0xfb30=['push','isNil','interface','SIP/%s','body','bulkCreate','type','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','Unknown\x20channel','voice','system','chat','fax','sms','whatsapp','set','%s%s','Pause','all','LogoutUser','LoginUser','loginInPause','count','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','destroy','merge','callysquare','concat','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','User','options','raw','where','limit','include','map','model','attributes','GetUser','debug','find','ShowUser','PauseUser','name','role','internal','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach'];(function(_0x2f5758,_0x1cc9d7){var _0x6f16c2=function(_0x1b4874){while(--_0x1b4874){_0x2f5758['push'](_0x2f5758['shift']());}};_0x6f16c2(++_0x1cc9d7);}(_0xfb30,0x1df));var _0x0fb3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfb30[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0fb3('0x0'));var util=require(_0x0fb3('0x1'));var moment=require(_0x0fb3('0x2'));var BPromise=require('bluebird');var rs=require(_0x0fb3('0x3'));var fs=require('fs');var Redis=require(_0x0fb3('0x4'));var db=require(_0x0fb3('0x5'))['db'];var utils=require(_0x0fb3('0x6'));var logger=require(_0x0fb3('0x7'))(_0x0fb3('0x8'));var config=require(_0x0fb3('0x9'));var jayson=require(_0x0fb3('0xa'));var client=jayson[_0x0fb3('0xb')]['http']({'port':0x232a});config[_0x0fb3('0xc')]=_['defaults'](config[_0x0fb3('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0fb3('0xd'))(new Redis(config[_0x0fb3('0xc')]));require(_0x0fb3('0xe'))[_0x0fb3('0xf')](socket);function respondWithRpcPromise(_0x18eccf,_0x1dd2b8,_0x4d3067){return new BPromise(function(_0x292bf6,_0x58b4ca){return client[_0x0fb3('0x10')](_0x18eccf,_0x4d3067)[_0x0fb3('0x11')](function(_0x1b1ec6){logger[_0x0fb3('0x12')](_0x0fb3('0x13'),_0x1dd2b8,_0x0fb3('0x14'));logger['debug']('User,\x20%s,\x20%s,\x20%s',_0x1dd2b8,_0x0fb3('0x14'),JSON[_0x0fb3('0x15')](_0x1b1ec6));if(_0x1b1ec6[_0x0fb3('0x16')]){if(_0x1b1ec6['error'][_0x0fb3('0x17')]===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x1dd2b8,_0x1b1ec6[_0x0fb3('0x16')]['message']);return _0x58b4ca(_0x1b1ec6[_0x0fb3('0x16')][_0x0fb3('0x18')]);}logger['error']('User,\x20%s,\x20%s',_0x1dd2b8,_0x1b1ec6[_0x0fb3('0x16')][_0x0fb3('0x18')]);return _0x292bf6(_0x1b1ec6[_0x0fb3('0x16')]['message']);}else{logger['info'](_0x0fb3('0x13'),_0x1dd2b8,_0x0fb3('0x14'));_0x292bf6(_0x1b1ec6[_0x0fb3('0x19')][_0x0fb3('0x18')]);}})[_0x0fb3('0x1a')](function(_0x4f6627){logger[_0x0fb3('0x16')](_0x0fb3('0x13'),_0x1dd2b8,_0x4f6627);_0x58b4ca(_0x4f6627);});});}exports['GetUser']=function(_0x23e3d7){var _0x22b9ec=this;return new Promise(function(_0x5d6430,_0x1bf16d){return db[_0x0fb3('0x1b')]['findAll']({'raw':_0x23e3d7[_0x0fb3('0x1c')]?_0x23e3d7[_0x0fb3('0x1c')][_0x0fb3('0x1d')]===undefined?!![]:![]:!![],'where':_0x23e3d7[_0x0fb3('0x1c')]?_0x23e3d7['options'][_0x0fb3('0x1e')]||null:null,'attributes':_0x23e3d7['options']?_0x23e3d7[_0x0fb3('0x1c')]['attributes']||null:null,'limit':_0x23e3d7['options']?_0x23e3d7[_0x0fb3('0x1c')][_0x0fb3('0x1f')]||null:null,'include':_0x23e3d7[_0x0fb3('0x1c')]?_0x23e3d7[_0x0fb3('0x1c')][_0x0fb3('0x20')]?_[_0x0fb3('0x21')](_0x23e3d7['options']['include'],function(_0x21b654){return{'model':db[_0x21b654[_0x0fb3('0x22')]],'as':_0x21b654['as'],'attributes':_0x21b654['attributes'],'include':_0x21b654[_0x0fb3('0x20')]?_['map'](_0x21b654[_0x0fb3('0x20')],function(_0x24eb41){return{'model':db[_0x24eb41[_0x0fb3('0x22')]],'as':_0x24eb41['as'],'attributes':_0x24eb41['attributes'],'include':_0x24eb41[_0x0fb3('0x20')]?_[_0x0fb3('0x21')](_0x24eb41['include'],function(_0x3c6001){return{'model':db[_0x3c6001[_0x0fb3('0x22')]],'as':_0x3c6001['as'],'attributes':_0x3c6001[_0x0fb3('0x23')]};}):[]};}):[]};}):[]:[]})[_0x0fb3('0x11')](function(_0x32950b){logger[_0x0fb3('0x12')](_0x0fb3('0x24'),_0x23e3d7);logger[_0x0fb3('0x25')]('GetUser',_0x23e3d7,JSON['stringify'](_0x32950b));_0x5d6430(_0x32950b);})[_0x0fb3('0x1a')](function(_0x381934){logger[_0x0fb3('0x16')](_0x0fb3('0x24'),_0x381934[_0x0fb3('0x18')],_0x23e3d7);_0x1bf16d(_0x22b9ec['error'](0x1f4,_0x381934['message']));});});};exports['ShowUser']=function(_0x2ed54a){var _0x7197ea=this;return new Promise(function(_0x32eae1,_0x52d8b1){return db[_0x0fb3('0x1b')][_0x0fb3('0x26')]({'raw':_0x2ed54a[_0x0fb3('0x1c')]?_0x2ed54a['options'][_0x0fb3('0x1d')]===undefined?!![]:![]:!![],'where':_0x2ed54a[_0x0fb3('0x1c')]?_0x2ed54a[_0x0fb3('0x1c')][_0x0fb3('0x1e')]||null:null,'attributes':_0x2ed54a['options']?_0x2ed54a[_0x0fb3('0x1c')]['attributes']||null:null,'include':_0x2ed54a['options']?_0x2ed54a[_0x0fb3('0x1c')][_0x0fb3('0x20')]?_[_0x0fb3('0x21')](_0x2ed54a['options'][_0x0fb3('0x20')],function(_0x4cb8c4){return{'model':db[_0x4cb8c4[_0x0fb3('0x22')]],'as':_0x4cb8c4['as'],'attributes':_0x4cb8c4[_0x0fb3('0x23')],'include':_0x4cb8c4[_0x0fb3('0x20')]?_[_0x0fb3('0x21')](_0x4cb8c4[_0x0fb3('0x20')],function(_0x330e42){return{'model':db[_0x330e42['model']],'as':_0x330e42['as'],'attributes':_0x330e42[_0x0fb3('0x23')],'include':_0x330e42[_0x0fb3('0x20')]?_[_0x0fb3('0x21')](_0x330e42[_0x0fb3('0x20')],function(_0x3caa84){return{'model':db[_0x3caa84[_0x0fb3('0x22')]],'as':_0x3caa84['as'],'attributes':_0x3caa84[_0x0fb3('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45c705){logger['info'](_0x0fb3('0x27'),_0x2ed54a);logger[_0x0fb3('0x25')](_0x0fb3('0x27'),_0x2ed54a,JSON[_0x0fb3('0x15')](_0x45c705));_0x32eae1(_0x45c705);})[_0x0fb3('0x1a')](function(_0x1c513a){logger[_0x0fb3('0x16')]('ShowUser',_0x1c513a[_0x0fb3('0x18')],_0x2ed54a);_0x52d8b1(_0x7197ea[_0x0fb3('0x16')](0x1f4,_0x1c513a[_0x0fb3('0x18')]));});});};exports[_0x0fb3('0x28')]=function(_0x23abfe){var _0x49a701=this;return new Promise(function(_0x5b1ad6,_0x57b30f){var _0x4d896f;return db[_0x0fb3('0x1b')]['find']({'where':_0x23abfe[_0x0fb3('0x1c')][_0x0fb3('0x1e')]||{},'attributes':['id',_0x0fb3('0x29'),_0x0fb3('0x2a'),_0x0fb3('0x2b'),'interface']})['then'](function(_0x389785){if(_0x389785){_0x4d896f=_0x389785;return db[_0x0fb3('0x2c')][_0x0fb3('0x2d')]({'paused':0x1},{'where':{'UserId':_0x4d896f['id']},'individualHooks':!![]});}})[_0x0fb3('0x11')](function(){if(_0x4d896f){return db[_0x0fb3('0x2e')][_0x0fb3('0x2f')]({'where':{'membername':_0x4d896f[_0x0fb3('0x29')],'type':_0x0fb3('0x30'),'exitAt':null}});}})[_0x0fb3('0x11')](function(_0x2276fd){if(_0x4d896f){if(_0x2276fd&&_0x2276fd[_0x0fb3('0x31')]){var _0x40abb6=moment()[_0x0fb3('0x32')](_0x0fb3('0x33'));for(var _0xfd4c1c=0x0,_0x22123e=_0x2276fd[_0x0fb3('0x31')];_0xfd4c1c<_0x22123e;_0xfd4c1c++){_0x2276fd[_0xfd4c1c][_0x0fb3('0x34')]({'exitAt':_0x40abb6});}}}})[_0x0fb3('0x11')](function(){if(_0x4d896f){var _0x18309c=[];var _0xf41299=utils[_0x0fb3('0x35')]();_0xf41299[_0x0fb3('0x36')](function(_0x367ab7){_0x18309c[_0x0fb3('0x37')]({'channel':_0x367ab7,'membername':_0x4d896f[_0x0fb3('0x29')],'interface':_[_0x0fb3('0x38')](_0x4d896f[_0x0fb3('0x39')])?util[_0x0fb3('0x32')](_0x0fb3('0x3a'),_0x4d896f[_0x0fb3('0x29')]):_0x4d896f['interface'],'type':_0x0fb3('0x30'),'enterAt':moment()[_0x0fb3('0x32')](_0x0fb3('0x33')),'data1':_0x23abfe[_0x0fb3('0x3b')]['type']||'DEFAULT\x20PAUSE','role':_0x4d896f[_0x0fb3('0x2a')],'internal':_0x4d896f[_0x0fb3('0x2b')],'uniqueid':_0x23abfe[_0x0fb3('0x3b')]['uniqueid']||null});});return db['MemberReport'][_0x0fb3('0x3c')](_0x18309c,{'individualHooks':!![]});}})['then'](function(){if(_0x4d896f){return _0x4d896f[_0x0fb3('0x2d')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x23abfe[_0x0fb3('0x3b')][_0x0fb3('0x3d')]||_0x0fb3('0x3e'),'lastPauseAt':moment()[_0x0fb3('0x32')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x0fb3('0x11')](function(_0x6eaf7f){_0x5b1ad6(_0x6eaf7f);})[_0x0fb3('0x1a')](function(_0x4cc0cd){_0x57b30f(_0x49a701[_0x0fb3('0x16')](0x1f4,_0x4cc0cd[_0x0fb3('0x18')]));});});};exports[_0x0fb3('0x3f')]=function(_0x24b41c){var _0x5d4196=this;return new Promise(function(_0xff232,_0x51c817){var _0x2553a0;return db['User'][_0x0fb3('0x40')]({'where':_0x24b41c[_0x0fb3('0x1c')][_0x0fb3('0x1e')]||{},'attributes':['id',_0x0fb3('0x29')]})[_0x0fb3('0x11')](function(_0x27b860){if(_0x27b860){_0x2553a0=_0x27b860;if(_0x24b41c[_0x0fb3('0x3b')][_0x0fb3('0x41')]&&!utils[_0x0fb3('0x42')](_0x24b41c['body'][_0x0fb3('0x41')])){throw new Error(_0x0fb3('0x43'));}switch(_0x24b41c[_0x0fb3('0x3b')][_0x0fb3('0x41')]){case _0x0fb3('0x44'):return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x2553a0['id']}})['then'](function(){return db[_0x0fb3('0x2e')][_0x0fb3('0x26')]({'where':{'channel':_0x24b41c['body'][_0x0fb3('0x41')],'membername':_0x2553a0[_0x0fb3('0x29')],'type':'PAUSE','exitAt':null}});})[_0x0fb3('0x11')](function(_0x24ae5e){if(_0x24ae5e){return _0x24ae5e[_0x0fb3('0x2d')]({'exitAt':moment()[_0x0fb3('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0fb3('0x45')},{'individualHooks':!![]});}return null;})[_0x0fb3('0x11')](function(){return _0x2553a0[_0x0fb3('0x2d')]({'voicePause':![]});});case'mail':case _0x0fb3('0x46'):case _0x0fb3('0x47'):case _0x0fb3('0x48'):case'openchannel':case _0x0fb3('0x49'):return db[_0x0fb3('0x2e')][_0x0fb3('0x26')]({'where':{'channel':_0x24b41c[_0x0fb3('0x3b')][_0x0fb3('0x41')],'membername':_0x2553a0[_0x0fb3('0x29')],'type':_0x0fb3('0x30'),'exitAt':null}})[_0x0fb3('0x11')](function(_0x179774){return _0x179774[_0x0fb3('0x2d')]({'exitAt':moment()[_0x0fb3('0x32')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x0fb3('0x45')},{'individualHooks':!![]});})[_0x0fb3('0x11')](function(){var _0x3680b2={};_[_0x0fb3('0x4a')](_0x3680b2,util[_0x0fb3('0x32')](_0x0fb3('0x4b'),_0x24b41c[_0x0fb3('0x3b')][_0x0fb3('0x41')],_0x0fb3('0x4c')),![]);return _0x2553a0[_0x0fb3('0x2d')](_0x3680b2);});default:return db['UserVoiceQueueRt'][_0x0fb3('0x2d')]({'paused':0x0},{'where':{'UserId':_0x2553a0['id']}})[_0x0fb3('0x11')](function(){return db[_0x0fb3('0x2e')]['findAll']({'where':{'membername':_0x2553a0[_0x0fb3('0x29')],'type':_0x0fb3('0x30'),'exitAt':null}});})[_0x0fb3('0x11')](function(_0x2d8a40){var _0x177f30=[];_0x2d8a40['forEach'](function(_0x45f7e0){_0x177f30[_0x0fb3('0x37')](_0x45f7e0['update']({'exitAt':moment()[_0x0fb3('0x32')](_0x0fb3('0x33')),'data2':_0x0fb3('0x45')}));});return BPromise[_0x0fb3('0x4d')](_0x177f30);})[_0x0fb3('0x11')](function(){return _0x2553a0[_0x0fb3('0x2d')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x0fb3('0x11')](function(_0x3af1fb){_0xff232(_0x3af1fb);})[_0x0fb3('0x1a')](function(_0x513bfe){_0x51c817(_0x5d4196[_0x0fb3('0x16')](0x1f4,_0x513bfe['message']));});});};exports[_0x0fb3('0x4e')]=function(_0xf6445){var _0x3d48e2=this;return new Promise(function(_0x4c9037,_0x1a15e8){var _0x1ab081;return db[_0x0fb3('0x1b')][_0x0fb3('0x40')]({'where':_0xf6445[_0x0fb3('0x1c')][_0x0fb3('0x1e')]||{},'attributes':['id','name']})[_0x0fb3('0x11')](function(_0xfdc669){if(_0xfdc669){_0x1ab081=_0xfdc669;return db[_0x0fb3('0x2c')]['destroy']({'where':{'membername':_0x1ab081[_0x0fb3('0x29')]},'individualHooks':!![]});}})[_0x0fb3('0x11')](function(){if(_0x1ab081){return db[_0x0fb3('0x2e')][_0x0fb3('0x2f')]({'where':{'membername':_0x1ab081[_0x0fb3('0x29')],'exitAt':null}});}})[_0x0fb3('0x11')](function(_0x5ee53e){if(_0x1ab081){if(_0x5ee53e&&_0x5ee53e[_0x0fb3('0x31')]){var _0x3aa970=[];_0x5ee53e[_0x0fb3('0x36')](function(_0x3d8ba2){_0x3aa970[_0x0fb3('0x37')](_0x3d8ba2[_0x0fb3('0x2d')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x0fb3('0x4d')](_0x3aa970);}}})['then'](function(){if(_0x1ab081){return _0x1ab081[_0x0fb3('0x2d')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x158d7a){_0x4c9037(_0x158d7a);})[_0x0fb3('0x1a')](function(_0x2a4f0d){_0x1a15e8(_0x3d48e2[_0x0fb3('0x16')](0x1f4,_0x2a4f0d[_0x0fb3('0x18')]));});});};exports[_0x0fb3('0x4f')]=function(_0x5cf475){var _0x4cf8fd=this;return new Promise(function(_0x1192dd,_0x52563d){var _0x474750;var _0xf5b701;var _0x10a3c0;var _0x206596;return db[_0x0fb3('0x1b')][_0x0fb3('0x40')]({'where':_0x5cf475['options'][_0x0fb3('0x1e')]||{},'attributes':['id',_0x0fb3('0x29'),'role','mobile','phone',_0x0fb3('0x2b'),_0x0fb3('0x50'),'interface']})['then'](function(_0x299208){if(_0x299208){_0x474750=_0x299208;_0x206596=_0x5cf475[_0x0fb3('0x3b')][_0x0fb3('0x39')]?_0x5cf475[_0x0fb3('0x3b')][_0x0fb3('0x39')]:util['format'](_0x0fb3('0x3a'),_0x474750[_0x0fb3('0x29')]);return db[_0x0fb3('0x1b')][_0x0fb3('0x51')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x474750['id']}}});}})[_0x0fb3('0x11')](function(_0x30f926){if(_0x30f926){_0x10a3c0=_0x30f926;return require(_0x0fb3('0x52'))['getLicense']();}})[_0x0fb3('0x11')](function(_0x584c7c){if(_0x584c7c&&_0x584c7c[_0x0fb3('0x53')]&&_0x10a3c0>=_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 diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index f51fc33..bc510dd 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 _0x8446=['removeListener','register','length','user:','./user.events','save','remove','update','emit'];(function(_0x3e5378,_0x2a5f6e){var _0xbbf176=function(_0x1a5581){while(--_0x1a5581){_0x3e5378['push'](_0x3e5378['shift']());}};_0xbbf176(++_0x2a5f6e);}(_0x8446,0x109));var _0x6844=function(_0x1ef446,_0x213fe7){_0x1ef446=_0x1ef446-0x0;var _0x4dbc00=_0x8446[_0x1ef446];return _0x4dbc00;};'use strict';var UserEvents=require(_0x6844('0x0'));var events=[_0x6844('0x1'),_0x6844('0x2'),_0x6844('0x3')];function createListener(_0x37ff03,_0x1aeaa3){return function(_0x22b059){_0x1aeaa3[_0x6844('0x4')](_0x37ff03,_0x22b059);};}function removeListener(_0x571795,_0x280c40){return function(){UserEvents[_0x6844('0x5')](_0x571795,_0x280c40);};}exports[_0x6844('0x6')]=function(_0x231abb){for(var _0x186c8d=0x0,_0x25f347=events[_0x6844('0x7')];_0x186c8d<_0x25f347;_0x186c8d++){var _0x43b3c5=events[_0x186c8d];var _0x4f0c0d=createListener(_0x6844('0x8')+_0x43b3c5,_0x231abb);UserEvents['on'](_0x43b3c5,_0x4f0c0d);}}; \ No newline at end of file +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 diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 670c6ca..d4e18b0 100644 --- a/server/api/userChatQueue/index.js +++ b/server/api/userChatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x1a05da,_0x1ea9ca){var _0x13471f=function(_0x2dd962){while(--_0x2dd962){_0x1a05da['push'](_0x1a05da['shift']());}};_0x13471f(++_0x1ea9ca);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4327fe,_0x4f8040){_0x4327fe=_0x4327fe-0x0;var _0x138651=_0xcb91[_0x4327fe];return _0x138651;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_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 diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index a5ca44a..0956bd8 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 _0x55a7=['INTEGER','exports'];(function(_0x2a55f8,_0x540ac4){var _0x245efd=function(_0x4dbc19){while(--_0x4dbc19){_0x2a55f8['push'](_0x2a55f8['shift']());}};_0x245efd(++_0x540ac4);}(_0x55a7,0x111));var _0x755a=function(_0x1db704,_0x77bc9c){_0x1db704=_0x1db704-0x0;var _0x325a39=_0x55a7[_0x1db704];return _0x325a39;};'use strict';var Sequelize=require('sequelize');module[_0x755a('0x0')]={'penalty':{'type':Sequelize[_0x755a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index ae84ec1..fb89153 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 _0xebae=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1d1854,_0x4a83b1){var _0x5b2acb=function(_0x29ae13){while(--_0x29ae13){_0x1d1854['push'](_0x1d1854['shift']());}};_0x5b2acb(++_0x4a83b1);}(_0xebae,0x1c6));var _0xeeba=function(_0x35cc24,_0x299db6){_0x35cc24=_0x35cc24-0x0;var _0x137359=_0xebae[_0x35cc24];return _0x137359;};'use strict';var _=require(_0xeeba('0x0'));var util=require(_0xeeba('0x1'));var logger=require(_0xeeba('0x2'))(_0xeeba('0x3'));var moment=require(_0xeeba('0x4'));var BPromise=require('bluebird');var rp=require(_0xeeba('0x5'));var fs=require('fs');var path=require(_0xeeba('0x6'));var rimraf=require(_0xeeba('0x7'));var config=require(_0xeeba('0x8'));var attributes=require(_0xeeba('0x9'));module[_0xeeba('0xa')]=function(_0x455239,_0x3b52f5){return _0x455239[_0xeeba('0xb')](_0xeeba('0xc'),attributes,{'tableName':_0xeeba('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 695cc14..7e677fa 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 _0x1174=['http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x268b3d,_0xcff35e){var _0x34548c=function(_0x316431){while(--_0x316431){_0x268b3d['push'](_0x268b3d['shift']());}};_0x34548c(++_0xcff35e);}(_0x1174,0x9d));var _0x4117=function(_0x1ed051,_0xc52dfb){_0x1ed051=_0x1ed051-0x0;var _0x55664a=_0x1174[_0x1ed051];return _0x55664a;};'use strict';var _=require('lodash');var util=require(_0x4117('0x0'));var moment=require(_0x4117('0x1'));var BPromise=require(_0x4117('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4117('0x3'));var db=require(_0x4117('0x4'))['db'];var utils=require(_0x4117('0x5'));var logger=require(_0x4117('0x6'))(_0x4117('0x7'));var config=require(_0x4117('0x8'));var jayson=require(_0x4117('0x9'));var client=jayson[_0x4117('0xa')][_0x4117('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x535a2b,_0x1e4cb2,_0x50c4d4){return new BPromise(function(_0x54fd46,_0x24392d){return client[_0x4117('0xc')](_0x535a2b,_0x50c4d4)[_0x4117('0xd')](function(_0x3de0ed){logger[_0x4117('0xe')](_0x4117('0xf'),_0x1e4cb2,'request\x20sent');logger[_0x4117('0x10')](_0x4117('0x11'),_0x1e4cb2,_0x4117('0x12'),JSON['stringify'](_0x3de0ed));if(_0x3de0ed[_0x4117('0x13')]){if(_0x3de0ed[_0x4117('0x13')][_0x4117('0x14')]===0x1f4){logger[_0x4117('0x13')](_0x4117('0xf'),_0x1e4cb2,_0x3de0ed['error'][_0x4117('0x15')]);return _0x24392d(_0x3de0ed[_0x4117('0x13')][_0x4117('0x15')]);}logger[_0x4117('0x13')](_0x4117('0xf'),_0x1e4cb2,_0x3de0ed[_0x4117('0x13')]['message']);return _0x54fd46(_0x3de0ed['error']['message']);}else{logger[_0x4117('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x1e4cb2,'request\x20sent');_0x54fd46(_0x3de0ed[_0x4117('0x16')][_0x4117('0x15')]);}})[_0x4117('0x17')](function(_0x272a5b){logger[_0x4117('0x13')](_0x4117('0xf'),_0x1e4cb2,_0x272a5b);_0x24392d(_0x272a5b);});});} \ No newline at end of file +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 diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 9c21353..13f6e84 100644 --- a/server/api/userFaxQueue/index.js +++ b/server/api/userFaxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x215cad,_0x18302e){var _0x4e1df9=function(_0x358d2e){while(--_0x358d2e){_0x215cad['push'](_0x215cad['shift']());}};_0x4e1df9(++_0x18302e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xa9e0[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +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 diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index a55ade3..a73adb9 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 _0x6e5d=['exports','INTEGER','STRING'];(function(_0x4f0e62,_0x28e44f){var _0x117ab8=function(_0x1a74bb){while(--_0x1a74bb){_0x4f0e62['push'](_0x4f0e62['shift']());}};_0x117ab8(++_0x28e44f);}(_0x6e5d,0x1d1));var _0xd6e5=function(_0x2bd16f,_0x48e748){_0x2bd16f=_0x2bd16f-0x0;var _0x4000d7=_0x6e5d[_0x2bd16f];return _0x4000d7;};'use strict';var Sequelize=require('sequelize');module[_0xd6e5('0x0')]={'penalty':{'type':Sequelize[_0xd6e5('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd6e5('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index f438227..d7a2827 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 _0x7ee5=['./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e840d,_0x35609b){var _0x1850f2=function(_0x467304){while(--_0x467304){_0x1e840d['push'](_0x1e840d['shift']());}};_0x1850f2(++_0x35609b);}(_0x7ee5,0x147));var _0x57ee=function(_0x265f52,_0x2d59d1){_0x265f52=_0x265f52-0x0;var _0x108c85=_0x7ee5[_0x265f52];return _0x108c85;};'use strict';var _=require(_0x57ee('0x0'));var util=require(_0x57ee('0x1'));var logger=require(_0x57ee('0x2'))('api');var moment=require(_0x57ee('0x3'));var BPromise=require(_0x57ee('0x4'));var rp=require(_0x57ee('0x5'));var fs=require('fs');var path=require(_0x57ee('0x6'));var rimraf=require(_0x57ee('0x7'));var config=require(_0x57ee('0x8'));var attributes=require(_0x57ee('0x9'));module[_0x57ee('0xa')]=function(_0x431ee2,_0x53b6f5){return _0x431ee2[_0x57ee('0xb')](_0x57ee('0xc'),attributes,{'tableName':_0x57ee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index d8314c0..5141c83 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 _0x60c3=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util'];(function(_0x23bbd9,_0x50dc0e){var _0x712a8a=function(_0x4cfaaa){while(--_0x4cfaaa){_0x23bbd9['push'](_0x23bbd9['shift']());}};_0x712a8a(++_0x50dc0e);}(_0x60c3,0x139));var _0x360c=function(_0x2dd00c,_0x12cb31){_0x2dd00c=_0x2dd00c-0x0;var _0x1371a7=_0x60c3[_0x2dd00c];return _0x1371a7;};'use strict';var _=require(_0x360c('0x0'));var util=require(_0x360c('0x1'));var moment=require(_0x360c('0x2'));var BPromise=require('bluebird');var rs=require(_0x360c('0x3'));var fs=require('fs');var Redis=require(_0x360c('0x4'));var db=require(_0x360c('0x5'))['db'];var utils=require(_0x360c('0x6'));var logger=require(_0x360c('0x7'))(_0x360c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x360c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9d96ed,_0x226931,_0x1d12d6){return new BPromise(function(_0x37148d,_0x58f994){return client[_0x360c('0xa')](_0x9d96ed,_0x1d12d6)[_0x360c('0xb')](function(_0x183dda){logger['info'](_0x360c('0xc'),_0x226931,_0x360c('0xd'));logger[_0x360c('0xe')](_0x360c('0xf'),_0x226931,'request\x20sent',JSON['stringify'](_0x183dda));if(_0x183dda['error']){if(_0x183dda[_0x360c('0x10')][_0x360c('0x11')]===0x1f4){logger[_0x360c('0x10')](_0x360c('0xc'),_0x226931,_0x183dda[_0x360c('0x10')][_0x360c('0x12')]);return _0x58f994(_0x183dda[_0x360c('0x10')][_0x360c('0x12')]);}logger[_0x360c('0x10')](_0x360c('0xc'),_0x226931,_0x183dda[_0x360c('0x10')][_0x360c('0x12')]);return _0x37148d(_0x183dda[_0x360c('0x10')][_0x360c('0x12')]);}else{logger[_0x360c('0x13')](_0x360c('0xc'),_0x226931,'request\x20sent');_0x37148d(_0x183dda['result']['message']);}})[_0x360c('0x14')](function(_0x40d12a){logger[_0x360c('0x10')](_0x360c('0xc'),_0x226931,_0x40d12a);_0x58f994(_0x40d12a);});});} \ No newline at end of file +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 diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c8107f1..533694a 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(_0x279c3a,_0x126299){var _0x323608=function(_0x3a3cdd){while(--_0x3a3cdd){_0x279c3a['push'](_0x279c3a['shift']());}};_0x323608(++_0x126299);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x51ec61,_0xf9d1e3){_0x51ec61=_0x51ec61-0x0;var _0x223200=_0xcb91[_0x51ec61];return _0x223200;};'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(_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 diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 8c07a6c..de43d5a 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 _0x5b3b=['sequelize','INTEGER'];(function(_0x45f7fe,_0x2f53ee){var _0x509065=function(_0x25674c){while(--_0x25674c){_0x45f7fe['push'](_0x45f7fe['shift']());}};_0x509065(++_0x2f53ee);}(_0x5b3b,0xd2));var _0xb5b3=function(_0x45cd61,_0x39ace3){_0x45cd61=_0x45cd61-0x0;var _0x5904c2=_0x5b3b[_0x45cd61];return _0x5904c2;};'use strict';var Sequelize=require(_0xb5b3('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xb5b3('0x1')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 36080aa..20f3483 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 _0xd22a=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','user_has_mail_queues','lodash','../../config/logger','moment'];(function(_0x29f60e,_0x295358){var _0x587be1=function(_0x15607e){while(--_0x15607e){_0x29f60e['push'](_0x29f60e['shift']());}};_0x587be1(++_0x295358);}(_0xd22a,0x126));var _0xad22=function(_0x5953f3,_0x2f3451){_0x5953f3=_0x5953f3-0x0;var _0x1d3991=_0xd22a[_0x5953f3];return _0x1d3991;};'use strict';var _=require(_0xad22('0x0'));var util=require('util');var logger=require(_0xad22('0x1'))('api');var moment=require(_0xad22('0x2'));var BPromise=require(_0xad22('0x3'));var rp=require(_0xad22('0x4'));var fs=require('fs');var path=require(_0xad22('0x5'));var rimraf=require(_0xad22('0x6'));var config=require(_0xad22('0x7'));var attributes=require('./userMailQueue.attributes');module[_0xad22('0x8')]=function(_0x34c134,_0x2db6ee){return _0x34c134[_0xad22('0x9')]('UserMailQueue',attributes,{'tableName':_0xad22('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 0ce05dc..cbcd8f3 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','UserMailQueue,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x1b0dce,_0x4ac905){var _0xf1dd32=function(_0x2b8019){while(--_0x2b8019){_0x1b0dce['push'](_0x1b0dce['shift']());}};_0xf1dd32(++_0x4ac905);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x5fc3[_0x4347ec];return _0x4c8314;};'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')]('UserMailQueue,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('UserMailQueue,\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']('UserMailQueue,\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);});});} \ No newline at end of file +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 diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 757d783..7468afd 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 _0xad23=['sendUserNotification','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','isAuthenticated'];(function(_0x249d99,_0x16b584){var _0x5bfb05=function(_0x4f4d67){while(--_0x4f4d67){_0x249d99['push'](_0x249d99['shift']());}};_0x5bfb05(++_0x16b584);}(_0xad23,0x1be));var _0x3ad2=function(_0x47bf39,_0x16d37b){_0x47bf39=_0x47bf39-0x0;var _0x5b1a90=_0xad23[_0x47bf39];return _0x5b1a90;};'use strict';var multer=require(_0x3ad2('0x0'));var util=require('util');var path=require(_0x3ad2('0x1'));var timeout=require(_0x3ad2('0x2'));var express=require('express');var router=express[_0x3ad2('0x3')]();var fs_extra=require(_0x3ad2('0x4'));var auth=require(_0x3ad2('0x5'));var interaction=require(_0x3ad2('0x6'));var config=require(_0x3ad2('0x7'));var controller=require(_0x3ad2('0x8'));router['post']('/',auth[_0x3ad2('0x9')](),controller[_0x3ad2('0xa')]);module[_0x3ad2('0xb')]=router; \ No newline at end of file +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 diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 626edfd..f9778aa 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 _0xbb27=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x2d513d,_0x451a51){var _0x141b16=function(_0x4a6474){while(--_0x4a6474){_0x2d513d['push'](_0x2d513d['shift']());}};_0x141b16(++_0x451a51);}(_0xbb27,0x15e));var _0x7bb2=function(_0x106be0,_0x3d8500){_0x106be0=_0x106be0-0x0;var _0x35176a=_0xbb27[_0x106be0];return _0x35176a;};'use strict';var Sequelize=require(_0x7bb2('0x0'));module[_0x7bb2('0x1')]={'body':{'type':Sequelize[_0x7bb2('0x2')]},'senderName':{'type':Sequelize[_0x7bb2('0x3')]},'recipientsId':{'type':Sequelize[_0x7bb2('0x2')]},'recipientsDescription':{'type':Sequelize[_0x7bb2('0x3')]},'beep':{'type':Sequelize[_0x7bb2('0x4')]}}; \ No newline at end of file +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 diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index 7296cec..cf20d56 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 _0x17b6=['path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','isEmpty','recipientsDescription','SenderId','then','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','startCase','User','union','queue','replace','Queue','ids','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x133f6d,_0x5ad0a4){var _0x2d5a8b=function(_0x460213){while(--_0x460213){_0x133f6d['push'](_0x133f6d['shift']());}};_0x2d5a8b(++_0x5ad0a4);}(_0x17b6,0x124));var _0x617b=function(_0x11dce0,_0x115c1d){_0x11dce0=_0x11dce0-0x0;var _0x47df8b=_0x17b6[_0x11dce0];return _0x47df8b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x617b('0x0'));var zipdir=require(_0x617b('0x1'));var jsonpatch=require(_0x617b('0x2'));var rp=require(_0x617b('0x3'));var moment=require(_0x617b('0x4'));var BPromise=require(_0x617b('0x5'));var Mustache=require(_0x617b('0x6'));var util=require(_0x617b('0x7'));var path=require(_0x617b('0x8'));var sox=require(_0x617b('0x9'));var csv=require(_0x617b('0xa'));var ejs=require(_0x617b('0xb'));var fs=require('fs');var fs_extra=require(_0x617b('0xc'));var _=require(_0x617b('0xd'));var squel=require('squel');var crypto=require(_0x617b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x617b('0xf'));var toCsv=require(_0x617b('0xa'));var querystring=require('querystring');var Papa=require(_0x617b('0x10'));var Redis=require(_0x617b('0x11'));var authService=require(_0x617b('0x12'));var qs=require(_0x617b('0x13'));var as=require(_0x617b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x617b('0x15'));var utils=require(_0x617b('0x16'));var config=require(_0x617b('0x17'));var licenseUtil=require(_0x617b('0x18'));var db=require('../../mysqldb')['db'];config[_0x617b('0x19')]=_[_0x617b('0x1a')](config[_0x617b('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x617b('0x1b'))(new Redis(config[_0x617b('0x19')]));require('./userNotification.socket')['register'](socket);function respondWithStatusCode(_0x456596,_0x325298){_0x325298=_0x325298||0xcc;return function(_0x2855f5){if(_0x2855f5){return _0x456596[_0x617b('0x1c')](_0x325298);}return _0x456596[_0x617b('0x1d')](_0x325298)['end']();};}function respondWithResult(_0x1fd94a,_0x4a593e){_0x4a593e=_0x4a593e||0xc8;return function(_0x369fbe){if(_0x369fbe){return _0x1fd94a[_0x617b('0x1d')](_0x4a593e)[_0x617b('0x1e')](_0x369fbe);}};}function respondWithFilteredResult(_0x3f6130,_0x178290){return function(_0x31614f){if(_0x31614f){var _0x1ebb56=typeof _0x178290[_0x617b('0x1f')]===_0x617b('0x20')&&typeof _0x178290[_0x617b('0x21')]===_0x617b('0x20');var _0x6e1c2f=_0x31614f[_0x617b('0x22')];var _0x2598ed=_0x1ebb56?0x0:_0x178290[_0x617b('0x1f')];var _0x2353ce=_0x1ebb56?_0x31614f['count']:_0x178290['offset']+_0x178290[_0x617b('0x21')];var _0x1b05b2;if(_0x2353ce>=_0x6e1c2f){_0x2353ce=_0x6e1c2f;_0x1b05b2=0xc8;}else{_0x1b05b2=0xce;}_0x3f6130[_0x617b('0x1d')](_0x1b05b2);return _0x3f6130[_0x617b('0x23')]('Content-Range',_0x2598ed+'-'+_0x2353ce+'/'+_0x6e1c2f)[_0x617b('0x1e')](_0x31614f);}return null;};}function patchUpdates(_0x9488ea){return function(_0x27fdfc){try{jsonpatch[_0x617b('0x24')](_0x27fdfc,_0x9488ea,!![]);}catch(_0x41ea08){return BPromise[_0x617b('0x25')](_0x41ea08);}return _0x27fdfc[_0x617b('0x26')]();};}function saveUpdates(_0x2267df,_0x58f3b8){return function(_0x55d4fa){if(_0x55d4fa){return _0x55d4fa[_0x617b('0x27')](_0x2267df)['then'](function(_0x33a8ea){return _0x33a8ea;});}return null;};}function removeEntity(_0x1cda74,_0x5752e1){return function(_0x4ef990){if(_0x4ef990){return _0x4ef990[_0x617b('0x28')]()['then'](function(){_0x1cda74[_0x617b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x441857,_0x3806d7){return function(_0x18234a){if(!_0x18234a){_0x441857[_0x617b('0x1c')](0x194);}return _0x18234a;};}function handleError(_0x1e5544,_0x45a9e4){_0x45a9e4=_0x45a9e4||0x1f4;return function(_0x143f9e){logger[_0x617b('0x29')](_0x143f9e[_0x617b('0x2a')]);if(_0x143f9e[_0x617b('0x2b')]){delete _0x143f9e[_0x617b('0x2b')];}_0x1e5544[_0x617b('0x1d')](_0x45a9e4)['send'](_0x143f9e);};}exports[_0x617b('0x2c')]=function(_0x3f0020,_0x4750c0,_0x129f53){if(!_0x3f0020[_0x617b('0x2d')]['hasOwnProperty'](_0x617b('0x2e'))&&!_0x3f0020[_0x617b('0x2d')][_0x617b('0x2f')](_0x617b('0x30'))){throw new db[(_0x617b('0x31'))][(_0x617b('0x32'))](_0x617b('0x33'));}else{if(_0x3f0020['body'][_0x617b('0x2f')]('TemplateId')&&!_0x3f0020[_0x617b('0x2d')]['hasOwnProperty'](_0x617b('0x34'))){throw new db[(_0x617b('0x31'))][(_0x617b('0x32'))](_0x617b('0x35'));}if(!_0x3f0020[_0x617b('0x2d')]['hasOwnProperty'](_0x617b('0x36'))){throw new db['Sequelize'][(_0x617b('0x32'))](_0x617b('0x37'));}else{try{var _0x1b9e2d=JSON[_0x617b('0x38')](_0x3f0020[_0x617b('0x2d')][_0x617b('0x36')]);}catch(_0x39b046){logger[_0x617b('0x29')](_0x39b046);throw new db['Sequelize'][(_0x617b('0x32'))](_0x617b('0x39'));}var _0x5ac40b=['chatqueue',_0x617b('0x3a'),_0x617b('0x3b'),_0x617b('0x3c'),_0x617b('0x3d'),_0x617b('0x3e'),_0x617b('0x3f'),_0x617b('0x40'),_0x617b('0x41')];if(_['some'](_0x1b9e2d,function(_0x3338a9){return!_[_0x617b('0x42')](_0x5ac40b,_0x3338a9[_0x617b('0x43')][_0x617b('0x44')]());})){throw new db[(_0x617b('0x31'))]['ValidationError'](_0x617b('0x45'));}}}var _0x10c0a1={};_0x10c0a1[_0x617b('0x46')]=_0x3f0020[_0x617b('0x2d')]['hasOwnProperty'](_0x617b('0x46'))?_0x3f0020[_0x617b('0x2d')][_0x617b('0x46')]:_0x3f0020[_0x617b('0x41')]['fullname'];_0x10c0a1['recipientsDescription']=_[_0x617b('0x47')](_0x3f0020[_0x617b('0x2d')][_0x617b('0x48')])?null:_0x3f0020[_0x617b('0x2d')][_0x617b('0x48')];_0x10c0a1['beep']=_0x3f0020['body']['beep']||![];_0x10c0a1[_0x617b('0x49')]=_0x3f0020[_0x617b('0x41')]['id'];return getContent(_0x3f0020[_0x617b('0x2d')])[_0x617b('0x4a')](function(_0x375daa){_0x10c0a1['body']=_0x375daa;return getRecipients(_0x1b9e2d);})[_0x617b('0x4a')](function(_0x4b14e){_0x10c0a1[_0x617b('0x4b')]=_[_0x617b('0x4c')](_0x4b14e)['join'](',');return db[_0x617b('0x4d')][_0x617b('0x4e')](function(_0x3c326c){return db[_0x617b('0x4f')][_0x617b('0x50')](_0x10c0a1,{'raw':!![],'transaction':_0x3c326c})[_0x617b('0x4a')](function(_0x4d53c1){var _0x25f801={'sender':_0x10c0a1[_0x617b('0x46')],'description':_0x10c0a1['recipientsDescription'],'content':_0x10c0a1[_0x617b('0x2d')],'beep':_0x10c0a1['beep']};_0x4b14e[_0x617b('0x51')](function(_0x1c96e1){_0x25f801[_0x617b('0x52')]=_0x1c96e1;socket['emit'](_0x617b('0x53'),_0x25f801);});return _0x4d53c1;});});})[_0x617b('0x4a')](respondWithResult(_0x4750c0,0xc9))[_0x617b('0x54')](handleError(_0x4750c0,null));};function getContent(_0x480815){return new BPromise(function(_0xb559b,_0x432abe){if(_0x480815[_0x617b('0x2e')]){_0xb559b(_0x480815[_0x617b('0x2e')]);return;}return db[_0x617b('0x55')][_0x617b('0x56')]({'attributes':[_0x617b('0x57')],'where':{'id':_0x480815[_0x617b('0x30')]},'raw':!![]})[_0x617b('0x4a')](function(_0x1a3985){if(!_0x1a3985)throw new db[(_0x617b('0x31'))][(_0x617b('0x32'))](_0x617b('0x58'));var _0x5792b9=Mustache['render'](_0x1a3985[_0x617b('0x57')],_0x480815[_0x617b('0x34')]);_0xb559b(_0x5792b9);})['catch'](function(_0x5e574d){_0x432abe(_0x5e574d);});});}function getRecipients(_0xcf01de){return new BPromise(function(_0x3bb817,_0x38a7fe){var _0x5b15de=[];var _0x32272d=[];_0xcf01de[_0x617b('0x51')](function(_0x30681a){var _0x114757=_[_0x617b('0x59')](_0x30681a[_0x617b('0x43')][_0x617b('0x44')]());if(_0x114757===_0x617b('0x5a')){_0x5b15de=_[_0x617b('0x5b')](_0x5b15de,_0x30681a['ids']);}else{if(_[_0x617b('0x42')](_0x114757,_0x617b('0x5c')))_0x114757=_0x114757[_0x617b('0x5d')]('queue',_0x617b('0x5e'));_0x30681a[_0x617b('0x5f')][_0x617b('0x51')](function(_0x2c43e4){_0x32272d['push'](getAgents(_0x114757,_0x2c43e4));});}});return BPromise[_0x617b('0x60')](_0x32272d)[_0x617b('0x4a')](function(_0x2c942d){_0x5b15de=_[_0x617b('0x5b')](_0x5b15de,_[_0x617b('0x61')](_0x2c942d));_0x3bb817(_0x5b15de);})[_0x617b('0x54')](function(_0x27d9eb){_0x38a7fe(_0x27d9eb);});});}function getAgents(_0x26f468,_0x5aafa6){return new BPromise(function(_0x4813a,_0x22e6c5){return db[_0x26f468][_0x617b('0x56')]({'where':{'id':_0x5aafa6}})[_0x617b('0x4a')](function(_0x5e2287){return _0x5e2287[_0x617b('0x62')]({'attributes':['id'],'raw':!![]})[_0x617b('0x4a')](function(_0x54e77c){var _0x587465=_[_0x617b('0x63')](_0x54e77c,'id');_0x4813a(_0x587465);});})[_0x617b('0x54')](function(_0x42a924){_0x22e6c5(_0x42a924);});});} \ No newline at end of file +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 diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 9623f6f..dc890b6 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 _0x0163=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','UserNotification','setMaxListeners','save'];(function(_0x1b126a,_0x354ce0){var _0x1da353=function(_0xc5b173){while(--_0xc5b173){_0x1b126a['push'](_0x1b126a['shift']());}};_0x1da353(++_0x354ce0);}(_0x0163,0x8c));var _0x3016=function(_0x2b7424,_0x460f28){_0x2b7424=_0x2b7424-0x0;var _0x20ca54=_0x0163[_0x2b7424];return _0x20ca54;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x3016('0x0'))['db'][_0x3016('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x3016('0x2')](0x0);var events={'afterCreate':_0x3016('0x3'),'afterUpdate':_0x3016('0x4'),'afterDestroy':'remove'};function emitEvent(_0x27d1df){return function(_0x2cdf1e,_0x4aa4a2,_0x12a080){UserNotificationEvents[_0x3016('0x5')](_0x27d1df+':'+_0x2cdf1e['id'],_0x2cdf1e);UserNotificationEvents[_0x3016('0x5')](_0x27d1df,_0x2cdf1e);_0x12a080(null);};}for(var e in events){if(events[_0x3016('0x6')](e)){var event=events[e];UserNotification[_0x3016('0x7')](e,emitEvent(event));}}module[_0x3016('0x8')]=UserNotificationEvents; \ No newline at end of file +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 diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 01cd56b..1d9c717 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 _0x5a91=['lodash','util','api','moment','bluebird','request-promise','./userNotification.attributes','exports','define','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x5a91,0x1d4));var _0x15a9=function(_0x505d96,_0x49b92b){_0x505d96=_0x505d96-0x0;var _0x1116d7=_0x5a91[_0x505d96];return _0x1116d7;};'use strict';var _=require(_0x15a9('0x0'));var util=require(_0x15a9('0x1'));var logger=require('../../config/logger')(_0x15a9('0x2'));var moment=require(_0x15a9('0x3'));var BPromise=require(_0x15a9('0x4'));var rp=require(_0x15a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x15a9('0x6'));module[_0x15a9('0x7')]=function(_0x308716,_0x338ac8){return _0x308716[_0x15a9('0x8')]('UserNotification',attributes,{'tableName':_0x15a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x15a9('0xa'),'collate':_0x15a9('0xb')});}; \ No newline at end of file +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 diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 9eb16f0..d1b5444 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 _0xd0db=['randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird'];(function(_0x25606d,_0x564c55){var _0x392d34=function(_0x3b3953){while(--_0x3b3953){_0x25606d['push'](_0x25606d['shift']());}};_0x392d34(++_0x564c55);}(_0xd0db,0x10c));var _0xbd0d=function(_0x2cc49f,_0x18de35){_0x2cc49f=_0x2cc49f-0x0;var _0x28ac8c=_0xd0db[_0x2cc49f];return _0x28ac8c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbd0d('0x0'));var BPromise=require(_0xbd0d('0x1'));var rs=require(_0xbd0d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd0d('0x3'))['db'];var utils=require(_0xbd0d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbd0d('0x5'));var jayson=require(_0xbd0d('0x6'));var client=jayson[_0xbd0d('0x7')][_0xbd0d('0x8')]({'port':0x232a});config[_0xbd0d('0x9')]=_[_0xbd0d('0xa')](config[_0xbd0d('0x9')],{'host':_0xbd0d('0xb'),'port':0x18eb});var socket=require(_0xbd0d('0xc'))(new Redis(config[_0xbd0d('0x9')]));require(_0xbd0d('0xd'))[_0xbd0d('0xe')](socket);function respondWithRpcPromise(_0x28c4a2,_0x29a0d7,_0x52ef3b){return new BPromise(function(_0xa06f29,_0x2f4695){return client[_0xbd0d('0xf')](_0x28c4a2,_0x52ef3b)[_0xbd0d('0x10')](function(_0x4522b0){logger[_0xbd0d('0x11')](_0xbd0d('0x12'),_0x29a0d7,_0xbd0d('0x13'));logger[_0xbd0d('0x14')]('UserNotification,\x20%s,\x20%s,\x20%s',_0x29a0d7,'request\x20sent',JSON[_0xbd0d('0x15')](_0x4522b0));if(_0x4522b0[_0xbd0d('0x16')]){if(_0x4522b0[_0xbd0d('0x16')][_0xbd0d('0x17')]===0x1f4){logger[_0xbd0d('0x16')](_0xbd0d('0x12'),_0x29a0d7,_0x4522b0['error']['message']);return _0x2f4695(_0x4522b0[_0xbd0d('0x16')][_0xbd0d('0x18')]);}logger[_0xbd0d('0x16')](_0xbd0d('0x12'),_0x29a0d7,_0x4522b0[_0xbd0d('0x16')]['message']);return _0xa06f29(_0x4522b0[_0xbd0d('0x16')][_0xbd0d('0x18')]);}else{logger[_0xbd0d('0x11')](_0xbd0d('0x12'),_0x29a0d7,_0xbd0d('0x13'));_0xa06f29(_0x4522b0[_0xbd0d('0x19')][_0xbd0d('0x18')]);}})[_0xbd0d('0x1a')](function(_0x4c599d){logger[_0xbd0d('0x16')](_0xbd0d('0x12'),_0x29a0d7,_0x4c599d);_0x2f4695(_0x4c599d);});});} \ No newline at end of file +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 diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 7de8cfb..a50c1c9 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 _0xba0e=['./userNotification.events','save','remove','update','emit','removeListener','register','userNotification:'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xba0e,0x150));var _0xeba0=function(_0x28b4a2,_0x5d85b6){_0x28b4a2=_0x28b4a2-0x0;var _0x174b66=_0xba0e[_0x28b4a2];return _0x174b66;};'use strict';var UserNotificationEvents=require(_0xeba0('0x0'));var events=[_0xeba0('0x1'),_0xeba0('0x2'),_0xeba0('0x3')];function createListener(_0x76187a,_0x1a7777){return function(_0x4412d4){_0x1a7777[_0xeba0('0x4')](_0x76187a,_0x4412d4);};}function removeListener(_0x55e1fd,_0x22b853){return function(){UserNotificationEvents[_0xeba0('0x5')](_0x55e1fd,_0x22b853);};}exports[_0xeba0('0x6')]=function(_0x3652b5){for(var _0x2f79ed=0x0,_0x52d891=events['length'];_0x2f79ed<_0x52d891;_0x2f79ed++){var _0x4a8c60=events[_0x2f79ed];var _0x27450f=createListener(_0xeba0('0x7')+_0x4a8c60,_0x3652b5);UserNotificationEvents['on'](_0x4a8c60,_0x27450f);}}; \ No newline at end of file +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 diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index ee465f4..754c467 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x69062,_0x231f82){var _0x3dabab=function(_0xc96141){while(--_0xc96141){_0x69062['push'](_0x69062['shift']());}};_0x3dabab(++_0x231f82);}(_0x9c44,0x178));var _0x49c4=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x9c44[_0x160c73];return _0xd9302;};'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 _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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 9006424..cf8fbd5 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. * // * * // ************************************************************************* -'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index e4fd5ea..06910da 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 _0x16c5=['user_has_openchannel_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','UserOpenchannelQueue'];(function(_0x5d43d0,_0x590190){var _0x3f87d0=function(_0x288df2){while(--_0x288df2){_0x5d43d0['push'](_0x5d43d0['shift']());}};_0x3f87d0(++_0x590190);}(_0x16c5,0x90));var _0x516c=function(_0x2611c9,_0x10e7fb){_0x2611c9=_0x2611c9-0x0;var _0x5d7958=_0x16c5[_0x2611c9];return _0x5d7958;};'use strict';var _=require(_0x516c('0x0'));var util=require(_0x516c('0x1'));var logger=require(_0x516c('0x2'))('api');var moment=require(_0x516c('0x3'));var BPromise=require(_0x516c('0x4'));var rp=require(_0x516c('0x5'));var fs=require('fs');var path=require(_0x516c('0x6'));var rimraf=require(_0x516c('0x7'));var config=require(_0x516c('0x8'));var attributes=require(_0x516c('0x9'));module['exports']=function(_0x2db5df,_0x5b19e2){return _0x2db5df[_0x516c('0xa')](_0x516c('0xb'),attributes,{'tableName':_0x516c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index 8a7069b..aca738e 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 _0x3b39=['UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x3b39,0x6e));var _0x93b3=function(_0x4ab99,_0x219ed2){_0x4ab99=_0x4ab99-0x0;var _0x29e39c=_0x3b39[_0x4ab99];return _0x29e39c;};'use strict';var _=require('lodash');var util=require(_0x93b3('0x0'));var moment=require(_0x93b3('0x1'));var BPromise=require(_0x93b3('0x2'));var rs=require(_0x93b3('0x3'));var fs=require('fs');var Redis=require(_0x93b3('0x4'));var db=require(_0x93b3('0x5'))['db'];var utils=require(_0x93b3('0x6'));var logger=require(_0x93b3('0x7'))(_0x93b3('0x8'));var config=require(_0x93b3('0x9'));var jayson=require(_0x93b3('0xa'));var client=jayson[_0x93b3('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4018a5,_0x24318d,_0x474625){return new BPromise(function(_0x17bb8d,_0x5cf410){return client[_0x93b3('0xc')](_0x4018a5,_0x474625)[_0x93b3('0xd')](function(_0x4e0cc7){logger[_0x93b3('0xe')](_0x93b3('0xf'),_0x24318d,_0x93b3('0x10'));logger[_0x93b3('0x11')](_0x93b3('0x12'),_0x24318d,_0x93b3('0x10'),JSON[_0x93b3('0x13')](_0x4e0cc7));if(_0x4e0cc7[_0x93b3('0x14')]){if(_0x4e0cc7[_0x93b3('0x14')][_0x93b3('0x15')]===0x1f4){logger[_0x93b3('0x14')](_0x93b3('0xf'),_0x24318d,_0x4e0cc7[_0x93b3('0x14')][_0x93b3('0x16')]);return _0x5cf410(_0x4e0cc7[_0x93b3('0x14')][_0x93b3('0x16')]);}logger['error'](_0x93b3('0xf'),_0x24318d,_0x4e0cc7[_0x93b3('0x14')][_0x93b3('0x16')]);return _0x17bb8d(_0x4e0cc7[_0x93b3('0x14')][_0x93b3('0x16')]);}else{logger[_0x93b3('0xe')](_0x93b3('0xf'),_0x24318d,'request\x20sent');_0x17bb8d(_0x4e0cc7[_0x93b3('0x17')]['message']);}})[_0x93b3('0x18')](function(_0x38e3bb){logger['error'](_0x93b3('0xf'),_0x24318d,_0x38e3bb);_0x5cf410(_0x38e3bb);});});} \ No newline at end of file +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 diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7350b2b..1837366 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 _0x80cf=['post','/:id/clone','addSections','/:id/resources','addResources','put','/:id','update','delete','destroy','removeSections','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','get','/describe','show','getSections','create'];(function(_0x3f1599,_0x22f4d4){var _0x42e05c=function(_0x4d3461){while(--_0x4d3461){_0x3f1599['push'](_0x3f1599['shift']());}};_0x42e05c(++_0x22f4d4);}(_0x80cf,0x1df));var _0xf80c=function(_0x39047d,_0x427b13){_0x39047d=_0x39047d-0x0;var _0x526add=_0x80cf[_0x39047d];return _0x526add;};'use strict';var multer=require(_0xf80c('0x0'));var util=require(_0xf80c('0x1'));var path=require(_0xf80c('0x2'));var timeout=require(_0xf80c('0x3'));var express=require(_0xf80c('0x4'));var router=express[_0xf80c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf80c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf80c('0x7'));var controller=require(_0xf80c('0x8'));router['get']('/',auth[_0xf80c('0x9')](),controller['index']);router[_0xf80c('0xa')](_0xf80c('0xb'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf80c('0xc')]);router[_0xf80c('0xa')]('/:id/sections',auth[_0xf80c('0x9')](),controller[_0xf80c('0xd')]);router[_0xf80c('0xa')]('/:id/resources',auth[_0xf80c('0x9')](),controller['getResources']);router['post']('/',auth['isAuthenticated'](),controller[_0xf80c('0xe')]);router[_0xf80c('0xf')](_0xf80c('0x10'),auth[_0xf80c('0x9')](),controller['clone']);router[_0xf80c('0xf')]('/:id/sections',auth['isAuthenticated'](),controller[_0xf80c('0x11')]);router[_0xf80c('0xf')](_0xf80c('0x12'),auth[_0xf80c('0x9')](),controller[_0xf80c('0x13')]);router[_0xf80c('0x14')](_0xf80c('0x15'),auth[_0xf80c('0x9')](),controller[_0xf80c('0x16')]);router[_0xf80c('0x17')](_0xf80c('0x15'),auth['isAuthenticated'](),controller[_0xf80c('0x18')]);router[_0xf80c('0x17')]('/:id/sections',auth[_0xf80c('0x9')](),controller[_0xf80c('0x19')]);router['delete'](_0xf80c('0x12'),auth['isAuthenticated'](),controller['removeResources']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 357ea95..6cbcc93 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 _0xc49a=['setDataValue','crudPermissions','getDataValue','BOOLEAN','sequelize','name','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc49a,0xcf));var _0xac49=function(_0x4fbda8,_0xcba360){_0x4fbda8=_0x4fbda8-0x0;var _0x1ff044=_0xc49a[_0x4fbda8];return _0x1ff044;};'use strict';var Sequelize=require(_0xac49('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xac49('0x1')},'crudPermissions':{'type':Sequelize[_0xac49('0x2')],'set':function(_0x180423){this[_0xac49('0x3')](_0xac49('0x4'),_0x180423?_0x180423['join'](''):[]);},'get':function(){return this['getDataValue'](_0xac49('0x4'))?this[_0xac49('0x5')]('crudPermissions')['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xac49('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xac49('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xac49('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xac49('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xac49('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xac49('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xac49('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xac49('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +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 diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 2939cf6..b7849c6 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 _0xb98e=['hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','findAll','rows','params','includeAll','find','catch','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','transaction','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','describe','UserProfileSection','removeSections','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','push','resourceId','addResources','sequelize','bulkCreate','removeResources','ids','getResources','section','Missing\x20section\x20parameter','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','stack','name','index','UserProfile','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xb98e,0x184));var _0xeb98=function(_0x3736c3,_0x2a84f4){_0x3736c3=_0x3736c3-0x0;var _0x5435f9=_0xb98e[_0x3736c3];return _0x5435f9;};'use strict';var emlformat=require(_0xeb98('0x0'));var rimraf=require(_0xeb98('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xeb98('0x2'));var moment=require(_0xeb98('0x3'));var BPromise=require(_0xeb98('0x4'));var Mustache=require('mustache');var util=require(_0xeb98('0x5'));var path=require(_0xeb98('0x6'));var sox=require(_0xeb98('0x7'));var csv=require('to-csv');var ejs=require(_0xeb98('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeb98('0x9'));var squel=require('squel');var crypto=require(_0xeb98('0xa'));var jsforce=require(_0xeb98('0xb'));var deskjs=require(_0xeb98('0xc'));var toCsv=require(_0xeb98('0xd'));var querystring=require(_0xeb98('0xe'));var Papa=require(_0xeb98('0xf'));var Redis=require(_0xeb98('0x10'));var authService=require(_0xeb98('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xeb98('0x12'));var hardwareService=require(_0xeb98('0x13'));var logger=require(_0xeb98('0x14'))(_0xeb98('0x15'));var utils=require(_0xeb98('0x16'));var config=require(_0xeb98('0x17'));var licenseUtil=require(_0xeb98('0x18'));var db=require(_0xeb98('0x19'))['db'];config[_0xeb98('0x1a')]=_[_0xeb98('0x1b')](config[_0xeb98('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xeb98('0x1c'))(new Redis(config[_0xeb98('0x1a')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x297a7a,_0x2df629){_0x2df629=_0x2df629||0xcc;return function(_0x3bb77a){if(_0x3bb77a){return _0x297a7a[_0xeb98('0x1d')](_0x2df629);}return _0x297a7a[_0xeb98('0x1e')](_0x2df629)[_0xeb98('0x1f')]();};}function respondWithResult(_0x33de7f,_0x47a3ad){_0x47a3ad=_0x47a3ad||0xc8;return function(_0x934089){if(_0x934089){return _0x33de7f[_0xeb98('0x1e')](_0x47a3ad)[_0xeb98('0x20')](_0x934089);}};}function respondWithFilteredResult(_0x2a77ff,_0x1bf54b){return function(_0x3520a4){if(_0x3520a4){var _0x3a86e9=typeof _0x1bf54b[_0xeb98('0x21')]===_0xeb98('0x22')&&typeof _0x1bf54b[_0xeb98('0x23')]===_0xeb98('0x22');var _0x1785fc=_0x3520a4['count'];var _0x38e22e=_0x3a86e9?0x0:_0x1bf54b[_0xeb98('0x21')];var _0x4f5267=_0x3a86e9?_0x3520a4['count']:_0x1bf54b[_0xeb98('0x21')]+_0x1bf54b[_0xeb98('0x23')];var _0x5261b0;if(_0x4f5267>=_0x1785fc){_0x4f5267=_0x1785fc;_0x5261b0=0xc8;}else{_0x5261b0=0xce;}_0x2a77ff['status'](_0x5261b0);return _0x2a77ff[_0xeb98('0x24')]('Content-Range',_0x38e22e+'-'+_0x4f5267+'/'+_0x1785fc)[_0xeb98('0x20')](_0x3520a4);}return null;};}function patchUpdates(_0x3ebf3d){return function(_0x57f377){try{jsonpatch[_0xeb98('0x25')](_0x57f377,_0x3ebf3d,!![]);}catch(_0xb561eb){return BPromise[_0xeb98('0x26')](_0xb561eb);}return _0x57f377[_0xeb98('0x27')]();};}function saveUpdates(_0x16274e,_0x1fa721){return function(_0x685a8f){if(_0x685a8f){return _0x685a8f[_0xeb98('0x28')](_0x16274e)[_0xeb98('0x29')](function(_0x378284){return _0x378284;});}return null;};}function removeEntity(_0x7d361,_0x499ae8){return function(_0x19f31d){if(_0x19f31d){return _0x19f31d[_0xeb98('0x2a')]()[_0xeb98('0x29')](function(){_0x7d361[_0xeb98('0x1e')](0xcc)[_0xeb98('0x1f')]();});}};}function handleEntityNotFound(_0x175a0f,_0x49ca11){return function(_0x151d9c){if(!_0x151d9c){_0x175a0f[_0xeb98('0x1d')](0x194);}return _0x151d9c;};}function handleError(_0x3f7fdd,_0x1da6ac){_0x1da6ac=_0x1da6ac||0x1f4;return function(_0x37fdd6){logger['error'](_0x37fdd6[_0xeb98('0x2b')]);if(_0x37fdd6[_0xeb98('0x2c')]){delete _0x37fdd6[_0xeb98('0x2c')];}_0x3f7fdd[_0xeb98('0x1e')](_0x1da6ac)['send'](_0x37fdd6);};}exports[_0xeb98('0x2d')]=function(_0x3998f0,_0x31cddf){var _0x1e7c19={},_0x430a6b={},_0x73b106={'count':0x0,'rows':[]};var _0x5a375c=_['map'](db[_0xeb98('0x2e')][_0xeb98('0x2f')],function(_0x3844dc){return{'name':_0x3844dc[_0xeb98('0x30')],'type':_0x3844dc[_0xeb98('0x31')][_0xeb98('0x32')]};});_0x430a6b[_0xeb98('0x33')]=_[_0xeb98('0x34')](_0x5a375c,_0xeb98('0x2c'));_0x430a6b[_0xeb98('0x35')]=_[_0xeb98('0x36')](_0x3998f0[_0xeb98('0x35')]);_0x430a6b[_0xeb98('0x37')]=_[_0xeb98('0x38')](_0x430a6b[_0xeb98('0x33')],_0x430a6b['query']);_0x1e7c19[_0xeb98('0x39')]=_[_0xeb98('0x38')](_0x430a6b[_0xeb98('0x33')],qs['fields'](_0x3998f0[_0xeb98('0x35')][_0xeb98('0x3a')]));_0x1e7c19['attributes']=_0x1e7c19[_0xeb98('0x39')][_0xeb98('0x3b')]?_0x1e7c19[_0xeb98('0x39')]:_0x430a6b['model'];if(!_0x3998f0['query'][_0xeb98('0x3c')](_0xeb98('0x3d'))){_0x1e7c19[_0xeb98('0x23')]=qs[_0xeb98('0x23')](_0x3998f0['query'][_0xeb98('0x23')]);_0x1e7c19[_0xeb98('0x21')]=qs['offset'](_0x3998f0[_0xeb98('0x35')]['offset']);}_0x1e7c19[_0xeb98('0x3e')]=qs[_0xeb98('0x3f')](_0x3998f0[_0xeb98('0x35')][_0xeb98('0x3f')]);_0x1e7c19[_0xeb98('0x40')]=qs['filters'](_['pick'](_0x3998f0[_0xeb98('0x35')],_0x430a6b[_0xeb98('0x37')]),_0x5a375c);if(_0x3998f0[_0xeb98('0x35')][_0xeb98('0x41')]){_0x1e7c19[_0xeb98('0x40')]=_[_0xeb98('0x42')](_0x1e7c19[_0xeb98('0x40')],{'$or':_[_0xeb98('0x34')](_0x5a375c,function(_0x300792){if(_0x300792[_0xeb98('0x31')]!==_0xeb98('0x43')){var _0x1805b6={};_0x1805b6[_0x300792[_0xeb98('0x2c')]]={'$like':'%'+_0x3998f0[_0xeb98('0x35')][_0xeb98('0x41')]+'%'};return _0x1805b6;}})});}_0x1e7c19=_['merge']({},_0x1e7c19,_0x3998f0[_0xeb98('0x44')]);var _0x226c79={'where':_0x1e7c19['where']};return db[_0xeb98('0x2e')][_0xeb98('0x45')](_0x226c79)[_0xeb98('0x29')](function(_0x3e48ee){_0x73b106[_0xeb98('0x45')]=_0x3e48ee;if(_0x3998f0[_0xeb98('0x35')]['includeAll']){_0x1e7c19['include']=[{'all':!![]}];}return db[_0xeb98('0x2e')][_0xeb98('0x46')](_0x1e7c19);})[_0xeb98('0x29')](function(_0x59ae37){_0x73b106[_0xeb98('0x47')]=_0x59ae37;return _0x73b106;})[_0xeb98('0x29')](respondWithFilteredResult(_0x31cddf,_0x1e7c19))['catch'](handleError(_0x31cddf,null));};exports['show']=function(_0x11bb8c,_0x43c065){var _0x14c664={'raw':![],'where':{'id':_0x11bb8c[_0xeb98('0x48')]['id']}},_0x40eab3={};_0x40eab3['model']=_[_0xeb98('0x36')](db[_0xeb98('0x2e')][_0xeb98('0x2f')]);_0x40eab3[_0xeb98('0x35')]=_[_0xeb98('0x36')](_0x11bb8c[_0xeb98('0x35')]);_0x40eab3[_0xeb98('0x37')]=_[_0xeb98('0x38')](_0x40eab3[_0xeb98('0x33')],_0x40eab3[_0xeb98('0x35')]);_0x14c664[_0xeb98('0x39')]=_[_0xeb98('0x38')](_0x40eab3[_0xeb98('0x33')],qs[_0xeb98('0x3a')](_0x11bb8c[_0xeb98('0x35')][_0xeb98('0x3a')]));_0x14c664[_0xeb98('0x39')]=_0x14c664['attributes'][_0xeb98('0x3b')]?_0x14c664[_0xeb98('0x39')]:_0x40eab3['model'];if(_0x11bb8c['query'][_0xeb98('0x49')]){_0x14c664['include']=[{'all':!![]}];}_0x14c664=_['merge']({},_0x14c664,_0x11bb8c['options']);return db['UserProfile'][_0xeb98('0x4a')](_0x14c664)[_0xeb98('0x29')](handleEntityNotFound(_0x43c065,null))[_0xeb98('0x29')](respondWithResult(_0x43c065,null))[_0xeb98('0x4b')](handleError(_0x43c065,null));};exports[_0xeb98('0x4c')]=function(_0x23f0c2,_0x34c3ff){return db[_0xeb98('0x2e')][_0xeb98('0x4c')](_0x23f0c2[_0xeb98('0x4d')],{})[_0xeb98('0x29')](respondWithResult(_0x34c3ff,0xc9))[_0xeb98('0x4b')](handleError(_0x34c3ff,null));};exports[_0xeb98('0x4e')]=function(_0x297da2,_0x3d678c){var _0x5a7858={'where':{'id':_0x297da2[_0xeb98('0x48')]['id']}},_0x120cb6={};_0x120cb6[_0xeb98('0x33')]=_[_0xeb98('0x36')](db[_0xeb98('0x2e')][_0xeb98('0x2f')]);_0x5a7858[_0xeb98('0x39')]=_[_0xeb98('0x38')](_0x120cb6['model'],qs['fields'](_0x297da2[_0xeb98('0x35')]['fields']));_0x5a7858[_0xeb98('0x39')]=_0x5a7858[_0xeb98('0x39')]['length']?_0x5a7858[_0xeb98('0x39')]:_0x120cb6[_0xeb98('0x33')];if(_0x297da2[_0xeb98('0x35')][_0xeb98('0x49')]){_0x5a7858['include']=[{'all':!![]}];}_0x5a7858=_[_0xeb98('0x42')]({},_0x5a7858,_0x297da2[_0xeb98('0x44')]);return db[_0xeb98('0x2e')][_0xeb98('0x4a')](_0x5a7858)['then'](handleEntityNotFound(_0x3d678c,null))['then'](function(_0x2fd2bd){if(_0x2fd2bd){var _0x5781ff=_0x2fd2bd[_0xeb98('0x4f')]({'plain':!![]});_0x5781ff=qs[_0xeb98('0x50')](_0x5781ff,['id',_0xeb98('0x51'),_0xeb98('0x52'),_0xeb98('0x53')]);_0x297da2['body']=_[_0xeb98('0x50')](_0x297da2['body'],['id',_0xeb98('0x51'),'updatedAt']);return db['sequelize'][_0xeb98('0x54')](function(_0x1f1bc3){return db['UserProfile'][_0xeb98('0x4c')](_[_0xeb98('0x42')](_0x5781ff,_0x297da2[_0xeb98('0x4d')]),{'include':_0x297da2[_0xeb98('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x1f1bc3})[_0xeb98('0x29')](function(_0x4f5317){var _0x1a35ee=_0x4f5317[_0xeb98('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0xeb98('0x46')]({'where':{'userProfileId':_0x297da2[_0xeb98('0x48')]['id']},'raw':!![]})[_0xeb98('0x29')](function(_0x4c5125){if(_0x4c5125){return BPromise[_0xeb98('0x55')](_0x4c5125,function(_0x4a0d98){return new BPromise(function(_0x44808f,_0x4ce3b7){if(_0x4a0d98[_0xeb98('0x56')]===null||_0x4a0d98['autoAssociation']===0x1)_0x44808f(null);return db['UserProfileResource'][_0xeb98('0x46')]({'where':{'sectionId':_0x4a0d98['id']},'raw':!![]})[_0xeb98('0x29')](function(_0x5bf23a){var _0x1c59e3=_['map'](_0x5bf23a,function(_0x5a65f8){return qs[_0xeb98('0x50')](_0x5a65f8,['id','createdAt',_0xeb98('0x52'),_0xeb98('0x57')]);});_0x44808f(_0x1c59e3);})[_0xeb98('0x4b')](function(_0x577b49){_0x4ce3b7(_0x577b49);});})[_0xeb98('0x29')](function(_0x1cb563){var _0x46930d=qs[_0xeb98('0x50')](_0x4a0d98,['id','createdAt','updatedAt']);_0x46930d[_0xeb98('0x58')]=_0x1a35ee['id'];if(_0x1cb563)_0x46930d[_0xeb98('0x59')]=_0x1cb563;return _0x46930d;})[_0xeb98('0x29')](function(_0x2a90df){return db['UserProfileSection'][_0xeb98('0x4c')](_0x2a90df,{'include':[{'model':db[_0xeb98('0x5a')],'as':_0xeb98('0x59')}],'raw':!![],'transaction':_0x1f1bc3});});})[_0xeb98('0x29')](function(){return _0x1a35ee;});}});});});}})[_0xeb98('0x29')](respondWithResult(_0x3d678c,0xc9))[_0xeb98('0x4b')](handleError(_0x3d678c,null));};exports['update']=function(_0x2632f7,_0x4d8294){if(_0x2632f7[_0xeb98('0x4d')]['id']){delete _0x2632f7[_0xeb98('0x4d')]['id'];}return db['UserProfile'][_0xeb98('0x4a')]({'where':{'id':_0x2632f7[_0xeb98('0x48')]['id']}})['then'](handleEntityNotFound(_0x4d8294,null))[_0xeb98('0x29')](saveUpdates(_0x2632f7[_0xeb98('0x4d')],null))[_0xeb98('0x29')](respondWithResult(_0x4d8294,null))['catch'](handleError(_0x4d8294,null));};exports[_0xeb98('0x2a')]=function(_0x4d85ee,_0x122681){return db[_0xeb98('0x2e')][_0xeb98('0x4a')]({'where':{'id':_0x4d85ee[_0xeb98('0x48')]['id']}})[_0xeb98('0x29')](handleEntityNotFound(_0x122681,null))[_0xeb98('0x29')](removeEntity(_0x122681,null))['catch'](handleError(_0x122681,null));};exports[_0xeb98('0x5b')]=function(_0x3ceba5,_0xee1caa){return db[_0xeb98('0x2e')][_0xeb98('0x5b')]()[_0xeb98('0x29')](respondWithResult(_0xee1caa,null))[_0xeb98('0x4b')](handleError(_0xee1caa,null));};exports['addSections']=function(_0x1bba01,_0x2c271a){var _0x473c20=_0x1bba01[_0xeb98('0x4d')];return db[_0xeb98('0x2e')][_0xeb98('0x4a')]({'where':{'id':_0x1bba01['params']['id']}})[_0xeb98('0x29')](handleEntityNotFound(_0x2c271a,null))[_0xeb98('0x29')](function(_0xc98244){if(_0xc98244){return db['sequelize'][_0xeb98('0x54')](function(_0x4cd4cb){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x1bba01[_0xeb98('0x48')]['id'],'sectionId':_[_0xeb98('0x34')](_0x473c20,function(_0x272b93){return _0x272b93['sectionId'];})},'transaction':_0x4cd4cb})[_0xeb98('0x29')](function(){var _0x260a5c=_[_0xeb98('0x34')](_0x473c20,function(_0x9f67ed){_0x9f67ed[_0xeb98('0x58')]=_0x1bba01[_0xeb98('0x48')]['id'];return _0x9f67ed;});var _0x1861cb=[];return BPromise['each'](_0x260a5c,function(_0x1cf1fa){return db[_0xeb98('0x5c')][_0xeb98('0x4c')](_0x1cf1fa,{'include':[{'model':db[_0xeb98('0x5a')],'as':_0xeb98('0x59')}],'raw':!![],'transaction':_0x4cd4cb})['then'](function(_0x3bc2d6){_0x1861cb['push'](_0x3bc2d6[_0xeb98('0x4f')]({'plain':!![]}));});})[_0xeb98('0x29')](function(){return _0x1861cb;});});});}})[_0xeb98('0x29')](function(_0x37a5ab){return _0x37a5ab;})[_0xeb98('0x29')](respondWithResult(_0x2c271a,null))['catch'](handleError(_0x2c271a,null));};exports[_0xeb98('0x5d')]=function(_0x2d163c,_0x28cf65){var _0x5142d9;return db['UserProfile']['find']({'where':{'id':_0x2d163c[_0xeb98('0x48')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x28cf65,null))['then'](function(_0x19aa64){if(_0x19aa64){_0x5142d9=_0x19aa64;return db[_0xeb98('0x5c')][_0xeb98('0x2a')]({'where':{'userProfileId':_0x2d163c[_0xeb98('0x48')]['id'],'sectionId':_0x2d163c[_0xeb98('0x35')]['ids']}});}})[_0xeb98('0x29')](function(){return _0x5142d9;})[_0xeb98('0x29')](respondWithStatusCode(_0x28cf65,null))[_0xeb98('0x4b')](handleError(_0x28cf65,null));};exports[_0xeb98('0x5e')]=function(_0xa4273e,_0x3485c2){var _0x2e72ca=[];var _0xa4ed65=[];return db[_0xeb98('0x5c')][_0xeb98('0x46')]({'where':{'userProfileId':_0xa4273e[_0xeb98('0x48')]['id']},'raw':!![]})['then'](function(_0x59323d){_0x2e72ca=_[_0xeb98('0x41')](_0x59323d,function(_0x43995e){return _0x43995e[_0xeb98('0x5f')]===0x1||_[_0xeb98('0x60')]([0x3eb,0x709],_0x43995e[_0xeb98('0x57')]);});if(!_[_0xeb98('0x61')](_0x2e72ca)){return _['map'](_0x2e72ca,function(_0x1cd4a1){return _0x1cd4a1['sectionId'];});}else{return;}})['then'](function(_0x420591){if(_0x420591)_0xa4ed65=_0x420591;if(_['includes'](_0xa4ed65,0x64)){var _0x2aef97=_[_0xeb98('0x4a')](_0x2e72ca,{'sectionId':0x64});return hasDefaultDashboard(_0x2aef97)[_0xeb98('0x29')](function(_0x1b0c55){return _['map'](_0x2e72ca,function(_0x58db67){if(_0x58db67[_0xeb98('0x57')]===0x64){_0x58db67[_0xeb98('0x62')]=_0x1b0c55;}return _0x58db67;});});}else{return;}})[_0xeb98('0x29')](function(_0x34f686){if(_0x34f686)_0x2e72ca=_0x34f686;if(_[_0xeb98('0x60')](_0xa4ed65,0x3eb)){var _0xf8643c=_[_0xeb98('0x4a')](_0x2e72ca,{'sectionId':0x3eb});return getCustomDashboards(_0xf8643c)[_0xeb98('0x29')](function(_0xc98ec7){return _[_0xeb98('0x34')](_0x2e72ca,function(_0x58e939){if(_0xf8643c[_0xeb98('0x5f')]){if(_0x58e939['sectionId']===0x3eb){_0x58e939[_0xeb98('0x62')]=_0xc98ec7;}}else{if(_0x58e939[_0xeb98('0x57')]===0x64){_0x58e939[_0xeb98('0x62')]=_0xc98ec7;}}return _0x58e939;});});}else{return;}})[_0xeb98('0x29')](function(_0xc7ce6b){if(_0xc7ce6b)_0x2e72ca=_0xc7ce6b;if(_['includes'](_0xa4ed65,0x709)){var _0x40247d=_['find'](_0x2e72ca,{'sectionId':0x709});return getPlugins(_0x40247d)[_0xeb98('0x29')](function(_0x26786a){if(_0x40247d[_0xeb98('0x5f')]){return _[_0xeb98('0x34')](_0x2e72ca,function(_0xe42c69){if(_0xe42c69[_0xeb98('0x57')]===0x709){_0xe42c69[_0xeb98('0x62')]=_0x26786a;}return _0xe42c69;});}else{var _0x1cdb53={'sectionId':0x76c,'enabled':0x1,'subsections':_0x26786a};var _0x652d6d=_[_0xeb98('0x34')](_0x2e72ca);_0x652d6d['push'](_0x1cdb53);return _0x652d6d;}});}else{return;}})[_0xeb98('0x29')](function(_0x248e74){if(_0x248e74)_0x2e72ca=_0x248e74;return _[_0xeb98('0x41')](_0x2e72ca,[_0xeb98('0x5f'),0x1]);})['then'](respondWithResult(_0x3485c2,null))[_0xeb98('0x4b')](handleError(_0x3485c2,null));};function hasDefaultDashboard(_0x5d7dc2){var _0x879ebc=[0x65];return new BPromise(function(_0xcd0fd9,_0x572259){try{if(_0x5d7dc2[_0xeb98('0x56')]){_0xcd0fd9(_0x879ebc);}else{return db[_0xeb98('0x5a')][_0xeb98('0x63')]({'where':{'sectionId':_0x5d7dc2['id']},'raw':!![]})[_0xeb98('0x29')](function(_0x358a3d){_0x358a3d?_0xcd0fd9(_0x879ebc):_0xcd0fd9();});}}catch(_0xc07f63){_0x572259(_0xc07f63);}});}function getCustomDashboards(_0x2d06d7){var _0x9f8edb=[];return new BPromise(function(_0x69542a,_0x2621e9){try{if(_0x2d06d7[_0xeb98('0x56')]){return db[_0xeb98('0x64')][_0xeb98('0x46')]({'raw':!![]})[_0xeb98('0x29')](function(_0x1b479c){_0x1b479c[_0xeb98('0x65')](function(_0x2ea6ee){_0x9f8edb[_0xeb98('0x66')](_0x2ea6ee['id']+0x1869f);});_0x69542a(_0x9f8edb);});}else{return db[_0xeb98('0x5a')][_0xeb98('0x46')]({'where':{'sectionId':_0x2d06d7['id']},'raw':!![]})['then'](function(_0x3115dc){_0x3115dc[_0xeb98('0x65')](function(_0x4dc236){_0x9f8edb[_0xeb98('0x66')](_0x4dc236[_0xeb98('0x67')]+0x1869f);});_0x69542a(_0x9f8edb);});}}catch(_0x5b6374){_0x2621e9(_0x5b6374);}});}function getPlugins(_0x1e3120){var _0x500d01=[];return new BPromise(function(_0x27c03d,_0x216cec){try{if(_0x1e3120[_0xeb98('0x56')]){return db['Plugin'][_0xeb98('0x46')]({'raw':!![]})['then'](function(_0x2262bf){_0x2262bf[_0xeb98('0x65')](function(_0x430551){_0x500d01['push'](_0x430551['id']+0x15b38);});_0x27c03d(_0x500d01);});}else{return db[_0xeb98('0x5a')][_0xeb98('0x46')]({'where':{'sectionId':_0x1e3120['id']},'raw':!![]})['then'](function(_0x112321){_0x112321[_0xeb98('0x65')](function(_0x4ed2f1){_0x500d01[_0xeb98('0x66')](_0x4ed2f1[_0xeb98('0x67')]+0x15b38);});_0x27c03d(_0x500d01);});}}catch(_0x34313a){_0x216cec(_0x34313a);}});}exports[_0xeb98('0x68')]=function(_0x1bc722,_0x1f7151){return db[_0xeb98('0x2e')][_0xeb98('0x4a')]({'where':{'id':_0x1bc722['params']['id']}})[_0xeb98('0x29')](handleEntityNotFound(_0x1f7151,null))[_0xeb98('0x29')](function(_0x4eba0b){if(_0x4eba0b){return db[_0xeb98('0x69')][_0xeb98('0x54')](function(_0x4abb7f){return db[_0xeb98('0x5c')][_0xeb98('0x46')]({'where':{'userProfileId':_0x1bc722[_0xeb98('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x4db2ae){if(_0x4db2ae){return db[_0xeb98('0x5c')][_0xeb98('0x2a')]({'where':{'userProfileId':_0x1bc722[_0xeb98('0x48')]['id'],'id':_['map'](_0x4db2ae,function(_0x498f62){return _0x498f62['id'];})},'transaction':_0x4abb7f});}})['then'](function(_0x41f5c0){var _0x271954=_[_0xeb98('0x34')](_0x1bc722[_0xeb98('0x4d')],function(_0x1552c2){_0x1552c2[_0xeb98('0x58')]=_0x1bc722[_0xeb98('0x48')]['id'];return _0x1552c2;});return db[_0xeb98('0x5c')]['bulkCreate'](_0x271954,{'raw':!![],'transaction':_0x4abb7f});})[_0xeb98('0x29')](function(_0x2de84c){var _0x48b8fd=_[_0xeb98('0x41')](_[_0xeb98('0x34')](_0x2de84c,function(_0x13e61e){return _0x13e61e[_0xeb98('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x48b8fd){return db['UserProfileSection'][_0xeb98('0x46')]({'where':{'userProfileId':_0x1bc722[_0xeb98('0x48')]['id'],'sectionId':_[_0xeb98('0x34')](_0x48b8fd,function(_0xd368e0){return _0xd368e0[_0xeb98('0x57')];})},'attributes':['id','sectionId'],'raw':!![]})[_0xeb98('0x29')](function(_0x5aa640){var _0x3d5ac0=_['map'](_0x1bc722[_0xeb98('0x4d')],function(_0x3be0ba){_0x3be0ba[_0xeb98('0x58')]=_0x1bc722['params']['id'];return _0x3be0ba;});return db[_0xeb98('0x5a')][_0xeb98('0x6a')](_0x3d5ac0,{'raw':!![],'transaction':_0x4abb7f});});}})['catch'](handleError(_0x1f7151,null));});}})['then'](function(_0x1496fa){var _0x128d8=_['map'](_0x1496fa,function(_0x160e3f){return _0x160e3f['get']({'plain':!![]});});})[_0xeb98('0x29')](respondWithResult(_0x1f7151,null))[_0xeb98('0x4b')](handleError(_0x1f7151,null));};exports[_0xeb98('0x6b')]=function(_0x2129a6,_0x463b54,_0x51131a){return db[_0xeb98('0x2e')]['find']({'where':{'id':_0x2129a6['params']['id']}})['then'](handleEntityNotFound(_0x463b54,null))[_0xeb98('0x29')](function(_0x3b0736){if(_0x3b0736){return _0x3b0736[_0xeb98('0x6b')](_0x2129a6[_0xeb98('0x35')][_0xeb98('0x6c')]);}})['then'](respondWithStatusCode(_0x463b54,null))[_0xeb98('0x4b')](handleError(_0x463b54,null));};exports[_0xeb98('0x6d')]=function(_0x52dd2c,_0x551bb9){var _0x39e7fc={};if(!_0x52dd2c[_0xeb98('0x35')][_0xeb98('0x6e')])throw new Error(_0xeb98('0x6f'));if(!_0x52dd2c[_0xeb98('0x35')]['hasOwnProperty'](_0xeb98('0x3d'))){_0x39e7fc[_0xeb98('0x23')]=qs[_0xeb98('0x23')](_0x52dd2c[_0xeb98('0x35')]['limit']);_0x39e7fc[_0xeb98('0x21')]=qs[_0xeb98('0x21')](_0x52dd2c[_0xeb98('0x35')][_0xeb98('0x21')]);}return db[_0xeb98('0x2e')][_0xeb98('0x4a')]({'where':{'id':_0x52dd2c[_0xeb98('0x48')]['id']}})['then'](function(_0x3958e5){if(!_0x3958e5)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x52dd2c[_0xeb98('0x48')]['id']);return db[_0xeb98('0x2e')][_0xeb98('0x6d')](_0x52dd2c);})[_0xeb98('0x29')](respondWithFilteredResult(_0x551bb9,_0x39e7fc))[_0xeb98('0x4b')](handleError(_0x551bb9,null));}; \ No newline at end of file +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 diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 9897502..b07d904 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 _0xdf5d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile'];(function(_0x185f0d,_0x59c29b){var _0x514008=function(_0x549252){while(--_0x549252){_0x185f0d['push'](_0x185f0d['shift']());}};_0x514008(++_0x59c29b);}(_0xdf5d,0x126));var _0xddf5=function(_0x16e935,_0xe8b5de){_0x16e935=_0x16e935-0x0;var _0x39ad96=_0xdf5d[_0x16e935];return _0x39ad96;};'use strict';var EventEmitter=require(_0xddf5('0x0'));var UserProfile=require(_0xddf5('0x1'))['db'][_0xddf5('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xddf5('0x3')](0x0);var events={'afterCreate':_0xddf5('0x4'),'afterUpdate':_0xddf5('0x5'),'afterDestroy':_0xddf5('0x6')};function emitEvent(_0x41859b){return function(_0x4faa21,_0xb2675b,_0x16e5dd){UserProfileEvents[_0xddf5('0x7')](_0x41859b+':'+_0x4faa21['id'],_0x4faa21);UserProfileEvents[_0xddf5('0x7')](_0x41859b,_0x4faa21);_0x16e5dd(null);};}for(var e in events){if(events[_0xddf5('0x8')](e)){var event=events[e];UserProfile[_0xddf5('0x9')](e,emitEvent(event));}}module[_0xddf5('0xa')]=UserProfileEvents; \ No newline at end of file +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 diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index e5b2883..ed4582d 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 _0x3f8a=['extractedreports','Reports','reportId','metrics','AnalyticMetric','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','UserProfile','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','pick','VIRTUAL','foreignKey','forEach','merge','options','includeAll','default','DefaultReports','custom','CustomReports','count','include','Tag','color','tag','ThroughTags','rows','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','internalroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','voicerecordings','User','membername','role','VoiceQueues','queue','VoiceQueue','inbound','outbound','musiconholds','VoiceMusicOnHold','voiceprefixes','VoicePrefix','ivrcampaigns','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','QueueCampaigns','users','agents','Users','admin','user','Agents','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','Plugin'];(function(_0x4c2f30,_0xa91340){var _0xb8854d=function(_0x5ddf3d){while(--_0x5ddf3d){_0x4c2f30['push'](_0x4c2f30['shift']());}};_0xb8854d(++_0xa91340);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x515ef2,_0x19dfa0){_0x515ef2=_0x515ef2-0x0;var _0x564aa7=_0x3f8a[_0x515ef2];return _0x564aa7;};'use strict';var _=require(_0xa3f8('0x0'));var attributes=require(_0xa3f8('0x1'));var qs=require(_0xa3f8('0x2'));var squel=require(_0xa3f8('0x3'));module['exports']=function(_0x467a6c){var _0x143375=_0x467a6c[_0xa3f8('0x4')];function _0x15b6aa(_0x2553fd,_0x2847b4){return new Promise(function(_0x39d2e4,_0x471464){if(!_0x2847b4)return _0x39d2e4(null);var _0x1f160a=_0x2847b4[_0xa3f8('0x5')]?{[_0x2847b4[_0xa3f8('0x5')][_0xa3f8('0x6')]]:_0x2847b4[_0xa3f8('0x5')][_0xa3f8('0x7')]}:undefined;return _0x143375[_0x2553fd][_0xa3f8('0x8')]({'where':_0x1f160a,'raw':!![]})[_0xa3f8('0x9')](function(_0xcdb0d4){_0x2847b4['associatedResources']=_[_0xa3f8('0xa')](_0xcdb0d4,'id');_0x39d2e4(_0x2847b4);})[_0xa3f8('0xb')](function(_0x3c1833){_0x471464(_0x3c1833);});});}function _0x22dcda(_0x53cf1f,_0x206b69){return new Promise(function(_0x26f0a0,_0x414bd7){var _0x24f421=_0x53cf1f[_0xa3f8('0x5')]?{[_0x53cf1f[_0xa3f8('0x5')][_0xa3f8('0x6')]]:_0x53cf1f[_0xa3f8('0x5')][_0xa3f8('0x7')]}:undefined;return _0x143375[_0x53cf1f[_0xa3f8('0xc')]][_0xa3f8('0x8')]({'where':_0x24f421,'raw':!![]})[_0xa3f8('0x9')](function(_0x5b2c33){_0x206b69[_0xa3f8('0xd')]=_[_0xa3f8('0xa')](_0x5b2c33,function(_0x45014f){return _0x45014f[_0xa3f8('0xe')];});_0x26f0a0(_0x206b69);})['catch'](function(_0x39c450){_0x414bd7(_0x39c450);});});}function _0x33b98e(_0x46a8d9,_0x8cd130,_0x45ef64){if(!_0x8cd130)return Promise[_0xa3f8('0xf')](null);return new Promise(function(_0x2f0659,_0x3e2e1c){return _0x143375[_0xa3f8('0x10')][_0xa3f8('0x8')]({'where':{'sectionId':_0x8cd130['id']},'raw':!![]})['then'](function(_0x3ad8cd){if(_0x46a8d9['field']&&_0x46a8d9[_0xa3f8('0x6')]!=='id'){_0x8cd130[_0xa3f8('0xd')]=_[_0xa3f8('0xa')](_0x3ad8cd,function(_0x46042d){return _0x46042d[_0x46a8d9['field']];});}else{if(_0x45ef64===_0xa3f8('0x11')){_0x8cd130['associatedResources']=_[_0xa3f8('0xa')](_0x3ad8cd,function(_0x58336d){return{'id':_0x58336d[_0xa3f8('0x12')],'type':_0x58336d[_0xa3f8('0x13')]};});}else{_0x8cd130[_0xa3f8('0xd')]=_[_0xa3f8('0xa')](_0x3ad8cd,function(_0x3a6a57){return _0x3a6a57[_0xa3f8('0x12')];});}}_0x2f0659(_0x8cd130);})[_0xa3f8('0xb')](function(_0x490717){_0x3e2e1c(_0x490717);});});}function _0xae76ec(_0x4d0e72,_0x3ce57b){var _0xa5a697={'parentSections':[]};switch(_0x4d0e72[_0xa3f8('0x14')]()){case _0xa3f8('0x15'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x17');break;case _0xa3f8('0x18'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x19');break;case _0xa3f8('0x1a'):_0xa5a697['childModel']=_0xa3f8('0x1b');_0xa5a697[_0xa3f8('0x1c')]=[{'name':_0xa3f8('0x1d'),'field':'name','foreignKey':_0xa3f8('0x1e')}];break;case'projects':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x1f');break;case _0xa3f8('0x20'):_0xa5a697['childModel']=_0xa3f8('0x21');_0xa5a697['parentSections']=[{'name':_0xa3f8('0x22'),'field':'id','foreignKey':_0xa3f8('0x23')}];break;case _0xa3f8('0x24'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x25');break;case _0xa3f8('0x26'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x27');break;case _0xa3f8('0x28'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x29');break;case'chatqueues':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x2a');break;case _0xa3f8('0x2b'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x2c');break;case'faxqueues':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x2d');break;case'faxaccounts':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x2e');break;case'inboundroutes':case _0xa3f8('0x2f'):case'outboundroutes':_0xa5a697['childModel']=_0xa3f8('0x30');break;case _0xa3f8('0x31'):_0xa5a697['childModel']=_0xa3f8('0x32');break;case'voicemails':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x33');break;case _0xa3f8('0x34'):_0xa5a697[_0xa3f8('0x16')]='VoiceRecording';_0xa5a697[_0xa3f8('0x1c')]=[{'name':'Agents','field':_0xa3f8('0xe'),'foreignKey':'membername','model':_0xa3f8('0x35'),'filter':{'field':'role','value':['agent']}},{'name':'Telephones','field':_0xa3f8('0xe'),'foreignKey':_0xa3f8('0x36'),'model':_0xa3f8('0x35'),'filter':{'field':_0xa3f8('0x37'),'value':['telephone']}},{'name':_0xa3f8('0x38'),'field':_0xa3f8('0xe'),'foreignKey':_0xa3f8('0x39'),'model':_0xa3f8('0x3a'),'filter':{'field':_0xa3f8('0x13'),'value':[_0xa3f8('0x3b')]}},{'name':'QueueCampaigns','field':_0xa3f8('0xe'),'foreignKey':_0xa3f8('0x39'),'model':_0xa3f8('0x3a'),'filter':{'field':'type','value':[_0xa3f8('0x3c')]}}];break;case _0xa3f8('0x3d'):_0xa5a697['childModel']=_0xa3f8('0x3e');break;case'chanspies':_0xa5a697[_0xa3f8('0x16')]='VoiceChanSpy';break;case _0xa3f8('0x3f'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x40');break;case _0xa3f8('0x41'):_0xa5a697[_0xa3f8('0x16')]='Campaign';break;case _0xa3f8('0x42'):_0xa5a697[_0xa3f8('0x16')]='MailQueue';break;case _0xa3f8('0x43'):_0xa5a697['childModel']=_0xa3f8('0x44');break;case _0xa3f8('0x45'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x46');break;case _0xa3f8('0x47'):_0xa5a697['childModel']=_0xa3f8('0x48');break;case _0xa3f8('0x49'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x4a');break;case _0xa3f8('0x4b'):_0xa5a697['childModel']=_0xa3f8('0x4c');break;case _0xa3f8('0x4d'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x4e');break;case _0xa3f8('0x4f'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x50');break;case _0xa3f8('0x51'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x52');break;case _0xa3f8('0x53'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x54');break;case'voicequeues':case'queuecampaigns':_0xa5a697['childModel']=_0xa3f8('0x3a');if(_0x3ce57b){_0xa5a697[_0xa3f8('0x1c')]=[{'name':_0xa3f8('0x38')},{'name':_0xa3f8('0x55')}];}break;case _0xa3f8('0x56'):case _0xa3f8('0x57'):case'telephones':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x35');if(_0x3ce57b){_0xa5a697[_0xa3f8('0x1c')]=[{'name':_0xa3f8('0x58'),'filter':{'field':'role','value':[_0xa3f8('0x59'),_0xa3f8('0x5a')]},'ignore':!![]},{'name':_0xa3f8('0x5b')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0xa5a697['childModel']=_0xa3f8('0x5c');break;case _0xa3f8('0x5d'):_0xa5a697['childModel']=_0xa3f8('0x5e');break;case _0xa3f8('0x5f'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x60');break;case _0xa3f8('0x61'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x62');break;case _0xa3f8('0x63'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x64');break;case _0xa3f8('0x65'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x66');break;case _0xa3f8('0x67'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x35');break;case _0xa3f8('0x68'):_0xa5a697['childModel']='CannedAnswer';break;case _0xa3f8('0x69'):_0xa5a697[_0xa3f8('0x16')]='Disposition';break;case _0xa3f8('0x6a'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x6b');break;case _0xa3f8('0x6c'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x6d');break;case _0xa3f8('0x6e'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x6f');break;case _0xa3f8('0x70'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x71');break;case _0xa3f8('0x72'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x73');break;case _0xa3f8('0x74'):_0xa5a697['childModel']='Tag';break;case _0xa3f8('0x75'):_0xa5a697['childModel']=_0xa3f8('0x76');break;case _0xa3f8('0x77'):_0xa5a697[_0xa3f8('0x16')]='Trigger';break;case _0xa3f8('0x78'):_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x79');break;case _0xa3f8('0x7a'):_0xa5a697['childModel']=_0xa3f8('0x7b');break;case'plugins':_0xa5a697[_0xa3f8('0x16')]=_0xa3f8('0x7c');break;case _0xa3f8('0x7d'):_0xa5a697['childModel']='AnalyticExtractedReport';_0xa5a697[_0xa3f8('0x1c')]=[{'name':_0xa3f8('0x7e'),'field':'id','foreignKey':_0xa3f8('0x7f')}];break;case _0xa3f8('0x80'):_0xa5a697['childModel']=_0xa3f8('0x81');break;}return _0xa5a697;}function _0x3478e8(_0x38dba4,_0x270ffc){var _0xc60091=_0x38dba4['charAt'](0x0)['toUpperCase']()+_0x38dba4[_0xa3f8('0x82')](0x1);var _0x102107={'type':_0x143375[_0xa3f8('0x83')][_0xa3f8('0x84')][_0xa3f8('0x85')],'raw':!![]};return new Promise(function(_0x2b0af7,_0xb17e21){var _0x5a7393=squel['select']()['field'](_0xa3f8('0x86')+_0xc60091+_0xa3f8('0x87'),'id')[_0xa3f8('0x6')](_0xa3f8('0x88'))[_0xa3f8('0x89')](_0xa3f8('0x8a')+_0x38dba4+_0xa3f8('0x8b'),'ui')[_0xa3f8('0x8c')]('ui.UserId\x20=\x20?',_0x270ffc['id']);return _0x143375[_0xa3f8('0x8d')][_0xa3f8('0x8e')](_0x5a7393[_0xa3f8('0x8f')](),_0x102107)[_0xa3f8('0x9')](function(_0x27c5aa){_0x270ffc[_0xc60091+_0xa3f8('0x90')]=_0x27c5aa;_0x2b0af7(_0x27c5aa);})[_0xa3f8('0xb')](function(_0x4d0404){_0xb17e21(_0x4d0404);});});}return _0x467a6c[_0xa3f8('0x91')](_0xa3f8('0x92'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x23614c){var _0x331629={'raw':![],'where':{}};var _0x44d566={};var _0x2bf252={'count':0x0,'rows':[]};var _0x11f5f7=_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0x93')];var _0x4a2f72=_0x23614c['query'][_0xa3f8('0x94')]||![];var _0x5a61f1=_0xae76ec(_0x11f5f7,_0x4a2f72);if(!_0x5a61f1[_0xa3f8('0x16')])throw new Error(_0xa3f8('0x95')+_0x11f5f7+'\x27');var _0x3ff369=[{'name':_0x11f5f7}];if(!_[_0xa3f8('0x96')](_0x5a61f1[_0xa3f8('0x1c')]))_0x3ff369=_0x5a61f1[_0xa3f8('0x1c')];var _0xeca2dc=[];for(var _0x14508d=0x0;_0x14508d<_0x3ff369[_0xa3f8('0x97')];_0x14508d++){_0xeca2dc[_0xa3f8('0x98')](_0x143375[_0xa3f8('0x99')][_0xa3f8('0x9a')]({'where':{'userProfileId':_0x23614c[_0xa3f8('0x9b')]['id'],'name':_0x3ff369[_0x14508d]['name']},'raw':!![]}));}return Promise[_0xa3f8('0x9c')](_0xeca2dc)[_0xa3f8('0x9')](function(_0x42e827){var _0x1688ca=_[_0xa3f8('0x5')](_0x42e827,function(_0x3420ec){return _0x3420ec?_0x3420ec:undefined;});var _0x4b6169=_[_0xa3f8('0x5')](_0x3ff369,[_0xa3f8('0x9d'),!![]]);var _0x1f01c1=_[_0xa3f8('0x96')](_0x1688ca)&&_[_0xa3f8('0x96')](_0x4b6169)?null:_[_0xa3f8('0x9e')](_0x4b6169,_0x1688ca);if(!_0x1f01c1)return null;var _0x3d45ae=[];for(var _0x3a2362=0x0;_0x3a2362<_0x1f01c1[_0xa3f8('0x97')];_0x3a2362++){var _0x33fef6=_[_0xa3f8('0x9a')](_0x3ff369,function(_0x5d4fe5){return _0x1f01c1[_0x3a2362]?_0x5d4fe5[_0xa3f8('0xe')]===_0x1f01c1[_0x3a2362][_0xa3f8('0xe')]:null;});if(_0x33fef6){if(_0x1f01c1[_0x3a2362]['ignore']){_0x3d45ae['push'](_0x15b6aa(_0x5a61f1[_0xa3f8('0x16')],_0x1f01c1[_0x3a2362]));}else{if(!_0x1f01c1[_0x3a2362][_0xa3f8('0x9f')]){_0x3d45ae[_0xa3f8('0x98')](_0x33b98e(_0x33fef6,_0x1f01c1[_0x3a2362],_0x5a61f1[_0xa3f8('0x16')]));}else{if(_0x33fef6[_0xa3f8('0xc')]){_0x3d45ae[_0xa3f8('0x98')](_0x22dcda(_0x33fef6,_0x1f01c1[_0x3a2362]));}}}}}return Promise[_0xa3f8('0x9c')](_0x3d45ae);})[_0xa3f8('0x9')](function(_0x4f5f62){var _0xf76898=_0x4f5f62;var _0x3c30d0=null;if(_0xf76898){_0x3c30d0=_0xf76898[_0xa3f8('0x97')]===0x1?_0xf76898[0x0]:null;}if(!_0x3c30d0&&!_0xf76898)return _0x2bf252;var _0x52f3ae=_0x143375[_0x5a61f1[_0xa3f8('0x16')]][_0xa3f8('0xa0')];_0x44d566['model']=_[_0xa3f8('0xa1')](_0x52f3ae);_0x44d566[_0xa3f8('0x8e')]=_[_0xa3f8('0xa1')](_0x23614c[_0xa3f8('0x8e')]);_0x44d566[_0xa3f8('0xa2')]=_[_0xa3f8('0xa3')](_0x44d566[_0xa3f8('0xc')],_0x44d566[_0xa3f8('0x8e')]);_0x331629[_0xa3f8('0xa4')]=_['intersection'](_0x44d566[_0xa3f8('0xc')],qs['fields'](_0x23614c[_0xa3f8('0x8e')]['fields']));_0x331629[_0xa3f8('0xa4')]=_0x331629[_0xa3f8('0xa4')][_0xa3f8('0x97')]?_0x331629[_0xa3f8('0xa4')]:_0x44d566[_0xa3f8('0xc')];if(!_0x23614c['query'][_0xa3f8('0xa5')](_0xa3f8('0xa6'))){_0x331629['limit']=qs[_0xa3f8('0xa7')](_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0xa7')]);_0x331629[_0xa3f8('0xa8')]=qs[_0xa3f8('0xa8')](_0x23614c[_0xa3f8('0x8e')]['offset']);}_0x331629[_0xa3f8('0xa9')]=qs[_0xa3f8('0xaa')](_0x23614c[_0xa3f8('0x8e')]['sort']);_0x331629[_0xa3f8('0x8c')]=qs['filters'](_[_0xa3f8('0xab')](_0x23614c['query'],_0x44d566['filters']));if(_0x23614c[_0xa3f8('0x8e')]['filter']){_0x331629[_0xa3f8('0x8c')]=_['merge'](_0x331629[_0xa3f8('0x8c')],{'$or':_[_0xa3f8('0xa')](_0x52f3ae,function(_0x279131){if(_0x279131[_0xa3f8('0x13')]['key']!==_0xa3f8('0xac')){var _0x35db48={};_0x35db48[_0x279131['field']]={'$like':'%'+_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0x5')]+'%'};return _0x35db48;}})});}var _0x3715ea=[];var _0x345089=null;var _0x25d8c1={};if(_0x3c30d0){_0x345089=_[_0xa3f8('0x9a')](_0x3ff369,[_0xa3f8('0xe'),_0x3c30d0[_0xa3f8('0xe')]]);if(_0x345089[_0xa3f8('0x6')]){_0x25d8c1={};if(_0x5a61f1[_0xa3f8('0x16')]==='AnalyticExtractedReport'){_0x25d8c1[_0x345089[_0xa3f8('0xad')]]=_[_0xa3f8('0xa')](_0x3c30d0[_0xa3f8('0xd')],'id');}else{_0x25d8c1[_0x345089[_0xa3f8('0xad')]]=_0x3c30d0[_0xa3f8('0xd')];}_0x3715ea[_0xa3f8('0x98')](_0x25d8c1);}else{_0x331629[_0xa3f8('0x8c')]['id']=_0x3c30d0[_0xa3f8('0xd')];}}else{for(var _0x32f937=0x0;_0x32f937<_0xf76898['length'];_0x32f937++){_0x345089=_[_0xa3f8('0x9a')](_0x3ff369,[_0xa3f8('0xe'),_0xf76898[_0x32f937][_0xa3f8('0xe')]]);if(_0x345089[_0xa3f8('0x6')]){_0x25d8c1={};_0x25d8c1[_0x345089[_0xa3f8('0xad')]]=_0xf76898[_0x32f937][_0xa3f8('0xd')];_0x3715ea['push'](_0x25d8c1);}else{if(!_0x331629[_0xa3f8('0x8c')]['id'])_0x331629[_0xa3f8('0x8c')]['id']=[];_0xf76898[_0x32f937][_0xa3f8('0xd')][_0xa3f8('0xae')](function(_0x4c47e6){_0x331629[_0xa3f8('0x8c')]['id'][_0xa3f8('0x98')](_0x4c47e6);});}}}if(!_[_0xa3f8('0x96')](_0x3715ea)){_0x331629[_0xa3f8('0x8c')]=_[_0xa3f8('0xaf')](_0x331629[_0xa3f8('0x8c')],{'$and':{'$or':_0x3715ea}});}_0x331629=_[_0xa3f8('0xaf')]({},_0x331629,_0x23614c[_0xa3f8('0xb0')]);if(_0x3c30d0&&!_0x3c30d0[_0xa3f8('0x9f')]&&_0x5a61f1[_0xa3f8('0x16')]===_0xa3f8('0x11')){if(_0x23614c['query'][_0xa3f8('0xb1')]){_0x331629['include']=[{'all':!![]}];}return _0x143375[_0x5a61f1[_0xa3f8('0x16')]][_0xa3f8('0x8')](_0x331629)[_0xa3f8('0x9')](function(_0x6a1e95){var _0x5b0ed5=[];_0x6a1e95[_0xa3f8('0xae')](function(_0x3d9702){var _0x365688;switch(_0x3d9702['reportType']){case _0xa3f8('0xb2'):_0x365688=_['find'](_0x3c30d0[_0xa3f8('0xd')],function(_0x52fcc3){return _0x52fcc3['id']===_0x3d9702[_0xa3f8('0x7f')]&&_0x52fcc3['type']===_0xa3f8('0xb3');});break;case _0xa3f8('0xb4'):_0x365688=_[_0xa3f8('0x9a')](_0x3c30d0[_0xa3f8('0xd')],function(_0x4f333f){return _0x4f333f['id']===_0x3d9702[_0xa3f8('0x7f')]&&_0x4f333f[_0xa3f8('0x13')]===_0xa3f8('0xb5');});break;}if(_0x365688)_0x5b0ed5[_0xa3f8('0x98')](_0x3d9702);});_0x2bf252[_0xa3f8('0xb6')]=_0x5b0ed5[_0xa3f8('0x97')];_0x2bf252['rows']=_0x5b0ed5;return _0x2bf252;});}else{return _0x143375[_0x5a61f1[_0xa3f8('0x16')]][_0xa3f8('0xb6')]({'where':_0x331629[_0xa3f8('0x8c')]})[_0xa3f8('0x9')](function(_0x477b0a){_0x2bf252['count']=_0x477b0a;if(_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0xb1')]){if(_0x5a61f1['childModel']===_0xa3f8('0x21')){_0x331629[_0xa3f8('0xb7')]=[{'model':_0x143375[_0xa3f8('0xb8')],'as':'Tags','attributes':['id',_0xa3f8('0xe'),_0xa3f8('0xb9')],'required':_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0xba')]?!![]:![]},{'model':_0x143375[_0xa3f8('0xb8')],'as':_0xa3f8('0xbb'),'attributes':['id',_0xa3f8('0xe'),'color'],'through':_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0xba')]?{'attributes':[],'where':{'TagId':_0x23614c['query'][_0xa3f8('0xba')]||undefined}}:{},'required':_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0xba')]?!![]:![]}];}else{_0x331629[_0xa3f8('0xb7')]=[{'all':!![]}];}}return _0x143375[_0x5a61f1[_0xa3f8('0x16')]][_0xa3f8('0x8')](_0x331629);})[_0xa3f8('0x9')](function(_0x525a21){_0x2bf252[_0xa3f8('0xbc')]=_0x525a21;if(_0x11f5f7===_0xa3f8('0x5b')&&_0x23614c[_0xa3f8('0x8e')][_0xa3f8('0xbd')]===_0xa3f8('0xbe')){var _0x1673ac=[];for(var _0xb1dca4=0x0;_0xb1dca4<_0x2bf252['rows'][_0xa3f8('0x97')];_0xb1dca4++){_0x1673ac[_0xa3f8('0x98')](_0x3478e8(_0xa3f8('0xbf'),_0x2bf252[_0xa3f8('0xbc')][_0xb1dca4]['dataValues']));_0x1673ac['push'](_0x3478e8(_0xa3f8('0xc0'),_0x2bf252['rows'][_0xb1dca4][_0xa3f8('0xc1')]));_0x1673ac[_0xa3f8('0x98')](_0x3478e8(_0xa3f8('0xc2'),_0x2bf252['rows'][_0xb1dca4]['dataValues']));_0x1673ac[_0xa3f8('0x98')](_0x3478e8(_0xa3f8('0xc3'),_0x2bf252[_0xa3f8('0xbc')][_0xb1dca4][_0xa3f8('0xc1')]));_0x1673ac['push'](_0x3478e8(_0xa3f8('0xc4'),_0x2bf252['rows'][_0xb1dca4][_0xa3f8('0xc1')]));_0x1673ac[_0xa3f8('0x98')](_0x3478e8(_0xa3f8('0xc5'),_0x2bf252['rows'][_0xb1dca4]['dataValues']));}return Promise['all'](_0x1673ac)[_0xa3f8('0x9')](function(){return _0x2bf252;});}return _0x2bf252;});}});}}});}; \ No newline at end of file +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 diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 3451657..25f56eb 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 _0xdf5d=['socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3e7ac9,_0x312226){var _0x10efdd=function(_0x1f2f80){while(--_0x1f2f80){_0x3e7ac9['push'](_0x3e7ac9['shift']());}};_0x10efdd(++_0x312226);}(_0xdf5d,0x126));var _0xddf5=function(_0xd2d9e,_0x409e7d){_0xd2d9e=_0xd2d9e-0x0;var _0x21e2af=_0xdf5d[_0xd2d9e];return _0x21e2af;};'use strict';var _=require(_0xddf5('0x0'));var util=require(_0xddf5('0x1'));var moment=require(_0xddf5('0x2'));var BPromise=require(_0xddf5('0x3'));var rs=require(_0xddf5('0x4'));var fs=require('fs');var Redis=require(_0xddf5('0x5'));var db=require(_0xddf5('0x6'))['db'];var utils=require(_0xddf5('0x7'));var logger=require('../../config/logger')(_0xddf5('0x8'));var config=require(_0xddf5('0x9'));var jayson=require(_0xddf5('0xa'));var client=jayson[_0xddf5('0xb')][_0xddf5('0xc')]({'port':0x232a});config[_0xddf5('0xd')]=_[_0xddf5('0xe')](config[_0xddf5('0xd')],{'host':_0xddf5('0xf'),'port':0x18eb});var socket=require(_0xddf5('0x10'))(new Redis(config[_0xddf5('0xd')]));require(_0xddf5('0x11'))[_0xddf5('0x12')](socket);function respondWithRpcPromise(_0x3e50f2,_0x10191b,_0x3e675b){return new BPromise(function(_0x5a4f45,_0x161973){return client[_0xddf5('0x13')](_0x3e50f2,_0x3e675b)[_0xddf5('0x14')](function(_0x10245f){logger[_0xddf5('0x15')](_0xddf5('0x16'),_0x10191b,_0xddf5('0x17'));logger[_0xddf5('0x18')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x10191b,'request\x20sent',JSON[_0xddf5('0x19')](_0x10245f));if(_0x10245f[_0xddf5('0x1a')]){if(_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1b')]===0x1f4){logger[_0xddf5('0x1a')](_0xddf5('0x16'),_0x10191b,_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1c')]);return _0x161973(_0x10245f['error'][_0xddf5('0x1c')]);}logger[_0xddf5('0x1a')](_0xddf5('0x16'),_0x10191b,_0x10245f[_0xddf5('0x1a')][_0xddf5('0x1c')]);return _0x5a4f45(_0x10245f['error'][_0xddf5('0x1c')]);}else{logger['info'](_0xddf5('0x16'),_0x10191b,'request\x20sent');_0x5a4f45(_0x10245f[_0xddf5('0x1d')][_0xddf5('0x1c')]);}})[_0xddf5('0x1e')](function(_0x1cd984){logger['error']('UserProfile,\x20%s,\x20%s',_0x10191b,_0x1cd984);_0x161973(_0x1cd984);});});} \ No newline at end of file +var _0xe08b=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_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 diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 4da4207..aee6c80 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 _0xd4ea=['save','remove','update','register','length','userProfile:'];(function(_0x34eec2,_0x34a883){var _0x2d696b=function(_0x5a3290){while(--_0x5a3290){_0x34eec2['push'](_0x34eec2['shift']());}};_0x2d696b(++_0x34a883);}(_0xd4ea,0x174));var _0xad4e=function(_0x181c64,_0x3634d6){_0x181c64=_0x181c64-0x0;var _0x329ebd=_0xd4ea[_0x181c64];return _0x329ebd;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xad4e('0x0'),_0xad4e('0x1'),_0xad4e('0x2')];function createListener(_0x389ffa,_0x5de7fb){return function(_0x4b9190){_0x5de7fb['emit'](_0x389ffa,_0x4b9190);};}function removeListener(_0x3720be,_0x9c3e2){return function(){UserProfileEvents['removeListener'](_0x3720be,_0x9c3e2);};}exports[_0xad4e('0x3')]=function(_0x244115){for(var _0x212b1c=0x0,_0x27550c=events[_0xad4e('0x4')];_0x212b1c<_0x27550c;_0x212b1c++){var _0xbf23fc=events[_0x212b1c];var _0x24d6e0=createListener(_0xad4e('0x5')+_0xbf23fc,_0x244115);UserProfileEvents['on'](_0xbf23fc,_0x24d6e0);}}; \ No newline at end of file +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 diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index a99a681..f398047 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 _0x66cc=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/:id','post','create','delete','destroy','exports'];(function(_0x2c9449,_0x5e98d3){var _0x33c58c=function(_0xdd0bfc){while(--_0xdd0bfc){_0x2c9449['push'](_0x2c9449['shift']());}};_0x33c58c(++_0x5e98d3);}(_0x66cc,0x1ee));var _0xc66c=function(_0x431529,_0x64c60b){_0x431529=_0x431529-0x0;var _0x4fc798=_0x66cc[_0x431529];return _0x4fc798;};'use strict';var multer=require(_0xc66c('0x0'));var util=require(_0xc66c('0x1'));var path=require(_0xc66c('0x2'));var timeout=require(_0xc66c('0x3'));var express=require(_0xc66c('0x4'));var router=express['Router']();var fs_extra=require(_0xc66c('0x5'));var auth=require(_0xc66c('0x6'));var interaction=require(_0xc66c('0x7'));var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router[_0xc66c('0x8')]('/',auth['isAuthenticated'](),controller[_0xc66c('0x9')]);router[_0xc66c('0x8')](_0xc66c('0xa'),auth[_0xc66c('0xb')](),controller[_0xc66c('0xc')]);router['get'](_0xc66c('0xd'),auth[_0xc66c('0xb')](),controller['show']);router[_0xc66c('0xe')]('/',auth['isAuthenticated'](),controller[_0xc66c('0xf')]);router['put'](_0xc66c('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xc66c('0x10')](_0xc66c('0xd'),auth[_0xc66c('0xb')](),controller[_0xc66c('0x11')]);module[_0xc66c('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c87d8e4..db509d4 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 _0xdea0=['exports','INTEGER','STRING','sequelize'];(function(_0x33ac7e,_0x5bd4d4){var _0x12c079=function(_0x470781){while(--_0x470781){_0x33ac7e['push'](_0x33ac7e['shift']());}};_0x12c079(++_0x5bd4d4);}(_0xdea0,0x1cb));var _0x0dea=function(_0x48229e,_0x13ab84){_0x48229e=_0x48229e-0x0;var _0x52fc56=_0xdea0[_0x48229e];return _0x52fc56;};'use strict';var Sequelize=require(_0x0dea('0x0'));module[_0x0dea('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0dea('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0dea('0x3')],'allowNull':![]}}; \ No newline at end of file +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 diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index c5ca8cc..b3c6da2 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 _0x7096=['Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','UserProfileResource','find','catch','create','body','describe','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','set'];(function(_0x1ee747,_0x30cb4b){var _0x4f2bb2=function(_0x1aa563){while(--_0x1aa563){_0x1ee747['push'](_0x1ee747['shift']());}};_0x4f2bb2(++_0x30cb4b);}(_0x7096,0x10c));var _0x6709=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x7096[_0x24237f];return _0x48298e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6709('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6709('0x1'));var rp=require('request-promise');var moment=require(_0x6709('0x2'));var BPromise=require(_0x6709('0x3'));var Mustache=require(_0x6709('0x4'));var util=require(_0x6709('0x5'));var path=require(_0x6709('0x6'));var sox=require(_0x6709('0x7'));var csv=require(_0x6709('0x8'));var ejs=require(_0x6709('0x9'));var fs=require('fs');var fs_extra=require(_0x6709('0xa'));var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var licenseUtil=require(_0x6709('0x18'));var db=require(_0x6709('0x19'))['db'];function respondWithStatusCode(_0x288f51,_0x1d56a5){_0x1d56a5=_0x1d56a5||0xcc;return function(_0x1ac547){if(_0x1ac547){return _0x288f51['sendStatus'](_0x1d56a5);}return _0x288f51[_0x6709('0x1a')](_0x1d56a5)[_0x6709('0x1b')]();};}function respondWithResult(_0x4d5255,_0x3706e1){_0x3706e1=_0x3706e1||0xc8;return function(_0x4e4587){if(_0x4e4587){return _0x4d5255[_0x6709('0x1a')](_0x3706e1)['json'](_0x4e4587);}};}function respondWithFilteredResult(_0x41af1f,_0x4bc059){return function(_0x149233){if(_0x149233){var _0x28866a=typeof _0x4bc059[_0x6709('0x1c')]===_0x6709('0x1d')&&typeof _0x4bc059['limit']==='undefined';var _0x5c4f94=_0x149233[_0x6709('0x1e')];var _0x235a54=_0x28866a?0x0:_0x4bc059['offset'];var _0x9c1fd8=_0x28866a?_0x149233[_0x6709('0x1e')]:_0x4bc059[_0x6709('0x1c')]+_0x4bc059['limit'];var _0x13cf04;if(_0x9c1fd8>=_0x5c4f94){_0x9c1fd8=_0x5c4f94;_0x13cf04=0xc8;}else{_0x13cf04=0xce;}_0x41af1f[_0x6709('0x1a')](_0x13cf04);return _0x41af1f[_0x6709('0x1f')](_0x6709('0x20'),_0x235a54+'-'+_0x9c1fd8+'/'+_0x5c4f94)['json'](_0x149233);}return null;};}function patchUpdates(_0x3c4971){return function(_0x1edac3){try{jsonpatch[_0x6709('0x21')](_0x1edac3,_0x3c4971,!![]);}catch(_0x3cf882){return BPromise[_0x6709('0x22')](_0x3cf882);}return _0x1edac3[_0x6709('0x23')]();};}function saveUpdates(_0x45921e,_0x17763d){return function(_0x386224){if(_0x386224){return _0x386224[_0x6709('0x24')](_0x45921e)[_0x6709('0x25')](function(_0xa36371){return _0xa36371;});}return null;};}function removeEntity(_0x5cf48b,_0x29f25f){return function(_0x81138e){if(_0x81138e){return _0x81138e[_0x6709('0x26')]()['then'](function(){_0x5cf48b[_0x6709('0x1a')](0xcc)[_0x6709('0x1b')]();});}};}function handleEntityNotFound(_0x20a347,_0x44b465){return function(_0x588e00){if(!_0x588e00){_0x20a347[_0x6709('0x27')](0x194);}return _0x588e00;};}function handleError(_0x3076fe,_0x50f7d6){_0x50f7d6=_0x50f7d6||0x1f4;return function(_0x585073){logger[_0x6709('0x28')](_0x585073['stack']);if(_0x585073[_0x6709('0x29')]){delete _0x585073[_0x6709('0x29')];}_0x3076fe['status'](_0x50f7d6)[_0x6709('0x2a')](_0x585073);};}exports['index']=function(_0x46a325,_0x3cd555){var _0x5b6906={},_0x137137={},_0x4e6989={'count':0x0,'rows':[]};var _0xe066d8=_[_0x6709('0x2b')](db['UserProfileResource'][_0x6709('0x2c')],function(_0x5deff5){return{'name':_0x5deff5[_0x6709('0x2d')],'type':_0x5deff5[_0x6709('0x2e')]['key']};});_0x137137['model']=_[_0x6709('0x2b')](_0xe066d8,_0x6709('0x29'));_0x137137[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x46a325[_0x6709('0x2f')]);_0x137137[_0x6709('0x31')]=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],_0x137137[_0x6709('0x2f')]);_0x5b6906['attributes']=_[_0x6709('0x32')](_0x137137[_0x6709('0x33')],qs[_0x6709('0x34')](_0x46a325[_0x6709('0x2f')]['fields']));_0x5b6906[_0x6709('0x35')]=_0x5b6906[_0x6709('0x35')][_0x6709('0x36')]?_0x5b6906[_0x6709('0x35')]:_0x137137['model'];if(!_0x46a325[_0x6709('0x2f')][_0x6709('0x37')]('nolimit')){_0x5b6906[_0x6709('0x38')]=qs[_0x6709('0x38')](_0x46a325['query'][_0x6709('0x38')]);_0x5b6906[_0x6709('0x1c')]=qs[_0x6709('0x1c')](_0x46a325[_0x6709('0x2f')][_0x6709('0x1c')]);}_0x5b6906[_0x6709('0x39')]=qs[_0x6709('0x3a')](_0x46a325['query'][_0x6709('0x3a')]);_0x5b6906[_0x6709('0x3b')]=qs['filters'](_[_0x6709('0x3c')](_0x46a325[_0x6709('0x2f')],_0x137137[_0x6709('0x31')]),_0xe066d8);if(_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]){_0x5b6906[_0x6709('0x3b')]=_['merge'](_0x5b6906[_0x6709('0x3b')],{'$or':_['map'](_0xe066d8,function(_0x31e05a){if(_0x31e05a[_0x6709('0x2e')]!==_0x6709('0x3e')){var _0x48492f={};_0x48492f[_0x31e05a[_0x6709('0x29')]]={'$like':'%'+_0x46a325[_0x6709('0x2f')][_0x6709('0x3d')]+'%'};return _0x48492f;}})});}_0x5b6906=_[_0x6709('0x3f')]({},_0x5b6906,_0x46a325[_0x6709('0x40')]);var _0x1030ee={'where':_0x5b6906[_0x6709('0x3b')]};return db['UserProfileResource'][_0x6709('0x1e')](_0x1030ee)[_0x6709('0x25')](function(_0x50fbcd){_0x4e6989[_0x6709('0x1e')]=_0x50fbcd;if(_0x46a325[_0x6709('0x2f')][_0x6709('0x41')]){_0x5b6906[_0x6709('0x42')]=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x5b6906);})[_0x6709('0x25')](function(_0x3f0da1){_0x4e6989[_0x6709('0x43')]=_0x3f0da1;return _0x4e6989;})[_0x6709('0x25')](respondWithFilteredResult(_0x3cd555,_0x5b6906))['catch'](handleError(_0x3cd555,null));};exports['show']=function(_0x5af1fb,_0x3d4237){var _0x293577={'raw':![],'where':{'id':_0x5af1fb[_0x6709('0x44')]['id']}},_0x54f74e={};_0x54f74e[_0x6709('0x33')]=_['keys'](db['UserProfileResource'][_0x6709('0x2c')]);_0x54f74e[_0x6709('0x2f')]=_[_0x6709('0x30')](_0x5af1fb[_0x6709('0x2f')]);_0x54f74e[_0x6709('0x31')]=_['intersection'](_0x54f74e[_0x6709('0x33')],_0x54f74e['query']);_0x293577[_0x6709('0x35')]=_[_0x6709('0x32')](_0x54f74e[_0x6709('0x33')],qs['fields'](_0x5af1fb[_0x6709('0x2f')]['fields']));_0x293577['attributes']=_0x293577[_0x6709('0x35')][_0x6709('0x36')]?_0x293577[_0x6709('0x35')]:_0x54f74e[_0x6709('0x33')];if(_0x5af1fb[_0x6709('0x2f')][_0x6709('0x41')]){_0x293577[_0x6709('0x42')]=[{'all':!![]}];}_0x293577=_[_0x6709('0x3f')]({},_0x293577,_0x5af1fb[_0x6709('0x40')]);return db[_0x6709('0x45')][_0x6709('0x46')](_0x293577)[_0x6709('0x25')](handleEntityNotFound(_0x3d4237,null))[_0x6709('0x25')](respondWithResult(_0x3d4237,null))[_0x6709('0x47')](handleError(_0x3d4237,null));};exports[_0x6709('0x48')]=function(_0x4f82a0,_0xfbb810){return db['UserProfileResource']['create'](_0x4f82a0[_0x6709('0x49')],{})[_0x6709('0x25')](respondWithResult(_0xfbb810,0xc9))[_0x6709('0x47')](handleError(_0xfbb810,null));};exports[_0x6709('0x24')]=function(_0x22363b,_0x2b05dc){if(_0x22363b[_0x6709('0x49')]['id']){delete _0x22363b[_0x6709('0x49')]['id'];}return db['UserProfileResource'][_0x6709('0x46')]({'where':{'id':_0x22363b[_0x6709('0x44')]['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2b05dc,null))[_0x6709('0x25')](saveUpdates(_0x22363b['body'],null))[_0x6709('0x25')](respondWithResult(_0x2b05dc,null))['catch'](handleError(_0x2b05dc,null));};exports[_0x6709('0x26')]=function(_0x34a950,_0x2a563b){return db[_0x6709('0x45')][_0x6709('0x46')]({'where':{'id':_0x34a950['params']['id']}})[_0x6709('0x25')](handleEntityNotFound(_0x2a563b,null))[_0x6709('0x25')](removeEntity(_0x2a563b,null))[_0x6709('0x47')](handleError(_0x2a563b,null));};exports[_0x6709('0x4a')]=function(_0x1015e0,_0x55188c){return db['UserProfileResource'][_0x6709('0x4a')]()['then'](respondWithResult(_0x55188c,null))['catch'](handleError(_0x55188c,null));}; \ No newline at end of file +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 diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 3c9ad08..301442b 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 _0xf41d=['../../config/environment','define','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf41d,0x171));var _0xdf41=function(_0x52ed18,_0x722adb){_0x52ed18=_0x52ed18-0x0;var _0x5d0a9e=_0xf41d[_0x52ed18];return _0x5d0a9e;};'use strict';var _=require(_0xdf41('0x0'));var util=require(_0xdf41('0x1'));var logger=require(_0xdf41('0x2'))(_0xdf41('0x3'));var moment=require(_0xdf41('0x4'));var BPromise=require(_0xdf41('0x5'));var rp=require(_0xdf41('0x6'));var fs=require('fs');var path=require(_0xdf41('0x7'));var rimraf=require(_0xdf41('0x8'));var config=require(_0xdf41('0x9'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x445f4b,_0x1fef77){return _0x445f4b[_0xdf41('0xa')]('UserProfileResource',attributes,{'tableName':_0xdf41('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xdf41('0xc'),_0xdf41('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 97202d9..5fb6f5f 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 _0xb6b0=['request\x20sent','error','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x2de39f,_0x3e5696){var _0x55b81b=function(_0x50b827){while(--_0x50b827){_0x2de39f['push'](_0x2de39f['shift']());}};_0x55b81b(++_0x3e5696);}(_0xb6b0,0x1cc));var _0x0b6b=function(_0x20c8c1,_0x1ee6f3){_0x20c8c1=_0x20c8c1-0x0;var _0x51bbb0=_0xb6b0[_0x20c8c1];return _0x51bbb0;};'use strict';var _=require(_0x0b6b('0x0'));var util=require(_0x0b6b('0x1'));var moment=require(_0x0b6b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b6b('0x3'));var db=require(_0x0b6b('0x4'))['db'];var utils=require(_0x0b6b('0x5'));var logger=require(_0x0b6b('0x6'))(_0x0b6b('0x7'));var config=require(_0x0b6b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0b6b('0x9')][_0x0b6b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x52fdec,_0x2fe4f8,_0x58f29a){return new BPromise(function(_0x2a1b1d,_0x4b0b02){return client[_0x0b6b('0xb')](_0x52fdec,_0x58f29a)[_0x0b6b('0xc')](function(_0x4a83f7){logger[_0x0b6b('0xd')](_0x0b6b('0xe'),_0x2fe4f8,_0x0b6b('0xf'));logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x2fe4f8,_0x0b6b('0xf'),JSON['stringify'](_0x4a83f7));if(_0x4a83f7[_0x0b6b('0x10')]){if(_0x4a83f7[_0x0b6b('0x10')]['code']===0x1f4){logger[_0x0b6b('0x10')](_0x0b6b('0xe'),_0x2fe4f8,_0x4a83f7['error'][_0x0b6b('0x11')]);return _0x4b0b02(_0x4a83f7[_0x0b6b('0x10')]['message']);}logger['error']('UserProfileResource,\x20%s,\x20%s',_0x2fe4f8,_0x4a83f7['error']['message']);return _0x2a1b1d(_0x4a83f7[_0x0b6b('0x10')][_0x0b6b('0x11')]);}else{logger['info'](_0x0b6b('0xe'),_0x2fe4f8,_0x0b6b('0xf'));_0x2a1b1d(_0x4a83f7['result']['message']);}})[_0x0b6b('0x12')](function(_0x154848){logger[_0x0b6b('0x10')](_0x0b6b('0xe'),_0x2fe4f8,_0x154848);_0x4b0b02(_0x154848);});});} \ No newline at end of file +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 diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 9128df6..59803cc 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 _0xac01=['isAuthenticated','index','/describe','describe','/:id','show','create','put','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1cfdc4,_0x3bb6a1){var _0x35b16e=function(_0x4ee41c){while(--_0x4ee41c){_0x1cfdc4['push'](_0x1cfdc4['shift']());}};_0x35b16e(++_0x3bb6a1);}(_0xac01,0xc8));var _0x1ac0=function(_0x502cf5,_0x4b73b5){_0x502cf5=_0x502cf5-0x0;var _0x2c6bc4=_0xac01[_0x502cf5];return _0x2c6bc4;};'use strict';var multer=require(_0x1ac0('0x0'));var util=require('util');var path=require(_0x1ac0('0x1'));var timeout=require(_0x1ac0('0x2'));var express=require(_0x1ac0('0x3'));var router=express['Router']();var fs_extra=require(_0x1ac0('0x4'));var auth=require(_0x1ac0('0x5'));var interaction=require(_0x1ac0('0x6'));var config=require(_0x1ac0('0x7'));var controller=require('./userProfileSection.controller');router[_0x1ac0('0x8')]('/',auth[_0x1ac0('0x9')](),controller[_0x1ac0('0xa')]);router[_0x1ac0('0x8')](_0x1ac0('0xb'),auth[_0x1ac0('0x9')](),controller[_0x1ac0('0xc')]);router['get'](_0x1ac0('0xd'),auth['isAuthenticated'](),controller[_0x1ac0('0xe')]);router['post']('/',auth[_0x1ac0('0x9')](),controller[_0x1ac0('0xf')]);router[_0x1ac0('0x10')]('/:id',auth[_0x1ac0('0x9')](),controller['update']);router['delete'](_0x1ac0('0xd'),auth[_0x1ac0('0x9')](),controller[_0x1ac0('0x11')]);module[_0x1ac0('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 4efd44e..f61a24d 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 _0x1399=['sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x597e46,_0x14bcbe){var _0x37463b=function(_0x39326c){while(--_0x39326c){_0x597e46['push'](_0x597e46['shift']());}};_0x37463b(++_0x14bcbe);}(_0x1399,0x16c));var _0x9139=function(_0x3c31d6,_0x11a67d){_0x3c31d6=_0x3c31d6-0x0;var _0x464347=_0x1399[_0x3c31d6];return _0x464347;};'use strict';var Sequelize=require(_0x9139('0x0'));module[_0x9139('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x9139('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x9139('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x9139('0x2')],'set':function(_0x28f155){this[_0x9139('0x4')](_0x9139('0x5'),_0x28f155?_0x28f155['join'](''):[]);},'get':function(){return this['getDataValue'](_0x9139('0x5'))?this[_0x9139('0x6')](_0x9139('0x5'))['split'](''):[];}}}; \ No newline at end of file +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 diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 7bcc3e7..0769509 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 _0x542c=['send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','show','params','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x61e241,_0x1c76d0){var _0x568bbe=function(_0x78e3a4){while(--_0x78e3a4){_0x61e241['push'](_0x61e241['shift']());}};_0x568bbe(++_0x1c76d0);}(_0x542c,0x69));var _0xc542=function(_0x1d8bdb,_0x2c9ade){_0x1d8bdb=_0x1d8bdb-0x0;var _0x1f1423=_0x542c[_0x1d8bdb];return _0x1f1423;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc542('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc542('0x1'));var rp=require(_0xc542('0x2'));var moment=require(_0xc542('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc542('0x4'));var util=require(_0xc542('0x5'));var path=require(_0xc542('0x6'));var sox=require(_0xc542('0x7'));var csv=require(_0xc542('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc542('0x9'));var crypto=require(_0xc542('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc542('0xb'));var toCsv=require(_0xc542('0x8'));var querystring=require('querystring');var Papa=require(_0xc542('0xc'));var Redis=require('ioredis');var authService=require(_0xc542('0xd'));var qs=require(_0xc542('0xe'));var as=require(_0xc542('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc542('0x10'))(_0xc542('0x11'));var utils=require(_0xc542('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x574674,_0x3efbe3){_0x3efbe3=_0x3efbe3||0xcc;return function(_0x3d9cd9){if(_0x3d9cd9){return _0x574674[_0xc542('0x13')](_0x3efbe3);}return _0x574674[_0xc542('0x14')](_0x3efbe3)[_0xc542('0x15')]();};}function respondWithResult(_0x59c7a2,_0x3ad9dc){_0x3ad9dc=_0x3ad9dc||0xc8;return function(_0x12608f){if(_0x12608f){return _0x59c7a2[_0xc542('0x14')](_0x3ad9dc)[_0xc542('0x16')](_0x12608f);}};}function respondWithFilteredResult(_0x36ffe8,_0xaaa24){return function(_0x3e5f8a){if(_0x3e5f8a){var _0x9ff32b=typeof _0xaaa24[_0xc542('0x17')]===_0xc542('0x18')&&typeof _0xaaa24['limit']===_0xc542('0x18');var _0x48e137=_0x3e5f8a[_0xc542('0x19')];var _0x37cd5a=_0x9ff32b?0x0:_0xaaa24[_0xc542('0x17')];var _0x1dd5cb=_0x9ff32b?_0x3e5f8a[_0xc542('0x19')]:_0xaaa24['offset']+_0xaaa24['limit'];var _0x714e27;if(_0x1dd5cb>=_0x48e137){_0x1dd5cb=_0x48e137;_0x714e27=0xc8;}else{_0x714e27=0xce;}_0x36ffe8[_0xc542('0x14')](_0x714e27);return _0x36ffe8[_0xc542('0x1a')](_0xc542('0x1b'),_0x37cd5a+'-'+_0x1dd5cb+'/'+_0x48e137)[_0xc542('0x16')](_0x3e5f8a);}return null;};}function patchUpdates(_0x5c1add){return function(_0xd042ea){try{jsonpatch['apply'](_0xd042ea,_0x5c1add,!![]);}catch(_0x425daa){return BPromise[_0xc542('0x1c')](_0x425daa);}return _0xd042ea[_0xc542('0x1d')]();};}function saveUpdates(_0x4da40d,_0x1aaf07){return function(_0x2aa94c){if(_0x2aa94c){return _0x2aa94c[_0xc542('0x1e')](_0x4da40d)[_0xc542('0x1f')](function(_0x330171){return _0x330171;});}return null;};}function removeEntity(_0x2a76f4,_0x55038e){return function(_0x2a82cd){if(_0x2a82cd){return _0x2a82cd[_0xc542('0x20')]()[_0xc542('0x1f')](function(){_0x2a76f4['status'](0xcc)[_0xc542('0x15')]();});}};}function handleEntityNotFound(_0x41b563,_0x43e979){return function(_0x530b00){if(!_0x530b00){_0x41b563[_0xc542('0x13')](0x194);}return _0x530b00;};}function handleError(_0x14a11c,_0x2572c0){_0x2572c0=_0x2572c0||0x1f4;return function(_0x116ce){logger[_0xc542('0x21')](_0x116ce[_0xc542('0x22')]);if(_0x116ce['name']){delete _0x116ce['name'];}_0x14a11c[_0xc542('0x14')](_0x2572c0)[_0xc542('0x23')](_0x116ce);};}exports[_0xc542('0x24')]=function(_0x35ecac,_0x1fafdf){var _0x473e4c={},_0xbffa4e={},_0x3ec492={'count':0x0,'rows':[]};var _0x5ed0ff=_[_0xc542('0x25')](db[_0xc542('0x26')][_0xc542('0x27')],function(_0x185816){return{'name':_0x185816[_0xc542('0x28')],'type':_0x185816[_0xc542('0x29')][_0xc542('0x2a')]};});_0xbffa4e[_0xc542('0x2b')]=_[_0xc542('0x25')](_0x5ed0ff,_0xc542('0x2c'));_0xbffa4e[_0xc542('0x2d')]=_[_0xc542('0x2e')](_0x35ecac[_0xc542('0x2d')]);_0xbffa4e[_0xc542('0x2f')]=_['intersection'](_0xbffa4e[_0xc542('0x2b')],_0xbffa4e[_0xc542('0x2d')]);_0x473e4c['attributes']=_[_0xc542('0x30')](_0xbffa4e[_0xc542('0x2b')],qs[_0xc542('0x31')](_0x35ecac[_0xc542('0x2d')][_0xc542('0x31')]));_0x473e4c['attributes']=_0x473e4c[_0xc542('0x32')][_0xc542('0x33')]?_0x473e4c[_0xc542('0x32')]:_0xbffa4e['model'];if(!_0x35ecac[_0xc542('0x2d')][_0xc542('0x34')]('nolimit')){_0x473e4c[_0xc542('0x35')]=qs[_0xc542('0x35')](_0x35ecac[_0xc542('0x2d')][_0xc542('0x35')]);_0x473e4c[_0xc542('0x17')]=qs[_0xc542('0x17')](_0x35ecac[_0xc542('0x2d')][_0xc542('0x17')]);}_0x473e4c[_0xc542('0x36')]=qs['sort'](_0x35ecac[_0xc542('0x2d')][_0xc542('0x37')]);_0x473e4c[_0xc542('0x38')]=qs['filters'](_[_0xc542('0x39')](_0x35ecac['query'],_0xbffa4e[_0xc542('0x2f')]),_0x5ed0ff);if(_0x35ecac['query'][_0xc542('0x3a')]){_0x473e4c[_0xc542('0x38')]=_[_0xc542('0x3b')](_0x473e4c[_0xc542('0x38')],{'$or':_[_0xc542('0x25')](_0x5ed0ff,function(_0x152a17){if(_0x152a17[_0xc542('0x29')]!==_0xc542('0x3c')){var _0x1455c4={};_0x1455c4[_0x152a17[_0xc542('0x2c')]]={'$like':'%'+_0x35ecac[_0xc542('0x2d')][_0xc542('0x3a')]+'%'};return _0x1455c4;}})});}_0x473e4c=_[_0xc542('0x3b')]({},_0x473e4c,_0x35ecac['options']);var _0x295d59={'where':_0x473e4c[_0xc542('0x38')]};return db[_0xc542('0x26')][_0xc542('0x19')](_0x295d59)[_0xc542('0x1f')](function(_0x28d906){_0x3ec492[_0xc542('0x19')]=_0x28d906;if(_0x35ecac[_0xc542('0x2d')][_0xc542('0x3d')]){_0x473e4c['include']=[{'all':!![]}];}return db[_0xc542('0x26')]['findAll'](_0x473e4c);})[_0xc542('0x1f')](function(_0x2512ef){_0x3ec492[_0xc542('0x3e')]=_0x2512ef;return _0x3ec492;})['then'](respondWithFilteredResult(_0x1fafdf,_0x473e4c))[_0xc542('0x3f')](handleError(_0x1fafdf,null));};exports[_0xc542('0x40')]=function(_0x3cd761,_0x474ed6){var _0x107bc3={'raw':![],'where':{'id':_0x3cd761[_0xc542('0x41')]['id']}},_0x34fb23={};_0x34fb23['model']=_[_0xc542('0x2e')](db[_0xc542('0x26')][_0xc542('0x27')]);_0x34fb23[_0xc542('0x2d')]=_[_0xc542('0x2e')](_0x3cd761['query']);_0x34fb23[_0xc542('0x2f')]=_[_0xc542('0x30')](_0x34fb23['model'],_0x34fb23[_0xc542('0x2d')]);_0x107bc3[_0xc542('0x32')]=_['intersection'](_0x34fb23['model'],qs['fields'](_0x3cd761['query'][_0xc542('0x31')]));_0x107bc3[_0xc542('0x32')]=_0x107bc3[_0xc542('0x32')][_0xc542('0x33')]?_0x107bc3[_0xc542('0x32')]:_0x34fb23[_0xc542('0x2b')];if(_0x3cd761[_0xc542('0x2d')]['includeAll']){_0x107bc3['include']=[{'all':!![]}];}_0x107bc3=_['merge']({},_0x107bc3,_0x3cd761['options']);return db[_0xc542('0x26')]['find'](_0x107bc3)[_0xc542('0x1f')](handleEntityNotFound(_0x474ed6,null))[_0xc542('0x1f')](respondWithResult(_0x474ed6,null))[_0xc542('0x3f')](handleError(_0x474ed6,null));};exports[_0xc542('0x42')]=function(_0x16add9,_0x221ab3){return db[_0xc542('0x26')][_0xc542('0x42')](_0x16add9[_0xc542('0x43')],{})['then'](respondWithResult(_0x221ab3,0xc9))[_0xc542('0x3f')](handleError(_0x221ab3,null));};exports[_0xc542('0x1e')]=function(_0x2ec424,_0x31e169){if(_0x2ec424[_0xc542('0x43')]['id']){delete _0x2ec424[_0xc542('0x43')]['id'];}return db[_0xc542('0x26')][_0xc542('0x44')]({'where':{'id':_0x2ec424[_0xc542('0x41')]['id']}})[_0xc542('0x1f')](handleEntityNotFound(_0x31e169,null))['then'](saveUpdates(_0x2ec424['body'],null))['then'](respondWithResult(_0x31e169,null))[_0xc542('0x3f')](handleError(_0x31e169,null));};exports[_0xc542('0x20')]=function(_0x1e4cf8,_0x2eda7c){return db[_0xc542('0x26')]['find']({'where':{'id':_0x1e4cf8[_0xc542('0x41')]['id']}})['then'](handleEntityNotFound(_0x2eda7c,null))['then'](removeEntity(_0x2eda7c,null))[_0xc542('0x3f')](handleError(_0x2eda7c,null));};exports['describe']=function(_0x3aabff,_0x532716){return db[_0xc542('0x26')][_0xc542('0x45')]()[_0xc542('0x1f')](respondWithResult(_0x532716,null))[_0xc542('0x3f')](handleError(_0x532716,null));}; \ No newline at end of file +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 diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 41e4081..0702ff1 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 _0xd549=['UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes'];(function(_0x45ad88,_0xcaca61){var _0x41a0c8=function(_0x2146f6){while(--_0x2146f6){_0x45ad88['push'](_0x45ad88['shift']());}};_0x41a0c8(++_0xcaca61);}(_0xd549,0x7c));var _0x9d54=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xd549[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x9d54('0x0'));var util=require('util');var logger=require(_0x9d54('0x1'))(_0x9d54('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9d54('0x3'));var fs=require('fs');var path=require(_0x9d54('0x4'));var rimraf=require(_0x9d54('0x5'));var config=require(_0x9d54('0x6'));var attributes=require(_0x9d54('0x7'));module['exports']=function(_0x3481a7,_0xfd1be0){return _0x3481a7['define'](_0x9d54('0x8'),attributes,{'tableName':_0x9d54('0x9'),'paranoid':![],'indexes':[{'name':_0x9d54('0xa'),'fields':[_0x9d54('0xb'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 0ac3e21..4ab934b 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 _0x5b94=['../../config/logger','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f089d,_0x344400){var _0x506c8c=function(_0x165e8d){while(--_0x165e8d){_0x2f089d['push'](_0x2f089d['shift']());}};_0x506c8c(++_0x344400);}(_0x5b94,0x117));var _0x45b9=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x5b94[_0x50aa2e];return _0x5e07f0;};'use strict';var _=require(_0x45b9('0x0'));var util=require(_0x45b9('0x1'));var moment=require(_0x45b9('0x2'));var BPromise=require('bluebird');var rs=require(_0x45b9('0x3'));var fs=require('fs');var Redis=require(_0x45b9('0x4'));var db=require(_0x45b9('0x5'))['db'];var utils=require(_0x45b9('0x6'));var logger=require(_0x45b9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x45b9('0x8'));var client=jayson[_0x45b9('0x9')][_0x45b9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d7fdc,_0x24be36,_0x5a8e1f){return new BPromise(function(_0x25f3fd,_0x17b12d){return client[_0x45b9('0xb')](_0x3d7fdc,_0x5a8e1f)[_0x45b9('0xc')](function(_0x2ad584){logger[_0x45b9('0xd')](_0x45b9('0xe'),_0x24be36,_0x45b9('0xf'));logger[_0x45b9('0x10')](_0x45b9('0x11'),_0x24be36,_0x45b9('0xf'),JSON['stringify'](_0x2ad584));if(_0x2ad584[_0x45b9('0x12')]){if(_0x2ad584[_0x45b9('0x12')][_0x45b9('0x13')]===0x1f4){logger[_0x45b9('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x24be36,_0x2ad584[_0x45b9('0x12')][_0x45b9('0x14')]);return _0x17b12d(_0x2ad584[_0x45b9('0x12')][_0x45b9('0x14')]);}logger['error'](_0x45b9('0xe'),_0x24be36,_0x2ad584[_0x45b9('0x12')][_0x45b9('0x14')]);return _0x25f3fd(_0x2ad584['error']['message']);}else{logger[_0x45b9('0xd')](_0x45b9('0xe'),_0x24be36,_0x45b9('0xf'));_0x25f3fd(_0x2ad584['result'][_0x45b9('0x14')]);}})[_0x45b9('0x15')](function(_0x1752dc){logger[_0x45b9('0x12')](_0x45b9('0xe'),_0x24be36,_0x1752dc);_0x17b12d(_0x1752dc);});});} \ No newline at end of file +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 diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index aa56274..eddd9b0 100644 --- a/server/api/userSmsQueue/index.js +++ b/server/api/userSmsQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x3419b0,_0x255acd){var _0x2fddb6=function(_0x3de0a1){while(--_0x3de0a1){_0x3419b0['push'](_0x3419b0['shift']());}};_0x2fddb6(++_0x255acd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +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 diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 25eba31..f684874 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 _0x41b5=['exports','INTEGER'];(function(_0x205b22,_0x33216f){var _0x2e00bd=function(_0x503aec){while(--_0x503aec){_0x205b22['push'](_0x205b22['shift']());}};_0x2e00bd(++_0x33216f);}(_0x41b5,0x94));var _0x541b=function(_0x539927,_0x1fd784){_0x539927=_0x539927-0x0;var _0x5adb6a=_0x41b5[_0x539927];return _0x5adb6a;};'use strict';var Sequelize=require('sequelize');module[_0x541b('0x0')]={'penalty':{'type':Sequelize[_0x541b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index a542323..a78b715 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 _0x6050=['../../config/environment','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x196c58,_0x2b63b9){var _0x1ccbe2=function(_0x52808f){while(--_0x52808f){_0x196c58['push'](_0x196c58['shift']());}};_0x1ccbe2(++_0x2b63b9);}(_0x6050,0x196));var _0x0605=function(_0x29b488,_0x43ddbb){_0x29b488=_0x29b488-0x0;var _0x3f79d9=_0x6050[_0x29b488];return _0x3f79d9;};'use strict';var _=require(_0x0605('0x0'));var util=require(_0x0605('0x1'));var logger=require(_0x0605('0x2'))(_0x0605('0x3'));var moment=require(_0x0605('0x4'));var BPromise=require(_0x0605('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0605('0x6'));var rimraf=require(_0x0605('0x7'));var config=require(_0x0605('0x8'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x4aca21,_0xd78d96){return _0x4aca21['define']('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 28f8611..331d51f 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 _0x2999=['message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../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'];(function(_0x28bbec,_0x1536ae){var _0x480c2e=function(_0x5d2fa6){while(--_0x5d2fa6){_0x28bbec['push'](_0x28bbec['shift']());}};_0x480c2e(++_0x1536ae);}(_0x2999,0x1a5));var _0x9299=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2999[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9299('0x0'));var util=require('util');var moment=require(_0x9299('0x1'));var BPromise=require(_0x9299('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9299('0x3'))['db'];var utils=require(_0x9299('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9299('0x5'));var jayson=require(_0x9299('0x6'));var client=jayson[_0x9299('0x7')][_0x9299('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15e4d3,_0x1d87de,_0x5e2299){return new BPromise(function(_0x523fc6,_0x5b5486){return client[_0x9299('0x9')](_0x15e4d3,_0x5e2299)[_0x9299('0xa')](function(_0x450aab){logger[_0x9299('0xb')](_0x9299('0xc'),_0x1d87de,_0x9299('0xd'));logger[_0x9299('0xe')](_0x9299('0xf'),_0x1d87de,_0x9299('0xd'),JSON[_0x9299('0x10')](_0x450aab));if(_0x450aab['error']){if(_0x450aab[_0x9299('0x11')][_0x9299('0x12')]===0x1f4){logger[_0x9299('0x11')](_0x9299('0xc'),_0x1d87de,_0x450aab[_0x9299('0x11')][_0x9299('0x13')]);return _0x5b5486(_0x450aab['error'][_0x9299('0x13')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1d87de,_0x450aab[_0x9299('0x11')][_0x9299('0x13')]);return _0x523fc6(_0x450aab['error'][_0x9299('0x13')]);}else{logger[_0x9299('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x1d87de,_0x9299('0xd'));_0x523fc6(_0x450aab[_0x9299('0x14')]['message']);}})[_0x9299('0x15')](function(_0x3680d8){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x1d87de,_0x3680d8);_0x5b5486(_0x3680d8);});});} \ No newline at end of file +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 diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 3fe7d50..ab64cfc 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 _0xeec7=['sequelize','exports','INTEGER'];(function(_0x2f954d,_0x4921ee){var _0x3c93ae=function(_0x31f622){while(--_0x31f622){_0x2f954d['push'](_0x2f954d['shift']());}};_0x3c93ae(++_0x4921ee);}(_0xeec7,0x1b3));var _0x7eec=function(_0x2f89c0,_0x455702){_0x2f89c0=_0x2f89c0-0x0;var _0x164223=_0xeec7[_0x2f89c0];return _0x164223;};'use strict';var Sequelize=require(_0x7eec('0x0'));module[_0x7eec('0x1')]={'UserId':{'type':Sequelize[_0x7eec('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7eec('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 6dd08c3..a034c58 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(_0x16caae,_0xacf0e5){var _0x184c23=function(_0x4897cb){while(--_0x4897cb){_0x16caae['push'](_0x16caae['shift']());}};_0x184c23(++_0xacf0e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_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 diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index c2378c6..aacf9d6 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x23076d,_0x5b6c5d){var _0x2e4193=function(_0x238aec){while(--_0x238aec){_0x23076d['push'](_0x23076d['shift']());}};_0x2e4193(++_0x5b6c5d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xcb91[_0x4f1da5];return _0xe972a8;};'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(_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 diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index f689fff..d80930d 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 _0x5908=['sequelize','exports'];(function(_0x1fee1b,_0x12960f){var _0x48e2d2=function(_0x33b45b){while(--_0x33b45b){_0x1fee1b['push'](_0x1fee1b['shift']());}};_0x48e2d2(++_0x12960f);}(_0x5908,0x84));var _0x8590=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x5908[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0x8590('0x0'));module[_0x8590('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 4ff95f8..4aa5869 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 _0xd5f9=['util','api','moment','bluebird','rimraf','../../config/environment','exports','define','user_has_voice_queues'];(function(_0x339174,_0x1d60c2){var _0x343afb=function(_0x76e1d5){while(--_0x76e1d5){_0x339174['push'](_0x339174['shift']());}};_0x343afb(++_0x1d60c2);}(_0xd5f9,0x13b));var _0x9d5f=function(_0x59a294,_0x17dde5){_0x59a294=_0x59a294-0x0;var _0x175f9b=_0xd5f9[_0x59a294];return _0x175f9b;};'use strict';var _=require('lodash');var util=require(_0x9d5f('0x0'));var logger=require('../../config/logger')(_0x9d5f('0x1'));var moment=require(_0x9d5f('0x2'));var BPromise=require(_0x9d5f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d5f('0x4'));var config=require(_0x9d5f('0x5'));var attributes=require('./userVoiceQueue.attributes');module[_0x9d5f('0x6')]=function(_0x1d3c14,_0x48db3a){return _0x1d3c14[_0x9d5f('0x7')]('UserVoiceQueue',attributes,{'tableName':_0x9d5f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index f64a2af..d225425 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 _0x6286=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x4f108c,_0x59b28d){var _0x1c43fe=function(_0x21c37b){while(--_0x21c37b){_0x4f108c['push'](_0x4f108c['shift']());}};_0x1c43fe(++_0x59b28d);}(_0x6286,0x1bb));var _0x6628=function(_0x3be3b1,_0x4c209d){_0x3be3b1=_0x3be3b1-0x0;var _0x23f366=_0x6286[_0x3be3b1];return _0x23f366;};'use strict';var _=require(_0x6628('0x0'));var util=require(_0x6628('0x1'));var moment=require(_0x6628('0x2'));var BPromise=require(_0x6628('0x3'));var rs=require(_0x6628('0x4'));var fs=require('fs');var Redis=require(_0x6628('0x5'));var db=require(_0x6628('0x6'))['db'];var utils=require(_0x6628('0x7'));var logger=require('../../config/logger')(_0x6628('0x8'));var config=require(_0x6628('0x9'));var jayson=require(_0x6628('0xa'));var client=jayson[_0x6628('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x492288,_0x163d3b,_0x3d699c){return new BPromise(function(_0x1af2d4,_0xdb46e0){return client[_0x6628('0xc')](_0x492288,_0x3d699c)['then'](function(_0x2f5af8){logger[_0x6628('0xd')](_0x6628('0xe'),_0x163d3b,_0x6628('0xf'));logger[_0x6628('0x10')](_0x6628('0x11'),_0x163d3b,'request\x20sent',JSON['stringify'](_0x2f5af8));if(_0x2f5af8[_0x6628('0x12')]){if(_0x2f5af8['error'][_0x6628('0x13')]===0x1f4){logger[_0x6628('0x12')](_0x6628('0xe'),_0x163d3b,_0x2f5af8[_0x6628('0x12')][_0x6628('0x14')]);return _0xdb46e0(_0x2f5af8['error'][_0x6628('0x14')]);}logger[_0x6628('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x163d3b,_0x2f5af8[_0x6628('0x12')][_0x6628('0x14')]);return _0x1af2d4(_0x2f5af8[_0x6628('0x12')][_0x6628('0x14')]);}else{logger[_0x6628('0xd')](_0x6628('0xe'),_0x163d3b,_0x6628('0xf'));_0x1af2d4(_0x2f5af8[_0x6628('0x15')][_0x6628('0x14')]);}})[_0x6628('0x16')](function(_0x4b5d1){logger[_0x6628('0x12')](_0x6628('0xe'),_0x163d3b,_0x4b5d1);_0xdb46e0(_0x4b5d1);});});} \ No newline at end of file +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 diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 0ec5c2a..727e18a 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x541e1f,_0x422be8){var _0x41d501=function(_0x59381d){while(--_0x59381d){_0x541e1f['push'](_0x541e1f['shift']());}};_0x41d501(++_0x422be8);}(_0xedd9,0xfc));var _0x9edd=function(_0x2826d9,_0x28f60f){_0x2826d9=_0x2826d9-0x0;var _0x96122b=_0xedd9[_0x2826d9];return _0x96122b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index c92a4db..5f2f2a6 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 _0x3987=['Required\x20by\x20Asterisk','STRING','queue_interface','sequelize','exports','INTEGER'];(function(_0x10d405,_0x28d136){var _0x12bd98=function(_0x3b6cc3){while(--_0x3b6cc3){_0x10d405['push'](_0x10d405['shift']());}};_0x12bd98(++_0x28d136);}(_0x3987,0x18f));var _0x7398=function(_0x2b5bae,_0x30446f){_0x2b5bae=_0x2b5bae-0x0;var _0x33ce0c=_0x3987[_0x2b5bae];return _0x33ce0c;};'use strict';var Sequelize=require(_0x7398('0x0'));module[_0x7398('0x1')]={'uniqueid':{'type':Sequelize[_0x7398('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x7398('0x3')},'UserId':{'type':Sequelize[_0x7398('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x7398('0x4')],'allowNull':![],'unique':_0x7398('0x5'),'comment':_0x7398('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x7398('0x4')],'allowNull':![],'unique':_0x7398('0x5'),'comment':_0x7398('0x3')},'penalty':{'type':Sequelize[_0x7398('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x7398('0x2')](0xb),'defaultValue':0x0,'comment':_0x7398('0x3')}}; \ No newline at end of file +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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 0026b23..8275a21 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 _0xa9d2=['setMaxListeners','save','remove','emit','exports','events','../../mysqldb','UserVoiceQueueRt'];(function(_0x330175,_0x259135){var _0x192feb=function(_0x28790d){while(--_0x28790d){_0x330175['push'](_0x330175['shift']());}};_0x192feb(++_0x259135);}(_0xa9d2,0x95));var _0x2a9d=function(_0x4d8704,_0xd27936){_0x4d8704=_0x4d8704-0x0;var _0x413914=_0xa9d2[_0x4d8704];return _0x413914;};'use strict';var EventEmitter=require(_0x2a9d('0x0'));var UserVoiceQueueRt=require(_0x2a9d('0x1'))['db'][_0x2a9d('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2a9d('0x3')](0x0);var events={'afterCreate':_0x2a9d('0x4'),'afterUpdate':'update','afterDestroy':_0x2a9d('0x5')};function emitEvent(_0x1307af){return function(_0x22dad6,_0x108c39,_0x3340f3){UserVoiceQueueRtEvents[_0x2a9d('0x6')](_0x1307af+':'+_0x22dad6['id'],_0x22dad6);UserVoiceQueueRtEvents[_0x2a9d('0x6')](_0x1307af,_0x22dad6);_0x3340f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x2a9d('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index f2fac0e..3733463 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 _0x7f9c=['user_has_voice_queues_rt','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','UserVoiceQueueRt'];(function(_0x25325a,_0x5b44d7){var _0x5a47fa=function(_0x5bf9aa){while(--_0x5bf9aa){_0x25325a['push'](_0x25325a['shift']());}};_0x5a47fa(++_0x5b44d7);}(_0x7f9c,0x1e1));var _0xc7f9=function(_0xb73c45,_0x4c0f13){_0xb73c45=_0xb73c45-0x0;var _0x31dacc=_0x7f9c[_0xb73c45];return _0x31dacc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc7f9('0x0'))(_0xc7f9('0x1'));var moment=require(_0xc7f9('0x2'));var BPromise=require(_0xc7f9('0x3'));var rp=require(_0xc7f9('0x4'));var fs=require('fs');var path=require(_0xc7f9('0x5'));var rimraf=require(_0xc7f9('0x6'));var config=require(_0xc7f9('0x7'));var attributes=require(_0xc7f9('0x8'));module[_0xc7f9('0x9')]=function(_0x53fde4,_0x34fc9f){return _0x53fde4['define'](_0xc7f9('0xa'),attributes,{'tableName':_0xc7f9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 23e4c41..11e89e5 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 _0x7a78=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','raw','options','where','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x468ac3,_0x3e67bb){var _0x4d3f99=function(_0x28853e){while(--_0x28853e){_0x468ac3['push'](_0x468ac3['shift']());}};_0x4d3f99(++_0x3e67bb);}(_0x7a78,0x71));var _0x87a7=function(_0x33302a,_0x5432ec){_0x33302a=_0x33302a-0x0;var _0x588bcc=_0x7a78[_0x33302a];return _0x588bcc;};'use strict';var _=require(_0x87a7('0x0'));var util=require(_0x87a7('0x1'));var moment=require(_0x87a7('0x2'));var BPromise=require(_0x87a7('0x3'));var rs=require(_0x87a7('0x4'));var fs=require('fs');var Redis=require(_0x87a7('0x5'));var db=require(_0x87a7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x87a7('0x7'))(_0x87a7('0x8'));var config=require(_0x87a7('0x9'));var jayson=require(_0x87a7('0xa'));var client=jayson[_0x87a7('0xb')][_0x87a7('0xc')]({'port':0x232a});config[_0x87a7('0xd')]=_[_0x87a7('0xe')](config[_0x87a7('0xd')],{'host':_0x87a7('0xf'),'port':0x18eb});var socket=require(_0x87a7('0x10'))(new Redis(config[_0x87a7('0xd')]));require('./userVoiceQueueRt.socket')[_0x87a7('0x11')](socket);function respondWithRpcPromise(_0x1165ef,_0x21832f,_0x37073d){return new BPromise(function(_0xc0bda1,_0x323b4f){return client[_0x87a7('0x12')](_0x1165ef,_0x37073d)[_0x87a7('0x13')](function(_0x4450dc){logger[_0x87a7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x21832f,_0x87a7('0x15'));logger[_0x87a7('0x16')](_0x87a7('0x17'),_0x21832f,'request\x20sent',JSON['stringify'](_0x4450dc));if(_0x4450dc['error']){if(_0x4450dc[_0x87a7('0x18')][_0x87a7('0x19')]===0x1f4){logger[_0x87a7('0x18')](_0x87a7('0x1a'),_0x21832f,_0x4450dc['error'][_0x87a7('0x1b')]);return _0x323b4f(_0x4450dc[_0x87a7('0x18')][_0x87a7('0x1b')]);}logger['error'](_0x87a7('0x1a'),_0x21832f,_0x4450dc[_0x87a7('0x18')][_0x87a7('0x1b')]);return _0xc0bda1(_0x4450dc['error'][_0x87a7('0x1b')]);}else{logger[_0x87a7('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x21832f,_0x87a7('0x15'));_0xc0bda1(_0x4450dc[_0x87a7('0x1c')][_0x87a7('0x1b')]);}})[_0x87a7('0x1d')](function(_0x8c7c05){logger[_0x87a7('0x18')](_0x87a7('0x1a'),_0x21832f,_0x8c7c05);_0x323b4f(_0x8c7c05);});});}exports[_0x87a7('0x1e')]=function(_0x7172){var _0x3ec37b=this;return new Promise(function(_0xd0283,_0x165f26){return db[_0x87a7('0x1f')][_0x87a7('0x20')]({'raw':_0x7172['options']?_0x7172['options'][_0x87a7('0x21')]===undefined?!![]:![]:!![],'where':_0x7172[_0x87a7('0x22')]?_0x7172[_0x87a7('0x22')][_0x87a7('0x23')]||null:null,'attributes':[[db['sequelize']['fn'](_0x87a7('0x24'),db['sequelize']['fn']('IF',db['sequelize'][_0x87a7('0x25')](_0x87a7('0x26')))),_0x87a7('0x27')]]})[_0x87a7('0x13')](function(_0x509014){logger['info'](_0x87a7('0x1e'),_0x7172);logger[_0x87a7('0x16')]('GetVoiceQueueRtPauses',_0x7172,JSON[_0x87a7('0x28')](_0x509014));_0xd0283(_0x509014);})['catch'](function(_0x44e56a){logger['error']('GetVoiceQueueRtPauses',_0x44e56a['message'],_0x7172);_0x165f26(_0x3ec37b[_0x87a7('0x18')](0x1f4,_0x44e56a[_0x87a7('0x1b')]));});});}; \ No newline at end of file +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 diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 5712161..461c1ee 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 _0xcb66=['remove','update','emit','removeListener','register','length','userVoiceQueueRt:','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcb66,0x19f));var _0x6cb6=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0xcb66[_0x1d50f2];return _0x3769b8;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=[_0x6cb6('0x0'),_0x6cb6('0x1'),_0x6cb6('0x2')];function createListener(_0x3f607b,_0x205243){return function(_0x56618a){_0x205243[_0x6cb6('0x3')](_0x3f607b,_0x56618a);};}function removeListener(_0x2d7dbb,_0x24660c){return function(){UserVoiceQueueRtEvents[_0x6cb6('0x4')](_0x2d7dbb,_0x24660c);};}exports[_0x6cb6('0x5')]=function(_0x506d14){for(var _0x53078d=0x0,_0x174f39=events[_0x6cb6('0x6')];_0x53078d<_0x174f39;_0x53078d++){var _0x1028b3=events[_0x53078d];var _0x4145f2=createListener(_0x6cb6('0x7')+_0x1028b3,_0x506d14);UserVoiceQueueRtEvents['on'](_0x1028b3,_0x4145f2);}}; \ No newline at end of file +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 diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index d15557c..04766b8 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x5049e1,_0x4ac87a){var _0x37f162=function(_0x2e06cb){while(--_0x2e06cb){_0x5049e1['push'](_0x5049e1['shift']());}};_0x37f162(++_0x4ac87a);}(_0x9c44,0x178));var _0x49c4=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9c44[_0x18ab2a];return _0x16dcee;};'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 _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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index ddb4440..af27ce6 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 _0x9cfc=['sequelize','exports','INTEGER'];(function(_0x25e981,_0x4485f5){var _0x3308ba=function(_0x33e65e){while(--_0x33e65e){_0x25e981['push'](_0x25e981['shift']());}};_0x3308ba(++_0x4485f5);}(_0x9cfc,0x1b0));var _0xc9cf=function(_0x4418a0,_0x27692e){_0x4418a0=_0x4418a0-0x0;var _0x3b6294=_0x9cfc[_0x4418a0];return _0x3b6294;};'use strict';var Sequelize=require(_0xc9cf('0x0'));module[_0xc9cf('0x1')]={'penalty':{'type':Sequelize[_0xc9cf('0x2')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 3062021..377e0b9 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 _0x20cb=['../../config/environment','./userWhatsappQueue.attributes','exports','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x3f9882,_0x4063bb){var _0x18b725=function(_0x8e5916){while(--_0x8e5916){_0x3f9882['push'](_0x3f9882['shift']());}};_0x18b725(++_0x4063bb);}(_0x20cb,0x64));var _0xb20c=function(_0x34dea0,_0x4dc276){_0x34dea0=_0x34dea0-0x0;var _0x49df46=_0x20cb[_0x34dea0];return _0x49df46;};'use strict';var _=require(_0xb20c('0x0'));var util=require(_0xb20c('0x1'));var logger=require(_0xb20c('0x2'))(_0xb20c('0x3'));var moment=require(_0xb20c('0x4'));var BPromise=require(_0xb20c('0x5'));var rp=require(_0xb20c('0x6'));var fs=require('fs');var path=require(_0xb20c('0x7'));var rimraf=require('rimraf');var config=require(_0xb20c('0x8'));var attributes=require(_0xb20c('0x9'));module[_0xb20c('0xa')]=function(_0x20f88a,_0x2be141){return _0x20f88a['define']('UserWhatsappQueue',attributes,{'tableName':_0xb20c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 9487414..b9bc273 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 _0xeb16=['request\x20sent','stringify','error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info'];(function(_0x22878a,_0x28fde6){var _0x8c7426=function(_0x3c0fee){while(--_0x3c0fee){_0x22878a['push'](_0x22878a['shift']());}};_0x8c7426(++_0x28fde6);}(_0xeb16,0x193));var _0x6eb1=function(_0x44ce56,_0x513181){_0x44ce56=_0x44ce56-0x0;var _0x514afa=_0xeb16[_0x44ce56];return _0x514afa;};'use strict';var _=require(_0x6eb1('0x0'));var util=require(_0x6eb1('0x1'));var moment=require(_0x6eb1('0x2'));var BPromise=require(_0x6eb1('0x3'));var rs=require(_0x6eb1('0x4'));var fs=require('fs');var Redis=require(_0x6eb1('0x5'));var db=require(_0x6eb1('0x6'))['db'];var utils=require(_0x6eb1('0x7'));var logger=require(_0x6eb1('0x8'))(_0x6eb1('0x9'));var config=require(_0x6eb1('0xa'));var jayson=require(_0x6eb1('0xb'));var client=jayson['client'][_0x6eb1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38855e,_0x41ad0a,_0x1a7d84){return new BPromise(function(_0x13b420,_0x3d4dee){return client[_0x6eb1('0xd')](_0x38855e,_0x1a7d84)['then'](function(_0x8be657){logger[_0x6eb1('0xe')]('UserWhatsappQueue,\x20%s,\x20%s',_0x41ad0a,_0x6eb1('0xf'));logger['debug']('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x41ad0a,_0x6eb1('0xf'),JSON[_0x6eb1('0x10')](_0x8be657));if(_0x8be657[_0x6eb1('0x11')]){if(_0x8be657[_0x6eb1('0x11')]['code']===0x1f4){logger[_0x6eb1('0x11')](_0x6eb1('0x12'),_0x41ad0a,_0x8be657['error'][_0x6eb1('0x13')]);return _0x3d4dee(_0x8be657[_0x6eb1('0x11')][_0x6eb1('0x13')]);}logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x41ad0a,_0x8be657['error']['message']);return _0x13b420(_0x8be657['error'][_0x6eb1('0x13')]);}else{logger[_0x6eb1('0xe')](_0x6eb1('0x12'),_0x41ad0a,_0x6eb1('0xf'));_0x13b420(_0x8be657[_0x6eb1('0x14')][_0x6eb1('0x13')]);}})[_0x6eb1('0x15')](function(_0x3f6eb2){logger['error'](_0x6eb1('0x12'),_0x41ad0a,_0x3f6eb2);_0x3d4dee(_0x3f6eb2);});});} \ No newline at end of file +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 diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 20c4d77..bf4c179 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 _0xc30d=['Router','fs-extra','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express'];(function(_0x515483,_0x47bbbb){var _0x1fe8f9=function(_0xe0ad09){while(--_0xe0ad09){_0x515483['push'](_0x515483['shift']());}};_0x1fe8f9(++_0x47bbbb);}(_0xc30d,0x6e));var _0xdc30=function(_0x2ddc4a,_0xdcf87){_0x2ddc4a=_0x2ddc4a-0x0;var _0x44bd44=_0xc30d[_0x2ddc4a];return _0x44bd44;};'use strict';var multer=require(_0xdc30('0x0'));var util=require('util');var path=require(_0xdc30('0x1'));var timeout=require(_0xdc30('0x2'));var express=require(_0xdc30('0x3'));var router=express[_0xdc30('0x4')]();var fs_extra=require(_0xdc30('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdc30('0x6'));var config=require('../../config/environment');var controller=require(_0xdc30('0x7'));router[_0xdc30('0x8')]('/',auth[_0xdc30('0x9')](),controller[_0xdc30('0xa')]);router[_0xdc30('0x8')](_0xdc30('0xb'),auth['isAuthenticated'](),controller[_0xdc30('0xc')]);router[_0xdc30('0xd')]('/',auth[_0xdc30('0x9')](),controller[_0xdc30('0xe')]);router[_0xdc30('0xf')](_0xdc30('0xb'),auth[_0xdc30('0x9')](),controller[_0xdc30('0x10')]);router[_0xdc30('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdc30('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 38527a0..694d4c1 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 _0xa43a=['exports','STRING','name','sequelize'];(function(_0x34ea22,_0x1270b3){var _0x1ca470=function(_0xf63cf4){while(--_0xf63cf4){_0x34ea22['push'](_0x34ea22['shift']());}};_0x1ca470(++_0x1270b3);}(_0xa43a,0xe3));var _0xaa43=function(_0x275561,_0x4388db){_0x275561=_0x275561-0x0;var _0x1c1543=_0xa43a[_0x275561];return _0x1c1543;};'use strict';var Sequelize=require(_0xaa43('0x0'));module[_0xaa43('0x1')]={'name':{'type':Sequelize[_0xaa43('0x2')],'unique':_0xaa43('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xaa43('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index c60de2c..6ed7546 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 _0x9ee0=['../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','destroy','then','Variables','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','Variable','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','UserProfileSection','userProfileId','autoAssociation','error','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x236232,_0x2b4dde){var _0xae716e=function(_0x2aa3ad){while(--_0x2aa3ad){_0x236232['push'](_0x236232['shift']());}};_0xae716e(++_0x2b4dde);}(_0x9ee0,0x8e));var _0x09ee=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0x9ee0[_0xa9eaa0];return _0x30897a;};'use strict';var emlformat=require(_0x09ee('0x0'));var rimraf=require(_0x09ee('0x1'));var zipdir=require(_0x09ee('0x2'));var jsonpatch=require(_0x09ee('0x3'));var rp=require(_0x09ee('0x4'));var moment=require(_0x09ee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x09ee('0x6'));var util=require(_0x09ee('0x7'));var path=require(_0x09ee('0x8'));var sox=require(_0x09ee('0x9'));var csv=require('to-csv');var ejs=require(_0x09ee('0xa'));var fs=require('fs');var fs_extra=require(_0x09ee('0xb'));var _=require(_0x09ee('0xc'));var squel=require('squel');var crypto=require(_0x09ee('0xd'));var jsforce=require(_0x09ee('0xe'));var deskjs=require(_0x09ee('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x09ee('0x10'));var Redis=require(_0x09ee('0x11'));var authService=require(_0x09ee('0x12'));var qs=require(_0x09ee('0x13'));var as=require(_0x09ee('0x14'));var hardwareService=require(_0x09ee('0x15'));var logger=require('../../config/logger')(_0x09ee('0x16'));var utils=require(_0x09ee('0x17'));var config=require(_0x09ee('0x18'));var licenseUtil=require(_0x09ee('0x19'));var db=require(_0x09ee('0x1a'))['db'];function respondWithStatusCode(_0x46a702,_0x29d9ea){_0x29d9ea=_0x29d9ea||0xcc;return function(_0x156b4){if(_0x156b4){return _0x46a702[_0x09ee('0x1b')](_0x29d9ea);}return _0x46a702[_0x09ee('0x1c')](_0x29d9ea)[_0x09ee('0x1d')]();};}function respondWithResult(_0x4d39a1,_0x5c80a5){_0x5c80a5=_0x5c80a5||0xc8;return function(_0x41ba09){if(_0x41ba09){return _0x4d39a1[_0x09ee('0x1c')](_0x5c80a5)[_0x09ee('0x1e')](_0x41ba09);}};}function respondWithFilteredResult(_0x26d97c,_0x41d613){return function(_0x39f08e){if(_0x39f08e){var _0x44f9a6=typeof _0x41d613[_0x09ee('0x1f')]==='undefined'&&typeof _0x41d613[_0x09ee('0x20')]===_0x09ee('0x21');var _0x235678=_0x39f08e[_0x09ee('0x22')];var _0x5386b0=_0x44f9a6?0x0:_0x41d613[_0x09ee('0x1f')];var _0x516b5f=_0x44f9a6?_0x39f08e[_0x09ee('0x22')]:_0x41d613[_0x09ee('0x1f')]+_0x41d613['limit'];var _0x1ff3a3;if(_0x516b5f>=_0x235678){_0x516b5f=_0x235678;_0x1ff3a3=0xc8;}else{_0x1ff3a3=0xce;}_0x26d97c[_0x09ee('0x1c')](_0x1ff3a3);return _0x26d97c['set'](_0x09ee('0x23'),_0x5386b0+'-'+_0x516b5f+'/'+_0x235678)[_0x09ee('0x1e')](_0x39f08e);}return null;};}function patchUpdates(_0x4d27ec){return function(_0x1009a4){try{jsonpatch[_0x09ee('0x24')](_0x1009a4,_0x4d27ec,!![]);}catch(_0x3dfa10){return BPromise[_0x09ee('0x25')](_0x3dfa10);}return _0x1009a4[_0x09ee('0x26')]();};}function saveUpdates(_0x372fce,_0x29c716){return function(_0xd37e6b){if(_0xd37e6b){return _0xd37e6b['update'](_0x372fce)['then'](function(_0x4d2659){return _0x4d2659;});}return null;};}function removeEntity(_0x1b0516,_0x33c909){return function(_0x4bfdee){if(_0x4bfdee){return _0x4bfdee[_0x09ee('0x27')]()[_0x09ee('0x28')](function(){var _0x2e0e9a=_0x4bfdee['get']({'plain':!![]});var _0x4c6ff9=_0x09ee('0x29');return db[_0x09ee('0x2a')][_0x09ee('0x27')]({'where':{'type':_0x4c6ff9,'resourceId':_0x2e0e9a['id']}})[_0x09ee('0x28')](function(){return _0x4bfdee;});})['then'](function(){_0x1b0516[_0x09ee('0x1c')](0xcc)[_0x09ee('0x1d')]();});}};}function handleEntityNotFound(_0x66a70d,_0x47ff13){return function(_0x308d65){if(!_0x308d65){_0x66a70d[_0x09ee('0x1b')](0x194);}return _0x308d65;};}function handleError(_0x52bc47,_0x1f381e){_0x1f381e=_0x1f381e||0x1f4;return function(_0x225662){logger['error'](_0x225662[_0x09ee('0x2b')]);if(_0x225662[_0x09ee('0x2c')]){delete _0x225662['name'];}_0x52bc47[_0x09ee('0x1c')](_0x1f381e)[_0x09ee('0x2d')](_0x225662);};}exports['index']=function(_0x50361f,_0x3443c6){var _0x5619a2={},_0x5328e2={},_0x34023b={'count':0x0,'rows':[]};var _0x45b694=_[_0x09ee('0x2e')](db['Variable'][_0x09ee('0x2f')],function(_0x12dd24){return{'name':_0x12dd24[_0x09ee('0x30')],'type':_0x12dd24[_0x09ee('0x31')][_0x09ee('0x32')]};});_0x5328e2[_0x09ee('0x33')]=_[_0x09ee('0x2e')](_0x45b694,_0x09ee('0x2c'));_0x5328e2[_0x09ee('0x34')]=_[_0x09ee('0x35')](_0x50361f[_0x09ee('0x34')]);_0x5328e2[_0x09ee('0x36')]=_['intersection'](_0x5328e2['model'],_0x5328e2['query']);_0x5619a2[_0x09ee('0x37')]=_[_0x09ee('0x38')](_0x5328e2[_0x09ee('0x33')],qs[_0x09ee('0x39')](_0x50361f[_0x09ee('0x34')][_0x09ee('0x39')]));_0x5619a2[_0x09ee('0x37')]=_0x5619a2[_0x09ee('0x37')][_0x09ee('0x3a')]?_0x5619a2[_0x09ee('0x37')]:_0x5328e2[_0x09ee('0x33')];if(!_0x50361f[_0x09ee('0x34')]['hasOwnProperty']('nolimit')){_0x5619a2['limit']=qs[_0x09ee('0x20')](_0x50361f[_0x09ee('0x34')][_0x09ee('0x20')]);_0x5619a2[_0x09ee('0x1f')]=qs[_0x09ee('0x1f')](_0x50361f[_0x09ee('0x34')][_0x09ee('0x1f')]);}_0x5619a2['order']=qs['sort'](_0x50361f['query'][_0x09ee('0x3b')]);_0x5619a2[_0x09ee('0x3c')]=qs['filters'](_[_0x09ee('0x3d')](_0x50361f[_0x09ee('0x34')],_0x5328e2[_0x09ee('0x36')]),_0x45b694);if(_0x50361f[_0x09ee('0x34')][_0x09ee('0x3e')]){_0x5619a2['where']=_[_0x09ee('0x3f')](_0x5619a2[_0x09ee('0x3c')],{'$or':_[_0x09ee('0x2e')](_0x45b694,function(_0x3fc228){if(_0x3fc228['type']!==_0x09ee('0x40')){var _0xfc0a7c={};_0xfc0a7c[_0x3fc228[_0x09ee('0x2c')]]={'$like':'%'+_0x50361f[_0x09ee('0x34')][_0x09ee('0x3e')]+'%'};return _0xfc0a7c;}})});}_0x5619a2=_[_0x09ee('0x3f')]({},_0x5619a2,_0x50361f[_0x09ee('0x41')]);var _0x22a11b={'where':_0x5619a2[_0x09ee('0x3c')]};return db[_0x09ee('0x42')][_0x09ee('0x22')](_0x22a11b)[_0x09ee('0x28')](function(_0x3753ba){_0x34023b[_0x09ee('0x22')]=_0x3753ba;if(_0x50361f[_0x09ee('0x34')][_0x09ee('0x43')]){_0x5619a2[_0x09ee('0x44')]=[{'all':!![]}];}return db['Variable'][_0x09ee('0x45')](_0x5619a2);})[_0x09ee('0x28')](function(_0xff97f0){_0x34023b[_0x09ee('0x46')]=_0xff97f0;return _0x34023b;})[_0x09ee('0x28')](respondWithFilteredResult(_0x3443c6,_0x5619a2))[_0x09ee('0x47')](handleError(_0x3443c6,null));};exports[_0x09ee('0x48')]=function(_0x5061bc,_0x4ff916){var _0x2faded={'raw':!![],'where':{'id':_0x5061bc[_0x09ee('0x49')]['id']}},_0x1b554d={};_0x1b554d[_0x09ee('0x33')]=_[_0x09ee('0x35')](db[_0x09ee('0x42')]['rawAttributes']);_0x1b554d[_0x09ee('0x34')]=_[_0x09ee('0x35')](_0x5061bc[_0x09ee('0x34')]);_0x1b554d[_0x09ee('0x36')]=_['intersection'](_0x1b554d['model'],_0x1b554d['query']);_0x2faded[_0x09ee('0x37')]=_['intersection'](_0x1b554d[_0x09ee('0x33')],qs['fields'](_0x5061bc[_0x09ee('0x34')]['fields']));_0x2faded[_0x09ee('0x37')]=_0x2faded['attributes'][_0x09ee('0x3a')]?_0x2faded[_0x09ee('0x37')]:_0x1b554d[_0x09ee('0x33')];if(_0x5061bc[_0x09ee('0x34')][_0x09ee('0x43')]){_0x2faded[_0x09ee('0x44')]=[{'all':!![]}];}_0x2faded=_[_0x09ee('0x3f')]({},_0x2faded,_0x5061bc[_0x09ee('0x41')]);return db[_0x09ee('0x42')][_0x09ee('0x4a')](_0x2faded)['then'](handleEntityNotFound(_0x4ff916,null))[_0x09ee('0x28')](respondWithResult(_0x4ff916,null))[_0x09ee('0x47')](handleError(_0x4ff916,null));};exports[_0x09ee('0x4b')]=function(_0x30fbc3,_0x24970b){return db[_0x09ee('0x42')][_0x09ee('0x4b')](_0x30fbc3[_0x09ee('0x4c')],{})[_0x09ee('0x28')](function(_0x35ce4f){var _0x530334=_0x30fbc3[_0x09ee('0x4d')][_0x09ee('0x4e')]({'plain':!![]});if(!_0x530334)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x530334['role']===_0x09ee('0x4d')){var _0x119c5b=_0x35ce4f[_0x09ee('0x4e')]({'plain':!![]});var _0x2e4e32=_0x09ee('0x29');return db[_0x09ee('0x4f')]['find']({'where':{'name':_0x2e4e32,'userProfileId':_0x530334[_0x09ee('0x50')]},'raw':!![]})[_0x09ee('0x28')](function(_0x2a1f3f){if(_0x2a1f3f&&_0x2a1f3f[_0x09ee('0x51')]===0x0){return db[_0x09ee('0x2a')][_0x09ee('0x4b')]({'name':_0x119c5b[_0x09ee('0x2c')],'resourceId':_0x119c5b['id'],'type':_0x2a1f3f[_0x09ee('0x2c')],'sectionId':_0x2a1f3f['id']},{})[_0x09ee('0x28')](function(){return _0x35ce4f;});}else{return _0x35ce4f;}})[_0x09ee('0x47')](function(_0x4f34d5){logger[_0x09ee('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4f34d5);throw _0x4f34d5;});}return _0x35ce4f;})['then'](respondWithResult(_0x24970b,0xc9))['catch'](handleError(_0x24970b,null));};exports[_0x09ee('0x53')]=function(_0x7a940f,_0x2e3994){if(_0x7a940f[_0x09ee('0x4c')]['id']){delete _0x7a940f[_0x09ee('0x4c')]['id'];}return db['Variable'][_0x09ee('0x4a')]({'where':{'id':_0x7a940f['params']['id']}})['then'](handleEntityNotFound(_0x2e3994,null))[_0x09ee('0x28')](saveUpdates(_0x7a940f[_0x09ee('0x4c')],null))['then'](respondWithResult(_0x2e3994,null))['catch'](handleError(_0x2e3994,null));};exports[_0x09ee('0x27')]=function(_0x334a1e,_0x58d321){return db[_0x09ee('0x42')][_0x09ee('0x4a')]({'where':{'id':_0x334a1e[_0x09ee('0x49')]['id']}})[_0x09ee('0x28')](handleEntityNotFound(_0x58d321,null))['then'](removeEntity(_0x58d321,null))['catch'](handleError(_0x58d321,null));}; \ No newline at end of file +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 diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6124ef3..c873756 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 _0xa595=['lodash','util','moment','bluebird','request-promise','path','rimraf','./variable.attributes','exports','Variable','tools_variables'];(function(_0x5987ac,_0x213dac){var _0xb3d18=function(_0x5e435e){while(--_0x5e435e){_0x5987ac['push'](_0x5987ac['shift']());}};_0xb3d18(++_0x213dac);}(_0xa595,0xd1));var _0x5a59=function(_0x272f4f,_0x516cf5){_0x272f4f=_0x272f4f-0x0;var _0x322aad=_0xa595[_0x272f4f];return _0x322aad;};'use strict';var _=require(_0x5a59('0x0'));var util=require(_0x5a59('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5a59('0x2'));var BPromise=require(_0x5a59('0x3'));var rp=require(_0x5a59('0x4'));var fs=require('fs');var path=require(_0x5a59('0x5'));var rimraf=require(_0x5a59('0x6'));var config=require('../../config/environment');var attributes=require(_0x5a59('0x7'));module[_0x5a59('0x8')]=function(_0x46e28c,_0x33168e){return _0x46e28c['define'](_0x5a59('0x9'),attributes,{'tableName':_0x5a59('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 81630c5..e06c211 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 _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x18b474,_0x55dde5){var _0x320a05=function(_0x13c850){while(--_0x13c850){_0x18b474['push'](_0x18b474['shift']());}};_0x320a05(++_0x55dde5);}(_0x6aa7,0x178));var _0x76aa=function(_0x5f0f2f,_0x4a31d4){_0x5f0f2f=_0x5f0f2f-0x0;var _0x169ed6=_0x6aa7[_0x5f0f2f];return _0x169ed6;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +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 diff --git a/server/api/version/index.js b/server/api/version/index.js index 838bc4a..c95c309 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 _0xfb25=['index','get','canUpdate','/reset','isAuthenticated','reset','pull','/restart','restart','/migrations','migrations','exports','express','Router','./version.controller'];(function(_0x589466,_0x1ef83e){var _0x2321de=function(_0x4f95c4){while(--_0x4f95c4){_0x589466['push'](_0x589466['shift']());}};_0x2321de(++_0x1ef83e);}(_0xfb25,0x75));var _0x5fb2=function(_0x4bcdca,_0x50fe8){_0x4bcdca=_0x4bcdca-0x0;var _0x1629c9=_0xfb25[_0x4bcdca];return _0x1629c9;};'use strict';var express=require(_0x5fb2('0x0'));var router=express[_0x5fb2('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5fb2('0x2'));router['get']('/',controller[_0x5fb2('0x3')]);router[_0x5fb2('0x4')]('/fetch',auth['isAuthenticated'](),auth[_0x5fb2('0x5')](),controller['fetch']);router[_0x5fb2('0x4')](_0x5fb2('0x6'),auth[_0x5fb2('0x7')](),auth[_0x5fb2('0x5')](),controller[_0x5fb2('0x8')]);router[_0x5fb2('0x4')]('/pull',auth[_0x5fb2('0x7')](),auth[_0x5fb2('0x5')](),controller[_0x5fb2('0x9')]);router[_0x5fb2('0x4')](_0x5fb2('0xa'),auth['isAuthenticated'](),controller[_0x5fb2('0xb')]);router[_0x5fb2('0x4')](_0x5fb2('0xc'),controller[_0x5fb2('0xd')]);module[_0x5fb2('0xe')]=router; \ No newline at end of file +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 diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 6d17e6f..79006f7 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 _0xd2be=['server','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','umzug','lodash','pkginfo','version','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','latest','fetch','tags','2.0.0','status','origin','master','error','json','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join'];(function(_0x4ce663,_0x4c667e){var _0x4e8595=function(_0x3832d6){while(--_0x3832d6){_0x4ce663['push'](_0x4ce663['shift']());}};_0x4e8595(++_0x4c667e);}(_0xd2be,0x1e1));var _0xed2b=function(_0x18dece,_0x309f41){_0x18dece=_0x18dece-0x0;var _0x12acaf=_0xd2be[_0x18dece];return _0x12acaf;};'use strict';var Umzug=require(_0xed2b('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xed2b('0x1'));var pkginfo=require(_0xed2b('0x2'))(module,_0xed2b('0x3'));var compareVersions=require('compare-versions');var exec=require('child_process')[_0xed2b('0x4')];var db=require(_0xed2b('0x5'))['db'];var config=require('../../config/environment');var pm2=require(_0xed2b('0x6'));var logger=require(_0xed2b('0x7'))(_0xed2b('0x8'));var git=require(_0xed2b('0x9'))(config[_0xed2b('0xa')]);exports[_0xed2b('0xb')]=function(_0x12b9d7,_0xe15161){var _0x2d7bad={'current':module[_0xed2b('0xc')]['version'],'phonebar':0x2};if(_0x12b9d7['query']&&_0x12b9d7['query'][_0xed2b('0xd')]){return git[_0xed2b('0xe')]()[_0xed2b('0xf')](function(_0x4d3e1f,_0x1fa577){_0x2d7bad['latest']=(_0x4d3e1f?module[_0xed2b('0xc')]['version']:_0x1fa577['latest'])||_0xed2b('0x10');return _0xe15161[_0xed2b('0x11')](0xc8)['json'](_0x2d7bad);});}else{return _0xe15161['status'](0xc8)['json'](_0x2d7bad);}};exports[_0xed2b('0xe')]=function(_0x4d4e61,_0x2714c6){return git[_0xed2b('0xe')]([_0xed2b('0x12'),_0xed2b('0x13')],function(_0x4f424e){if(_0x4f424e){logger[_0xed2b('0x14')](_0x4f424e);return _0x2714c6[_0xed2b('0x11')](0x1f4)[_0xed2b('0x15')](_0x4f424e);}logger[_0xed2b('0x16')](_0xed2b('0x17'));return _0x2714c6[_0xed2b('0x11')](0xc8)[_0xed2b('0x15')]({'output':_0xed2b('0x18')});});};exports[_0xed2b('0x19')]=function(_0x9bb8c2,_0x1de151){return git[_0xed2b('0x19')]([_0xed2b('0x1a'),_0xed2b('0x1b')],function(_0x59d4d9){if(_0x59d4d9){logger['error'](_0x59d4d9);return _0x1de151[_0xed2b('0x11')](0x1f4)['json'](_0x59d4d9);}logger[_0xed2b('0x16')](_0xed2b('0x1c'));return _0x1de151['status'](0xc8)[_0xed2b('0x15')]({'output':_0xed2b('0x1d')});});};exports[_0xed2b('0x1e')]=function(_0x176b26,_0x115d4f){exec('npm\x20install\x20--production',function(_0x2077eb,_0x2c81e1,_0x1746ff){logger[_0xed2b('0x16')](_0x2c81e1);logger[_0xed2b('0x16')](_0x1746ff);if(_0x2077eb){logger[_0xed2b('0x14')](_0x2077eb);return _0x115d4f[_0xed2b('0x11')](0x1f4)['json'](_0x2077eb);}return _0x115d4f[_0xed2b('0x11')](0xc8)[_0xed2b('0x15')]({'output':_0x2c81e1});});};exports[_0xed2b('0x1f')]=function(_0x3515ae,_0x351fc8){return pm2[_0xed2b('0x1f')]('motion2')[_0xed2b('0x20')](function(_0x1566d6){logger[_0xed2b('0x16')](_0xed2b('0x21'),_0x1566d6);return _0x351fc8[_0xed2b('0x11')](0xc8)[_0xed2b('0x15')]({'output':_0xed2b('0x22')});})[_0xed2b('0x23')](function(_0x4e3a03){logger[_0xed2b('0x14')](_0x4e3a03);return _0x351fc8[_0xed2b('0x11')](0x1f4)['json'](_0x4e3a03);});};exports[_0xed2b('0x24')]=function(_0x509958,_0x3511fa){var _0x2b7b92=fs[_0xed2b('0x25')](path[_0xed2b('0x26')](config[_0xed2b('0xa')],_0xed2b('0x27'),_0xed2b('0x24')));var _0x1cc22d=[];for(var _0x5bd4db=0x0;_0x5bd4db<_0x2b7b92['length'];_0x5bd4db++){var _0x4688a9=_0x2b7b92[_0x5bd4db]['replace']('.js','');if(compareVersions(module[_0xed2b('0xc')][_0xed2b('0x3')],_0x4688a9)===-0x1){_0x1cc22d['push'](_0x4688a9);}}if(_0x1cc22d[_0xed2b('0x28')]){var _0x7d794e=_0x1cc22d[_0xed2b('0x29')](compareVersions);var _0x1bc873=new Umzug({'storage':_0xed2b('0x2a'),'storageOptions':{'model':db[_0xed2b('0x2b')],'modelName':_0xed2b('0x2b'),'columnName':_0xed2b('0x3')},'migrations':{'params':[db['sequelize'][_0xed2b('0x2c')](),db[_0xed2b('0x2a')][_0xed2b('0x2d')],function(){throw new Error(_0xed2b('0x2e'));}],'path':path[_0xed2b('0x26')](config['root'],'server',_0xed2b('0x24')),'pattern':/\.js$/}});_0x1bc873['up']({'migrations':_[_0xed2b('0x2f')](_0x7d794e,function(_0x58cb8c){return _0x58cb8c+_0xed2b('0x30');})})[_0xed2b('0x20')](function(){return _0x3511fa[_0xed2b('0x11')](0xc8)[_0xed2b('0x15')]({'output':_0xed2b('0x31')+module['exports']['version']+_0xed2b('0x32')+_['last'](_0x7d794e),'migrations':_[_0xed2b('0x26')](_0x7d794e)});})['catch'](function(_0x2c4029){if(_0x2c4029 instanceof db[_0xed2b('0x2a')][_0xed2b('0x33')]){return _0x3511fa[_0xed2b('0x11')](0xc8)[_0xed2b('0x15')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x3511fa['status'](0x1f4)['json'](_0x2c4029);}});}else{return _0x3511fa['status'](0xc8)[_0xed2b('0x15')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file +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 diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 00effe9..a9b113b 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 _0xe50e=['delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','/:id','update'];(function(_0x12b250,_0x5548f3){var _0x51bd34=function(_0x157091){while(--_0x157091){_0x12b250['push'](_0x12b250['shift']());}};_0x51bd34(++_0x5548f3);}(_0xe50e,0x145));var _0xee50=function(_0x4844a6,_0x56cd5a){_0x4844a6=_0x4844a6-0x0;var _0x5ded75=_0xe50e[_0x4844a6];return _0x5ded75;};'use strict';var multer=require(_0xee50('0x0'));var util=require(_0xee50('0x1'));var path=require(_0xee50('0x2'));var timeout=require(_0xee50('0x3'));var express=require(_0xee50('0x4'));var router=express['Router']();var fs_extra=require(_0xee50('0x5'));var auth=require(_0xee50('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xee50('0x7'));var controller=require('./voiceAgentReport.controller');router[_0xee50('0x8')]('/',auth[_0xee50('0x9')](),controller[_0xee50('0xa')]);router['get']('/describe',auth[_0xee50('0x9')](),controller[_0xee50('0xb')]);router[_0xee50('0x8')]('/:id',auth[_0xee50('0x9')](),controller[_0xee50('0xc')]);router['post']('/',auth[_0xee50('0x9')](),controller[_0xee50('0xd')]);router[_0xee50('0xe')](_0xee50('0xf'),auth['isAuthenticated'](),controller[_0xee50('0x10')]);router[_0xee50('0x11')](_0xee50('0xf'),auth[_0xee50('0x9')](),controller[_0xee50('0x12')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index de3d332..71d6a4c 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 _0x2d0b=['exports','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x255f98,_0x514d21){var _0x67e0f8=function(_0x25359c){while(--_0x25359c){_0x255f98['push'](_0x255f98['shift']());}};_0x67e0f8(++_0x514d21);}(_0x2d0b,0x102));var _0xb2d0=function(_0x3f55ce,_0x3cfe40){_0x3f55ce=_0x3f55ce-0x0;var _0x525cc6=_0x2d0b[_0x3f55ce];return _0x525cc6;};'use strict';var Sequelize=require('sequelize');module[_0xb2d0('0x0')]={'type':{'type':Sequelize[_0xb2d0('0x1')]},'uniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb2d0('0x1')]},'queue':{'type':Sequelize[_0xb2d0('0x1')]},'interface':{'type':Sequelize[_0xb2d0('0x1')]},'membername':{'type':Sequelize[_0xb2d0('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb2d0('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0xb2d0('0x2')]},'agentdumpAt':{'type':Sequelize[_0xb2d0('0x2')]},'holdtime':{'type':Sequelize[_0xb2d0('0x3')]},'agentcomplete':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb2d0('0x3')]},'agentacw':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb2d0('0x3')]},'reason':{'type':Sequelize[_0xb2d0('0x1')]},'lastevent':{'type':Sequelize[_0xb2d0('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb2d0('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xb2d0('0x1')]},'exten':{'type':Sequelize[_0xb2d0('0x1')]},'priority':{'type':Sequelize[_0xb2d0('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xb2d0('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xb2d0('0x1')]},'destcalleridname':{'type':Sequelize[_0xb2d0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb2d0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb2d0('0x1')]},'destlanguage':{'type':Sequelize[_0xb2d0('0x1')]},'destaccountcode':{'type':Sequelize[_0xb2d0('0x1')]},'destcontext':{'type':Sequelize[_0xb2d0('0x1')]},'destexten':{'type':Sequelize[_0xb2d0('0x1')]},'destpriority':{'type':Sequelize[_0xb2d0('0x1')]},'destuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0xb2d0('0x1')]},'transfer':{'type':Sequelize[_0xb2d0('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb2d0('0x1')],'comment':_0xb2d0('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb2d0('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index efc4845..e68ccac 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(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_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 diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 80a701b..ab1f08a 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 _0x1cb9=['api','moment','bluebird','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','uniqueid','lodash','../../config/logger'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0x1cb9,0x14e));var _0x91cb=function(_0x451da6,_0x5c2ce4){_0x451da6=_0x451da6-0x0;var _0x43b788=_0x1cb9[_0x451da6];return _0x43b788;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':[_0x91cb('0xb'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 2a0e147..cce33ac 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 _0x5f0f=['options','where','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','info','VoiceAgentReport,\x20%s,\x20%s','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','create','body','then','CreateVoiceAgentReport','VoiceAgentReport'];(function(_0x4dca53,_0x172851){var _0x103f58=function(_0x43f534){while(--_0x43f534){_0x4dca53['push'](_0x4dca53['shift']());}};_0x103f58(++_0x172851);}(_0x5f0f,0xb8));var _0xf5f0=function(_0x4d81c0,_0x1aada4){_0x4d81c0=_0x4d81c0-0x0;var _0x3ef8b9=_0x5f0f[_0x4d81c0];return _0x3ef8b9;};'use strict';var _=require(_0xf5f0('0x0'));var util=require(_0xf5f0('0x1'));var moment=require(_0xf5f0('0x2'));var BPromise=require(_0xf5f0('0x3'));var rs=require(_0xf5f0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5f0('0x5'))['db'];var utils=require(_0xf5f0('0x6'));var logger=require('../../config/logger')(_0xf5f0('0x7'));var config=require(_0xf5f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf5f0('0x9')][_0xf5f0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47b57b,_0x12bb6f,_0x9e578c){return new BPromise(function(_0x1e81a6,_0xe07a11){return client['request'](_0x47b57b,_0x9e578c)['then'](function(_0x224c21){logger[_0xf5f0('0xb')](_0xf5f0('0xc'),_0x12bb6f,'request\x20sent');logger['debug'](_0xf5f0('0xd'),_0x12bb6f,_0xf5f0('0xe'),JSON[_0xf5f0('0xf')](_0x224c21));if(_0x224c21[_0xf5f0('0x10')]){if(_0x224c21[_0xf5f0('0x10')][_0xf5f0('0x11')]===0x1f4){logger[_0xf5f0('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x12bb6f,_0x224c21['error'][_0xf5f0('0x12')]);return _0xe07a11(_0x224c21[_0xf5f0('0x10')][_0xf5f0('0x12')]);}logger['error'](_0xf5f0('0xc'),_0x12bb6f,_0x224c21[_0xf5f0('0x10')]['message']);return _0x1e81a6(_0x224c21['error']['message']);}else{logger[_0xf5f0('0xb')](_0xf5f0('0xc'),_0x12bb6f,_0xf5f0('0xe'));_0x1e81a6(_0x224c21[_0xf5f0('0x13')][_0xf5f0('0x12')]);}})[_0xf5f0('0x14')](function(_0x46be61){logger[_0xf5f0('0x10')](_0xf5f0('0xc'),_0x12bb6f,_0x46be61);_0xe07a11(_0x46be61);});});}exports['CreateVoiceAgentReport']=function(_0x252e0e){var _0x551d27=this;return new Promise(function(_0x44b581,_0x1b25c4){return db['VoiceAgentReport'][_0xf5f0('0x15')](_0x252e0e[_0xf5f0('0x16')],{'raw':_0x252e0e['options']?_0x252e0e['options']['raw']===undefined?!![]:![]:!![]})[_0xf5f0('0x17')](function(_0x2d23ad){logger['info'](_0xf5f0('0x18'),_0x252e0e);logger['debug'](_0xf5f0('0x18'),_0x252e0e,JSON[_0xf5f0('0xf')](_0x2d23ad));_0x44b581(_0x2d23ad);})[_0xf5f0('0x14')](function(_0x86c306){logger[_0xf5f0('0x10')]('CreateVoiceAgentReport',_0x86c306[_0xf5f0('0x12')],_0x252e0e);_0x1b25c4(_0x551d27[_0xf5f0('0x10')](0x1f4,_0x86c306[_0xf5f0('0x12')]));});});};exports['UpdateVoiceAgentReport']=function(_0x4ab73f){var _0x11dda0=this;return new Promise(function(_0x4d0a77,_0x1bc23c){return db[_0xf5f0('0x19')]['update'](_0x4ab73f[_0xf5f0('0x16')],{'raw':_0x4ab73f[_0xf5f0('0x1a')]?_0x4ab73f[_0xf5f0('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4ab73f['options']?_0x4ab73f[_0xf5f0('0x1a')][_0xf5f0('0x1b')]||null:null,'attributes':_0x4ab73f['options']?_0x4ab73f[_0xf5f0('0x1a')]['attributes']||null:null,'limit':_0x4ab73f[_0xf5f0('0x1a')]?_0x4ab73f[_0xf5f0('0x1a')][_0xf5f0('0x1c')]||null:null})[_0xf5f0('0x17')](function(_0x4f61e1){logger[_0xf5f0('0xb')](_0xf5f0('0x1d'),_0x4ab73f);logger['debug'](_0xf5f0('0x1d'),_0x4ab73f,JSON[_0xf5f0('0xf')](_0x4f61e1));_0x4d0a77(_0x4f61e1);})[_0xf5f0('0x14')](function(_0xfd1c95){logger[_0xf5f0('0x10')](_0xf5f0('0x1d'),_0xfd1c95[_0xf5f0('0x12')],_0x4ab73f);_0x1bc23c(_0x11dda0['error'](0x1f4,_0xfd1c95['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index f31a802..d4bfd13 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 _0xdc97=['get','isAuthenticated','describe','/:id','show','create','put','update','delete','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xdc97,0x13b));var _0x7dc9=function(_0x3b38f3,_0x21cd1c){_0x3b38f3=_0x3b38f3-0x0;var _0x3e270b=_0xdc97[_0x3b38f3];return _0x3e270b;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['post']('/',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xd')]);router[_0x7dc9('0xe')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xf')]);router[_0x7dc9('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2e05b3b..d299f98 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 _0x7ace=['STRING','ENUM','inbound','internal','outbound','DATE','INTEGER','sequelize','exports'];(function(_0x538225,_0x2763c5){var _0x507e5f=function(_0x328b40){while(--_0x328b40){_0x538225['push'](_0x538225['shift']());}};_0x507e5f(++_0x2763c5);}(_0x7ace,0xd6));var _0xe7ac=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7ace[_0x413feb];return _0x40ee88;};'use strict';var Sequelize=require(_0xe7ac('0x0'));module[_0xe7ac('0x1')]={'uniqueid':{'type':Sequelize[_0xe7ac('0x2')]},'type':{'type':Sequelize[_0xe7ac('0x3')](_0xe7ac('0x4'),_0xe7ac('0x5'),_0xe7ac('0x6'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xe7ac('0x2')]},'accountcode':{'type':Sequelize[_0xe7ac('0x2')]},'source':{'type':Sequelize[_0xe7ac('0x2')]},'destination':{'type':Sequelize[_0xe7ac('0x2')]},'destinationcontext':{'type':Sequelize[_0xe7ac('0x2')]},'callerid':{'type':Sequelize[_0xe7ac('0x2')]},'channel':{'type':Sequelize[_0xe7ac('0x2')]},'destinationchannel':{'type':Sequelize[_0xe7ac('0x2')]},'lastapplication':{'type':Sequelize[_0xe7ac('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xe7ac('0x7')]},'systemanswertime':{'type':Sequelize[_0xe7ac('0x7')]},'answertime':{'type':Sequelize[_0xe7ac('0x7')]},'endtime':{'type':Sequelize[_0xe7ac('0x7')]},'duration':{'type':Sequelize[_0xe7ac('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xe7ac('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xe7ac('0x2')]},'userfield':{'type':Sequelize[_0xe7ac('0x2')]},'userDisposition':{'type':Sequelize[_0xe7ac('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xe7ac('0x2')]},'note':{'type':Sequelize[_0xe7ac('0x2')]},'prefix':{'type':Sequelize[_0xe7ac('0x2')]},'routeid':{'type':Sequelize[_0xe7ac('0x8')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +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 diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 125bf2a..6bb56d4 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 _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(_0x162842,_0x3e717e){_0x162842=_0x162842-0x0;var _0x24dff5=_0x2032[_0x162842];return _0x24dff5;};'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 +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 diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 6999fc8..764a060 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 _0x5b83=['VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x5b83,0x1b6));var _0x35b8=function(_0x3bec68,_0x160828){_0x3bec68=_0x3bec68-0x0;var _0x80701b=_0x5b83[_0x3bec68];return _0x80701b;};'use strict';var _=require(_0x35b8('0x0'));var util=require(_0x35b8('0x1'));var logger=require(_0x35b8('0x2'))(_0x35b8('0x3'));var moment=require(_0x35b8('0x4'));var BPromise=require(_0x35b8('0x5'));var rp=require(_0x35b8('0x6'));var fs=require('fs');var path=require(_0x35b8('0x7'));var rimraf=require(_0x35b8('0x8'));var config=require(_0x35b8('0x9'));var attributes=require(_0x35b8('0xa'));module[_0x35b8('0xb')]=function(_0x304867,_0x2363ed){return _0x304867['define'](_0x35b8('0xc'),attributes,{'tableName':_0x35b8('0xd'),'paranoid':![],'indexes':[{'fields':[_0x35b8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index c6fadb5..144348b 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 _0x2c6d=['stringify','error','code','message','result','catch','GetVoiceCallReport','findAll','options','where','limit','include','map','attributes','model','CreateVoiceCallReport','VoiceCallReport','create','body','raw','UpdateVoiceCallReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1436ee,_0x4dfbf4){var _0xdf2e02=function(_0x5e7ae3){while(--_0x5e7ae3){_0x1436ee['push'](_0x1436ee['shift']());}};_0xdf2e02(++_0x4dfbf4);}(_0x2c6d,0x64));var _0xd2c6=function(_0x1bf32f,_0x2e994e){_0x1bf32f=_0x1bf32f-0x0;var _0x147063=_0x2c6d[_0x1bf32f];return _0x147063;};'use strict';var _=require(_0xd2c6('0x0'));var util=require(_0xd2c6('0x1'));var moment=require(_0xd2c6('0x2'));var BPromise=require(_0xd2c6('0x3'));var rs=require(_0xd2c6('0x4'));var fs=require('fs');var Redis=require(_0xd2c6('0x5'));var db=require(_0xd2c6('0x6'))['db'];var utils=require(_0xd2c6('0x7'));var logger=require(_0xd2c6('0x8'))('rpc');var config=require(_0xd2c6('0x9'));var jayson=require(_0xd2c6('0xa'));var client=jayson['client'][_0xd2c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa3b42c,_0xb9e2a5,_0x23af93){return new BPromise(function(_0x47ef31,_0x33648b){return client['request'](_0xa3b42c,_0x23af93)[_0xd2c6('0xc')](function(_0x1057f5){logger[_0xd2c6('0xd')](_0xd2c6('0xe'),_0xb9e2a5,_0xd2c6('0xf'));logger[_0xd2c6('0x10')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0xb9e2a5,_0xd2c6('0xf'),JSON[_0xd2c6('0x11')](_0x1057f5));if(_0x1057f5[_0xd2c6('0x12')]){if(_0x1057f5[_0xd2c6('0x12')][_0xd2c6('0x13')]===0x1f4){logger[_0xd2c6('0x12')](_0xd2c6('0xe'),_0xb9e2a5,_0x1057f5[_0xd2c6('0x12')]['message']);return _0x33648b(_0x1057f5[_0xd2c6('0x12')][_0xd2c6('0x14')]);}logger[_0xd2c6('0x12')](_0xd2c6('0xe'),_0xb9e2a5,_0x1057f5[_0xd2c6('0x12')]['message']);return _0x47ef31(_0x1057f5[_0xd2c6('0x12')]['message']);}else{logger[_0xd2c6('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0xb9e2a5,'request\x20sent');_0x47ef31(_0x1057f5[_0xd2c6('0x15')]['message']);}})[_0xd2c6('0x16')](function(_0x27188b){logger[_0xd2c6('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0xb9e2a5,_0x27188b);_0x33648b(_0x27188b);});});}exports[_0xd2c6('0x17')]=function(_0x3fd035){var _0x449515=this;return new Promise(function(_0x5575e0,_0x4f9845){return db['VoiceCallReport'][_0xd2c6('0x18')]({'raw':_0x3fd035[_0xd2c6('0x19')]?_0x3fd035['options']['raw']===undefined?!![]:![]:!![],'where':_0x3fd035[_0xd2c6('0x19')]?_0x3fd035[_0xd2c6('0x19')][_0xd2c6('0x1a')]||null:null,'attributes':_0x3fd035[_0xd2c6('0x19')]?_0x3fd035['options']['attributes']||null:null,'limit':_0x3fd035[_0xd2c6('0x19')]?_0x3fd035[_0xd2c6('0x19')][_0xd2c6('0x1b')]||null:null,'include':_0x3fd035['options']?_0x3fd035[_0xd2c6('0x19')][_0xd2c6('0x1c')]?_[_0xd2c6('0x1d')](_0x3fd035[_0xd2c6('0x19')][_0xd2c6('0x1c')],function(_0xa04e5d){return{'model':db[_0xa04e5d['model']],'as':_0xa04e5d['as'],'attributes':_0xa04e5d[_0xd2c6('0x1e')],'include':_0xa04e5d[_0xd2c6('0x1c')]?_['map'](_0xa04e5d[_0xd2c6('0x1c')],function(_0x2948c6){return{'model':db[_0x2948c6[_0xd2c6('0x1f')]],'as':_0x2948c6['as'],'attributes':_0x2948c6[_0xd2c6('0x1e')],'include':_0x2948c6['include']?_['map'](_0x2948c6['include'],function(_0x4c3d1c){return{'model':db[_0x4c3d1c['model']],'as':_0x4c3d1c['as'],'attributes':_0x4c3d1c[_0xd2c6('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xd2c6('0xc')](function(_0x37f31e){logger[_0xd2c6('0xd')](_0xd2c6('0x17'),_0x3fd035);logger['debug'](_0xd2c6('0x17'),_0x3fd035,JSON['stringify'](_0x37f31e));_0x5575e0(_0x37f31e);})[_0xd2c6('0x16')](function(_0x54f2d1){logger[_0xd2c6('0x12')](_0xd2c6('0x17'),_0x54f2d1[_0xd2c6('0x14')],_0x3fd035);_0x4f9845(_0x449515[_0xd2c6('0x12')](0x1f4,_0x54f2d1[_0xd2c6('0x14')]));});});};exports[_0xd2c6('0x20')]=function(_0x3009ee){var _0xb49bcb=this;return new Promise(function(_0x5e6431,_0x47fb38){return db[_0xd2c6('0x21')][_0xd2c6('0x22')](_0x3009ee[_0xd2c6('0x23')],{'raw':_0x3009ee[_0xd2c6('0x19')]?_0x3009ee['options'][_0xd2c6('0x24')]===undefined?!![]:![]:!![]})[_0xd2c6('0xc')](function(_0x5499fb){logger[_0xd2c6('0xd')](_0xd2c6('0x20'),_0x3009ee);logger[_0xd2c6('0x10')](_0xd2c6('0x20'),_0x3009ee,JSON['stringify'](_0x5499fb));_0x5e6431(_0x5499fb);})[_0xd2c6('0x16')](function(_0x38933c){logger[_0xd2c6('0x12')](_0xd2c6('0x20'),_0x38933c[_0xd2c6('0x14')],_0x3009ee);_0x47fb38(_0xb49bcb[_0xd2c6('0x12')](0x1f4,_0x38933c['message']));});});};exports[_0xd2c6('0x25')]=function(_0x5e0fed){var _0x4a035f=this;return new Promise(function(_0x123cf6,_0x3def52){return db[_0xd2c6('0x21')][_0xd2c6('0x26')](_0x5e0fed[_0xd2c6('0x23')],{'raw':_0x5e0fed[_0xd2c6('0x19')]?_0x5e0fed[_0xd2c6('0x19')][_0xd2c6('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e0fed[_0xd2c6('0x19')]?_0x5e0fed['options'][_0xd2c6('0x1a')]||null:null,'attributes':_0x5e0fed[_0xd2c6('0x19')]?_0x5e0fed[_0xd2c6('0x19')]['attributes']||null:null,'limit':_0x5e0fed[_0xd2c6('0x19')]?_0x5e0fed[_0xd2c6('0x19')]['limit']||null:null})[_0xd2c6('0xc')](function(_0xd06c01){logger[_0xd2c6('0xd')](_0xd2c6('0x25'),_0x5e0fed);logger['debug'](_0xd2c6('0x25'),_0x5e0fed,JSON[_0xd2c6('0x11')](_0xd06c01));_0x123cf6(_0xd06c01);})[_0xd2c6('0x16')](function(_0x109d9e){logger[_0xd2c6('0x12')](_0xd2c6('0x25'),_0x109d9e['message'],_0x5e0fed);_0x3def52(_0x4a035f[_0xd2c6('0x12')](0x1f4,_0x109d9e['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 8cd0099..30c56b1 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 _0xa5fd=['/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voiceChanSpy.controller','get'];(function(_0x4c3140,_0xbe173e){var _0x1ba12c=function(_0x3bf0dd){while(--_0x3bf0dd){_0x4c3140['push'](_0x4c3140['shift']());}};_0x1ba12c(++_0xbe173e);}(_0xa5fd,0x186));var _0xda5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5fd[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xda5f('0x0'));var util=require('util');var path=require(_0xda5f('0x1'));var timeout=require(_0xda5f('0x2'));var express=require(_0xda5f('0x3'));var router=express[_0xda5f('0x4')]();var fs_extra=require(_0xda5f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xda5f('0x6'));var config=require('../../config/environment');var controller=require(_0xda5f('0x7'));router[_0xda5f('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xda5f('0x8')](_0xda5f('0x9'),auth[_0xda5f('0xa')](),controller[_0xda5f('0xb')]);router[_0xda5f('0xc')]('/',auth['isAuthenticated'](),controller[_0xda5f('0xd')]);router[_0xda5f('0xe')](_0xda5f('0x9'),auth['isAuthenticated'](),controller[_0xda5f('0xf')]);router[_0xda5f('0x10')](_0xda5f('0x9'),auth['isAuthenticated'](),controller[_0xda5f('0x11')]);module[_0xda5f('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 17682c1..b81c46a 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 _0x685e=['name','setDataValue','options','join','getDataValue','BOOLEAN','exports','STRING'];(function(_0x1a9bf7,_0x59480a){var _0x969aaa=function(_0x2712e9){while(--_0x2712e9){_0x1a9bf7['push'](_0x1a9bf7['shift']());}};_0x969aaa(++_0x59480a);}(_0x685e,0x1d6));var _0xe685=function(_0x25e109,_0x6ab24c){_0x25e109=_0x25e109-0x0;var _0xc0f7d6=_0x685e[_0x25e109];return _0xc0f7d6;};'use strict';var Sequelize=require('sequelize');module[_0xe685('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xe685('0x1')],'unique':_0xe685('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x3ccc01){this[_0xe685('0x3')](_0xe685('0x4'),_0x3ccc01?_0x3ccc01[_0xe685('0x5')](''):[]);},'get':function(){return this[_0xe685('0x6')]('options')?this['getDataValue'](_0xe685('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0xe685('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xe685('0x1')]},'record':{'type':Sequelize[_0xe685('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe685('0x1')]},'description':{'type':Sequelize[_0xe685('0x1')]}}; \ No newline at end of file +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 diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 64ab504..ebc626d 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 _0xbe99=['end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','error','name','send','index','map','VoiceChanSpy','rawAttributes','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','fields','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','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'];(function(_0x1ed5c3,_0x1c7dce){var _0x20ead4=function(_0x57221a){while(--_0x57221a){_0x1ed5c3['push'](_0x1ed5c3['shift']());}};_0x20ead4(++_0x1c7dce);}(_0xbe99,0x196));var _0x9be9=function(_0x2f6b28,_0x3dac49){_0x2f6b28=_0x2f6b28-0x0;var _0x454270=_0xbe99[_0x2f6b28];return _0x454270;};'use strict';var emlformat=require(_0x9be9('0x0'));var rimraf=require(_0x9be9('0x1'));var zipdir=require(_0x9be9('0x2'));var jsonpatch=require(_0x9be9('0x3'));var rp=require(_0x9be9('0x4'));var moment=require('moment');var BPromise=require(_0x9be9('0x5'));var Mustache=require('mustache');var util=require(_0x9be9('0x6'));var path=require(_0x9be9('0x7'));var sox=require(_0x9be9('0x8'));var csv=require(_0x9be9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9be9('0xa'));var _=require(_0x9be9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9be9('0xc'));var deskjs=require(_0x9be9('0xd'));var toCsv=require(_0x9be9('0x9'));var querystring=require(_0x9be9('0xe'));var Papa=require(_0x9be9('0xf'));var Redis=require(_0x9be9('0x10'));var authService=require(_0x9be9('0x11'));var qs=require(_0x9be9('0x12'));var as=require(_0x9be9('0x13'));var hardwareService=require(_0x9be9('0x14'));var logger=require(_0x9be9('0x15'))(_0x9be9('0x16'));var utils=require(_0x9be9('0x17'));var config=require(_0x9be9('0x18'));var licenseUtil=require(_0x9be9('0x19'));var db=require(_0x9be9('0x1a'))['db'];function respondWithStatusCode(_0x33c2cd,_0x4b6d99){_0x4b6d99=_0x4b6d99||0xcc;return function(_0x1251e4){if(_0x1251e4){return _0x33c2cd[_0x9be9('0x1b')](_0x4b6d99);}return _0x33c2cd[_0x9be9('0x1c')](_0x4b6d99)[_0x9be9('0x1d')]();};}function respondWithResult(_0x2cc374,_0x50a7fb){_0x50a7fb=_0x50a7fb||0xc8;return function(_0x2798bd){if(_0x2798bd){return _0x2cc374[_0x9be9('0x1c')](_0x50a7fb)[_0x9be9('0x1e')](_0x2798bd);}};}function respondWithFilteredResult(_0x5a8a3d,_0x2d3e45){return function(_0x418c1e){if(_0x418c1e){var _0x3c92cc=typeof _0x2d3e45[_0x9be9('0x1f')]===_0x9be9('0x20')&&typeof _0x2d3e45['limit']===_0x9be9('0x20');var _0x1cbff7=_0x418c1e[_0x9be9('0x21')];var _0x5f2612=_0x3c92cc?0x0:_0x2d3e45['offset'];var _0x9a37a0=_0x3c92cc?_0x418c1e[_0x9be9('0x21')]:_0x2d3e45[_0x9be9('0x1f')]+_0x2d3e45['limit'];var _0x5aeca2;if(_0x9a37a0>=_0x1cbff7){_0x9a37a0=_0x1cbff7;_0x5aeca2=0xc8;}else{_0x5aeca2=0xce;}_0x5a8a3d[_0x9be9('0x1c')](_0x5aeca2);return _0x5a8a3d[_0x9be9('0x22')](_0x9be9('0x23'),_0x5f2612+'-'+_0x9a37a0+'/'+_0x1cbff7)[_0x9be9('0x1e')](_0x418c1e);}return null;};}function patchUpdates(_0x1b041b){return function(_0x3761c7){try{jsonpatch[_0x9be9('0x24')](_0x3761c7,_0x1b041b,!![]);}catch(_0x2c1f2f){return BPromise[_0x9be9('0x25')](_0x2c1f2f);}return _0x3761c7[_0x9be9('0x26')]();};}function saveUpdates(_0xd700ff,_0x100637){return function(_0x599429){if(_0x599429){return _0x599429[_0x9be9('0x27')](_0xd700ff)['then'](function(_0x2d543d){return _0x2d543d;});}return null;};}function removeEntity(_0xf87e6d,_0x451e60){return function(_0x3fe959){if(_0x3fe959){return _0x3fe959['destroy']()[_0x9be9('0x28')](function(){var _0xfb4266=_0x3fe959[_0x9be9('0x29')]({'plain':!![]});var _0x42a486=_0x9be9('0x2a');return db[_0x9be9('0x2b')][_0x9be9('0x2c')]({'where':{'type':_0x42a486,'resourceId':_0xfb4266['id']}})[_0x9be9('0x28')](function(){return _0x3fe959;});})[_0x9be9('0x28')](function(){_0xf87e6d[_0x9be9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x195330,_0x2f8466){return function(_0x26db60){if(!_0x26db60){_0x195330[_0x9be9('0x1b')](0x194);}return _0x26db60;};}function handleError(_0x10ac46,_0x54de1f){_0x54de1f=_0x54de1f||0x1f4;return function(_0x22c898){logger[_0x9be9('0x2d')](_0x22c898['stack']);if(_0x22c898[_0x9be9('0x2e')]){delete _0x22c898['name'];}_0x10ac46[_0x9be9('0x1c')](_0x54de1f)[_0x9be9('0x2f')](_0x22c898);};}exports[_0x9be9('0x30')]=function(_0x199cbd,_0x5a527a){var _0x133eca={},_0x3f6fff={},_0xb61721={'count':0x0,'rows':[]};var _0x35665c=_[_0x9be9('0x31')](db[_0x9be9('0x32')][_0x9be9('0x33')],function(_0x3dcb2a){return{'name':_0x3dcb2a['fieldName'],'type':_0x3dcb2a['type'][_0x9be9('0x34')]};});_0x3f6fff['model']=_[_0x9be9('0x31')](_0x35665c,_0x9be9('0x2e'));_0x3f6fff[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x199cbd['query']);_0x3f6fff[_0x9be9('0x37')]=_[_0x9be9('0x38')](_0x3f6fff[_0x9be9('0x39')],_0x3f6fff[_0x9be9('0x35')]);_0x133eca[_0x9be9('0x3a')]=_['intersection'](_0x3f6fff[_0x9be9('0x39')],qs['fields'](_0x199cbd['query']['fields']));_0x133eca['attributes']=_0x133eca[_0x9be9('0x3a')][_0x9be9('0x3b')]?_0x133eca['attributes']:_0x3f6fff[_0x9be9('0x39')];if(!_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3c')](_0x9be9('0x3d'))){_0x133eca[_0x9be9('0x3e')]=qs['limit'](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x3e')]);_0x133eca[_0x9be9('0x1f')]=qs[_0x9be9('0x1f')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x1f')]);}_0x133eca[_0x9be9('0x3f')]=qs[_0x9be9('0x40')](_0x199cbd[_0x9be9('0x35')][_0x9be9('0x40')]);_0x133eca[_0x9be9('0x41')]=qs[_0x9be9('0x37')](_[_0x9be9('0x42')](_0x199cbd[_0x9be9('0x35')],_0x3f6fff[_0x9be9('0x37')]),_0x35665c);if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]){_0x133eca[_0x9be9('0x41')]=_[_0x9be9('0x44')](_0x133eca[_0x9be9('0x41')],{'$or':_[_0x9be9('0x31')](_0x35665c,function(_0x1c1d9a){if(_0x1c1d9a[_0x9be9('0x45')]!==_0x9be9('0x46')){var _0x56a49d={};_0x56a49d[_0x1c1d9a[_0x9be9('0x2e')]]={'$like':'%'+_0x199cbd[_0x9be9('0x35')][_0x9be9('0x43')]+'%'};return _0x56a49d;}})});}_0x133eca=_[_0x9be9('0x44')]({},_0x133eca,_0x199cbd[_0x9be9('0x47')]);var _0x51e6fe={'where':_0x133eca[_0x9be9('0x41')]};return db[_0x9be9('0x32')][_0x9be9('0x21')](_0x51e6fe)[_0x9be9('0x28')](function(_0x1f7775){_0xb61721[_0x9be9('0x21')]=_0x1f7775;if(_0x199cbd[_0x9be9('0x35')][_0x9be9('0x48')]){_0x133eca[_0x9be9('0x49')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x133eca);})[_0x9be9('0x28')](function(_0x56bf39){_0xb61721['rows']=_0x56bf39;return _0xb61721;})[_0x9be9('0x28')](respondWithFilteredResult(_0x5a527a,_0x133eca))[_0x9be9('0x4a')](handleError(_0x5a527a,null));};exports[_0x9be9('0x4b')]=function(_0x59ed83,_0x5ab632){var _0x24c121={'raw':![],'where':{'id':_0x59ed83[_0x9be9('0x4c')]['id']}},_0x4f4168={};_0x4f4168[_0x9be9('0x39')]=_['keys'](db[_0x9be9('0x32')][_0x9be9('0x33')]);_0x4f4168[_0x9be9('0x35')]=_[_0x9be9('0x36')](_0x59ed83[_0x9be9('0x35')]);_0x4f4168['filters']=_[_0x9be9('0x38')](_0x4f4168[_0x9be9('0x39')],_0x4f4168[_0x9be9('0x35')]);_0x24c121['attributes']=_[_0x9be9('0x38')](_0x4f4168['model'],qs[_0x9be9('0x4d')](_0x59ed83[_0x9be9('0x35')][_0x9be9('0x4d')]));_0x24c121[_0x9be9('0x3a')]=_0x24c121['attributes']['length']?_0x24c121[_0x9be9('0x3a')]:_0x4f4168[_0x9be9('0x39')];if(_0x59ed83['query'][_0x9be9('0x48')]){_0x24c121[_0x9be9('0x49')]=[{'all':!![]}];}_0x24c121=_[_0x9be9('0x44')]({},_0x24c121,_0x59ed83[_0x9be9('0x47')]);return db[_0x9be9('0x32')][_0x9be9('0x4e')](_0x24c121)[_0x9be9('0x28')](handleEntityNotFound(_0x5ab632,null))[_0x9be9('0x28')](respondWithResult(_0x5ab632,null))[_0x9be9('0x4a')](handleError(_0x5ab632,null));};exports[_0x9be9('0x4f')]=function(_0x1385ac,_0x31faa8){return db['VoiceChanSpy'][_0x9be9('0x4f')](_0x1385ac[_0x9be9('0x50')],{})[_0x9be9('0x28')](function(_0x31928f){var _0x47e6c8=_0x1385ac['user'][_0x9be9('0x29')]({'plain':!![]});if(!_0x47e6c8)throw new Error(_0x9be9('0x51'));if(_0x47e6c8[_0x9be9('0x52')]===_0x9be9('0x53')){var _0x18450a=_0x31928f['get']({'plain':!![]});var _0x240265=_0x9be9('0x2a');return db['UserProfileSection'][_0x9be9('0x4e')]({'where':{'name':_0x240265,'userProfileId':_0x47e6c8[_0x9be9('0x54')]},'raw':!![]})['then'](function(_0x5a4795){if(_0x5a4795&&_0x5a4795[_0x9be9('0x55')]===0x0){return db[_0x9be9('0x2b')][_0x9be9('0x4f')]({'name':_0x18450a['name'],'resourceId':_0x18450a['id'],'type':_0x5a4795[_0x9be9('0x2e')],'sectionId':_0x5a4795['id']},{})[_0x9be9('0x28')](function(){return _0x31928f;});}else{return _0x31928f;}})[_0x9be9('0x4a')](function(_0x46a7d2){logger[_0x9be9('0x2d')](_0x9be9('0x56'),_0x46a7d2);throw _0x46a7d2;});}return _0x31928f;})[_0x9be9('0x28')](respondWithResult(_0x31faa8,0xc9))[_0x9be9('0x4a')](handleError(_0x31faa8,null));};exports[_0x9be9('0x27')]=function(_0x156637,_0x4dd1d0){if(_0x156637['body']['id']){delete _0x156637['body']['id'];}return db[_0x9be9('0x32')][_0x9be9('0x4e')]({'where':{'id':_0x156637['params']['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x4dd1d0,null))[_0x9be9('0x28')](saveUpdates(_0x156637[_0x9be9('0x50')],null))[_0x9be9('0x28')](respondWithResult(_0x4dd1d0,null))[_0x9be9('0x4a')](handleError(_0x4dd1d0,null));};exports[_0x9be9('0x2c')]=function(_0x1b0543,_0x5245a1){return db[_0x9be9('0x32')]['find']({'where':{'id':_0x1b0543[_0x9be9('0x4c')]['id']}})[_0x9be9('0x28')](handleEntityNotFound(_0x5245a1,null))['then'](removeEntity(_0x5245a1,null))[_0x9be9('0x4a')](handleError(_0x5245a1,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e47c0af..63e412c 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 _0x0653=['bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','auth','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','length','concat','internal','name','User','findAll','agent','catch','exports','models','voice_chanspy','then','VoiceExtension','bulkCreate','destroy','lodash','util'];(function(_0x4f16be,_0x1441bb){var _0x337f8c=function(_0x4cb51e){while(--_0x4cb51e){_0x4f16be['push'](_0x4f16be['shift']());}};_0x337f8c(++_0x1441bb);}(_0x0653,0xe2));var _0x3065=function(_0x3fbe46,_0xb00cfb){_0x3fbe46=_0x3fbe46-0x0;var _0x358e11=_0x0653[_0x3fbe46];return _0x358e11;};'use strict';var _=require(_0x3065('0x0'));var util=require(_0x3065('0x1'));var BPromise=require(_0x3065('0x2'));var attributes=require(_0x3065('0x3'));var getUserApplications=function(_0x360b11,_0x4ef878,_0x54cfe1){var _0x3b9b89=0x1;var _0x194a74=[];var _0x3da976={'context':_0x4ef878[_0x3065('0x4')]||_0x3065('0x5'),'exten':util[_0x3065('0x6')](_0x3065('0x7'),_0x360b11[_0x3065('0x8')],_0x54cfe1),'type':_0x3065('0x9'),'isApp':![],'ChanSpyId':_0x360b11['id'],'UserId':_0x4ef878['id']};_0x194a74[_0x3065('0xa')](_[_0x3065('0xb')]({'app':'Set','appdata':util['format'](_0x3065('0xc'),_0x3065('0xd')),'priority':_0x3b9b89++},_0x3da976));if(_0x360b11[_0x3065('0xe')]){_0x194a74[_0x3065('0xa')](_[_0x3065('0xb')]({'app':_0x3065('0xf'),'appdata':util[_0x3065('0x6')]('${UNIQUEID}.%s,a',_0x360b11['recordingFormat']),'priority':_0x3b9b89++},_0x3da976));}if(_0x360b11[_0x3065('0x10')]){_0x194a74[_0x3065('0xa')](_[_0x3065('0xb')]({'app':_0x3065('0x11'),'appdata':_0x360b11[_0x3065('0x12')],'priority':_0x3b9b89++},_0x3da976));}_0x194a74['push'](_['merge']({'app':_0x3065('0x13'),'appdata':util[_0x3065('0x6')](_0x3065('0x14'),_0x4ef878['name'],_0x360b11['options']?_0x360b11[_0x3065('0x15')][_0x3065('0x16')](''):''),'priority':_0x3b9b89++},_0x3da976));if(_0x360b11[_0x3065('0xe')]){_0x194a74[_0x3065('0xa')](_[_0x3065('0xb')]({'app':'StopMixMonitor','priority':_0x3b9b89++},_0x3da976));}return _0x194a74;};var getChanSpyApplications=function(_0x2c258e,_0x4ab9f6){var _0x3adf14=[];for(var _0x4f424d=0x0,_0x1876eb=0x1;_0x4f424d<_0x4ab9f6[_0x3065('0x17')];_0x4f424d++,_0x1876eb=0x1){_0x3adf14=_0x3adf14[_0x3065('0x18')](getUserApplications(_0x2c258e,_0x4ab9f6[_0x4f424d],_0x4ab9f6[_0x4f424d][_0x3065('0x19')]));if(_0x4ab9f6[_0x4f424d][_0x3065('0x19')]!=_0x4ab9f6[_0x4f424d][_0x3065('0x1a')]){_0x3adf14=_0x3adf14[_0x3065('0x18')](getUserApplications(_0x2c258e,_0x4ab9f6[_0x4f424d],_0x4ab9f6[_0x4f424d][_0x3065('0x1a')]));}}return _0x3adf14;};var getChanSpyPromise=function(_0x5b3286,_0xf8afb3){return new BPromise(function(_0x8b11f,_0x138f3d){return _0x5b3286[_0x3065('0x1b')][_0x3065('0x1c')]({'attributes':['id',_0x3065('0x1a'),_0x3065('0x19')],'where':{'role':_0x3065('0x1d'),'chanspy':!![]},'raw':!![]})['then'](function(_0x1352b2){if(_0x1352b2){return _0x8b11f(getChanSpyApplications(_0xf8afb3,_0x1352b2));}return _0x8b11f([]);})[_0x3065('0x1e')](function(_0x34c176){_0x138f3d(_0x34c176);});});};module[_0x3065('0x1f')]=function(_0x39b5c5,_0xca4608){var _0x13aad7=_0x39b5c5[_0x3065('0x20')];return _0x39b5c5['define']('VoiceChanSpy',attributes,{'tableName':_0x3065('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2a1dad,_0x257fa6,_0x330923){return getChanSpyPromise(_0x13aad7,_0x2a1dad)[_0x3065('0x22')](function(_0x13e712){if(_0x13e712&&_0x13e712['length']){return _0x13aad7[_0x3065('0x23')][_0x3065('0x24')](_0x13e712);}})[_0x3065('0x22')](function(){_0x330923();})['catch'](function(_0x2b77a9){_0x330923(_0x2b77a9);});},'afterUpdate':function(_0x4f7e27,_0x24f69b,_0x2c36a0){return _0x13aad7['VoiceExtension'][_0x3065('0x25')]({'where':{'ChanSpyId':_0x4f7e27['id']}})[_0x3065('0x22')](function(){return getChanSpyPromise(_0x13aad7,_0x4f7e27);})[_0x3065('0x22')](function(_0x1ea716){if(_0x1ea716&&_0x1ea716[_0x3065('0x17')]){return _0x13aad7[_0x3065('0x23')][_0x3065('0x24')](_0x1ea716);}})[_0x3065('0x22')](function(){_0x2c36a0();})[_0x3065('0x1e')](function(_0x17b6c0){_0x2c36a0(_0x17b6c0);});},'afterDestroy':function(_0xcea555,_0x220ed7,_0x56ed21){return _0x13aad7['VoiceExtension'][_0x3065('0x25')]({'where':{'ChanSpyId':_0xcea555['id']}})[_0x3065('0x22')](function(){_0x56ed21();})[_0x3065('0x1e')](function(_0x378e61){_0x56ed21(_0x378e61);});}}});}; \ No newline at end of file +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 diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index a48d153..6db606b 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 _0x2e54=['rpc','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x2e54,0x1dd));var _0x42e5=function(_0x335c56,_0x5af892){_0x335c56=_0x335c56-0x0;var _0x312817=_0x2e54[_0x335c56];return _0x312817;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4bed10,_0x2af5bb,_0x56be20){return new BPromise(function(_0x335b92,_0x490b99){return client[_0x42e5('0xb')](_0x4bed10,_0x56be20)[_0x42e5('0xc')](function(_0x10ee5a){logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));logger[_0x42e5('0x10')](_0x42e5('0x11'),_0x2af5bb,_0x42e5('0xf'),JSON['stringify'](_0x10ee5a));if(_0x10ee5a[_0x42e5('0x12')]){if(_0x10ee5a[_0x42e5('0x12')]['code']===0x1f4){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x490b99(_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);}logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x10ee5a[_0x42e5('0x12')][_0x42e5('0x13')]);return _0x335b92(_0x10ee5a['error'][_0x42e5('0x13')]);}else{logger[_0x42e5('0xd')](_0x42e5('0xe'),_0x2af5bb,_0x42e5('0xf'));_0x335b92(_0x10ee5a[_0x42e5('0x14')][_0x42e5('0x13')]);}})[_0x42e5('0x15')](function(_0x3abe3d){logger[_0x42e5('0x12')](_0x42e5('0xe'),_0x2af5bb,_0x3abe3d);_0x490b99(_0x3abe3d);});});} \ No newline at end of file +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 diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index ad629f7..651db9b 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 _0x16dc=['fs-extra','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','/:id','isAuthenticated','show','create','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x1a31b8,_0x599a03){var _0x4d1369=function(_0x4b7789){while(--_0x4b7789){_0x1a31b8['push'](_0x1a31b8['shift']());}};_0x4d1369(++_0x599a03);}(_0x16dc,0x183));var _0xc16d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16dc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc16d('0x0'));var path=require('path');var timeout=require(_0xc16d('0x1'));var express=require(_0xc16d('0x2'));var router=express[_0xc16d('0x3')]();var fs_extra=require(_0xc16d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xc16d('0x5'));var config=require(_0xc16d('0x6'));var controller=require(_0xc16d('0x7'));router[_0xc16d('0x8')]('/',auth['isAuthenticated'](),controller[_0xc16d('0x9')]);router['get'](_0xc16d('0xa'),auth[_0xc16d('0xb')](),controller[_0xc16d('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc16d('0xd')]);router['put']('/:id',auth[_0xc16d('0xb')](),controller[_0xc16d('0xe')]);router[_0xc16d('0xf')](_0xc16d('0xa'),auth[_0xc16d('0xb')](),controller['destroy']);module[_0xc16d('0x10')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index cb3cb44..c7410f3 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 _0x2c3b=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x59ef4e,_0x20dcc1){var _0x4b82c4=function(_0x3a7766){while(--_0x3a7766){_0x59ef4e['push'](_0x59ef4e['shift']());}};_0x4b82c4(++_0x20dcc1);}(_0x2c3b,0x8e));var _0xb2c3=function(_0x309ad8,_0x3365a0){_0x309ad8=_0x309ad8-0x0;var _0x3114d4=_0x2c3b[_0x309ad8];return _0x3114d4;};'use strict';var Sequelize=require(_0xb2c3('0x0'));module[_0xb2c3('0x1')]={'name':{'type':Sequelize[_0xb2c3('0x2')],'unique':_0xb2c3('0x3')},'description':{'type':Sequelize[_0xb2c3('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xb2c3('0x4')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index f8339bc..44a1ff1 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 _0x1dd2=['findAll','rows','catch','show','params','find','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','utf8','/etc/asterisk/extensions_xcally_contexts.conf','Reload','readFileSync','eml-format','rimraf','request-promise','mustache','util','path','sox','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','Contexts','UserProfileResource','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','intersection','query','attributes','fields','hasOwnProperty','where','pick','filters','merge','type','VIRTUAL','options','includeAll','include','VoiceContext'];(function(_0x3b84ae,_0x57296a){var _0x526ee6=function(_0x516c7a){while(--_0x516c7a){_0x3b84ae['push'](_0x3b84ae['shift']());}};_0x526ee6(++_0x57296a);}(_0x1dd2,0x1aa));var _0x21dd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dd2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x21dd('0x0'));var rimraf=require(_0x21dd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x21dd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x21dd('0x3'));var util=require(_0x21dd('0x4'));var path=require(_0x21dd('0x5'));var sox=require(_0x21dd('0x6'));var csv=require(_0x21dd('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x21dd('0x8'));var _=require('lodash');var squel=require(_0x21dd('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x21dd('0xa'));var toCsv=require('to-csv');var querystring=require(_0x21dd('0xb'));var Papa=require(_0x21dd('0xc'));var Redis=require(_0x21dd('0xd'));var authService=require(_0x21dd('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x21dd('0xf'));var hardwareService=require(_0x21dd('0x10'));var logger=require(_0x21dd('0x11'))(_0x21dd('0x12'));var utils=require(_0x21dd('0x13'));var config=require(_0x21dd('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x21dd('0x15'))['db'];var jayson=require(_0x21dd('0x16'));var client=jayson['client'][_0x21dd('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x280669,_0x3f8298,_0x488b6a,_0x1e81e4){return new BPromise(function(_0x254bba,_0x547dc7){var _0x2e3b74=_0x1e81e4||client;return _0x2e3b74[_0x21dd('0x18')](_0x280669,_0x488b6a)[_0x21dd('0x19')](function(_0x2346b8){logger[_0x21dd('0x1a')](_0x21dd('0x1b'),_0x3f8298,_0x21dd('0x1c'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0x3f8298,_0x21dd('0x1c'),JSON['stringify'](_0x2346b8));if(_0x2346b8[_0x21dd('0x1d')]){if(_0x2346b8[_0x21dd('0x1d')][_0x21dd('0x1e')]===0x1f4){logger['error'](_0x21dd('0x1b'),_0x3f8298,_0x2346b8['error'][_0x21dd('0x1f')]);return _0x547dc7(_0x2346b8[_0x21dd('0x1d')]['message']);}logger[_0x21dd('0x1d')](_0x21dd('0x1b'),_0x3f8298,_0x2346b8[_0x21dd('0x1d')]['message']);return _0x254bba(_0x2346b8['error'][_0x21dd('0x1f')]);}else{logger[_0x21dd('0x1a')](_0x21dd('0x1b'),_0x3f8298,_0x21dd('0x1c'));_0x254bba(_0x2346b8[_0x21dd('0x20')][_0x21dd('0x1f')]);}})['catch'](function(_0x1e6acf){logger[_0x21dd('0x1d')](_0x21dd('0x1b'),_0x3f8298,_0x1e6acf);_0x547dc7(_0x1e6acf);});});}function respondWithStatusCode(_0x13be1d,_0x582323){_0x582323=_0x582323||0xcc;return function(_0x10e8ef){if(_0x10e8ef){return _0x13be1d[_0x21dd('0x21')](_0x582323);}return _0x13be1d[_0x21dd('0x22')](_0x582323)[_0x21dd('0x23')]();};}function respondWithResult(_0x1d8327,_0x122056){_0x122056=_0x122056||0xc8;return function(_0x56b2a7){if(_0x56b2a7){return _0x1d8327[_0x21dd('0x22')](_0x122056)[_0x21dd('0x24')](_0x56b2a7);}};}function respondWithFilteredResult(_0x3d7f29,_0x127b78){return function(_0x5147a7){if(_0x5147a7){var _0x2b819e=typeof _0x127b78[_0x21dd('0x25')]==='undefined'&&typeof _0x127b78[_0x21dd('0x26')]===_0x21dd('0x27');var _0x2f1e7d=_0x5147a7[_0x21dd('0x28')];var _0x4cd328=_0x2b819e?0x0:_0x127b78[_0x21dd('0x25')];var _0x376551=_0x2b819e?_0x5147a7['count']:_0x127b78[_0x21dd('0x25')]+_0x127b78['limit'];var _0x30beae;if(_0x376551>=_0x2f1e7d){_0x376551=_0x2f1e7d;_0x30beae=0xc8;}else{_0x30beae=0xce;}_0x3d7f29[_0x21dd('0x22')](_0x30beae);return _0x3d7f29['set'](_0x21dd('0x29'),_0x4cd328+'-'+_0x376551+'/'+_0x2f1e7d)['json'](_0x5147a7);}return null;};}function patchUpdates(_0x416112){return function(_0x21ddb2){try{jsonpatch[_0x21dd('0x2a')](_0x21ddb2,_0x416112,!![]);}catch(_0x40f11d){return BPromise[_0x21dd('0x2b')](_0x40f11d);}return _0x21ddb2[_0x21dd('0x2c')]();};}function saveUpdates(_0x502b10,_0x1ce6be){return function(_0xeffa4b){if(_0xeffa4b){return _0xeffa4b[_0x21dd('0x2d')](_0x502b10)[_0x21dd('0x19')](function(_0x56082d){return _0x56082d;});}return null;};}function removeEntity(_0x10c94a,_0x878dfe){return function(_0x4d4862){if(_0x4d4862){return _0x4d4862[_0x21dd('0x2e')]()[_0x21dd('0x19')](function(){var _0x7e196b=_0x4d4862['get']({'plain':!![]});var _0x1a5552=_0x21dd('0x2f');return db[_0x21dd('0x30')][_0x21dd('0x2e')]({'where':{'type':_0x1a5552,'resourceId':_0x7e196b['id']}})[_0x21dd('0x19')](function(){return _0x4d4862;});})[_0x21dd('0x19')](function(){_0x10c94a['status'](0xcc)[_0x21dd('0x23')]();});}};}function handleEntityNotFound(_0x904b94,_0x2cf22e){return function(_0x312dd8){if(!_0x312dd8){_0x904b94[_0x21dd('0x21')](0x194);}return _0x312dd8;};}function handleError(_0x265302,_0x15c332){_0x15c332=_0x15c332||0x1f4;return function(_0x4b9a19){logger[_0x21dd('0x1d')](_0x4b9a19[_0x21dd('0x31')]);if(_0x4b9a19[_0x21dd('0x32')]){delete _0x4b9a19['name'];}_0x265302[_0x21dd('0x22')](_0x15c332)[_0x21dd('0x33')](_0x4b9a19);};}exports[_0x21dd('0x34')]=function(_0x2fdc4d,_0x1ebd23){var _0x5bf7b1={},_0x2488ef={},_0x3ef546={'count':0x0,'rows':[]};var _0x1820ca=_['map'](db['VoiceContext'][_0x21dd('0x35')],function(_0x4736ea){return{'name':_0x4736ea[_0x21dd('0x36')],'type':_0x4736ea['type'][_0x21dd('0x37')]};});_0x2488ef[_0x21dd('0x38')]=_[_0x21dd('0x39')](_0x1820ca,_0x21dd('0x32'));_0x2488ef['query']=_[_0x21dd('0x3a')](_0x2fdc4d['query']);_0x2488ef['filters']=_[_0x21dd('0x3b')](_0x2488ef['model'],_0x2488ef[_0x21dd('0x3c')]);_0x5bf7b1[_0x21dd('0x3d')]=_[_0x21dd('0x3b')](_0x2488ef['model'],qs[_0x21dd('0x3e')](_0x2fdc4d[_0x21dd('0x3c')][_0x21dd('0x3e')]));_0x5bf7b1['attributes']=_0x5bf7b1[_0x21dd('0x3d')]['length']?_0x5bf7b1[_0x21dd('0x3d')]:_0x2488ef['model'];if(!_0x2fdc4d[_0x21dd('0x3c')][_0x21dd('0x3f')]('nolimit')){_0x5bf7b1[_0x21dd('0x26')]=qs[_0x21dd('0x26')](_0x2fdc4d[_0x21dd('0x3c')][_0x21dd('0x26')]);_0x5bf7b1[_0x21dd('0x25')]=qs[_0x21dd('0x25')](_0x2fdc4d['query']['offset']);}_0x5bf7b1['order']=qs['sort'](_0x2fdc4d[_0x21dd('0x3c')]['sort']);_0x5bf7b1[_0x21dd('0x40')]=qs['filters'](_[_0x21dd('0x41')](_0x2fdc4d['query'],_0x2488ef[_0x21dd('0x42')]),_0x1820ca);if(_0x2fdc4d[_0x21dd('0x3c')]['filter']){_0x5bf7b1[_0x21dd('0x40')]=_[_0x21dd('0x43')](_0x5bf7b1['where'],{'$or':_[_0x21dd('0x39')](_0x1820ca,function(_0x25c7a3){if(_0x25c7a3[_0x21dd('0x44')]!==_0x21dd('0x45')){var _0x2be93e={};_0x2be93e[_0x25c7a3[_0x21dd('0x32')]]={'$like':'%'+_0x2fdc4d[_0x21dd('0x3c')]['filter']+'%'};return _0x2be93e;}})});}_0x5bf7b1=_[_0x21dd('0x43')]({},_0x5bf7b1,_0x2fdc4d[_0x21dd('0x46')]);var _0x5b7d1e={'where':_0x5bf7b1['where']};return db['VoiceContext'][_0x21dd('0x28')](_0x5b7d1e)[_0x21dd('0x19')](function(_0x336c2e){_0x3ef546[_0x21dd('0x28')]=_0x336c2e;if(_0x2fdc4d['query'][_0x21dd('0x47')]){_0x5bf7b1[_0x21dd('0x48')]=[{'all':!![]}];}return db[_0x21dd('0x49')][_0x21dd('0x4a')](_0x5bf7b1);})[_0x21dd('0x19')](function(_0x4d27dd){_0x3ef546[_0x21dd('0x4b')]=_0x4d27dd;return _0x3ef546;})[_0x21dd('0x19')](respondWithFilteredResult(_0x1ebd23,_0x5bf7b1))[_0x21dd('0x4c')](handleError(_0x1ebd23,null));};exports[_0x21dd('0x4d')]=function(_0x512847,_0x1dc731){var _0x67f4e4={'raw':![],'where':{'id':_0x512847[_0x21dd('0x4e')]['id']}},_0x857591={};_0x857591[_0x21dd('0x38')]=_[_0x21dd('0x3a')](db[_0x21dd('0x49')]['rawAttributes']);_0x857591['query']=_[_0x21dd('0x3a')](_0x512847['query']);_0x857591[_0x21dd('0x42')]=_[_0x21dd('0x3b')](_0x857591[_0x21dd('0x38')],_0x857591[_0x21dd('0x3c')]);_0x67f4e4[_0x21dd('0x3d')]=_[_0x21dd('0x3b')](_0x857591[_0x21dd('0x38')],qs['fields'](_0x512847[_0x21dd('0x3c')][_0x21dd('0x3e')]));_0x67f4e4[_0x21dd('0x3d')]=_0x67f4e4[_0x21dd('0x3d')]['length']?_0x67f4e4['attributes']:_0x857591[_0x21dd('0x38')];if(_0x512847[_0x21dd('0x3c')][_0x21dd('0x47')]){_0x67f4e4['include']=[{'all':!![]}];}_0x67f4e4=_[_0x21dd('0x43')]({},_0x67f4e4,_0x512847[_0x21dd('0x46')]);return db[_0x21dd('0x49')][_0x21dd('0x4f')](_0x67f4e4)[_0x21dd('0x19')](handleEntityNotFound(_0x1dc731,null))[_0x21dd('0x19')](respondWithResult(_0x1dc731,null))[_0x21dd('0x4c')](handleError(_0x1dc731,null));};exports[_0x21dd('0x50')]=function(_0x324908,_0xaa8a96,_0x3c736c){var _0x5aaf5a;return db[_0x21dd('0x49')][_0x21dd('0x50')](_0x324908[_0x21dd('0x51')],{'raw':!![]})['then'](function(_0x1a85e3){_0x5aaf5a=_0x1a85e3;return db[_0x21dd('0x49')]['findAll']({'raw':!![]});})[_0x21dd('0x19')](function(_0x584c08){var _0x2805a9=fs['readFileSync'](path[_0x21dd('0x52')](config[_0x21dd('0x53')],_0x21dd('0x54')),'utf8');var _0x1e60a8=ejs[_0x21dd('0x55')](_0x2805a9,{'contexts':_0x584c08||[]});fs[_0x21dd('0x56')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x1e60a8);})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x21dd('0x57')});})[_0x21dd('0x19')](function(){var _0x4946b3=_0x324908['user']['get']({'plain':!![]});if(!_0x4946b3)throw new Error(_0x21dd('0x58'));if(_0x4946b3[_0x21dd('0x59')]===_0x21dd('0x5a')){var _0x839d73=_0x5aaf5a[_0x21dd('0x5b')]({'plain':!![]});return db[_0x21dd('0x5c')][_0x21dd('0x4f')]({'where':{'name':'Contexts','userProfileId':_0x4946b3[_0x21dd('0x5d')]},'raw':!![]})[_0x21dd('0x19')](function(_0x236259){if(_0x236259&&_0x236259[_0x21dd('0x5e')]===0x0){return db[_0x21dd('0x30')][_0x21dd('0x50')]({'name':_0x839d73[_0x21dd('0x32')],'resourceId':_0x839d73['id'],'type':_0x236259[_0x21dd('0x32')],'sectionId':_0x236259['id']},{})[_0x21dd('0x19')](function(){return _0x5aaf5a;});}else{return _0x5aaf5a;}})[_0x21dd('0x4c')](function(_0x50d76d){logger[_0x21dd('0x1d')](_0x21dd('0x5f'),_0x50d76d);throw _0x50d76d;});}return _0x5aaf5a;})[_0x21dd('0x19')](respondWithResult(_0xaa8a96,0xc9))[_0x21dd('0x4c')](handleError(_0xaa8a96,null));};exports['update']=function(_0x377c74,_0x4dc217,_0x3ca371){var _0x3fcfc3;return db[_0x21dd('0x49')][_0x21dd('0x4f')]({'where':{'id':_0x377c74[_0x21dd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4dc217,null))[_0x21dd('0x19')](saveUpdates(_0x377c74[_0x21dd('0x51')],null))['then'](function(_0x14e3d0){if(_0x14e3d0){_0x3fcfc3=_0x14e3d0;return db[_0x21dd('0x49')][_0x21dd('0x4a')]({'raw':!![]});}})[_0x21dd('0x19')](function(_0x49727d){var _0x3e1bfb=fs['readFileSync'](path['join'](config[_0x21dd('0x53')],'server/files/templates/context.ejs'),_0x21dd('0x60'));var _0x13aade=ejs[_0x21dd('0x55')](_0x3e1bfb,{'contexts':_0x49727d||[]});fs[_0x21dd('0x56')](_0x21dd('0x61'),_0x13aade);})['then'](function(){return respondWithRpcPromise(_0x21dd('0x62'),_0x21dd('0x2d'),{'module':'chan_sip.so'});})[_0x21dd('0x19')](function(){return _0x3fcfc3;})[_0x21dd('0x19')](respondWithResult(_0x4dc217,null))[_0x21dd('0x4c')](handleError(_0x4dc217,null));};exports['destroy']=function(_0x5d016e,_0x3b4623,_0x8a907a){var _0x5c0643;return db[_0x21dd('0x49')][_0x21dd('0x4f')]({'where':{'id':_0x5d016e[_0x21dd('0x4e')]['id']}})[_0x21dd('0x19')](handleEntityNotFound(_0x3b4623,null))[_0x21dd('0x19')](removeEntity(_0x3b4623,null))[_0x21dd('0x19')](function(){return db[_0x21dd('0x49')]['findAll']({'raw':!![]});})['then'](function(_0x14a7e8){var _0x2061e9=fs[_0x21dd('0x63')](path[_0x21dd('0x52')](config[_0x21dd('0x53')],_0x21dd('0x54')),_0x21dd('0x60'));var _0x4baa93=ejs['render'](_0x2061e9,{'contexts':_0x14a7e8});fs[_0x21dd('0x56')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x4baa93);return respondWithRpcPromise('Reload','destroy',{'module':_0x21dd('0x57')});})[_0x21dd('0x4c')](handleError(_0x3b4623,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index a6013e1..8b0f0bc 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 _0xa969=['exports','define','voice_contexts','lodash','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x266772,_0x51aa0b){var _0x1ac5ee=function(_0x3462cf){while(--_0x3462cf){_0x266772['push'](_0x266772['shift']());}};_0x1ac5ee(++_0x51aa0b);}(_0xa969,0x16b));var _0x9a96=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa969[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0x9a96('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9a96('0x1'));var BPromise=require(_0x9a96('0x2'));var rp=require(_0x9a96('0x3'));var fs=require('fs');var path=require(_0x9a96('0x4'));var rimraf=require('rimraf');var config=require(_0x9a96('0x5'));var attributes=require('./voiceContext.attributes');module[_0x9a96('0x6')]=function(_0x246089,_0x40bfdf){return _0x246089[_0x9a96('0x7')]('VoiceContext',attributes,{'tableName':_0x9a96('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 58b1a17..7bdb4fa 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 _0xa7b5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x269f75,_0x2d96b4){var _0x4bea94=function(_0x41bf71){while(--_0x41bf71){_0x269f75['push'](_0x269f75['shift']());}};_0x4bea94(++_0x2d96b4);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x4f59a3,_0x2be653){_0x4f59a3=_0x4f59a3-0x0;var _0x4963d0=_0xa7b5[_0x4f59a3];return _0x4963d0;};'use strict';var _=require(_0x5a7b('0x0'));var util=require('util');var moment=require(_0x5a7b('0x1'));var BPromise=require('bluebird');var rs=require(_0x5a7b('0x2'));var fs=require('fs');var Redis=require(_0x5a7b('0x3'));var db=require(_0x5a7b('0x4'))['db'];var utils=require(_0x5a7b('0x5'));var logger=require(_0x5a7b('0x6'))(_0x5a7b('0x7'));var config=require(_0x5a7b('0x8'));var jayson=require(_0x5a7b('0x9'));var client=jayson[_0x5a7b('0xa')][_0x5a7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f8f95,_0x493ae6,_0x2cd623){return new BPromise(function(_0x24b80c,_0x7a3ae){return client[_0x5a7b('0xc')](_0x1f8f95,_0x2cd623)[_0x5a7b('0xd')](function(_0x4070ee){logger['info']('VoiceContext,\x20%s,\x20%s',_0x493ae6,_0x5a7b('0xe'));logger['debug'](_0x5a7b('0xf'),_0x493ae6,_0x5a7b('0xe'),JSON[_0x5a7b('0x10')](_0x4070ee));if(_0x4070ee[_0x5a7b('0x11')]){if(_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x12')]===0x1f4){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x7a3ae(_0x4070ee[_0x5a7b('0x11')]['message']);}logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x4070ee[_0x5a7b('0x11')][_0x5a7b('0x14')]);return _0x24b80c(_0x4070ee['error'][_0x5a7b('0x14')]);}else{logger[_0x5a7b('0x15')]('VoiceContext,\x20%s,\x20%s',_0x493ae6,_0x5a7b('0xe'));_0x24b80c(_0x4070ee['result'][_0x5a7b('0x14')]);}})['catch'](function(_0x340241){logger[_0x5a7b('0x11')](_0x5a7b('0x13'),_0x493ae6,_0x340241);_0x7a3ae(_0x340241);});});} \ No newline at end of file +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 diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index e2a41ef..05dc483 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 _0x6b87=['../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x6b87,0x15f));var _0x76b8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6b87[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0x76b8('0x0'));var path=require(_0x76b8('0x1'));var timeout=require(_0x76b8('0x2'));var express=require('express');var router=express[_0x76b8('0x3')]();var fs_extra=require(_0x76b8('0x4'));var auth=require(_0x76b8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x76b8('0x6'));var controller=require(_0x76b8('0x7'));router[_0x76b8('0x8')]('/',auth[_0x76b8('0x9')](),controller[_0x76b8('0xa')]);router[_0x76b8('0x8')](_0x76b8('0xb'),auth[_0x76b8('0x9')](),controller[_0x76b8('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x76b8('0xd')]);router[_0x76b8('0xe')]('/',auth[_0x76b8('0x9')](),controller['create']);router[_0x76b8('0xf')](_0x76b8('0x10'),auth[_0x76b8('0x9')](),controller[_0x76b8('0x11')]);router[_0x76b8('0x12')](_0x76b8('0x10'),auth[_0x76b8('0x9')](),controller[_0x76b8('0x13')]);module[_0x76b8('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index acdf1c6..23a82e3 100644 --- a/server/api/voiceDialReport/voiceDialReport.attributes.js +++ b/server/api/voiceDialReport/voiceDialReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['STRING','INTEGER','DATE','exports'];(function(_0x30f4f4,_0x56ee70){var _0x16c804=function(_0xb8fdc7){while(--_0xb8fdc7){_0x30f4f4['push'](_0x30f4f4['shift']());}};_0x16c804(++_0x56ee70);}(_0xe5b3,0x133));var _0x3e5b=function(_0x482332,_0x2f8fc7){_0x482332=_0x482332-0x0;var _0x483621=_0xe5b3[_0x482332];return _0x483621;};'use strict';var Sequelize=require('sequelize');module[_0x3e5b('0x0')]={'privilege':{'type':Sequelize[_0x3e5b('0x1')]},'channel':{'type':Sequelize[_0x3e5b('0x1')]},'channelstate':{'type':Sequelize[_0x3e5b('0x2')]},'channelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'calleridnum':{'type':Sequelize[_0x3e5b('0x1')]},'calleridname':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'connectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'language':{'type':Sequelize[_0x3e5b('0x1')]},'accountcode':{'type':Sequelize[_0x3e5b('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3e5b('0x1')]},'priority':{'type':Sequelize[_0x3e5b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x3e5b('0x1')]},'destchannel':{'type':Sequelize[_0x3e5b('0x1')]},'destchannelstate':{'type':Sequelize[_0x3e5b('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x3e5b('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x3e5b('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x3e5b('0x1')]},'destlanguage':{'type':Sequelize[_0x3e5b('0x1')]},'destaccountcode':{'type':Sequelize[_0x3e5b('0x1')]},'destcontext':{'type':Sequelize[_0x3e5b('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x3e5b('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x3e5b('0x1')]},'dialstring':{'type':Sequelize[_0x3e5b('0x1')]},'dialstatus':{'type':Sequelize[_0x3e5b('0x1')]},'starttime':{'type':Sequelize[_0x3e5b('0x3')]},'answertime':{'type':Sequelize[_0x3e5b('0x3')]},'endtime':{'type':Sequelize[_0x3e5b('0x3')]},'lastevent':{'type':Sequelize[_0x3e5b('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0x3e5b('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _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 diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 8d9326d..593325e 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 _0x0ea6=['include','findAll','catch','show','includeAll','find','create','body','update','params','describe','rimraf','fast-json-patch','request-promise','moment','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options'];(function(_0x461890,_0x3c43f7){var _0x348339=function(_0x1f01ab){while(--_0x1f01ab){_0x461890['push'](_0x461890['shift']());}};_0x348339(++_0x3c43f7);}(_0x0ea6,0x1cd));var _0x60ea=function(_0x1ac120,_0x3e7e45){_0x1ac120=_0x1ac120-0x0;var _0x19b703=_0x0ea6[_0x1ac120];return _0x19b703;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x60ea('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60ea('0x1'));var rp=require(_0x60ea('0x2'));var moment=require(_0x60ea('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x60ea('0x4'));var path=require('path');var sox=require(_0x60ea('0x5'));var csv=require('to-csv');var ejs=require(_0x60ea('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x60ea('0x7'));var squel=require(_0x60ea('0x8'));var crypto=require(_0x60ea('0x9'));var jsforce=require(_0x60ea('0xa'));var deskjs=require(_0x60ea('0xb'));var toCsv=require(_0x60ea('0xc'));var querystring=require(_0x60ea('0xd'));var Papa=require('papaparse');var Redis=require(_0x60ea('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x60ea('0xf'));var as=require(_0x60ea('0x10'));var hardwareService=require(_0x60ea('0x11'));var logger=require(_0x60ea('0x12'))('api');var utils=require(_0x60ea('0x13'));var config=require(_0x60ea('0x14'));var licenseUtil=require(_0x60ea('0x15'));var db=require(_0x60ea('0x16'))['db'];function respondWithStatusCode(_0x3b1bdb,_0x2e0fab){_0x2e0fab=_0x2e0fab||0xcc;return function(_0x5ac275){if(_0x5ac275){return _0x3b1bdb[_0x60ea('0x17')](_0x2e0fab);}return _0x3b1bdb[_0x60ea('0x18')](_0x2e0fab)[_0x60ea('0x19')]();};}function respondWithResult(_0x32114d,_0x55aabb){_0x55aabb=_0x55aabb||0xc8;return function(_0x4e5f8d){if(_0x4e5f8d){return _0x32114d['status'](_0x55aabb)[_0x60ea('0x1a')](_0x4e5f8d);}};}function respondWithFilteredResult(_0x274b00,_0x462dec){return function(_0x27ec83){if(_0x27ec83){var _0x180fcb=typeof _0x462dec[_0x60ea('0x1b')]===_0x60ea('0x1c')&&typeof _0x462dec[_0x60ea('0x1d')]===_0x60ea('0x1c');var _0x48d0ee=_0x27ec83[_0x60ea('0x1e')];var _0x2d4294=_0x180fcb?0x0:_0x462dec[_0x60ea('0x1b')];var _0x254cba=_0x180fcb?_0x27ec83['count']:_0x462dec[_0x60ea('0x1b')]+_0x462dec[_0x60ea('0x1d')];var _0x38c019;if(_0x254cba>=_0x48d0ee){_0x254cba=_0x48d0ee;_0x38c019=0xc8;}else{_0x38c019=0xce;}_0x274b00['status'](_0x38c019);return _0x274b00[_0x60ea('0x1f')]('Content-Range',_0x2d4294+'-'+_0x254cba+'/'+_0x48d0ee)['json'](_0x27ec83);}return null;};}function patchUpdates(_0x254ddc){return function(_0x38b693){try{jsonpatch[_0x60ea('0x20')](_0x38b693,_0x254ddc,!![]);}catch(_0x35d7f1){return BPromise[_0x60ea('0x21')](_0x35d7f1);}return _0x38b693[_0x60ea('0x22')]();};}function saveUpdates(_0x3fc9e8,_0x332fe1){return function(_0x57b551){if(_0x57b551){return _0x57b551['update'](_0x3fc9e8)[_0x60ea('0x23')](function(_0x19a40a){return _0x19a40a;});}return null;};}function removeEntity(_0x3ca157,_0x332192){return function(_0x37e383){if(_0x37e383){return _0x37e383[_0x60ea('0x24')]()[_0x60ea('0x23')](function(){_0x3ca157['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ae528,_0x42b34b){return function(_0x2a5273){if(!_0x2a5273){_0x4ae528[_0x60ea('0x17')](0x194);}return _0x2a5273;};}function handleError(_0x9f5366,_0x1c2291){_0x1c2291=_0x1c2291||0x1f4;return function(_0x19a01a){logger['error'](_0x19a01a[_0x60ea('0x25')]);if(_0x19a01a[_0x60ea('0x26')]){delete _0x19a01a[_0x60ea('0x26')];}_0x9f5366[_0x60ea('0x18')](_0x1c2291)[_0x60ea('0x27')](_0x19a01a);};}exports[_0x60ea('0x28')]=function(_0x45fcc5,_0xf7800c){var _0x217d39={},_0x47a063={},_0x27cad2={'count':0x0,'rows':[]};var _0x288cb9=_[_0x60ea('0x29')](db[_0x60ea('0x2a')][_0x60ea('0x2b')],function(_0x111052){return{'name':_0x111052[_0x60ea('0x2c')],'type':_0x111052[_0x60ea('0x2d')]['key']};});_0x47a063[_0x60ea('0x2e')]=_[_0x60ea('0x29')](_0x288cb9,_0x60ea('0x26'));_0x47a063['query']=_[_0x60ea('0x2f')](_0x45fcc5[_0x60ea('0x30')]);_0x47a063[_0x60ea('0x31')]=_['intersection'](_0x47a063['model'],_0x47a063['query']);_0x217d39[_0x60ea('0x32')]=_[_0x60ea('0x33')](_0x47a063[_0x60ea('0x2e')],qs[_0x60ea('0x34')](_0x45fcc5[_0x60ea('0x30')]['fields']));_0x217d39[_0x60ea('0x32')]=_0x217d39[_0x60ea('0x32')][_0x60ea('0x35')]?_0x217d39[_0x60ea('0x32')]:_0x47a063[_0x60ea('0x2e')];if(!_0x45fcc5[_0x60ea('0x30')][_0x60ea('0x36')](_0x60ea('0x37'))){_0x217d39[_0x60ea('0x1d')]=qs[_0x60ea('0x1d')](_0x45fcc5[_0x60ea('0x30')][_0x60ea('0x1d')]);_0x217d39[_0x60ea('0x1b')]=qs[_0x60ea('0x1b')](_0x45fcc5[_0x60ea('0x30')][_0x60ea('0x1b')]);}_0x217d39[_0x60ea('0x38')]=qs[_0x60ea('0x39')](_0x45fcc5[_0x60ea('0x30')][_0x60ea('0x39')]);_0x217d39['where']=qs[_0x60ea('0x31')](_[_0x60ea('0x3a')](_0x45fcc5[_0x60ea('0x30')],_0x47a063[_0x60ea('0x31')]),_0x288cb9);if(_0x45fcc5['query'][_0x60ea('0x3b')]){_0x217d39[_0x60ea('0x3c')]=_[_0x60ea('0x3d')](_0x217d39[_0x60ea('0x3c')],{'$or':_[_0x60ea('0x29')](_0x288cb9,function(_0x31c361){if(_0x31c361[_0x60ea('0x2d')]!==_0x60ea('0x3e')){var _0x3ed666={};_0x3ed666[_0x31c361[_0x60ea('0x26')]]={'$like':'%'+_0x45fcc5[_0x60ea('0x30')][_0x60ea('0x3b')]+'%'};return _0x3ed666;}})});}_0x217d39=_['merge']({},_0x217d39,_0x45fcc5[_0x60ea('0x3f')]);var _0x439ce6={'where':_0x217d39[_0x60ea('0x3c')]};return db[_0x60ea('0x2a')][_0x60ea('0x1e')](_0x439ce6)[_0x60ea('0x23')](function(_0x248d08){_0x27cad2[_0x60ea('0x1e')]=_0x248d08;if(_0x45fcc5['query']['includeAll']){_0x217d39[_0x60ea('0x40')]=[{'all':!![]}];}return db[_0x60ea('0x2a')][_0x60ea('0x41')](_0x217d39);})[_0x60ea('0x23')](function(_0x1d087){_0x27cad2['rows']=_0x1d087;return _0x27cad2;})[_0x60ea('0x23')](respondWithFilteredResult(_0xf7800c,_0x217d39))[_0x60ea('0x42')](handleError(_0xf7800c,null));};exports[_0x60ea('0x43')]=function(_0x5719c0,_0x2391bb){var _0x5e0934={'raw':!![],'where':{'id':_0x5719c0['params']['id']}},_0xae27b8={};_0xae27b8[_0x60ea('0x2e')]=_[_0x60ea('0x2f')](db['VoiceDialReport'][_0x60ea('0x2b')]);_0xae27b8[_0x60ea('0x30')]=_[_0x60ea('0x2f')](_0x5719c0[_0x60ea('0x30')]);_0xae27b8[_0x60ea('0x31')]=_[_0x60ea('0x33')](_0xae27b8[_0x60ea('0x2e')],_0xae27b8['query']);_0x5e0934[_0x60ea('0x32')]=_['intersection'](_0xae27b8[_0x60ea('0x2e')],qs[_0x60ea('0x34')](_0x5719c0[_0x60ea('0x30')][_0x60ea('0x34')]));_0x5e0934[_0x60ea('0x32')]=_0x5e0934['attributes'][_0x60ea('0x35')]?_0x5e0934[_0x60ea('0x32')]:_0xae27b8['model'];if(_0x5719c0['query'][_0x60ea('0x44')]){_0x5e0934[_0x60ea('0x40')]=[{'all':!![]}];}_0x5e0934=_['merge']({},_0x5e0934,_0x5719c0[_0x60ea('0x3f')]);return db['VoiceDialReport'][_0x60ea('0x45')](_0x5e0934)[_0x60ea('0x23')](handleEntityNotFound(_0x2391bb,null))[_0x60ea('0x23')](respondWithResult(_0x2391bb,null))[_0x60ea('0x42')](handleError(_0x2391bb,null));};exports[_0x60ea('0x46')]=function(_0x3a105d,_0x35393c){return db[_0x60ea('0x2a')][_0x60ea('0x46')](_0x3a105d[_0x60ea('0x47')],{})[_0x60ea('0x23')](respondWithResult(_0x35393c,0xc9))[_0x60ea('0x42')](handleError(_0x35393c,null));};exports[_0x60ea('0x48')]=function(_0x326f49,_0x348236){if(_0x326f49[_0x60ea('0x47')]['id']){delete _0x326f49[_0x60ea('0x47')]['id'];}return db[_0x60ea('0x2a')][_0x60ea('0x45')]({'where':{'id':_0x326f49[_0x60ea('0x49')]['id']}})[_0x60ea('0x23')](handleEntityNotFound(_0x348236,null))['then'](saveUpdates(_0x326f49[_0x60ea('0x47')],null))[_0x60ea('0x23')](respondWithResult(_0x348236,null))[_0x60ea('0x42')](handleError(_0x348236,null));};exports[_0x60ea('0x24')]=function(_0x1a119b,_0x1a6326){return db[_0x60ea('0x2a')][_0x60ea('0x45')]({'where':{'id':_0x1a119b['params']['id']}})[_0x60ea('0x23')](handleEntityNotFound(_0x1a6326,null))['then'](removeEntity(_0x1a6326,null))[_0x60ea('0x42')](handleError(_0x1a6326,null));};exports[_0x60ea('0x4a')]=function(_0x35ad51,_0x4d5938){return db['VoiceDialReport'][_0x60ea('0x4a')]()[_0x60ea('0x23')](respondWithResult(_0x4d5938,null))['catch'](handleError(_0x4d5938,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 1544f84..032e5a4 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 _0xab3f=['path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x502121,_0x35c040){var _0x4724d2=function(_0x4c88f3){while(--_0x4c88f3){_0x502121['push'](_0x502121['shift']());}};_0x4724d2(++_0x35c040);}(_0xab3f,0x72));var _0xfab3=function(_0x1d0184,_0x44e7e3){_0x1d0184=_0x1d0184-0x0;var _0x437d85=_0xab3f[_0x1d0184];return _0x437d85;};'use strict';var _=require(_0xfab3('0x0'));var util=require('util');var logger=require(_0xfab3('0x1'))(_0xfab3('0x2'));var moment=require(_0xfab3('0x3'));var BPromise=require(_0xfab3('0x4'));var rp=require(_0xfab3('0x5'));var fs=require('fs');var path=require(_0xfab3('0x6'));var rimraf=require(_0xfab3('0x7'));var config=require(_0xfab3('0x8'));var attributes=require(_0xfab3('0x9'));module[_0xfab3('0xa')]=function(_0x2daeb4,_0x5ed108){return _0x2daeb4[_0xfab3('0xb')](_0xfab3('0xc'),attributes,{'tableName':_0xfab3('0xd'),'paranoid':![],'indexes':[{'fields':[_0xfab3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 96eef55..e83f849 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 _0x7696=['util','moment','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','debug','stringify','VoiceDialReport','update','attributes','limit','UpdateVoiceDialReport','lodash'];(function(_0x278ce1,_0x3f5e6d){var _0x5089cb=function(_0x14983c){while(--_0x14983c){_0x278ce1['push'](_0x278ce1['shift']());}};_0x5089cb(++_0x3f5e6d);}(_0x7696,0xf7));var _0x6769=function(_0x2effef,_0x4f92de){_0x2effef=_0x2effef-0x0;var _0x2d1fe4=_0x7696[_0x2effef];return _0x2d1fe4;};'use strict';var _=require(_0x6769('0x0'));var util=require(_0x6769('0x1'));var moment=require(_0x6769('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6769('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6769('0x4'))(_0x6769('0x5'));var config=require('../../config/environment');var jayson=require(_0x6769('0x6'));var client=jayson[_0x6769('0x7')][_0x6769('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d7cac,_0x2a8a97,_0x1a267e){return new BPromise(function(_0x37b8cb,_0x204113){return client[_0x6769('0x9')](_0x5d7cac,_0x1a267e)[_0x6769('0xa')](function(_0x1e33e3){logger[_0x6769('0xb')](_0x6769('0xc'),_0x2a8a97,'request\x20sent');logger['debug'](_0x6769('0xd'),_0x2a8a97,_0x6769('0xe'),JSON['stringify'](_0x1e33e3));if(_0x1e33e3[_0x6769('0xf')]){if(_0x1e33e3[_0x6769('0xf')][_0x6769('0x10')]===0x1f4){logger[_0x6769('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x2a8a97,_0x1e33e3[_0x6769('0xf')][_0x6769('0x11')]);return _0x204113(_0x1e33e3['error'][_0x6769('0x11')]);}logger[_0x6769('0xf')](_0x6769('0xc'),_0x2a8a97,_0x1e33e3[_0x6769('0xf')][_0x6769('0x11')]);return _0x37b8cb(_0x1e33e3[_0x6769('0xf')][_0x6769('0x11')]);}else{logger['info'](_0x6769('0xc'),_0x2a8a97,'request\x20sent');_0x37b8cb(_0x1e33e3[_0x6769('0x12')][_0x6769('0x11')]);}})[_0x6769('0x13')](function(_0xa4b6c6){logger['error'](_0x6769('0xc'),_0x2a8a97,_0xa4b6c6);_0x204113(_0xa4b6c6);});});}exports[_0x6769('0x14')]=function(_0x1f6732){var _0x52295b=this;return new Promise(function(_0x4d2cab,_0x44ed6d){return db['VoiceDialReport'][_0x6769('0x15')](_0x1f6732[_0x6769('0x16')],{'raw':_0x1f6732['options']?_0x1f6732[_0x6769('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x6769('0xa')](function(_0x32266b){logger[_0x6769('0xb')](_0x6769('0x14'),_0x1f6732);logger[_0x6769('0x18')](_0x6769('0x14'),_0x1f6732,JSON[_0x6769('0x19')](_0x32266b));_0x4d2cab(_0x32266b);})[_0x6769('0x13')](function(_0x5d3207){logger['error'](_0x6769('0x14'),_0x5d3207[_0x6769('0x11')],_0x1f6732);_0x44ed6d(_0x52295b[_0x6769('0xf')](0x1f4,_0x5d3207[_0x6769('0x11')]));});});};exports['UpdateVoiceDialReport']=function(_0x533478){var _0x45b80e=this;return new Promise(function(_0x5c32da,_0xecd77f){return db[_0x6769('0x1a')][_0x6769('0x1b')](_0x533478[_0x6769('0x16')],{'raw':_0x533478['options']?_0x533478['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x533478[_0x6769('0x17')]?_0x533478[_0x6769('0x17')]['where']||null:null,'attributes':_0x533478[_0x6769('0x17')]?_0x533478[_0x6769('0x17')][_0x6769('0x1c')]||null:null,'limit':_0x533478[_0x6769('0x17')]?_0x533478[_0x6769('0x17')][_0x6769('0x1d')]||null:null})['then'](function(_0x24296c){logger['info'](_0x6769('0x1e'),_0x533478);logger[_0x6769('0x18')](_0x6769('0x1e'),_0x533478,JSON[_0x6769('0x19')](_0x24296c));_0x5c32da(_0x24296c);})[_0x6769('0x13')](function(_0x1b13d0){logger[_0x6769('0xf')](_0x6769('0x1e'),_0x1b13d0[_0x6769('0x11')],_0x533478);_0xecd77f(_0x45b80e['error'](0x1f4,_0x1b13d0[_0x6769('0x11')]));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 9416530..aefcfbc 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 _0x0a75=['./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','addApplications','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4b01b7,_0x183b04){var _0x2ed185=function(_0x4a1222){while(--_0x4a1222){_0x4b01b7['push'](_0x4b01b7['shift']());}};_0x2ed185(++_0x183b04);}(_0x0a75,0x1c3));var _0x50a7=function(_0x3e26dc,_0x1b22f1){_0x3e26dc=_0x3e26dc-0x0;var _0x698a9f=_0x0a75[_0x3e26dc];return _0x698a9f;};'use strict';var multer=require(_0x50a7('0x0'));var util=require(_0x50a7('0x1'));var path=require(_0x50a7('0x2'));var timeout=require(_0x50a7('0x3'));var express=require(_0x50a7('0x4'));var router=express[_0x50a7('0x5')]();var fs_extra=require(_0x50a7('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x50a7('0x7'));var config=require(_0x50a7('0x8'));var controller=require(_0x50a7('0x9'));router[_0x50a7('0xa')]('/',auth[_0x50a7('0xb')](),controller[_0x50a7('0xc')]);router[_0x50a7('0xa')](_0x50a7('0xd'),auth['isAuthenticated'](),controller[_0x50a7('0xe')]);router[_0x50a7('0xf')]('/',auth[_0x50a7('0xb')](),controller['create']);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0x50a7('0x10')]);router['put'](_0x50a7('0xd'),auth[_0x50a7('0xb')](),controller[_0x50a7('0x11')]);router[_0x50a7('0x12')]('/:id',auth[_0x50a7('0xb')](),controller[_0x50a7('0x13')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ae27252..b904ffe 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 _0x13fd=['*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system'];(function(_0x4c8976,_0x5784b1){var _0x55ee12=function(_0x1ae260){while(--_0x1ae260){_0x4c8976['push'](_0x4c8976['shift']());}};_0x55ee12(++_0x5784b1);}(_0x13fd,0x114));var _0xd13f=function(_0x49cbbc,_0x4753fa){_0x49cbbc=_0x49cbbc-0x0;var _0x197d3f=_0x13fd[_0x49cbbc];return _0x197d3f;};'use strict';var Sequelize=require(_0xd13f('0x0'));module[_0xd13f('0x1')]={'context':{'type':Sequelize[_0xd13f('0x2')],'allowNull':![],'unique':_0xd13f('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xd13f('0x2')],'allowNull':![],'unique':_0xd13f('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0xd13f('0x3')},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xd13f('0x2')],'allowNull':![],'defaultValue':_0xd13f('0x4')},'appdata':{'type':Sequelize[_0xd13f('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xd13f('0x5')](_0xd13f('0x6'),_0xd13f('0x7'),_0xd13f('0x8'),_0xd13f('0x9'),_0xd13f('0xa'),_0xd13f('0xb'),'any'),'allowNull':![]},'description':{'type':Sequelize[_0xd13f('0x2')]},'interval':{'type':Sequelize[_0xd13f('0x2')],'allowNull':![],'defaultValue':_0xd13f('0xc')},'IntervalId':{'type':Sequelize[_0xd13f('0xd')]},'isApp':{'type':Sequelize[_0xd13f('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xd13f('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xd13f('0xd')]},'recordingFormat':{'type':Sequelize[_0xd13f('0x2')],'defaultValue':_0xd13f('0xf')},'answer':{'type':Sequelize[_0xd13f('0xe')],'defaultValue':!![]},'name':{'type':Sequelize[_0xd13f('0x10')],'get':function(_0x532d7f){return this['getDataValue'](_0xd13f('0x11'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 063e829..f4897f1 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 _0x9fee=['concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','internal','value','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize','VoiceExtensionId','createRouting','log','LOG\x20~\x20.then\x20~\x20routing','findAndCountAll','cast(priority\x20as\x20unsigned)','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','filter','find','type','name','UserProfileResource','destroy','sendStatus','stack','send','index','map','VoiceExtension','rawAttributes','fieldName','query','keys','filters','model','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','intersection','create','startsWith','body','exten'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9fee,0xc5));var _0xe9fe=function(_0xe81132,_0x13fe43){_0xe81132=_0xe81132-0x0;var _0x398024=_0x9fee[_0xe81132];return _0x398024;};'use strict';var _=require('lodash');var Redis=require(_0xe9fe('0x0'));var qs=require(_0xe9fe('0x1'));var logger=require(_0xe9fe('0x2'))('api');var config=require(_0xe9fe('0x3'));var db=require(_0xe9fe('0x4'))['db'];config[_0xe9fe('0x5')]=_['defaults'](config[_0xe9fe('0x5')],{'host':_0xe9fe('0x6'),'port':0x18eb});var socket=require(_0xe9fe('0x7'))(new Redis(config[_0xe9fe('0x5')]));require(_0xe9fe('0x8'))[_0xe9fe('0x9')](socket);function respondWithStatusCode(_0x2cdb7f,_0x5a833a){_0x5a833a=_0x5a833a||0xcc;return function(_0x16dad9){if(_0x16dad9){return _0x2cdb7f['sendStatus'](_0x5a833a);}return _0x2cdb7f[_0xe9fe('0xa')](_0x5a833a)[_0xe9fe('0xb')]();};}function respondWithResult(_0x2cfcfc,_0x5580c7){_0x5580c7=_0x5580c7||0xc8;return function(_0x54975a){if(_0x54975a){return _0x2cfcfc['status'](_0x5580c7)[_0xe9fe('0xc')](_0x54975a);}};}function respondWithFilteredResult(_0x4dafd1,_0x23052f){return function(_0x98eac9){if(_0x98eac9){var _0x1e816b=typeof _0x23052f[_0xe9fe('0xd')]==='undefined'&&typeof _0x23052f[_0xe9fe('0xe')]===_0xe9fe('0xf');var _0x4fe214=_0x98eac9[_0xe9fe('0x10')];var _0x472da9=_0x1e816b?0x0:_0x23052f['offset'];var _0x243271=_0x1e816b?_0x98eac9[_0xe9fe('0x10')]:_0x23052f[_0xe9fe('0xd')]+_0x23052f['limit'];var _0x3f08e7;if(_0x243271>=_0x4fe214){_0x243271=_0x4fe214;_0x3f08e7=0xc8;}else{_0x3f08e7=0xce;}_0x4dafd1[_0xe9fe('0xa')](_0x3f08e7);return _0x4dafd1['set'](_0xe9fe('0x11'),_0x472da9+'-'+_0x243271+'/'+_0x4fe214)['json'](_0x98eac9);}return null;};}function removeEntity(_0x3b74b7){return function(_0x4e35b2){if(_0x4e35b2){return _0x4e35b2['destroy']()[_0xe9fe('0x12')](function(){var _0xc096c4=_0x4e35b2[_0xe9fe('0x13')]({'plain':!![]});var _0x23a6d9=[{'name':_0xe9fe('0x14'),'value':_0xe9fe('0x15'),'ignore':![]},{'name':_0xe9fe('0x16'),'value':'outbound','ignore':![]},{'name':_0xe9fe('0x17'),'value':'internal','ignore':![]}];var _0xadf99c=_(_0x23a6d9)[_0xe9fe('0x18')]('ignore')['map']('value')['value']();if(_['includes'](_0xadf99c,_0xc096c4['type'])){return;}var _0x4d86c4=_[_0xe9fe('0x19')](_0x23a6d9,['value',_0xc096c4[_0xe9fe('0x1a')]])[_0xe9fe('0x1b')];return db[_0xe9fe('0x1c')][_0xe9fe('0x1d')]({'where':{'type':_0x4d86c4,'resourceId':_0xc096c4['id']}})['then'](function(){return _0x4e35b2;});})[_0xe9fe('0x12')](function(){_0x3b74b7[_0xe9fe('0xa')](0xcc)[_0xe9fe('0xb')]();});}};}function handleEntityNotFound(_0x5bda6b){return function(_0xb0f22f){if(!_0xb0f22f){_0x5bda6b[_0xe9fe('0x1e')](0x194);}return _0xb0f22f;};}function handleError(_0x52e49b,_0x47a56a){_0x47a56a=_0x47a56a||0x1f4;return function(_0x2025ae){logger['error'](_0x2025ae[_0xe9fe('0x1f')]);if(_0x2025ae[_0xe9fe('0x1b')]){delete _0x2025ae[_0xe9fe('0x1b')];}_0x52e49b[_0xe9fe('0xa')](_0x47a56a)[_0xe9fe('0x20')](_0x2025ae);};}exports[_0xe9fe('0x21')]=function(_0x50f8dc,_0x4af79d){var _0x4a44fa={},_0x4cfd57={},_0x127f77={'count':0x0,'rows':[]};var _0x3d3a73=_[_0xe9fe('0x22')](db[_0xe9fe('0x23')][_0xe9fe('0x24')],function(_0x363040){return{'name':_0x363040[_0xe9fe('0x25')],'type':_0x363040[_0xe9fe('0x1a')]['key']};});_0x4cfd57['model']=_['map'](_0x3d3a73,'name');_0x4cfd57[_0xe9fe('0x26')]=_[_0xe9fe('0x27')](_0x50f8dc['query']);_0x4cfd57[_0xe9fe('0x28')]=_['intersection'](_0x4cfd57[_0xe9fe('0x29')],_0x4cfd57[_0xe9fe('0x26')]);_0x4a44fa['attributes']=_['intersection'](_0x4cfd57[_0xe9fe('0x29')],qs[_0xe9fe('0x2a')](_0x50f8dc[_0xe9fe('0x26')][_0xe9fe('0x2a')]));_0x4a44fa[_0xe9fe('0x2b')]=_0x4a44fa[_0xe9fe('0x2b')][_0xe9fe('0x2c')]?_0x4a44fa['attributes']:_0x4cfd57[_0xe9fe('0x29')];if(!_0x50f8dc['query']['hasOwnProperty'](_0xe9fe('0x2d'))){_0x4a44fa[_0xe9fe('0xe')]=qs[_0xe9fe('0xe')](_0x50f8dc[_0xe9fe('0x26')]['limit']);_0x4a44fa[_0xe9fe('0xd')]=qs[_0xe9fe('0xd')](_0x50f8dc['query']['offset']);}_0x4a44fa[_0xe9fe('0x2e')]=qs[_0xe9fe('0x2f')](_0x50f8dc[_0xe9fe('0x26')][_0xe9fe('0x2f')]);_0x4a44fa[_0xe9fe('0x30')]=qs[_0xe9fe('0x28')](_[_0xe9fe('0x31')](_0x50f8dc['query'],_0x4cfd57[_0xe9fe('0x28')]),_0x3d3a73);if(_0x50f8dc['query']['filter']){_0x4a44fa[_0xe9fe('0x30')]=_[_0xe9fe('0x32')](_0x4a44fa[_0xe9fe('0x30')],{'$or':_['map'](_0x3d3a73,function(_0x505854){if(_0x505854[_0xe9fe('0x1a')]!==_0xe9fe('0x33')){var _0x3f8d08={};_0x3f8d08[_0x505854[_0xe9fe('0x1b')]]={'$like':'%'+_0x50f8dc[_0xe9fe('0x26')][_0xe9fe('0x18')]+'%'};return _0x3f8d08;}})});}_0x4a44fa=_[_0xe9fe('0x32')]({},_0x4a44fa,_0x50f8dc[_0xe9fe('0x34')]);var _0x28f4c9={'where':_0x4a44fa[_0xe9fe('0x30')]};return db['VoiceExtension'][_0xe9fe('0x10')](_0x28f4c9)[_0xe9fe('0x12')](function(_0x231314){_0x127f77[_0xe9fe('0x10')]=_0x231314;if(_0x50f8dc[_0xe9fe('0x26')][_0xe9fe('0x35')]){_0x4a44fa[_0xe9fe('0x36')]=[{'all':!![]}];}return db[_0xe9fe('0x23')][_0xe9fe('0x37')](_0x4a44fa);})['then'](function(_0x5e819b){_0x127f77['rows']=_0x5e819b;return _0x127f77;})['then'](respondWithFilteredResult(_0x4af79d,_0x4a44fa))[_0xe9fe('0x38')](handleError(_0x4af79d,null));};exports[_0xe9fe('0x39')]=function(_0x1316b2,_0x32dbc7){var _0x2010ad={'raw':![],'where':{'id':_0x1316b2[_0xe9fe('0x3a')]['id']}},_0x33d1ad={};_0x33d1ad['model']=_[_0xe9fe('0x27')](db[_0xe9fe('0x23')]['rawAttributes']);_0x33d1ad[_0xe9fe('0x26')]=_[_0xe9fe('0x27')](_0x1316b2['query']);_0x33d1ad['filters']=_[_0xe9fe('0x3b')](_0x33d1ad[_0xe9fe('0x29')],_0x33d1ad[_0xe9fe('0x26')]);_0x2010ad[_0xe9fe('0x2b')]=_['intersection'](_0x33d1ad['model'],qs[_0xe9fe('0x2a')](_0x1316b2['query'][_0xe9fe('0x2a')]));_0x2010ad[_0xe9fe('0x2b')]=_0x2010ad['attributes'][_0xe9fe('0x2c')]?_0x2010ad['attributes']:_0x33d1ad[_0xe9fe('0x29')];if(_0x1316b2[_0xe9fe('0x26')][_0xe9fe('0x35')]){_0x2010ad['include']=[{'all':!![]}];}_0x2010ad=_['merge']({},_0x2010ad,_0x1316b2[_0xe9fe('0x34')]);return db[_0xe9fe('0x23')][_0xe9fe('0x19')](_0x2010ad)[_0xe9fe('0x12')](handleEntityNotFound(_0x32dbc7,null))[_0xe9fe('0x12')](respondWithResult(_0x32dbc7,null))[_0xe9fe('0x38')](handleError(_0x32dbc7,null));};exports[_0xe9fe('0x1d')]=function(_0x2d38f4,_0x34a3f9){return db[_0xe9fe('0x23')][_0xe9fe('0x19')]({'where':{'id':_0x2d38f4['params']['id']}})['then'](handleEntityNotFound(_0x34a3f9,null))[_0xe9fe('0x12')](removeEntity(_0x34a3f9,null))['catch'](handleError(_0x34a3f9,null));};exports[_0xe9fe('0x3c')]=function(_0x27a07e,_0x5c6af2){if(_0x27a07e['body'][_0xe9fe('0x1a')]==='outbound'&&!_[_0xe9fe('0x3d')](_0x27a07e[_0xe9fe('0x3e')][_0xe9fe('0x3f')],'_')){_0x27a07e[_0xe9fe('0x3e')][_0xe9fe('0x3f')]='_'[_0xe9fe('0x40')](_0x27a07e['body'][_0xe9fe('0x3f')]);}return db[_0xe9fe('0x23')][_0xe9fe('0x3c')](_0x27a07e[_0xe9fe('0x3e')],{'raw':![]})[_0xe9fe('0x12')](function(_0x5d7190){var _0xa1a78c=_0x27a07e['user']['get']({'plain':!![]});if(!_0xa1a78c)throw new Error(_0xe9fe('0x41'));if(_0xa1a78c[_0xe9fe('0x42')]===_0xe9fe('0x43')){var _0x27ffb3=_0x5d7190[_0xe9fe('0x13')]({'plain':!![]});var _0x351a66=[{'name':_0xe9fe('0x14'),'value':'inbound'},{'name':_0xe9fe('0x16'),'value':'outbound'},{'name':'InternalRoutes','value':_0xe9fe('0x44')}];var _0x1844c1=_[_0xe9fe('0x19')](_0x351a66,[_0xe9fe('0x45'),_0x27ffb3[_0xe9fe('0x1a')]])[_0xe9fe('0x1b')];return db[_0xe9fe('0x46')][_0xe9fe('0x19')]({'where':{'name':_0x1844c1,'userProfileId':_0xa1a78c[_0xe9fe('0x47')]},'raw':!![]})[_0xe9fe('0x12')](function(_0xd7e907){if(_0xd7e907&&_0xd7e907[_0xe9fe('0x48')]===0x0){return db[_0xe9fe('0x1c')][_0xe9fe('0x3c')]({'name':_0x27ffb3['name'],'resourceId':_0x27ffb3['id'],'type':_0xd7e907[_0xe9fe('0x1b')],'sectionId':_0xd7e907['id']},{})['then'](function(){return _0x5d7190;});}else{return _0x5d7190;}})['catch'](function(_0x36e3ce){logger['error'](_0xe9fe('0x49'),_0x36e3ce);throw _0x36e3ce;});}return _0x5d7190;})[_0xe9fe('0x12')](respondWithResult(_0x5c6af2,0xc9))[_0xe9fe('0x38')](handleError(_0x5c6af2,null));};exports[_0xe9fe('0x4a')]=function(_0x1833fa,_0xff676c){if(_0x1833fa[_0xe9fe('0x3e')]['id']){delete _0x1833fa['body']['id'];}return db['VoiceExtension'][_0xe9fe('0x19')]({'where':{'id':_0x1833fa[_0xe9fe('0x3a')]['id']}})[_0xe9fe('0x12')](handleEntityNotFound(_0xff676c,null))['then'](function(_0x11a819){if(_0x11a819){return db[_0xe9fe('0x23')]['update'](_['pick'](_0x1833fa[_0xe9fe('0x3e')],[_0xe9fe('0x3f'),_0xe9fe('0x4b'),'description',_0xe9fe('0x4c'),_0xe9fe('0x4d'),_0xe9fe('0x4e'),_0xe9fe('0x4f')]),{'where':{'context':_0x11a819[_0xe9fe('0x4b')],'exten':_0x11a819[_0xe9fe('0x3f')]},'individualHooks':!![]})['then'](function(_0x2e6d4a){return _0x2e6d4a;});}return null;})[_0xe9fe('0x12')](respondWithStatusCode(_0xff676c,null))['catch'](handleError(_0xff676c,null));};exports['addApplications']=function(_0xdb172e,_0x1ba081){return db[_0xe9fe('0x23')]['findOne']({'where':{'id':_0xdb172e[_0xe9fe('0x3a')]['id']}})['then'](function(_0x265a4d){if(_0x265a4d){return db[_0xe9fe('0x50')]['transaction'](function(_0x5e1268){return db['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':_0xdb172e[_0xe9fe('0x3a')]['id']},'transaction':_0x5e1268})[_0xe9fe('0x12')](function(){var _0x23abb0=_[_0xe9fe('0x22')](_0xdb172e[_0xe9fe('0x3e')],function(_0x3e142a){_0x3e142a[_0xe9fe('0x51')]=_0xdb172e[_0xe9fe('0x3a')]['id'];_0x3e142a['isApp']=!![];return _0x3e142a;});return _0x265a4d[_0xe9fe('0x52')](_0x23abb0);})[_0xe9fe('0x12')](function(_0x502f3f){console[_0xe9fe('0x53')](_0xe9fe('0x54'),_0x502f3f);return db[_0xe9fe('0x23')]['bulkCreate'](_0x502f3f,{'transaction':_0x5e1268});});})[_0xe9fe('0x12')](function(){return db[_0xe9fe('0x23')][_0xe9fe('0x55')]({'where':{'isApp':!![],'VoiceExtensionId':_0xdb172e[_0xe9fe('0x3a')]['id']},'order':_0xe9fe('0x56')});});}})[_0xe9fe('0x12')](respondWithResult(_0x1ba081,null))[_0xe9fe('0x38')](handleError(_0x1ba081,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 41b924d..23922c9 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 _0x11a1=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update'];(function(_0x2f0623,_0x25ccb5){var _0x5da218=function(_0x130758){while(--_0x130758){_0x2f0623['push'](_0x2f0623['shift']());}};_0x5da218(++_0x25ccb5);}(_0x11a1,0xae));var _0x111a=function(_0x31cee3,_0x2e7928){_0x31cee3=_0x31cee3-0x0;var _0x813c8f=_0x11a1[_0x31cee3];return _0x813c8f;};'use strict';var EventEmitter=require(_0x111a('0x0'));var VoiceExtension=require(_0x111a('0x1'))['db'][_0x111a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x111a('0x3')](0x0);var events={'afterCreate':_0x111a('0x4'),'afterUpdate':_0x111a('0x5'),'afterDestroy':_0x111a('0x6')};function emitEvent(_0x3b60ca){return function(_0x572785,_0x74f1a,_0x471403){VoiceExtensionEvents[_0x111a('0x7')](_0x3b60ca+':'+_0x572785['id'],_0x572785);VoiceExtensionEvents[_0x111a('0x7')](_0x3b60ca,_0x572785);_0x471403(null);};}for(var e in events){if(events[_0x111a('0x8')](e)){var event=events[e];VoiceExtension[_0x111a('0x9')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 3907ee9..5af5fb6 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 _0x93b6=['GotoIfTime',',${EXTEN},','outboundDial','appdata','priority','last','concat','VoiceExtension','voice_extensions','lodash','./voiceExtension.attributes','type','Set','CDR(type)=','context','exten','NoOp','alias','CDR(routeAlias)=','No\x20alias\x20set','push','inbound','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','split','param','phone','prefix','${EXTEN}','SIP','join','indexOf','replace','U(xcally-mixmonitor-context)','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','tag','toLowerCase','CDR(tag)=','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','length','answer','queue','playback','includes','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice'];(function(_0x22868f,_0x450f48){var _0x97bc75=function(_0x447cb4){while(--_0x447cb4){_0x22868f['push'](_0x22868f['shift']());}};_0x97bc75(++_0x450f48);}(_0x93b6,0x151));var _0x693b=function(_0x52f41a,_0x11ebca){_0x52f41a=_0x52f41a-0x0;var _0x347175=_0x93b6[_0x52f41a];return _0x347175;};'use strict';var _=require(_0x693b('0x0'));var attributes=require(_0x693b('0x1'));module['exports']=function(_0x3c2648){var _0x309e7a=_0x3c2648['models'];function _0x15d406(_0x1a61a8){var _0x243d38=0x2;var _0x203b89=[{'type':_0x1a61a8[_0x693b('0x2')],'app':_0x693b('0x3'),'appdata':_0x693b('0x4')+_0x1a61a8[_0x693b('0x2')],'context':_0x1a61a8[_0x693b('0x5')],'exten':_0x1a61a8[_0x693b('0x6')],'priority':_0x243d38++,'VoiceExtensionId':_0x1a61a8['id']},{'type':_0x1a61a8['type'],'app':_0x1a61a8['alias']?'Set':_0x693b('0x7'),'appdata':_0x1a61a8[_0x693b('0x8')]?_0x693b('0x9')+_0x1a61a8[_0x693b('0x8')]:_0x693b('0xa'),'context':_0x1a61a8[_0x693b('0x5')],'exten':_0x1a61a8[_0x693b('0x6')],'priority':_0x243d38++,'VoiceExtensionId':_0x1a61a8['id']}];if(_0x1a61a8[_0x693b('0x2')]==='inbound'){_0x203b89[_0x693b('0xb')]({'type':_0x693b('0xc'),'app':_0x693b('0x3'),'appdata':'CDR(routeid)='+_0x1a61a8['id'],'context':_0x1a61a8[_0x693b('0x5')],'exten':_0x1a61a8[_0x693b('0x6')],'priority':_0x243d38++,'VoiceExtensionId':_0x1a61a8['id']});}_0x203b89[_0x693b('0xb')]({'type':_0x1a61a8[_0x693b('0x2')],'app':_0x693b('0x3'),'appdata':_0x693b('0xd'),'context':_0x1a61a8[_0x693b('0x5')],'exten':_0x1a61a8['exten'],'priority':_0x243d38++,'VoiceExtensionId':_0x1a61a8['id']},{'type':_0x1a61a8[_0x693b('0x2')],'app':_0x693b('0x3'),'appdata':_0x693b('0xe'),'context':_0x1a61a8[_0x693b('0x5')],'exten':_0x1a61a8[_0x693b('0x6')],'priority':_0x243d38++,'VoiceExtensionId':_0x1a61a8['id']},{'type':_0x1a61a8[_0x693b('0x2')],'app':_0x693b('0x3'),'appdata':_0x693b('0xf'),'context':_0x1a61a8[_0x693b('0x5')],'exten':_0x1a61a8[_0x693b('0x6')],'priority':_0x243d38++,'VoiceExtensionId':_0x1a61a8['id']});return _0x203b89;}function _0x34a178(_0x390e28){var _0x53d9dc=0x2;var _0x38a798=[{'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x693b('0x11'),'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28['exten'],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x390e28[_0x693b('0x8')]?_0x693b('0x3'):'NoOp','appdata':_0x390e28[_0x693b('0x8')]?_0x693b('0x9')+_0x390e28[_0x693b('0x8')]:_0x693b('0xa'),'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':'outbound','app':_0x693b('0x3'),'appdata':_0x693b('0x12')+(_0x390e28[_0x693b('0x13')]?_0x693b('0x14')+_0x390e28[_0x693b('0x13')]+'}':'${EXTEN}'),'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':'outbound','app':_0x693b('0x3'),'appdata':_0x693b('0x15')+_0x390e28['id'],'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28['exten'],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x693b('0x16'),'appdata':_0x693b('0x17')+(_0x53d9dc+0x2)+_0x693b('0x18')+(_0x53d9dc+0x1)+')','context':_0x390e28['context'],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x390e28[_0x693b('0x13')]?_0x693b('0x19')+_0x390e28[_0x693b('0x13')]+'}':_0x693b('0x1a'),'context':_0x390e28['context'],'exten':_0x390e28['exten'],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x693b('0xd'),'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':'Set','appdata':_0x693b('0xe'),'context':_0x390e28['context'],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x693b('0xf'),'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x693b('0x1b')+_0x390e28['id'],'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']}];if(_0x390e28[_0x693b('0x1c')](_0x693b('0x1d'))&&_0x390e28[_0x693b('0x1d')]!==_0x693b('0x1e')){_0x38a798[_0x693b('0xb')]({'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x693b('0x1f'),'context':_0x390e28['context'],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']},{'type':_0x693b('0x10'),'app':_0x693b('0x3'),'appdata':_0x693b('0x20')+_0x390e28[_0x693b('0x1d')]||_0x693b('0x21'),'context':_0x390e28[_0x693b('0x5')],'exten':_0x390e28[_0x693b('0x6')],'priority':_0x53d9dc++,'VoiceExtensionId':_0x390e28['id']});}return _0x38a798;}function _0x3c943f(_0x27d78f,_0x35b1fd){var _0x818af1=[{'name':_0x693b('0x22'),'param':0x0},{'name':_0x693b('0x23'),'param':0x1},{'name':_0x693b('0x24'),'param':0x2},{'name':_0x693b('0x25'),'param':0x3}];var _0x589606={};var _0x1bc7d8=_0x35b1fd[_0x693b('0x26')](',');var _0x46b5b2=[];for(var _0x291e4d=0x0;_0x291e4d<_0x818af1['length'];_0x291e4d++){switch(_0x818af1[_0x291e4d]['name']){case _0x693b('0x22'):_0x589606[_0x693b('0x22')]=_0x1bc7d8[_0x818af1[_0x291e4d][_0x693b('0x27')]]['split']('/')[0x1];_0x589606[_0x693b('0x28')]=_0x1bc7d8[_0x818af1[_0x291e4d][_0x693b('0x27')]][_0x693b('0x26')]('/')[0x2];_0x589606[_0x693b('0x29')]=_0x589606['phone']?_0x589606['phone'][_0x693b('0x26')]('$')[0x0]:undefined;_0x589606['phone']=_0x27d78f[_0x693b('0x13')]?(_0x589606['prefix']||'')+_0x693b('0x14')+_0x27d78f[_0x693b('0x13')]+'}':(_0x589606[_0x693b('0x29')]||'')+_0x693b('0x2a');_0x46b5b2[_0x818af1[_0x291e4d]['param']]=[_0x693b('0x2b'),_0x589606[_0x693b('0x22')],_0x589606[_0x693b('0x28')]][_0x693b('0x2c')]('/');break;case _0x693b('0x24'):_0x589606['options']=_0x1bc7d8[_0x818af1[_0x291e4d]['param']];if(_0x27d78f['recordingFormat']!=='none'){if(_0x589606[_0x693b('0x24')][_0x693b('0x2d')]('U(xcally-mixmonitor-context)')<0x0){_0x589606[_0x693b('0x24')]+='U(xcally-mixmonitor-context)';}}else{_0x589606[_0x693b('0x24')]=_0x589606[_0x693b('0x24')][_0x693b('0x2e')](_0x693b('0x2f'),'');}_0x46b5b2[_0x818af1[_0x291e4d][_0x693b('0x27')]]=_0x589606[_0x693b('0x24')];break;default:_0x46b5b2[_0x818af1[_0x291e4d]['param']]=_0x1bc7d8[_0x818af1[_0x291e4d]['param']];}}return _0x46b5b2[_0x693b('0x2c')](',');}function _0x45b0ef(_0x20e605,_0x5befaa,_0x3b55f2){return new Promise(function(_0x4e86ea,_0x1b1255){var _0xf52989=[];if(_['isEmpty'](_0x5befaa))return _0x4e86ea(_0xf52989);_0x309e7a[_0x693b('0x30')][_0x693b('0x31')]({'attributes':['id',_0x693b('0x32'),'IntervalId'],'raw':!![]})[_0x693b('0x33')](function(_0x46b2df){for(var _0x8484e4=0x0,_0x247e2f=0x0;_0x8484e4<_0x5befaa['length'];_0x8484e4++,_0x247e2f=0x0){var _0x1d9b07=_0x5befaa[_0x8484e4];var _0xedf458=[];var _0x37c1eb=[];delete _0x1d9b07['id'];if(_0x1d9b07['interval']!==_0x693b('0x34')){_0x1d9b07[_0x693b('0x35')]=[_0x1d9b07[_0x693b('0x32')]];}else{_0x1d9b07['intervals']=_0x1d9b07[_0x693b('0x36')]?_['map'](_['filter'](_0x46b2df,{'IntervalId':_0x1d9b07[_0x693b('0x36')]}),_0x693b('0x32')):[];}_0x1d9b07[_0x693b('0x5')]=_0x20e605['context'];_0x1d9b07[_0x693b('0x6')]=_0x20e605[_0x693b('0x6')];if(_0x1d9b07[_0x693b('0x2')])_0x1d9b07[_0x693b('0x2')]=_0x1d9b07['type']['toLowerCase']();if(_0x20e605[_0x693b('0x2')]===_0x693b('0x10')){if(_0x1d9b07[_0x693b('0x1c')](_0x693b('0x37'))&&_0x1d9b07[_0x693b('0x37')]&&_0x1d9b07[_0x693b('0x37')]!=='--'){_0xedf458[_0x693b('0xb')]({'type':_0x1d9b07[_0x693b('0x2')][_0x693b('0x38')](),'app':_0x693b('0x3'),'appdata':_0x693b('0x39')+_0x1d9b07[_0x693b('0x37')],'context':_0x20e605[_0x693b('0x5')],'exten':_0x20e605[_0x693b('0x6')],'priority':_0x1d9b07[_0x693b('0x35')]['length']+_0x3b55f2+_0x247e2f++,'VoiceExtensionId':_0x20e605['id']});}_0xedf458['push']({'type':_0x1d9b07['type'][_0x693b('0x38')](),'app':_0x693b('0x16'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x1d9b07[_0x693b('0x3a')]?_0x693b('0x3b')+_0x1d9b07[_0x693b('0x3a')]+')':_0x693b('0x3c')),'context':_0x20e605[_0x693b('0x5')],'exten':_0x20e605[_0x693b('0x6')],'priority':_0x1d9b07[_0x693b('0x35')][_0x693b('0x3d')]+_0x3b55f2+_0x247e2f++,'VoiceExtensionId':_0x20e605['id']});}else{if(_0x1d9b07[_0x693b('0x1c')](_0x693b('0x3e'))){if([_0x693b('0x3f'),_0x693b('0x40')][_0x693b('0x41')](_0x1d9b07['app'][_0x693b('0x38')]())&&_0x1d9b07[_0x693b('0x42')]!==_0x693b('0x43')){if(_0x1d9b07['answer']){_0xedf458[_0x693b('0xb')]({'type':_0x1d9b07[_0x693b('0x2')][_0x693b('0x38')](),'app':_0x693b('0x16'),'appdata':_0x693b('0x44'),'context':_0x20e605[_0x693b('0x5')],'exten':_0x20e605[_0x693b('0x6')],'priority':_0x1d9b07[_0x693b('0x35')][_0x693b('0x3d')]+_0x3b55f2+_0x247e2f++,'VoiceExtensionId':_0x20e605['id']});_0xedf458['push']({'type':_0x1d9b07[_0x693b('0x2')][_0x693b('0x38')](),'app':'Set','appdata':_0x693b('0x45'),'context':_0x20e605[_0x693b('0x5')],'exten':_0x20e605[_0x693b('0x6')],'priority':_0x1d9b07[_0x693b('0x35')][_0x693b('0x3d')]+_0x3b55f2+_0x247e2f++,'VoiceExtensionId':_0x20e605['id']});}else{_0xedf458['push']({'type':_0x1d9b07[_0x693b('0x2')][_0x693b('0x38')](),'app':_0x693b('0x16'),'appdata':_0x693b('0x46'),'context':_0x20e605[_0x693b('0x5')],'exten':_0x20e605[_0x693b('0x6')],'priority':_0x1d9b07['intervals'][_0x693b('0x3d')]+_0x3b55f2+_0x247e2f++,'VoiceExtensionId':_0x20e605['id']});_0xedf458[_0x693b('0xb')]({'type':_0x1d9b07[_0x693b('0x2')][_0x693b('0x38')](),'app':_0x693b('0x3'),'appdata':_0x693b('0x47'),'context':_0x20e605[_0x693b('0x5')],'exten':_0x20e605['exten'],'priority':_0x1d9b07[_0x693b('0x35')]['length']+_0x3b55f2+_0x247e2f++,'VoiceExtensionId':_0x20e605['id']});}}}}for(var _0x167415=0x0;_0x167415<_0x1d9b07[_0x693b('0x35')][_0x693b('0x3d')];_0x167415++){var _0x38a7f8=_0x3b55f2+_0x1d9b07[_0x693b('0x35')][_0x693b('0x3d')];var _0x251425=_0x167415===_0x1d9b07['intervals']['length']-0x1?_0x3b55f2+_0xedf458['length']+_0x37c1eb[_0x693b('0x3d')]+0x2:_0x3b55f2+_0x167415+0x1;_0xedf458[_0x693b('0x48')](_0x167415,0x0,{'type':_0x20e605['type'],'app':_0x693b('0x49'),'appdata':_0x1d9b07[_0x693b('0x35')][_0x167415]+'?'+_0x20e605[_0x693b('0x5')]+',${EXTEN},'+_0x38a7f8+':'+_0x20e605[_0x693b('0x5')]+_0x693b('0x4a')+_0x251425,'exten':_0x20e605[_0x693b('0x6')],'context':_0x20e605['context'],'priority':_0x3b55f2+_0x167415,'VoiceExtensionId':_0x20e605['id']});}if(_0x1d9b07[_0x693b('0x42')]===_0x693b('0x4b'))_0x1d9b07['appdata']=_0x3c943f(_0x20e605,_0x1d9b07[_0x693b('0x4c')]);_0x1d9b07[_0x693b('0x4d')]=_0xedf458['length']?_[_0x693b('0x4e')](_0xedf458)['priority']+0x1:_0x3b55f2;_0xf52989=_[_0x693b('0x4f')](_0xf52989,_0xedf458,[_0x1d9b07],_0x37c1eb);_0x3b55f2=_[_0x693b('0x4e')](_0xf52989)[_0x693b('0x4d')]+0x1;}return _0x4e86ea(_0xf52989);})['catch'](function(_0x3fe038){_0x1b1255(_0x3fe038);});});}return _0x3c2648['define'](_0x693b('0x50'),attributes,{'tableName':_0x693b('0x51'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xcbc35b){var _0x409dfc=this['get']({'plain':!![]});var _0x1fa3d0=_0x409dfc[_0x693b('0x2')]===_0x693b('0x10')?_0x34a178(_0x409dfc):_0x15d406(_0x409dfc);return _0x45b0ef(_0x409dfc,_0xcbc35b,_['last'](_0x1fa3d0)[_0x693b('0x4d')]+0x1)[_0x693b('0x33')](function(_0x555de4){var _0x2a1b80=_['concat'](_0x1fa3d0,_0x555de4);_0x2a1b80[_0x693b('0xb')]({'type':_0x409dfc[_0x693b('0x2')],'app':'Hangup','exten':_0x409dfc['exten'],'context':_0x409dfc[_0x693b('0x5')],'priority':_[_0x693b('0x4e')](_0x2a1b80)['priority']+0x1,'VoiceExtensionId':_0x409dfc['id']});return _0x2a1b80;});}}});}; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 6f1d3da..3597791 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 _0x644f=['limit','include','map','model','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter','./voiceExtension.socket','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes'];(function(_0x96a185,_0x130b0d){var _0x14dc80=function(_0xbf6d4d){while(--_0xbf6d4d){_0x96a185['push'](_0x96a185['shift']());}};_0x14dc80(++_0x130b0d);}(_0x644f,0x177));var _0xf644=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x644f[_0x5a19fc];return _0x34b413;};'use strict';var _=require('lodash');var util=require(_0xf644('0x0'));var moment=require(_0xf644('0x1'));var BPromise=require(_0xf644('0x2'));var rs=require(_0xf644('0x3'));var fs=require('fs');var Redis=require(_0xf644('0x4'));var db=require(_0xf644('0x5'))['db'];var utils=require(_0xf644('0x6'));var logger=require(_0xf644('0x7'))(_0xf644('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf644('0x9')][_0xf644('0xa')]({'port':0x232a});config[_0xf644('0xb')]=_['defaults'](config[_0xf644('0xb')],{'host':_0xf644('0xc'),'port':0x18eb});var socket=require(_0xf644('0xd'))(new Redis(config[_0xf644('0xb')]));require(_0xf644('0xe'))['register'](socket);function respondWithRpcPromise(_0x35b8e5,_0x21e90a,_0x33a2c2){return new BPromise(function(_0xcd5688,_0x59d974){return client['request'](_0x35b8e5,_0x33a2c2)[_0xf644('0xf')](function(_0x517447){logger['info'](_0xf644('0x10'),_0x21e90a,_0xf644('0x11'));logger[_0xf644('0x12')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x21e90a,_0xf644('0x11'),JSON[_0xf644('0x13')](_0x517447));if(_0x517447[_0xf644('0x14')]){if(_0x517447[_0xf644('0x14')][_0xf644('0x15')]===0x1f4){logger['error']('VoiceExtension,\x20%s,\x20%s',_0x21e90a,_0x517447['error']['message']);return _0x59d974(_0x517447['error'][_0xf644('0x16')]);}logger['error'](_0xf644('0x10'),_0x21e90a,_0x517447[_0xf644('0x14')][_0xf644('0x16')]);return _0xcd5688(_0x517447[_0xf644('0x14')][_0xf644('0x16')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x21e90a,_0xf644('0x11'));_0xcd5688(_0x517447[_0xf644('0x17')][_0xf644('0x16')]);}})[_0xf644('0x18')](function(_0x2b628d){logger[_0xf644('0x14')](_0xf644('0x10'),_0x21e90a,_0x2b628d);_0x59d974(_0x2b628d);});});}exports[_0xf644('0x19')]=function(_0x2c51ef){var _0x1c8c56=this;return new Promise(function(_0x1c5613,_0x567c1d){return db[_0xf644('0x1a')][_0xf644('0x1b')]({'raw':_0x2c51ef[_0xf644('0x1c')]?_0x2c51ef[_0xf644('0x1c')][_0xf644('0x1d')]===undefined?!![]:![]:!![],'where':_0x2c51ef['options']?_0x2c51ef[_0xf644('0x1c')][_0xf644('0x1e')]||null:null,'attributes':_0x2c51ef[_0xf644('0x1c')]?_0x2c51ef[_0xf644('0x1c')][_0xf644('0x1f')]||null:null,'limit':_0x2c51ef['options']?_0x2c51ef[_0xf644('0x1c')][_0xf644('0x20')]||null:null,'include':_0x2c51ef[_0xf644('0x1c')]?_0x2c51ef[_0xf644('0x1c')]['include']?_['map'](_0x2c51ef[_0xf644('0x1c')][_0xf644('0x21')],function(_0x372f30){return{'model':db[_0x372f30['model']],'as':_0x372f30['as'],'attributes':_0x372f30['attributes'],'include':_0x372f30[_0xf644('0x21')]?_[_0xf644('0x22')](_0x372f30[_0xf644('0x21')],function(_0x530a33){return{'model':db[_0x530a33[_0xf644('0x23')]],'as':_0x530a33['as'],'attributes':_0x530a33['attributes'],'include':_0x530a33[_0xf644('0x21')]?_[_0xf644('0x22')](_0x530a33[_0xf644('0x21')],function(_0x295c04){return{'model':db[_0x295c04[_0xf644('0x23')]],'as':_0x295c04['as'],'attributes':_0x295c04['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x44366a){logger[_0xf644('0x24')](_0xf644('0x19'),_0x2c51ef);logger['debug'](_0xf644('0x19'),_0x2c51ef,JSON[_0xf644('0x13')](_0x44366a));_0x1c5613(_0x44366a);})[_0xf644('0x18')](function(_0x42351e){logger[_0xf644('0x14')]('GetVoiceExtension',_0x42351e[_0xf644('0x16')],_0x2c51ef);_0x567c1d(_0x1c8c56[_0xf644('0x14')](0x1f4,_0x42351e[_0xf644('0x16')]));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index dd5c05f..02c7e20 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 _0x5fab=['emit','removeListener','register','length','./voiceExtension.events','save','update'];(function(_0x199bc1,_0x11229f){var _0x3e47e6=function(_0x433a00){while(--_0x433a00){_0x199bc1['push'](_0x199bc1['shift']());}};_0x3e47e6(++_0x11229f);}(_0x5fab,0x177));var _0xb5fa=function(_0x3326c3,_0x14382c){_0x3326c3=_0x3326c3-0x0;var _0x14eb8a=_0x5fab[_0x3326c3];return _0x14eb8a;};'use strict';var VoiceExtensionEvents=require(_0xb5fa('0x0'));var events=[_0xb5fa('0x1'),'remove',_0xb5fa('0x2')];function createListener(_0x2e2a50,_0x3fc227){return function(_0x316ad0){_0x3fc227[_0xb5fa('0x3')](_0x2e2a50,_0x316ad0);};}function removeListener(_0x595d8b,_0x29390a){return function(){VoiceExtensionEvents[_0xb5fa('0x4')](_0x595d8b,_0x29390a);};}exports[_0xb5fa('0x5')]=function(_0x44df89){for(var _0x4a0249=0x0,_0x5d70f6=events[_0xb5fa('0x6')];_0x4a0249<_0x5d70f6;_0x4a0249++){var _0x1aec3e=events[_0x4a0249];var _0x9c7bce=createListener('voiceExtension:'+_0x1aec3e,_0x44df89);VoiceExtensionEvents['on'](_0x1aec3e,_0x9c7bce);}}; \ No newline at end of file +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 diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 00d1ebe..061d1a0 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 _0xeda8=['show','/:id/messages','create','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index'];(function(_0x548f9e,_0x598aa4){var _0x17f609=function(_0x23958b){while(--_0x23958b){_0x548f9e['push'](_0x548f9e['shift']());}};_0x17f609(++_0x598aa4);}(_0xeda8,0x104));var _0x8eda=function(_0x454d04,_0x1905fe){_0x454d04=_0x454d04-0x0;var _0x751c1=_0xeda8[_0x454d04];return _0x751c1;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var fs_extra=require(_0x8eda('0x5'));var auth=require(_0x8eda('0x6'));var interaction=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var controller=require(_0x8eda('0x9'));router[_0x8eda('0xa')]('/',auth[_0x8eda('0xb')](),controller[_0x8eda('0xc')]);router[_0x8eda('0xa')]('/:id',auth[_0x8eda('0xb')](),controller[_0x8eda('0xd')]);router[_0x8eda('0xa')](_0x8eda('0xe'),auth['isAuthenticated'](),controller['getMessages']);router['post']('/',auth['isAuthenticated'](),controller[_0x8eda('0xf')]);router[_0x8eda('0x10')](_0x8eda('0x11'),auth['isAuthenticated'](),controller[_0x8eda('0x12')]);router['delete'](_0x8eda('0x11'),auth[_0x8eda('0xb')](),controller[_0x8eda('0x13')]);module[_0x8eda('0x14')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 83a88ad..6bbfa49 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 _0x06fc=['getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','contest_mailbox','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x201ef5,_0x29c234){var _0x13eaf7=function(_0x1a09d0){while(--_0x1a09d0){_0x201ef5['push'](_0x201ef5['shift']());}};_0x13eaf7(++_0x29c234);}(_0x06fc,0x136));var _0xc06f=function(_0xd86f32,_0x4b6ea8){_0xd86f32=_0xd86f32-0x0;var _0x161aae=_0x06fc[_0xd86f32];return _0x161aae;};'use strict';var Sequelize=require(_0xc06f('0x0'));module[_0xc06f('0x1')]={'customer_id':{'type':Sequelize[_0xc06f('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xc06f('0x3')},'mailbox':{'type':Sequelize[_0xc06f('0x2')],'defaultValue':'','allowNull':![],'unique':_0xc06f('0x3')},'password':{'type':Sequelize[_0xc06f('0x2')]},'fullname':{'type':Sequelize[_0xc06f('0x2')]},'email':{'type':Sequelize[_0xc06f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x332f1f){this['setDataValue']('email',typeof _0x332f1f===_0xc06f('0x4')&&_0x332f1f['trim']()?_0x332f1f[_0xc06f('0x5')]():null);}},'pager':{'type':Sequelize[_0xc06f('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xc06f('0x6')},'attach':{'type':Sequelize[_0xc06f('0x7')](_0xc06f('0x8'),'no'),'defaultValue':_0xc06f('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xc06f('0x7')]('yes','no'),'defaultValue':_0xc06f('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xc06f('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0xc06f('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xc06f('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xc06f('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xc06f('0x7')](_0xc06f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xc06f('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xc06f('0x7')](_0xc06f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xc06f('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xc06f('0x7')](_0xc06f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xc06f('0x7')](_0xc06f('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xc06f('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0xc06f('0xa')},'emailsubject':{'type':Sequelize[_0xc06f('0x2')]},'emailbody':{'type':Sequelize[_0xc06f('0x2')]},'maxsecs':{'type':Sequelize[_0xc06f('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xc06f('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xc06f('0xc')],'get':function(){return this[_0xc06f('0xd')](_0xc06f('0xe'))+_0xc06f('0xf')+this['getDataValue'](_0xc06f('0x10'));}}}; \ No newline at end of file +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 diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 4872f43..a29e98a 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 _0x3f8c=['create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findAndCountAll','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','reject','save','update','then','Voicemails','UserProfileResource','destroy','error','stack','name','index','map','VoiceMail','rawAttributes','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch'];(function(_0x251762,_0x38bdc5){var _0x2bb7fa=function(_0x5b3ba3){while(--_0x5b3ba3){_0x251762['push'](_0x251762['shift']());}};_0x2bb7fa(++_0x38bdc5);}(_0x3f8c,0x104));var _0xc3f8=function(_0x20fc87,_0x4fe03a){_0x20fc87=_0x20fc87-0x0;var _0x52bb14=_0x3f8c[_0x20fc87];return _0x52bb14;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));var _=require(_0xc3f8('0x7'));var squel=require(_0xc3f8('0x8'));var crypto=require(_0xc3f8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc3f8('0xa'));var toCsv=require(_0xc3f8('0x4'));var querystring=require(_0xc3f8('0xb'));var Papa=require(_0xc3f8('0xc'));var Redis=require(_0xc3f8('0xd'));var authService=require(_0xc3f8('0xe'));var qs=require(_0xc3f8('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){var _0x3f196d=_0x2559a4['get']({'plain':!![]});var _0x4569c2=_0xc3f8('0x22');return db[_0xc3f8('0x23')][_0xc3f8('0x24')]({'where':{'type':_0x4569c2,'resourceId':_0x3f196d['id']}})[_0xc3f8('0x21')](function(){return _0x2559a4;});})[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)[_0xc3f8('0x18')]();});}};}function handleEntityNotFound(_0x21b002,_0xbea3b8){return function(_0x22c8e6){if(!_0x22c8e6){_0x21b002[_0xc3f8('0x16')](0x194);}return _0x22c8e6;};}function handleError(_0x238ff5,_0x429fd8){_0x429fd8=_0x429fd8||0x1f4;return function(_0x59e4dd){logger[_0xc3f8('0x25')](_0x59e4dd[_0xc3f8('0x26')]);if(_0x59e4dd[_0xc3f8('0x27')]){delete _0x59e4dd['name'];}_0x238ff5[_0xc3f8('0x17')](_0x429fd8)['send'](_0x59e4dd);};}exports[_0xc3f8('0x28')]=function(_0x32343e,_0x47ab53){var _0x48b32e={},_0x21a225={},_0x25df65={'count':0x0,'rows':[]};var _0xd32b09=_[_0xc3f8('0x29')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')],function(_0x680047){return{'name':_0x680047[_0xc3f8('0x2c')],'type':_0x680047[_0xc3f8('0x2d')][_0xc3f8('0x2e')]};});_0x21a225['model']=_[_0xc3f8('0x29')](_0xd32b09,_0xc3f8('0x27'));_0x21a225[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x32343e[_0xc3f8('0x2f')]);_0x21a225['filters']=_['intersection'](_0x21a225[_0xc3f8('0x31')],_0x21a225[_0xc3f8('0x2f')]);_0x48b32e[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x21a225[_0xc3f8('0x31')],qs['fields'](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x48b32e[_0xc3f8('0x32')]=_0x48b32e['attributes'][_0xc3f8('0x35')]?_0x48b32e[_0xc3f8('0x32')]:_0x21a225[_0xc3f8('0x31')];if(!_0x32343e['query'][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0x48b32e['limit']=qs[_0xc3f8('0x1b')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0x48b32e[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x32343e[_0xc3f8('0x2f')]['offset']);}_0x48b32e[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x39')]);_0x48b32e[_0xc3f8('0x3a')]=qs['filters'](_[_0xc3f8('0x3b')](_0x32343e[_0xc3f8('0x2f')],_0x21a225[_0xc3f8('0x3c')]),_0xd32b09);if(_0x32343e['query'][_0xc3f8('0x3d')]){_0x48b32e[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0x48b32e[_0xc3f8('0x3a')],{'$or':_['map'](_0xd32b09,function(_0x306182){if(_0x306182[_0xc3f8('0x2d')]!==_0xc3f8('0x3f')){var _0x37b104={};_0x37b104[_0x306182['name']]={'$like':'%'+_0x32343e[_0xc3f8('0x2f')]['filter']+'%'};return _0x37b104;}})});}_0x48b32e=_['merge']({},_0x48b32e,_0x32343e[_0xc3f8('0x40')]);var _0x1f3aef={'where':_0x48b32e[_0xc3f8('0x3a')]};return db[_0xc3f8('0x2a')]['count'](_0x1f3aef)['then'](function(_0x361a85){_0x25df65[_0xc3f8('0x1c')]=_0x361a85;if(_0x32343e[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x48b32e[_0xc3f8('0x42')]=[{'all':!![]}];}return db[_0xc3f8('0x2a')][_0xc3f8('0x43')](_0x48b32e);})[_0xc3f8('0x21')](function(_0x13d8dc){_0x25df65[_0xc3f8('0x44')]=_0x13d8dc;return _0x25df65;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x47ab53,_0x48b32e))['catch'](handleError(_0x47ab53,null));};exports[_0xc3f8('0x45')]=function(_0x22e9b3,_0x4b327f){var _0x1aff20={'raw':!![],'where':{'id':_0x22e9b3['params']['id']}},_0x172f1a={};_0x172f1a[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](db[_0xc3f8('0x2a')][_0xc3f8('0x2b')]);_0x172f1a[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x22e9b3[_0xc3f8('0x2f')]);_0x172f1a[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],_0x172f1a[_0xc3f8('0x2f')]);_0x1aff20['attributes']=_[_0xc3f8('0x33')](_0x172f1a[_0xc3f8('0x31')],qs['fields'](_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0x1aff20[_0xc3f8('0x32')]=_0x1aff20[_0xc3f8('0x32')]['length']?_0x1aff20['attributes']:_0x172f1a[_0xc3f8('0x31')];if(_0x22e9b3[_0xc3f8('0x2f')][_0xc3f8('0x41')]){_0x1aff20['include']=[{'all':!![]}];}_0x1aff20=_[_0xc3f8('0x3e')]({},_0x1aff20,_0x22e9b3[_0xc3f8('0x40')]);return db[_0xc3f8('0x2a')][_0xc3f8('0x46')](_0x1aff20)[_0xc3f8('0x21')](handleEntityNotFound(_0x4b327f,null))['then'](respondWithResult(_0x4b327f,null))[_0xc3f8('0x47')](handleError(_0x4b327f,null));};exports[_0xc3f8('0x48')]=function(_0x5961ab,_0x1becae){return db[_0xc3f8('0x2a')][_0xc3f8('0x48')](_0x5961ab[_0xc3f8('0x49')],{})[_0xc3f8('0x21')](function(_0x3045bc){var _0x1ca7c9=_0x5961ab['user'][_0xc3f8('0x4a')]({'plain':!![]});if(!_0x1ca7c9)throw new Error(_0xc3f8('0x4b'));if(_0x1ca7c9['role']===_0xc3f8('0x4c')){var _0x2e9f93=_0x3045bc[_0xc3f8('0x4a')]({'plain':!![]});var _0x33e5c5=_0xc3f8('0x22');return db[_0xc3f8('0x4d')][_0xc3f8('0x46')]({'where':{'name':_0x33e5c5,'userProfileId':_0x1ca7c9['userProfileId']},'raw':!![]})[_0xc3f8('0x21')](function(_0x2c6999){if(_0x2c6999&&_0x2c6999[_0xc3f8('0x4e')]===0x0){return db[_0xc3f8('0x23')][_0xc3f8('0x48')]({'name':_0x2e9f93[_0xc3f8('0x27')],'resourceId':_0x2e9f93['id'],'type':_0x2c6999[_0xc3f8('0x27')],'sectionId':_0x2c6999['id']},{})[_0xc3f8('0x21')](function(){return _0x3045bc;});}else{return _0x3045bc;}})['catch'](function(_0x51249a){logger[_0xc3f8('0x25')](_0xc3f8('0x4f'),_0x51249a);throw _0x51249a;});}return _0x3045bc;})['then'](respondWithResult(_0x1becae,0xc9))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x20')]=function(_0x4b4adb,_0x1b1e13){if(_0x4b4adb[_0xc3f8('0x49')]['id']){delete _0x4b4adb[_0xc3f8('0x49')]['id'];}return db['VoiceMail'][_0xc3f8('0x46')]({'where':{'id':_0x4b4adb['params']['id']}})['then'](handleEntityNotFound(_0x1b1e13,null))[_0xc3f8('0x21')](saveUpdates(_0x4b4adb['body'],null))[_0xc3f8('0x21')](respondWithResult(_0x1b1e13,null))[_0xc3f8('0x47')](handleError(_0x1b1e13,null));};exports[_0xc3f8('0x24')]=function(_0x490f37,_0xcb45c1){return db[_0xc3f8('0x2a')][_0xc3f8('0x46')]({'where':{'id':_0x490f37[_0xc3f8('0x50')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0xcb45c1,null))['then'](removeEntity(_0xcb45c1,null))['catch'](handleError(_0xcb45c1,null));};exports[_0xc3f8('0x51')]=function(_0x326dcc,_0x2f1b68,_0x3a268d){return db[_0xc3f8('0x2a')]['findOne']({'where':{'id':_0x326dcc[_0xc3f8('0x50')]['id']}})['then'](handleEntityNotFound(_0x2f1b68,null))[_0xc3f8('0x21')](function(_0x337029){var _0x163264;var _0xd5d6a7={},_0x5c6f6e={};_0x5c6f6e[_0xc3f8('0x31')]=_['keys'](db['VoiceMailMessage']['rawAttributes']);_0x5c6f6e['query']=_[_0xc3f8('0x30')](_0x326dcc[_0xc3f8('0x2f')]);_0x5c6f6e[_0xc3f8('0x3c')]=_[_0xc3f8('0x33')](_0x5c6f6e[_0xc3f8('0x31')],_0x5c6f6e[_0xc3f8('0x2f')]);_0xd5d6a7[_0xc3f8('0x32')]=_[_0xc3f8('0x33')](_0x5c6f6e['model'],qs[_0xc3f8('0x34')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x34')]));_0xd5d6a7[_0xc3f8('0x32')]=_0xd5d6a7[_0xc3f8('0x32')]['length']?_0xd5d6a7[_0xc3f8('0x32')]:_0x5c6f6e[_0xc3f8('0x31')];if(!_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x36')](_0xc3f8('0x37'))){_0xd5d6a7['limit']=qs[_0xc3f8('0x1b')](_0x326dcc[_0xc3f8('0x2f')][_0xc3f8('0x1b')]);_0xd5d6a7[_0xc3f8('0x1a')]=qs[_0xc3f8('0x1a')](_0x326dcc[_0xc3f8('0x2f')]['offset']);}_0xd5d6a7[_0xc3f8('0x38')]=qs[_0xc3f8('0x39')](_0x326dcc[_0xc3f8('0x2f')]['sort']);_0xd5d6a7[_0xc3f8('0x3a')]=qs[_0xc3f8('0x3c')](_['pick'](_0x326dcc['query'],_0x5c6f6e[_0xc3f8('0x3c')]));if(_0x326dcc[_0xc3f8('0x2f')]['filter']){_0xd5d6a7[_0xc3f8('0x3a')]=_[_0xc3f8('0x3e')](_0xd5d6a7[_0xc3f8('0x3a')],{'$or':_[_0xc3f8('0x29')](_0xd5d6a7[_0xc3f8('0x32')],function(_0x30a23a){var _0x1e62ec={};_0x1e62ec[_0x30a23a]={'$like':'%'+_0x326dcc[_0xc3f8('0x2f')]['filter']+'%'};return _0x1e62ec;})});}_0xd5d6a7['where']=_[_0xc3f8('0x3e')](_0xd5d6a7['where'],{'mailboxuser':_0x337029['mailbox']});_0xd5d6a7=_['merge']({},_0xd5d6a7,_0x326dcc['options']);return db['VoiceMailMessage'][_0xc3f8('0x52')](_0xd5d6a7)[_0xc3f8('0x21')](respondWithFilteredResult(_0x2f1b68,_0xd5d6a7));})[_0xc3f8('0x47')](handleError(_0x2f1b68,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 2fd59c7..9bba004 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 _0x98de=['path','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash','moment','request-promise'];(function(_0x486cea,_0x3ce180){var _0x569236=function(_0x52628c){while(--_0x52628c){_0x486cea['push'](_0x486cea['shift']());}};_0x569236(++_0x3ce180);}(_0x98de,0x17d));var _0xe98d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x98de[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe98d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe98d('0x1'));var BPromise=require('bluebird');var rp=require(_0xe98d('0x2'));var fs=require('fs');var path=require(_0xe98d('0x3'));var rimraf=require('rimraf');var config=require(_0xe98d('0x4'));var attributes=require(_0xe98d('0x5'));module[_0xe98d('0x6')]=function(_0x20faa1,_0x5d5f77){return _0x20faa1['define'](_0xe98d('0x7'),attributes,{'tableName':_0xe98d('0x8'),'paranoid':![],'indexes':[{'name':_0xe98d('0x9'),'fields':[_0xe98d('0xa'),_0xe98d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 31f086c..51b3b78 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 _0x4286=['util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x3a92d6,_0x16cab2){var _0x3219ec=function(_0x3d0212){while(--_0x3d0212){_0x3a92d6['push'](_0x3a92d6['shift']());}};_0x3219ec(++_0x16cab2);}(_0x4286,0x7e));var _0x6428=function(_0x4d7570,_0x24f9e3){_0x4d7570=_0x4d7570-0x0;var _0xa0278=_0x4286[_0x4d7570];return _0xa0278;};'use strict';var _=require('lodash');var util=require(_0x6428('0x0'));var moment=require(_0x6428('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6428('0x2'));var db=require(_0x6428('0x3'))['db'];var utils=require(_0x6428('0x4'));var logger=require('../../config/logger')(_0x6428('0x5'));var config=require(_0x6428('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6428('0x7')][_0x6428('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30eaf9,_0x8761e6,_0x3ff92e){return new BPromise(function(_0x1c03f7,_0x53cc3d){return client[_0x6428('0x9')](_0x30eaf9,_0x3ff92e)[_0x6428('0xa')](function(_0x4f8096){logger[_0x6428('0xb')](_0x6428('0xc'),_0x8761e6,_0x6428('0xd'));logger[_0x6428('0xe')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x8761e6,_0x6428('0xd'),JSON[_0x6428('0xf')](_0x4f8096));if(_0x4f8096[_0x6428('0x10')]){if(_0x4f8096[_0x6428('0x10')][_0x6428('0x11')]===0x1f4){logger[_0x6428('0x10')](_0x6428('0xc'),_0x8761e6,_0x4f8096['error']['message']);return _0x53cc3d(_0x4f8096['error'][_0x6428('0x12')]);}logger[_0x6428('0x10')](_0x6428('0xc'),_0x8761e6,_0x4f8096[_0x6428('0x10')][_0x6428('0x12')]);return _0x1c03f7(_0x4f8096['error'][_0x6428('0x12')]);}else{logger[_0x6428('0xb')](_0x6428('0xc'),_0x8761e6,_0x6428('0xd'));_0x1c03f7(_0x4f8096[_0x6428('0x13')][_0x6428('0x12')]);}})[_0x6428('0x14')](function(_0x518c7e){logger[_0x6428('0x10')]('VoiceMail,\x20%s,\x20%s',_0x8761e6,_0x518c7e);_0x53cc3d(_0x518c7e);});});} \ No newline at end of file +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 diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 76386a5..a8c5a19 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 _0x519c=['./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0xb6bddf,_0x2372c3){var _0x1a7749=function(_0x3e020e){while(--_0x3e020e){_0xb6bddf['push'](_0xb6bddf['shift']());}};_0x1a7749(++_0x2372c3);}(_0x519c,0x1af));var _0xc519=function(_0x103b70,_0x7e019f){_0x103b70=_0x103b70-0x0;var _0x58c1dc=_0x519c[_0x103b70];return _0x58c1dc;};'use strict';var multer=require(_0xc519('0x0'));var util=require(_0xc519('0x1'));var path=require(_0xc519('0x2'));var timeout=require(_0xc519('0x3'));var express=require(_0xc519('0x4'));var router=express[_0xc519('0x5')]();var fs_extra=require(_0xc519('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc519('0x7'));var config=require(_0xc519('0x8'));var controller=require(_0xc519('0x9'));router[_0xc519('0xa')]('/',auth[_0xc519('0xb')](),controller[_0xc519('0xc')]);router[_0xc519('0xa')](_0xc519('0xd'),auth['isAuthenticated'](),controller[_0xc519('0xe')]);router['get'](_0xc519('0xf'),auth[_0xc519('0xb')](),controller[_0xc519('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc519('0x11')]);router['put']('/:id',auth[_0xc519('0xb')](),controller[_0xc519('0x12')]);router['delete']('/:id',auth[_0xc519('0xb')](),controller['destroy']);module[_0xc519('0x13')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 9b1fdd7..ced1181 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 _0x2d9a=['STRING','BLOB','long','TIMESTAMP','sequelize','getDataValue'];(function(_0x2d9795,_0x17b58a){var _0x2d18db=function(_0x4f4fd0){while(--_0x4f4fd0){_0x2d9795['push'](_0x2d9795['shift']());}};_0x2d18db(++_0x17b58a);}(_0x2d9a,0x196));var _0xa2d9=function(_0x45f575,_0x3ae51c){_0x45f575=_0x45f575-0x0;var _0xd8e1a1=_0x2d9a[_0x45f575];return _0xd8e1a1;};'use strict';var Sequelize=require(_0xa2d9('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xdc9d5c){return this[_0xa2d9('0x1')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'context':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'callerid':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'origtime':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'duration':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'recording':{'type':Sequelize[_0xa2d9('0x3')](_0xa2d9('0x4')),'defaultValue':null},'flag':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'msg_id':{'type':Sequelize[_0xa2d9('0x2')],'defaultValue':''},'stamp':{'type':_0xa2d9('0x5'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file +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 diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 0b557d7..c576fbd 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 _0xffe4=['rawAttributes','find','body','download','msg_id','recording','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','VoiceMailMessage','fieldName','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xffe4,0x1e0));var _0x4ffe=function(_0x31866f,_0x44c2cb){_0x31866f=_0x31866f-0x0;var _0x443d09=_0xffe4[_0x31866f];return _0x443d09;};'use strict';var emlformat=require(_0x4ffe('0x0'));var rimraf=require(_0x4ffe('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ffe('0x2'));var rp=require(_0x4ffe('0x3'));var moment=require(_0x4ffe('0x4'));var BPromise=require(_0x4ffe('0x5'));var Mustache=require(_0x4ffe('0x6'));var util=require(_0x4ffe('0x7'));var path=require(_0x4ffe('0x8'));var sox=require('sox');var csv=require(_0x4ffe('0x9'));var ejs=require(_0x4ffe('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4ffe('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4ffe('0x9'));var querystring=require(_0x4ffe('0xc'));var Papa=require(_0x4ffe('0xd'));var Redis=require(_0x4ffe('0xe'));var authService=require(_0x4ffe('0xf'));var qs=require(_0x4ffe('0x10'));var as=require(_0x4ffe('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4ffe('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47f0a1,_0x2a6f8b){_0x2a6f8b=_0x2a6f8b||0xcc;return function(_0x5296c8){if(_0x5296c8){return _0x47f0a1['sendStatus'](_0x2a6f8b);}return _0x47f0a1[_0x4ffe('0x13')](_0x2a6f8b)[_0x4ffe('0x14')]();};}function respondWithResult(_0x3f6db5,_0xbd756a){_0xbd756a=_0xbd756a||0xc8;return function(_0x57c849){if(_0x57c849){return _0x3f6db5[_0x4ffe('0x13')](_0xbd756a)[_0x4ffe('0x15')](_0x57c849);}};}function respondWithFilteredResult(_0x50cc15,_0x22a580){return function(_0x5b461e){if(_0x5b461e){var _0x1ee480=typeof _0x22a580[_0x4ffe('0x16')]===_0x4ffe('0x17')&&typeof _0x22a580[_0x4ffe('0x18')]==='undefined';var _0x34c026=_0x5b461e[_0x4ffe('0x19')];var _0x5829c6=_0x1ee480?0x0:_0x22a580[_0x4ffe('0x16')];var _0x37f7c0=_0x1ee480?_0x5b461e[_0x4ffe('0x19')]:_0x22a580['offset']+_0x22a580['limit'];var _0x374479;if(_0x37f7c0>=_0x34c026){_0x37f7c0=_0x34c026;_0x374479=0xc8;}else{_0x374479=0xce;}_0x50cc15[_0x4ffe('0x13')](_0x374479);return _0x50cc15[_0x4ffe('0x1a')](_0x4ffe('0x1b'),_0x5829c6+'-'+_0x37f7c0+'/'+_0x34c026)[_0x4ffe('0x15')](_0x5b461e);}return null;};}function patchUpdates(_0x5bbfb2){return function(_0x4c7c1e){try{jsonpatch[_0x4ffe('0x1c')](_0x4c7c1e,_0x5bbfb2,!![]);}catch(_0x1146ce){return BPromise[_0x4ffe('0x1d')](_0x1146ce);}return _0x4c7c1e['save']();};}function saveUpdates(_0x4384ca,_0x3a0e9b){return function(_0x2432ed){if(_0x2432ed){return _0x2432ed[_0x4ffe('0x1e')](_0x4384ca)[_0x4ffe('0x1f')](function(_0x425737){return _0x425737;});}return null;};}function removeEntity(_0x425bdd,_0x14c0b2){return function(_0x951f3c){if(_0x951f3c){return _0x951f3c[_0x4ffe('0x20')]()['then'](function(){_0x425bdd[_0x4ffe('0x13')](0xcc)[_0x4ffe('0x14')]();});}};}function handleEntityNotFound(_0x3b0e96,_0x17078c){return function(_0x50bad5){if(!_0x50bad5){_0x3b0e96[_0x4ffe('0x21')](0x194);}return _0x50bad5;};}function handleError(_0x1ef643,_0x417992){_0x417992=_0x417992||0x1f4;return function(_0x40c3a1){logger['error'](_0x40c3a1[_0x4ffe('0x22')]);if(_0x40c3a1['name']){delete _0x40c3a1[_0x4ffe('0x23')];}_0x1ef643[_0x4ffe('0x13')](_0x417992)[_0x4ffe('0x24')](_0x40c3a1);};}exports['index']=function(_0x2767b6,_0x46856f){var _0x551b21={},_0x4264f9={},_0x4aaf2b={'count':0x0,'rows':[]};var _0x372a0e=_[_0x4ffe('0x25')](db[_0x4ffe('0x26')]['rawAttributes'],function(_0x1bd4fb){return{'name':_0x1bd4fb[_0x4ffe('0x27')],'type':_0x1bd4fb['type'][_0x4ffe('0x28')]};});_0x4264f9['model']=_['differenceBy'](_[_0x4ffe('0x25')](_0x372a0e,'name'),['name']);_0x4264f9['query']=_[_0x4ffe('0x29')](_0x2767b6[_0x4ffe('0x2a')]);_0x4264f9[_0x4ffe('0x2b')]=_[_0x4ffe('0x2c')](_0x4264f9[_0x4ffe('0x2d')],_0x4264f9[_0x4ffe('0x2a')]);_0x551b21['attributes']=_[_0x4ffe('0x2c')](_0x4264f9[_0x4ffe('0x2d')],qs[_0x4ffe('0x2e')](_0x2767b6[_0x4ffe('0x2a')]['fields']));_0x551b21['attributes']=_0x551b21[_0x4ffe('0x2f')][_0x4ffe('0x30')]?_0x551b21['attributes']:_0x4264f9[_0x4ffe('0x2d')];if(!_0x2767b6['query'][_0x4ffe('0x31')](_0x4ffe('0x32'))){_0x551b21[_0x4ffe('0x18')]=qs[_0x4ffe('0x18')](_0x2767b6['query']['limit']);_0x551b21[_0x4ffe('0x16')]=qs['offset'](_0x2767b6[_0x4ffe('0x2a')][_0x4ffe('0x16')]);}_0x551b21[_0x4ffe('0x33')]=qs[_0x4ffe('0x34')](_0x2767b6[_0x4ffe('0x2a')][_0x4ffe('0x34')]);_0x551b21[_0x4ffe('0x35')]=qs[_0x4ffe('0x2b')](_[_0x4ffe('0x36')](_0x2767b6[_0x4ffe('0x2a')],_0x4264f9['filters']),_0x372a0e);if(_0x2767b6['query'][_0x4ffe('0x37')]){_0x551b21['where']=_[_0x4ffe('0x38')](_0x551b21[_0x4ffe('0x35')],{'$or':_[_0x4ffe('0x25')](_0x372a0e,function(_0x268e14){if(_0x268e14[_0x4ffe('0x39')]!==_0x4ffe('0x3a')){var _0x1e4257={};_0x1e4257[_0x268e14[_0x4ffe('0x23')]]={'$like':'%'+_0x2767b6[_0x4ffe('0x2a')][_0x4ffe('0x37')]+'%'};return _0x1e4257;}})});}_0x551b21=_['merge']({},_0x551b21,_0x2767b6[_0x4ffe('0x3b')]);var _0x839d24={'where':_0x551b21[_0x4ffe('0x35')]};return db[_0x4ffe('0x26')]['count'](_0x839d24)['then'](function(_0x10cd7d){_0x4aaf2b['count']=_0x10cd7d;if(_0x2767b6[_0x4ffe('0x2a')][_0x4ffe('0x3c')]){_0x551b21[_0x4ffe('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x551b21);})[_0x4ffe('0x1f')](function(_0x586326){_0x4aaf2b[_0x4ffe('0x3e')]=_0x586326;return _0x4aaf2b;})[_0x4ffe('0x1f')](respondWithFilteredResult(_0x46856f,_0x551b21))[_0x4ffe('0x3f')](handleError(_0x46856f,null));};exports[_0x4ffe('0x40')]=function(_0x5b1f98,_0x1dcde5){var _0x2335ab={'raw':!![],'where':{'id':_0x5b1f98[_0x4ffe('0x41')]['id']}},_0x49b007={};_0x49b007[_0x4ffe('0x2d')]=_[_0x4ffe('0x29')](db[_0x4ffe('0x26')][_0x4ffe('0x42')]);_0x49b007[_0x4ffe('0x2a')]=_['keys'](_0x5b1f98[_0x4ffe('0x2a')]);_0x49b007[_0x4ffe('0x2b')]=_[_0x4ffe('0x2c')](_0x49b007['model'],_0x49b007[_0x4ffe('0x2a')]);_0x2335ab[_0x4ffe('0x2f')]=_[_0x4ffe('0x2c')](_0x49b007[_0x4ffe('0x2d')],qs[_0x4ffe('0x2e')](_0x5b1f98[_0x4ffe('0x2a')][_0x4ffe('0x2e')]));_0x2335ab[_0x4ffe('0x2f')]=_0x2335ab[_0x4ffe('0x2f')]['length']?_0x2335ab['attributes']:_0x49b007['model'];if(_0x5b1f98[_0x4ffe('0x2a')][_0x4ffe('0x3c')]){_0x2335ab[_0x4ffe('0x3d')]=[{'all':!![]}];}_0x2335ab=_[_0x4ffe('0x38')]({},_0x2335ab,_0x5b1f98['options']);return db[_0x4ffe('0x26')][_0x4ffe('0x43')](_0x2335ab)[_0x4ffe('0x1f')](handleEntityNotFound(_0x1dcde5,null))[_0x4ffe('0x1f')](respondWithResult(_0x1dcde5,null))[_0x4ffe('0x3f')](handleError(_0x1dcde5,null));};exports['create']=function(_0x372e47,_0x23626d){return db[_0x4ffe('0x26')]['create'](_0x372e47[_0x4ffe('0x44')],{})['then'](respondWithResult(_0x23626d,0xc9))[_0x4ffe('0x3f')](handleError(_0x23626d,null));};exports[_0x4ffe('0x1e')]=function(_0x2f586a,_0x29a940){if(_0x2f586a[_0x4ffe('0x44')]['id']){delete _0x2f586a[_0x4ffe('0x44')]['id'];}return db['VoiceMailMessage'][_0x4ffe('0x43')]({'where':{'id':_0x2f586a[_0x4ffe('0x41')]['id']}})[_0x4ffe('0x1f')](handleEntityNotFound(_0x29a940,null))[_0x4ffe('0x1f')](saveUpdates(_0x2f586a[_0x4ffe('0x44')],null))[_0x4ffe('0x1f')](respondWithResult(_0x29a940,null))[_0x4ffe('0x3f')](handleError(_0x29a940,null));};exports['destroy']=function(_0x5753d0,_0x1c78d8){return db['VoiceMailMessage'][_0x4ffe('0x43')]({'where':{'id':_0x5753d0[_0x4ffe('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c78d8,null))[_0x4ffe('0x1f')](removeEntity(_0x1c78d8,null))[_0x4ffe('0x3f')](handleError(_0x1c78d8,null));};exports[_0x4ffe('0x45')]=function(_0x4e05d6,_0x3497d7,_0x15f545){return db[_0x4ffe('0x26')][_0x4ffe('0x43')]({'where':{'id':_0x4e05d6[_0x4ffe('0x41')]['id']},'attributes':['id','recording',_0x4ffe('0x46')]})[_0x4ffe('0x1f')](handleEntityNotFound(_0x3497d7,null))[_0x4ffe('0x1f')](function(_0x2158b0){if(_0x2158b0){if(!_0x2158b0[_0x4ffe('0x47')]){throw new db['Sequelize'][(_0x4ffe('0x48'))](_0x4ffe('0x49'));}var _0x33a0b8={'Content-Type':'audio/wav','Content-Disposition':_0x4ffe('0x4a')};if(_0x2158b0[_0x4ffe('0x46')]){_0x33a0b8[_0x4ffe('0x4b')]=_0x4ffe('0x4c')+_0x2158b0['msg_id']+_0x4ffe('0x4d');}_0x3497d7[_0x4ffe('0x1a')](_0x33a0b8);return _0x3497d7[_0x4ffe('0x24')](new Buffer(_0x2158b0[_0x4ffe('0x47')]));}})['catch'](handleError(_0x3497d7,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index a9b705b..7c21fc2 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 _0x531f=['request-promise','path','../../config/environment','./voiceMailMessage.attributes','define','VoiceMailMessage','voice_voicemail_messages','dir','../../config/logger','api','bluebird'];(function(_0x35d0fe,_0x24962a){var _0x298901=function(_0x26648b){while(--_0x26648b){_0x35d0fe['push'](_0x35d0fe['shift']());}};_0x298901(++_0x24962a);}(_0x531f,0xd9));var _0xf531=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x531f[_0x46ae5a];return _0x434986;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf531('0x0'))(_0xf531('0x1'));var moment=require('moment');var BPromise=require(_0xf531('0x2'));var rp=require(_0xf531('0x3'));var fs=require('fs');var path=require(_0xf531('0x4'));var rimraf=require('rimraf');var config=require(_0xf531('0x5'));var attributes=require(_0xf531('0x6'));module['exports']=function(_0x191f9a,_0x4fc39d){return _0x191f9a[_0xf531('0x7')](_0xf531('0x8'),attributes,{'tableName':_0xf531('0x9'),'paranoid':![],'indexes':[{'name':_0xf531('0xa'),'fields':[_0xf531('0xa')]}],'timestamps':![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 3378190..d65de82 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 _0xb702=['VoiceMailMessage,\x20%s,\x20%s','info','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','message'];(function(_0xce3d93,_0x504f1c){var _0x16bcf8=function(_0xff82f3){while(--_0xff82f3){_0xce3d93['push'](_0xce3d93['shift']());}};_0x16bcf8(++_0x504f1c);}(_0xb702,0x169));var _0x2b70=function(_0x39106e,_0x586f3d){_0x39106e=_0x39106e-0x0;var _0x892aec=_0xb702[_0x39106e];return _0x892aec;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2b70('0x0'));var BPromise=require(_0x2b70('0x1'));var rs=require(_0x2b70('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2b70('0x3'))['db'];var utils=require(_0x2b70('0x4'));var logger=require(_0x2b70('0x5'))('rpc');var config=require(_0x2b70('0x6'));var jayson=require(_0x2b70('0x7'));var client=jayson[_0x2b70('0x8')][_0x2b70('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33e0bb,_0x5b4a4f,_0x49f7d6){return new BPromise(function(_0x1e41bf,_0x2ac40c){return client[_0x2b70('0xa')](_0x33e0bb,_0x49f7d6)[_0x2b70('0xb')](function(_0xba732e){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x5b4a4f,_0x2b70('0xc'));logger[_0x2b70('0xd')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x5b4a4f,'request\x20sent',JSON[_0x2b70('0xe')](_0xba732e));if(_0xba732e[_0x2b70('0xf')]){if(_0xba732e[_0x2b70('0xf')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x5b4a4f,_0xba732e[_0x2b70('0xf')][_0x2b70('0x10')]);return _0x2ac40c(_0xba732e[_0x2b70('0xf')]['message']);}logger[_0x2b70('0xf')](_0x2b70('0x11'),_0x5b4a4f,_0xba732e[_0x2b70('0xf')][_0x2b70('0x10')]);return _0x1e41bf(_0xba732e[_0x2b70('0xf')][_0x2b70('0x10')]);}else{logger[_0x2b70('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x5b4a4f,_0x2b70('0xc'));_0x1e41bf(_0xba732e[_0x2b70('0x13')][_0x2b70('0x10')]);}})[_0x2b70('0x14')](function(_0x1308b3){logger[_0x2b70('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x5b4a4f,_0x1308b3);_0x2ac40c(_0x1308b3);});});} \ No newline at end of file +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 diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index c94bdb7..0292dce 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 _0xaca7=['../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','/:id','show','/:id/sounds','getSounds','create','addSound','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0xaca7,0x170));var _0x7aca=function(_0x8ee663,_0x4024b9){_0x8ee663=_0x8ee663-0x0;var _0x495f20=_0xaca7[_0x8ee663];return _0x495f20;};'use strict';var multer=require(_0x7aca('0x0'));var util=require(_0x7aca('0x1'));var path=require(_0x7aca('0x2'));var timeout=require('connect-timeout');var express=require(_0x7aca('0x3'));var router=express[_0x7aca('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7aca('0x5'));var interaction=require(_0x7aca('0x6'));var config=require(_0x7aca('0x7'));var controller=require(_0x7aca('0x8'));router['get']('/',auth[_0x7aca('0x9')](),controller[_0x7aca('0xa')]);router[_0x7aca('0xb')](_0x7aca('0xc'),auth[_0x7aca('0x9')](),controller[_0x7aca('0xd')]);router['get'](_0x7aca('0xe'),auth[_0x7aca('0x9')](),controller[_0x7aca('0xf')]);router['post']('/',auth[_0x7aca('0x9')](),controller[_0x7aca('0x10')]);router['post'](_0x7aca('0xe'),auth[_0x7aca('0x9')](),controller[_0x7aca('0x11')]);router[_0x7aca('0x12')](_0x7aca('0xc'),auth[_0x7aca('0x9')](),controller['update']);router[_0x7aca('0x13')](_0x7aca('0xc'),auth[_0x7aca('0x9')](),controller[_0x7aca('0x14')]);router['delete']('/:id/sounds/:id2',auth[_0x7aca('0x9')](),controller['removeSound']);module[_0x7aca('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 37c5b72..20eb673 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 _0x659c=['mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','mp3nb','quietmp3nb'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x659c,0x1d8));var _0xc659=function(_0x302a64,_0x191bf6){_0x302a64=_0x302a64-0x0;var _0xc4c71e=_0x659c[_0x302a64];return _0xc4c71e;};'use strict';var Sequelize=require(_0xc659('0x0'));module[_0xc659('0x1')]={'name':{'type':Sequelize[_0xc659('0x2')],'allowNull':![],'unique':_0xc659('0x3')},'mode':{'type':Sequelize[_0xc659('0x4')](_0xc659('0x5'),_0xc659('0x6'),_0xc659('0x7'),_0xc659('0x8'),'quietmp3',_0xc659('0x9')),'allowNull':!![],'defaultValue':_0xc659('0x6')},'directory':{'type':Sequelize[_0xc659('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xc659('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xc659('0x2')],'allowNull':!![],'defaultValue':_0xc659('0xa')},'format':{'type':Sequelize[_0xc659('0x2')],'allowNull':!![]},'stamp':{'type':_0xc659('0xb')},'defaultEntry':{'type':Sequelize[_0xc659('0xc')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 278602e..c07d56e 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 _0x13a7=['fs-extra','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','end','stack','name','map','VoiceMusicOnHold','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','symlinkSync','message','removeSound','id2','getSounds','rawAttributes','pick','options','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs'];(function(_0x2edfb6,_0x739fa8){var _0x6cb535=function(_0x42adb2){while(--_0x42adb2){_0x2edfb6['push'](_0x2edfb6['shift']());}};_0x6cb535(++_0x739fa8);}(_0x13a7,0xd8));var _0x713a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x13a7[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x713a('0x0'));var rimraf=require(_0x713a('0x1'));var zipdir=require(_0x713a('0x2'));var jsonpatch=require(_0x713a('0x3'));var rp=require(_0x713a('0x4'));var moment=require('moment');var BPromise=require(_0x713a('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x713a('0x6'));var sox=require(_0x713a('0x7'));var csv=require(_0x713a('0x8'));var ejs=require(_0x713a('0x9'));var fs=require('fs');var fs_extra=require(_0x713a('0xa'));var _=require(_0x713a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x713a('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x713a('0xd'));var Redis=require('ioredis');var authService=require(_0x713a('0xe'));var qs=require(_0x713a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x713a('0x10'));var logger=require(_0x713a('0x11'))(_0x713a('0x12'));var utils=require(_0x713a('0x13'));var config=require(_0x713a('0x14'));var licenseUtil=require(_0x713a('0x15'));var db=require(_0x713a('0x16'))['db'];function respondWithStatusCode(_0x4c9de4,_0x242350){_0x242350=_0x242350||0xcc;return function(_0x35d381){if(_0x35d381){return _0x4c9de4[_0x713a('0x17')](_0x242350);}return _0x4c9de4[_0x713a('0x18')](_0x242350)['end']();};}function respondWithResult(_0x4e6f1f,_0x4bc620){_0x4bc620=_0x4bc620||0xc8;return function(_0x410af8){if(_0x410af8){return _0x4e6f1f['status'](_0x4bc620)['json'](_0x410af8);}};}function respondWithFilteredResult(_0x2f1a4f,_0x43bc51){return function(_0x3fe16a){if(_0x3fe16a){var _0x5545f1=typeof _0x43bc51['offset']==='undefined'&&typeof _0x43bc51[_0x713a('0x19')]===_0x713a('0x1a');var _0x365be5=_0x3fe16a['count'];var _0x4b9951=_0x5545f1?0x0:_0x43bc51['offset'];var _0x37bd67=_0x5545f1?_0x3fe16a[_0x713a('0x1b')]:_0x43bc51[_0x713a('0x1c')]+_0x43bc51['limit'];var _0x517743;if(_0x37bd67>=_0x365be5){_0x37bd67=_0x365be5;_0x517743=0xc8;}else{_0x517743=0xce;}_0x2f1a4f[_0x713a('0x18')](_0x517743);return _0x2f1a4f[_0x713a('0x1d')](_0x713a('0x1e'),_0x4b9951+'-'+_0x37bd67+'/'+_0x365be5)[_0x713a('0x1f')](_0x3fe16a);}return null;};}function patchUpdates(_0x10b70e){return function(_0x5941ec){try{jsonpatch[_0x713a('0x20')](_0x5941ec,_0x10b70e,!![]);}catch(_0x3c25bb){return BPromise[_0x713a('0x21')](_0x3c25bb);}return _0x5941ec[_0x713a('0x22')]();};}function saveUpdates(_0x55c04d,_0x571c1f){return function(_0x377aa6){if(_0x377aa6){return _0x377aa6[_0x713a('0x23')](_0x55c04d)[_0x713a('0x24')](function(_0xc7a141){return _0xc7a141;});}return null;};}function removeEntity(_0x3bdba0,_0x409060){return function(_0x589728){if(_0x589728){return _0x589728[_0x713a('0x25')]()[_0x713a('0x24')](function(){var _0x2abcb1=_0x589728['get']({'plain':!![]});var _0x3d4432=_0x713a('0x26');return db[_0x713a('0x27')][_0x713a('0x25')]({'where':{'type':_0x3d4432,'resourceId':_0x2abcb1['id']}})[_0x713a('0x24')](function(){return _0x589728;});})[_0x713a('0x24')](function(){_0x3bdba0['status'](0xcc)[_0x713a('0x28')]();});}};}function handleEntityNotFound(_0x4970aa,_0x591cde){return function(_0x503935){if(!_0x503935){_0x4970aa[_0x713a('0x17')](0x194);}return _0x503935;};}function handleError(_0x5753b6,_0x24b2b6){_0x24b2b6=_0x24b2b6||0x1f4;return function(_0x36c4a3){logger['error'](_0x36c4a3[_0x713a('0x29')]);if(_0x36c4a3[_0x713a('0x2a')]){delete _0x36c4a3[_0x713a('0x2a')];}_0x5753b6[_0x713a('0x18')](_0x24b2b6)['send'](_0x36c4a3);};}exports['index']=function(_0x307c2b,_0x961c4e){var _0x1e2332={},_0x5c1c71={},_0x3236a4={'count':0x0,'rows':[]};var _0x3ed0cf=_[_0x713a('0x2b')](db[_0x713a('0x2c')]['rawAttributes'],function(_0x2cafff){return{'name':_0x2cafff[_0x713a('0x2d')],'type':_0x2cafff[_0x713a('0x2e')][_0x713a('0x2f')]};});_0x5c1c71['model']=_[_0x713a('0x2b')](_0x3ed0cf,_0x713a('0x2a'));_0x5c1c71['query']=_['keys'](_0x307c2b[_0x713a('0x30')]);_0x5c1c71[_0x713a('0x31')]=_[_0x713a('0x32')](_0x5c1c71[_0x713a('0x33')],_0x5c1c71[_0x713a('0x30')]);_0x1e2332[_0x713a('0x34')]=_[_0x713a('0x32')](_0x5c1c71[_0x713a('0x33')],qs[_0x713a('0x35')](_0x307c2b[_0x713a('0x30')][_0x713a('0x35')]));_0x1e2332[_0x713a('0x34')]=_0x1e2332['attributes'][_0x713a('0x36')]?_0x1e2332[_0x713a('0x34')]:_0x5c1c71[_0x713a('0x33')];if(!_0x307c2b[_0x713a('0x30')][_0x713a('0x37')]('nolimit')){_0x1e2332['limit']=qs['limit'](_0x307c2b[_0x713a('0x30')]['limit']);_0x1e2332[_0x713a('0x1c')]=qs[_0x713a('0x1c')](_0x307c2b[_0x713a('0x30')][_0x713a('0x1c')]);}_0x1e2332[_0x713a('0x38')]=qs['sort'](_0x307c2b[_0x713a('0x30')][_0x713a('0x39')]);delete _0x307c2b[_0x713a('0x30')]['sort'];_0x1e2332[_0x713a('0x3a')]=qs[_0x713a('0x31')](_['pick'](_0x307c2b[_0x713a('0x30')],_0x5c1c71[_0x713a('0x31')]),_0x3ed0cf);if(_0x307c2b[_0x713a('0x30')][_0x713a('0x3b')]){_0x1e2332['where']=_[_0x713a('0x3c')](_0x1e2332[_0x713a('0x3a')],{'$or':_[_0x713a('0x2b')](_0x3ed0cf,function(_0x21a501){if(_0x21a501[_0x713a('0x2e')]!==_0x713a('0x3d')){var _0x22e2f9={};_0x22e2f9[_0x21a501[_0x713a('0x2a')]]={'$like':'%'+_0x307c2b[_0x713a('0x30')]['filter']+'%'};return _0x22e2f9;}})});}_0x1e2332=_[_0x713a('0x3c')]({},_0x1e2332,_0x307c2b['options']);var _0x32964e={'where':_0x1e2332['where']};return db[_0x713a('0x2c')]['count'](_0x32964e)[_0x713a('0x24')](function(_0xc3b4c6){_0x3236a4[_0x713a('0x1b')]=_0xc3b4c6;if(_0x307c2b[_0x713a('0x30')][_0x713a('0x3e')]){_0x1e2332[_0x713a('0x3f')]=[{'all':!![]}];}return db[_0x713a('0x2c')][_0x713a('0x40')](_0x1e2332);})[_0x713a('0x24')](function(_0x3da1d3){_0x3236a4[_0x713a('0x41')]=_0x3da1d3;return _0x3236a4;})[_0x713a('0x24')](respondWithFilteredResult(_0x961c4e,_0x1e2332))[_0x713a('0x42')](handleError(_0x961c4e,null));};exports[_0x713a('0x43')]=function(_0x9c1707,_0x4a66d2){var _0xae7f4e={'raw':![],'where':{'id':_0x9c1707[_0x713a('0x44')]['id']}},_0x5bdc9c={};_0x5bdc9c['model']=_['keys'](db[_0x713a('0x2c')]['rawAttributes']);_0x5bdc9c[_0x713a('0x30')]=_[_0x713a('0x45')](_0x9c1707[_0x713a('0x30')]);_0x5bdc9c['filters']=_[_0x713a('0x32')](_0x5bdc9c['model'],_0x5bdc9c['query']);_0xae7f4e['attributes']=_[_0x713a('0x32')](_0x5bdc9c[_0x713a('0x33')],qs['fields'](_0x9c1707[_0x713a('0x30')][_0x713a('0x35')]));_0xae7f4e[_0x713a('0x34')]=_0xae7f4e[_0x713a('0x34')][_0x713a('0x36')]?_0xae7f4e[_0x713a('0x34')]:_0x5bdc9c['model'];if(_0x9c1707['query'][_0x713a('0x3e')]){_0xae7f4e[_0x713a('0x3f')]=[{'all':!![]}];}_0xae7f4e=_['merge']({},_0xae7f4e,_0x9c1707['options']);return db[_0x713a('0x2c')][_0x713a('0x46')](_0xae7f4e)[_0x713a('0x24')](handleEntityNotFound(_0x4a66d2,null))[_0x713a('0x24')](respondWithResult(_0x4a66d2,null))[_0x713a('0x42')](handleError(_0x4a66d2,null));};exports['update']=function(_0x30ad3c,_0x230573){if(_0x30ad3c[_0x713a('0x47')]['id']){delete _0x30ad3c['body']['id'];}return db[_0x713a('0x2c')]['find']({'where':{'id':_0x30ad3c[_0x713a('0x44')]['id']}})[_0x713a('0x24')](handleEntityNotFound(_0x230573,null))[_0x713a('0x24')](saveUpdates(_0x30ad3c[_0x713a('0x47')],null))[_0x713a('0x24')](respondWithResult(_0x230573,null))[_0x713a('0x42')](handleError(_0x230573,null));};exports[_0x713a('0x48')]=function(_0x157b86,_0x170e5b,_0x20e600){return db[_0x713a('0x49')][_0x713a('0x4a')](function(_0x1d5900){if(_0x157b86[_0x713a('0x47')][_0x713a('0x4b')]===_0x713a('0x4c')){_0x157b86[_0x713a('0x47')][_0x713a('0x4d')]=path[_0x713a('0x4e')](config[_0x713a('0x4f')],_0x713a('0x50'),_0x157b86[_0x713a('0x47')][_0x713a('0x2a')]);}return db[_0x713a('0x2c')][_0x713a('0x48')](_0x157b86[_0x713a('0x47')],{'transaction':_0x1d5900})[_0x713a('0x24')](function(_0xa12b65){if(_0x157b86[_0x713a('0x47')]['mode']===_0x713a('0x4c')){fs[_0x713a('0x51')](_0xa12b65[_0x713a('0x4d')],parseInt('0777',0x8));}var _0x2ab51a=_0x157b86[_0x713a('0x52')][_0x713a('0x53')]({'plain':!![]});if(!_0x2ab51a)throw new Error(_0x713a('0x54'));if(_0x2ab51a[_0x713a('0x55')]===_0x713a('0x52')){var _0x231b61=_0xa12b65['get']({'plain':!![]});return db[_0x713a('0x56')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x2ab51a[_0x713a('0x57')]},'raw':!![]})[_0x713a('0x24')](function(_0x24a816){if(_0x24a816&&_0x24a816[_0x713a('0x58')]===0x0){return db[_0x713a('0x27')][_0x713a('0x48')]({'name':_0x231b61[_0x713a('0x2a')],'resourceId':_0x231b61['id'],'type':_0x24a816['name'],'sectionId':_0x24a816['id']},{})['then'](function(){return _0xa12b65;});}else{return _0xa12b65;}})[_0x713a('0x42')](function(_0x10dcfa){logger[_0x713a('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x10dcfa);});}return _0xa12b65;});})['then'](respondWithResult(_0x170e5b,0xc9))[_0x713a('0x42')](handleError(_0x170e5b,null));};exports[_0x713a('0x25')]=function(_0x4447c8,_0x46c311,_0x2dc840){var _0x4a71d6;return db[_0x713a('0x2c')][_0x713a('0x46')]({'where':{'id':_0x4447c8[_0x713a('0x44')]['id']}})[_0x713a('0x24')](function(_0x585763){if(_0x585763){return db['sequelize'][_0x713a('0x4a')](function(_0x16d323){return _0x585763[_0x713a('0x25')]({'transaction':_0x16d323,'raw':!![]})[_0x713a('0x24')](function(_0x2515e5){if(_0x2515e5[_0x713a('0x4d')]){fs[_0x713a('0x5a')](_0x2515e5['directory'])[_0x713a('0x5b')](function(_0x58a5de){fs[_0x713a('0x5c')](path[_0x713a('0x4e')](_0x2515e5['directory'],_0x58a5de));});fs[_0x713a('0x5d')](_0x2515e5[_0x713a('0x4d')]);}return _0x2515e5;});})[_0x713a('0x42')](function(_0x2456ff){throw new db[(_0x713a('0x5e'))][(_0x713a('0x5f'))](_0x2456ff['message']);});}})[_0x713a('0x24')](handleEntityNotFound(_0x46c311,null))[_0x713a('0x24')](removeEntity(_0x46c311,null))[_0x713a('0x42')](handleError(_0x46c311,null));};exports[_0x713a('0x60')]=function(_0x263f37,_0x366e16,_0x3c6567){return db[_0x713a('0x49')][_0x713a('0x4a')](function(_0x18b75f){var _0x5517a8;return db['VoiceMusicOnHold'][_0x713a('0x46')]({'where':{'id':_0x263f37[_0x713a('0x44')]['id']}})[_0x713a('0x24')](function(_0x30a841){if(_0x30a841){_0x5517a8=_0x30a841;return _0x30a841[_0x713a('0x60')](_0x263f37['body']['id'],{'transaction':_0x18b75f});}})[_0x713a('0x24')](function(_0x2b821d){if(_0x2b821d){return db[_0x713a('0x61')][_0x713a('0x62')]({'where':{'id':_0x263f37[_0x713a('0x47')]['id']},'attributes':['id',_0x713a('0x2a'),_0x713a('0x63'),_0x713a('0x64'),_0x713a('0x65')],'raw':!![]});}})['then'](function(_0xd5bd03){if(_0xd5bd03){var _0x5669d2=path[_0x713a('0x4e')](config[_0x713a('0x4f')],'server/files/sounds/converted',util[_0x713a('0x66')]('%s.%s',path['basename'](_0xd5bd03[_0x713a('0x63')],path['extname'](_0xd5bd03['save_name'])),_0xd5bd03[_0x713a('0x64')]));var _0x5ca8b4=path[_0x713a('0x4e')](config[_0x713a('0x4f')],_0x713a('0x50'),_0x5517a8[_0x713a('0x2a')],util['format'](_0x713a('0x67'),_0xd5bd03[_0x713a('0x2a')],_0xd5bd03[_0x713a('0x64')]));fs[_0x713a('0x68')](_0x5669d2,_0x5ca8b4);return _0xd5bd03;}})[_0x713a('0x42')](function(_0x57e37d){throw new db[(_0x713a('0x5e'))][(_0x713a('0x5f'))](_0x57e37d[_0x713a('0x69')]);});})['then'](handleEntityNotFound(_0x366e16,null))[_0x713a('0x24')](respondWithResult(_0x366e16,0xc9))[_0x713a('0x42')](handleError(_0x366e16,null));};exports[_0x713a('0x6a')]=function(_0x403d4c,_0x366c5c,_0x49613f){return db['sequelize']['transaction'](function(_0x41588a){var _0x280b8b;return db[_0x713a('0x2c')]['findOne']({'where':{'id':_0x403d4c[_0x713a('0x44')]['id']}})[_0x713a('0x24')](handleEntityNotFound(_0x366c5c,null))[_0x713a('0x24')](function(_0x54036c){if(_0x54036c){_0x280b8b=_0x54036c;return _0x54036c['removeSound'](_0x403d4c[_0x713a('0x44')][_0x713a('0x6b')]);}})[_0x713a('0x24')](function(_0x2a9553){if(_0x2a9553){return db[_0x713a('0x61')]['findOne']({'where':{'id':_0x403d4c[_0x713a('0x44')][_0x713a('0x6b')]},'attributes':['id',_0x713a('0x2a'),_0x713a('0x63'),_0x713a('0x64'),_0x713a('0x65')],'raw':!![]});}})[_0x713a('0x24')](function(_0x2a31ca){if(_0x2a31ca){fs[_0x713a('0x5c')](path[_0x713a('0x4e')](_0x280b8b[_0x713a('0x4d')],util[_0x713a('0x66')]('%s.%s',_0x2a31ca['name'],_0x2a31ca[_0x713a('0x64')])));return _0x2a31ca;}})[_0x713a('0x42')](function(_0x34d09e){throw new db[(_0x713a('0x5e'))][(_0x713a('0x5f'))](_0x34d09e['message']);});})['then'](handleEntityNotFound(_0x366c5c,null))[_0x713a('0x24')](respondWithStatusCode(_0x366c5c,0xcc))[_0x713a('0x42')](handleError(_0x366c5c,null));};exports[_0x713a('0x6c')]=function(_0x27cdbc,_0x3ef544,_0x59294f){var _0x591cc0={};var _0x194d1d={};var _0x4e74af;var _0x560ec1;return db[_0x713a('0x2c')][_0x713a('0x62')]({'where':{'id':_0x27cdbc[_0x713a('0x44')]['id']}})[_0x713a('0x24')](handleEntityNotFound(_0x3ef544,null))['then'](function(_0x267f2c){if(_0x267f2c){_0x4e74af=_0x267f2c;_0x194d1d[_0x713a('0x33')]=_[_0x713a('0x45')](db[_0x713a('0x61')][_0x713a('0x6d')]);_0x194d1d[_0x713a('0x30')]=_[_0x713a('0x45')](_0x27cdbc[_0x713a('0x30')]);_0x194d1d[_0x713a('0x31')]=_[_0x713a('0x32')](_0x194d1d[_0x713a('0x33')],_0x194d1d['query']);_0x591cc0[_0x713a('0x34')]=_[_0x713a('0x32')](_0x194d1d[_0x713a('0x33')],qs[_0x713a('0x35')](_0x27cdbc[_0x713a('0x30')][_0x713a('0x35')]));_0x591cc0[_0x713a('0x34')]=_0x591cc0[_0x713a('0x34')][_0x713a('0x36')]?_0x591cc0[_0x713a('0x34')]:_0x194d1d['model'];_0x591cc0[_0x713a('0x38')]=qs[_0x713a('0x39')](_0x27cdbc[_0x713a('0x30')][_0x713a('0x39')]);_0x591cc0[_0x713a('0x3a')]=qs[_0x713a('0x31')](_[_0x713a('0x6e')](_0x27cdbc['query'],_0x194d1d[_0x713a('0x31')]));if(_0x27cdbc[_0x713a('0x30')][_0x713a('0x3b')]){_0x591cc0['where']=_[_0x713a('0x3c')](_0x591cc0[_0x713a('0x3a')],{'$or':_[_0x713a('0x2b')](_0x591cc0[_0x713a('0x34')],function(_0x6415b){var _0x5e82e8={};_0x5e82e8[_0x6415b]={'$like':'%'+_0x27cdbc[_0x713a('0x30')]['filter']+'%'};return _0x5e82e8;})});}_0x591cc0=_[_0x713a('0x3c')]({},_0x591cc0,_0x27cdbc[_0x713a('0x6f')]);return _0x4e74af['getSounds'](_0x591cc0);}})[_0x713a('0x24')](function(_0x1f4106){if(_0x1f4106){_0x560ec1=_0x1f4106[_0x713a('0x36')];if(!_0x27cdbc[_0x713a('0x30')][_0x713a('0x37')](_0x713a('0x70'))){_0x591cc0['limit']=qs[_0x713a('0x19')](_0x27cdbc['query'][_0x713a('0x19')]);_0x591cc0[_0x713a('0x1c')]=qs[_0x713a('0x1c')](_0x27cdbc[_0x713a('0x30')][_0x713a('0x1c')]);}return _0x4e74af[_0x713a('0x6c')](_0x591cc0);}})['then'](function(_0x4e2603){if(_0x4e2603){return _0x4e2603?{'count':_0x560ec1,'rows':_0x4e2603}:null;}})[_0x713a('0x24')](respondWithResult(_0x3ef544,null))[_0x713a('0x42')](handleError(_0x3ef544,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 7344aa2..950028b 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 _0x81f0=['request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x81f0,0x7f));var _0x081f=function(_0x4a0e1d,_0x1ba236){_0x4a0e1d=_0x4a0e1d-0x0;var _0x4acbc5=_0x81f0[_0x4a0e1d];return _0x4acbc5;};'use strict';var _=require(_0x081f('0x0'));var util=require(_0x081f('0x1'));var logger=require(_0x081f('0x2'))(_0x081f('0x3'));var moment=require(_0x081f('0x4'));var BPromise=require('bluebird');var rp=require(_0x081f('0x5'));var fs=require('fs');var path=require(_0x081f('0x6'));var rimraf=require(_0x081f('0x7'));var config=require(_0x081f('0x8'));var attributes=require(_0x081f('0x9'));module[_0x081f('0xa')]=function(_0x2bc2cf,_0x31a911){return _0x2bc2cf[_0x081f('0xb')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index a46aea5..bc5459f 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','VoiceMusicOnHold,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0xdbeb2a,_0x5bca20){var _0x326575=function(_0x126465){while(--_0x126465){_0xdbeb2a['push'](_0xdbeb2a['shift']());}};_0x326575(++_0x5bca20);}(_0x9c44,0x178));var _0x49c4=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x9c44[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _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 diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 81eab13..6ba520f 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 _0x6208=['isAuthenticated','index','/describe','describe','/:id','show','/:id/users','getAgents','getTeams','post','create','addAgents','/:id/teams','addTeams','put','update','destroy','removeAgents','delete','removeTeams','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x3fc9af,_0x94a9a1){var _0x5a9e5e=function(_0x2e0886){while(--_0x2e0886){_0x3fc9af['push'](_0x3fc9af['shift']());}};_0x5a9e5e(++_0x94a9a1);}(_0x6208,0x17d));var _0x8620=function(_0x596f6e,_0x3f8857){_0x596f6e=_0x596f6e-0x0;var _0x1e0803=_0x6208[_0x596f6e];return _0x1e0803;};'use strict';var multer=require(_0x8620('0x0'));var util=require('util');var path=require(_0x8620('0x1'));var timeout=require(_0x8620('0x2'));var express=require('express');var router=express[_0x8620('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8620('0x4'));var interaction=require(_0x8620('0x5'));var config=require(_0x8620('0x6'));var controller=require(_0x8620('0x7'));router[_0x8620('0x8')]('/',auth[_0x8620('0x9')](),controller[_0x8620('0xa')]);router['get'](_0x8620('0xb'),auth[_0x8620('0x9')](),controller[_0x8620('0xc')]);router[_0x8620('0x8')](_0x8620('0xd'),auth[_0x8620('0x9')](),controller[_0x8620('0xe')]);router[_0x8620('0x8')](_0x8620('0xf'),auth['isAuthenticated'](),controller[_0x8620('0x10')]);router[_0x8620('0x8')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8620('0x11')]);router[_0x8620('0x12')]('/',auth[_0x8620('0x9')](),controller[_0x8620('0x13')]);router[_0x8620('0x12')](_0x8620('0xf'),auth['isAuthenticated'](),controller[_0x8620('0x14')]);router['post'](_0x8620('0x15'),auth[_0x8620('0x9')](),controller[_0x8620('0x16')]);router[_0x8620('0x17')]('/:id',auth[_0x8620('0x9')](),controller[_0x8620('0x18')]);router['delete']('/:id',auth[_0x8620('0x9')](),controller[_0x8620('0x19')]);router['delete'](_0x8620('0xf'),auth['isAuthenticated'](),controller[_0x8620('0x1a')]);router[_0x8620('0x1b')](_0x8620('0x15'),auth[_0x8620('0x9')](),controller[_0x8620('0x1c')]);module[_0x8620('0x1d')]=router; \ No newline at end of file +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 diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index f931292..8b1286b 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 _0xd2f8=['VIRTUAL','system-','getDataValue','sequelize','exports','STRING','name'];(function(_0x25248b,_0x3c8491){var _0x509939=function(_0x457a27){while(--_0x457a27){_0x25248b['push'](_0x25248b['shift']());}};_0x509939(++_0x3c8491);}(_0xd2f8,0x1df));var _0x8d2f=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0xd2f8[_0x7feb90];return _0x3c5b33;};'use strict';var Sequelize=require(_0x8d2f('0x0'));module[_0x8d2f('0x1')]={'name':{'type':Sequelize[_0x8d2f('0x2')],'allowNull':![],'unique':_0x8d2f('0x3')},'prefix':{'type':Sequelize[_0x8d2f('0x4')],'get':function(_0x29bd2a){return _0x8d2f('0x5')+this[_0x8d2f('0x6')]('name')+'-';}},'description':{'type':Sequelize[_0x8d2f('0x2')]},'callerIdAll':{'type':Sequelize[_0x8d2f('0x2')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +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 diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e6ec564..f864870 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 _0x5f2f=['VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','describe','create','transaction','body','get','VoiceExtension','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','app','system','description','Voice\x20Prefix\x20Extension','appdata','Voice\x20Prefix','VoiceExtensionId','VoicePrefixId','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','context','charAt','prefix','system-','sequelize','findById','addAgents','ids','omit','spread','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','order','hasOwnProperty','getTeams','findOne','Team','addTeams','User','Agents','online','voicePause','flatMap','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','userVoicePrefix:save','select','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x5f2f,0x73));var _0xf5f2=function(_0x15d70f,_0x13727d){_0x15d70f=_0x15d70f-0x0;var _0x9f4936=_0x5f2f[_0x15d70f];return _0x9f4936;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];config[_0xf5f2('0x18')]=_[_0xf5f2('0x19')](config[_0xf5f2('0x18')],{'host':_0xf5f2('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5f2('0x18')]));require(_0xf5f2('0x1b'))[_0xf5f2('0x1c')](socket);function respondWithStatusCode(_0x1c1a5c,_0x422b55){_0x422b55=_0x422b55||0xcc;return function(_0x4d97fc){if(_0x4d97fc){return _0x1c1a5c[_0xf5f2('0x1d')](_0x422b55);}return _0x1c1a5c[_0xf5f2('0x1e')](_0x422b55)[_0xf5f2('0x1f')]();};}function respondWithResult(_0x1b6dd2,_0x23e23a){_0x23e23a=_0x23e23a||0xc8;return function(_0x3a9dbb){if(_0x3a9dbb){return _0x1b6dd2[_0xf5f2('0x1e')](_0x23e23a)[_0xf5f2('0x20')](_0x3a9dbb);}};}function respondWithFilteredResult(_0x11f702,_0x228ace){return function(_0x20fccd){if(_0x20fccd){var _0x28e097=typeof _0x228ace[_0xf5f2('0x21')]===_0xf5f2('0x22')&&typeof _0x228ace[_0xf5f2('0x23')]===_0xf5f2('0x22');var _0x1bf655=_0x20fccd['count'];var _0x34706d=_0x28e097?0x0:_0x228ace[_0xf5f2('0x21')];var _0x49dac2=_0x28e097?_0x20fccd['count']:_0x228ace[_0xf5f2('0x21')]+_0x228ace[_0xf5f2('0x23')];var _0x4ae323;if(_0x49dac2>=_0x1bf655){_0x49dac2=_0x1bf655;_0x4ae323=0xc8;}else{_0x4ae323=0xce;}_0x11f702[_0xf5f2('0x1e')](_0x4ae323);return _0x11f702[_0xf5f2('0x24')](_0xf5f2('0x25'),_0x34706d+'-'+_0x49dac2+'/'+_0x1bf655)[_0xf5f2('0x20')](_0x20fccd);}return null;};}function patchUpdates(_0x36f1cb){return function(_0x4c691a){try{jsonpatch[_0xf5f2('0x26')](_0x4c691a,_0x36f1cb,!![]);}catch(_0x4669a6){return BPromise[_0xf5f2('0x27')](_0x4669a6);}return _0x4c691a[_0xf5f2('0x28')]();};}function saveUpdates(_0x287ad5,_0x5bdf4a){return function(_0x529f07){if(_0x529f07){return _0x529f07[_0xf5f2('0x29')](_0x287ad5)[_0xf5f2('0x2a')](function(_0x13da6f){return _0x13da6f;});}return null;};}function removeEntity(_0x1a5bb3,_0xf6c58d){return function(_0x788a8d){if(_0x788a8d){return _0x788a8d[_0xf5f2('0x2b')]()[_0xf5f2('0x2a')](function(){var _0x294414=_0x788a8d['get']({'plain':!![]});var _0xaa2602=_0xf5f2('0x2c');return db[_0xf5f2('0x2d')][_0xf5f2('0x2b')]({'where':{'type':_0xaa2602,'resourceId':_0x294414['id']}})[_0xf5f2('0x2a')](function(){return _0x788a8d;});})[_0xf5f2('0x2a')](function(){_0x1a5bb3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22c826,_0x14c829){return function(_0x11c771){if(!_0x11c771){_0x22c826['sendStatus'](0x194);}return _0x11c771;};}function handleError(_0x5a2c7e,_0x29571b){_0x29571b=_0x29571b||0x1f4;return function(_0x50b8a2){logger[_0xf5f2('0x2e')](_0x50b8a2[_0xf5f2('0x2f')]);if(_0x50b8a2[_0xf5f2('0x30')]){delete _0x50b8a2['name'];}_0x5a2c7e['status'](_0x29571b)[_0xf5f2('0x31')](_0x50b8a2);};}exports['index']=function(_0xb744b9,_0x58a4df){var _0x45b643={},_0x31087c={},_0x7b6817={'count':0x0,'rows':[]};var _0x428770=_[_0xf5f2('0x32')](db[_0xf5f2('0x33')][_0xf5f2('0x34')],function(_0x2c0e05){return{'name':_0x2c0e05['fieldName'],'type':_0x2c0e05[_0xf5f2('0x35')][_0xf5f2('0x36')]};});_0x31087c[_0xf5f2('0x37')]=_[_0xf5f2('0x32')](_0x428770,_0xf5f2('0x30'));_0x31087c[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0xb744b9['query']);_0x31087c[_0xf5f2('0x3a')]=_[_0xf5f2('0x3b')](_0x31087c['model'],_0x31087c[_0xf5f2('0x38')]);_0x45b643['attributes']=_[_0xf5f2('0x3b')](_0x31087c[_0xf5f2('0x37')],qs[_0xf5f2('0x3c')](_0xb744b9[_0xf5f2('0x38')]['fields']));_0x45b643['attributes']=_0x45b643[_0xf5f2('0x3d')][_0xf5f2('0x3e')]?_0x45b643[_0xf5f2('0x3d')]:_0x31087c['model'];if(!_0xb744b9[_0xf5f2('0x38')]['hasOwnProperty'](_0xf5f2('0x3f'))){_0x45b643['limit']=qs[_0xf5f2('0x23')](_0xb744b9[_0xf5f2('0x38')]['limit']);_0x45b643[_0xf5f2('0x21')]=qs[_0xf5f2('0x21')](_0xb744b9[_0xf5f2('0x38')][_0xf5f2('0x21')]);}_0x45b643['order']=qs['sort'](_0xb744b9[_0xf5f2('0x38')][_0xf5f2('0x40')]);_0x45b643[_0xf5f2('0x41')]=qs[_0xf5f2('0x3a')](_[_0xf5f2('0x42')](_0xb744b9[_0xf5f2('0x38')],_0x31087c[_0xf5f2('0x3a')]),_0x428770);if(_0xb744b9['query'][_0xf5f2('0x43')]){_0x45b643[_0xf5f2('0x41')]=_['merge'](_0x45b643[_0xf5f2('0x41')],{'$or':_[_0xf5f2('0x32')](_0x428770,function(_0x71b0e7){if(_0x71b0e7[_0xf5f2('0x35')]!==_0xf5f2('0x44')){var _0x3b6372={};_0x3b6372[_0x71b0e7[_0xf5f2('0x30')]]={'$like':'%'+_0xb744b9[_0xf5f2('0x38')]['filter']+'%'};return _0x3b6372;}})});}_0x45b643=_[_0xf5f2('0x45')]({},_0x45b643,_0xb744b9[_0xf5f2('0x46')]);var _0x17a78e={'where':_0x45b643['where']};return db['VoicePrefix']['count'](_0x17a78e)[_0xf5f2('0x2a')](function(_0x2ad13c){_0x7b6817['count']=_0x2ad13c;if(_0xb744b9[_0xf5f2('0x38')][_0xf5f2('0x47')]){_0x45b643[_0xf5f2('0x48')]=[{'all':!![]}];}return db[_0xf5f2('0x33')][_0xf5f2('0x49')](_0x45b643);})[_0xf5f2('0x2a')](function(_0x1a6ec1){_0x7b6817[_0xf5f2('0x4a')]=_0x1a6ec1;return _0x7b6817;})[_0xf5f2('0x2a')](respondWithFilteredResult(_0x58a4df,_0x45b643))[_0xf5f2('0x4b')](handleError(_0x58a4df,null));};exports[_0xf5f2('0x4c')]=function(_0x4773cd,_0x4252a3){var _0x2fb67e={'raw':![],'where':{'id':_0x4773cd[_0xf5f2('0x4d')]['id']}},_0x4faeed={};_0x4faeed['model']=_[_0xf5f2('0x39')](db[_0xf5f2('0x33')][_0xf5f2('0x34')]);_0x4faeed[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0x4773cd[_0xf5f2('0x38')]);_0x4faeed['filters']=_[_0xf5f2('0x3b')](_0x4faeed[_0xf5f2('0x37')],_0x4faeed[_0xf5f2('0x38')]);_0x2fb67e[_0xf5f2('0x3d')]=_[_0xf5f2('0x3b')](_0x4faeed[_0xf5f2('0x37')],qs[_0xf5f2('0x3c')](_0x4773cd[_0xf5f2('0x38')]['fields']));_0x2fb67e[_0xf5f2('0x3d')]=_0x2fb67e[_0xf5f2('0x3d')][_0xf5f2('0x3e')]?_0x2fb67e['attributes']:_0x4faeed[_0xf5f2('0x37')];if(_0x4773cd[_0xf5f2('0x38')][_0xf5f2('0x47')]){_0x2fb67e['include']=[{'all':!![]}];}_0x2fb67e=_['merge']({},_0x2fb67e,_0x4773cd[_0xf5f2('0x46')]);return db[_0xf5f2('0x33')]['find'](_0x2fb67e)[_0xf5f2('0x2a')](handleEntityNotFound(_0x4252a3,null))['then'](respondWithResult(_0x4252a3,null))[_0xf5f2('0x4b')](handleError(_0x4252a3,null));};exports['destroy']=function(_0x2cbd9d,_0x5d9120){return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x2cbd9d[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x5d9120,null))['then'](removeEntity(_0x5d9120,null))[_0xf5f2('0x4b')](handleError(_0x5d9120,null));};exports[_0xf5f2('0x4f')]=function(_0x4f6b01,_0x58213b){return db[_0xf5f2('0x33')][_0xf5f2('0x4f')]()['then'](respondWithResult(_0x58213b,null))[_0xf5f2('0x4b')](handleError(_0x58213b,null));};exports[_0xf5f2('0x50')]=function(_0x29c9b6,_0x41b1c7){var _0x5d0db0;return db['sequelize'][_0xf5f2('0x51')](function(_0xa3cc67){return db['VoicePrefix'][_0xf5f2('0x50')](_0x29c9b6[_0xf5f2('0x52')],{'transaction':_0xa3cc67})[_0xf5f2('0x2a')](function(_0x14029e){_0x5d0db0=_0x14029e[_0xf5f2('0x53')]({'plain':!![]});return db[_0xf5f2('0x54')][_0xf5f2('0x4e')]({'where':{'id':_0x5d0db0['VoiceExtensionId']},'raw':!![]})['then'](function(_0x330730){return createVoicePrefixExtensions(_0x5d0db0,_0x330730,_0xa3cc67);});});})[_0xf5f2('0x2a')](function(){var _0x3c349f=_0x29c9b6[_0xf5f2('0x55')][_0xf5f2('0x53')]({'plain':!![]});if(!_0x3c349f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c349f[_0xf5f2('0x56')]===_0xf5f2('0x55')){var _0x18b124=_0x5d0db0;return db['UserProfileSection'][_0xf5f2('0x4e')]({'where':{'name':'VoicePrefixes','userProfileId':_0x3c349f[_0xf5f2('0x57')]},'raw':!![]})[_0xf5f2('0x2a')](function(_0x28cce5){if(_0x28cce5&&_0x28cce5[_0xf5f2('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x18b124[_0xf5f2('0x30')],'resourceId':_0x18b124['id'],'type':_0x28cce5['name'],'sectionId':_0x28cce5['id']},{})[_0xf5f2('0x2a')](function(){return _0x5d0db0;});}else{return _0x5d0db0;}})[_0xf5f2('0x4b')](function(_0x572ec1){logger[_0xf5f2('0x2e')](_0xf5f2('0x59'),_0x572ec1);throw _0x572ec1;});}return _0x5d0db0;})[_0xf5f2('0x2a')](respondWithResult(_0x41b1c7,null))['catch'](handleError(_0x41b1c7,null));};function Extension(_0x397b99,_0xcf7a50,_0x42cc27,_0x4579f4){this['context']=_0xf5f2('0x5a');this['exten']=_0x397b99;this[_0xf5f2('0x5b')]=_0x42cc27;this[_0xf5f2('0x35')]=_0xf5f2('0x5c');this[_0xf5f2('0x5d')]=_0xf5f2('0x5e');this['priority']=_0xcf7a50;this[_0xf5f2('0x5f')]=_0x4579f4;}function createVoicePrefixExtensions(_0xacd80,_0x3461e5,_0x212639){return new BPromise(function(_0x2c5733,_0x5359b5){var _0x31e16b=new Extension(formatPrefixName(_0xacd80['prefix']),0x1,'NoOp',_0xf5f2('0x60'));_0x31e16b['VoicePrefixId']=_0xacd80['id'];return db[_0xf5f2('0x54')][_0xf5f2('0x50')](_0x31e16b,{'transaction':_0x212639})[_0xf5f2('0x2a')](function(_0x123b93){var _0x5767fc=_0x123b93[_0xf5f2('0x53')]({'plain':!![]});var _0x3a53f2=_[_0xf5f2('0x32')](addVoicePrefixExtensions(_0xacd80,_0x3461e5),function(_0x18c41f){_0x18c41f[_0xf5f2('0x61')]=_0x5767fc['id'];_0x18c41f[_0xf5f2('0x62')]=_0xacd80['id'];return _0x18c41f;});return db[_0xf5f2('0x54')]['bulkCreate'](_0x3a53f2,{'transaction':_0x212639})[_0xf5f2('0x2a')](function(_0x2d171d){if(!_0x2d171d){return _0x5359b5(_0xf5f2('0x63'));}else{return _0x2c5733(_0x2d171d);}})[_0xf5f2('0x4b')](function(_0x5a5b2b){return _0x5359b5(_0x5a5b2b);});});;});};function addVoicePrefixExtensions(_0x1de396,_0x4cce08){var _0x410866=[];var _0x1c7f06=formatPrefixName(_0x1de396['prefix']);_0x410866[_0xf5f2('0x64')](new Extension(_0x1c7f06,0x2,_0xf5f2('0x65'),_0xf5f2('0x66')+_0x1de396[_0xf5f2('0x30')]));if(_0x1de396[_0xf5f2('0x67')]){_0x410866['push'](new Extension(_0x1c7f06,0x3,_0xf5f2('0x65'),_0xf5f2('0x68')+_0x1de396[_0xf5f2('0x67')]));}else{_0x410866[_0xf5f2('0x64')](new Extension(_0x1c7f06,0x3,_0xf5f2('0x69'),_0xf5f2('0x6a')));}_0x410866['push'](new Extension(_0x1c7f06,0x4,_0xf5f2('0x6b'),_0x4cce08[_0xf5f2('0x6c')]+','+'${EXTEN:'+(0x8+_0x1de396[_0xf5f2('0x30')][_0xf5f2('0x3e')])+'}'+','+0x1));return _0x410866;}function formatPrefixName(_0x377aad){var _0x51a3c7='_';for(var _0x551cc9=0x0;_0x551cc9<_0x377aad['length'];_0x551cc9++){if(_0x377aad[_0xf5f2('0x6d')](_0x551cc9)=='-'){_0x51a3c7+=_0x377aad[_0xf5f2('0x6d')](_0x551cc9);}else{_0x51a3c7+='['+_0x377aad[_0xf5f2('0x6d')](_0x551cc9)+']';}}_0x51a3c7+='.';return _0x51a3c7;}exports[_0xf5f2('0x29')]=function(_0x55da4d,_0x4d878e,_0x278b76){var _0x3a98b4=_0x55da4d[_0xf5f2('0x52')];_0x3a98b4[_0xf5f2('0x6e')]=_0xf5f2('0x6f')+_0x3a98b4[_0xf5f2('0x30')]+'-';return db[_0xf5f2('0x70')][_0xf5f2('0x51')](function(_0x155f45){return db[_0xf5f2('0x33')][_0xf5f2('0x29')](_0x3a98b4,{'where':{'id':_0x3a98b4['id']},'transaction':_0x155f45})['then'](function(){return db['VoiceExtension']['destroy']({'where':{'VoicePrefixId':_0x3a98b4['id']},'transaction':_0x155f45})[_0xf5f2('0x2a')](function(){return db[_0xf5f2('0x54')][_0xf5f2('0x4e')]({'where':{'id':_0x3a98b4[_0xf5f2('0x61')]},'raw':!![]})[_0xf5f2('0x2a')](function(_0x5c6959){return createVoicePrefixExtensions(_0x3a98b4,_0x5c6959,_0x155f45);});});});})[_0xf5f2('0x2a')](function(){return db[_0xf5f2('0x33')][_0xf5f2('0x71')](_0x3a98b4['id']);})[_0xf5f2('0x2a')](respondWithResult(_0x4d878e,null))[_0xf5f2('0x4b')](handleError(_0x4d878e,null));};exports['addAgents']=function(_0x2986ed,_0x1409b9,_0x517c15){return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x2986ed[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x1409b9,null))['then'](function(_0x40b36e){if(_0x40b36e){return _0x40b36e[_0xf5f2('0x72')](_0x2986ed[_0xf5f2('0x52')][_0xf5f2('0x73')],_[_0xf5f2('0x74')](_0x2986ed['body'],['ids','id'])||{})[_0xf5f2('0x75')](function(_0x30f362){for(var _0x17eb69=0x0;_0x17eb69<_0x2986ed[_0xf5f2('0x52')]['ids']['length'];_0x17eb69+=0x1){socket[_0xf5f2('0x76')]('userVoicePrefix:save',{'UserId':Number(_0x2986ed['body']['ids'][_0x17eb69]),'VoicePrefixId':Number(_0x2986ed['params']['id'])});}return _0x30f362;});}})[_0xf5f2('0x2a')](respondWithResult(_0x1409b9,null))[_0xf5f2('0x4b')](handleError(_0x1409b9,null));};exports[_0xf5f2('0x77')]=function(_0x168092,_0x3de508,_0x9f941e){return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x168092[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x3de508,null))[_0xf5f2('0x2a')](function(_0x2afeac){if(_0x2afeac){return _0x2afeac[_0xf5f2('0x77')](_0x168092[_0xf5f2('0x38')][_0xf5f2('0x73')])[_0xf5f2('0x2a')](function(){if(_[_0xf5f2('0x78')](_0x168092[_0xf5f2('0x38')]['ids'])){for(var _0xe7ac8=0x0;_0xe7ac8<_0x168092[_0xf5f2('0x38')][_0xf5f2('0x73')][_0xf5f2('0x3e')];_0xe7ac8+=0x1){socket[_0xf5f2('0x76')](_0xf5f2('0x79'),{'UserId':Number(_0x168092[_0xf5f2('0x38')][_0xf5f2('0x73')][_0xe7ac8]),'VoicePrefixId':Number(_0x168092['params']['id'])});}}else{socket[_0xf5f2('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x168092['query']['ids']),'VoicePrefixId':Number(_0x168092['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3de508,null))['catch'](handleError(_0x3de508,null));};exports[_0xf5f2('0x7a')]=function(_0x18ce86,_0x26a57c,_0x375bc9){var _0x145d4d={};var _0x3cf857={};var _0x5dc63f;var _0x4a0005;return db[_0xf5f2('0x33')]['findOne']({'where':{'id':_0x18ce86[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x26a57c,null))['then'](function(_0x4f3ad4){if(_0x4f3ad4){_0x5dc63f=_0x4f3ad4;_0x3cf857[_0xf5f2('0x37')]=_[_0xf5f2('0x39')](db['User'][_0xf5f2('0x34')]);_0x3cf857[_0xf5f2('0x38')]=_['keys'](_0x18ce86[_0xf5f2('0x38')]);_0x3cf857[_0xf5f2('0x3a')]=_[_0xf5f2('0x3b')](_0x3cf857['model'],_0x3cf857[_0xf5f2('0x38')]);_0x145d4d[_0xf5f2('0x3d')]=_[_0xf5f2('0x3b')](_0x3cf857[_0xf5f2('0x37')],qs[_0xf5f2('0x3c')](_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0x145d4d[_0xf5f2('0x3d')]=_0x145d4d[_0xf5f2('0x3d')][_0xf5f2('0x3e')]?_0x145d4d[_0xf5f2('0x3d')]:_0x3cf857[_0xf5f2('0x37')];_0x145d4d[_0xf5f2('0x7b')]=qs[_0xf5f2('0x40')](_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x40')]);_0x145d4d[_0xf5f2('0x41')]=qs[_0xf5f2('0x3a')](_[_0xf5f2('0x42')](_0x18ce86[_0xf5f2('0x38')],_0x3cf857[_0xf5f2('0x3a')]));if(_0x18ce86['query'][_0xf5f2('0x43')]){_0x145d4d[_0xf5f2('0x41')]=_['merge'](_0x145d4d[_0xf5f2('0x41')],{'$or':_[_0xf5f2('0x32')](_0x145d4d['attributes'],function(_0xb56304){var _0x2f54eb={};_0x2f54eb[_0xb56304]={'$like':'%'+_0x18ce86[_0xf5f2('0x38')]['filter']+'%'};return _0x2f54eb;})});}_0x145d4d=_['merge']({},_0x145d4d,_0x18ce86[_0xf5f2('0x46')]);return _0x5dc63f[_0xf5f2('0x7a')](_0x145d4d);}})[_0xf5f2('0x2a')](function(_0x5ba275){if(_0x5ba275){_0x4a0005=_0x5ba275['length'];if(!_0x18ce86[_0xf5f2('0x38')][_0xf5f2('0x7c')](_0xf5f2('0x3f'))){_0x145d4d['limit']=qs['limit'](_0x18ce86['query']['limit']);_0x145d4d['offset']=qs[_0xf5f2('0x21')](_0x18ce86['query'][_0xf5f2('0x21')]);}return _0x5dc63f[_0xf5f2('0x7a')](_0x145d4d);}})[_0xf5f2('0x2a')](function(_0x43a167){if(_0x43a167){return _0x43a167?{'count':_0x4a0005,'rows':_0x43a167}:null;}})[_0xf5f2('0x2a')](respondWithResult(_0x26a57c,null))[_0xf5f2('0x4b')](handleError(_0x26a57c,null));};exports[_0xf5f2('0x7d')]=function(_0x40e921,_0x3dc051,_0x27ca4a){var _0x1bb4ac={};var _0x36c3c8={};var _0x10c982;var _0x5e69a2;return db[_0xf5f2('0x33')][_0xf5f2('0x7e')]({'where':{'id':_0x40e921['params']['id']}})[_0xf5f2('0x2a')](handleEntityNotFound(_0x3dc051,null))[_0xf5f2('0x2a')](function(_0x537a7d){if(_0x537a7d){_0x10c982=_0x537a7d;_0x36c3c8[_0xf5f2('0x37')]=_[_0xf5f2('0x39')](db[_0xf5f2('0x7f')]['rawAttributes']);_0x36c3c8[_0xf5f2('0x38')]=_[_0xf5f2('0x39')](_0x40e921['query']);_0x36c3c8[_0xf5f2('0x3a')]=_[_0xf5f2('0x3b')](_0x36c3c8[_0xf5f2('0x37')],_0x36c3c8['query']);_0x1bb4ac[_0xf5f2('0x3d')]=_['intersection'](_0x36c3c8[_0xf5f2('0x37')],qs['fields'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x3c')]));_0x1bb4ac[_0xf5f2('0x3d')]=_0x1bb4ac[_0xf5f2('0x3d')]['length']?_0x1bb4ac[_0xf5f2('0x3d')]:_0x36c3c8['model'];_0x1bb4ac['order']=qs['sort'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x40')]);_0x1bb4ac['where']=qs[_0xf5f2('0x3a')](_[_0xf5f2('0x42')](_0x40e921[_0xf5f2('0x38')],_0x36c3c8[_0xf5f2('0x3a')]));if(_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x43')]){_0x1bb4ac['where']=_[_0xf5f2('0x45')](_0x1bb4ac[_0xf5f2('0x41')],{'$or':_['map'](_0x1bb4ac[_0xf5f2('0x3d')],function(_0x19cbff){var _0x58042c={};_0x58042c[_0x19cbff]={'$like':'%'+_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x43')]+'%'};return _0x58042c;})});}_0x1bb4ac=_[_0xf5f2('0x45')]({},_0x1bb4ac,_0x40e921[_0xf5f2('0x46')]);return _0x10c982[_0xf5f2('0x7d')](_0x1bb4ac);}})[_0xf5f2('0x2a')](function(_0x4df05c){if(_0x4df05c){_0x5e69a2=_0x4df05c[_0xf5f2('0x3e')];if(!_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x7c')](_0xf5f2('0x3f'))){_0x1bb4ac[_0xf5f2('0x23')]=qs[_0xf5f2('0x23')](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x23')]);_0x1bb4ac[_0xf5f2('0x21')]=qs['offset'](_0x40e921[_0xf5f2('0x38')][_0xf5f2('0x21')]);}return _0x10c982[_0xf5f2('0x7d')](_0x1bb4ac);}})[_0xf5f2('0x2a')](function(_0x35fe1a){if(_0x35fe1a){return _0x35fe1a?{'count':_0x5e69a2,'rows':_0x35fe1a}:null;}})[_0xf5f2('0x2a')](respondWithResult(_0x3dc051,null))[_0xf5f2('0x4b')](handleError(_0x3dc051,null));};exports[_0xf5f2('0x80')]=function(_0x33cfe7,_0x40d0eb,_0x4c138c){var _0x52e419=_0x33cfe7[_0xf5f2('0x52')][_0xf5f2('0x73')];var _0x28eda5;return db[_0xf5f2('0x7f')]['findAll']({'where':{'id':_0x52e419},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x81')],'as':_0xf5f2('0x82'),'attributes':['id',_0xf5f2('0x30'),_0xf5f2('0x83'),_0xf5f2('0x84'),'interface'],'raw':!![]}]})[_0xf5f2('0x2a')](function(_0x18d727){if(_0x18d727){_0x28eda5=_0x18d727;var _0x4bdb72=_[_0xf5f2('0x85')](_0x18d727,function(_0x3ff714){var _0x2563fa=_0x3ff714[_0xf5f2('0x53')]({'plain':!![]});return _0x2563fa['Agents'];});return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x33cfe7[_0xf5f2('0x4d')]['id']}})['then'](function(_0x489d4a){return db[_0xf5f2('0x70')][_0xf5f2('0x51')](function(_0x1432ef){return _0x489d4a[_0xf5f2('0x80')](_0x52e419,{'transaction':_0x1432ef})[_0xf5f2('0x2a')](function(){return BPromise[_0xf5f2('0x86')](_0x28eda5,function(_0x58711d){return db[_0xf5f2('0x87')]['upsert']({'TeamId':_0x58711d['id'],'VoicePrefixId':_0x33cfe7[_0xf5f2('0x4d')]['id']},{'transaction':_0x1432ef});});})[_0xf5f2('0x2a')](function(){return BPromise[_0xf5f2('0x86')](_0x4bdb72,function(_0xa74467){return db[_0xf5f2('0x88')][_0xf5f2('0x89')]({'where':{'UserId':_0xa74467['id'],'VoicePrefixId':_0x33cfe7['params']['id']},'transaction':_0x1432ef});});})[_0xf5f2('0x2a')](function(){_0x4bdb72[_0xf5f2('0x8a')](function(_0x457b53){socket[_0xf5f2('0x76')](_0xf5f2('0x8b'),{'UserId':_0x457b53['id'],'VoicePrefixId':_0x489d4a['id']});});});});});}})[_0xf5f2('0x2a')](respondWithStatusCode(_0x40d0eb,null))[_0xf5f2('0x4b')](handleError(_0x40d0eb,null));};exports['removeTeams']=function(_0x1ee541,_0x4a6b83,_0x5857d1){return db['Team'][_0xf5f2('0x49')]({'where':{'id':_0x1ee541[_0xf5f2('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x81')],'as':_0xf5f2('0x82'),'attributes':['id'],'raw':!![]}]})[_0xf5f2('0x2a')](handleEntityNotFound(_0x4a6b83,null))[_0xf5f2('0x2a')](function(_0x4f2704){var _0x3075b4=_[_0xf5f2('0x32')](_0x4f2704,'id');var _0x10ac11=[];var _0x5d3ca7=[];var _0x29f7bd=squel[_0xf5f2('0x8c')]();_0x29f7bd['field'](_0xf5f2('0x8d'))[_0xf5f2('0x8e')](_0xf5f2('0x8f'),'tq')[_0xf5f2('0x90')](_0xf5f2('0x91'),'ut',_0xf5f2('0x92'))[_0xf5f2('0x41')](_0xf5f2('0x93'),_0x1ee541[_0xf5f2('0x4d')]['id']);for(var _0x4782da=0x0;_0x4782da<_0x4f2704[_0xf5f2('0x3e')];_0x4782da+=0x1){let _0x4b6146=_0x4f2704[_0x4782da];for(var _0x299c53=0x0;_0x299c53<_0x4b6146[_0xf5f2('0x82')]['length'];_0x299c53+=0x1){let _0x2275ba=_0x4b6146['Agents'][_0x299c53];var _0x3b2620=_0x29f7bd[_0xf5f2('0x94')]();_0x3b2620[_0xf5f2('0x41')](_0xf5f2('0x95'),_0x2275ba['id']);_0x5d3ca7['push'](db[_0xf5f2('0x70')]['query'](_0x3b2620[_0xf5f2('0x96')](),{'type':db['sequelize'][_0xf5f2('0x97')][_0xf5f2('0x98')]})['then'](function(_0x2bfc53){if(_0x2bfc53[_0xf5f2('0x3e')]===0x1){return _0x2275ba['id'];}else{var _0x16619b=_[_0xf5f2('0x99')](_[_0xf5f2('0x32')](_0x2bfc53,_0xf5f2('0x9a')),function(_0x54c86e){return _['includes'](_0x3075b4,_0x54c86e);});if(_0x16619b){return _0x2275ba['id'];}}}));}}return BPromise[_0xf5f2('0x9b')](_0x5d3ca7)[_0xf5f2('0x2a')](function(_0x5dc5da){_0x10ac11=_(_0x10ac11)[_0xf5f2('0x9c')](_0x5dc5da)[_0xf5f2('0x9d')]()[_0xf5f2('0x9e')]();return db[_0xf5f2('0x33')][_0xf5f2('0x4e')]({'where':{'id':_0x1ee541[_0xf5f2('0x4d')]['id']}})[_0xf5f2('0x2a')](function(_0x4f9e2d){return db[_0xf5f2('0x70')]['transaction'](function(_0x3ea1aa){return _0x4f9e2d['removeTeams'](_0x1ee541[_0xf5f2('0x38')]['ids'],{'transaction':_0x3ea1aa})[_0xf5f2('0x2a')](function(){if(!_['isEmpty'](_0x10ac11)){return _0x4f9e2d['removeAgents'](_0x10ac11,{'transaction':_0x3ea1aa});}})[_0xf5f2('0x2a')](function(){_0x10ac11[_0xf5f2('0x8a')](function(_0x57708f){socket[_0xf5f2('0x76')](_0xf5f2('0x79'),{'UserId':_0x57708f,'VoicePrefixId':_0x4f9e2d['id']});});});});});});})[_0xf5f2('0x2a')](respondWithStatusCode(_0x4a6b83,null))[_0xf5f2('0x4b')](handleError(_0x4a6b83,null));}; \ No newline at end of file +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 diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 6d759db..2083b75 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 _0xd106=['../../mysqldb','VoicePrefix','save','update','remove','emit','events'];(function(_0x4d5abc,_0x38b33a){var _0x305056=function(_0x197dc3){while(--_0x197dc3){_0x4d5abc['push'](_0x4d5abc['shift']());}};_0x305056(++_0x38b33a);}(_0xd106,0xa0));var _0x6d10=function(_0x4fcb65,_0xa4d03a){_0x4fcb65=_0x4fcb65-0x0;var _0x273c6a=_0xd106[_0x4fcb65];return _0x273c6a;};'use strict';var EventEmitter=require(_0x6d10('0x0'));var VoicePrefix=require(_0x6d10('0x1'))['db'][_0x6d10('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6d10('0x3'),'afterUpdate':_0x6d10('0x4'),'afterDestroy':_0x6d10('0x5')};function emitEvent(_0x54712e){return function(_0x58943a,_0x9da1a5,_0x11c4a1){VoicePrefixEvents[_0x6d10('0x6')](_0x54712e+':'+_0x58943a['id'],_0x58943a);VoicePrefixEvents[_0x6d10('0x6')](_0x54712e,_0x58943a);_0x11c4a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +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 diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 042b9ef..0803c91 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 _0xf6dc=['../../config/environment','exports','define','voice_prefixes','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x17406a,_0x1e2320){var _0x1501ff=function(_0x4b075a){while(--_0x4b075a){_0x17406a['push'](_0x17406a['shift']());}};_0x1501ff(++_0x1e2320);}(_0xf6dc,0x93));var _0xcf6d=function(_0x2dfb67,_0x5355c2){_0x2dfb67=_0x2dfb67-0x0;var _0x3d0482=_0xf6dc[_0x2dfb67];return _0x3d0482;};'use strict';var _=require(_0xcf6d('0x0'));var util=require('util');var logger=require(_0xcf6d('0x1'))(_0xcf6d('0x2'));var moment=require(_0xcf6d('0x3'));var BPromise=require('bluebird');var rp=require(_0xcf6d('0x4'));var fs=require('fs');var path=require(_0xcf6d('0x5'));var rimraf=require(_0xcf6d('0x6'));var config=require(_0xcf6d('0x7'));var attributes=require('./voicePrefix.attributes');module[_0xcf6d('0x8')]=function(_0x4fe62e,_0x4dd97e){return _0x4fe62e[_0xcf6d('0x9')]('VoicePrefix',attributes,{'tableName':_0xcf6d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index dc07ecf..cb52d5e 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 _0x6333=['stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','redis','defaults','request','info','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x44b5f6,_0xa66e98){var _0x439ac8=function(_0x236f6f){while(--_0x236f6f){_0x44b5f6['push'](_0x44b5f6['shift']());}};_0x439ac8(++_0xa66e98);}(_0x6333,0x83));var _0x3633=function(_0x403590,_0x260b76){_0x403590=_0x403590-0x0;var _0x4c02b8=_0x6333[_0x403590];return _0x4c02b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3633('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3633('0x1'));var db=require(_0x3633('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x3633('0x3'))('rpc');var config=require(_0x3633('0x4'));var jayson=require(_0x3633('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0x3633('0x6')]=_[_0x3633('0x7')](config[_0x3633('0x6')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3633('0x6')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x463f1d,_0x288fc8,_0x184dd9){return new BPromise(function(_0x5aace0,_0x24e243){return client[_0x3633('0x8')](_0x463f1d,_0x184dd9)['then'](function(_0x507300){logger[_0x3633('0x9')]('VoicePrefix,\x20%s,\x20%s',_0x288fc8,'request\x20sent');logger[_0x3633('0xa')](_0x3633('0xb'),_0x288fc8,_0x3633('0xc'),JSON[_0x3633('0xd')](_0x507300));if(_0x507300[_0x3633('0xe')]){if(_0x507300['error'][_0x3633('0xf')]===0x1f4){logger[_0x3633('0xe')](_0x3633('0x10'),_0x288fc8,_0x507300[_0x3633('0xe')]['message']);return _0x24e243(_0x507300['error'][_0x3633('0x11')]);}logger[_0x3633('0xe')](_0x3633('0x10'),_0x288fc8,_0x507300[_0x3633('0xe')][_0x3633('0x11')]);return _0x5aace0(_0x507300[_0x3633('0xe')]['message']);}else{logger[_0x3633('0x9')](_0x3633('0x10'),_0x288fc8,'request\x20sent');_0x5aace0(_0x507300['result'][_0x3633('0x11')]);}})['catch'](function(_0x4875b8){logger[_0x3633('0xe')](_0x3633('0x10'),_0x288fc8,_0x4875b8);_0x24e243(_0x4875b8);});});} \ No newline at end of file +var _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 diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2ced7b8..f206998 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 _0x99e9=['update','emit','removeListener','length','voicePrefix:','save','remove'];(function(_0x419b7a,_0x299ca7){var _0x4e284d=function(_0x42a9f5){while(--_0x42a9f5){_0x419b7a['push'](_0x419b7a['shift']());}};_0x4e284d(++_0x299ca7);}(_0x99e9,0xb4));var _0x999e=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x99e9[_0x301c34];return _0x1a8c5a;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x999e('0x0'),_0x999e('0x1'),_0x999e('0x2')];function createListener(_0x1c6fa0,_0x4aaeb4){return function(_0x19a818){_0x4aaeb4[_0x999e('0x3')](_0x1c6fa0,_0x19a818);};}function removeListener(_0x3aac27,_0x4e2112){return function(){VoicePrefixEvents[_0x999e('0x4')](_0x3aac27,_0x4e2112);};}exports['register']=function(_0x25421f){for(var _0x1bda0a=0x0,_0x100330=events[_0x999e('0x5')];_0x1bda0a<_0x100330;_0x1bda0a++){var _0x5c1c17=events[_0x1bda0a];var _0x46aeae=createListener(_0x999e('0x6')+_0x5c1c17,_0x25421f);VoicePrefixEvents['on'](_0x5c1c17,_0x46aeae);}}; \ No newline at end of file +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 diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 4bb3c73..321d709 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(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1ea015,_0x5e416a){_0x1ea015=_0x1ea015-0x0;var _0x5ed37f=_0xb10b[_0x1ea015];return _0x5ed37f;};'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 _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 diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index bc567a5..c1f3d6e 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 _0x669a=['#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','name','default','ringall','random','rrmemory','linear','wrandom','setDataValue','getDataValue','type','dialMethod','inbound','booked','roundrobin','predictive','power','INTEGER','yes','all','ENUM','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','progressive','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','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)'];(function(_0x2f0057,_0x448b27){var _0x17f2c3=function(_0x12efc3){while(--_0x12efc3){_0x2f0057['push'](_0x2f0057['shift']());}};_0x17f2c3(++_0x448b27);}(_0x669a,0x1d8));var _0xa669=function(_0x5b0f30,_0x2c4e86){_0x5b0f30=_0x5b0f30-0x0;var _0x19ab24=_0x669a[_0x5b0f30];return _0x19ab24;};'use strict';var Sequelize=require(_0xa669('0x0'));module[_0xa669('0x1')]={'name':{'type':Sequelize[_0xa669('0x2')],'allowNull':![],'unique':_0xa669('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound','outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xa669('0x2')],'defaultValue':_0xa669('0x4')},'announce':{'type':Sequelize[_0xa669('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xa669('0x5'),'leastrecent','fewestcalls',_0xa669('0x6'),_0xa669('0x7'),_0xa669('0x8'),_0xa669('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0xa669('0x5'),'set':function(_0x15b126){this[_0xa669('0xa')]('strategy',_0x15b126?_0x15b126:_0xa669('0x7'));},'get':function(){var _0x44e966=this[_0xa669('0xb')](_0xa669('0xc'));var _0x25a469=this[_0xa669('0xb')](_0xa669('0xd'));var _0xb8ced9=this[_0xa669('0xb')]('strategy');if(_0x44e966===_0xa669('0xe')){return _0xb8ced9;}if(_0x25a469===_0xa669('0xf')&&_0xb8ced9===_0xa669('0x7')||_0x25a469===_0xa669('0xf')&&_0xb8ced9===_0xa669('0x10')){return _0xb8ced9;}if(_0x25a469==='progressive'||_0x25a469===_0xa669('0x11')||_0x25a469===_0xa669('0x12')){return _0xb8ced9;}return null;}},'servicelevel':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xa669('0x13')](0xb)},'timeout':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xa669('0x2')]},'weight':{'type':Sequelize[_0xa669('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no'),'defaultValue':_0xa669('0x14')},'autopause':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no',_0xa669('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xa669('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x14'),'no'),'defaultValue':_0xa669('0x14')},'announce_holdtime':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x14'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xa669('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0xa669('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xa669('0x2')]},'queue_youarenext':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xa669('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xa669('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xa669('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xa669('0x2')]},'queue_less_than':{'type':Sequelize[_0xa669('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x17ef3d){this[_0xa669('0xa')](_0xa669('0x17'),_0x17ef3d?_0x17ef3d[_0xa669('0x18')](','):[]);},'get':function(){return this[_0xa669('0xb')](_0xa669('0x17'))?this[_0xa669('0xb')](_0xa669('0x17'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xa669('0x14'),'set':function(_0x3d011e){this[_0xa669('0xa')]('joinempty',_0x3d011e?_0x3d011e[_0xa669('0x18')](','):undefined);},'get':function(){return this['getDataValue'](_0xa669('0x19'))?this[_0xa669('0xb')](_0xa669('0x19'))[_0xa669('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x4bd0c2){this['setDataValue'](_0xa669('0x1b'),_0x4bd0c2?_0x4bd0c2[_0xa669('0x18')](','):undefined);},'get':function(){return this[_0xa669('0xb')](_0xa669('0x1b'))?this['getDataValue']('leavewhenempty')[_0xa669('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xa669('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xa669('0x2')]},'description':{'type':Sequelize[_0xa669('0x2')]},'acw':{'type':Sequelize[_0xa669('0x1c')],'defaultValue':0x0,'set':function(_0x3ff1de){this[_0xa669('0xa')]('acw',_0x3ff1de);if(_0x3ff1de){if(this[_0xa669('0xb')](_0xa669('0x1d'))<0x2){this[_0xa669('0xa')](_0xa669('0x1d'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xa669('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xa669('0x1c')],'defaultValue':0x0,'comment':_0xa669('0x1e')},'dialMethod':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x1f'),_0xa669('0x20'),_0xa669('0x12'),'predictive',_0xa669('0xf')),'defaultValue':_0xa669('0x20'),'comment':_0xa669('0x21')},'dialLimitChannel':{'type':Sequelize[_0xa669('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa669('0x22')},'dialLimitQueue':{'type':Sequelize[_0xa669('0x13')](0x4)[_0xa669('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xa669('0x24')},'dialPowerLevel':{'type':Sequelize[_0xa669('0x25')](0x2)[_0xa669('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0xa669('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0xa669('0x16')](_0xa669('0x27'),_0xa669('0x28')),'defaultValue':'dropRate','comment':_0xa669('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xa669('0x25')](0x2)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xa669('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xa669('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xa669('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0xa669('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xa669('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xa669('0x2')],'defaultValue':'tTxX','comment':_0xa669('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x2e')},'dialQueueProject':{'type':Sequelize[_0xa669('0x2')],'comment':_0xa669('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xa669('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa669('0x31')},'dialBusyMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x32')},'dialBusyRetryFrequency':{'type':Sequelize[_0xa669('0x13')](0x5)[_0xa669('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa669('0x33')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xa669('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa669('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xa669('0x35')},'dialTimezone':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xa669('0x2')],'defaultValue':_0xa669('0x36')},'dialPrefix':{'type':Sequelize[_0xa669('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0xa669('0x37'),_0xa669('0x38'),_0xa669('0x39')),'defaultValue':_0xa669('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xa669('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xa669('0x13')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xa669('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xa669('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xa669('0x13')](0x9)[_0xa669('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa669('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0xa669('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xa669('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xa669('0x13')](0x9)[_0xa669('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xa669('0x3d')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xa669('0x13')](0x9)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xa669('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xa669('0x13')](0x5)[_0xa669('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xa669('0x13')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xa669('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0xa669('0x13')](0x5)[_0xa669('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xa669('0x40')},'dialRecallInQueue':{'type':Sequelize[_0xa669('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xa669('0x16')]('DESC','ASC'),'defaultValue':_0xa669('0x41')},'dialQueueProject2':{'type':Sequelize[_0xa669('0x2')],'comment':_0xa669('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xa669('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xa669('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xa669('0x42')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xa669('0x13')](0x5)[_0xa669('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa669('0x43')},'dialDropMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x44')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x45')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xa669('0x13')](0x5)[_0xa669('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xa669('0x46')},'dialMachineRetryFrequency':{'type':Sequelize[_0xa669('0x13')](0x5)[_0xa669('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa669('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xa669('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xa669('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xa669('0x49')},'mandatoryDisposition':{'type':Sequelize[_0xa669('0x1c')],'defaultValue':![],'comment':_0xa669('0x4a'),'set':function(_0x4f50f4){if(!_0x4f50f4)this[_0xa669('0xa')]('mandatoryDispositionPauseId',null);this[_0xa669('0xa')]('mandatoryDisposition',_0x4f50f4);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xa669('0x13')](0x3)[_0xa669('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xa669('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xa669('0x1c')],'defaultValue':!![]}}; \ No newline at end of file +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 diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 51949de..975c108 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 _0x7750=['../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','./voiceQueue.socket','register','status','end','json','undefined','limit','count','offset','apply','reject','save','update','destroy','then','get','VoiceQueues','inbound','filter','ignore','map','value','type','find','name','sendStatus','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','includeAll','include','findAll','rows','catch','attributes','options','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','userProfileId','autoAssociation','UserProfileResource','clone','params','keys','omit','createdAt','updatedAt','body','create','QueueCampaigns','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','VoiceQueueId','CmHopper','getHopperHistories','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','Agents','online','voicePause','interface','flatMap','penalty','addTeams','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','userVoiceQueue:save','removeTeams','User','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','SELECT','every','TeamId','includes','all','compact','transaction','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','NOW()','CmListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','ListId','COALESCE(phone,\x27\x27)','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2a0ad3,_0x3e5795){var _0x1e501b=function(_0x464914){while(--_0x464914){_0x2a0ad3['push'](_0x2a0ad3['shift']());}};_0x1e501b(++_0x3e5795);}(_0x7750,0x16b));var _0x0775=function(_0x59a046,_0x34ebe3){_0x59a046=_0x59a046-0x0;var _0x2454ab=_0x7750[_0x59a046];return _0x2454ab;};'use strict';var emlformat=require(_0x0775('0x0'));var rimraf=require(_0x0775('0x1'));var zipdir=require(_0x0775('0x2'));var jsonpatch=require(_0x0775('0x3'));var rp=require(_0x0775('0x4'));var moment=require(_0x0775('0x5'));var BPromise=require(_0x0775('0x6'));var Mustache=require(_0x0775('0x7'));var util=require(_0x0775('0x8'));var path=require(_0x0775('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0775('0xa'));var fs=require('fs');var fs_extra=require(_0x0775('0xb'));var _=require(_0x0775('0xc'));var squel=require(_0x0775('0xd'));var crypto=require(_0x0775('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0775('0xf'));var toCsv=require(_0x0775('0x10'));var querystring=require(_0x0775('0x11'));var Papa=require(_0x0775('0x12'));var Redis=require(_0x0775('0x13'));var authService=require(_0x0775('0x14'));var qs=require(_0x0775('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0775('0x16'));var logger=require('../../config/logger')(_0x0775('0x17'));var utils=require(_0x0775('0x18'));var config=require(_0x0775('0x19'));var licenseUtil=require(_0x0775('0x1a'));var db=require(_0x0775('0x1b'))['db'];config['redis']=_[_0x0775('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0775('0x1d')]));require(_0x0775('0x1e'))[_0x0775('0x1f')](socket);function respondWithStatusCode(_0x1f985c,_0x5e5cf1){_0x5e5cf1=_0x5e5cf1||0xcc;return function(_0x464d7e){if(_0x464d7e){return _0x1f985c['sendStatus'](_0x5e5cf1);}return _0x1f985c[_0x0775('0x20')](_0x5e5cf1)[_0x0775('0x21')]();};}function respondWithResult(_0x509a03,_0xecc2f5){_0xecc2f5=_0xecc2f5||0xc8;return function(_0x48895f){if(_0x48895f){return _0x509a03[_0x0775('0x20')](_0xecc2f5)[_0x0775('0x22')](_0x48895f);}};}function respondWithFilteredResult(_0x13790d,_0x273ea6){return function(_0x26f47e){if(_0x26f47e){var _0x141895=typeof _0x273ea6['offset']===_0x0775('0x23')&&typeof _0x273ea6[_0x0775('0x24')]==='undefined';var _0x22975c=_0x26f47e[_0x0775('0x25')];var _0xf70a31=_0x141895?0x0:_0x273ea6['offset'];var _0x2e68f2=_0x141895?_0x26f47e[_0x0775('0x25')]:_0x273ea6[_0x0775('0x26')]+_0x273ea6[_0x0775('0x24')];var _0x1dc8aa;if(_0x2e68f2>=_0x22975c){_0x2e68f2=_0x22975c;_0x1dc8aa=0xc8;}else{_0x1dc8aa=0xce;}_0x13790d[_0x0775('0x20')](_0x1dc8aa);return _0x13790d['set']('Content-Range',_0xf70a31+'-'+_0x2e68f2+'/'+_0x22975c)[_0x0775('0x22')](_0x26f47e);}return null;};}function patchUpdates(_0x360526){return function(_0x10b29f){try{jsonpatch[_0x0775('0x27')](_0x10b29f,_0x360526,!![]);}catch(_0x2d3c01){return BPromise[_0x0775('0x28')](_0x2d3c01);}return _0x10b29f[_0x0775('0x29')]();};}function saveUpdates(_0x2dfd7a,_0x39a3e0){return function(_0x5839c2){if(_0x5839c2){return _0x5839c2[_0x0775('0x2a')](_0x2dfd7a)['then'](function(_0x3b5ffe){return _0x3b5ffe;});}return null;};}function removeEntity(_0x56cbc2,_0x46960e){return function(_0x5921ca){if(_0x5921ca){return _0x5921ca[_0x0775('0x2b')]()[_0x0775('0x2c')](function(){var _0x489e7f=_0x5921ca[_0x0775('0x2d')]({'plain':!![]});var _0x4ac44d=[{'name':_0x0775('0x2e'),'value':_0x0775('0x2f'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x5a61c0=_(_0x4ac44d)[_0x0775('0x30')](_0x0775('0x31'))[_0x0775('0x32')](_0x0775('0x33'))[_0x0775('0x33')]();if(_['includes'](_0x5a61c0,_0x489e7f[_0x0775('0x34')])){return;}var _0x473e70=_[_0x0775('0x35')](_0x4ac44d,[_0x0775('0x33'),_0x489e7f[_0x0775('0x34')]])[_0x0775('0x36')];return db['UserProfileResource'][_0x0775('0x2b')]({'where':{'type':_0x473e70,'resourceId':_0x489e7f['id']}})[_0x0775('0x2c')](function(){return _0x5921ca;});})[_0x0775('0x2c')](function(){_0x56cbc2['status'](0xcc)[_0x0775('0x21')]();});}};}function handleEntityNotFound(_0x3433cc,_0x3675b5){return function(_0x5b38bf){if(!_0x5b38bf){_0x3433cc[_0x0775('0x37')](0x194);}return _0x5b38bf;};}function handleError(_0x4d81bb,_0x572199){_0x572199=_0x572199||0x1f4;return function(_0x342d95){logger[_0x0775('0x38')](_0x342d95[_0x0775('0x39')]);if(_0x342d95['name']){delete _0x342d95[_0x0775('0x36')];}_0x4d81bb[_0x0775('0x20')](_0x572199)[_0x0775('0x3a')](_0x342d95);};}exports[_0x0775('0x3b')]=function(_0x19163e,_0x41cbd7){var _0x568bcf={},_0x395d51={},_0x47096f={'count':0x0,'rows':[]};var _0x5b7db1=_[_0x0775('0x32')](db[_0x0775('0x3c')][_0x0775('0x3d')],function(_0x22d784){return{'name':_0x22d784[_0x0775('0x3e')],'type':_0x22d784['type'][_0x0775('0x3f')]};});_0x395d51[_0x0775('0x40')]=_['map'](_0x5b7db1,_0x0775('0x36'));_0x395d51[_0x0775('0x41')]=_['keys'](_0x19163e[_0x0775('0x41')]);_0x395d51['filters']=_[_0x0775('0x42')](_0x395d51['model'],_0x395d51[_0x0775('0x41')]);_0x568bcf['attributes']=_['intersection'](_0x395d51[_0x0775('0x40')],qs[_0x0775('0x43')](_0x19163e['query']['fields']));_0x568bcf['attributes']=_0x568bcf['attributes'][_0x0775('0x44')]?_0x568bcf['attributes']:_0x395d51[_0x0775('0x40')];if(!_0x19163e[_0x0775('0x41')][_0x0775('0x45')](_0x0775('0x46'))){_0x568bcf[_0x0775('0x24')]=qs[_0x0775('0x24')](_0x19163e['query']['limit']);_0x568bcf[_0x0775('0x26')]=qs['offset'](_0x19163e['query'][_0x0775('0x26')]);}_0x568bcf[_0x0775('0x47')]=qs[_0x0775('0x48')](_0x19163e[_0x0775('0x41')][_0x0775('0x48')]);_0x568bcf[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x19163e[_0x0775('0x41')],_0x395d51['filters']),_0x5b7db1);if(_0x19163e[_0x0775('0x41')][_0x0775('0x30')]){_0x568bcf['where']=_['merge'](_0x568bcf[_0x0775('0x49')],{'$or':_[_0x0775('0x32')](_0x5b7db1,function(_0x510d99){if(_0x510d99[_0x0775('0x34')]!=='VIRTUAL'){var _0x43c668={};_0x43c668[_0x510d99[_0x0775('0x36')]]={'$like':'%'+_0x19163e[_0x0775('0x41')][_0x0775('0x30')]+'%'};return _0x43c668;}})});}_0x568bcf=_[_0x0775('0x4c')]({},_0x568bcf,_0x19163e['options']);var _0x390777={'where':_0x568bcf[_0x0775('0x49')]};return db[_0x0775('0x3c')][_0x0775('0x25')](_0x390777)['then'](function(_0x4b60bd){_0x47096f['count']=_0x4b60bd;if(_0x19163e[_0x0775('0x41')][_0x0775('0x4d')]){_0x568bcf[_0x0775('0x4e')]=[{'all':!![]}];}return db[_0x0775('0x3c')][_0x0775('0x4f')](_0x568bcf);})['then'](function(_0x5d1370){_0x47096f[_0x0775('0x50')]=_0x5d1370;return _0x47096f;})['then'](respondWithFilteredResult(_0x41cbd7,_0x568bcf))[_0x0775('0x51')](handleError(_0x41cbd7,null));};exports['show']=function(_0x48fe9e,_0x32b65b){var _0x1f8db1={'raw':![],'where':{'id':_0x48fe9e['params']['id']}},_0x1a1803={};_0x1a1803[_0x0775('0x40')]=_['keys'](db[_0x0775('0x3c')]['rawAttributes']);_0x1a1803['query']=_['keys'](_0x48fe9e[_0x0775('0x41')]);_0x1a1803[_0x0775('0x4a')]=_['intersection'](_0x1a1803[_0x0775('0x40')],_0x1a1803['query']);_0x1f8db1[_0x0775('0x52')]=_['intersection'](_0x1a1803['model'],qs[_0x0775('0x43')](_0x48fe9e['query'][_0x0775('0x43')]));_0x1f8db1[_0x0775('0x52')]=_0x1f8db1[_0x0775('0x52')][_0x0775('0x44')]?_0x1f8db1[_0x0775('0x52')]:_0x1a1803['model'];if(_0x48fe9e[_0x0775('0x41')]['includeAll']){_0x1f8db1['include']=[{'all':!![]}];}_0x1f8db1=_[_0x0775('0x4c')]({},_0x1f8db1,_0x48fe9e[_0x0775('0x53')]);return db['VoiceQueue'][_0x0775('0x35')](_0x1f8db1)[_0x0775('0x2c')](handleEntityNotFound(_0x32b65b,null))[_0x0775('0x2c')](respondWithResult(_0x32b65b,null))['catch'](handleError(_0x32b65b,null));};exports['create']=function(_0x20d770,_0x7b91f8){return db[_0x0775('0x3c')]['create'](_0x20d770['body'],{})[_0x0775('0x2c')](function(_0x71ddc){var _0x4a20a3=_0x20d770[_0x0775('0x54')]['get']({'plain':!![]});if(!_0x4a20a3)throw new Error(_0x0775('0x55'));if(_0x4a20a3[_0x0775('0x56')]===_0x0775('0x54')){var _0x18a29a=_0x71ddc[_0x0775('0x2d')]({'plain':!![]});var _0x3d6882=[{'name':_0x0775('0x2e'),'value':_0x0775('0x2f')},{'name':'QueueCampaigns','value':_0x0775('0x57')}];var _0x33fab5=_[_0x0775('0x35')](_0x3d6882,[_0x0775('0x33'),_0x18a29a[_0x0775('0x34')]])['name'];return db['UserProfileSection'][_0x0775('0x35')]({'where':{'name':_0x33fab5,'userProfileId':_0x4a20a3[_0x0775('0x58')]},'raw':!![]})[_0x0775('0x2c')](function(_0x545f34){if(_0x545f34&&_0x545f34[_0x0775('0x59')]===0x0){return db[_0x0775('0x5a')]['create']({'name':_0x18a29a[_0x0775('0x36')],'resourceId':_0x18a29a['id'],'type':_0x545f34[_0x0775('0x36')],'sectionId':_0x545f34['id']},{})['then'](function(){return _0x71ddc;});}else{return _0x71ddc;}})[_0x0775('0x51')](function(_0x61a512){logger[_0x0775('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x61a512);throw _0x61a512;});}return _0x71ddc;})[_0x0775('0x2c')](respondWithResult(_0x7b91f8,0xc9))['catch'](handleError(_0x7b91f8,null));};exports[_0x0775('0x5b')]=function(_0x113e71,_0x3fefd5){var _0x4da65f={'where':{'id':_0x113e71[_0x0775('0x5c')]['id']}},_0x3af681={};_0x3af681[_0x0775('0x40')]=_[_0x0775('0x5d')](db[_0x0775('0x3c')][_0x0775('0x3d')]);_0x4da65f['attributes']=_['intersection'](_0x3af681['model'],qs[_0x0775('0x43')](_0x113e71['query'][_0x0775('0x43')]));_0x4da65f[_0x0775('0x52')]=_0x4da65f[_0x0775('0x52')]['length']?_0x4da65f[_0x0775('0x52')]:_0x3af681[_0x0775('0x40')];if(_0x113e71[_0x0775('0x41')]['includeAll']){_0x4da65f[_0x0775('0x4e')]=[{'all':!![]}];}_0x4da65f=_[_0x0775('0x4c')]({},_0x4da65f,_0x113e71[_0x0775('0x53')]);return db[_0x0775('0x3c')]['find'](_0x4da65f)['then'](handleEntityNotFound(_0x3fefd5,null))[_0x0775('0x2c')](function(_0x3965dd){if(_0x3965dd){var _0x508049=_0x3965dd[_0x0775('0x2d')]({'plain':!![]});_0x508049=qs[_0x0775('0x5e')](_0x508049,['id',_0x0775('0x5f'),_0x0775('0x60')]);_0x113e71[_0x0775('0x61')]=_[_0x0775('0x5e')](_0x113e71[_0x0775('0x61')],['id',_0x0775('0x5f'),_0x0775('0x60')]);return db[_0x0775('0x3c')][_0x0775('0x62')](_[_0x0775('0x4c')](_0x508049,_0x113e71[_0x0775('0x61')]),{'include':_0x113e71['query'][_0x0775('0x4d')]?[{'all':!![]}]:undefined})[_0x0775('0x2c')](function(_0x8bbeee){var _0x596dbe=_0x113e71['user'][_0x0775('0x2d')]({'plain':!![]});if(!_0x596dbe)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x596dbe[_0x0775('0x56')]===_0x0775('0x54')){var _0x34a5fc=_0x8bbeee['get']({'plain':!![]});var _0x474aba=[{'name':_0x0775('0x2e'),'value':_0x0775('0x2f')},{'name':_0x0775('0x63'),'value':_0x0775('0x57')}];var _0x2b3168=_[_0x0775('0x35')](_0x474aba,[_0x0775('0x33'),_0x34a5fc[_0x0775('0x34')]])['name'];return db['UserProfileSection'][_0x0775('0x35')]({'where':{'name':_0x2b3168,'userProfileId':_0x596dbe[_0x0775('0x58')]},'raw':!![]})['then'](function(_0x10a213){if(_0x10a213&&_0x10a213[_0x0775('0x59')]===0x0){return db[_0x0775('0x5a')]['create']({'name':_0x34a5fc[_0x0775('0x36')],'resourceId':_0x34a5fc['id'],'type':_0x10a213[_0x0775('0x36')],'sectionId':_0x10a213['id']},{})[_0x0775('0x2c')](function(){return _0x8bbeee;});}else{return _0x8bbeee;}})[_0x0775('0x51')](function(_0x215e52){logger[_0x0775('0x38')](_0x0775('0x64'),_0x215e52);throw _0x215e52;});}return _0x8bbeee;});}})[_0x0775('0x2c')](respondWithResult(_0x3fefd5,0xc9))[_0x0775('0x51')](handleError(_0x3fefd5,null));};exports['update']=function(_0x51cfb0,_0x56efc3){if(_0x51cfb0['body']['id']){delete _0x51cfb0[_0x0775('0x61')]['id'];}return db[_0x0775('0x3c')][_0x0775('0x35')]({'where':{'id':_0x51cfb0[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x56efc3,null))['then'](saveUpdates(_0x51cfb0[_0x0775('0x61')],null))[_0x0775('0x2c')](respondWithResult(_0x56efc3,null))[_0x0775('0x51')](handleError(_0x56efc3,null));};exports['destroy']=function(_0x143921,_0x38f5a8){return db[_0x0775('0x3c')]['find']({'where':{'id':_0x143921[_0x0775('0x5c')]['id']}})['then'](handleEntityNotFound(_0x38f5a8,null))['then'](removeEntity(_0x38f5a8,null))[_0x0775('0x51')](handleError(_0x38f5a8,null));};exports[_0x0775('0x65')]=function(_0x454726,_0x5a8054,_0x57ab4b){var _0x33d4e1={'raw':![],'where':{}};var _0xbac02e={};var _0x5f37de={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0x454726[_0x0775('0x5c')]['id']}})['then'](handleEntityNotFound(_0x5a8054,null))['then'](function(_0x4ed126){if(_0x4ed126){_0xbac02e['model']=_[_0x0775('0x5d')](db['CmHopper'][_0x0775('0x3d')]);_0xbac02e[_0x0775('0x41')]=_[_0x0775('0x5d')](_0x454726['query']);_0xbac02e['filters']=_[_0x0775('0x42')](_0xbac02e[_0x0775('0x40')],_0xbac02e[_0x0775('0x41')]);_0x33d4e1[_0x0775('0x52')]=_['intersection'](_0xbac02e[_0x0775('0x40')],qs[_0x0775('0x43')](_0x454726[_0x0775('0x41')][_0x0775('0x43')]));_0x33d4e1[_0x0775('0x52')]=_0x33d4e1[_0x0775('0x52')][_0x0775('0x44')]?_0x33d4e1['attributes']:_0xbac02e[_0x0775('0x40')];if(!_0x454726['query'][_0x0775('0x45')](_0x0775('0x46'))){_0x33d4e1[_0x0775('0x24')]=qs[_0x0775('0x24')](_0x454726[_0x0775('0x41')][_0x0775('0x24')]);_0x33d4e1[_0x0775('0x26')]=qs[_0x0775('0x26')](_0x454726[_0x0775('0x41')][_0x0775('0x26')]);}_0x33d4e1[_0x0775('0x47')]=qs[_0x0775('0x48')](_0x454726['query']['sort']);_0x33d4e1['where']=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x454726[_0x0775('0x41')],_0xbac02e[_0x0775('0x4a')]));_0x33d4e1[_0x0775('0x49')][_0x0775('0x66')]=_0x4ed126['id'];if(_0x454726[_0x0775('0x41')]['filter']){_0x33d4e1[_0x0775('0x49')]=_[_0x0775('0x4c')](_0x33d4e1['where'],{'$or':_[_0x0775('0x32')](_0x33d4e1[_0x0775('0x52')],function(_0x230f30){var _0x2ce196={};_0x2ce196[_0x230f30]={'$like':'%'+_0x454726[_0x0775('0x41')][_0x0775('0x30')]+'%'};return _0x2ce196;})});}_0x33d4e1=_['merge']({},_0x33d4e1,_0x454726[_0x0775('0x53')]);return db[_0x0775('0x67')][_0x0775('0x25')]({'where':_0x33d4e1[_0x0775('0x49')]})[_0x0775('0x2c')](function(_0x39d431){_0x5f37de[_0x0775('0x25')]=_0x39d431;if(_0x454726['query'][_0x0775('0x4d')]){_0x33d4e1['include']=[{'all':!![]}];}return db[_0x0775('0x67')][_0x0775('0x4f')](_0x33d4e1);})[_0x0775('0x2c')](function(_0x5bfbb3){_0x5f37de[_0x0775('0x50')]=_0x5bfbb3;return _0x5f37de;});}})['then'](respondWithFilteredResult(_0x5a8054,_0x33d4e1))[_0x0775('0x51')](handleError(_0x5a8054,null));};exports[_0x0775('0x68')]=function(_0xc106f4,_0x4cbea7,_0x498e16){var _0x28c759={'raw':!![],'where':{}};var _0x593f4d={};var _0xd4c934={'count':0x0,'rows':[]};return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0xc106f4[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x4cbea7,null))[_0x0775('0x2c')](function(_0x2669fd){if(_0x2669fd){_0x593f4d[_0x0775('0x40')]=_['keys'](db['CmHopperHistory']['rawAttributes']);_0x593f4d[_0x0775('0x41')]=_['keys'](_0xc106f4[_0x0775('0x41')]);_0x593f4d[_0x0775('0x4a')]=_[_0x0775('0x42')](_0x593f4d[_0x0775('0x40')],_0x593f4d[_0x0775('0x41')]);_0x28c759[_0x0775('0x52')]=_[_0x0775('0x42')](_0x593f4d['model'],qs['fields'](_0xc106f4[_0x0775('0x41')][_0x0775('0x43')]));_0x28c759[_0x0775('0x52')]=_0x28c759[_0x0775('0x52')][_0x0775('0x44')]?_0x28c759[_0x0775('0x52')]:_0x593f4d[_0x0775('0x40')];if(!_0xc106f4[_0x0775('0x41')]['hasOwnProperty']('nolimit')){_0x28c759['limit']=qs['limit'](_0xc106f4[_0x0775('0x41')][_0x0775('0x24')]);_0x28c759[_0x0775('0x26')]=qs[_0x0775('0x26')](_0xc106f4[_0x0775('0x41')]['offset']);}_0x28c759[_0x0775('0x47')]=qs[_0x0775('0x48')](_0xc106f4[_0x0775('0x41')]['sort']);_0x28c759[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0xc106f4[_0x0775('0x41')],_0x593f4d[_0x0775('0x4a')]));_0x28c759[_0x0775('0x49')][_0x0775('0x66')]=_0x2669fd['id'];if(_0xc106f4[_0x0775('0x41')][_0x0775('0x30')]){_0x28c759['where']=_['merge'](_0x28c759[_0x0775('0x49')],{'$or':_['map'](_0x28c759[_0x0775('0x52')],function(_0x7561ef){var _0x42d77d={};_0x42d77d[_0x7561ef]={'$like':'%'+_0xc106f4['query'][_0x0775('0x30')]+'%'};return _0x42d77d;})});}_0x28c759=_['merge']({},_0x28c759,_0xc106f4[_0x0775('0x53')]);return db[_0x0775('0x6a')][_0x0775('0x25')]({'where':_0x28c759['where']})[_0x0775('0x2c')](function(_0x4665d6){_0xd4c934[_0x0775('0x25')]=_0x4665d6;if(_0xc106f4[_0x0775('0x41')][_0x0775('0x4d')]){_0x28c759[_0x0775('0x4e')]=[{'all':!![]}];}return db[_0x0775('0x6a')][_0x0775('0x4f')](_0x28c759);})[_0x0775('0x2c')](function(_0x2e3956){_0xd4c934[_0x0775('0x50')]=_0x2e3956;return _0xd4c934;});}})[_0x0775('0x2c')](respondWithFilteredResult(_0x4cbea7,_0x28c759))['catch'](handleError(_0x4cbea7,null));};exports[_0x0775('0x6b')]=function(_0x467f6d,_0xcd1ad9,_0x2df76b){var _0x5ca4a3={'raw':!![],'where':{}};var _0x1faacd={};var _0xb94e80={'count':0x0,'rows':[]};return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0x467f6d[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0xcd1ad9,null))[_0x0775('0x2c')](function(_0x21a359){if(_0x21a359){_0x1faacd[_0x0775('0x40')]=_[_0x0775('0x5d')](db[_0x0775('0x6c')]['rawAttributes']);_0x1faacd['query']=_[_0x0775('0x5d')](_0x467f6d[_0x0775('0x41')]);_0x1faacd[_0x0775('0x4a')]=_[_0x0775('0x42')](_0x1faacd[_0x0775('0x40')],_0x1faacd[_0x0775('0x41')]);_0x5ca4a3[_0x0775('0x52')]=_[_0x0775('0x42')](_0x1faacd[_0x0775('0x40')],qs[_0x0775('0x43')](_0x467f6d['query']['fields']));_0x5ca4a3[_0x0775('0x52')]=_0x5ca4a3[_0x0775('0x52')][_0x0775('0x44')]?_0x5ca4a3[_0x0775('0x52')]:_0x1faacd[_0x0775('0x40')];if(!_0x467f6d[_0x0775('0x41')][_0x0775('0x45')](_0x0775('0x46'))){_0x5ca4a3[_0x0775('0x24')]=qs[_0x0775('0x24')](_0x467f6d['query'][_0x0775('0x24')]);_0x5ca4a3[_0x0775('0x26')]=qs[_0x0775('0x26')](_0x467f6d[_0x0775('0x41')][_0x0775('0x26')]);}_0x5ca4a3[_0x0775('0x47')]=qs[_0x0775('0x48')](_0x467f6d[_0x0775('0x41')][_0x0775('0x48')]);_0x5ca4a3[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x467f6d[_0x0775('0x41')],_0x1faacd['filters']));_0x5ca4a3['where'][_0x0775('0x66')]=_0x21a359['id'];if(_0x467f6d[_0x0775('0x41')]['filter']){_0x5ca4a3[_0x0775('0x49')]=_['merge'](_0x5ca4a3[_0x0775('0x49')],{'$or':_['map'](_0x5ca4a3[_0x0775('0x52')],function(_0x33f500){var _0x2936f1={};_0x2936f1[_0x33f500]={'$like':'%'+_0x467f6d[_0x0775('0x41')][_0x0775('0x30')]+'%'};return _0x2936f1;})});}_0x5ca4a3=_[_0x0775('0x4c')]({},_0x5ca4a3,_0x467f6d[_0x0775('0x53')]);return db[_0x0775('0x6c')]['count']({'where':_0x5ca4a3[_0x0775('0x49')]})[_0x0775('0x2c')](function(_0x25c9e3){_0xb94e80[_0x0775('0x25')]=_0x25c9e3;if(_0x467f6d[_0x0775('0x41')]['includeAll']){_0x5ca4a3[_0x0775('0x4e')]=[{'all':!![]}];}return db[_0x0775('0x6c')][_0x0775('0x4f')](_0x5ca4a3);})['then'](function(_0x3693f8){_0xb94e80['rows']=_0x3693f8;return _0xb94e80;});}})['then'](respondWithFilteredResult(_0xcd1ad9,_0x5ca4a3))[_0x0775('0x51')](handleError(_0xcd1ad9,null));};exports[_0x0775('0x6d')]=function(_0xff503d,_0x5abc09,_0x3e11a2){var _0x14b9da={'raw':!![],'where':{}};var _0x550962={};var _0x4fe6ad={'count':0x0,'rows':[]};return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0xff503d[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x5abc09,null))[_0x0775('0x2c')](function(_0x390f5b){if(_0x390f5b){_0x550962[_0x0775('0x40')]=_[_0x0775('0x5d')](db[_0x0775('0x6e')][_0x0775('0x3d')]);_0x550962['query']=_[_0x0775('0x5d')](_0xff503d['query']);_0x550962[_0x0775('0x4a')]=_[_0x0775('0x42')](_0x550962[_0x0775('0x40')],_0x550962['query']);_0x14b9da['attributes']=_[_0x0775('0x42')](_0x550962[_0x0775('0x40')],qs[_0x0775('0x43')](_0xff503d[_0x0775('0x41')][_0x0775('0x43')]));_0x14b9da[_0x0775('0x52')]=_0x14b9da[_0x0775('0x52')][_0x0775('0x44')]?_0x14b9da[_0x0775('0x52')]:_0x550962['model'];if(!_0xff503d['query'][_0x0775('0x45')](_0x0775('0x46'))){_0x14b9da[_0x0775('0x24')]=qs['limit'](_0xff503d[_0x0775('0x41')][_0x0775('0x24')]);_0x14b9da[_0x0775('0x26')]=qs[_0x0775('0x26')](_0xff503d[_0x0775('0x41')][_0x0775('0x26')]);}_0x14b9da[_0x0775('0x47')]=qs[_0x0775('0x48')](_0xff503d[_0x0775('0x41')][_0x0775('0x48')]);_0x14b9da[_0x0775('0x49')]=qs['filters'](_[_0x0775('0x4b')](_0xff503d[_0x0775('0x41')],_0x550962[_0x0775('0x4a')]));_0x14b9da[_0x0775('0x49')][_0x0775('0x66')]=_0x390f5b['id'];if(_0xff503d[_0x0775('0x41')][_0x0775('0x30')]){_0x14b9da['where']=_[_0x0775('0x4c')](_0x14b9da[_0x0775('0x49')],{'$or':_['map'](_0x14b9da[_0x0775('0x52')],function(_0xb21033){var _0x12da93={};_0x12da93[_0xb21033]={'$like':'%'+_0xff503d[_0x0775('0x41')]['filter']+'%'};return _0x12da93;})});}_0x14b9da=_[_0x0775('0x4c')]({},_0x14b9da,_0xff503d['options']);return db[_0x0775('0x6e')][_0x0775('0x25')]({'where':_0x14b9da[_0x0775('0x49')]})[_0x0775('0x2c')](function(_0x229158){_0x4fe6ad[_0x0775('0x25')]=_0x229158;if(_0xff503d[_0x0775('0x41')][_0x0775('0x4d')]){_0x14b9da[_0x0775('0x4e')]=[{'all':!![]}];}return db[_0x0775('0x6e')][_0x0775('0x4f')](_0x14b9da);})['then'](function(_0x2c2042){_0x4fe6ad[_0x0775('0x50')]=_0x2c2042;return _0x4fe6ad;});}})[_0x0775('0x2c')](respondWithFilteredResult(_0x5abc09,_0x14b9da))[_0x0775('0x51')](handleError(_0x5abc09,null));};exports[_0x0775('0x6f')]=function(_0x13dd79,_0x836ccf,_0x38bed8){var _0x33e6e4={};var _0x56f9f9={};var _0x30dd38;var _0x3936e5;return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0x13dd79[_0x0775('0x5c')]['id']}})['then'](handleEntityNotFound(_0x836ccf,null))['then'](function(_0x1b5135){if(_0x1b5135){_0x30dd38=_0x1b5135;_0x56f9f9[_0x0775('0x40')]=_[_0x0775('0x5d')](db[_0x0775('0x70')]['rawAttributes']);_0x56f9f9[_0x0775('0x41')]=_['keys'](_0x13dd79['query']);_0x56f9f9['filters']=_[_0x0775('0x42')](_0x56f9f9[_0x0775('0x40')],_0x56f9f9['query']);_0x33e6e4[_0x0775('0x52')]=_['intersection'](_0x56f9f9[_0x0775('0x40')],qs['fields'](_0x13dd79[_0x0775('0x41')][_0x0775('0x43')]));_0x33e6e4[_0x0775('0x52')]=_0x33e6e4[_0x0775('0x52')][_0x0775('0x44')]?_0x33e6e4[_0x0775('0x52')]:_0x56f9f9[_0x0775('0x40')];_0x33e6e4[_0x0775('0x47')]=qs['sort'](_0x13dd79[_0x0775('0x41')]['sort']);_0x33e6e4[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x13dd79[_0x0775('0x41')],_0x56f9f9[_0x0775('0x4a')]));if(_0x13dd79[_0x0775('0x41')][_0x0775('0x30')]){_0x33e6e4[_0x0775('0x49')]=_[_0x0775('0x4c')](_0x33e6e4[_0x0775('0x49')],{'$or':_[_0x0775('0x32')](_0x33e6e4[_0x0775('0x52')],function(_0x2c6089){var _0x126ba1={};_0x126ba1[_0x2c6089]={'$like':'%'+_0x13dd79[_0x0775('0x41')][_0x0775('0x30')]+'%'};return _0x126ba1;})});}_0x33e6e4=_[_0x0775('0x4c')]({},_0x33e6e4,_0x13dd79[_0x0775('0x53')]);return _0x30dd38[_0x0775('0x6f')](_0x33e6e4);}})[_0x0775('0x2c')](function(_0x505dd8){if(_0x505dd8){_0x3936e5=_0x505dd8[_0x0775('0x44')];if(!_0x13dd79[_0x0775('0x41')]['hasOwnProperty']('nolimit')){_0x33e6e4[_0x0775('0x24')]=qs[_0x0775('0x24')](_0x13dd79['query']['limit']);_0x33e6e4[_0x0775('0x26')]=qs[_0x0775('0x26')](_0x13dd79['query'][_0x0775('0x26')]);}return _0x30dd38[_0x0775('0x6f')](_0x33e6e4);}})['then'](function(_0x40e570){if(_0x40e570){return _0x40e570?{'count':_0x3936e5,'rows':_0x40e570}:null;}})[_0x0775('0x2c')](respondWithResult(_0x836ccf,null))[_0x0775('0x51')](handleError(_0x836ccf,null));};exports['addTeams']=function(_0x25ff1e,_0x96ff63,_0x1cfd37){var _0x361a90=_0x25ff1e[_0x0775('0x61')][_0x0775('0x71')];var _0x5f1e67=_[_0x0775('0x32')](_0x361a90,'id');return db['Team'][_0x0775('0x4f')]({'where':{'id':_0x5f1e67},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0775('0x72'),'attributes':['id',_0x0775('0x36'),_0x0775('0x73'),_0x0775('0x74'),_0x0775('0x75')],'raw':!![]}]})['then'](function(_0x276e5e){if(_0x276e5e){var _0x5aded1=_[_0x0775('0x76')](_0x276e5e,function(_0xdd8478){var _0x32d118=_0xdd8478[_0x0775('0x2d')]({'plain':!![]});_0x32d118[_0x0775('0x72')]['forEach'](function(_0x5adf10){_0x5adf10['penalty']=_[_0x0775('0x35')](_0x361a90,{'id':_0x32d118['id']})[_0x0775('0x77')];});return _0x32d118[_0x0775('0x72')];});return db[_0x0775('0x3c')]['find']({'where':{'id':_0x25ff1e[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](function(_0x3bae98){return db['sequelize']['transaction'](function(_0x5a2d98){return _0x3bae98[_0x0775('0x78')](_0x5f1e67,{'transaction':_0x5a2d98})['then'](function(){return BPromise[_0x0775('0x79')](_0x361a90,function(_0x476232){return db[_0x0775('0x7a')][_0x0775('0x7b')]({'TeamId':_0x476232['id'],'VoiceQueueId':_0x25ff1e[_0x0775('0x5c')]['id'],'penalty':_0x476232[_0x0775('0x77')]},{'transaction':_0x5a2d98});});})['then'](function(){return BPromise[_0x0775('0x79')](_0x5aded1,function(_0x378ceb){return db[_0x0775('0x7c')][_0x0775('0x7d')]({'where':{'UserId':_0x378ceb['id'],'VoiceQueueId':_0x25ff1e['params']['id']},'defaults':{'penalty':_0x378ceb[_0x0775('0x77')]},'transaction':_0x5a2d98});});})['then'](function(){return BPromise[_0x0775('0x79')](_[_0x0775('0x30')](_0x5aded1,{'online':!![]}),function(_0x3d6616){return db[_0x0775('0x7e')]['upsert']({'membername':_0x3d6616[_0x0775('0x36')],'UserId':_0x3d6616['id'],'queue_name':_0x3bae98[_0x0775('0x36')],'VoiceQueueId':_0x3bae98['id'],'interface':_[_0x0775('0x7f')](_0x3d6616[_0x0775('0x75')])?util[_0x0775('0x80')](_0x0775('0x81'),_0x3d6616[_0x0775('0x36')]):_0x3d6616['interface'],'paused':_0x3d6616[_0x0775('0x74')]||![],'penalty':_0x3d6616[_0x0775('0x77')]},{'transaction':_0x5a2d98});});})['then'](function(){_0x5aded1[_0x0775('0x82')](function(_0x2605ae){socket[_0x0775('0x83')](_0x0775('0x84'),{'UserId':_0x2605ae['id'],'VoiceQueueId':_0x3bae98['id']});});});});});}})['then'](respondWithStatusCode(_0x96ff63,null))[_0x0775('0x51')](handleError(_0x96ff63,null));};exports[_0x0775('0x85')]=function(_0xe16d47,_0x27ee20,_0x1d1205){return db[_0x0775('0x70')][_0x0775('0x4f')]({'where':{'id':_0xe16d47[_0x0775('0x41')]['ids']},'attributes':['id'],'include':[{'model':db[_0x0775('0x86')],'as':_0x0775('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x27ee20,null))[_0x0775('0x2c')](function(_0x15468a){var _0x52c424=_[_0x0775('0x32')](_0x15468a,'id');var _0x5b5602=[];var _0x4c5561=[];var _0x37ed79=squel[_0x0775('0x87')]();_0x37ed79[_0x0775('0x88')](_0x0775('0x89'))['from'](_0x0775('0x8a'),'tq')[_0x0775('0x8b')](_0x0775('0x8c'),'ut',_0x0775('0x8d'))[_0x0775('0x49')](_0x0775('0x8e'),_0xe16d47['params']['id']);for(var _0x5f1c4b=0x0;_0x5f1c4b<_0x15468a[_0x0775('0x44')];_0x5f1c4b+=0x1){let _0x4f38af=_0x15468a[_0x5f1c4b];for(var _0x3c6d6a=0x0;_0x3c6d6a<_0x4f38af[_0x0775('0x72')][_0x0775('0x44')];_0x3c6d6a+=0x1){let _0x58f6d6=_0x4f38af[_0x0775('0x72')][_0x3c6d6a];var _0x368717=_0x37ed79['clone']();_0x368717[_0x0775('0x49')](_0x0775('0x8f'),_0x58f6d6['id']);_0x4c5561[_0x0775('0x90')](db[_0x0775('0x91')][_0x0775('0x41')](_0x368717[_0x0775('0x92')](),{'type':db['sequelize']['QueryTypes'][_0x0775('0x93')]})[_0x0775('0x2c')](function(_0x2da528){if(_0x2da528[_0x0775('0x44')]===0x1){return _0x58f6d6['id'];}else{var _0x7026aa=_[_0x0775('0x94')](_['map'](_0x2da528,_0x0775('0x95')),function(_0x12c911){return _[_0x0775('0x96')](_0x52c424,_0x12c911);});if(_0x7026aa){return _0x58f6d6['id'];}}}));}}return BPromise[_0x0775('0x97')](_0x4c5561)['then'](function(_0x395708){_0x5b5602=_(_0x5b5602)['union'](_0x395708)[_0x0775('0x98')]()[_0x0775('0x33')]();return db[_0x0775('0x3c')][_0x0775('0x35')]({'where':{'id':_0xe16d47['params']['id']}})[_0x0775('0x2c')](function(_0x199cd9){return db[_0x0775('0x91')][_0x0775('0x99')](function(_0x3c9b01){return _0x199cd9['removeTeams'](_0xe16d47['query'][_0x0775('0x9a')],{'transaction':_0x3c9b01})[_0x0775('0x2c')](function(){if(!_[_0x0775('0x9b')](_0x5b5602)){return _0x199cd9[_0x0775('0x9c')](_0x5b5602,{'transaction':_0x3c9b01})[_0x0775('0x2c')](function(){return db['UserVoiceQueueRt'][_0x0775('0x2b')]({'where':{'VoiceQueueId':_0xe16d47[_0x0775('0x5c')]['id'],'UserId':_0x5b5602},'transaction':_0x3c9b01});});}})[_0x0775('0x2c')](function(){_0x5b5602['forEach'](function(_0x1e1198){socket[_0x0775('0x83')](_0x0775('0x9d'),{'UserId':_0x1e1198,'VoiceQueueId':_0x199cd9['id']});});});});});});})[_0x0775('0x2c')](respondWithStatusCode(_0x27ee20,null))['catch'](handleError(_0x27ee20,null));};exports[_0x0775('0x9e')]=function(_0x66abda,_0x48789a,_0x41ccbc){var _0x3ebbbd,_0x2f1a2c;return db[_0x0775('0x3c')]['find']({'where':{'id':_0x66abda[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x48789a,null))[_0x0775('0x2c')](function(_0xbe35e2){if(_0xbe35e2){_0x2f1a2c=_0xbe35e2;return _0xbe35e2['addAgents'](_0x66abda[_0x0775('0x61')][_0x0775('0x9a')],_[_0x0775('0x5e')](_0x66abda['body'],[_0x0775('0x9a'),'id'])||{})[_0x0775('0x9f')](function(_0x1dc727){for(var _0xa3e1b7=0x0;_0xa3e1b7<_0x66abda['body'][_0x0775('0x9a')][_0x0775('0x44')];_0xa3e1b7+=0x1){socket['emit'](_0x0775('0x84'),{'UserId':Number(_0x66abda[_0x0775('0x61')]['ids'][_0xa3e1b7]),'VoiceQueueId':Number(_0x66abda[_0x0775('0x5c')]['id'])});}return _0x1dc727;});}})[_0x0775('0x2c')](function(_0x1da8ad){_0x3ebbbd=_0x1da8ad||[];if(_0x2f1a2c){return db[_0x0775('0x86')][_0x0775('0x4f')]({'where':{'id':_0x66abda[_0x0775('0x61')][_0x0775('0x9a')]},'attributes':['id',_0x0775('0x36'),'online',_0x0775('0x74'),_0x0775('0x75')],'raw':!![]});}})[_0x0775('0x2c')](function(_0x3bee4b){if(!_[_0x0775('0x9b')](_0x3bee4b)){var _0x2cc654=[];for(var _0x1f0c2c=0x0;_0x1f0c2c<_0x3bee4b[_0x0775('0x44')];_0x1f0c2c++){if(_0x3bee4b[_0x1f0c2c][_0x0775('0x73')]){_0x2cc654[_0x0775('0x90')](db[_0x0775('0x7e')]['upsert']({'membername':_0x3bee4b[_0x1f0c2c]['name'],'UserId':_0x3bee4b[_0x1f0c2c]['id'],'queue_name':_0x2f1a2c['name'],'VoiceQueueId':_0x2f1a2c['id'],'interface':_['isNil'](_0x3bee4b[_0x1f0c2c][_0x0775('0x75')])?util[_0x0775('0x80')](_0x0775('0x81'),_0x3bee4b[_0x1f0c2c]['name']):_0x3bee4b[_0x1f0c2c][_0x0775('0x75')],'paused':_0x3bee4b[_0x1f0c2c][_0x0775('0x74')]||![],'penalty':_0x66abda[_0x0775('0x61')][_0x0775('0x77')]||0x0}));}}return BPromise[_0x0775('0x97')](_0x2cc654);}})[_0x0775('0x2c')](function(){return _0x3ebbbd;})['then'](respondWithResult(_0x48789a,null))[_0x0775('0x51')](handleError(_0x48789a,null));};exports[_0x0775('0x9c')]=function(_0x2012bd,_0x48caee,_0x30bc09){return db[_0x0775('0x3c')][_0x0775('0x35')]({'where':{'id':_0x2012bd[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x48caee,null))['then'](function(_0x119f38){if(_0x119f38){return _0x119f38[_0x0775('0x9c')](_0x2012bd[_0x0775('0x41')][_0x0775('0x9a')])[_0x0775('0x2c')](function(){if(_[_0x0775('0xa0')](_0x2012bd['query'][_0x0775('0x9a')])){for(var _0x1c55b8=0x0;_0x1c55b8<_0x2012bd[_0x0775('0x41')][_0x0775('0x9a')][_0x0775('0x44')];_0x1c55b8+=0x1){socket[_0x0775('0x83')](_0x0775('0x9d'),{'UserId':Number(_0x2012bd[_0x0775('0x41')][_0x0775('0x9a')][_0x1c55b8]),'VoiceQueueId':Number(_0x2012bd[_0x0775('0x5c')]['id'])});}}else{socket[_0x0775('0x83')](_0x0775('0x9d'),{'UserId':Number(_0x2012bd[_0x0775('0x41')][_0x0775('0x9a')]),'VoiceQueueId':Number(_0x2012bd[_0x0775('0x5c')]['id'])});}});}})[_0x0775('0x2c')](function(_0xb85d3e){return db[_0x0775('0x7e')][_0x0775('0x2b')]({'where':{'VoiceQueueId':_0x2012bd[_0x0775('0x5c')]['id'],'UserId':_0x2012bd[_0x0775('0x41')][_0x0775('0x9a')]}})[_0x0775('0x2c')](function(){return _0xb85d3e;});})[_0x0775('0x2c')](respondWithStatusCode(_0x48caee,null))[_0x0775('0x51')](handleError(_0x48caee,null));};exports['getAgents']=function(_0x2f15b8,_0xda8d04,_0x59361c){var _0xc97612={};var _0x3ef03a={};var _0x52f463;var _0x55e31f;return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0x2f15b8[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0xda8d04,null))['then'](function(_0x3eed76){if(_0x3eed76){_0x52f463=_0x3eed76;_0x3ef03a[_0x0775('0x40')]=_[_0x0775('0x5d')](db[_0x0775('0x86')][_0x0775('0x3d')]);_0x3ef03a[_0x0775('0x41')]=_[_0x0775('0x5d')](_0x2f15b8[_0x0775('0x41')]);_0x3ef03a[_0x0775('0x4a')]=_[_0x0775('0x42')](_0x3ef03a['model'],_0x3ef03a[_0x0775('0x41')]);_0xc97612[_0x0775('0x52')]=_[_0x0775('0x42')](_0x3ef03a['model'],qs[_0x0775('0x43')](_0x2f15b8[_0x0775('0x41')]['fields']));_0xc97612[_0x0775('0x52')]=_0xc97612[_0x0775('0x52')]['length']?_0xc97612[_0x0775('0x52')]:_0x3ef03a['model'];_0xc97612['order']=qs[_0x0775('0x48')](_0x2f15b8[_0x0775('0x41')][_0x0775('0x48')]);_0xc97612[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x2f15b8[_0x0775('0x41')],_0x3ef03a['filters']));if(_0x2f15b8[_0x0775('0x41')][_0x0775('0x30')]){_0xc97612[_0x0775('0x49')]=_['merge'](_0xc97612[_0x0775('0x49')],{'$or':_[_0x0775('0x32')](_0xc97612[_0x0775('0x52')],function(_0x1047d8){var _0x161642={};_0x161642[_0x1047d8]={'$like':'%'+_0x2f15b8['query'][_0x0775('0x30')]+'%'};return _0x161642;})});}_0xc97612=_[_0x0775('0x4c')]({},_0xc97612,_0x2f15b8['options']);return _0x52f463[_0x0775('0xa1')](_0xc97612);}})[_0x0775('0x2c')](function(_0x3aeff1){if(_0x3aeff1){_0x55e31f=_0x3aeff1[_0x0775('0x44')];if(!_0x2f15b8[_0x0775('0x41')]['hasOwnProperty'](_0x0775('0x46'))){_0xc97612[_0x0775('0x24')]=qs[_0x0775('0x24')](_0x2f15b8[_0x0775('0x41')]['limit']);_0xc97612[_0x0775('0x26')]=qs[_0x0775('0x26')](_0x2f15b8[_0x0775('0x41')][_0x0775('0x26')]);}return _0x52f463[_0x0775('0xa1')](_0xc97612);}})['then'](function(_0x54f2d5){if(_0x54f2d5){return _0x54f2d5?{'count':_0x55e31f,'rows':_0x54f2d5}:null;}})['then'](respondWithResult(_0xda8d04,null))['catch'](handleError(_0xda8d04,null));};exports['getMembers']=function(_0x4887cd,_0x57d9af,_0x1e74be){var _0x3915b3={};var _0x620079={};var _0x90063b;var _0x598dca;return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0x4887cd[_0x0775('0x5c')]['id']}})['then'](handleEntityNotFound(_0x57d9af,null))['then'](function(_0x568bf4){if(_0x568bf4){_0x90063b=_0x568bf4;_0x620079[_0x0775('0x40')]=_['keys'](db[_0x0775('0x7e')][_0x0775('0x3d')]);_0x620079['query']=_[_0x0775('0x5d')](_0x4887cd[_0x0775('0x41')]);_0x620079['filters']=_[_0x0775('0x42')](_0x620079[_0x0775('0x40')],_0x620079['query']);_0x3915b3[_0x0775('0x52')]=_[_0x0775('0x42')](_0x620079[_0x0775('0x40')],qs[_0x0775('0x43')](_0x4887cd[_0x0775('0x41')]['fields']));_0x3915b3[_0x0775('0x52')]=_0x3915b3[_0x0775('0x52')]['length']?_0x3915b3['attributes']:_0x620079[_0x0775('0x40')];_0x3915b3[_0x0775('0x47')]=qs[_0x0775('0x48')](_0x4887cd[_0x0775('0x41')][_0x0775('0x48')]);_0x3915b3[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x4887cd[_0x0775('0x41')],_0x620079[_0x0775('0x4a')]));if(_0x4887cd[_0x0775('0x41')][_0x0775('0x30')]){_0x3915b3[_0x0775('0x49')]=_['merge'](_0x3915b3[_0x0775('0x49')],{'$or':_[_0x0775('0x32')](_0x3915b3[_0x0775('0x52')],function(_0x57c9fe){var _0x4ed74f={};_0x4ed74f[_0x57c9fe]={'$like':'%'+_0x4887cd['query'][_0x0775('0x30')]+'%'};return _0x4ed74f;})});}_0x3915b3=_[_0x0775('0x4c')]({},_0x3915b3,_0x4887cd[_0x0775('0x53')]);return _0x90063b[_0x0775('0xa2')](_0x3915b3);}})[_0x0775('0x2c')](function(_0x1a927b){if(_0x1a927b){_0x598dca=_0x1a927b[_0x0775('0x44')];if(!_0x4887cd[_0x0775('0x41')][_0x0775('0x45')](_0x0775('0x46'))){_0x3915b3['limit']=qs[_0x0775('0x24')](_0x4887cd[_0x0775('0x41')][_0x0775('0x24')]);_0x3915b3['offset']=qs['offset'](_0x4887cd[_0x0775('0x41')][_0x0775('0x26')]);}return _0x90063b[_0x0775('0xa2')](_0x3915b3);}})[_0x0775('0x2c')](function(_0x2015be){return _0x2015be?{'count':_0x598dca,'rows':_0x2015be}:null;})[_0x0775('0x2c')](respondWithResult(_0x57d9af,null))['catch'](handleError(_0x57d9af,null));};exports[_0x0775('0xa3')]=function(_0x926495,_0x28ec9f,_0x3008e5){var _0x4381f0={};var _0x2144ee={};var _0x22f22f;var _0xa71d4a;return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0x926495[_0x0775('0x5c')]['id']}})['then'](handleEntityNotFound(_0x28ec9f,null))[_0x0775('0x2c')](function(_0x38eefc){if(_0x38eefc){_0x22f22f=_0x38eefc;_0x2144ee['model']=_['keys'](db[_0x0775('0xa4')]['rawAttributes']);_0x2144ee[_0x0775('0x41')]=_[_0x0775('0x5d')](_0x926495[_0x0775('0x41')]);_0x2144ee[_0x0775('0x4a')]=_['intersection'](_0x2144ee['model'],_0x2144ee[_0x0775('0x41')]);_0x4381f0[_0x0775('0x52')]=_[_0x0775('0x42')](_0x2144ee[_0x0775('0x40')],qs[_0x0775('0x43')](_0x926495[_0x0775('0x41')][_0x0775('0x43')]));_0x4381f0['attributes']=_0x4381f0[_0x0775('0x52')][_0x0775('0x44')]?_0x4381f0['attributes']:_0x2144ee[_0x0775('0x40')];_0x4381f0[_0x0775('0x47')]=qs['sort'](_0x926495[_0x0775('0x41')][_0x0775('0x48')]);_0x4381f0[_0x0775('0x49')]=qs[_0x0775('0x4a')](_['pick'](_0x926495['query'],_0x2144ee[_0x0775('0x4a')]));if(_0x926495[_0x0775('0x41')][_0x0775('0x30')]){_0x4381f0[_0x0775('0x49')]=_['merge'](_0x4381f0[_0x0775('0x49')],{'$or':_['map'](_0x4381f0[_0x0775('0x52')],function(_0x5b5c73){var _0x369e76={};_0x369e76[_0x5b5c73]={'$like':'%'+_0x926495[_0x0775('0x41')]['filter']+'%'};return _0x369e76;})});}_0x4381f0=_[_0x0775('0x4c')]({},_0x4381f0,_0x926495['options']);return _0x22f22f[_0x0775('0xa3')](_0x4381f0);}})[_0x0775('0x2c')](function(_0x480577){if(_0x480577){_0xa71d4a=_0x480577[_0x0775('0x44')];if(!_0x926495['query'][_0x0775('0x45')](_0x0775('0x46'))){_0x4381f0[_0x0775('0x24')]=qs[_0x0775('0x24')](_0x926495[_0x0775('0x41')]['limit']);_0x4381f0[_0x0775('0x26')]=qs[_0x0775('0x26')](_0x926495[_0x0775('0x41')][_0x0775('0x26')]);}return _0x22f22f[_0x0775('0xa3')](_0x4381f0);}})[_0x0775('0x2c')](function(_0x2a5718){if(_0x2a5718){return _0x2a5718?{'count':_0xa71d4a,'rows':_0x2a5718}:null;}})[_0x0775('0x2c')](respondWithResult(_0x28ec9f,null))[_0x0775('0x51')](handleError(_0x28ec9f,null));};exports[_0x0775('0xa5')]=function(_0x584c27,_0x247398,_0x2bd3b1){var _0x2c8a25,_0x591a53;return db[_0x0775('0x3c')]['find']({'where':{'id':_0x584c27[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x247398,null))['then'](function(_0x3d967a){if(_0x3d967a){_0x591a53=_0x3d967a;return _0x3d967a[_0x0775('0xa5')](_0x584c27[_0x0775('0x61')][_0x0775('0x9a')],_['omit'](_0x584c27['body'],[_0x0775('0x9a'),'id'])||{});}return null;})[_0x0775('0x9f')](function(_0x2bdb61){var _0x2208d1;_0x2c8a25=_0x2bdb61||[];var _0x5a0701=[];if(_0x2bdb61){for(var _0x45d1cf=0x0;_0x45d1cf<_0x2bdb61[_0x0775('0x44')];_0x45d1cf+=0x1){var _0x16d607=_0x2bdb61[_0x45d1cf][_0x0775('0x2d')]({'plain':!![]});_0x591a53['dialCheckDuplicateType']=_0x584c27[_0x0775('0x61')][_0x0775('0xa6')]?_0x584c27['body'][_0x0775('0xa6')]:_0x591a53[_0x0775('0xa6')];switch(_0x591a53[_0x0775('0xa6')]){case _0x0775('0xa7'):_0x2208d1=squel[_0x0775('0xa8')]()[_0x0775('0xa9')](_0x0775('0xaa'))[_0x0775('0xab')]([_0x0775('0xac'),_0x0775('0xad'),_0x0775('0xae'),'ListId',_0x0775('0x66'),_0x0775('0x5f'),_0x0775('0x60')],squel['select']()[_0x0775('0x88')](_0x0775('0xac'),_0x0775('0xac'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0xad'))[_0x0775('0x88')]('id','ContactId')[_0x0775('0x88')](_0x16d607[_0x0775('0xb0')]['toString'](),'ListId')['field'](_0x584c27['params']['id'][_0x0775('0x92')](),_0x0775('0x66'))[_0x0775('0x88')]('NOW()',_0x0775('0x5f'))['field']('NOW()',_0x0775('0x60'))[_0x0775('0xb1')](_0x0775('0xb2'))[_0x0775('0x49')](_0x0775('0xb3'))[_0x0775('0x49')](_0x0775('0xb4'),_0x16d607[_0x0775('0xb0')][_0x0775('0x92')]())[_0x0775('0x49')](_0x0775('0xb5'))[_0x0775('0x49')](_0x0775('0xb6'),squel[_0x0775('0x87')]()['field'](_0x0775('0xb7'))[_0x0775('0xb1')](_0x0775('0xb8'))['where']('VoiceQueueId\x20=\x20?',_0x584c27['params']['id']['toString']()))['where'](_0x0775('0xb6'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x0775('0xb1')](_0x0775('0xaa'))['where'](_0x0775('0x8e'),_0x584c27[_0x0775('0x5c')]['id']['toString']())))['toString']();break;case _0x0775('0xb9'):_0x2208d1=squel['insert']()['into'](_0x0775('0xaa'))[_0x0775('0xab')]([_0x0775('0xac'),_0x0775('0xad'),_0x0775('0xae'),_0x0775('0xba'),'VoiceQueueId',_0x0775('0x5f'),_0x0775('0x60')],squel[_0x0775('0x87')]()[_0x0775('0x88')]('phone',_0x0775('0xac'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0xad'))[_0x0775('0x88')]('id',_0x0775('0xae'))[_0x0775('0x88')](_0x16d607['CmListId']['toString'](),'ListId')[_0x0775('0x88')](_0x584c27[_0x0775('0x5c')]['id'][_0x0775('0x92')](),_0x0775('0x66'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0x5f'))[_0x0775('0x88')]('NOW()',_0x0775('0x60'))[_0x0775('0xb1')]('cm_contacts')[_0x0775('0x49')]('deletedAt\x20IS\x20NULL')[_0x0775('0x49')]('ListId\x20=\x20?',_0x16d607[_0x0775('0xb0')]['toString']())[_0x0775('0x49')]('phone\x20IS\x20NOT\x20NULL')[_0x0775('0x49')](_0x0775('0xb6'),squel['select']()[_0x0775('0x88')](_0x0775('0xbb'))[_0x0775('0xb1')](_0x0775('0xaa'))['where'](_0x0775('0x8e'),_0x584c27[_0x0775('0x5c')]['id'][_0x0775('0x92')]())))['toString']();break;default:_0x2208d1=squel[_0x0775('0xa8')]()['into'](_0x0775('0xaa'))[_0x0775('0xab')]([_0x0775('0xac'),_0x0775('0xad'),'ContactId','ListId',_0x0775('0x66'),_0x0775('0x5f'),_0x0775('0x60')],squel[_0x0775('0x87')]()[_0x0775('0x88')]('phone',_0x0775('0xac'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0xad'))[_0x0775('0x88')]('id',_0x0775('0xae'))[_0x0775('0x88')](_0x16d607[_0x0775('0xb0')]['toString'](),_0x0775('0xba'))[_0x0775('0x88')](_0x584c27[_0x0775('0x5c')]['id']['toString'](),_0x0775('0x66'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0x5f'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0x60'))[_0x0775('0xb1')]('cm_contacts')['where'](_0x0775('0xb3'))[_0x0775('0x49')](_0x0775('0xb4'),_0x16d607[_0x0775('0xb0')]['toString']())[_0x0775('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x0775('0x92')]();}_0x5a0701[_0x0775('0x90')](db[_0x0775('0x91')][_0x0775('0x41')](_0x2208d1));}return BPromise['all'](_0x5a0701);}})['then'](function(){return _0x2c8a25;})[_0x0775('0x2c')](respondWithResult(_0x247398,null))[_0x0775('0x51')](handleError(_0x247398,null));};exports[_0x0775('0xbc')]=function(_0x3c84b5,_0x55ae6a,_0x352015){return db[_0x0775('0x3c')][_0x0775('0x35')]({'where':{'id':_0x3c84b5[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x55ae6a,null))['then'](function(_0x382bd0){if(_0x382bd0){return _0x382bd0[_0x0775('0xbc')](_0x3c84b5[_0x0775('0x41')][_0x0775('0x9a')]);}})[_0x0775('0x2c')](function(_0x55ef91){if(_0x55ef91){return db[_0x0775('0x67')]['destroy']({'where':{'ListId':_0x3c84b5[_0x0775('0x41')][_0x0775('0x9a')],'VoiceQueueId':_0x3c84b5['params']['id']}})[_0x0775('0x2c')](function(){return _0x55ef91;});}})['then'](respondWithStatusCode(_0x55ae6a,null))['catch'](handleError(_0x55ae6a,null));};exports[_0x0775('0xbd')]=function(_0x4ed7e6,_0x27236a,_0x3c480a){var _0x167d34={};var _0x10f3c9={};var _0x4a1d26;var _0x28c84a;return db[_0x0775('0x3c')][_0x0775('0x69')]({'where':{'id':_0x4ed7e6['params']['id']}})['then'](handleEntityNotFound(_0x27236a,null))['then'](function(_0x26170d){if(_0x26170d){_0x4a1d26=_0x26170d;_0x10f3c9[_0x0775('0x40')]=_['keys'](db['CmList'][_0x0775('0x3d')]);_0x10f3c9[_0x0775('0x41')]=_['keys'](_0x4ed7e6[_0x0775('0x41')]);_0x10f3c9[_0x0775('0x4a')]=_[_0x0775('0x42')](_0x10f3c9[_0x0775('0x40')],_0x10f3c9['query']);_0x167d34[_0x0775('0x52')]=_[_0x0775('0x42')](_0x10f3c9[_0x0775('0x40')],qs[_0x0775('0x43')](_0x4ed7e6[_0x0775('0x41')][_0x0775('0x43')]));_0x167d34[_0x0775('0x52')]=_0x167d34['attributes'][_0x0775('0x44')]?_0x167d34['attributes']:_0x10f3c9['model'];_0x167d34['order']=qs['sort'](_0x4ed7e6[_0x0775('0x41')]['sort']);_0x167d34[_0x0775('0x49')]=qs[_0x0775('0x4a')](_[_0x0775('0x4b')](_0x4ed7e6[_0x0775('0x41')],_0x10f3c9[_0x0775('0x4a')]));if(_0x4ed7e6[_0x0775('0x41')][_0x0775('0x30')]){_0x167d34[_0x0775('0x49')]=_[_0x0775('0x4c')](_0x167d34['where'],{'$or':_[_0x0775('0x32')](_0x167d34[_0x0775('0x52')],function(_0x3bbdb3){var _0x239fdb={};_0x239fdb[_0x3bbdb3]={'$like':'%'+_0x4ed7e6[_0x0775('0x41')]['filter']+'%'};return _0x239fdb;})});}_0x167d34=_['merge']({},_0x167d34,_0x4ed7e6[_0x0775('0x53')]);return _0x4a1d26['getBlackLists'](_0x167d34);}})[_0x0775('0x2c')](function(_0x392db5){if(_0x392db5){_0x28c84a=_0x392db5[_0x0775('0x44')];if(!_0x4ed7e6['query']['hasOwnProperty'](_0x0775('0x46'))){_0x167d34[_0x0775('0x24')]=qs['limit'](_0x4ed7e6[_0x0775('0x41')][_0x0775('0x24')]);_0x167d34[_0x0775('0x26')]=qs[_0x0775('0x26')](_0x4ed7e6[_0x0775('0x41')][_0x0775('0x26')]);}return _0x4a1d26[_0x0775('0xbd')](_0x167d34);}})[_0x0775('0x2c')](function(_0x304198){if(_0x304198){return _0x304198?{'count':_0x28c84a,'rows':_0x304198}:null;}})[_0x0775('0x2c')](respondWithResult(_0x27236a,null))[_0x0775('0x51')](handleError(_0x27236a,null));};exports[_0x0775('0xbe')]=function(_0x2277af,_0x1f9666,_0x5eb00d){var _0x2eb5c,_0x43e382;return db['VoiceQueue'][_0x0775('0x35')]({'where':{'id':_0x2277af[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](handleEntityNotFound(_0x1f9666,null))[_0x0775('0x2c')](function(_0xb92f39){if(_0xb92f39){_0x43e382=_0xb92f39;return _0xb92f39[_0x0775('0xbe')](_0x2277af[_0x0775('0x61')][_0x0775('0x9a')],_[_0x0775('0x5e')](_0x2277af['body'],['ids','id'])||{});}return null;})['spread'](function(_0x718208){var _0x20ee90;_0x2eb5c=_0x718208||[];var _0x58e7e1=[];if(_0x718208){for(var _0x297dc9=0x0;_0x297dc9<_0x718208['length'];_0x297dc9+=0x1){var _0xf7ed5c=_0x718208[_0x297dc9]['get']({'plain':!![]});_0x20ee90=squel[_0x0775('0xa8')]()[_0x0775('0xa9')]('cm_hopper_black')['fromQuery'](['phone',_0x0775('0xae'),_0x0775('0xba'),_0x0775('0x66'),'createdAt',_0x0775('0x60')],squel[_0x0775('0x87')]()[_0x0775('0x88')](_0x0775('0xac'),'phone')[_0x0775('0x88')]('id',_0x0775('0xae'))['field'](_0xf7ed5c[_0x0775('0xb0')][_0x0775('0x92')](),'ListId')[_0x0775('0x88')](_0x2277af['params']['id'][_0x0775('0x92')](),_0x0775('0x66'))['field'](_0x0775('0xaf'),_0x0775('0x5f'))[_0x0775('0x88')](_0x0775('0xaf'),_0x0775('0x60'))['from']('cm_contacts')[_0x0775('0x49')](_0x0775('0xb3'))['where'](_0x0775('0xb4'),_0xf7ed5c[_0x0775('0xb0')]['toString']())[_0x0775('0x49')](_0x0775('0xb5')))[_0x0775('0x92')]();_0x58e7e1[_0x0775('0x90')](db[_0x0775('0x91')][_0x0775('0x41')](_0x20ee90));}return BPromise[_0x0775('0x97')](_0x58e7e1);}})[_0x0775('0x2c')](function(){return _0x2eb5c;})[_0x0775('0x2c')](respondWithResult(_0x1f9666,null))['catch'](handleError(_0x1f9666,null));};exports['removeBlackLists']=function(_0x380162,_0x398de5,_0x81c687){return db[_0x0775('0x3c')][_0x0775('0x35')]({'where':{'id':_0x380162[_0x0775('0x5c')]['id']}})['then'](handleEntityNotFound(_0x398de5,null))[_0x0775('0x2c')](function(_0x2f64bd){if(_0x2f64bd){return _0x2f64bd[_0x0775('0xbf')](_0x380162[_0x0775('0x41')][_0x0775('0x9a')]);}})[_0x0775('0x2c')](function(_0x222eaa){if(_0x222eaa){return db[_0x0775('0x6e')][_0x0775('0x2b')]({'where':{'ListId':_0x380162[_0x0775('0x41')]['ids'],'VoiceQueueId':_0x380162[_0x0775('0x5c')]['id']}})[_0x0775('0x2c')](function(){return _0x222eaa;});}})['then'](respondWithStatusCode(_0x398de5,null))[_0x0775('0x51')](handleError(_0x398de5,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index f7537bc..a87c9ec 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 _0x492c=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update'];(function(_0x395daf,_0x27ee0e){var _0x18db31=function(_0x26af9f){while(--_0x26af9f){_0x395daf['push'](_0x395daf['shift']());}};_0x18db31(++_0x27ee0e);}(_0x492c,0x7d));var _0xc492=function(_0xc31037,_0x1aa912){_0xc31037=_0xc31037-0x0;var _0x42d63a=_0x492c[_0xc31037];return _0x42d63a;};'use strict';var EventEmitter=require(_0xc492('0x0'));var VoiceQueue=require(_0xc492('0x1'))['db'][_0xc492('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xc492('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc492('0x4'),'afterDestroy':_0xc492('0x5')};function emitEvent(_0x54eca2){return function(_0x2fd0d1,_0x32fa0c,_0x26a781){VoiceQueueEvents[_0xc492('0x6')](_0x54eca2+':'+_0x2fd0d1['id'],_0x2fd0d1);VoiceQueueEvents[_0xc492('0x6')](_0x54eca2,_0x2fd0d1);_0x26a781(null);};}for(var e in events){if(events[_0xc492('0x7')](e)){var event=events[e];VoiceQueue[_0xc492('0x8')](e,emitEvent(event));}}module[_0xc492('0x9')]=VoiceQueueEvents; \ No newline at end of file +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 diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 2e4baee..f79b242 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceQueue.attributes','exports','VoiceQueue','util'];(function(_0x2cf0a2,_0x58e039){var _0x344f4f=function(_0x5f08d9){while(--_0x5f08d9){_0x2cf0a2['push'](_0x2cf0a2['shift']());}};_0x344f4f(++_0x58e039);}(_0xedd9,0xfc));var _0x9edd=function(_0x31f1a6,_0x4a6f16){_0x31f1a6=_0x31f1a6-0x0;var _0x4af41b=_0xedd9[_0x31f1a6];return _0x4af41b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _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 diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index dfea222..28a33a5 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 _0xe30f=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetVoiceQueue','VoiceQueue','options','raw','attributes','limit','include','model','map','catch','ShowVoiceQueue','find','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x59ee41,_0xaf7db8){var _0x3ecd3e=function(_0x2f9291){while(--_0x2f9291){_0x59ee41['push'](_0x59ee41['shift']());}};_0x3ecd3e(++_0xaf7db8);}(_0xe30f,0x112));var _0xfe30=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe30f[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0xfe30('0x0'));var util=require('util');var moment=require(_0xfe30('0x1'));var BPromise=require(_0xfe30('0x2'));var rs=require(_0xfe30('0x3'));var fs=require('fs');var Redis=require(_0xfe30('0x4'));var db=require(_0xfe30('0x5'))['db'];var utils=require(_0xfe30('0x6'));var logger=require(_0xfe30('0x7'))(_0xfe30('0x8'));var config=require(_0xfe30('0x9'));var jayson=require(_0xfe30('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xfe30('0xb')],{'host':_0xfe30('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe30('0xb')]));require(_0xfe30('0xd'))[_0xfe30('0xe')](socket);function respondWithRpcPromise(_0x1abb9a,_0x419f27,_0x36e61f){return new BPromise(function(_0x3b27b1,_0x1aea61){return client[_0xfe30('0xf')](_0x1abb9a,_0x36e61f)[_0xfe30('0x10')](function(_0x4156f1){logger[_0xfe30('0x11')](_0xfe30('0x12'),_0x419f27,'request\x20sent');logger[_0xfe30('0x13')](_0xfe30('0x14'),_0x419f27,'request\x20sent',JSON[_0xfe30('0x15')](_0x4156f1));if(_0x4156f1[_0xfe30('0x16')]){if(_0x4156f1[_0xfe30('0x16')][_0xfe30('0x17')]===0x1f4){logger[_0xfe30('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x419f27,_0x4156f1[_0xfe30('0x16')][_0xfe30('0x18')]);return _0x1aea61(_0x4156f1[_0xfe30('0x16')][_0xfe30('0x18')]);}logger[_0xfe30('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x419f27,_0x4156f1['error']['message']);return _0x3b27b1(_0x4156f1[_0xfe30('0x16')]['message']);}else{logger[_0xfe30('0x11')](_0xfe30('0x12'),_0x419f27,_0xfe30('0x19'));_0x3b27b1(_0x4156f1[_0xfe30('0x1a')]['message']);}})['catch'](function(_0x3af2d6){logger['error'](_0xfe30('0x12'),_0x419f27,_0x3af2d6);_0x1aea61(_0x3af2d6);});});}exports[_0xfe30('0x1b')]=function(_0x33d116){var _0x4e4f96=this;return new Promise(function(_0x291944,_0x15076d){return db[_0xfe30('0x1c')]['findAll']({'raw':_0x33d116[_0xfe30('0x1d')]?_0x33d116[_0xfe30('0x1d')][_0xfe30('0x1e')]===undefined?!![]:![]:!![],'where':_0x33d116['options']?_0x33d116['options']['where']||null:null,'attributes':_0x33d116[_0xfe30('0x1d')]?_0x33d116[_0xfe30('0x1d')][_0xfe30('0x1f')]||null:null,'limit':_0x33d116[_0xfe30('0x1d')]?_0x33d116['options'][_0xfe30('0x20')]||null:null,'include':_0x33d116[_0xfe30('0x1d')]?_0x33d116[_0xfe30('0x1d')][_0xfe30('0x21')]?_['map'](_0x33d116['options'][_0xfe30('0x21')],function(_0x10bde6){return{'model':db[_0x10bde6[_0xfe30('0x22')]],'as':_0x10bde6['as'],'attributes':_0x10bde6[_0xfe30('0x1f')],'include':_0x10bde6[_0xfe30('0x21')]?_[_0xfe30('0x23')](_0x10bde6[_0xfe30('0x21')],function(_0x485882){return{'model':db[_0x485882[_0xfe30('0x22')]],'as':_0x485882['as'],'attributes':_0x485882[_0xfe30('0x1f')],'include':_0x485882['include']?_['map'](_0x485882[_0xfe30('0x21')],function(_0x52ef93){return{'model':db[_0x52ef93['model']],'as':_0x52ef93['as'],'attributes':_0x52ef93[_0xfe30('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xfe30('0x10')](function(_0x1ad78c){logger['info'](_0xfe30('0x1b'),_0x33d116);logger[_0xfe30('0x13')](_0xfe30('0x1b'),_0x33d116,JSON[_0xfe30('0x15')](_0x1ad78c));_0x291944(_0x1ad78c);})[_0xfe30('0x24')](function(_0x5f05b4){logger[_0xfe30('0x16')](_0xfe30('0x1b'),_0x5f05b4[_0xfe30('0x18')],_0x33d116);_0x15076d(_0x4e4f96[_0xfe30('0x16')](0x1f4,_0x5f05b4[_0xfe30('0x18')]));});});};exports[_0xfe30('0x25')]=function(_0x5ed602){var _0x4bb484=this;return new Promise(function(_0x4978c4,_0x4ea6c4){return db[_0xfe30('0x1c')][_0xfe30('0x26')]({'raw':_0x5ed602[_0xfe30('0x1d')]?_0x5ed602['options'][_0xfe30('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ed602[_0xfe30('0x1d')]?_0x5ed602[_0xfe30('0x1d')][_0xfe30('0x27')]||null:null,'attributes':_0x5ed602[_0xfe30('0x1d')]?_0x5ed602[_0xfe30('0x1d')][_0xfe30('0x1f')]||null:null,'include':_0x5ed602[_0xfe30('0x1d')]?_0x5ed602[_0xfe30('0x1d')][_0xfe30('0x21')]?_[_0xfe30('0x23')](_0x5ed602['options'][_0xfe30('0x21')],function(_0xd237fc){return{'model':db[_0xd237fc[_0xfe30('0x22')]],'as':_0xd237fc['as'],'attributes':_0xd237fc[_0xfe30('0x1f')],'include':_0xd237fc[_0xfe30('0x21')]?_['map'](_0xd237fc[_0xfe30('0x21')],function(_0x31c7db){return{'model':db[_0x31c7db[_0xfe30('0x22')]],'as':_0x31c7db['as'],'attributes':_0x31c7db[_0xfe30('0x1f')],'include':_0x31c7db['include']?_[_0xfe30('0x23')](_0x31c7db[_0xfe30('0x21')],function(_0x486143){return{'model':db[_0x486143['model']],'as':_0x486143['as'],'attributes':_0x486143[_0xfe30('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c166c){logger[_0xfe30('0x11')]('ShowVoiceQueue',_0x5ed602);logger['debug'](_0xfe30('0x25'),_0x5ed602,JSON[_0xfe30('0x15')](_0x4c166c));_0x4978c4(_0x4c166c);})[_0xfe30('0x24')](function(_0x1f5084){logger[_0xfe30('0x16')]('ShowVoiceQueue',_0x1f5084[_0xfe30('0x18')],_0x5ed602);_0x4ea6c4(_0x4bb484[_0xfe30('0x16')](0x1f4,_0x1f5084['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index cecb32f..2320a35 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 _0xe290=['save','remove','emit','removeListener','length','voiceQueue:'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xe290,0xfc));var _0x0e29=function(_0xc40b9f,_0x17ec1f){_0xc40b9f=_0xc40b9f-0x0;var _0x535b9c=_0xe290[_0xc40b9f];return _0x535b9c;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x0e29('0x0'),_0x0e29('0x1'),'update'];function createListener(_0x1b314f,_0x114a98){return function(_0x5c283d){_0x114a98[_0x0e29('0x2')](_0x1b314f,_0x5c283d);};}function removeListener(_0x480f24,_0x38a03c){return function(){VoiceQueueEvents[_0x0e29('0x3')](_0x480f24,_0x38a03c);};}exports['register']=function(_0x955370){for(var _0x55d0df=0x0,_0x1261a6=events[_0x0e29('0x4')];_0x55d0df<_0x1261a6;_0x55d0df++){var _0x233c5c=events[_0x55d0df];var _0x26db55=createListener(_0x0e29('0x5')+_0x233c5c,_0x955370);VoiceQueueEvents['on'](_0x233c5c,_0x26db55);}}; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 8559f56..b643ccc 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 _0x0681=['destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete'];(function(_0x5ee0ef,_0x34f2b1){var _0x144aab=function(_0x39f698){while(--_0x39f698){_0x5ee0ef['push'](_0x5ee0ef['shift']());}};_0x144aab(++_0x34f2b1);}(_0x0681,0x10a));var _0x1068=function(_0x48a836,_0xa1d010){_0x48a836=_0x48a836-0x0;var _0x249dc8=_0x0681[_0x48a836];return _0x249dc8;};'use strict';var multer=require(_0x1068('0x0'));var util=require(_0x1068('0x1'));var path=require('path');var timeout=require(_0x1068('0x2'));var express=require('express');var router=express[_0x1068('0x3')]();var fs_extra=require(_0x1068('0x4'));var auth=require(_0x1068('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x1068('0x6'));var controller=require(_0x1068('0x7'));router[_0x1068('0x8')]('/',auth[_0x1068('0x9')](),controller['index']);router['get']('/describe',auth[_0x1068('0x9')](),controller[_0x1068('0xa')]);router[_0x1068('0x8')](_0x1068('0xb'),auth[_0x1068('0x9')](),controller[_0x1068('0xc')]);router['get'](_0x1068('0xd'),auth[_0x1068('0x9')](),controller[_0x1068('0xe')]);router[_0x1068('0xf')]('/',auth[_0x1068('0x9')](),controller[_0x1068('0x10')]);router[_0x1068('0x11')]('/:id',auth[_0x1068('0x9')](),controller[_0x1068('0x12')]);router[_0x1068('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1068('0x14')]);module[_0x1068('0x15')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index acf1e29..941e81a 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 _0xfec5=['getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','sequelize','moment','exports','STRING','DATE'];(function(_0x3eea8b,_0x396785){var _0x508e3a=function(_0x537fcc){while(--_0x537fcc){_0x3eea8b['push'](_0x3eea8b['shift']());}};_0x508e3a(++_0x396785);}(_0xfec5,0x83));var _0x5fec=function(_0x5522b3,_0xa6b54e){_0x5522b3=_0x5522b3-0x0;var _0x2db066=_0xfec5[_0x5522b3];return _0x2db066;};'use strict';var Sequelize=require(_0x5fec('0x0'));var moment=require(_0x5fec('0x1'));module[_0x5fec('0x2')]={'type':{'type':Sequelize[_0x5fec('0x3')]},'uniqueid':{'type':Sequelize[_0x5fec('0x3')]},'calleridnum':{'type':Sequelize[_0x5fec('0x3')]},'calleridname':{'type':Sequelize[_0x5fec('0x3')]},'queue':{'type':Sequelize[_0x5fec('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x5fec('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x290987){var _0x4aa3f9=moment(_0x290987);var _0xed3aec=moment(this[_0x5fec('0x5')](_0x5fec('0x6')))[_0x5fec('0x7')](_0x5fec('0x8'));var _0x41341f=_0x4aa3f9[_0x5fec('0x9')](_0xed3aec,_0x5fec('0xa'));this[_0x5fec('0xb')](_0x5fec('0xc'),_0x290987);this[_0x5fec('0xb')](_0x5fec('0xd'),_0x41341f||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x5fec('0xe')]},'queuecallerabandon':{'type':Sequelize[_0x5fec('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x5fec('0x4')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x5fec('0x4')]},'queuecallerexit':{'type':Sequelize[_0x5fec('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x5fec('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x5fec('0x10')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x5fec('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5fec('0x3')]},'context':{'type':Sequelize[_0x5fec('0x3')]},'exten':{'type':Sequelize[_0x5fec('0x3')]},'priority':{'type':Sequelize[_0x5fec('0x3')]},'holdtime':{'type':Sequelize[_0x5fec('0xe')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5fec('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x5fec('0x3')]},'transferuniqueid':{'type':Sequelize[_0x5fec('0x3')]},'disposition':{'type':Sequelize[_0x5fec('0x3')]},'secondDisposition':{'type':Sequelize[_0x5fec('0x3')]},'thirdDisposition':{'type':Sequelize[_0x5fec('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x5fec('0xe')],'defaultValue':0x0}}; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 317d4a9..d550b2b 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 _0x83ca=['filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','include','findAll','rows','catch','show','params','length','includeAll','options','create','body','find','describe','getVoiceQueuesReport','hasOwnProperty','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','localhost','socket.io-emitter','redis','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x9a49bb,_0x5332d7){var _0x53e972=function(_0x6bc818){while(--_0x6bc818){_0x9a49bb['push'](_0x9a49bb['shift']());}};_0x53e972(++_0x5332d7);}(_0x83ca,0x1ca));var _0xa83c=function(_0x161cf8,_0x5dd73a){_0x161cf8=_0x161cf8-0x0;var _0x32c491=_0x83ca[_0x161cf8];return _0x32c491;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa83c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa83c('0x1'));var rp=require(_0xa83c('0x2'));var moment=require('moment');var BPromise=require(_0xa83c('0x3'));var Mustache=require('mustache');var util=require(_0xa83c('0x4'));var path=require(_0xa83c('0x5'));var sox=require('sox');var csv=require(_0xa83c('0x6'));var ejs=require(_0xa83c('0x7'));var fs=require('fs');var fs_extra=require(_0xa83c('0x8'));var _=require(_0xa83c('0x9'));var squel=require(_0xa83c('0xa'));var crypto=require(_0xa83c('0xb'));var jsforce=require(_0xa83c('0xc'));var deskjs=require(_0xa83c('0xd'));var toCsv=require(_0xa83c('0x6'));var querystring=require(_0xa83c('0xe'));var Papa=require(_0xa83c('0xf'));var Redis=require(_0xa83c('0x10'));var authService=require(_0xa83c('0x11'));var qs=require(_0xa83c('0x12'));var as=require(_0xa83c('0x13'));var hardwareService=require(_0xa83c('0x14'));var logger=require(_0xa83c('0x15'))(_0xa83c('0x16'));var utils=require('../../config/utils');var config=require(_0xa83c('0x17'));var licenseUtil=require(_0xa83c('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xa83c('0x19'),'port':0x18eb});var socket=require(_0xa83c('0x1a'))(new Redis(config[_0xa83c('0x1b')]));require(_0xa83c('0x1c'))[_0xa83c('0x1d')](socket);function respondWithStatusCode(_0x2f64f9,_0x5a896e){_0x5a896e=_0x5a896e||0xcc;return function(_0x5c4a3f){if(_0x5c4a3f){return _0x2f64f9[_0xa83c('0x1e')](_0x5a896e);}return _0x2f64f9[_0xa83c('0x1f')](_0x5a896e)[_0xa83c('0x20')]();};}function respondWithResult(_0x3595e8,_0x166a27){_0x166a27=_0x166a27||0xc8;return function(_0x15e3b9){if(_0x15e3b9){return _0x3595e8['status'](_0x166a27)[_0xa83c('0x21')](_0x15e3b9);}};}function respondWithFilteredResult(_0x39702c,_0x1d5418){return function(_0x36222a){if(_0x36222a){var _0x2d37f6=typeof _0x1d5418[_0xa83c('0x22')]===_0xa83c('0x23')&&typeof _0x1d5418[_0xa83c('0x24')]==='undefined';var _0x3327a6=_0x36222a[_0xa83c('0x25')];var _0x25d4d3=_0x2d37f6?0x0:_0x1d5418['offset'];var _0x35242e=_0x2d37f6?_0x36222a[_0xa83c('0x25')]:_0x1d5418['offset']+_0x1d5418[_0xa83c('0x24')];var _0x34ca07;if(_0x35242e>=_0x3327a6){_0x35242e=_0x3327a6;_0x34ca07=0xc8;}else{_0x34ca07=0xce;}_0x39702c[_0xa83c('0x1f')](_0x34ca07);return _0x39702c[_0xa83c('0x26')](_0xa83c('0x27'),_0x25d4d3+'-'+_0x35242e+'/'+_0x3327a6)[_0xa83c('0x21')](_0x36222a);}return null;};}function patchUpdates(_0x4d4f82){return function(_0x1ad1b7){try{jsonpatch[_0xa83c('0x28')](_0x1ad1b7,_0x4d4f82,!![]);}catch(_0x15dff3){return BPromise[_0xa83c('0x29')](_0x15dff3);}return _0x1ad1b7['save']();};}function saveUpdates(_0x532416,_0x20027e){return function(_0x2ef37d){if(_0x2ef37d){return _0x2ef37d[_0xa83c('0x2a')](_0x532416)[_0xa83c('0x2b')](function(_0x41cc99){return _0x41cc99;});}return null;};}function removeEntity(_0x1e4ea0,_0x27d676){return function(_0x4d589c){if(_0x4d589c){return _0x4d589c[_0xa83c('0x2c')]()[_0xa83c('0x2b')](function(){_0x1e4ea0[_0xa83c('0x1f')](0xcc)[_0xa83c('0x20')]();});}};}function handleEntityNotFound(_0x345efa,_0x4fcc4a){return function(_0xf1b8c1){if(!_0xf1b8c1){_0x345efa[_0xa83c('0x1e')](0x194);}return _0xf1b8c1;};}function handleError(_0x2879eb,_0x292293){_0x292293=_0x292293||0x1f4;return function(_0x30b68a){logger[_0xa83c('0x2d')](_0x30b68a[_0xa83c('0x2e')]);if(_0x30b68a['name']){delete _0x30b68a[_0xa83c('0x2f')];}_0x2879eb[_0xa83c('0x1f')](_0x292293)[_0xa83c('0x30')](_0x30b68a);};}exports[_0xa83c('0x31')]=function(_0x5134da,_0x5afb54){var _0x24bd37={},_0x3c4f47={},_0x37d18b={'count':0x0,'rows':[]};var _0x179e03=_['map'](db[_0xa83c('0x32')][_0xa83c('0x33')],function(_0x4af7d9){return{'name':_0x4af7d9[_0xa83c('0x34')],'type':_0x4af7d9[_0xa83c('0x35')][_0xa83c('0x36')]};});_0x3c4f47[_0xa83c('0x37')]=_['map'](_0x179e03,'name');_0x3c4f47['query']=_[_0xa83c('0x38')](_0x5134da[_0xa83c('0x39')]);_0x3c4f47[_0xa83c('0x3a')]=_[_0xa83c('0x3b')](_0x3c4f47[_0xa83c('0x37')],_0x3c4f47['query']);_0x24bd37['attributes']=_['intersection'](_0x3c4f47[_0xa83c('0x37')],qs['fields'](_0x5134da[_0xa83c('0x39')][_0xa83c('0x3c')]));_0x24bd37[_0xa83c('0x3d')]=_0x24bd37[_0xa83c('0x3d')]['length']?_0x24bd37[_0xa83c('0x3d')]:_0x3c4f47['model'];if(!_0x5134da[_0xa83c('0x39')]['hasOwnProperty'](_0xa83c('0x3e'))){_0x24bd37[_0xa83c('0x24')]=qs['limit'](_0x5134da['query'][_0xa83c('0x24')]);_0x24bd37[_0xa83c('0x22')]=qs[_0xa83c('0x22')](_0x5134da[_0xa83c('0x39')]['offset']);}_0x24bd37[_0xa83c('0x3f')]=qs[_0xa83c('0x40')](_0x5134da['query']['sort']);_0x24bd37[_0xa83c('0x41')]=qs[_0xa83c('0x3a')](_[_0xa83c('0x42')](_0x5134da[_0xa83c('0x39')],_0x3c4f47[_0xa83c('0x3a')]),_0x179e03);if(_0x5134da[_0xa83c('0x39')][_0xa83c('0x43')]){_0x24bd37['where']=_[_0xa83c('0x44')](_0x24bd37[_0xa83c('0x41')],{'$or':_[_0xa83c('0x45')](_0x179e03,function(_0x56a578){if(_0x56a578[_0xa83c('0x35')]!==_0xa83c('0x46')){var _0x3db15a={};_0x3db15a[_0x56a578[_0xa83c('0x2f')]]={'$like':'%'+_0x5134da['query']['filter']+'%'};return _0x3db15a;}})});}_0x24bd37=_['merge']({},_0x24bd37,_0x5134da['options']);var _0x52d329={'where':_0x24bd37[_0xa83c('0x41')]};return db[_0xa83c('0x32')][_0xa83c('0x25')](_0x52d329)[_0xa83c('0x2b')](function(_0x511125){_0x37d18b[_0xa83c('0x25')]=_0x511125;if(_0x5134da['query']['includeAll']){_0x24bd37[_0xa83c('0x47')]=[{'all':!![]}];}return db[_0xa83c('0x32')][_0xa83c('0x48')](_0x24bd37);})[_0xa83c('0x2b')](function(_0x2855ba){_0x37d18b[_0xa83c('0x49')]=_0x2855ba;return _0x37d18b;})[_0xa83c('0x2b')](respondWithFilteredResult(_0x5afb54,_0x24bd37))[_0xa83c('0x4a')](handleError(_0x5afb54,null));};exports[_0xa83c('0x4b')]=function(_0x36d84b,_0x2d3d3d){var _0x4193cd={'raw':![],'where':{'id':_0x36d84b[_0xa83c('0x4c')]['id']}},_0x45e4a8={};_0x45e4a8[_0xa83c('0x37')]=_[_0xa83c('0x38')](db[_0xa83c('0x32')][_0xa83c('0x33')]);_0x45e4a8[_0xa83c('0x39')]=_['keys'](_0x36d84b[_0xa83c('0x39')]);_0x45e4a8[_0xa83c('0x3a')]=_[_0xa83c('0x3b')](_0x45e4a8['model'],_0x45e4a8[_0xa83c('0x39')]);_0x4193cd['attributes']=_[_0xa83c('0x3b')](_0x45e4a8['model'],qs[_0xa83c('0x3c')](_0x36d84b[_0xa83c('0x39')][_0xa83c('0x3c')]));_0x4193cd['attributes']=_0x4193cd[_0xa83c('0x3d')][_0xa83c('0x4d')]?_0x4193cd[_0xa83c('0x3d')]:_0x45e4a8[_0xa83c('0x37')];if(_0x36d84b['query'][_0xa83c('0x4e')]){_0x4193cd[_0xa83c('0x47')]=[{'all':!![]}];}_0x4193cd=_[_0xa83c('0x44')]({},_0x4193cd,_0x36d84b[_0xa83c('0x4f')]);return db[_0xa83c('0x32')]['find'](_0x4193cd)[_0xa83c('0x2b')](handleEntityNotFound(_0x2d3d3d,null))['then'](respondWithResult(_0x2d3d3d,null))[_0xa83c('0x4a')](handleError(_0x2d3d3d,null));};exports[_0xa83c('0x50')]=function(_0x246765,_0x2ffbba){return db[_0xa83c('0x32')]['create'](_0x246765[_0xa83c('0x51')],{})[_0xa83c('0x2b')](respondWithResult(_0x2ffbba,0xc9))[_0xa83c('0x4a')](handleError(_0x2ffbba,null));};exports['update']=function(_0x23fb51,_0x15b5b4){if(_0x23fb51[_0xa83c('0x51')]['id']){delete _0x23fb51['body']['id'];}return db[_0xa83c('0x32')][_0xa83c('0x52')]({'where':{'id':_0x23fb51[_0xa83c('0x4c')]['id']}})[_0xa83c('0x2b')](handleEntityNotFound(_0x15b5b4,null))[_0xa83c('0x2b')](saveUpdates(_0x23fb51[_0xa83c('0x51')],null))[_0xa83c('0x2b')](respondWithResult(_0x15b5b4,null))[_0xa83c('0x4a')](handleError(_0x15b5b4,null));};exports[_0xa83c('0x2c')]=function(_0x401deb,_0x37f92f){return db[_0xa83c('0x32')][_0xa83c('0x52')]({'where':{'id':_0x401deb[_0xa83c('0x4c')]['id']}})['then'](handleEntityNotFound(_0x37f92f,null))['then'](removeEntity(_0x37f92f,null))[_0xa83c('0x4a')](handleError(_0x37f92f,null));};exports[_0xa83c('0x53')]=function(_0x43d9e6,_0x43af80){return db[_0xa83c('0x32')]['describe']()[_0xa83c('0x2b')](respondWithResult(_0x43af80,null))['catch'](handleError(_0x43af80,null));};exports[_0xa83c('0x54')]=function(_0x4722ce,_0x117529){var _0x6e00f={},_0x50990e={},_0x1d3309={'count':0x0,'rows':[]};_0x50990e[_0xa83c('0x37')]=_[_0xa83c('0x38')](db['VoiceQueueReport'][_0xa83c('0x33')]);_0x50990e['query']=_[_0xa83c('0x38')](_0x4722ce[_0xa83c('0x39')]);_0x50990e['filters']=_[_0xa83c('0x3b')](_0x50990e[_0xa83c('0x37')],_0x50990e[_0xa83c('0x39')]);_0x6e00f[_0xa83c('0x3d')]=_[_0xa83c('0x3b')](_0x50990e[_0xa83c('0x37')],qs['fields'](_0x4722ce['query'][_0xa83c('0x3c')]));_0x6e00f[_0xa83c('0x3d')]=_0x6e00f['attributes'][_0xa83c('0x4d')]?_0x6e00f['attributes']:_0x50990e['model'];if(!_0x4722ce[_0xa83c('0x39')][_0xa83c('0x55')](_0xa83c('0x3e'))){_0x6e00f[_0xa83c('0x24')]=qs[_0xa83c('0x24')](_0x4722ce[_0xa83c('0x39')][_0xa83c('0x24')]);_0x6e00f['offset']=qs['offset'](_0x4722ce[_0xa83c('0x39')]['offset']);}_0x6e00f[_0xa83c('0x3f')]=qs[_0xa83c('0x40')](_0x4722ce['query'][_0xa83c('0x40')]);_0x6e00f[_0xa83c('0x41')]=qs['filters'](_['pick'](_0x4722ce[_0xa83c('0x39')],_0x50990e[_0xa83c('0x3a')]));if(_0x4722ce[_0xa83c('0x39')]['filter']){_0x6e00f['where']=_[_0xa83c('0x44')](_0x6e00f[_0xa83c('0x41')],{'$or':_['map'](_0x6e00f[_0xa83c('0x3d')],function(_0x3f62db){var _0x201881={};_0x201881[_0x3f62db]={'$like':'%'+_0x4722ce[_0xa83c('0x39')][_0xa83c('0x43')]+'%'};return _0x201881;})});}_0x6e00f=_[_0xa83c('0x44')]({},_0x6e00f,_0x4722ce[_0xa83c('0x4f')]);var _0x5a2b66={'where':_0x6e00f[_0xa83c('0x41')]};return db[_0xa83c('0x32')][_0xa83c('0x25')](_0x5a2b66)['then'](function(_0x31760b){_0x1d3309[_0xa83c('0x25')]=_0x31760b;if(_0x4722ce[_0xa83c('0x39')][_0xa83c('0x4e')]){_0x6e00f[_0xa83c('0x47')]=[{'all':!![]}];}return db[_0xa83c('0x32')][_0xa83c('0x48')](_0x6e00f);})[_0xa83c('0x2b')](function(_0x291bdb){_0x1d3309['rows']=_0x291bdb;return _0x1d3309;})[_0xa83c('0x2b')](respondWithFilteredResult(_0x117529,_0x6e00f,_0xa83c('0x54')))['catch'](handleError(_0x117529,null,'getVoiceQueuesReport'));}; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 5051ffd..2fcb160 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 _0xe39e=['setMaxListeners','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe39e,0x65));var _0xee39=function(_0x26b462,_0x4a2fe2){_0x26b462=_0x26b462-0x0;var _0x5050af=_0xe39e[_0x26b462];return _0x5050af;};'use strict';var EventEmitter=require(_0xee39('0x0'));var VoiceQueueReport=require(_0xee39('0x1'))['db'][_0xee39('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xee39('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xee39('0x4')};function emitEvent(_0x3ea82a){return function(_0x2ad96c,_0x23195c,_0xf46764){VoiceQueueReportEvents[_0xee39('0x5')](_0x3ea82a+':'+_0x2ad96c['id'],_0x2ad96c);VoiceQueueReportEvents[_0xee39('0x5')](_0x3ea82a,_0x2ad96c);_0xf46764(null);};}for(var e in events){if(events[_0xee39('0x6')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0xee39('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 0796b70..6dbf2db 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 _0x1d30=['define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x77ec23,_0x31dd47){var _0x213d7e=function(_0x3c9bb4){while(--_0x3c9bb4){_0x77ec23['push'](_0x77ec23['shift']());}};_0x213d7e(++_0x31dd47);}(_0x1d30,0x15e));var _0x01d3=function(_0x3e5b3b,_0xe318a4){_0x3e5b3b=_0x3e5b3b-0x0;var _0x515bb2=_0x1d30[_0x3e5b3b];return _0x515bb2;};'use strict';var _=require(_0x01d3('0x0'));var util=require('util');var logger=require(_0x01d3('0x1'))(_0x01d3('0x2'));var moment=require(_0x01d3('0x3'));var BPromise=require(_0x01d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01d3('0x5'));var rimraf=require(_0x01d3('0x6'));var config=require(_0x01d3('0x7'));var attributes=require(_0x01d3('0x8'));module[_0x01d3('0x9')]=function(_0x5a5a14,_0x11d63d){return _0x5a5a14[_0x01d3('0xa')](_0x01d3('0xb'),attributes,{'tableName':_0x01d3('0xc'),'paranoid':![],'indexes':[{'fields':[_0x01d3('0xd')]},{'fields':[_0x01d3('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 3dd3a4c..642aa23 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 _0x75b1=['then','catch','create','body','CreateVoiceQueueReport','stringify','UpdateVoiceQueueReport','update','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','code','VoiceQueueReport,\x20%s,\x20%s','message','result','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','where','options','limit','include','map','model','attributes'];(function(_0xd99138,_0x352241){var _0x50be2d=function(_0x45a605){while(--_0x45a605){_0xd99138['push'](_0xd99138['shift']());}};_0x50be2d(++_0x352241);}(_0x75b1,0xbc));var _0x175b=function(_0xe21df3,_0x5671d8){_0xe21df3=_0xe21df3-0x0;var _0x3d90b2=_0x75b1[_0xe21df3];return _0x3d90b2;};'use strict';var _=require(_0x175b('0x0'));var util=require(_0x175b('0x1'));var moment=require(_0x175b('0x2'));var BPromise=require(_0x175b('0x3'));var rs=require(_0x175b('0x4'));var fs=require('fs');var Redis=require(_0x175b('0x5'));var db=require(_0x175b('0x6'))['db'];var utils=require(_0x175b('0x7'));var logger=require(_0x175b('0x8'))('rpc');var config=require(_0x175b('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x175b('0xa')]({'port':0x232a});config[_0x175b('0xb')]=_[_0x175b('0xc')](config[_0x175b('0xb')],{'host':_0x175b('0xd'),'port':0x18eb});var socket=require(_0x175b('0xe'))(new Redis(config[_0x175b('0xb')]));require(_0x175b('0xf'))[_0x175b('0x10')](socket);function respondWithRpcPromise(_0x25e407,_0x125122,_0x37fe47){return new BPromise(function(_0x38c93a,_0x24c857){return client['request'](_0x25e407,_0x37fe47)['then'](function(_0x4da6e0){logger[_0x175b('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x125122,_0x175b('0x12'));logger[_0x175b('0x13')](_0x175b('0x14'),_0x125122,_0x175b('0x12'),JSON['stringify'](_0x4da6e0));if(_0x4da6e0[_0x175b('0x15')]){if(_0x4da6e0[_0x175b('0x15')][_0x175b('0x16')]===0x1f4){logger[_0x175b('0x15')](_0x175b('0x17'),_0x125122,_0x4da6e0[_0x175b('0x15')]['message']);return _0x24c857(_0x4da6e0[_0x175b('0x15')][_0x175b('0x18')]);}logger[_0x175b('0x15')](_0x175b('0x17'),_0x125122,_0x4da6e0[_0x175b('0x15')][_0x175b('0x18')]);return _0x38c93a(_0x4da6e0['error'][_0x175b('0x18')]);}else{logger[_0x175b('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x125122,_0x175b('0x12'));_0x38c93a(_0x4da6e0[_0x175b('0x19')][_0x175b('0x18')]);}})['catch'](function(_0x3ea613){logger[_0x175b('0x15')]('VoiceQueueReport,\x20%s,\x20%s',_0x125122,_0x3ea613);_0x24c857(_0x3ea613);});});}exports[_0x175b('0x1a')]=function(_0x24044e){var _0x33324d=this;return new Promise(function(_0x449b7f,_0x422af4){return db[_0x175b('0x1b')][_0x175b('0x1c')]({'raw':_0x24044e['options']?_0x24044e['options'][_0x175b('0x1d')]===undefined?!![]:![]:!![],'where':_0x24044e['options']?_0x24044e['options'][_0x175b('0x1e')]||null:null,'attributes':_0x24044e[_0x175b('0x1f')]?_0x24044e[_0x175b('0x1f')]['attributes']||null:null,'limit':_0x24044e[_0x175b('0x1f')]?_0x24044e[_0x175b('0x1f')][_0x175b('0x20')]||null:null,'include':_0x24044e[_0x175b('0x1f')]?_0x24044e[_0x175b('0x1f')][_0x175b('0x21')]?_[_0x175b('0x22')](_0x24044e[_0x175b('0x1f')][_0x175b('0x21')],function(_0x592524){return{'model':db[_0x592524[_0x175b('0x23')]],'as':_0x592524['as'],'attributes':_0x592524[_0x175b('0x24')],'include':_0x592524[_0x175b('0x21')]?_[_0x175b('0x22')](_0x592524['include'],function(_0x2abe4e){return{'model':db[_0x2abe4e[_0x175b('0x23')]],'as':_0x2abe4e['as'],'attributes':_0x2abe4e[_0x175b('0x24')],'include':_0x2abe4e['include']?_[_0x175b('0x22')](_0x2abe4e[_0x175b('0x21')],function(_0xa08a17){return{'model':db[_0xa08a17['model']],'as':_0xa08a17['as'],'attributes':_0xa08a17[_0x175b('0x24')]};}):[]};}):[]};}):[]:[]})[_0x175b('0x25')](function(_0x2103b6){logger[_0x175b('0x11')](_0x175b('0x1a'),_0x24044e);logger[_0x175b('0x13')](_0x175b('0x1a'),_0x24044e,JSON['stringify'](_0x2103b6));_0x449b7f(_0x2103b6);})[_0x175b('0x26')](function(_0x570dc6){logger[_0x175b('0x15')](_0x175b('0x1a'),_0x570dc6[_0x175b('0x18')],_0x24044e);_0x422af4(_0x33324d[_0x175b('0x15')](0x1f4,_0x570dc6[_0x175b('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x195dfb){var _0x45c376=this;return new Promise(function(_0x4f97b5,_0x2722de){return db[_0x175b('0x1b')][_0x175b('0x27')](_0x195dfb[_0x175b('0x28')],{'raw':_0x195dfb[_0x175b('0x1f')]?_0x195dfb['options'][_0x175b('0x1d')]===undefined?!![]:![]:!![]})[_0x175b('0x25')](function(_0xc2c2e9){logger[_0x175b('0x11')](_0x175b('0x29'),_0x195dfb);logger['debug'](_0x175b('0x29'),_0x195dfb,JSON[_0x175b('0x2a')](_0xc2c2e9));_0x4f97b5(_0xc2c2e9);})[_0x175b('0x26')](function(_0x463060){logger['error'](_0x175b('0x29'),_0x463060[_0x175b('0x18')],_0x195dfb);_0x2722de(_0x45c376[_0x175b('0x15')](0x1f4,_0x463060[_0x175b('0x18')]));});});};exports[_0x175b('0x2b')]=function(_0x2c9816){var _0x396780=this;return new Promise(function(_0x919e9,_0x4ad5ae){return db[_0x175b('0x1b')][_0x175b('0x2c')](_0x2c9816['body'],{'raw':_0x2c9816[_0x175b('0x1f')]?_0x2c9816['options'][_0x175b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c9816['options']?_0x2c9816[_0x175b('0x1f')][_0x175b('0x1e')]||null:null,'attributes':_0x2c9816[_0x175b('0x1f')]?_0x2c9816['options'][_0x175b('0x24')]||null:null,'limit':_0x2c9816[_0x175b('0x1f')]?_0x2c9816[_0x175b('0x1f')][_0x175b('0x20')]||null:null})[_0x175b('0x25')](function(_0x65b534){logger[_0x175b('0x11')](_0x175b('0x2b'),_0x2c9816);logger[_0x175b('0x13')](_0x175b('0x2b'),_0x2c9816,JSON[_0x175b('0x2a')](_0x65b534));_0x919e9(_0x65b534);})['catch'](function(_0x3d9144){logger[_0x175b('0x15')](_0x175b('0x2b'),_0x3d9144[_0x175b('0x18')],_0x2c9816);_0x4ad5ae(_0x396780[_0x175b('0x15')](0x1f4,_0x3d9144['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 70c3081..92c78d6 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 _0x88c6=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit'];(function(_0x1ad901,_0x852d9e){var _0x3c0249=function(_0x319eda){while(--_0x319eda){_0x1ad901['push'](_0x1ad901['shift']());}};_0x3c0249(++_0x852d9e);}(_0x88c6,0x163));var _0x688c=function(_0x2cc017,_0x25b198){_0x2cc017=_0x2cc017-0x0;var _0x509276=_0x88c6[_0x2cc017];return _0x509276;};'use strict';var VoiceQueueReportEvents=require(_0x688c('0x0'));var events=[_0x688c('0x1'),_0x688c('0x2'),_0x688c('0x3')];function createListener(_0x5f1da0,_0x5e79e1){return function(_0x343bdd){_0x5e79e1[_0x688c('0x4')](_0x5f1da0,_0x343bdd);};}function removeListener(_0x33e2f8,_0x4f44a9){return function(){VoiceQueueReportEvents[_0x688c('0x5')](_0x33e2f8,_0x4f44a9);};}exports[_0x688c('0x6')]=function(_0x415551){for(var _0x14e6d6=0x0,_0x1be494=events[_0x688c('0x7')];_0x14e6d6<_0x1be494;_0x14e6d6++){var _0x4cd706=events[_0x14e6d6];var _0x9f8059=createListener(_0x688c('0x8')+_0x4cd706,_0x415551);VoiceQueueReportEvents['on'](_0x4cd706,_0x9f8059);}}; \ No newline at end of file +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 diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 42baa3a..0f7d30b 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 _0x00f3=['util','path','connect-timeout','fs-extra','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x55786d,_0xd5a547){var _0x20530b=function(_0x588453){while(--_0x588453){_0x55786d['push'](_0x55786d['shift']());}};_0x20530b(++_0xd5a547);}(_0x00f3,0x168));var _0x300f=function(_0x273f6e,_0x18e7b7){_0x273f6e=_0x273f6e-0x0;var _0x430ec4=_0x00f3[_0x273f6e];return _0x430ec4;};'use strict';var multer=require(_0x300f('0x0'));var util=require(_0x300f('0x1'));var path=require(_0x300f('0x2'));var timeout=require(_0x300f('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x300f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x300f('0x5'));var controller=require(_0x300f('0x6'));router[_0x300f('0x7')]('/',auth[_0x300f('0x8')](),controller[_0x300f('0x9')]);router[_0x300f('0x7')](_0x300f('0xa'),auth[_0x300f('0x8')](),controller[_0x300f('0xb')]);router[_0x300f('0xc')]('/',auth[_0x300f('0x8')](),controller[_0x300f('0xd')]);router[_0x300f('0xe')](_0x300f('0xa'),auth['isAuthenticated'](),controller[_0x300f('0xf')]);router[_0x300f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x300f('0x11')]);module[_0x300f('0x12')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 2d364fd..1d7f1ea 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 _0x1279=['exports','STRING','DATE'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x1279,0x1b9));var _0x9127=function(_0x1dfa21,_0x538dcf){_0x1dfa21=_0x1dfa21-0x0;var _0x350bf0=_0x1279[_0x1dfa21];return _0x350bf0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x9127('0x0')]={'time':{'type':Sequelize[_0x9127('0x1')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x9127('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x9127('0x2')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +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 diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index bd50546..e1ab774 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 _0x82b6=['stack','name','send','index','VoiceQueuesLog','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','destroy','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','undefined','limit','count','set','Content-Range','save','update','then','sendStatus','error'];(function(_0x377ff6,_0xf7fb77){var _0x2f6117=function(_0xa5ab68){while(--_0xa5ab68){_0x377ff6['push'](_0x377ff6['shift']());}};_0x2f6117(++_0xf7fb77);}(_0x82b6,0x197));var _0x682b=function(_0x4f3c9b,_0x28e078){_0x4f3c9b=_0x4f3c9b-0x0;var _0x84e58a=_0x82b6[_0x4f3c9b];return _0x84e58a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x682b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x682b('0x1'));var rp=require(_0x682b('0x2'));var moment=require(_0x682b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x682b('0x4'));var util=require(_0x682b('0x5'));var path=require(_0x682b('0x6'));var sox=require(_0x682b('0x7'));var csv=require(_0x682b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x682b('0x9'));var _=require('lodash');var squel=require(_0x682b('0xa'));var crypto=require(_0x682b('0xb'));var jsforce=require(_0x682b('0xc'));var deskjs=require(_0x682b('0xd'));var toCsv=require('to-csv');var querystring=require(_0x682b('0xe'));var Papa=require(_0x682b('0xf'));var Redis=require(_0x682b('0x10'));var authService=require(_0x682b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x682b('0x12'));var hardwareService=require(_0x682b('0x13'));var logger=require('../../config/logger')(_0x682b('0x14'));var utils=require(_0x682b('0x15'));var config=require(_0x682b('0x16'));var licenseUtil=require(_0x682b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36209f,_0x3067c6){_0x3067c6=_0x3067c6||0xcc;return function(_0x4465ff){if(_0x4465ff){return _0x36209f['sendStatus'](_0x3067c6);}return _0x36209f['status'](_0x3067c6)[_0x682b('0x18')]();};}function respondWithResult(_0x1ac20f,_0x1d431c){_0x1d431c=_0x1d431c||0xc8;return function(_0x1b56ac){if(_0x1b56ac){return _0x1ac20f[_0x682b('0x19')](_0x1d431c)[_0x682b('0x1a')](_0x1b56ac);}};}function respondWithFilteredResult(_0x1fc2f5,_0x3855cb){return function(_0x39facd){if(_0x39facd){var _0x4b9b82=typeof _0x3855cb['offset']===_0x682b('0x1b')&&typeof _0x3855cb[_0x682b('0x1c')]===_0x682b('0x1b');var _0x1de04c=_0x39facd[_0x682b('0x1d')];var _0x497fd3=_0x4b9b82?0x0:_0x3855cb['offset'];var _0x13d0ff=_0x4b9b82?_0x39facd[_0x682b('0x1d')]:_0x3855cb['offset']+_0x3855cb[_0x682b('0x1c')];var _0x7382c1;if(_0x13d0ff>=_0x1de04c){_0x13d0ff=_0x1de04c;_0x7382c1=0xc8;}else{_0x7382c1=0xce;}_0x1fc2f5[_0x682b('0x19')](_0x7382c1);return _0x1fc2f5[_0x682b('0x1e')](_0x682b('0x1f'),_0x497fd3+'-'+_0x13d0ff+'/'+_0x1de04c)[_0x682b('0x1a')](_0x39facd);}return null;};}function patchUpdates(_0x100bb8){return function(_0x57c04c){try{jsonpatch['apply'](_0x57c04c,_0x100bb8,!![]);}catch(_0x4168cc){return BPromise['reject'](_0x4168cc);}return _0x57c04c[_0x682b('0x20')]();};}function saveUpdates(_0x2f0453,_0x134349){return function(_0x179efb){if(_0x179efb){return _0x179efb[_0x682b('0x21')](_0x2f0453)[_0x682b('0x22')](function(_0x5ebc2a){return _0x5ebc2a;});}return null;};}function removeEntity(_0x221257,_0x48bc6b){return function(_0x2ae38a){if(_0x2ae38a){return _0x2ae38a['destroy']()[_0x682b('0x22')](function(){_0x221257[_0x682b('0x19')](0xcc)[_0x682b('0x18')]();});}};}function handleEntityNotFound(_0x510889,_0x124aa8){return function(_0x1fc94d){if(!_0x1fc94d){_0x510889[_0x682b('0x23')](0x194);}return _0x1fc94d;};}function handleError(_0x512d4d,_0x110d6f){_0x110d6f=_0x110d6f||0x1f4;return function(_0x24c7b9){logger[_0x682b('0x24')](_0x24c7b9[_0x682b('0x25')]);if(_0x24c7b9[_0x682b('0x26')]){delete _0x24c7b9[_0x682b('0x26')];}_0x512d4d['status'](_0x110d6f)[_0x682b('0x27')](_0x24c7b9);};}exports[_0x682b('0x28')]=function(_0x41df80,_0x470892){var _0x5d0de1={},_0xc6e33b={},_0x14d1ef={'count':0x0,'rows':[]};var _0x13d70a=_['map'](db[_0x682b('0x29')]['rawAttributes'],function(_0x345ba9){return{'name':_0x345ba9['fieldName'],'type':_0x345ba9[_0x682b('0x2a')][_0x682b('0x2b')]};});_0xc6e33b[_0x682b('0x2c')]=_['map'](_0x13d70a,'name');_0xc6e33b[_0x682b('0x2d')]=_[_0x682b('0x2e')](_0x41df80[_0x682b('0x2d')]);_0xc6e33b[_0x682b('0x2f')]=_['intersection'](_0xc6e33b[_0x682b('0x2c')],_0xc6e33b[_0x682b('0x2d')]);_0x5d0de1[_0x682b('0x30')]=_[_0x682b('0x31')](_0xc6e33b['model'],qs[_0x682b('0x32')](_0x41df80[_0x682b('0x2d')]['fields']));_0x5d0de1[_0x682b('0x30')]=_0x5d0de1['attributes'][_0x682b('0x33')]?_0x5d0de1[_0x682b('0x30')]:_0xc6e33b[_0x682b('0x2c')];if(!_0x41df80[_0x682b('0x2d')][_0x682b('0x34')](_0x682b('0x35'))){_0x5d0de1[_0x682b('0x1c')]=qs[_0x682b('0x1c')](_0x41df80[_0x682b('0x2d')][_0x682b('0x1c')]);_0x5d0de1[_0x682b('0x36')]=qs[_0x682b('0x36')](_0x41df80[_0x682b('0x2d')][_0x682b('0x36')]);}_0x5d0de1[_0x682b('0x37')]=qs[_0x682b('0x38')](_0x41df80[_0x682b('0x2d')][_0x682b('0x38')]);_0x5d0de1[_0x682b('0x39')]=qs[_0x682b('0x2f')](_[_0x682b('0x3a')](_0x41df80['query'],_0xc6e33b[_0x682b('0x2f')]),_0x13d70a);if(_0x41df80[_0x682b('0x2d')]['filter']){_0x5d0de1[_0x682b('0x39')]=_[_0x682b('0x3b')](_0x5d0de1[_0x682b('0x39')],{'$or':_[_0x682b('0x3c')](_0x13d70a,function(_0x574629){if(_0x574629[_0x682b('0x2a')]!=='VIRTUAL'){var _0x4e9894={};_0x4e9894[_0x574629[_0x682b('0x26')]]={'$like':'%'+_0x41df80[_0x682b('0x2d')]['filter']+'%'};return _0x4e9894;}})});}_0x5d0de1=_[_0x682b('0x3b')]({},_0x5d0de1,_0x41df80[_0x682b('0x3d')]);var _0xc8fd4d={'where':_0x5d0de1[_0x682b('0x39')]};return db[_0x682b('0x29')][_0x682b('0x1d')](_0xc8fd4d)[_0x682b('0x22')](function(_0xde5e4){_0x14d1ef[_0x682b('0x1d')]=_0xde5e4;if(_0x41df80['query'][_0x682b('0x3e')]){_0x5d0de1['include']=[{'all':!![]}];}return db['VoiceQueuesLog'][_0x682b('0x3f')](_0x5d0de1);})[_0x682b('0x22')](function(_0x1434f7){_0x14d1ef[_0x682b('0x40')]=_0x1434f7;return _0x14d1ef;})[_0x682b('0x22')](respondWithFilteredResult(_0x470892,_0x5d0de1))[_0x682b('0x41')](handleError(_0x470892,null));};exports[_0x682b('0x42')]=function(_0x29eee9,_0x1072cd){var _0x36a1a9={'raw':!![],'where':{'id':_0x29eee9[_0x682b('0x43')]['id']}},_0x208b70={};_0x208b70[_0x682b('0x2c')]=_[_0x682b('0x2e')](db['VoiceQueuesLog'][_0x682b('0x44')]);_0x208b70[_0x682b('0x2d')]=_['keys'](_0x29eee9['query']);_0x208b70['filters']=_[_0x682b('0x31')](_0x208b70[_0x682b('0x2c')],_0x208b70['query']);_0x36a1a9[_0x682b('0x30')]=_[_0x682b('0x31')](_0x208b70[_0x682b('0x2c')],qs[_0x682b('0x32')](_0x29eee9['query'][_0x682b('0x32')]));_0x36a1a9[_0x682b('0x30')]=_0x36a1a9['attributes']['length']?_0x36a1a9[_0x682b('0x30')]:_0x208b70[_0x682b('0x2c')];if(_0x29eee9['query'][_0x682b('0x3e')]){_0x36a1a9[_0x682b('0x45')]=[{'all':!![]}];}_0x36a1a9=_[_0x682b('0x3b')]({},_0x36a1a9,_0x29eee9[_0x682b('0x3d')]);return db['VoiceQueuesLog']['find'](_0x36a1a9)['then'](handleEntityNotFound(_0x1072cd,null))[_0x682b('0x22')](respondWithResult(_0x1072cd,null))[_0x682b('0x41')](handleError(_0x1072cd,null));};exports[_0x682b('0x46')]=function(_0x21a92,_0x28b9e4){return db['VoiceQueuesLog'][_0x682b('0x46')](_0x21a92[_0x682b('0x47')],{})[_0x682b('0x22')](respondWithResult(_0x28b9e4,0xc9))[_0x682b('0x41')](handleError(_0x28b9e4,null));};exports[_0x682b('0x21')]=function(_0x5dc87d,_0x24f445){if(_0x5dc87d[_0x682b('0x47')]['id']){delete _0x5dc87d[_0x682b('0x47')]['id'];}return db[_0x682b('0x29')][_0x682b('0x48')]({'where':{'id':_0x5dc87d[_0x682b('0x43')]['id']}})[_0x682b('0x22')](handleEntityNotFound(_0x24f445,null))['then'](saveUpdates(_0x5dc87d[_0x682b('0x47')],null))[_0x682b('0x22')](respondWithResult(_0x24f445,null))[_0x682b('0x41')](handleError(_0x24f445,null));};exports[_0x682b('0x49')]=function(_0x1896b5,_0x5712d8){return db[_0x682b('0x29')][_0x682b('0x48')]({'where':{'id':_0x1896b5[_0x682b('0x43')]['id']}})[_0x682b('0x22')](handleEntityNotFound(_0x5712d8,null))['then'](removeEntity(_0x5712d8,null))[_0x682b('0x41')](handleError(_0x5712d8,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 3c185c9..abf2e93 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 _0xe189=['request-promise','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','api','moment','bluebird'];(function(_0x3e779c,_0x546ea2){var _0x22ab11=function(_0x4f2b7a){while(--_0x4f2b7a){_0x3e779c['push'](_0x3e779c['shift']());}};_0x22ab11(++_0x546ea2);}(_0xe189,0x194));var _0x9e18=function(_0x8fe94,_0x49e66e){_0x8fe94=_0x8fe94-0x0;var _0x1f6f6c=_0xe189[_0x8fe94];return _0x1f6f6c;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9e18('0x1'));var moment=require(_0x9e18('0x2'));var BPromise=require(_0x9e18('0x3'));var rp=require(_0x9e18('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9e18('0x5'));var attributes=require(_0x9e18('0x6'));module[_0x9e18('0x7')]=function(_0x53d7c9,_0x3e6881){return _0x53d7c9['define'](_0x9e18('0x8'),attributes,{'tableName':_0x9e18('0x9'),'paranoid':![],'indexes':[{'name':_0x9e18('0xa'),'fields':['event',_0x9e18('0xb')]}],'timestamps':![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index af6d35a..4e388f6 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 _0xfb68=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2093f0,_0x1f903c){var _0x37829f=function(_0x27d3bc){while(--_0x27d3bc){_0x2093f0['push'](_0x2093f0['shift']());}};_0x37829f(++_0x1f903c);}(_0xfb68,0x1d2));var _0x8fb6=function(_0x4c8cd3,_0x411899){_0x4c8cd3=_0x4c8cd3-0x0;var _0x5082e1=_0xfb68[_0x4c8cd3];return _0x5082e1;};'use strict';var _=require(_0x8fb6('0x0'));var util=require(_0x8fb6('0x1'));var moment=require(_0x8fb6('0x2'));var BPromise=require(_0x8fb6('0x3'));var rs=require(_0x8fb6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8fb6('0x5'));var logger=require(_0x8fb6('0x6'))(_0x8fb6('0x7'));var config=require(_0x8fb6('0x8'));var jayson=require(_0x8fb6('0x9'));var client=jayson['client'][_0x8fb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6dbef2,_0x2767ba,_0x22e64e){return new BPromise(function(_0x17ce82,_0x251342){return client[_0x8fb6('0xb')](_0x6dbef2,_0x22e64e)['then'](function(_0x45f03b){logger['info'](_0x8fb6('0xc'),_0x2767ba,'request\x20sent');logger[_0x8fb6('0xd')](_0x8fb6('0xe'),_0x2767ba,'request\x20sent',JSON[_0x8fb6('0xf')](_0x45f03b));if(_0x45f03b[_0x8fb6('0x10')]){if(_0x45f03b[_0x8fb6('0x10')][_0x8fb6('0x11')]===0x1f4){logger[_0x8fb6('0x10')]('VoiceQueuesLog,\x20%s,\x20%s',_0x2767ba,_0x45f03b[_0x8fb6('0x10')][_0x8fb6('0x12')]);return _0x251342(_0x45f03b['error'][_0x8fb6('0x12')]);}logger[_0x8fb6('0x10')](_0x8fb6('0xc'),_0x2767ba,_0x45f03b[_0x8fb6('0x10')][_0x8fb6('0x12')]);return _0x17ce82(_0x45f03b[_0x8fb6('0x10')][_0x8fb6('0x12')]);}else{logger[_0x8fb6('0x13')](_0x8fb6('0xc'),_0x2767ba,'request\x20sent');_0x17ce82(_0x45f03b['result'][_0x8fb6('0x12')]);}})[_0x8fb6('0x14')](function(_0x259deb){logger[_0x8fb6('0x10')](_0x8fb6('0xc'),_0x2767ba,_0x259deb);_0x251342(_0x259deb);});});} \ No newline at end of file +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 diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 6a9646b..bc23541 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 _0xb4f3=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','index','/describe','describe','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete'];(function(_0x46ae1a,_0x54c307){var _0xfe5eed=function(_0x1b3b98){while(--_0x1b3b98){_0x46ae1a['push'](_0x46ae1a['shift']());}};_0xfe5eed(++_0x54c307);}(_0xb4f3,0x1a6));var _0x3b4f=function(_0x1a30cf,_0x5b5164){_0x1a30cf=_0x1a30cf-0x0;var _0x50d4f5=_0xb4f3[_0x1a30cf];return _0x50d4f5;};'use strict';var multer=require('multer');var util=require(_0x3b4f('0x0'));var path=require(_0x3b4f('0x1'));var timeout=require(_0x3b4f('0x2'));var express=require(_0x3b4f('0x3'));var router=express[_0x3b4f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b4f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b4f('0x6'));var controller=require(_0x3b4f('0x7'));router[_0x3b4f('0x8')]('/',auth['isAuthenticated'](),controller[_0x3b4f('0x9')]);router[_0x3b4f('0x8')](_0x3b4f('0xa'),auth['isAuthenticated'](),controller[_0x3b4f('0xb')]);router['get'](_0x3b4f('0xc'),auth[_0x3b4f('0xd')](),controller[_0x3b4f('0xe')]);router[_0x3b4f('0x8')](_0x3b4f('0xf'),auth[_0x3b4f('0xd')](),controller[_0x3b4f('0x10')]);router[_0x3b4f('0x8')](_0x3b4f('0x11'),controller['downloads']);router['get'](_0x3b4f('0x12'),auth[_0x3b4f('0xd')](),controller[_0x3b4f('0x13')]);router[_0x3b4f('0x14')]('/',auth[_0x3b4f('0xd')](),controller[_0x3b4f('0x15')]);router[_0x3b4f('0x14')]('/:id/transcribe',auth['isAuthenticated'](),controller[_0x3b4f('0x16')]);router[_0x3b4f('0x17')]('/:id',auth[_0x3b4f('0xd')](),controller[_0x3b4f('0x18')]);router[_0x3b4f('0x19')](_0x3b4f('0xc'),auth['isAuthenticated'](),controller[_0x3b4f('0x1a')]);module[_0x3b4f('0x1b')]=router; \ No newline at end of file +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 diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 342c8e5..814ad19 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(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_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 diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 6281c8c..203fbba 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 _0xd6e8=['name','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','catch','create','body','find','describe','download','../../components/encryptor','uniqueid','value','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','message','downloads','sequelize','MD5','token','$and','push','extname','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','listBuckets','createBucket','upload','basename','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeName','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','%s.cypher','Voice\x20Recording\x20not\x20found','transcribe','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','language','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','transcribeRegion','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','transcribeStatus','NEW','IN_PROGRESS','tempSentiment','writeFile','downloadTranscribe','fileText','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','send','index','map','VoiceRecording','rawAttributes','type','model','differenceBy'];(function(_0x54edc9,_0x345f01){var _0x2ae7a9=function(_0x24a545){while(--_0x24a545){_0x54edc9['push'](_0x54edc9['shift']());}};_0x2ae7a9(++_0x345f01);}(_0xd6e8,0xf9));var _0x8d6e=function(_0x99d37,_0x4e7974){_0x99d37=_0x99d37-0x0;var _0x2db098=_0xd6e8[_0x99d37];return _0x2db098;};'use strict';var emlformat=require(_0x8d6e('0x0'));var rimraf=require(_0x8d6e('0x1'));var zipdir=require(_0x8d6e('0x2'));var jsonpatch=require(_0x8d6e('0x3'));var rp=require(_0x8d6e('0x4'));var moment=require(_0x8d6e('0x5'));var BPromise=require(_0x8d6e('0x6'));var Mustache=require(_0x8d6e('0x7'));var util=require(_0x8d6e('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x8d6e('0x9'));var ejs=require(_0x8d6e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8d6e('0xb'));var crypto=require('crypto');var jsforce=require(_0x8d6e('0xc'));var deskjs=require(_0x8d6e('0xd'));var toCsv=require(_0x8d6e('0x9'));var querystring=require('querystring');var Papa=require(_0x8d6e('0xe'));var AWS=require('aws-sdk');var uuidv4=require('uuid/v4');var Redis=require(_0x8d6e('0xf'));var authService=require(_0x8d6e('0x10'));var qs=require(_0x8d6e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8d6e('0x12'));var logger=require(_0x8d6e('0x13'))(_0x8d6e('0x14'));var utils=require(_0x8d6e('0x15'));var config=require(_0x8d6e('0x16'));var licenseUtil=require(_0x8d6e('0x17'));var db=require(_0x8d6e('0x18'))['db'];function respondWithStatusCode(_0x3a3b5e,_0x166257){_0x166257=_0x166257||0xcc;return function(_0x1f0dc5){if(_0x1f0dc5){return _0x3a3b5e['sendStatus'](_0x166257);}return _0x3a3b5e[_0x8d6e('0x19')](_0x166257)[_0x8d6e('0x1a')]();};}function respondWithResult(_0x997411,_0x476065){_0x476065=_0x476065||0xc8;return function(_0xbe7369){if(_0xbe7369){return _0x997411['status'](_0x476065)[_0x8d6e('0x1b')](_0xbe7369);}};}function respondWithFilteredResult(_0x3a7b69,_0x3cac48){return function(_0x5eda51){if(_0x5eda51){var _0x210118=typeof _0x3cac48[_0x8d6e('0x1c')]==='undefined'&&typeof _0x3cac48[_0x8d6e('0x1d')]===_0x8d6e('0x1e');var _0x1c95f0=_0x5eda51[_0x8d6e('0x1f')];var _0x3e5227=_0x210118?0x0:_0x3cac48[_0x8d6e('0x1c')];var _0x40cadb=_0x210118?_0x5eda51[_0x8d6e('0x1f')]:_0x3cac48[_0x8d6e('0x1c')]+_0x3cac48[_0x8d6e('0x1d')];var _0x2d9d45;if(_0x40cadb>=_0x1c95f0){_0x40cadb=_0x1c95f0;_0x2d9d45=0xc8;}else{_0x2d9d45=0xce;}_0x3a7b69[_0x8d6e('0x19')](_0x2d9d45);return _0x3a7b69[_0x8d6e('0x20')](_0x8d6e('0x21'),_0x3e5227+'-'+_0x40cadb+'/'+_0x1c95f0)[_0x8d6e('0x1b')](_0x5eda51);}return null;};}function patchUpdates(_0xc068b6){return function(_0x5c52eb){try{jsonpatch[_0x8d6e('0x22')](_0x5c52eb,_0xc068b6,!![]);}catch(_0x281d92){return BPromise[_0x8d6e('0x23')](_0x281d92);}return _0x5c52eb[_0x8d6e('0x24')]();};}function saveUpdates(_0x5b56f9,_0xf812fd){return function(_0x1573a0){if(_0x1573a0){return _0x1573a0[_0x8d6e('0x25')](_0x5b56f9)[_0x8d6e('0x26')](function(_0x56d75f){return _0x56d75f;});}return null;};}function removeEntity(_0x16e295,_0x2a2944){return function(_0x34b210){if(_0x34b210){return _0x34b210[_0x8d6e('0x27')]()[_0x8d6e('0x26')](function(){_0x16e295[_0x8d6e('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d96d4,_0x587f4f){return function(_0x5ecb17){if(!_0x5ecb17){_0x4d96d4[_0x8d6e('0x28')](0x194);}return _0x5ecb17;};}function handleError(_0xfc1012,_0x3ec467){_0x3ec467=_0x3ec467||0x1f4;return function(_0x39d4b8){logger['error'](_0x39d4b8['stack']);if(_0x39d4b8['name']){delete _0x39d4b8['name'];}_0xfc1012[_0x8d6e('0x19')](_0x3ec467)[_0x8d6e('0x29')](_0x39d4b8);};}exports[_0x8d6e('0x2a')]=function(_0x22fa1f,_0x24a738){var _0x1ff173={},_0x2c01ae={},_0x5ba0df={'count':0x0,'rows':[]};var _0x378b3c=_[_0x8d6e('0x2b')](db[_0x8d6e('0x2c')][_0x8d6e('0x2d')],function(_0x2d9faf){return{'name':_0x2d9faf['fieldName'],'type':_0x2d9faf[_0x8d6e('0x2e')]['key']};});_0x2c01ae[_0x8d6e('0x2f')]=_[_0x8d6e('0x30')](_[_0x8d6e('0x2b')](_0x378b3c,_0x8d6e('0x31')),['format']);_0x2c01ae[_0x8d6e('0x32')]=_[_0x8d6e('0x33')](_0x22fa1f[_0x8d6e('0x32')]);_0x2c01ae['filters']=_[_0x8d6e('0x34')](_0x2c01ae['model'],_0x2c01ae['query']);_0x1ff173[_0x8d6e('0x35')]=_[_0x8d6e('0x34')](_0x2c01ae[_0x8d6e('0x2f')],qs[_0x8d6e('0x36')](_0x22fa1f['query'][_0x8d6e('0x36')]));_0x1ff173['attributes']=_0x1ff173[_0x8d6e('0x35')][_0x8d6e('0x37')]?_0x1ff173[_0x8d6e('0x35')]:_0x2c01ae[_0x8d6e('0x2f')];if(!_0x22fa1f[_0x8d6e('0x32')]['hasOwnProperty'](_0x8d6e('0x38'))){_0x1ff173[_0x8d6e('0x1d')]=qs[_0x8d6e('0x1d')](_0x22fa1f['query'][_0x8d6e('0x1d')]);_0x1ff173[_0x8d6e('0x1c')]=qs[_0x8d6e('0x1c')](_0x22fa1f[_0x8d6e('0x32')]['offset']);}_0x1ff173[_0x8d6e('0x39')]=qs[_0x8d6e('0x3a')](_0x22fa1f['query'][_0x8d6e('0x3a')]);_0x1ff173[_0x8d6e('0x3b')]=qs[_0x8d6e('0x3c')](_['pick'](_0x22fa1f['query'],_0x2c01ae[_0x8d6e('0x3c')]),_0x378b3c);if(_0x22fa1f[_0x8d6e('0x32')][_0x8d6e('0x3d')]){_0x1ff173[_0x8d6e('0x3b')]=_[_0x8d6e('0x3e')](_0x1ff173[_0x8d6e('0x3b')],{'$or':_[_0x8d6e('0x2b')](_0x378b3c,function(_0x285345){if(_0x285345[_0x8d6e('0x2e')]!==_0x8d6e('0x3f')){var _0x4615b9={};_0x4615b9[_0x285345['name']]={'$like':'%'+_0x22fa1f[_0x8d6e('0x32')][_0x8d6e('0x3d')]+'%'};return _0x4615b9;}})});}_0x1ff173=_[_0x8d6e('0x3e')]({},_0x1ff173,_0x22fa1f[_0x8d6e('0x40')]);var _0x2eb392={'where':_0x1ff173[_0x8d6e('0x3b')]};return db['VoiceRecording']['count'](_0x2eb392)[_0x8d6e('0x26')](function(_0x97ff32){_0x5ba0df[_0x8d6e('0x1f')]=_0x97ff32;if(_0x22fa1f[_0x8d6e('0x32')][_0x8d6e('0x41')]){_0x1ff173['include']=[{'all':!![]}];}return db[_0x8d6e('0x2c')][_0x8d6e('0x42')](_0x1ff173);})['then'](function(_0x31141f){_0x5ba0df[_0x8d6e('0x43')]=_0x31141f;return _0x5ba0df;})[_0x8d6e('0x26')](respondWithFilteredResult(_0x24a738,_0x1ff173))['catch'](handleError(_0x24a738,null));};exports[_0x8d6e('0x44')]=function(_0x16216b,_0x37d236){var _0x118f02={'raw':![],'where':{'id':_0x16216b[_0x8d6e('0x45')]['id']}},_0xbbc4b0={};_0xbbc4b0[_0x8d6e('0x2f')]=_['keys'](db['VoiceRecording'][_0x8d6e('0x2d')]);_0xbbc4b0[_0x8d6e('0x32')]=_[_0x8d6e('0x33')](_0x16216b['query']);_0xbbc4b0[_0x8d6e('0x3c')]=_[_0x8d6e('0x34')](_0xbbc4b0[_0x8d6e('0x2f')],_0xbbc4b0[_0x8d6e('0x32')]);_0x118f02[_0x8d6e('0x35')]=_[_0x8d6e('0x34')](_0xbbc4b0[_0x8d6e('0x2f')],qs[_0x8d6e('0x36')](_0x16216b['query']['fields']));_0x118f02[_0x8d6e('0x35')]=_0x118f02[_0x8d6e('0x35')][_0x8d6e('0x37')]?_0x118f02[_0x8d6e('0x35')]:_0xbbc4b0[_0x8d6e('0x2f')];if(_0x16216b[_0x8d6e('0x32')]['includeAll']){_0x118f02[_0x8d6e('0x46')]=[{'all':!![]}];}_0x118f02=_[_0x8d6e('0x3e')]({},_0x118f02,_0x16216b[_0x8d6e('0x40')]);return db[_0x8d6e('0x2c')]['find'](_0x118f02)[_0x8d6e('0x26')](handleEntityNotFound(_0x37d236,null))[_0x8d6e('0x26')](respondWithResult(_0x37d236,null))[_0x8d6e('0x47')](handleError(_0x37d236,null));};exports[_0x8d6e('0x48')]=function(_0x2502ba,_0x4bbf14){return db[_0x8d6e('0x2c')][_0x8d6e('0x48')](_0x2502ba[_0x8d6e('0x49')],{})['then'](respondWithResult(_0x4bbf14,0xc9))[_0x8d6e('0x47')](handleError(_0x4bbf14,null));};exports[_0x8d6e('0x25')]=function(_0x18d4fe,_0x45c079){if(_0x18d4fe[_0x8d6e('0x49')]['id']){delete _0x18d4fe[_0x8d6e('0x49')]['id'];}return db[_0x8d6e('0x2c')][_0x8d6e('0x4a')]({'where':{'id':_0x18d4fe['params']['id']}})[_0x8d6e('0x26')](handleEntityNotFound(_0x45c079,null))['then'](saveUpdates(_0x18d4fe[_0x8d6e('0x49')],null))[_0x8d6e('0x26')](respondWithResult(_0x45c079,null))['catch'](handleError(_0x45c079,null));};exports[_0x8d6e('0x4b')]=function(_0x3da89f,_0x592001){return db['VoiceRecording'][_0x8d6e('0x4b')]()[_0x8d6e('0x26')](respondWithResult(_0x592001,null))[_0x8d6e('0x47')](handleError(_0x592001,null));};exports[_0x8d6e('0x4c')]=function(_0x2c4007,_0x52527d,_0x1c7292){var _0x27d1b8=require(_0x8d6e('0x4d'));var _0x25a598=![];var _0x1b5d3e={};if(_0x2c4007[_0x8d6e('0x32')][_0x8d6e('0x2e')]&&_0x2c4007['query'][_0x8d6e('0x2e')]===_0x8d6e('0x4e')){_0x1b5d3e['uniqueid']=_0x2c4007[_0x8d6e('0x45')]['id'];}else{_0x1b5d3e['id']=_0x2c4007['params']['id'];}return db[_0x8d6e('0x2c')]['find']({'where':_0x1b5d3e,'attributes':['id',_0x8d6e('0x4f')],'raw':!![]})[_0x8d6e('0x26')](handleEntityNotFound(_0x52527d,null))['then'](function(_0x3da3be){if(_0x3da3be){var _0x46b316=_0x3da3be[_0x8d6e('0x4f')];var _0x4c7330=util[_0x8d6e('0x50')]('%s.cypher',_0x46b316);if(fs[_0x8d6e('0x51')](_0x4c7330)){_0x25a598=!![];return _0x27d1b8[_0x8d6e('0x52')](_0x4c7330,_0x46b316,config[_0x8d6e('0x53')][_0x8d6e('0x54')])[_0x8d6e('0x26')](function(){return _0x3da3be;});}return _0x3da3be;}})[_0x8d6e('0x26')](function(_0x3dc5da){if(_0x3dc5da){var _0x5b35c1=_0x3dc5da[_0x8d6e('0x4f')];if(!fs['existsSync'](_0x5b35c1)){throw new db[(_0x8d6e('0x55'))][(_0x8d6e('0x56'))](_0x8d6e('0x57'));}if(_0x3dc5da[_0x8d6e('0x58')]){return _0x52527d[_0x8d6e('0x4c')](_0x5b35c1,_0x3dc5da[_0x8d6e('0x58')]+path['extname'](_0x5b35c1),function(){if(_0x25a598){fs[_0x8d6e('0x59')](_0x5b35c1);}});}else{return _0x52527d['download'](_0x5b35c1,function(_0x570519){if(_0x25a598){fs[_0x8d6e('0x59')](_0x5b35c1);}});}}})['catch'](function(_0x9fe7b8){if(_0x9fe7b8[_0x8d6e('0x5a')]===_0x8d6e('0x57')){_0x52527d['status'](0x194)[_0x8d6e('0x29')]('Not\x20found');}else{return handleError(_0x52527d,null);}});};exports[_0x8d6e('0x5b')]=function(_0xd3bb17,_0x9afa2f,_0x2244c7){var _0x2af28d=require('../../components/encryptor');var _0x242187=![];var _0x34d148={'$and':[db['sequelize']['where'](db[_0x8d6e('0x5c')]['fn'](_0x8d6e('0x5d'),db[_0x8d6e('0x5c')]['col'](_0x8d6e('0x4e'))),_0xd3bb17[_0x8d6e('0x32')][_0x8d6e('0x5e')])]};if(_0xd3bb17[_0x8d6e('0x32')][_0x8d6e('0x2e')]&&_0xd3bb17[_0x8d6e('0x32')]['type']===_0x8d6e('0x4e')){_0x34d148[_0x8d6e('0x5f')][_0x8d6e('0x60')]({'uniqueid':_0xd3bb17[_0x8d6e('0x45')]['id']});}else{_0x34d148[_0x8d6e('0x5f')][_0x8d6e('0x60')]({'id':_0xd3bb17['params']['id']});}return db[_0x8d6e('0x2c')]['find']({'where':_0x34d148,'attributes':['id','value'],'raw':!![]})[_0x8d6e('0x26')](handleEntityNotFound(_0x9afa2f,null))[_0x8d6e('0x26')](function(_0x563495){if(_0x563495){var _0x29981b=util['format']('%s.cypher',_0x563495[_0x8d6e('0x4f')]);if(fs['existsSync'](_0x29981b)){_0x242187=!![];return _0x2af28d[_0x8d6e('0x52')](_0x29981b,_0x563495[_0x8d6e('0x4f')],config['secrets'][_0x8d6e('0x54')])['then'](function(){return _0x563495;});}return _0x563495;}})['then'](function(_0x143f8e){if(_0x143f8e){if(!fs[_0x8d6e('0x51')](_0x143f8e[_0x8d6e('0x4f')])){throw new db[(_0x8d6e('0x55'))][(_0x8d6e('0x56'))]('VoiceRecording\x20not\x20found');}if(_0x143f8e[_0x8d6e('0x58')]){return _0x9afa2f[_0x8d6e('0x4c')](_0x143f8e[_0x8d6e('0x4f')],_0x143f8e[_0x8d6e('0x58')]+path[_0x8d6e('0x61')](_0x143f8e[_0x8d6e('0x4f')]),function(){if(_0x242187){fs[_0x8d6e('0x59')](_0x143f8e['value']);}});}else{return _0x9afa2f['download'](_0x143f8e[_0x8d6e('0x4f')],function(_0x4755e6){if(_0x242187){fs[_0x8d6e('0x59')](_0x143f8e[_0x8d6e('0x4f')]);}});}}})['catch'](handleError(_0x9afa2f,null));};exports['destroy']=function(_0xe73711,_0x278b0){return db[_0x8d6e('0x2c')][_0x8d6e('0x4a')]({'where':{'id':_0xe73711[_0x8d6e('0x45')]['id']}})[_0x8d6e('0x26')](function(_0x46428e){if(_['isNil'](_0x46428e)){throw new ReferenceError(_0x8d6e('0x62'));}return _0x46428e;})['then'](function(_0x2b88da){var _0x54054e=_0x2b88da[_0x8d6e('0x4f')];logger[_0x8d6e('0x63')](_0x8d6e('0x64'),_0x54054e);if(!_['isNil'](_0x2b88da[_0x8d6e('0x4f')])&&fs['existsSync'](_0x54054e)){logger[_0x8d6e('0x63')]('File:\x20\x22'+_0x54054e+_0x8d6e('0x65'));fs[_0x8d6e('0x66')](_0x54054e);}_0x54054e=_0x54054e+'.cypher';if(!_['isNil'](_0x2b88da[_0x8d6e('0x4f')])&&fs[_0x8d6e('0x51')](_0x54054e)){logger[_0x8d6e('0x63')](_0x8d6e('0x67')+_0x54054e+_0x8d6e('0x65'));fs[_0x8d6e('0x66')](_0x54054e);}return _0x2b88da;})['then'](function(_0x2896a0){if(!_0x2896a0)throw new InternalError();return _0x2896a0[_0x8d6e('0x27')]();})[_0x8d6e('0x26')](function(){_0x278b0[_0x8d6e('0x19')](0xcc)['end']();})[_0x8d6e('0x47')](handleError(_0x278b0,null));};function getBucketslist(_0x3edcd5,_0x298329,_0x5e6022){return new Promise(function(_0x465920,_0x59f40f){var _0x2c786b=new AWS['S3']({'accessKeyId':_0x298329,'secretAccessKey':_0x3edcd5,'region':_0x5e6022});_0x2c786b[_0x8d6e('0x68')]({},function(_0x4d23ed,_0x53f14d){if(_0x4d23ed){return _0x59f40f(_0x4d23ed);}else{return _0x465920(_0x53f14d);}});});}function createBucket(_0x4bbe94,_0x2ebbdb,_0x325979,_0x413c1e){return new Promise(function(_0x10edfc,_0x1e22cd){var _0x507a97=new AWS['S3']({'accessKeyId':_0x2ebbdb,'secretAccessKey':_0x4bbe94,'region':_0x325979});_0x507a97[_0x8d6e('0x69')]({'Bucket':_0x413c1e},function(_0x31d017,_0x58740e){if(_0x31d017){return _0x1e22cd(_0x31d017);}else{return _0x10edfc(_0x58740e);}});});}function uploadFile(_0x4be814,_0x218dcb,_0x58dbd9,_0x3c7ba3,_0x34cd70,_0x499a33){return new Promise(function(_0x515a76,_0x27a538){var _0x3d4f29=new AWS['S3']({'accessKeyId':_0x218dcb,'secretAccessKey':_0x4be814,'region':_0x58dbd9});_0x3d4f29[_0x8d6e('0x6a')]({'Bucket':_0x3c7ba3,'Key':_0x34cd70,'Body':_0x499a33},function(_0x5c81e7,_0x28cca1){if(_0x5c81e7){return _0x27a538(_0x5c81e7);}else{return _0x515a76(_0x28cca1);}});});}function startTranscribe(_0x11ce3a,_0x33b72c,_0xe15a5e,_0x5e697f,_0x4c968e,_0x1291fd){return new Promise(function(_0x4d5228,_0x1b9c75){var _0x508341=new AWS['TranscribeService']({'accessKeyId':_0x33b72c,'secretAccessKey':_0x11ce3a,'region':_0xe15a5e});_0x508341['startTranscriptionJob']({'TranscriptionJobName':_0x5e697f,'LanguageCode':_0x4c968e,'Media':{'MediaFileUri':_0x1291fd}},function(_0x226e5c,_0x5ef8b9){if(_0x226e5c){return _0x1b9c75(_0x226e5c);}else{return _0x4d5228(_0x5ef8b9);}});});}function transcribe(_0x4e7c27,_0x378479,_0x15e5a2,_0x45b3a1,_0x1c31fb,_0x2a21e7,_0x1c1e6a){return new Promise(function(_0x51c9fa,_0x5dd75f){var _0x61adfc={};logger['info'](util[_0x8d6e('0x50')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x4e7c27,_0x1c31fb));return uploadFile(_0x378479,_0x15e5a2,_0x45b3a1,_0x1c31fb,path[_0x8d6e('0x6b')](_0x2a21e7),fs[_0x8d6e('0x6c')](_0x2a21e7))[_0x8d6e('0x26')](function(_0x1874e8){logger[_0x8d6e('0x63')](util['format']('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x4e7c27,_0x1c31fb,_0x1874e8[_0x8d6e('0x6d')]));_0x61adfc[_0x8d6e('0x6e')]=_0x1874e8[_0x8d6e('0x6f')];_0x61adfc['location']=_0x1874e8[_0x8d6e('0x6d')];logger[_0x8d6e('0x63')](util[_0x8d6e('0x50')](_0x8d6e('0x70'),_0x4e7c27));return startTranscribe(_0x378479,_0x15e5a2,_0x45b3a1,uuidv4(),_0x1c1e6a,_0x1874e8['Location']);})[_0x8d6e('0x26')](function(_0x202333){logger[_0x8d6e('0x63')](util[_0x8d6e('0x50')](_0x8d6e('0x71'),_0x4e7c27,_0x202333['TranscriptionJob'][_0x8d6e('0x72')]));_0x61adfc[_0x8d6e('0x73')]=_0x202333[_0x8d6e('0x74')]['TranscriptionJobName'];_0x61adfc['transcribeStatus']=_0x202333['TranscriptionJob'][_0x8d6e('0x75')];return _0x51c9fa(_0x61adfc);})[_0x8d6e('0x47')](function(_0x51c22c){return _0x5dd75f(_0x51c22c);});});}exports[_0x8d6e('0x76')]=function(_0xdab425,_0x39eda8,_0x103867){var _0x24855a;var _0x1a18cc;var _0x4ae879;var _0xaba16=require(_0x8d6e('0x4d'));return db[_0x8d6e('0x2c')][_0x8d6e('0x77')]({'where':{'id':_0xdab425['params']['id']}})[_0x8d6e('0x26')](function(_0xee8dec){if(_0xee8dec){var _0x4d1a6d=util[_0x8d6e('0x50')](_0x8d6e('0x78'),_0xee8dec[_0x8d6e('0x4f')]);if(fs[_0x8d6e('0x51')](_0x4d1a6d)){cypher=!![];return _0xaba16['decryptFile'](_0x4d1a6d,_0xee8dec['value'],config['secrets'][_0x8d6e('0x54')])['then'](function(){return _0xee8dec;});}return _0xee8dec;}})[_0x8d6e('0x26')](function(_0x3a59db){if(!_0x3a59db){throw new db[(_0x8d6e('0x55'))]['ValidationError'](_0x8d6e('0x79'));}_0x1a18cc=_0x3a59db;return db['Setting'][_0x8d6e('0x77')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x39eda8,null))[_0x8d6e('0x26')](function(_0x515add){if(_0x515add){_0x24855a=_0x515add;if(!_0x24855a[_0x8d6e('0x7a')]||!_0x24855a['transcribeAccountId']||!_0x24855a['transcribeRegion']||!_0x24855a['language']||!_0x24855a[_0x8d6e('0x6e')]){throw new db[(_0x8d6e('0x55'))]['ValidationError'](_0x8d6e('0x7b'));}if(_0xdab425[_0x8d6e('0x49')][_0x8d6e('0x7c')]&&(!_0x24855a['sentiment']||!_0x24855a[_0x8d6e('0x7d')]||!_0x24855a[_0x8d6e('0x7e')]||!_0x24855a[_0x8d6e('0x7f')]||!_0x24855a[_0x8d6e('0x6e')])){throw new db[(_0x8d6e('0x55'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}return db[_0x8d6e('0x80')][_0x8d6e('0x77')]({'where':{'id':_0x24855a[_0x8d6e('0x81')]}});}})[_0x8d6e('0x26')](function(_0x1033de){if(!_0x1033de){throw new db[(_0x8d6e('0x55'))][(_0x8d6e('0x56'))](_0x8d6e('0x82'));}if(!_0x1033de[_0x8d6e('0x83')]||!_0x1033de['data2']){throw new db['Sequelize'][(_0x8d6e('0x56'))](_0x8d6e('0x84'));}_0x4ae879=_0x1033de;return getBucketslist(_0x4ae879[_0x8d6e('0x83')],_0x4ae879[_0x8d6e('0x85')],_0x24855a[_0x8d6e('0x86')]);})['then'](function(_0x2a647b){if(_0x2a647b&&_0x2a647b[_0x8d6e('0x87')]){var _0xb09ebf=_[_0x8d6e('0x4a')](_0x2a647b[_0x8d6e('0x87')],function(_0x19c584){return _0x19c584[_0x8d6e('0x88')]===_0x24855a['bucket'];});if(!_0xb09ebf){logger[_0x8d6e('0x63')](util[_0x8d6e('0x50')](_0x8d6e('0x89'),_0xdab425[_0x8d6e('0x45')]['id'],_0x24855a[_0x8d6e('0x6e')]));return createBucket(_0x4ae879['data1'],_0x4ae879['data2'],_0x24855a[_0x8d6e('0x86')],_0x24855a['bucket']);}logger['info'](util[_0x8d6e('0x50')](_0x8d6e('0x8a'),_0xdab425['params']['id'],_0x24855a['bucket']));return;}})[_0x8d6e('0x26')](function(_0xc71451){if(_0x1a18cc[_0x8d6e('0x8b')]===_0x8d6e('0x8c')){return transcribe(_0xdab425['params']['id'],_0x4ae879[_0x8d6e('0x83')],_0x4ae879[_0x8d6e('0x85')],_0x24855a['transcribeRegion'],_0x24855a[_0x8d6e('0x6e')],_0x1a18cc['value'],_0x24855a['language']);}else{logger[_0x8d6e('0x63')](util[_0x8d6e('0x50')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0xdab425[_0x8d6e('0x45')]['id']));return{'transcribeStatus':_0x8d6e('0x8d')};}})['then'](function(_0x247edb){if(_0x247edb){_0x247edb[_0x8d6e('0x8e')]=_0xdab425[_0x8d6e('0x49')][_0x8d6e('0x7c')];return _0x1a18cc['updateAttributes'](_0x247edb);}})['then'](respondWithResult(_0x39eda8,null))[_0x8d6e('0x47')](handleError(_0x39eda8,null));};function writeFile(_0x510e1e,_0x1bf5c6){return new Promise(function(_0x38c9cd,_0x3c6900){fs[_0x8d6e('0x8f')](_0x1bf5c6,_0x510e1e,function(_0x43daad,_0x9a2c95){if(_0x43daad){return _0x3c6900(_0x43daad);}else{return _0x38c9cd(_0x9a2c95);}});});}exports[_0x8d6e('0x90')]=function(_0x590414,_0x192fca,_0x31a570){return db[_0x8d6e('0x2c')][_0x8d6e('0x77')]({'where':{'id':_0x590414[_0x8d6e('0x45')]['id']}})[_0x8d6e('0x26')](handleEntityNotFound(_0x192fca))[_0x8d6e('0x26')](function(_0x11d346){if(_0x11d346&&_0x11d346[_0x8d6e('0x91')]){var _0x36afd4=_0x11d346['fileText'];var _0x258672=config['root']+_0x8d6e('0x92')+_0x11d346['id']+_0x8d6e('0x93');if(fs[_0x8d6e('0x51')](_0x258672)){return _0x258672;}return writeFile(_0x36afd4,_0x258672)[_0x8d6e('0x26')](function(){return _0x258672;});}else{throw new db['Sequelize'][(_0x8d6e('0x56'))](_0x8d6e('0x94'));}})[_0x8d6e('0x26')](function(_0x57b5ca){return _0x192fca[_0x8d6e('0x4c')](_0x57b5ca);})[_0x8d6e('0x47')](handleError(_0x192fca));}; \ No newline at end of file +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 diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 42dae08..fd0620b 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 _0x07cb=['rimraf','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','voice_recordings','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x07cb,0x149));var _0xb07c=function(_0x4c85e4,_0x24d438){_0x4c85e4=_0x4c85e4-0x0;var _0x424be6=_0x07cb[_0x4c85e4];return _0x424be6;};'use strict';var _=require(_0xb07c('0x0'));var util=require(_0xb07c('0x1'));var logger=require('../../config/logger')(_0xb07c('0x2'));var moment=require(_0xb07c('0x3'));var BPromise=require(_0xb07c('0x4'));var rp=require(_0xb07c('0x5'));var fs=require('fs');var path=require(_0xb07c('0x6'));var rimraf=require(_0xb07c('0x7'));var config=require(_0xb07c('0x8'));var attributes=require(_0xb07c('0x9'));module[_0xb07c('0xa')]=function(_0x4f23f0,_0x2e273b){return _0x4f23f0['define'](_0xb07c('0xb'),attributes,{'tableName':_0xb07c('0xc'),'paranoid':![],'indexes':[{'name':_0xb07c('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 850409f..619e568 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 _0x9582=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceRecording','body','options','where','attributes','limit','then'];(function(_0x1427c4,_0x388cc0){var _0x2a3681=function(_0x4fa3b3){while(--_0x4fa3b3){_0x1427c4['push'](_0x1427c4['shift']());}};_0x2a3681(++_0x388cc0);}(_0x9582,0x95));var _0x2958=function(_0x911f53,_0x1d5704){_0x911f53=_0x911f53-0x0;var _0x127190=_0x9582[_0x911f53];return _0x127190;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['UpdateVoiceRecording']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['update'](_0x28a92c[_0x2958('0x19')],{'raw':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a92c[_0x2958('0x1a')]?_0x28a92c['options'][_0x2958('0x1b')]||null:null,'attributes':_0x28a92c['options']?_0x28a92c['options'][_0x2958('0x1c')]||null:null,'limit':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')][_0x2958('0x1d')]||null:null})[_0x2958('0x1e')](function(_0x412e42){logger[_0x2958('0x16')](_0x2958('0x1f'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x1f'),_0x28a92c,JSON[_0x2958('0x12')](_0x412e42));_0x310d07(_0x412e42);})[_0x2958('0x20')](function(_0x119242){logger[_0x2958('0x13')](_0x2958('0x1f'),_0x119242['message'],_0x28a92c);_0x42bb99(_0x160949['error'](0x1f4,_0x119242[_0x2958('0x15')]));});});};exports[_0x2958('0x21')]=function(_0x28c1f5){var _0x43cf73=this;return new Promise(function(_0x52bd32,_0x2bd1ac){var _0x57ae96=require(_0x2958('0x22'));var _0x40adce;return db[_0x2958('0x23')][_0x2958('0x24')]({'attributes':['id',_0x2958('0x25')],'where':{'id':0x1},'raw':!![]})[_0x2958('0x1e')](function(_0x153958){_0x40adce=_0x153958;return db['VoiceRecording'][_0x2958('0x26')](_0x28c1f5['body']);})['then'](function(_0x28ee09){if(_0x40adce[_0x2958('0x25')]&&fs[_0x2958('0x27')](_0x28ee09[_0x2958('0x28')])){var _0x584179=util[_0x2958('0x29')](_0x2958('0x2a'),_0x28ee09[_0x2958('0x28')]);return _0x57ae96['encryptFile'](_0x28ee09[_0x2958('0x28')],_0x584179,config[_0x2958('0x2b')]['recording'])[_0x2958('0x1e')](function(){fs['unlink'](_0x28ee09[_0x2958('0x28')]);logger['info'](_0x2958('0x2c'));return _0x28ee09;});}return _0x28ee09;})['then'](function(_0x4477b5){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28c1f5);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28c1f5,JSON[_0x2958('0x12')](_0x4477b5));_0x52bd32(_0x4477b5);})[_0x2958('0x20')](function(_0x58f9b4){logger[_0x2958('0x13')]('CreateVoiceRecording',_0x58f9b4[_0x2958('0x15')],_0x28c1f5);_0x2bd1ac(_0x43cf73['error'](0x1f4,_0x58f9b4[_0x2958('0x15')]));});});}; \ No newline at end of file +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 diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index a12cbc5..6681410 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 _0x394a=['describe','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x394a,0x158));var _0xa394=function(_0xceac9e,_0x3a474f){_0xceac9e=_0xceac9e-0x0;var _0x102ff8=_0x394a[_0xceac9e];return _0x102ff8;};'use strict';var multer=require(_0xa394('0x0'));var util=require(_0xa394('0x1'));var path=require(_0xa394('0x2'));var timeout=require(_0xa394('0x3'));var express=require(_0xa394('0x4'));var router=express[_0xa394('0x5')]();var fs_extra=require(_0xa394('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa394('0x7'));var config=require(_0xa394('0x8'));var controller=require('./voiceTransferReport.controller');router[_0xa394('0x9')]('/',auth[_0xa394('0xa')](),controller[_0xa394('0xb')]);router[_0xa394('0x9')](_0xa394('0xc'),auth[_0xa394('0xa')](),controller[_0xa394('0xd')]);router[_0xa394('0x9')]('/:id',auth[_0xa394('0xa')](),controller[_0xa394('0xe')]);router[_0xa394('0xf')]('/',auth['isAuthenticated'](),controller[_0xa394('0x10')]);router['put'](_0xa394('0x11'),auth[_0xa394('0xa')](),controller[_0xa394('0x12')]);router[_0xa394('0x13')](_0xa394('0x11'),auth[_0xa394('0xa')](),controller[_0xa394('0x14')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index c44db41..719caaf 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 _0xd056=['sequelize','exports','ENUM','blind','attended','STRING','Yes'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xd056,0xb6));var _0x6d05=function(_0x3b9a92,_0x473e19){_0x3b9a92=_0x3b9a92-0x0;var _0x2548f7=_0xd056[_0x3b9a92];return _0x2548f7;};'use strict';var Sequelize=require(_0x6d05('0x0'));var moment=require('moment');module[_0x6d05('0x1')]={'type':{'type':Sequelize[_0x6d05('0x2')](_0x6d05('0x3'),_0x6d05('0x4'))},'result':{'type':Sequelize[_0x6d05('0x5')]},'transfererchannel':{'type':Sequelize[_0x6d05('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x6d05('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x6d05('0x5')]},'transferercontext':{'type':Sequelize[_0x6d05('0x5')]},'transfererexten':{'type':Sequelize[_0x6d05('0x5')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0x6d05('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x6d05('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x6d05('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6d05('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6d05('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x6d05('0x5')]},'transfereecontext':{'type':Sequelize[_0x6d05('0x5')]},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x6d05('0x5')]},'isexternal':{'type':Sequelize[_0x6d05('0x2')](_0x6d05('0x6'),'No')},'context':{'type':Sequelize[_0x6d05('0x5')]},'extension':{'type':Sequelize[_0x6d05('0x5')]}}; \ No newline at end of file +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 diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 087d3bf..2b30e84 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 _0xe72f=['index','map','VoiceTransferReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','type','merge','findAll','catch','show','params','keys','includeAll','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send'];(function(_0x33c0fc,_0x511e57){var _0x40019f=function(_0x1c8e20){while(--_0x1c8e20){_0x33c0fc['push'](_0x33c0fc['shift']());}};_0x40019f(++_0x511e57);}(_0xe72f,0xb6));var _0xfe72=function(_0x283f9b,_0x581e79){_0x283f9b=_0x283f9b-0x0;var _0x35881e=_0xe72f[_0x283f9b];return _0x35881e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe72('0x0'));var zipdir=require(_0xfe72('0x1'));var jsonpatch=require(_0xfe72('0x2'));var rp=require(_0xfe72('0x3'));var moment=require(_0xfe72('0x4'));var BPromise=require(_0xfe72('0x5'));var Mustache=require(_0xfe72('0x6'));var util=require(_0xfe72('0x7'));var path=require('path');var sox=require(_0xfe72('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfe72('0x9'));var squel=require(_0xfe72('0xa'));var crypto=require(_0xfe72('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfe72('0xc'));var toCsv=require(_0xfe72('0xd'));var querystring=require(_0xfe72('0xe'));var Papa=require(_0xfe72('0xf'));var Redis=require(_0xfe72('0x10'));var authService=require(_0xfe72('0x11'));var qs=require(_0xfe72('0x12'));var as=require(_0xfe72('0x13'));var hardwareService=require(_0xfe72('0x14'));var logger=require(_0xfe72('0x15'))('api');var utils=require(_0xfe72('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfe72('0x17'))['db'];function respondWithStatusCode(_0x528e31,_0x4f7997){_0x4f7997=_0x4f7997||0xcc;return function(_0x210d05){if(_0x210d05){return _0x528e31['sendStatus'](_0x4f7997);}return _0x528e31[_0xfe72('0x18')](_0x4f7997)[_0xfe72('0x19')]();};}function respondWithResult(_0x51b16f,_0x4f5a2a){_0x4f5a2a=_0x4f5a2a||0xc8;return function(_0x3304ac){if(_0x3304ac){return _0x51b16f[_0xfe72('0x18')](_0x4f5a2a)[_0xfe72('0x1a')](_0x3304ac);}};}function respondWithFilteredResult(_0x850440,_0x1eab54){return function(_0x1de1e4){if(_0x1de1e4){var _0x327539=typeof _0x1eab54[_0xfe72('0x1b')]===_0xfe72('0x1c')&&typeof _0x1eab54[_0xfe72('0x1d')]===_0xfe72('0x1c');var _0x161a4c=_0x1de1e4['count'];var _0x56b118=_0x327539?0x0:_0x1eab54['offset'];var _0x2001db=_0x327539?_0x1de1e4[_0xfe72('0x1e')]:_0x1eab54[_0xfe72('0x1b')]+_0x1eab54[_0xfe72('0x1d')];var _0x5a1976;if(_0x2001db>=_0x161a4c){_0x2001db=_0x161a4c;_0x5a1976=0xc8;}else{_0x5a1976=0xce;}_0x850440['status'](_0x5a1976);return _0x850440[_0xfe72('0x1f')](_0xfe72('0x20'),_0x56b118+'-'+_0x2001db+'/'+_0x161a4c)[_0xfe72('0x1a')](_0x1de1e4);}return null;};}function patchUpdates(_0x391f7c){return function(_0x38ed91){try{jsonpatch[_0xfe72('0x21')](_0x38ed91,_0x391f7c,!![]);}catch(_0x54f1e8){return BPromise[_0xfe72('0x22')](_0x54f1e8);}return _0x38ed91[_0xfe72('0x23')]();};}function saveUpdates(_0x1a3890,_0x5cef19){return function(_0x3dd332){if(_0x3dd332){return _0x3dd332['update'](_0x1a3890)[_0xfe72('0x24')](function(_0x12a2f9){return _0x12a2f9;});}return null;};}function removeEntity(_0x17c2c6,_0x5a3a6b){return function(_0x1bc718){if(_0x1bc718){return _0x1bc718[_0xfe72('0x25')]()[_0xfe72('0x24')](function(){_0x17c2c6['status'](0xcc)[_0xfe72('0x19')]();});}};}function handleEntityNotFound(_0x5cad78,_0x497fef){return function(_0x214f56){if(!_0x214f56){_0x5cad78[_0xfe72('0x26')](0x194);}return _0x214f56;};}function handleError(_0x3aa8cc,_0x5a80d9){_0x5a80d9=_0x5a80d9||0x1f4;return function(_0x4700d8){logger[_0xfe72('0x27')](_0x4700d8[_0xfe72('0x28')]);if(_0x4700d8['name']){delete _0x4700d8[_0xfe72('0x29')];}_0x3aa8cc['status'](_0x5a80d9)[_0xfe72('0x2a')](_0x4700d8);};}exports[_0xfe72('0x2b')]=function(_0x192379,_0x3fc432){var _0x5d7220={},_0x3913e4={},_0x5f0bac={'count':0x0,'rows':[]};var _0x137640=_[_0xfe72('0x2c')](db[_0xfe72('0x2d')][_0xfe72('0x2e')],function(_0x5dda4c){return{'name':_0x5dda4c[_0xfe72('0x2f')],'type':_0x5dda4c['type'][_0xfe72('0x30')]};});_0x3913e4[_0xfe72('0x31')]=_['map'](_0x137640,'name');_0x3913e4[_0xfe72('0x32')]=_['keys'](_0x192379[_0xfe72('0x32')]);_0x3913e4[_0xfe72('0x33')]=_[_0xfe72('0x34')](_0x3913e4[_0xfe72('0x31')],_0x3913e4['query']);_0x5d7220[_0xfe72('0x35')]=_[_0xfe72('0x34')](_0x3913e4[_0xfe72('0x31')],qs[_0xfe72('0x36')](_0x192379[_0xfe72('0x32')][_0xfe72('0x36')]));_0x5d7220[_0xfe72('0x35')]=_0x5d7220['attributes'][_0xfe72('0x37')]?_0x5d7220[_0xfe72('0x35')]:_0x3913e4['model'];if(!_0x192379[_0xfe72('0x32')]['hasOwnProperty']('nolimit')){_0x5d7220['limit']=qs['limit'](_0x192379['query']['limit']);_0x5d7220[_0xfe72('0x1b')]=qs[_0xfe72('0x1b')](_0x192379[_0xfe72('0x32')][_0xfe72('0x1b')]);}_0x5d7220[_0xfe72('0x38')]=qs[_0xfe72('0x39')](_0x192379['query'][_0xfe72('0x39')]);_0x5d7220['where']=qs[_0xfe72('0x33')](_[_0xfe72('0x3a')](_0x192379['query'],_0x3913e4[_0xfe72('0x33')]),_0x137640);if(_0x192379[_0xfe72('0x32')][_0xfe72('0x3b')]){_0x5d7220[_0xfe72('0x3c')]=_['merge'](_0x5d7220[_0xfe72('0x3c')],{'$or':_['map'](_0x137640,function(_0x55c501){if(_0x55c501[_0xfe72('0x3d')]!=='VIRTUAL'){var _0x572478={};_0x572478[_0x55c501['name']]={'$like':'%'+_0x192379['query'][_0xfe72('0x3b')]+'%'};return _0x572478;}})});}_0x5d7220=_[_0xfe72('0x3e')]({},_0x5d7220,_0x192379['options']);var _0x35b118={'where':_0x5d7220['where']};return db[_0xfe72('0x2d')][_0xfe72('0x1e')](_0x35b118)[_0xfe72('0x24')](function(_0x471cdc){_0x5f0bac['count']=_0x471cdc;if(_0x192379[_0xfe72('0x32')]['includeAll']){_0x5d7220['include']=[{'all':!![]}];}return db[_0xfe72('0x2d')][_0xfe72('0x3f')](_0x5d7220);})[_0xfe72('0x24')](function(_0xa1d680){_0x5f0bac['rows']=_0xa1d680;return _0x5f0bac;})['then'](respondWithFilteredResult(_0x3fc432,_0x5d7220))[_0xfe72('0x40')](handleError(_0x3fc432,null));};exports[_0xfe72('0x41')]=function(_0x26ebbf,_0x59db58){var _0x2ab18a={'raw':!![],'where':{'id':_0x26ebbf[_0xfe72('0x42')]['id']}},_0x57294b={};_0x57294b['model']=_[_0xfe72('0x43')](db[_0xfe72('0x2d')][_0xfe72('0x2e')]);_0x57294b[_0xfe72('0x32')]=_[_0xfe72('0x43')](_0x26ebbf[_0xfe72('0x32')]);_0x57294b[_0xfe72('0x33')]=_[_0xfe72('0x34')](_0x57294b['model'],_0x57294b['query']);_0x2ab18a[_0xfe72('0x35')]=_['intersection'](_0x57294b['model'],qs[_0xfe72('0x36')](_0x26ebbf[_0xfe72('0x32')][_0xfe72('0x36')]));_0x2ab18a[_0xfe72('0x35')]=_0x2ab18a[_0xfe72('0x35')][_0xfe72('0x37')]?_0x2ab18a[_0xfe72('0x35')]:_0x57294b['model'];if(_0x26ebbf[_0xfe72('0x32')][_0xfe72('0x44')]){_0x2ab18a[_0xfe72('0x45')]=[{'all':!![]}];}_0x2ab18a=_['merge']({},_0x2ab18a,_0x26ebbf['options']);return db['VoiceTransferReport'][_0xfe72('0x46')](_0x2ab18a)[_0xfe72('0x24')](handleEntityNotFound(_0x59db58,null))[_0xfe72('0x24')](respondWithResult(_0x59db58,null))[_0xfe72('0x40')](handleError(_0x59db58,null));};exports[_0xfe72('0x47')]=function(_0x3671f6,_0x169234){return db[_0xfe72('0x2d')][_0xfe72('0x47')](_0x3671f6[_0xfe72('0x48')],{})['then'](respondWithResult(_0x169234,0xc9))[_0xfe72('0x40')](handleError(_0x169234,null));};exports[_0xfe72('0x49')]=function(_0x3d2b32,_0x4ee99f){if(_0x3d2b32[_0xfe72('0x48')]['id']){delete _0x3d2b32[_0xfe72('0x48')]['id'];}return db[_0xfe72('0x2d')][_0xfe72('0x46')]({'where':{'id':_0x3d2b32[_0xfe72('0x42')]['id']}})[_0xfe72('0x24')](handleEntityNotFound(_0x4ee99f,null))[_0xfe72('0x24')](saveUpdates(_0x3d2b32[_0xfe72('0x48')],null))['then'](respondWithResult(_0x4ee99f,null))[_0xfe72('0x40')](handleError(_0x4ee99f,null));};exports['destroy']=function(_0x5b8eb4,_0x502bce){return db[_0xfe72('0x2d')][_0xfe72('0x46')]({'where':{'id':_0x5b8eb4[_0xfe72('0x42')]['id']}})[_0xfe72('0x24')](handleEntityNotFound(_0x502bce,null))['then'](removeEntity(_0x502bce,null))[_0xfe72('0x40')](handleError(_0x502bce,null));};exports[_0xfe72('0x4a')]=function(_0x2ddf9c,_0x3d31d9){return db[_0xfe72('0x2d')][_0xfe72('0x4a')]()[_0xfe72('0x24')](respondWithResult(_0x3d31d9,null))[_0xfe72('0x40')](handleError(_0x3d31d9,null));}; \ No newline at end of file +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 diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 38b4354..34ef284 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 _0x541d=['exports','define','VoiceTransferReport','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x4524c2,_0x42e2bd){var _0x5cc12b=function(_0x230ec5){while(--_0x230ec5){_0x4524c2['push'](_0x4524c2['shift']());}};_0x5cc12b(++_0x42e2bd);}(_0x541d,0xac));var _0xd541=function(_0x59febd,_0x4ed4db){_0x59febd=_0x59febd-0x0;var _0x21fe93=_0x541d[_0x59febd];return _0x21fe93;};'use strict';var _=require(_0xd541('0x0'));var util=require(_0xd541('0x1'));var logger=require('../../config/logger')(_0xd541('0x2'));var moment=require(_0xd541('0x3'));var BPromise=require(_0xd541('0x4'));var rp=require(_0xd541('0x5'));var fs=require('fs');var path=require(_0xd541('0x6'));var rimraf=require(_0xd541('0x7'));var config=require(_0xd541('0x8'));var attributes=require(_0xd541('0x9'));module[_0xd541('0xa')]=function(_0x893a55,_0x27b3f3){return _0x893a55[_0xd541('0xb')](_0xd541('0xc'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 2a13b24..da3ba7f 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 _0xa092=['../../config/logger','rpc','../../config/environment','request','info','request\x20sent','debug','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','message','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x211e6d,_0x8264c5){var _0x111c55=function(_0x259123){while(--_0x259123){_0x211e6d['push'](_0x211e6d['shift']());}};_0x111c55(++_0x8264c5);}(_0xa092,0xb5));var _0x2a09=function(_0x38a140,_0x484518){_0x38a140=_0x38a140-0x0;var _0x1292a0=_0xa092[_0x38a140];return _0x1292a0;};'use strict';var _=require(_0x2a09('0x0'));var util=require(_0x2a09('0x1'));var moment=require(_0x2a09('0x2'));var BPromise=require(_0x2a09('0x3'));var rs=require(_0x2a09('0x4'));var fs=require('fs');var Redis=require(_0x2a09('0x5'));var db=require(_0x2a09('0x6'))['db'];var utils=require(_0x2a09('0x7'));var logger=require(_0x2a09('0x8'))(_0x2a09('0x9'));var config=require(_0x2a09('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5f3cf8,_0x42ac8d,_0x3585f1){return new BPromise(function(_0x1cde28,_0x42cba7){return client[_0x2a09('0xb')](_0x5f3cf8,_0x3585f1)['then'](function(_0x1702b1){logger[_0x2a09('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x42ac8d,_0x2a09('0xd'));logger[_0x2a09('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x42ac8d,_0x2a09('0xd'),JSON[_0x2a09('0xf')](_0x1702b1));if(_0x1702b1[_0x2a09('0x10')]){if(_0x1702b1['error'][_0x2a09('0x11')]===0x1f4){logger[_0x2a09('0x10')]('VoiceTransferReport,\x20%s,\x20%s',_0x42ac8d,_0x1702b1['error']['message']);return _0x42cba7(_0x1702b1[_0x2a09('0x10')]['message']);}logger[_0x2a09('0x10')](_0x2a09('0x12'),_0x42ac8d,_0x1702b1[_0x2a09('0x10')][_0x2a09('0x13')]);return _0x1cde28(_0x1702b1[_0x2a09('0x10')][_0x2a09('0x13')]);}else{logger['info'](_0x2a09('0x12'),_0x42ac8d,'request\x20sent');_0x1cde28(_0x1702b1['result'][_0x2a09('0x13')]);}})['catch'](function(_0x15b284){logger['error'](_0x2a09('0x12'),_0x42ac8d,_0x15b284);_0x42cba7(_0x15b284);});});}exports[_0x2a09('0x14')]=function(_0x1d2239){var _0x37ae82=this;return new Promise(function(_0x2e0a54,_0x6ceb09){return db[_0x2a09('0x15')][_0x2a09('0x16')](_0x1d2239[_0x2a09('0x17')],{'raw':_0x1d2239[_0x2a09('0x18')]?_0x1d2239[_0x2a09('0x18')][_0x2a09('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2acd25){logger[_0x2a09('0xc')]('CreateVoiceTransferReport',_0x1d2239);logger[_0x2a09('0xe')](_0x2a09('0x14'),_0x1d2239,JSON[_0x2a09('0xf')](_0x2acd25));_0x2e0a54(_0x2acd25);})[_0x2a09('0x1a')](function(_0x425d22){logger[_0x2a09('0x10')](_0x2a09('0x14'),_0x425d22[_0x2a09('0x13')],_0x1d2239);_0x6ceb09(_0x37ae82['error'](0x1f4,_0x425d22[_0x2a09('0x13')]));});});}; \ No newline at end of file +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 diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index ac136c2..58bd363 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 _0xd808=['Router','canUpdate','post','hangup','/answer','isAuthenticated','answer','/hold','hold','/unhold','unhold','/calls','/transfer','express'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0xd808,0x133));var _0x8d80=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xd808[_0x562f3b];return _0x1edd55;};'use strict';var express=require(_0x8d80('0x0'));var router=express[_0x8d80('0x1')]();var auth=require('../../components/auth/service');var controller=require('./webbar.controller');router['post']('/originate',auth['isAuthenticated'](),auth[_0x8d80('0x2')](),controller['originate']);router[_0x8d80('0x3')]('/hangup',auth['isAuthenticated'](),auth[_0x8d80('0x2')](),controller[_0x8d80('0x4')]);router[_0x8d80('0x3')](_0x8d80('0x5'),auth[_0x8d80('0x6')](),auth[_0x8d80('0x2')](),controller[_0x8d80('0x7')]);router[_0x8d80('0x3')](_0x8d80('0x8'),auth[_0x8d80('0x6')](),auth[_0x8d80('0x2')](),controller[_0x8d80('0x9')]);router[_0x8d80('0x3')](_0x8d80('0xa'),auth[_0x8d80('0x6')](),auth[_0x8d80('0x2')](),controller[_0x8d80('0xb')]);router[_0x8d80('0x3')](_0x8d80('0xc'),auth[_0x8d80('0x6')](),auth['canUpdate'](),controller['calls']);router['post'](_0x8d80('0xd'),auth[_0x8d80('0x6')](),auth['canUpdate'](),controller['transfer']);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index cda8fda..f5d27a3 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 _0xb07f=['hold','hold\x20fired:','user:%s','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','stack','name','send','status','NotFound','request','then','error','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','length','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','webbar:originate','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xb07f,0x109));var _0xfb07=function(_0xdc34a5,_0x50a396){_0xdc34a5=_0xdc34a5-0x0;var _0x5f3990=_0xb07f[_0xdc34a5];return _0x5f3990;};'use strict';var path=require(_0xfb07('0x0'));var fs=require('fs');var _=require(_0xfb07('0x1'));var db=require(_0xfb07('0x2'))['db'];var config=require(_0xfb07('0x3'));var util=require(_0xfb07('0x4'));var BPromise=require(_0xfb07('0x5'));var jayson=require(_0xfb07('0x6'));var amiClient=jayson[_0xfb07('0x7')][_0xfb07('0x8')]({'port':0x232a});var logger=require(_0xfb07('0x9'))(_0xfb07('0xa'));var Redis=require('ioredis');config[_0xfb07('0xb')]=_[_0xfb07('0xc')](config[_0xfb07('0xb')],{'host':_0xfb07('0xd'),'port':0x18eb});var io=require(_0xfb07('0xe'))(new Redis(config[_0xfb07('0xb')]));var Schema=require(_0xfb07('0xf'));var originateValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'callNumber':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x13')]},'callerId':{'type':_0xfb07('0x12')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x14')]},'transferNumber':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x15')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]}});function emit(_0x6a14e0,_0x3dde76,_0x1cfc43){logger[_0xfb07('0x16')](_0x6a14e0,_0x3dde76,JSON[_0xfb07('0x17')](_0x1cfc43));io['to'](_0x6a14e0)['emit'](_0x3dde76,_0x1cfc43);}function handleError(_0x57fc39){return function(_0x3e747e){console[_0xfb07('0x18')](_0xfb07('0x19'),_0x3e747e,_0x3e747e instanceof RangeError);logger['error'](_0x3e747e[_0xfb07('0x1a')]);if(_0x3e747e instanceof RangeError){if(_0x3e747e[_0xfb07('0x1b')]){delete _0x3e747e['name'];}_0x57fc39['status'](0x194)[_0xfb07('0x1c')](_0x3e747e);}else{if(_0x3e747e[_0xfb07('0x1b')]){delete _0x3e747e[_0xfb07('0x1b')];}_0x57fc39[_0xfb07('0x1d')](0x1f4)[_0xfb07('0x1c')](_0x3e747e);}};}function checkError(){return function(_0x323bec){if(!_0x323bec){throw new RangeError(_0xfb07('0x1e'));}return _0x323bec;};}function respondWithRpcPromise(_0x23c2be,_0x19ad99){return new BPromise(function(_0x578bb2,_0x45806a){var _0x56d0c4=amiClient;return _0x56d0c4[_0xfb07('0x1f')](_0x23c2be,_0x19ad99)[_0xfb07('0x20')](function(_0x428c85){if(_0x428c85[_0xfb07('0x21')]){if(_0x428c85[_0xfb07('0x21')]['code']===0x1f4){return _0x45806a(_0x428c85[_0xfb07('0x21')][_0xfb07('0x22')]);}return _0x578bb2(_0x428c85[_0xfb07('0x21')][_0xfb07('0x22')]);}else{_0x578bb2(_0x428c85[_0xfb07('0x23')]);}})[_0xfb07('0x24')](function(_0x531346){_0x45806a(_0x531346);});});}function getAgent(_0x36d6f3){return db[_0xfb07('0x25')]['findOne']({'where':{'id':_0x36d6f3,'role':_0xfb07('0x26')}})[_0xfb07('0x20')](checkError());}function getAgentCheckSession(_0xe813a7,_0x149ac0){return new BPromise(function(_0x46927a,_0x2b0650){var _0x20f01a=respondWithRpcPromise(_0xfb07('0x27'));var _0x95f1d=getAgent(_0xe813a7);Promise[_0xfb07('0x28')]([_0x20f01a,_0x95f1d])[_0xfb07('0x20')](function(_0x49b06e){var _0x217932=_0x49b06e[0x0];var _0x1e4cb8=_0x49b06e[0x1];var _0x36787a=_[_0xfb07('0x29')](_0x217932['rows'],function(_0x46d57e){return _0x46d57e[_0xfb07('0x2a')]==_0x1e4cb8['id']&&_0x46d57e['sessionId']==_0x149ac0;});if(_0x36787a[_0xfb07('0x2b')]==0x1){_0x46927a(_0x1e4cb8);}else{_0x2b0650(new RangeError('sessionId\x20'+_0x149ac0+_0xfb07('0x2c')));}});});}exports['originate']=function(_0x56b48c,_0x4a8d4c){logger[_0xfb07('0x16')](_0xfb07('0x2d'),_0x56b48c[_0xfb07('0x2e')]);var _0x4452d7=originateValidation[_0xfb07('0xf')](_0x56b48c[_0xfb07('0x2e')]);if(_0x4452d7['length']>0x0){return _0x4a8d4c['status'](0x190)[_0xfb07('0x2f')](_0x4452d7);}var _0x1cccdd=_0x56b48c[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x5e28cd=_0x56b48c['body'][_0xfb07('0x31')];var _0x3e0d11=_0x56b48c[_0xfb07('0x2e')][_0xfb07('0x32')];var _0x4d06f5=_0x56b48c[_0xfb07('0x2e')]['callbackUrl'];return getAgent(_0x1cccdd)['then'](function(_0x4a5055){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x4a5055[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')]('user:%s',_0x4a5055['name']),_0xfb07('0x35'),{'callNumber':_0x5e28cd,'callerId':_0x3e0d11,'callbackUrl':_0x4d06f5});return _0x4a8d4c[_0xfb07('0x1d')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x4a8d4c));};exports[_0xfb07('0x36')]=function(_0x10cd8b,_0x55de52){logger['info'](_0xfb07('0x37'),_0x10cd8b[_0xfb07('0x2e')]);var _0x18c41f=hangupValidation[_0xfb07('0xf')](_0x10cd8b[_0xfb07('0x2e')]);if(_0x18c41f['length']>0x0){return _0x55de52[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x18c41f);}var _0xac769b=_0x10cd8b[_0xfb07('0x2e')]['userId'];var _0x4ab5dd=_0x10cd8b[_0xfb07('0x2e')][_0xfb07('0x38')];return getAgent(_0xac769b)[_0xfb07('0x20')](function(_0xc5df59){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0xc5df59[_0xfb07('0x1b')]);emit(util['format']('user:%s',_0xc5df59[_0xfb07('0x1b')]),_0xfb07('0x39'),{'sessionId':_0x4ab5dd});return _0x55de52['status'](0xc8)['json']({'error':![],'message':_0xfb07('0x3a')});})[_0xfb07('0x24')](handleError(_0x55de52));};exports[_0xfb07('0x3b')]=function(_0x48c179,_0x479e61){logger[_0xfb07('0x16')](_0xfb07('0x3c'),_0x48c179[_0xfb07('0x2e')]);var _0x123e3d=answerValidation[_0xfb07('0xf')](_0x48c179[_0xfb07('0x2e')]);if(_0x123e3d[_0xfb07('0x2b')]>0x0){return _0x479e61[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x123e3d);}var _0x492f1b=_0x48c179[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x3d6372=_0x48c179[_0xfb07('0x2e')][_0xfb07('0x38')];return getAgent(_0x492f1b)[_0xfb07('0x20')](function(_0x4cb228){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x4cb228[_0xfb07('0x1b')]);emit(util['format']('user:%s',_0x4cb228[_0xfb07('0x1b')]),_0xfb07('0x3d'),{'sessionId':_0x3d6372});return _0x479e61['status'](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x3e')});})[_0xfb07('0x24')](handleError(_0x479e61));};exports[_0xfb07('0x3f')]=function(_0x44568c,_0x567958){logger['info'](_0xfb07('0x40'),_0x44568c[_0xfb07('0x2e')]);var _0x38354c=holdValidation[_0xfb07('0xf')](_0x44568c[_0xfb07('0x2e')]);if(_0x38354c[_0xfb07('0x2b')]>0x0){return _0x567958[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x38354c);}var _0x186987=_0x44568c[_0xfb07('0x2e')]['userId'];var _0x5b304d=_0x44568c['body'][_0xfb07('0x38')];return getAgent(_0x186987)['then'](function(_0x2397f8){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x2397f8[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x2397f8['name']),_0xfb07('0x42'),{'sessionId':_0x5b304d});return _0x567958[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x43')});})[_0xfb07('0x24')](handleError(_0x567958));};exports['unhold']=function(_0x3cfb89,_0x3b85f7){logger[_0xfb07('0x16')](_0xfb07('0x44'),_0x3cfb89[_0xfb07('0x2e')]);var _0x5179c2=unholdValidation[_0xfb07('0xf')](_0x3cfb89[_0xfb07('0x2e')]);if(_0x5179c2[_0xfb07('0x2b')]>0x0){return _0x3b85f7[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x5179c2);}var _0x529936=_0x3cfb89[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x26a7b7=_0x3cfb89[_0xfb07('0x2e')]['sessionId'];return getAgent(_0x529936)[_0xfb07('0x20')](function(_0x204469){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x204469[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x204469[_0xfb07('0x1b')]),_0xfb07('0x45'),{'sessionId':_0x26a7b7});return _0x3b85f7[_0xfb07('0x1d')](0xc8)['json']({'error':![],'message':_0xfb07('0x46')});})['catch'](handleError(_0x3b85f7));};exports[_0xfb07('0x47')]=function(_0xfcaeb7,_0x22fa5c){logger[_0xfb07('0x16')](_0xfb07('0x48'),_0x22fa5c[_0xfb07('0x2e')]);var _0x1c76af=callsValidation['validate'](_0xfcaeb7['body']);if(_0x1c76af['length']>0x0){return _0x22fa5c[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x1c76af);}var _0x44d1a1=_0xfcaeb7['body'][_0xfb07('0x30')];var _0x4ef1a4=respondWithRpcPromise(_0xfb07('0x27'));var _0x29e4be=getAgent(_0x44d1a1);return Promise['all']([_0x4ef1a4,_0x29e4be])[_0xfb07('0x20')](function(_0x2f9f0f){var _0x18d0de=_0x2f9f0f[0x0];var _0xc122ae=_0x2f9f0f[0x1];var _0x294dc8=_[_0xfb07('0x29')](_0x18d0de[_0xfb07('0x49')],function(_0x18ae74){return _0x18ae74[_0xfb07('0x2a')]==_0xc122ae['id'];});return _0x22fa5c[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'count':_0x294dc8[_0xfb07('0x2b')],'rows':_0x294dc8});})[_0xfb07('0x24')](handleError(_0x22fa5c));};exports[_0xfb07('0x4a')]=function(_0x5387ce,_0x275aba){logger[_0xfb07('0x16')]('conference\x20fired:',_0x5387ce['body']);var _0xb5bf41=conferenceValidation[_0xfb07('0xf')](_0x5387ce[_0xfb07('0x2e')]);if(_0xb5bf41['length']>0x0){return _0x275aba[_0xfb07('0x1d')](0x190)['json'](_0xb5bf41);}var _0x4e323f=_0x5387ce['body']['userId'];return getAgent(_0x4e323f)[_0xfb07('0x20')](function(_0x237117){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x237117[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x237117['name']),_0xfb07('0x4b'));return _0x275aba[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x4c')});})[_0xfb07('0x24')](handleError(_0x275aba));};exports[_0xfb07('0x4d')]=function(_0x268d88,_0x238492){logger['info'](_0xfb07('0x4e'),_0x268d88[_0xfb07('0x2e')]);var _0x3831bf=transferValidation[_0xfb07('0xf')](_0x268d88[_0xfb07('0x2e')]);if(_0x3831bf['length']>0x0){return _0x238492['status'](0x190)[_0xfb07('0x2f')](_0x3831bf);}var _0x231247=_0x268d88['body'][_0xfb07('0x30')];var _0x311c6d=_0x268d88[_0xfb07('0x2e')][_0xfb07('0x38')];var _0x127392=_0x268d88[_0xfb07('0x2e')][_0xfb07('0x4f')];return getAgent(_0x231247)['then'](function(_0x4c1238){logger[_0xfb07('0x16')]('entityFound:',_0x4c1238[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x4c1238[_0xfb07('0x1b')]),_0xfb07('0x50'),{'sessionId':_0x311c6d,'transferNumber':_0x127392});return _0x238492[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x51')});})[_0xfb07('0x24')](handleError(_0x238492));}; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 581c076..85f1e28 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 _0x66fa=['/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','/:id/dispositions','addDisposition','addAgents','/:id/notify','notify','/:id/send','send','put'];(function(_0x364dbb,_0x364ba2){var _0x2285c7=function(_0x599e38){while(--_0x599e38){_0x364dbb['push'](_0x364dbb['shift']());}};_0x2285c7(++_0x364ba2);}(_0x66fa,0x117));var _0xa66f=function(_0x430da9,_0x51d2fc){_0x430da9=_0x430da9-0x0;var _0x16ae43=_0x66fa[_0x430da9];return _0x16ae43;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0xb')](_0xa66f('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x12')](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa66f('0x12')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x15')]);router['post'](_0xa66f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa66f('0x12')](_0xa66f('0x16'),controller[_0xa66f('0x17')]);router[_0xa66f('0x12')](_0xa66f('0x18'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x19')]);router[_0xa66f('0x1a')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1c')]);router[_0xa66f('0x1d')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1e')]);router['delete'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1f')]);router[_0xa66f('0x1d')]('/:id/canned_answers',auth[_0xa66f('0x9')](),controller[_0xa66f('0x20')]);router[_0xa66f('0x1d')](_0xa66f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa66f('0x21')]=router; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 3b2a426..768f528 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 _0x1dd6=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','generate','sinch'];(function(_0x4266c5,_0x1dde64){var _0x249800=function(_0x3d74b3){while(--_0x3d74b3){_0x4266c5['push'](_0x4266c5['shift']());}};_0x249800(++_0x1dde64);}(_0x1dd6,0xdb));var _0x61dd=function(_0xe00497,_0x109ce6){_0xe00497=_0xe00497-0x0;var _0x46d918=_0x1dd6[_0xe00497];return _0x46d918;};'use strict';var Sequelize=require(_0x61dd('0x0'));var rs=require('randomstring');module[_0x61dd('0x1')]={'name':{'type':Sequelize[_0x61dd('0x2')],'unique':_0x61dd('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x61dd('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x61dd('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x61dd('0x2')],'defaultValue':function(){return rs[_0x61dd('0x4')]();}},'phone':{'type':Sequelize[_0x61dd('0x2')]},'type':{'type':Sequelize['ENUM']('twilio',_0x61dd('0x5'))},'accountSid':{'type':Sequelize[_0x61dd('0x2')]},'baseUrl':{'type':Sequelize[_0x61dd('0x2')]},'authToken':{'type':Sequelize[_0x61dd('0x2')]},'notificationTemplate':{'type':Sequelize[_0x61dd('0x6')],'defaultValue':function(){return _0x61dd('0x7');}},'notificationSound':{'type':Sequelize[_0x61dd('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x61dd('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x61dd('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x61dd('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x61dd('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x61dd('0x9')],'comment':_0x61dd('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x61dd('0x8')],'defaultValue':![],'comment':_0x61dd('0xb'),'set':function(_0x51d3a6){if(!_0x51d3a6){this[_0x61dd('0xc')](_0x61dd('0xd'),null);}this[_0x61dd('0xc')](_0x61dd('0xe'),_0x51d3a6);}},'description':{'type':Sequelize[_0x61dd('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index b8e94b1..bfcfec5 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 _0xc299=['VIRTUAL','options','WhatsappAccount','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','findOne','Disposition','length','WhatsappAccountId','filter','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','account','sinch','statuses','state','read','timestamp','message_id','applications','Applications','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','whatsapp:','messageId','notifications','isNil','ValidationError','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','contact','WhatsappInteraction','spread','interaction','created','autoclose','push','close','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','entity\x20found','text/xml','send','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','DESC','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','merge','type'];(function(_0xa87394,_0x3db8ab){var _0x33d1b6=function(_0x169710){while(--_0x169710){_0xa87394['push'](_0xa87394['shift']());}};_0x33d1b6(++_0x3db8ab);}(_0xc299,0x135));var _0x9c29=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xc299[_0x68ee8b];return _0x5148f7;};'use strict';var emlformat=require(_0x9c29('0x0'));var rimraf=require(_0x9c29('0x1'));var zipdir=require(_0x9c29('0x2'));var jsonpatch=require(_0x9c29('0x3'));var rp=require(_0x9c29('0x4'));var moment=require(_0x9c29('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c29('0x6'));var util=require(_0x9c29('0x7'));var path=require(_0x9c29('0x8'));var sox=require(_0x9c29('0x9'));var csv=require('to-csv');var ejs=require(_0x9c29('0xa'));var fs=require('fs');var fs_extra=require(_0x9c29('0xb'));var _=require(_0x9c29('0xc'));var squel=require('squel');var crypto=require(_0x9c29('0xd'));var jsforce=require(_0x9c29('0xe'));var deskjs=require(_0x9c29('0xf'));var toCsv=require(_0x9c29('0x10'));var querystring=require(_0x9c29('0x11'));var Papa=require(_0x9c29('0x12'));var Redis=require('ioredis');var authService=require(_0x9c29('0x13'));var qs=require(_0x9c29('0x14'));var as=require(_0x9c29('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9c29('0x16'))(_0x9c29('0x17'));var utils=require(_0x9c29('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9c29('0x19')]=_[_0x9c29('0x1a')](config[_0x9c29('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x9c29('0x1b'))(new Redis(config[_0x9c29('0x19')]));require(_0x9c29('0x1c'))[_0x9c29('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x9c29('0x1e')][_0x9c29('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x3b62a3,_0xfdab2,_0x20ce58,_0x54d18d){return new BPromise(function(_0x49345e,_0x4fe723){var _0x593304=_0x54d18d||client;return _0x593304[_0x9c29('0x20')](_0x3b62a3,_0x20ce58)['then'](function(_0x53a308){logger[_0x9c29('0x21')](_0x9c29('0x22'),_0xfdab2,_0x9c29('0x23'));logger[_0x9c29('0x24')](_0x9c29('0x25'),_0xfdab2,_0x9c29('0x23'),JSON[_0x9c29('0x26')](_0x53a308));if(_0x53a308[_0x9c29('0x27')]){if(_0x53a308[_0x9c29('0x27')][_0x9c29('0x28')]===0x1f4){logger[_0x9c29('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0xfdab2,_0x53a308[_0x9c29('0x27')]['message']);return _0x4fe723(_0x53a308[_0x9c29('0x27')][_0x9c29('0x29')]);}logger[_0x9c29('0x27')](_0x9c29('0x22'),_0xfdab2,_0x53a308[_0x9c29('0x27')][_0x9c29('0x29')]);return _0x49345e(_0x53a308[_0x9c29('0x27')]['message']);}else{logger[_0x9c29('0x21')](_0x9c29('0x22'),_0xfdab2,_0x9c29('0x23'));_0x49345e(_0x53a308[_0x9c29('0x2a')][_0x9c29('0x29')]);}})[_0x9c29('0x2b')](function(_0x351380){logger['error'](_0x9c29('0x22'),_0xfdab2,_0x351380);_0x4fe723(_0x351380);});});}function respondWithStatusCode(_0x294564,_0x249b27){_0x249b27=_0x249b27||0xcc;return function(_0x5ab0d4){if(_0x5ab0d4){return _0x294564[_0x9c29('0x2c')](_0x249b27);}return _0x294564[_0x9c29('0x2d')](_0x249b27)[_0x9c29('0x2e')]();};}function respondWithResult(_0x9896bc,_0x364e0e){_0x364e0e=_0x364e0e||0xc8;return function(_0x16cf1d){if(_0x16cf1d){return _0x9896bc[_0x9c29('0x2d')](_0x364e0e)[_0x9c29('0x2f')](_0x16cf1d);}};}function respondWithFilteredResult(_0x5eee2e,_0x58d69f){return function(_0x55fa58){if(_0x55fa58){var _0xf727b7=typeof _0x58d69f[_0x9c29('0x30')]===_0x9c29('0x31')&&typeof _0x58d69f[_0x9c29('0x32')]===_0x9c29('0x31');var _0x24a541=_0x55fa58[_0x9c29('0x33')];var _0x4d9b50=_0xf727b7?0x0:_0x58d69f[_0x9c29('0x30')];var _0x436c5c=_0xf727b7?_0x55fa58['count']:_0x58d69f[_0x9c29('0x30')]+_0x58d69f[_0x9c29('0x32')];var _0x292e77;if(_0x436c5c>=_0x24a541){_0x436c5c=_0x24a541;_0x292e77=0xc8;}else{_0x292e77=0xce;}_0x5eee2e[_0x9c29('0x2d')](_0x292e77);return _0x5eee2e[_0x9c29('0x34')](_0x9c29('0x35'),_0x4d9b50+'-'+_0x436c5c+'/'+_0x24a541)[_0x9c29('0x2f')](_0x55fa58);}return null;};}function patchUpdates(_0x15d231){return function(_0xbb4032){try{jsonpatch['apply'](_0xbb4032,_0x15d231,!![]);}catch(_0x5cdd72){return BPromise[_0x9c29('0x36')](_0x5cdd72);}return _0xbb4032[_0x9c29('0x37')]();};}function saveUpdates(_0xd37829,_0x4ede26){return function(_0x4874fb){if(_0x4874fb){return _0x4874fb[_0x9c29('0x38')](_0xd37829)[_0x9c29('0x39')](function(_0x12e17f){return _0x12e17f;});}return null;};}function removeEntity(_0x1cb511,_0x1373cf){return function(_0x47faae){if(_0x47faae){return _0x47faae[_0x9c29('0x3a')]()[_0x9c29('0x39')](function(){var _0x528740=_0x47faae[_0x9c29('0x3b')]({'plain':!![]});var _0x280a29=_0x9c29('0x3c');return db[_0x9c29('0x3d')][_0x9c29('0x3a')]({'where':{'type':_0x280a29,'resourceId':_0x528740['id']}})[_0x9c29('0x39')](function(){return _0x47faae;});})[_0x9c29('0x39')](function(){_0x1cb511[_0x9c29('0x2d')](0xcc)[_0x9c29('0x2e')]();});}};}function handleEntityNotFound(_0x528b52,_0x2bd573){return function(_0x1da1d3){if(!_0x1da1d3){_0x528b52[_0x9c29('0x2c')](0x194);}return _0x1da1d3;};}function handleError(_0x353e4d,_0x5dbd3f){_0x5dbd3f=_0x5dbd3f||0x1f4;return function(_0xf0a8ed){logger[_0x9c29('0x27')](_0xf0a8ed[_0x9c29('0x3e')]);if(_0xf0a8ed[_0x9c29('0x3f')]){delete _0xf0a8ed[_0x9c29('0x3f')];}_0x353e4d[_0x9c29('0x2d')](_0x5dbd3f)['send'](_0xf0a8ed);};}exports['index']=function(_0x1c1d91,_0x8ec60b){var _0x1afffb={'include':[{'model':db[_0x9c29('0x40')],'as':_0x9c29('0x41')}]},_0x442c67={},_0x563402={'count':0x0,'rows':[]};var _0x2e36e6=_[_0x9c29('0x42')](db['WhatsappAccount']['rawAttributes'],function(_0x41d73c){return{'name':_0x41d73c[_0x9c29('0x43')],'type':_0x41d73c['type'][_0x9c29('0x44')]};});_0x442c67[_0x9c29('0x45')]=_[_0x9c29('0x42')](_0x2e36e6,_0x9c29('0x3f'));_0x442c67['query']=_[_0x9c29('0x46')](_0x1c1d91[_0x9c29('0x47')]);_0x442c67[_0x9c29('0x48')]=_[_0x9c29('0x49')](_0x442c67[_0x9c29('0x45')],_0x442c67[_0x9c29('0x47')]);_0x1afffb['attributes']=_[_0x9c29('0x49')](_0x442c67[_0x9c29('0x45')],qs['fields'](_0x1c1d91['query'][_0x9c29('0x4a')]));_0x1afffb['attributes']=_0x1afffb[_0x9c29('0x4b')]['length']?_0x1afffb[_0x9c29('0x4b')]:_0x442c67[_0x9c29('0x45')];if(!_0x1c1d91[_0x9c29('0x47')][_0x9c29('0x4c')](_0x9c29('0x4d'))){_0x1afffb[_0x9c29('0x32')]=qs['limit'](_0x1c1d91['query'][_0x9c29('0x32')]);_0x1afffb[_0x9c29('0x30')]=qs['offset'](_0x1c1d91[_0x9c29('0x47')]['offset']);}_0x1afffb['order']=qs[_0x9c29('0x4e')](_0x1c1d91[_0x9c29('0x47')][_0x9c29('0x4e')]);_0x1afffb[_0x9c29('0x4f')]=qs[_0x9c29('0x48')](_[_0x9c29('0x50')](_0x1c1d91['query'],_0x442c67[_0x9c29('0x48')]),_0x2e36e6);if(_0x1c1d91[_0x9c29('0x47')]['filter']){_0x1afffb[_0x9c29('0x4f')]=_[_0x9c29('0x51')](_0x1afffb[_0x9c29('0x4f')],{'$or':_[_0x9c29('0x42')](_0x2e36e6,function(_0x3e05af){if(_0x3e05af[_0x9c29('0x52')]!==_0x9c29('0x53')){var _0x162ee8={};_0x162ee8[_0x3e05af[_0x9c29('0x3f')]]={'$like':'%'+_0x1c1d91['query']['filter']+'%'};return _0x162ee8;}})});}_0x1afffb=_[_0x9c29('0x51')]({},_0x1afffb,_0x1c1d91[_0x9c29('0x54')]);var _0x2dda28={'where':_0x1afffb[_0x9c29('0x4f')]};return db[_0x9c29('0x55')][_0x9c29('0x33')](_0x2dda28)[_0x9c29('0x39')](function(_0x3a2af0){_0x563402[_0x9c29('0x33')]=_0x3a2af0;if(_0x1c1d91[_0x9c29('0x47')][_0x9c29('0x56')]){_0x1afffb[_0x9c29('0x57')]=[{'all':!![]}];}return db[_0x9c29('0x55')][_0x9c29('0x58')](_0x1afffb);})['then'](function(_0x1a0a29){_0x563402[_0x9c29('0x59')]=_0x1a0a29;return _0x563402;})[_0x9c29('0x39')](respondWithFilteredResult(_0x8ec60b,_0x1afffb))['catch'](handleError(_0x8ec60b,null));};exports['show']=function(_0x2cd2b0,_0x28de70){var _0x26f37a={'raw':![],'where':{'id':_0x2cd2b0[_0x9c29('0x5a')]['id']},'include':[{'model':db[_0x9c29('0x40')],'as':_0x9c29('0x41')}]},_0x35291c={};_0x35291c['model']=_['keys'](db[_0x9c29('0x55')][_0x9c29('0x5b')]);_0x35291c[_0x9c29('0x47')]=_[_0x9c29('0x46')](_0x2cd2b0[_0x9c29('0x47')]);_0x35291c[_0x9c29('0x48')]=_[_0x9c29('0x49')](_0x35291c[_0x9c29('0x45')],_0x35291c[_0x9c29('0x47')]);_0x26f37a[_0x9c29('0x4b')]=_[_0x9c29('0x49')](_0x35291c[_0x9c29('0x45')],qs[_0x9c29('0x4a')](_0x2cd2b0[_0x9c29('0x47')][_0x9c29('0x4a')]));_0x26f37a[_0x9c29('0x4b')]=_0x26f37a[_0x9c29('0x4b')]['length']?_0x26f37a[_0x9c29('0x4b')]:_0x35291c['model'];if(_0x2cd2b0[_0x9c29('0x47')][_0x9c29('0x56')]){_0x26f37a['include']=[{'all':!![]}];}_0x26f37a=_['merge']({},_0x26f37a,_0x2cd2b0[_0x9c29('0x54')]);return db[_0x9c29('0x55')][_0x9c29('0x5c')](_0x26f37a)[_0x9c29('0x39')](handleEntityNotFound(_0x28de70,null))[_0x9c29('0x39')](respondWithResult(_0x28de70,null))[_0x9c29('0x2b')](handleError(_0x28de70,null));};exports[_0x9c29('0x5d')]=function(_0x3f4bdd,_0x4384fd){return db[_0x9c29('0x55')][_0x9c29('0x5d')](_0x3f4bdd[_0x9c29('0x5e')],{})['then'](function(_0x551250){var _0x45921a=_0x3f4bdd['user']['get']({'plain':!![]});if(!_0x45921a)throw new Error(_0x9c29('0x5f'));if(_0x45921a[_0x9c29('0x60')]===_0x9c29('0x61')){var _0x40b363=_0x551250[_0x9c29('0x3b')]({'plain':!![]});var _0x6b118a=_0x9c29('0x3c');return db[_0x9c29('0x62')]['find']({'where':{'name':_0x6b118a,'userProfileId':_0x45921a[_0x9c29('0x63')]},'raw':!![]})[_0x9c29('0x39')](function(_0x212d47){if(_0x212d47&&_0x212d47[_0x9c29('0x64')]===0x0){return db[_0x9c29('0x3d')]['create']({'name':_0x40b363[_0x9c29('0x3f')],'resourceId':_0x40b363['id'],'type':_0x212d47['name'],'sectionId':_0x212d47['id']},{})[_0x9c29('0x39')](function(){return _0x551250;});}else{return _0x551250;}})['catch'](function(_0x1f9936){logger[_0x9c29('0x27')](_0x9c29('0x65'),_0x1f9936);throw _0x1f9936;});}return _0x551250;})[_0x9c29('0x39')](respondWithResult(_0x4384fd,0xc9))['catch'](handleError(_0x4384fd,null));};exports[_0x9c29('0x38')]=function(_0x12002c,_0x30fd81){if(_0x12002c['body']['id']){delete _0x12002c[_0x9c29('0x5e')]['id'];}return db['WhatsappAccount'][_0x9c29('0x5c')]({'where':{'id':_0x12002c[_0x9c29('0x5a')]['id']},'include':[{'model':db[_0x9c29('0x40')],'as':_0x9c29('0x41')}]})[_0x9c29('0x39')](handleEntityNotFound(_0x30fd81,null))[_0x9c29('0x39')](saveUpdates(_0x12002c[_0x9c29('0x5e')],null))[_0x9c29('0x39')](respondWithResult(_0x30fd81,null))[_0x9c29('0x2b')](handleError(_0x30fd81,null));};exports[_0x9c29('0x3a')]=function(_0x4c1fc1,_0x1e8be3){return db['WhatsappAccount'][_0x9c29('0x5c')]({'where':{'id':_0x4c1fc1[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x1e8be3,null))['then'](removeEntity(_0x1e8be3,null))['catch'](handleError(_0x1e8be3,null));};exports[_0x9c29('0x66')]=function(_0xdab61f,_0x1bc234){return db[_0x9c29('0x55')][_0x9c29('0x66')]()['then'](respondWithResult(_0x1bc234,null))['catch'](handleError(_0x1bc234,null));};exports[_0x9c29('0x67')]=function(_0x46853e,_0x164195,_0x5457c4){if(_0x46853e[_0x9c29('0x5e')]['id']){delete _0x46853e[_0x9c29('0x5e')]['id'];}return db[_0x9c29('0x55')][_0x9c29('0x5c')]({'where':{'id':_0x46853e[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x164195,null))['then'](function(_0x4bbda9){if(_0x4bbda9){_0x46853e[_0x9c29('0x5e')]['WhatsappAccountId']=_0x4bbda9['id'];return db['Disposition'][_0x9c29('0x5d')](_0x46853e[_0x9c29('0x5e')]);}})[_0x9c29('0x39')](respondWithResult(_0x164195,null))[_0x9c29('0x2b')](handleError(_0x164195,null));};exports[_0x9c29('0x68')]=function(_0x375beb,_0x37e005,_0x139e83){var _0xf7b238={'raw':![],'where':{}};var _0x40dc20={};var _0x3104d8={'count':0x0,'rows':[]};return db[_0x9c29('0x55')][_0x9c29('0x69')]({'where':{'id':_0x375beb['params']['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x37e005,null))[_0x9c29('0x39')](function(_0x3ac9c4){if(_0x3ac9c4){_0x40dc20[_0x9c29('0x45')]=_[_0x9c29('0x46')](db[_0x9c29('0x6a')][_0x9c29('0x5b')]);_0x40dc20[_0x9c29('0x47')]=_[_0x9c29('0x46')](_0x375beb[_0x9c29('0x47')]);_0x40dc20['filters']=_[_0x9c29('0x49')](_0x40dc20[_0x9c29('0x45')],_0x40dc20[_0x9c29('0x47')]);_0xf7b238[_0x9c29('0x4b')]=_['intersection'](_0x40dc20[_0x9c29('0x45')],qs['fields'](_0x375beb[_0x9c29('0x47')][_0x9c29('0x4a')]));_0xf7b238[_0x9c29('0x4b')]=_0xf7b238[_0x9c29('0x4b')][_0x9c29('0x6b')]?_0xf7b238[_0x9c29('0x4b')]:_0x40dc20[_0x9c29('0x45')];if(!_0x375beb[_0x9c29('0x47')][_0x9c29('0x4c')](_0x9c29('0x4d'))){_0xf7b238['limit']=qs[_0x9c29('0x32')](_0x375beb[_0x9c29('0x47')][_0x9c29('0x32')]);_0xf7b238['offset']=qs['offset'](_0x375beb[_0x9c29('0x47')]['offset']);}_0xf7b238['order']=qs[_0x9c29('0x4e')](_0x375beb[_0x9c29('0x47')][_0x9c29('0x4e')]);_0xf7b238['where']=qs[_0x9c29('0x48')](_[_0x9c29('0x50')](_0x375beb['query'],_0x40dc20[_0x9c29('0x48')]));_0xf7b238['where'][_0x9c29('0x6c')]=_0x3ac9c4['id'];if(_0x375beb[_0x9c29('0x47')]['filter']){_0xf7b238['where']=_[_0x9c29('0x51')](_0xf7b238[_0x9c29('0x4f')],{'$or':_[_0x9c29('0x42')](_0xf7b238[_0x9c29('0x4b')],function(_0x169fb3){var _0x20c1a8={};_0x20c1a8[_0x169fb3]={'$like':'%'+_0x375beb[_0x9c29('0x47')][_0x9c29('0x6d')]+'%'};return _0x20c1a8;})});}_0xf7b238=_[_0x9c29('0x51')]({},_0xf7b238,_0x375beb[_0x9c29('0x54')]);return db[_0x9c29('0x6a')][_0x9c29('0x33')]({'where':_0xf7b238[_0x9c29('0x4f')]})[_0x9c29('0x39')](function(_0x59f816){_0x3104d8[_0x9c29('0x33')]=_0x59f816;if(_0x375beb[_0x9c29('0x47')][_0x9c29('0x56')]){_0xf7b238[_0x9c29('0x57')]=[{'all':!![]}];}return db[_0x9c29('0x6a')][_0x9c29('0x58')](_0xf7b238);})[_0x9c29('0x39')](function(_0x2387cd){_0x3104d8['rows']=_0x2387cd;return _0x3104d8;});}})[_0x9c29('0x39')](respondWithFilteredResult(_0x37e005,_0xf7b238))['catch'](handleError(_0x37e005,null));};exports['removeDispositions']=function(_0xf45f06,_0x1c21d3,_0xbbf268){return db['WhatsappAccount'][_0x9c29('0x5c')]({'where':{'id':_0xf45f06[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x1c21d3,null))['then'](function(_0x5717d0){if(_0x5717d0){return _0x5717d0['removeDispositions'](_0xf45f06[_0x9c29('0x47')][_0x9c29('0x6e')]);}})[_0x9c29('0x39')](respondWithStatusCode(_0x1c21d3,null))[_0x9c29('0x2b')](handleError(_0x1c21d3,null));};exports[_0x9c29('0x6f')]=function(_0x54aa31,_0x5ef419,_0x3c8871){if(_0x54aa31[_0x9c29('0x5e')]['id']){delete _0x54aa31[_0x9c29('0x5e')]['id'];}return db[_0x9c29('0x55')][_0x9c29('0x5c')]({'where':{'id':_0x54aa31['params']['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x5ef419,null))[_0x9c29('0x39')](function(_0x12a966){if(_0x12a966){_0x54aa31[_0x9c29('0x5e')][_0x9c29('0x6c')]=_0x12a966['id'];return db[_0x9c29('0x70')]['create'](_0x54aa31[_0x9c29('0x5e')]);}})[_0x9c29('0x39')](respondWithResult(_0x5ef419,null))[_0x9c29('0x2b')](handleError(_0x5ef419,null));};exports[_0x9c29('0x71')]=function(_0x17e26d,_0x4e61f4,_0x37fb37){var _0x53048d={'raw':![],'where':{}};var _0x204cf9={};var _0x3835ec={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x17e26d[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x4e61f4,null))[_0x9c29('0x39')](function(_0x1f84c1){if(_0x1f84c1){_0x204cf9[_0x9c29('0x45')]=_[_0x9c29('0x46')](db[_0x9c29('0x70')][_0x9c29('0x5b')]);_0x204cf9[_0x9c29('0x47')]=_[_0x9c29('0x46')](_0x17e26d[_0x9c29('0x47')]);_0x204cf9['filters']=_[_0x9c29('0x49')](_0x204cf9['model'],_0x204cf9[_0x9c29('0x47')]);_0x53048d[_0x9c29('0x4b')]=_[_0x9c29('0x49')](_0x204cf9['model'],qs['fields'](_0x17e26d[_0x9c29('0x47')][_0x9c29('0x4a')]));_0x53048d[_0x9c29('0x4b')]=_0x53048d[_0x9c29('0x4b')]['length']?_0x53048d['attributes']:_0x204cf9[_0x9c29('0x45')];if(!_0x17e26d[_0x9c29('0x47')][_0x9c29('0x4c')]('nolimit')){_0x53048d[_0x9c29('0x32')]=qs[_0x9c29('0x32')](_0x17e26d['query'][_0x9c29('0x32')]);_0x53048d[_0x9c29('0x30')]=qs[_0x9c29('0x30')](_0x17e26d['query'][_0x9c29('0x30')]);}_0x53048d[_0x9c29('0x72')]=qs[_0x9c29('0x4e')](_0x17e26d[_0x9c29('0x47')][_0x9c29('0x4e')]);_0x53048d['where']=qs['filters'](_['pick'](_0x17e26d[_0x9c29('0x47')],_0x204cf9[_0x9c29('0x48')]));_0x53048d[_0x9c29('0x4f')]['WhatsappAccountId']=_0x1f84c1['id'];if(_0x17e26d[_0x9c29('0x47')]['filter']){_0x53048d[_0x9c29('0x4f')]=_['merge'](_0x53048d[_0x9c29('0x4f')],{'$or':_[_0x9c29('0x42')](_0x53048d[_0x9c29('0x4b')],function(_0x5d9441){var _0xd4ca26={};_0xd4ca26[_0x5d9441]={'$like':'%'+_0x17e26d['query'][_0x9c29('0x6d')]+'%'};return _0xd4ca26;})});}_0x53048d=_['merge']({},_0x53048d,_0x17e26d['options']);return db[_0x9c29('0x70')][_0x9c29('0x33')]({'where':_0x53048d[_0x9c29('0x4f')]})['then'](function(_0x489238){_0x3835ec['count']=_0x489238;if(_0x17e26d['query']['includeAll']){_0x53048d[_0x9c29('0x57')]=[{'all':!![]}];}return db[_0x9c29('0x70')]['findAll'](_0x53048d);})[_0x9c29('0x39')](function(_0x2de3b9){_0x3835ec[_0x9c29('0x59')]=_0x2de3b9;return _0x3835ec;});}})[_0x9c29('0x39')](respondWithFilteredResult(_0x4e61f4,_0x53048d))[_0x9c29('0x2b')](handleError(_0x4e61f4,null));};exports[_0x9c29('0x73')]=function(_0x5768fc,_0x48f09d,_0x2dd173){return db[_0x9c29('0x55')][_0x9c29('0x5c')]({'where':{'id':_0x5768fc[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x48f09d,null))[_0x9c29('0x39')](function(_0xf70646){if(_0xf70646){return _0xf70646[_0x9c29('0x73')](_0x5768fc[_0x9c29('0x47')][_0x9c29('0x6e')]);}})[_0x9c29('0x39')](respondWithStatusCode(_0x48f09d,null))[_0x9c29('0x2b')](handleError(_0x48f09d,null));};exports[_0x9c29('0x74')]=function(_0x1361ac,_0x3c4db9,_0x5859bc){return db[_0x9c29('0x55')]['find']({'where':{'id':_0x1361ac[_0x9c29('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3c4db9,null))['then'](function(_0x3c2c0f){if(_0x3c2c0f){return _0x3c2c0f[_0x9c29('0x74')](_0x1361ac[_0x9c29('0x5e')]['ids'],_[_0x9c29('0x75')](_0x1361ac[_0x9c29('0x5e')],[_0x9c29('0x6e'),'id'])||{})['spread'](function(_0x108f36){for(var _0x522b32=0x0;_0x522b32<_0x1361ac[_0x9c29('0x5e')][_0x9c29('0x6e')][_0x9c29('0x6b')];_0x522b32+=0x1){socket[_0x9c29('0x76')](_0x9c29('0x77'),{'UserId':Number(_0x1361ac['body']['ids'][_0x522b32]),'WhatsappAccountId':Number(_0x1361ac['params']['id'])});}return _0x108f36;});}})[_0x9c29('0x39')](respondWithResult(_0x3c4db9,null))[_0x9c29('0x2b')](handleError(_0x3c4db9,null));};exports[_0x9c29('0x78')]=function(_0x2299d1,_0x34670c,_0x224bbb){return db['WhatsappAccount'][_0x9c29('0x5c')]({'where':{'id':_0x2299d1['params']['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x34670c,null))[_0x9c29('0x39')](function(_0x225c87){if(_0x225c87){return _0x225c87[_0x9c29('0x78')](_0x2299d1[_0x9c29('0x47')][_0x9c29('0x6e')])[_0x9c29('0x39')](function(){if(_[_0x9c29('0x79')](_0x2299d1[_0x9c29('0x47')][_0x9c29('0x6e')])){for(var _0x3ab4bb=0x0;_0x3ab4bb<_0x2299d1[_0x9c29('0x47')]['ids'][_0x9c29('0x6b')];_0x3ab4bb+=0x1){socket[_0x9c29('0x76')]('userWhatsappAccount:remove',{'UserId':Number(_0x2299d1['query'][_0x9c29('0x6e')][_0x3ab4bb]),'WhatsappAccountId':Number(_0x2299d1['params']['id'])});}}else{socket[_0x9c29('0x76')](_0x9c29('0x7a'),{'UserId':Number(_0x2299d1['query'][_0x9c29('0x6e')]),'WhatsappAccountId':Number(_0x2299d1[_0x9c29('0x5a')]['id'])});}});}})[_0x9c29('0x39')](respondWithStatusCode(_0x34670c,null))[_0x9c29('0x2b')](handleError(_0x34670c,null));};exports[_0x9c29('0x7b')]=function(_0xded03c,_0x3c7ad5,_0x13b714){var _0x40bc46={};var _0x1befb8={};var _0x4c3f93;var _0xdf7d8c;return db[_0x9c29('0x55')][_0x9c29('0x69')]({'where':{'id':_0xded03c[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x3c7ad5,null))['then'](function(_0x277760){if(_0x277760){_0x4c3f93=_0x277760;_0x1befb8[_0x9c29('0x45')]=_[_0x9c29('0x46')](db[_0x9c29('0x7c')]['rawAttributes']);_0x1befb8[_0x9c29('0x47')]=_[_0x9c29('0x46')](_0xded03c[_0x9c29('0x47')]);_0x1befb8['filters']=_[_0x9c29('0x49')](_0x1befb8['model'],_0x1befb8[_0x9c29('0x47')]);_0x40bc46['attributes']=_['intersection'](_0x1befb8[_0x9c29('0x45')],qs[_0x9c29('0x4a')](_0xded03c[_0x9c29('0x47')]['fields']));_0x40bc46[_0x9c29('0x4b')]=_0x40bc46[_0x9c29('0x4b')]['length']?_0x40bc46['attributes']:_0x1befb8[_0x9c29('0x45')];_0x40bc46['order']=qs[_0x9c29('0x4e')](_0xded03c[_0x9c29('0x47')]['sort']);_0x40bc46[_0x9c29('0x4f')]=qs[_0x9c29('0x48')](_[_0x9c29('0x50')](_0xded03c[_0x9c29('0x47')],_0x1befb8['filters']));if(_0xded03c[_0x9c29('0x47')][_0x9c29('0x6d')]){_0x40bc46[_0x9c29('0x4f')]=_[_0x9c29('0x51')](_0x40bc46[_0x9c29('0x4f')],{'$or':_['map'](_0x40bc46[_0x9c29('0x4b')],function(_0x24b990){var _0x2e9056={};_0x2e9056[_0x24b990]={'$like':'%'+_0xded03c[_0x9c29('0x47')][_0x9c29('0x6d')]+'%'};return _0x2e9056;})});}_0x40bc46=_[_0x9c29('0x51')]({},_0x40bc46,_0xded03c[_0x9c29('0x54')]);return _0x4c3f93[_0x9c29('0x7b')](_0x40bc46);}})[_0x9c29('0x39')](function(_0x2cab2d){if(_0x2cab2d){_0xdf7d8c=_0x2cab2d[_0x9c29('0x6b')];if(!_0xded03c['query']['hasOwnProperty']('nolimit')){_0x40bc46['limit']=qs[_0x9c29('0x32')](_0xded03c[_0x9c29('0x47')][_0x9c29('0x32')]);_0x40bc46[_0x9c29('0x30')]=qs[_0x9c29('0x30')](_0xded03c[_0x9c29('0x47')][_0x9c29('0x30')]);}return _0x4c3f93[_0x9c29('0x7b')](_0x40bc46);}})['then'](function(_0x3f56dd){if(_0x3f56dd){return _0x3f56dd?{'count':_0xdf7d8c,'rows':_0x3f56dd}:null;}})[_0x9c29('0x39')](respondWithResult(_0x3c7ad5,null))[_0x9c29('0x2b')](handleError(_0x3c7ad5,null));};exports[_0x9c29('0x7d')]=function(_0x24f829,_0x3bed75,_0x152ccb){return db['WhatsappAccount'][_0x9c29('0x69')]({'where':{'id':_0x24f829[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x3bed75,null))['then'](function(_0x55cdc3){if(_0x55cdc3){return db[_0x9c29('0x7e')][_0x9c29('0x7f')](function(_0x4cb95d){return db[_0x9c29('0x80')]['destroy']({'where':{'WhatsappAccountId':_0x24f829[_0x9c29('0x5a')]['id']},'transaction':_0x4cb95d})[_0x9c29('0x39')](function(_0x397398){var _0x1da8e8=_['map'](_0x24f829['body'],function(_0x5de656){_0x5de656[_0x9c29('0x6c')]=_0x24f829[_0x9c29('0x5a')]['id'];return _0x5de656;});return db[_0x9c29('0x80')][_0x9c29('0x81')](_0x1da8e8,{'transaction':_0x4cb95d});});})[_0x9c29('0x39')](function(){return db[_0x9c29('0x80')][_0x9c29('0x82')]({'where':{'WhatsappAccountId':_0x24f829[_0x9c29('0x5a')]['id']},'order':_0x9c29('0x83')});});}})['then'](respondWithResult(_0x3bed75,null))[_0x9c29('0x2b')](handleError(_0x3bed75,null));};exports[_0x9c29('0x84')]=function(_0x19fa5f,_0x55ffb9,_0x5793a3){var _0x576672={};var _0x4b7ff6={};var _0x2d89a4;var _0x13c767;return db[_0x9c29('0x55')][_0x9c29('0x69')]({'where':{'id':_0x19fa5f[_0x9c29('0x5a')]['id']}})[_0x9c29('0x39')](handleEntityNotFound(_0x55ffb9,null))[_0x9c29('0x39')](function(_0x79b660){if(_0x79b660){_0x2d89a4=_0x79b660;_0x4b7ff6[_0x9c29('0x45')]=_[_0x9c29('0x46')](db[_0x9c29('0x80')]['rawAttributes']);_0x4b7ff6['query']=_['keys'](_0x19fa5f[_0x9c29('0x47')]);_0x4b7ff6[_0x9c29('0x48')]=_['intersection'](_0x4b7ff6[_0x9c29('0x45')],_0x4b7ff6['query']);_0x576672[_0x9c29('0x4b')]=_['intersection'](_0x4b7ff6[_0x9c29('0x45')],qs['fields'](_0x19fa5f[_0x9c29('0x47')]['fields']));_0x576672[_0x9c29('0x4b')]=_0x576672[_0x9c29('0x4b')][_0x9c29('0x6b')]?_0x576672['attributes']:_0x4b7ff6['model'];_0x576672[_0x9c29('0x72')]=qs[_0x9c29('0x4e')](_0x19fa5f[_0x9c29('0x47')][_0x9c29('0x4e')]);_0x576672['where']=qs[_0x9c29('0x48')](_[_0x9c29('0x50')](_0x19fa5f[_0x9c29('0x47')],_0x4b7ff6[_0x9c29('0x48')]));if(_0x19fa5f[_0x9c29('0x47')][_0x9c29('0x6d')]){_0x576672[_0x9c29('0x4f')]=_[_0x9c29('0x51')](_0x576672[_0x9c29('0x4f')],{'$or':_['map'](_0x576672[_0x9c29('0x4b')],function(_0x35c3c0){var _0xd021af={};_0xd021af[_0x35c3c0]={'$like':'%'+_0x19fa5f[_0x9c29('0x47')][_0x9c29('0x6d')]+'%'};return _0xd021af;})});}_0x576672=_[_0x9c29('0x51')]({},_0x576672,_0x19fa5f[_0x9c29('0x54')]);return _0x2d89a4[_0x9c29('0x84')](_0x576672);}})[_0x9c29('0x39')](function(_0x6bfeeb){if(_0x6bfeeb){_0x13c767=_0x6bfeeb[_0x9c29('0x6b')];if(!_0x19fa5f[_0x9c29('0x47')][_0x9c29('0x4c')](_0x9c29('0x4d'))){_0x576672[_0x9c29('0x32')]=qs['limit'](_0x19fa5f['query'][_0x9c29('0x32')]);_0x576672[_0x9c29('0x30')]=qs[_0x9c29('0x30')](_0x19fa5f['query'][_0x9c29('0x30')]);}return _0x2d89a4['getApplications'](_0x576672);}})['then'](function(_0x8b1d60){if(_0x8b1d60){return _0x8b1d60?{'count':_0x13c767,'rows':_0x8b1d60}:null;}})['then'](respondWithResult(_0x55ffb9,null))[_0x9c29('0x2b')](handleError(_0x55ffb9,null));};exports[_0x9c29('0x85')]=function(_0x2f61c8,_0x39bff3,_0x268c03){var _0x3626e7={'channel':_0x9c29('0x86')};var _0x510e81=[];var _0x1397c4=[];var _0x4534d={};return db['WhatsappAccount'][_0x9c29('0x5c')]({'where':{'id':_0x2f61c8[_0x9c29('0x5a')]['id']},'include':[{'model':db[_0x9c29('0x80')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x39bff3,null))[_0x9c29('0x39')](function(_0x1702e5){_0x3626e7['account']=_0x1702e5;if(_0x3626e7['account']&&_0x3626e7[_0x9c29('0x87')]['type']===_0x9c29('0x88')&&_0x2f61c8[_0x9c29('0x5e')][_0x9c29('0x89')]){if(_0x2f61c8['body'][_0x9c29('0x89')][_0x9c29('0x6b')]===0x0)return;if(_0x2f61c8[_0x9c29('0x5e')][_0x9c29('0x89')][0x0][_0x9c29('0x8a')]!==_0x9c29('0x8b'))return;return db['WhatsappMessage']['update']({'read':!![],'readAt':_0x2f61c8[_0x9c29('0x5e')][_0x9c29('0x89')][0x0][_0x9c29('0x8c')]},{'where':{'messageId':_0x2f61c8[_0x9c29('0x5e')][_0x9c29('0x89')][0x0][_0x9c29('0x8d')]},'individualHooks':!![]})[_0x9c29('0x39')](function(_0x5ae6c2){return _0x39bff3[_0x9c29('0x2d')](0xc8)[_0x9c29('0x2f')](_0x5ae6c2);});}_0x3626e7[_0x9c29('0x8e')]=_['orderBy'](_0x1702e5[_0x9c29('0x8f')],['priority'],[_0x9c29('0x90')]);if(_0x3626e7['account'][_0x9c29('0x8f')]){delete _0x3626e7['account'][_0x9c29('0x8f')];}return db[_0x9c29('0x91')][_0x9c29('0x66')]()[_0x9c29('0x39')](function(_0x38133a){if(!_0x38133a){throw new db[(_0x9c29('0x92'))]['ValidationError'](_0x9c29('0x93'));}_0x510e81=_[_0x9c29('0x94')](_['keys'](_0x38133a),[_0x9c29('0x95'),_0x9c29('0x96')]);_0x1397c4=_[_0x9c29('0x94')](_[_0x9c29('0x46')](_0x38133a),[_0x9c29('0x95'),_0x9c29('0x96'),_0x9c29('0x97'),_0x9c29('0x98')]);_0x3626e7[_0x9c29('0x5e')]={'mapKey':_0x9c29('0x99')};if(_0x3626e7[_0x9c29('0x87')]&&_0x3626e7[_0x9c29('0x87')][_0x9c29('0x52')]===_0x9c29('0x9a')){_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9b')]=_0x2f61c8[_0x9c29('0x5e')][_0x9c29('0x9c')]['replace'](_0x9c29('0x9d'),'');_0x3626e7[_0x9c29('0x5e')]['body']=_0x2f61c8[_0x9c29('0x5e')]['Body'];_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9e')]=_0x2f61c8[_0x9c29('0x5e')]['MessageSid'];}if(_0x3626e7['account']&&_0x3626e7[_0x9c29('0x87')][_0x9c29('0x52')]===_0x9c29('0x88')){_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9b')]=_0x2f61c8[_0x9c29('0x5e')][_0x9c29('0x9f')][0x0][_0x9c29('0x9b')];_0x3626e7['body']['body']=_0x2f61c8[_0x9c29('0x5e')]['notifications'][0x0][_0x9c29('0x29')][_0x9c29('0x5e')];_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9e')]=_0x2f61c8['body'][_0x9c29('0x9f')][0x0][_0x9c29('0x8d')];}if(_0x3626e7[_0x9c29('0x5e')]['id']){delete _0x3626e7['body']['id'];}if(_[_0x9c29('0xa0')](_0x3626e7[_0x9c29('0x5e')]['from'])){throw new db[(_0x9c29('0x92'))][(_0x9c29('0xa1'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x5e')])||_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x5e')]===''){throw new db[(_0x9c29('0x92'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9c29('0xa0')](_0x3626e7[_0x9c29('0x5e')][_0x9c29('0xa2')])){throw new db[(_0x9c29('0x92'))][(_0x9c29('0xa1'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1397c4);}if(!_[_0x9c29('0xa3')](_0x1397c4,_0x3626e7['body'][_0x9c29('0xa2')])){throw new db['Sequelize']['ValidationError'](_0x9c29('0xa4')+_0x1397c4);}_0x4534d[_0x3626e7[_0x9c29('0x5e')][_0x9c29('0xa2')]]=_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9b')];return db['CmList']['find']({'where':{'id':_0x3626e7[_0x9c29('0x87')][_0x9c29('0x98')]},'include':[{'model':db[_0x9c29('0x91')],'as':'Contacts','where':_0x4534d,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x9c29('0x39')](handleEntityNotFound(_0x39bff3,null))[_0x9c29('0x39')](function(_0x365567){if(_0x365567){_0x3626e7['list']=_[_0x9c29('0x75')](_0x365567,[_0x9c29('0xa5')]);if(_0x365567[_0x9c29('0xa5')][_0x9c29('0x6b')]){return _0x365567[_0x9c29('0xa5')][0x0];}var _0x2ef7b2=_[_0x9c29('0x1a')](_0x3626e7[_0x9c29('0x5e')],{'firstName':_0x3626e7['body'][_0x9c29('0x9b')],'ListId':_0x365567['id']});_0x2ef7b2[_0x3626e7[_0x9c29('0x5e')][_0x9c29('0xa2')]]=_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9b')];return db[_0x9c29('0x91')][_0x9c29('0x5d')](_0x2ef7b2,{'fields':_0x510e81,'raw':!![]});}})[_0x9c29('0x39')](handleEntityNotFound(_0x39bff3,null))[_0x9c29('0x39')](function(_0x18a09b){if(_0x18a09b){_0x3626e7[_0x9c29('0xa6')]=_0x18a09b;var _0x417e56={'ContactId':_0x18a09b['id'],'phone':_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9b')],'WhatsappAccountId':_0x2f61c8[_0x9c29('0x5a')]['id']};var _0x411a20={'ContactId':_0x18a09b['id'],'WhatsappAccountId':_0x2f61c8[_0x9c29('0x5a')]['id'],'closed':![]};return db['WhatsappInteraction'][_0x9c29('0x5c')]({'where':_0x411a20})[_0x9c29('0x39')](function(_0x45c125){if(_0x45c125){return[_0x45c125,![]];}return db[_0x9c29('0xa7')][_0x9c29('0x5d')](_0x417e56)[_0x9c29('0x39')](function(_0x1167d9){return[_0x1167d9,!![]];});});}})[_0x9c29('0xa8')](function(_0x1dda62,_0x32c733){_0x3626e7['interaction']=_0x1dda62[_0x9c29('0x3b')]({'plain':!![]});_0x3626e7[_0x9c29('0xa9')][_0x9c29('0xaa')]=![];if(_0x32c733){if(_0x3626e7[_0x9c29('0x87')][_0x9c29('0xab')]){_0x3626e7[_0x9c29('0x8e')][_0x9c29('0xac')]({'id':0x0,'priority':_0x3626e7[_0x9c29('0x8e')][_0x9c29('0x6b')]+0x1,'app':_0x9c29('0xad'),'appdata':_0x9c29('0xae'),'interval':'*,*,*,*'});}_0x3626e7[_0x9c29('0xa9')][_0x9c29('0xaa')]=!![];}return db[_0x9c29('0xaf')][_0x9c29('0x5d')]({'phone':_0x3626e7[_0x9c29('0x5e')]['from'],'messageId':_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x9e')],'body':_0x3626e7[_0x9c29('0x5e')][_0x9c29('0x5e')],'WhatsappAccountId':_0x2f61c8[_0x9c29('0x5a')]['id'],'WhatsappInteractionId':_0x1dda62['id'],'direction':'in','ContactId':_0x1dda62[_0x9c29('0xb0')],'AttachmentId':_0x3626e7[_0x9c29('0x5e')][_0x9c29('0xb1')]});})[_0x9c29('0x39')](function(_0x42acf4){_0x3626e7[_0x9c29('0x29')]=_0x42acf4;if(_0x3626e7['interaction'][_0x9c29('0xb2')]){return db[_0x9c29('0x7c')][_0x9c29('0x5c')]({'attributes':['id','name'],'where':{'id':_0x3626e7[_0x9c29('0xa9')][_0x9c29('0xb2')]}})['then'](function(_0xcee879){if(_0xcee879){_0x3626e7[_0x9c29('0x8e')][_0x9c29('0xb3')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xcee879[_0x9c29('0x3f')]+','+(_0x3626e7[_0x9c29('0x87')][_0x9c29('0xb4')]||0xa),'interval':_0x9c29('0xb5')});}return respondWithRpcPromise(_0x9c29('0xb6'),_0x9c29('0xb7'),_0x3626e7);});}return respondWithRpcPromise(_0x9c29('0xb6'),_0x9c29('0xb7'),_0x3626e7);})[_0x9c29('0x39')](function(_0x29a430){if(_0x29a430){var _0x4577d2=0xc8;var _0x2109d8='receiveMessage';logger[_0x9c29('0x21')](_0x9c29('0x25'),_0x2109d8,_0x4577d2,_0x9c29('0xb8'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2109d8,_0x4577d2,_0x9c29('0xb8'),JSON['stringify'](_0x29a430));if(_0x3626e7['account'][_0x9c29('0x52')]==='twilio'){return _0x39bff3[_0x9c29('0x2d')](_0x4577d2)[_0x9c29('0x34')]('Content-Type',_0x9c29('0xb9'))[_0x9c29('0xba')](_0x9c29('0xbb'));}else{return _0x39bff3[_0x9c29('0x2d')](_0x4577d2)[_0x9c29('0x2f')](_0x29a430);}}});})[_0x9c29('0x2b')](handleError(_0x39bff3,null));};exports[_0x9c29('0xba')]=function(_0x5ede59,_0x5f29ba,_0xe8e559){var _0x501a8b,_0x38cd1d,_0x585dba;if(_['isNil'](_0x5ede59[_0x9c29('0x5e')][_0x9c29('0x5e')])||_0x5ede59['body'][_0x9c29('0x5e')]===''){throw new db[(_0x9c29('0x92'))][(_0x9c29('0xa1'))](_0x9c29('0xbc'));}if(_['isNil'](_0x5ede59[_0x9c29('0x5e')]['to'])){throw new db[(_0x9c29('0x92'))][(_0x9c29('0xa1'))](_0x9c29('0xbd'));}_0x501a8b=_0x5ede59[_0x9c29('0x5e')]['to'];return db[_0x9c29('0x55')][_0x9c29('0x5c')]({'where':{'id':_0x5ede59[_0x9c29('0x5a')]['id']},'include':[{'model':db[_0x9c29('0xbe')],'as':_0x9c29('0xbf'),'include':[{'model':db[_0x9c29('0x91')],'as':_0x9c29('0xa5'),'where':{'mobile':_0x501a8b},'limit':0x1,'order':[[_0x9c29('0x96'),_0x9c29('0xc0')]]}]}]})[_0x9c29('0x39')](handleEntityNotFound(_0x5f29ba,null))[_0x9c29('0x39')](function(_0x4c2087){if(_0x4c2087&&_0x4c2087[_0x9c29('0xbf')]){_0x38cd1d=_0x4c2087[_0x9c29('0x3b')]({'plain':!![]});if(_0x38cd1d[_0x9c29('0xbf')]&&_0x38cd1d['List'][_0x9c29('0xa5')][_0x9c29('0x6b')]){return _0x38cd1d[_0x9c29('0xbf')][_0x9c29('0xa5')][0x0];}return db['CmContact']['create'](_[_0x9c29('0x1a')](_0x5ede59['body'],{'firstName':_0x501a8b,'mobile':_0x501a8b,'phone':_0x501a8b,'ListId':_0x38cd1d[_0x9c29('0x98')]}));}})[_0x9c29('0x39')](handleEntityNotFound(_0x5f29ba,null))['then'](function(_0x552c6c){if(_0x552c6c){_0x585dba=_0x552c6c;return db['WhatsappInteraction'][_0x9c29('0x5c')]({'where':{'ContactId':_0x585dba['id'],'closed':![],'WhatsappAccountId':_0x38cd1d['id']}})[_0x9c29('0x39')](function(_0x3f2e96){if(_0x3f2e96){return[_0x3f2e96,![]];}return db[_0x9c29('0xa7')][_0x9c29('0x5d')]({'UserId':_0x5ede59[_0x9c29('0x61')]['id'],'ContactId':_0x585dba['id'],'WhatsappAccountId':_0x38cd1d['id'],'phone':_0x501a8b,'firstMsgDirection':_0x9c29('0xc1'),'Messages':[_['merge'](_0x5ede59[_0x9c29('0x5e')],{'read':![],'body':_0x5ede59['body'][_0x9c29('0x5e')],'phone':_0x501a8b,'WhatsappAccountId':_0x38cd1d['id'],'UserId':_0x5ede59[_0x9c29('0x61')]['id'],'ContactId':_0x585dba['id']})]},{'include':[{'model':db['WhatsappMessage'],'as':_0x9c29('0xc2')}]})['then'](function(_0x2bba43){return[_0x2bba43,!![]];});});}})['spread'](function(_0x245447,_0x5cf28c){if(_0x5cf28c){return _0x245447;}return db[_0x9c29('0xaf')][_0x9c29('0x5d')](_['merge'](_0x5ede59[_0x9c29('0x5e')],{'read':![],'body':_0x5ede59['body'][_0x9c29('0x5e')],'phone':_0x501a8b,'WhatsappAccountId':_0x38cd1d['id'],'WhatsappInteractionId':_0x245447['id'],'UserId':_0x5ede59[_0x9c29('0x61')]['id'],'ContactId':_0x585dba['id']}))[_0x9c29('0x39')](function(_0x26bff2){_0x245447[_0x9c29('0xc3')][_0x9c29('0xc2')]=[];_0x245447['dataValues'][_0x9c29('0xc2')][_0x9c29('0xac')](_0x26bff2[_0x9c29('0xc3')]);return _0x245447;});})[_0x9c29('0x39')](respondWithResult(_0x5f29ba,null))[_0x9c29('0x2b')](handleError(_0x5f29ba,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index c296792..f0056df 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 _0x80b9=['../../mysqldb','WhatsappAccount','save','update','remove','emit','hook','exports'];(function(_0x48b962,_0x5060b5){var _0x1b7a6e=function(_0x138c56){while(--_0x138c56){_0x48b962['push'](_0x48b962['shift']());}};_0x1b7a6e(++_0x5060b5);}(_0x80b9,0x1a8));var _0x980b=function(_0x41e2e5,_0xd2ec31){_0x41e2e5=_0x41e2e5-0x0;var _0x11d2c9=_0x80b9[_0x41e2e5];return _0x11d2c9;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x980b('0x0'))['db'][_0x980b('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x980b('0x2'),'afterUpdate':_0x980b('0x3'),'afterDestroy':_0x980b('0x4')};function emitEvent(_0x2e890a){return function(_0xa5e60d,_0x3f3ff3,_0x598dc5){WhatsappAccountEvents[_0x980b('0x5')](_0x2e890a+':'+_0xa5e60d['id'],_0xa5e60d);WhatsappAccountEvents[_0x980b('0x5')](_0x2e890a,_0xa5e60d);_0x598dc5(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x980b('0x6')](e,emitEvent(event));}}module[_0x980b('0x7')]=WhatsappAccountEvents; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 7fca5d5..b63aa3c 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 _0x5ffe=['util','../../config/logger','api','request-promise','rimraf','exports','define','WhatsappAccount','whatsapp_accounts','lodash'];(function(_0x6a7c9b,_0x4b473d){var _0x191b33=function(_0x2be179){while(--_0x2be179){_0x6a7c9b['push'](_0x6a7c9b['shift']());}};_0x191b33(++_0x4b473d);}(_0x5ffe,0x117));var _0xe5ff=function(_0x32b33b,_0x22d81a){_0x32b33b=_0x32b33b-0x0;var _0x31eb5a=_0x5ffe[_0x32b33b];return _0x31eb5a;};'use strict';var _=require(_0xe5ff('0x0'));var util=require(_0xe5ff('0x1'));var logger=require(_0xe5ff('0x2'))(_0xe5ff('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe5ff('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe5ff('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0xe5ff('0x6')]=function(_0x18f653,_0x4b3c12){return _0x18f653[_0xe5ff('0x7')](_0xe5ff('0x8'),attributes,{'tableName':_0xe5ff('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index d107361..7b3f6d2 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 _0xaf85=['raw','include','map','model','attributes','debug','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','redis','./whatsappAccount.socket','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options'];(function(_0x471619,_0x2c4825){var _0x413d79=function(_0x783959){while(--_0x783959){_0x471619['push'](_0x471619['shift']());}};_0x413d79(++_0x2c4825);}(_0xaf85,0xb0));var _0x5af8=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0xaf85[_0x46a671];return _0x526d75;};'use strict';var _=require(_0x5af8('0x0'));var util=require(_0x5af8('0x1'));var moment=require(_0x5af8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5af8('0x3'))['db'];var utils=require(_0x5af8('0x4'));var logger=require(_0x5af8('0x5'))(_0x5af8('0x6'));var config=require(_0x5af8('0x7'));var jayson=require(_0x5af8('0x8'));var client=jayson[_0x5af8('0x9')][_0x5af8('0xa')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x5af8('0xb'),'port':0x18eb});var socket=require(_0x5af8('0xc'))(new Redis(config[_0x5af8('0xd')]));require(_0x5af8('0xe'))['register'](socket);function respondWithRpcPromise(_0x3369bd,_0x3aed61,_0xf473b4){return new BPromise(function(_0x596613,_0x313dfc){return client['request'](_0x3369bd,_0xf473b4)[_0x5af8('0xf')](function(_0xfc1852){logger[_0x5af8('0x10')](_0x5af8('0x11'),_0x3aed61,_0x5af8('0x12'));logger['debug']('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x3aed61,_0x5af8('0x12'),JSON['stringify'](_0xfc1852));if(_0xfc1852[_0x5af8('0x13')]){if(_0xfc1852[_0x5af8('0x13')][_0x5af8('0x14')]===0x1f4){logger[_0x5af8('0x13')](_0x5af8('0x11'),_0x3aed61,_0xfc1852['error'][_0x5af8('0x15')]);return _0x313dfc(_0xfc1852[_0x5af8('0x13')]['message']);}logger[_0x5af8('0x13')](_0x5af8('0x11'),_0x3aed61,_0xfc1852[_0x5af8('0x13')][_0x5af8('0x15')]);return _0x596613(_0xfc1852['error'][_0x5af8('0x15')]);}else{logger[_0x5af8('0x10')](_0x5af8('0x11'),_0x3aed61,_0x5af8('0x12'));_0x596613(_0xfc1852[_0x5af8('0x16')][_0x5af8('0x15')]);}})[_0x5af8('0x17')](function(_0x34a3c9){logger[_0x5af8('0x13')](_0x5af8('0x11'),_0x3aed61,_0x34a3c9);_0x313dfc(_0x34a3c9);});});}exports[_0x5af8('0x18')]=function(_0x28d32d){var _0x372ac8=this;return new Promise(function(_0x5cbc74,_0x1e3d1a){return db[_0x5af8('0x19')][_0x5af8('0x1a')]({'raw':_0x28d32d['options']?_0x28d32d[_0x5af8('0x1b')][_0x5af8('0x1c')]===undefined?!![]:![]:!![],'where':_0x28d32d['options']?_0x28d32d['options']['where']||null:null,'attributes':_0x28d32d[_0x5af8('0x1b')]?_0x28d32d[_0x5af8('0x1b')]['attributes']||null:null,'include':_0x28d32d[_0x5af8('0x1b')]?_0x28d32d[_0x5af8('0x1b')][_0x5af8('0x1d')]?_[_0x5af8('0x1e')](_0x28d32d['options'][_0x5af8('0x1d')],function(_0x175e48){return{'model':db[_0x175e48[_0x5af8('0x1f')]],'as':_0x175e48['as'],'attributes':_0x175e48[_0x5af8('0x20')],'include':_0x175e48[_0x5af8('0x1d')]?_[_0x5af8('0x1e')](_0x175e48['include'],function(_0x30815f){return{'model':db[_0x30815f[_0x5af8('0x1f')]],'as':_0x30815f['as'],'attributes':_0x30815f[_0x5af8('0x20')],'include':_0x30815f[_0x5af8('0x1d')]?_[_0x5af8('0x1e')](_0x30815f[_0x5af8('0x1d')],function(_0x373737){return{'model':db[_0x373737[_0x5af8('0x1f')]],'as':_0x373737['as'],'attributes':_0x373737[_0x5af8('0x20')]};}):[]};}):[]};}):[]:[]})[_0x5af8('0xf')](function(_0x304788){logger[_0x5af8('0x10')](_0x5af8('0x18'),_0x28d32d);logger[_0x5af8('0x21')](_0x5af8('0x18'),_0x28d32d,JSON['stringify'](_0x304788));_0x5cbc74(_0x304788);})[_0x5af8('0x17')](function(_0x310ba2){logger['error'](_0x5af8('0x18'),_0x310ba2[_0x5af8('0x15')],_0x28d32d);_0x1e3d1a(_0x372ac8[_0x5af8('0x13')](0x1f4,_0x310ba2[_0x5af8('0x15')]));});});}; \ No newline at end of file +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 diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index f761bba..4fb0f04 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 _0x46da=['remove','update','emit','register','length','whatsappAccount:','./whatsappAccount.events'];(function(_0x5df88f,_0x40d8fd){var _0x5deebd=function(_0xd4d55a){while(--_0xd4d55a){_0x5df88f['push'](_0x5df88f['shift']());}};_0x5deebd(++_0x40d8fd);}(_0x46da,0x84));var _0xa46d=function(_0x5595f9,_0x4abf7e){_0x5595f9=_0x5595f9-0x0;var _0x4a123e=_0x46da[_0x5595f9];return _0x4a123e;};'use strict';var WhatsappAccountEvents=require(_0xa46d('0x0'));var events=['save',_0xa46d('0x1'),_0xa46d('0x2')];function createListener(_0x487991,_0x42e11b){return function(_0x37ff31){_0x42e11b[_0xa46d('0x3')](_0x487991,_0x37ff31);};}function removeListener(_0x48a05b,_0x5f3204){return function(){WhatsappAccountEvents['removeListener'](_0x48a05b,_0x5f3204);};}exports[_0xa46d('0x4')]=function(_0x169609){for(var _0x3fab67=0x0,_0x116afd=events[_0xa46d('0x5')];_0x3fab67<_0x116afd;_0x3fab67++){var _0x2f7c39=events[_0x3fab67];var _0x19bfab=createListener(_0xa46d('0x6')+_0x2f7c39,_0x169609);WhatsappAccountEvents['on'](_0x2f7c39,_0x19bfab);}}; \ No newline at end of file +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 diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index b716be7..2ba1870 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 _0x02b3=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./whatsappApplication.controller','isAuthenticated','get','/:id','post','create','put'];(function(_0x5bd953,_0x307788){var _0x4ac021=function(_0x31a3ba){while(--_0x31a3ba){_0x5bd953['push'](_0x5bd953['shift']());}};_0x4ac021(++_0x307788);}(_0x02b3,0x110));var _0x302b=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0x02b3[_0x872b02];return _0x1a6b24;};'use strict';var multer=require(_0x302b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x302b('0x1'));var express=require(_0x302b('0x2'));var router=express[_0x302b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x302b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x302b('0x5'));var controller=require(_0x302b('0x6'));router['get']('/',auth[_0x302b('0x7')](),controller['index']);router[_0x302b('0x8')](_0x302b('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x302b('0xa')]('/',auth[_0x302b('0x7')](),controller[_0x302b('0xb')]);router[_0x302b('0xc')]('/:id',auth[_0x302b('0x7')](),controller['update']);router['delete'](_0x302b('0x9'),auth['isAuthenticated'](),controller[_0x302b('0xd')]);module[_0x302b('0xe')]=router; \ No newline at end of file +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 diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index e3e9c60..b1335c7 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 _0xd662=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x2c3c3d,_0x3a25d2){var _0x341677=function(_0x1aeda9){while(--_0x1aeda9){_0x2c3c3d['push'](_0x2c3c3d['shift']());}};_0x341677(++_0x3a25d2);}(_0xd662,0x75));var _0x2d66=function(_0x18f7ff,_0xcfc554){_0x18f7ff=_0x18f7ff-0x0;var _0x3343dc=_0xd662[_0x18f7ff];return _0x3343dc;};'use strict';var Sequelize=require(_0x2d66('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x2d66('0x1')],'allowNull':![],'defaultValue':_0x2d66('0x2')},'appdata':{'type':Sequelize[_0x2d66('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2d66('0x1')],'defaultValue':_0x2d66('0x4')}}; \ No newline at end of file +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 diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index e718094..02b5e16 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 _0xf08c=['name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','keys','intersection','fields','attributes','length','query','hasOwnProperty','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','merge','find','catch','create','body','params','destroy','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','undefined','count','offset','limit','set','Content-Range','reject','update','then','status','error','stack'];(function(_0x722f6,_0x36d2cb){var _0x55711d=function(_0x3c229b){while(--_0x3c229b){_0x722f6['push'](_0x722f6['shift']());}};_0x55711d(++_0x36d2cb);}(_0xf08c,0xb5));var _0xcf08=function(_0x20fbf7,_0xdb4575){_0x20fbf7=_0x20fbf7-0x0;var _0x16076d=_0xf08c[_0x20fbf7];return _0x16076d;};'use strict';var emlformat=require(_0xcf08('0x0'));var rimraf=require(_0xcf08('0x1'));var zipdir=require(_0xcf08('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf08('0x3'));var moment=require(_0xcf08('0x4'));var BPromise=require(_0xcf08('0x5'));var Mustache=require(_0xcf08('0x6'));var util=require('util');var path=require('path');var sox=require(_0xcf08('0x7'));var csv=require(_0xcf08('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcf08('0x9'));var _=require(_0xcf08('0xa'));var squel=require(_0xcf08('0xb'));var crypto=require(_0xcf08('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcf08('0x8'));var querystring=require('querystring');var Papa=require(_0xcf08('0xd'));var Redis=require(_0xcf08('0xe'));var authService=require(_0xcf08('0xf'));var qs=require(_0xcf08('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcf08('0x11'));var logger=require(_0xcf08('0x12'))(_0xcf08('0x13'));var utils=require(_0xcf08('0x14'));var config=require(_0xcf08('0x15'));var licenseUtil=require(_0xcf08('0x16'));var db=require(_0xcf08('0x17'))['db'];function respondWithStatusCode(_0x2a7fe0,_0x3d10c7){_0x3d10c7=_0x3d10c7||0xcc;return function(_0x43c27a){if(_0x43c27a){return _0x2a7fe0[_0xcf08('0x18')](_0x3d10c7);}return _0x2a7fe0['status'](_0x3d10c7)['end']();};}function respondWithResult(_0x56797c,_0x3400b4){_0x3400b4=_0x3400b4||0xc8;return function(_0x1d727f){if(_0x1d727f){return _0x56797c['status'](_0x3400b4)[_0xcf08('0x19')](_0x1d727f);}};}function respondWithFilteredResult(_0x3fe9c5,_0x8c9d32){return function(_0x2b0135){if(_0x2b0135){var _0xf97f6e=typeof _0x8c9d32['offset']===_0xcf08('0x1a')&&typeof _0x8c9d32['limit']==='undefined';var _0x4072c7=_0x2b0135[_0xcf08('0x1b')];var _0x4c4970=_0xf97f6e?0x0:_0x8c9d32[_0xcf08('0x1c')];var _0x47060d=_0xf97f6e?_0x2b0135[_0xcf08('0x1b')]:_0x8c9d32[_0xcf08('0x1c')]+_0x8c9d32[_0xcf08('0x1d')];var _0x3b9a4b;if(_0x47060d>=_0x4072c7){_0x47060d=_0x4072c7;_0x3b9a4b=0xc8;}else{_0x3b9a4b=0xce;}_0x3fe9c5['status'](_0x3b9a4b);return _0x3fe9c5[_0xcf08('0x1e')](_0xcf08('0x1f'),_0x4c4970+'-'+_0x47060d+'/'+_0x4072c7)[_0xcf08('0x19')](_0x2b0135);}return null;};}function patchUpdates(_0x56f2cb){return function(_0x3a2ef6){try{jsonpatch['apply'](_0x3a2ef6,_0x56f2cb,!![]);}catch(_0x633937){return BPromise[_0xcf08('0x20')](_0x633937);}return _0x3a2ef6['save']();};}function saveUpdates(_0x1ee0b4,_0x279847){return function(_0x209d5d){if(_0x209d5d){return _0x209d5d[_0xcf08('0x21')](_0x1ee0b4)['then'](function(_0x31aceb){return _0x31aceb;});}return null;};}function removeEntity(_0x208f1d,_0x52968a){return function(_0x39ba73){if(_0x39ba73){return _0x39ba73['destroy']()[_0xcf08('0x22')](function(){_0x208f1d[_0xcf08('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a4b96,_0x32d41d){return function(_0x27f0bc){if(!_0x27f0bc){_0x2a4b96[_0xcf08('0x18')](0x194);}return _0x27f0bc;};}function handleError(_0x3faf5a,_0x245ce7){_0x245ce7=_0x245ce7||0x1f4;return function(_0x4137ae){logger[_0xcf08('0x24')](_0x4137ae[_0xcf08('0x25')]);if(_0x4137ae[_0xcf08('0x26')]){delete _0x4137ae['name'];}_0x3faf5a['status'](_0x245ce7)[_0xcf08('0x27')](_0x4137ae);};}exports[_0xcf08('0x28')]=function(_0x4a98d7,_0x684f45){var _0x2ceb1f={},_0x347835={},_0x157752={'count':0x0,'rows':[]};var _0xcd6a74=_[_0xcf08('0x29')](db[_0xcf08('0x2a')][_0xcf08('0x2b')],function(_0xf482f8){return{'name':_0xf482f8[_0xcf08('0x2c')],'type':_0xf482f8[_0xcf08('0x2d')][_0xcf08('0x2e')]};});_0x347835[_0xcf08('0x2f')]=_[_0xcf08('0x29')](_0xcd6a74,_0xcf08('0x26'));_0x347835['query']=_[_0xcf08('0x30')](_0x4a98d7['query']);_0x347835['filters']=_[_0xcf08('0x31')](_0x347835['model'],_0x347835['query']);_0x2ceb1f['attributes']=_[_0xcf08('0x31')](_0x347835[_0xcf08('0x2f')],qs[_0xcf08('0x32')](_0x4a98d7['query']['fields']));_0x2ceb1f[_0xcf08('0x33')]=_0x2ceb1f[_0xcf08('0x33')][_0xcf08('0x34')]?_0x2ceb1f[_0xcf08('0x33')]:_0x347835[_0xcf08('0x2f')];if(!_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x36')]('nolimit')){_0x2ceb1f[_0xcf08('0x1d')]=qs['limit'](_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x1d')]);_0x2ceb1f['offset']=qs[_0xcf08('0x1c')](_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x1c')]);}_0x2ceb1f['order']=qs['sort'](_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x37')]);_0x2ceb1f[_0xcf08('0x38')]=qs[_0xcf08('0x39')](_[_0xcf08('0x3a')](_0x4a98d7[_0xcf08('0x35')],_0x347835[_0xcf08('0x39')]),_0xcd6a74);if(_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x3b')]){_0x2ceb1f[_0xcf08('0x38')]=_['merge'](_0x2ceb1f['where'],{'$or':_[_0xcf08('0x29')](_0xcd6a74,function(_0x1d7aeb){if(_0x1d7aeb[_0xcf08('0x2d')]!==_0xcf08('0x3c')){var _0x4261e1={};_0x4261e1[_0x1d7aeb[_0xcf08('0x26')]]={'$like':'%'+_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x3b')]+'%'};return _0x4261e1;}})});}_0x2ceb1f=_['merge']({},_0x2ceb1f,_0x4a98d7[_0xcf08('0x3d')]);var _0x3d8ee7={'where':_0x2ceb1f['where']};return db[_0xcf08('0x2a')]['count'](_0x3d8ee7)[_0xcf08('0x22')](function(_0x3a474a){_0x157752[_0xcf08('0x1b')]=_0x3a474a;if(_0x4a98d7[_0xcf08('0x35')][_0xcf08('0x3e')]){_0x2ceb1f[_0xcf08('0x3f')]=[{'all':!![]}];}return db[_0xcf08('0x2a')][_0xcf08('0x40')](_0x2ceb1f);})['then'](function(_0x2f7495){_0x157752[_0xcf08('0x41')]=_0x2f7495;return _0x157752;})[_0xcf08('0x22')](respondWithFilteredResult(_0x684f45,_0x2ceb1f))['catch'](handleError(_0x684f45,null));};exports['show']=function(_0x3904cf,_0x470a70){var _0x9d8f32={'raw':!![],'where':{'id':_0x3904cf['params']['id']}},_0x907b7e={};_0x907b7e[_0xcf08('0x2f')]=_['keys'](db[_0xcf08('0x2a')][_0xcf08('0x2b')]);_0x907b7e[_0xcf08('0x35')]=_['keys'](_0x3904cf[_0xcf08('0x35')]);_0x907b7e[_0xcf08('0x39')]=_[_0xcf08('0x31')](_0x907b7e[_0xcf08('0x2f')],_0x907b7e[_0xcf08('0x35')]);_0x9d8f32[_0xcf08('0x33')]=_[_0xcf08('0x31')](_0x907b7e[_0xcf08('0x2f')],qs[_0xcf08('0x32')](_0x3904cf['query'][_0xcf08('0x32')]));_0x9d8f32[_0xcf08('0x33')]=_0x9d8f32[_0xcf08('0x33')][_0xcf08('0x34')]?_0x9d8f32[_0xcf08('0x33')]:_0x907b7e['model'];if(_0x3904cf[_0xcf08('0x35')][_0xcf08('0x3e')]){_0x9d8f32[_0xcf08('0x3f')]=[{'all':!![]}];}_0x9d8f32=_[_0xcf08('0x42')]({},_0x9d8f32,_0x3904cf[_0xcf08('0x3d')]);return db[_0xcf08('0x2a')][_0xcf08('0x43')](_0x9d8f32)[_0xcf08('0x22')](handleEntityNotFound(_0x470a70,null))[_0xcf08('0x22')](respondWithResult(_0x470a70,null))[_0xcf08('0x44')](handleError(_0x470a70,null));};exports[_0xcf08('0x45')]=function(_0x4241e5,_0x439f60){return db[_0xcf08('0x2a')][_0xcf08('0x45')](_0x4241e5[_0xcf08('0x46')],{})[_0xcf08('0x22')](respondWithResult(_0x439f60,0xc9))[_0xcf08('0x44')](handleError(_0x439f60,null));};exports[_0xcf08('0x21')]=function(_0x52d03d,_0x559c3b){if(_0x52d03d[_0xcf08('0x46')]['id']){delete _0x52d03d[_0xcf08('0x46')]['id'];}return db[_0xcf08('0x2a')][_0xcf08('0x43')]({'where':{'id':_0x52d03d[_0xcf08('0x47')]['id']}})[_0xcf08('0x22')](handleEntityNotFound(_0x559c3b,null))['then'](saveUpdates(_0x52d03d[_0xcf08('0x46')],null))[_0xcf08('0x22')](respondWithResult(_0x559c3b,null))[_0xcf08('0x44')](handleError(_0x559c3b,null));};exports[_0xcf08('0x48')]=function(_0x3da861,_0x139174){return db['WhatsappApplication'][_0xcf08('0x43')]({'where':{'id':_0x3da861[_0xcf08('0x47')]['id']}})[_0xcf08('0x22')](handleEntityNotFound(_0x139174,null))['then'](removeEntity(_0x139174,null))[_0xcf08('0x44')](handleError(_0x139174,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 83138c2..ddd8624 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 _0x28e3=['bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0xb938ff,_0x40a3c4){var _0x456bc0=function(_0x1c295c){while(--_0x1c295c){_0xb938ff['push'](_0xb938ff['shift']());}};_0x456bc0(++_0x40a3c4);}(_0x28e3,0x106));var _0x328e=function(_0x202c61,_0x3673e0){_0x202c61=_0x202c61-0x0;var _0x540691=_0x28e3[_0x202c61];return _0x540691;};'use strict';var _=require(_0x328e('0x0'));var util=require(_0x328e('0x1'));var logger=require(_0x328e('0x2'))(_0x328e('0x3'));var moment=require('moment');var BPromise=require(_0x328e('0x4'));var rp=require(_0x328e('0x5'));var fs=require('fs');var path=require(_0x328e('0x6'));var rimraf=require(_0x328e('0x7'));var config=require(_0x328e('0x8'));var attributes=require(_0x328e('0x9'));module[_0x328e('0xa')]=function(_0x439182,_0x5e5bcf){return _0x439182['define']('WhatsappApplication',attributes,{'tableName':_0x328e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x328e('0xc'),'collate':_0x328e('0xd')});}; \ No newline at end of file +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 diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index f285dcb..1c93c6a 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 _0xb821=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment','ioredis'];(function(_0x508e31,_0x215014){var _0x5a4bec=function(_0xa6caf0){while(--_0xa6caf0){_0x508e31['push'](_0x508e31['shift']());}};_0x5a4bec(++_0x215014);}(_0xb821,0xa7));var _0x1b82=function(_0x337e00,_0x54984a){_0x337e00=_0x337e00-0x0;var _0x26cbe6=_0xb821[_0x337e00];return _0x26cbe6;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1b82('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1b82('0x3'))(_0x1b82('0x4'));var config=require(_0x1b82('0x5'));var jayson=require(_0x1b82('0x6'));var client=jayson['client'][_0x1b82('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x192434,_0x202a5f,_0x3632dd){return new BPromise(function(_0x18f45f,_0x7b87e8){return client[_0x1b82('0x8')](_0x192434,_0x3632dd)[_0x1b82('0x9')](function(_0x141673){logger['info'](_0x1b82('0xa'),_0x202a5f,_0x1b82('0xb'));logger[_0x1b82('0xc')](_0x1b82('0xd'),_0x202a5f,_0x1b82('0xb'),JSON[_0x1b82('0xe')](_0x141673));if(_0x141673[_0x1b82('0xf')]){if(_0x141673[_0x1b82('0xf')]['code']===0x1f4){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);return _0x7b87e8(_0x141673['error'][_0x1b82('0x10')]);}logger['error']('WhatsappApplication,\x20%s,\x20%s',_0x202a5f,_0x141673[_0x1b82('0xf')]['message']);return _0x18f45f(_0x141673[_0x1b82('0xf')][_0x1b82('0x10')]);}else{logger['info'](_0x1b82('0xa'),_0x202a5f,'request\x20sent');_0x18f45f(_0x141673['result'][_0x1b82('0x10')]);}})['catch'](function(_0x111247){logger[_0x1b82('0xf')](_0x1b82('0xa'),_0x202a5f,_0x111247);_0x7b87e8(_0x111247);});});} \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 5027b19..d2764e1 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 _0x90b5=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','whatsappinteraction:update','delete','removeTags','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1df9e8,_0x44a733){var _0x3639f2=function(_0x8af495){while(--_0x8af495){_0x1df9e8['push'](_0x1df9e8['shift']());}};_0x3639f2(++_0x44a733);}(_0x90b5,0x139));var _0x590b=function(_0x1a2200,_0x402c76){_0x1a2200=_0x1a2200-0x0;var _0x3a5e54=_0x90b5[_0x1a2200];return _0x3a5e54;};'use strict';var multer=require(_0x590b('0x0'));var util=require('util');var path=require(_0x590b('0x1'));var timeout=require(_0x590b('0x2'));var express=require(_0x590b('0x3'));var router=express[_0x590b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var controller=require('./whatsappInteraction.controller');router[_0x590b('0x7')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x9')]);router['get'](_0x590b('0xa'),auth[_0x590b('0x8')](),controller[_0x590b('0xb')]);router[_0x590b('0x7')](_0x590b('0xc'),auth[_0x590b('0x8')](),controller[_0x590b('0xd')]);router[_0x590b('0x7')](_0x590b('0xe'),auth['isAuthenticated'](),controller[_0x590b('0xf')]);router[_0x590b('0x7')]('/:id/download',auth[_0x590b('0x8')](),controller['download']);router[_0x590b('0x10')]('/',auth[_0x590b('0x8')](),controller[_0x590b('0x11')]);router[_0x590b('0x10')]('/:id/messages',auth[_0x590b('0x8')](),controller[_0x590b('0x12')]);router[_0x590b('0x10')](_0x590b('0x13'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x16')),controller[_0x590b('0x17')]);router[_0x590b('0x18')](_0x590b('0xc'),auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),_0x590b('0x19')),controller['update']);router[_0x590b('0x1a')]('/:id',auth[_0x590b('0x8')](),interaction[_0x590b('0x14')](_0x590b('0x15'),'whatsappinteraction:destroy'),controller['destroy']);router[_0x590b('0x1a')]('/:id/tags',auth[_0x590b('0x8')](),controller[_0x590b('0x1b')]);module[_0x590b('0x1c')]=router; \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 5610950..5ac2c19 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 _0x9305=['ENUM','out','sequelize','moment','exports','BOOLEAN','STRING','DATE'];(function(_0x2a5a03,_0x422b7d){var _0x186333=function(_0x2bb9b5){while(--_0x2bb9b5){_0x2a5a03['push'](_0x2a5a03['shift']());}};_0x186333(++_0x422b7d);}(_0x9305,0x1e2));var _0x5930=function(_0x3e1c4c,_0x3a27fc){_0x3e1c4c=_0x3e1c4c-0x0;var _0x4ff014=_0x9305[_0x3e1c4c];return _0x4ff014;};'use strict';var Sequelize=require(_0x5930('0x0'));var moment=require(_0x5930('0x1'));module[_0x5930('0x2')]={'closed':{'type':Sequelize[_0x5930('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5930('0x4')]},'secondDisposition':{'type':Sequelize[_0x5930('0x4')]},'thirdDisposition':{'type':Sequelize[_0x5930('0x4')]},'note':{'type':Sequelize[_0x5930('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x5930('0x5')]},'firstMsgDirection':{'type':Sequelize[_0x5930('0x6')]('in',_0x5930('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5930('0x5')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5930('0x3')],'defaultValue':![]}}; \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 4085552..a6ce2ff 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 _0x4f99=['SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','agent','user','i.WhatsappAccountId\x20IS\x20NULL','role','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','c.firstName','Contact.firstName','c.email','Contact.email','c.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','WhatsappInteractionId','rows','show','includeAll','merge','options','create','body','params','describe','addMessage','WhatsappMessage','omit','ids','getMessages','findOne','nolimit','filter','$gte','format','include','findAll','addTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','User','CmContact','Contact','Attachment','Messages','createdAt','direction','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','pipe','createWriteStream','basename','out','System','firstName','lastName','secret','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','map','fullname','TagIds','Tags','split','push','catch','index','WhatsappInteraction','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','field','color','from','tools_tags','select','u.id','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','`\x20=\x200','operator','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','forEach','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize'];(function(_0x27e08a,_0x29b06c){var _0x996740=function(_0x1de12c){while(--_0x1de12c){_0x27e08a['push'](_0x27e08a['shift']());}};_0x996740(++_0x29b06c);}(_0x4f99,0x157));var _0x94f9=function(_0xda6326,_0x4e805f){_0xda6326=_0xda6326-0x0;var _0x5933c4=_0x4f99[_0xda6326];return _0x5933c4;};'use strict';var emlformat=require(_0x94f9('0x0'));var rimraf=require(_0x94f9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x94f9('0x2'));var rp=require(_0x94f9('0x3'));var moment=require(_0x94f9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x94f9('0x5'));var util=require(_0x94f9('0x6'));var path=require('path');var sox=require(_0x94f9('0x7'));var csv=require(_0x94f9('0x8'));var ejs=require(_0x94f9('0x9'));var fs=require('fs');var fs_extra=require(_0x94f9('0xa'));var _=require(_0x94f9('0xb'));var squel=require('squel');var crypto=require(_0x94f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x94f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x94f9('0xe'));var Papa=require('papaparse');var Redis=require(_0x94f9('0xf'));var authService=require(_0x94f9('0x10'));var qs=require(_0x94f9('0x11'));var as=require(_0x94f9('0x12'));var pdf=require(_0x94f9('0x13'));var hardwareService=require(_0x94f9('0x14'));var logger=require(_0x94f9('0x15'))('api');var utils=require(_0x94f9('0x16'));var config=require(_0x94f9('0x17'));var licenseUtil=require(_0x94f9('0x18'));var db=require(_0x94f9('0x19'))['db'];config[_0x94f9('0x1a')]=_[_0x94f9('0x1b')](config[_0x94f9('0x1a')],{'host':_0x94f9('0x1c'),'port':0x18eb});var socket=require(_0x94f9('0x1d'))(new Redis(config[_0x94f9('0x1a')]));require(_0x94f9('0x1e'))[_0x94f9('0x1f')](socket);function respondWithStatusCode(_0x101daf,_0x1f4c94){_0x1f4c94=_0x1f4c94||0xcc;return function(_0x3791c0){if(_0x3791c0){return _0x101daf['sendStatus'](_0x1f4c94);}return _0x101daf[_0x94f9('0x20')](_0x1f4c94)[_0x94f9('0x21')]();};}function respondWithResult(_0x2f4232,_0x5217d4){_0x5217d4=_0x5217d4||0xc8;return function(_0x490841){if(_0x490841){return _0x2f4232[_0x94f9('0x20')](_0x5217d4)[_0x94f9('0x22')](_0x490841);}};}function respondWithFilteredResult(_0x5930bd,_0x2d1f09){return function(_0x5b0e86){if(_0x5b0e86){var _0x2f3ded=typeof _0x2d1f09[_0x94f9('0x23')]==='undefined'&&typeof _0x2d1f09[_0x94f9('0x24')]===_0x94f9('0x25');var _0x176de9=_0x5b0e86[_0x94f9('0x26')];var _0x437979=_0x2f3ded?0x0:_0x2d1f09[_0x94f9('0x23')];var _0x4b9051=_0x2f3ded?_0x5b0e86[_0x94f9('0x26')]:_0x2d1f09['offset']+_0x2d1f09['limit'];var _0x396600;if(_0x4b9051>=_0x176de9){_0x4b9051=_0x176de9;_0x396600=0xc8;}else{_0x396600=0xce;}_0x5930bd[_0x94f9('0x20')](_0x396600);return _0x5930bd['set'](_0x94f9('0x27'),_0x437979+'-'+_0x4b9051+'/'+_0x176de9)[_0x94f9('0x22')](_0x5b0e86);}return null;};}function patchUpdates(_0x3cd374){return function(_0x2ae4f8){try{jsonpatch[_0x94f9('0x28')](_0x2ae4f8,_0x3cd374,!![]);}catch(_0x18bbfb){return BPromise['reject'](_0x18bbfb);}return _0x2ae4f8[_0x94f9('0x29')]();};}function saveUpdates(_0x152f40,_0x16f655){return function(_0x267216){if(_0x267216){return _0x267216[_0x94f9('0x2a')](_0x152f40)[_0x94f9('0x2b')](function(_0x552554){return _0x552554;});}return null;};}function removeEntity(_0x587c58,_0x4af6bd){return function(_0x243bd4){if(_0x243bd4){return _0x243bd4['destroy']()['then'](function(){_0x587c58['status'](0xcc)[_0x94f9('0x21')]();});}};}function handleEntityNotFound(_0x165cb8,_0x142609){return function(_0x3d78bf){if(!_0x3d78bf){_0x165cb8[_0x94f9('0x2c')](0x194);}return _0x3d78bf;};}function handleError(_0x12a99e,_0x4cb7e3){_0x4cb7e3=_0x4cb7e3||0x1f4;return function(_0x4a6e12){logger[_0x94f9('0x2d')](_0x4a6e12[_0x94f9('0x2e')]);if(_0x4a6e12['name']){delete _0x4a6e12[_0x94f9('0x2f')];}_0x12a99e[_0x94f9('0x20')](_0x4cb7e3)[_0x94f9('0x30')](_0x4a6e12);};}function getInteractionUsers(_0x20984c,_0x1e92dd){return new BPromise(function(_0x24a40f,_0x27c533){try{if(_0x1e92dd[_0x20984c['id']]){_0x20984c['Users']=_[_0x94f9('0x31')](_0x1e92dd[_0x20984c['id']],function(_0x541bfd){return{'id':_0x541bfd['id'],'fullname':_0x541bfd[_0x94f9('0x32')]};});}}catch(_0x287afb){_0x27c533(_0x287afb);}_0x24a40f(_0x20984c);});}function getInteractionTags(_0xa18358,_0x39bf31){return new BPromise(function(_0x2fbc7b,_0x319911){try{if(_0xa18358[_0x94f9('0x33')]){_0xa18358[_0x94f9('0x34')]=[];_0xa18358['TagIds'][_0x94f9('0x35')](',')['forEach'](function(_0x4478e6){_0xa18358[_0x94f9('0x34')][_0x94f9('0x36')](_0x39bf31[_0x4478e6]);});}delete _0xa18358[_0x94f9('0x33')];}catch(_0x5056d8){_0x319911(_0x5056d8);}_0x2fbc7b(_0xa18358);});}function updateWhatsappInteraction(_0x3dbf50,_0x1a131b,_0x48a958){return new BPromise(function(_0x379e5d,_0x12c55c){return getInteractionUsers(_0x3dbf50,_0x48a958)[_0x94f9('0x2b')](function(_0x231225){return getInteractionTags(_0x231225,_0x1a131b);})[_0x94f9('0x2b')](function(_0x25d569){_0x379e5d(_0x25d569);})[_0x94f9('0x37')](function(_0x316675){_0x12c55c(_0x316675);});});}exports[_0x94f9('0x38')]=function(_0x48e5e0,_0x5aab32){var _0x4dc5c5={},_0x45bb69={},_0x8fc7b8={'count':0x0,'rows':[]};var _0x5d46e6=_['map'](db[_0x94f9('0x39')][_0x94f9('0x3a')],function(_0x39fafd){return{'name':_0x39fafd['fieldName'],'type':_0x39fafd['type'][_0x94f9('0x3b')]};});_0x45bb69[_0x94f9('0x3c')]=_[_0x94f9('0x31')](_0x5d46e6,'name');_0x45bb69[_0x94f9('0x3d')]=_[_0x94f9('0x3e')](_0x48e5e0[_0x94f9('0x3d')]);_0x45bb69[_0x94f9('0x3f')]=_['intersection'](_0x45bb69[_0x94f9('0x3c')],_0x45bb69[_0x94f9('0x3d')]);_0x4dc5c5[_0x94f9('0x40')]=_[_0x94f9('0x41')](_0x45bb69[_0x94f9('0x3c')],qs[_0x94f9('0x42')](_0x48e5e0['query'][_0x94f9('0x42')]));_0x4dc5c5[_0x94f9('0x40')]=_0x4dc5c5[_0x94f9('0x40')]['length']?_0x4dc5c5[_0x94f9('0x40')]:_0x45bb69['model'];if(!_0x48e5e0['query'][_0x94f9('0x43')]('nolimit')){_0x4dc5c5[_0x94f9('0x24')]=qs[_0x94f9('0x24')](_0x48e5e0[_0x94f9('0x3d')]['limit']);_0x4dc5c5['offset']=qs[_0x94f9('0x23')](_0x48e5e0[_0x94f9('0x3d')][_0x94f9('0x23')]);}_0x4dc5c5[_0x94f9('0x44')]=qs[_0x94f9('0x45')](_0x48e5e0[_0x94f9('0x3d')][_0x94f9('0x45')]);_0x4dc5c5[_0x94f9('0x46')]=qs['filters'](_[_0x94f9('0x47')](_0x48e5e0['query'],_0x45bb69['filters']),_0x5d46e6);var _0x3f18ac=[];var _0x3d3ba3=squel['select']()[_0x94f9('0x48')]('id')[_0x94f9('0x48')](_0x94f9('0x2f'))['field'](_0x94f9('0x49'))[_0x94f9('0x4a')](_0x94f9('0x4b'));var _0x422578=squel[_0x94f9('0x4c')]()[_0x94f9('0x48')](_0x94f9('0x4d'))[_0x94f9('0x48')]('u.fullname')[_0x94f9('0x48')](_0x94f9('0x4e'))[_0x94f9('0x4a')](_0x94f9('0x4f'),'ui')[_0x94f9('0x50')](_0x94f9('0x51'),'u',_0x94f9('0x52'));var _0x4bd458=squel[_0x94f9('0x4c')]()[_0x94f9('0x4a')]('whatsapp_interactions','i')['left_join'](_0x94f9('0x53'),'c',_0x94f9('0x54'))[_0x94f9('0x50')](_0x94f9('0x51'),'o',_0x94f9('0x55'))[_0x94f9('0x50')](_0x94f9('0x56'),'a',_0x94f9('0x57'))[_0x94f9('0x50')](_0x94f9('0x58'),'me',_0x94f9('0x59'))[_0x94f9('0x50')](_0x94f9('0x5a'),'it','it.WhatsappInteractionId\x20=\x20i.id')[_0x94f9('0x50')](_0x94f9('0x4b'),'t',_0x94f9('0x5b'));var _0x846bc8=squel[_0x94f9('0x5c')]();var _0x2d4f71=[];var _0x4d7622=squel['expr']();var _0x3f4983;if(_0x48e5e0['query'][_0x94f9('0x5d')]){_0x3f4983=as[_0x94f9('0x5e')](_0x48e5e0[_0x94f9('0x3d')]['search']);var _0x4137eb=_0x3f4983[_0x94f9('0x5f')];for(var _0x5cf2b0=0x0;_0x5cf2b0<_0x3f4983[_0x94f9('0x60')][_0x94f9('0x61')];_0x5cf2b0++){var _0x2b045b=_0x3f4983[_0x94f9('0x60')][_0x5cf2b0];var _0x4433e3='i';var _0x3e6ca9=_[_0x94f9('0x62')](_0x5d46e6,[_0x94f9('0x2f'),_0x2b045b[_0x94f9('0x48')]]);if(!_0x3e6ca9){switch(_0x2b045b['field']){case _0x94f9('0x63'):if(_0x2b045b['value']==0x1){_0x4bd458[_0x94f9('0x64')]('`'+_0x2b045b[_0x94f9('0x48')]+_0x94f9('0x65'));}else{_0x4bd458[_0x94f9('0x64')]('`'+_0x2b045b[_0x94f9('0x48')]+'`\x20>\x200');}break;case'Contact':if(_0x2b045b[_0x94f9('0x66')]==='$substring'){if(_0x2b045b[_0x94f9('0x67')][_0x94f9('0x35')]('\x20')[_0x94f9('0x61')]>0x1){_0x846bc8[_0x4137eb]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x94f9('0x68')](_0x2b045b[_0x94f9('0x67')]),null);}else{var _0x15c462='%'+_0x2b045b[_0x94f9('0x67')]+'%';_0x846bc8[_0x4137eb](_0x94f9('0x69'),_0x15c462,_0x15c462,_0x15c462);}}else{_0x3e6ca9=_[_0x94f9('0x62')](_0x5d46e6,[_0x94f9('0x2f'),_0x94f9('0x6a')]);_0x2b045b[_0x94f9('0x48')]=_0x94f9('0x6a');_0x5762b4=as['buildExpression'](_0x4433e3,_0x3e6ca9[_0x94f9('0x6b')],_0x2b045b);_0x846bc8[_0x4137eb](_0x5762b4[_0x94f9('0x6c')],_0x5762b4['value'][_0x94f9('0x6d')],_0x5762b4['value'][_0x94f9('0x21')]);}break;case _0x94f9('0x6e'):var _0x43c138=_0x2b045b[_0x94f9('0x67')][_0x94f9('0x35')](',')[_0x94f9('0x31')](function(_0x2efbb6){return Number(_0x2efbb6);});_0x43c138['forEach'](function(_0x465325){_0x4d7622['or'](_0x94f9('0x6f'),'%,'+_0x465325+',%');});_0x2d4f71=_[_0x94f9('0x70')](_0x2d4f71,_0x43c138);break;case'User':if(_0x2b045b['operator']===_0x94f9('0x71')){_0x846bc8[_0x4137eb](_0x94f9('0x72'),'%'+_0x2b045b[_0x94f9('0x67')]+'%',null);}else{_0x3e6ca9=_[_0x94f9('0x62')](_0x5d46e6,[_0x94f9('0x2f'),_0x94f9('0x73')]);_0x2b045b[_0x94f9('0x48')]=_0x94f9('0x73');_0x5762b4=as[_0x94f9('0x74')](_0x4433e3,_0x3e6ca9[_0x94f9('0x6b')],_0x2b045b);_0x846bc8[_0x4137eb](_0x5762b4['text'],_0x5762b4[_0x94f9('0x67')][_0x94f9('0x6d')],_0x5762b4['value'][_0x94f9('0x21')]);}break;case'body':_0x5762b4=as[_0x94f9('0x74')]('me',null,_0x2b045b);_0x846bc8[_0x4137eb](_0x5762b4[_0x94f9('0x6c')],_0x5762b4['value'][_0x94f9('0x6d')],_0x5762b4[_0x94f9('0x67')][_0x94f9('0x21')]);break;}}else{var _0x5762b4=as[_0x94f9('0x74')](_0x4433e3,_0x3e6ca9[_0x94f9('0x6b')],_0x2b045b);_0x846bc8[_0x4137eb](_0x5762b4[_0x94f9('0x6c')],_0x5762b4[_0x94f9('0x67')][_0x94f9('0x6d')],_0x5762b4[_0x94f9('0x67')]['end']);}}}else{var _0x22a3e5=_(_0x48e5e0[_0x94f9('0x3d')])[_0x94f9('0x3e')]()[_0x94f9('0x31')](function(_0x5c5a4c){return _[_0x94f9('0x75')](_0x5d46e6,[_0x94f9('0x2f'),_0x5c5a4c])?_0x5c5a4c:undefined;})[_0x94f9('0x76')]()[_0x94f9('0x67')]();if(!_[_0x94f9('0x77')](_0x22a3e5)){_0x22a3e5[_0x94f9('0x78')](function(_0x4b71d0){if(_0x4b71d0===_0x94f9('0x79')){_0x4bd458[_0x94f9('0x46')](_0x94f9('0x7a'),[][_0x94f9('0x7b')](_0x48e5e0[_0x94f9('0x3d')][_0x4b71d0]));}else if(_0x4b71d0==='createdAt'){var _0x3a5f69=JSON[_0x94f9('0x7c')](_0x48e5e0[_0x94f9('0x3d')][_0x4b71d0])['$gte'];var _0x3c2cdf=JSON['parse'](_0x48e5e0[_0x94f9('0x3d')][_0x4b71d0])[_0x94f9('0x7d')];_0x4bd458[_0x94f9('0x46')](_0x94f9('0x7e'),_0x3a5f69,_0x3c2cdf);}else{if(_0x48e5e0[_0x94f9('0x3d')][_0x4b71d0]===_0x94f9('0x7f')){_0x4bd458[_0x94f9('0x46')]('i.'+_0x4b71d0+_0x94f9('0x80'));}else{_0x4bd458[_0x94f9('0x46')]('i.'+_0x4b71d0+_0x94f9('0x81'),_0x48e5e0[_0x94f9('0x3d')][_0x4b71d0]);}}});}if(_0x48e5e0[_0x94f9('0x3d')][_0x94f9('0x82')]){if(_0x48e5e0['query'][_0x94f9('0x82')]==0x1){_0x4bd458['having'](_0x94f9('0x83'));}else{_0x4bd458[_0x94f9('0x64')]('`unreadMessages`\x20>\x200');}}if(_0x48e5e0['query'][_0x94f9('0x84')]){_0x2d4f71=_[_0x94f9('0x85')](_0x48e5e0['query']['tag'])?_0x48e5e0['query'][_0x94f9('0x84')]:new Array(_0x48e5e0[_0x94f9('0x3d')][_0x94f9('0x84')]);_0x2d4f71[_0x94f9('0x78')](function(_0x3a965c){_0x4d7622['or'](_0x94f9('0x6f'),'%,'+_0x3a965c+',%');});}if(_0x48e5e0[_0x94f9('0x3d')]['filter']){var _0x4abd30=_0x48e5e0[_0x94f9('0x3d')]['filter']['replace']('\x5c','\x5c\x5c')[_0x94f9('0x86')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4abd30)){_0x846bc8['or'](_0x94f9('0x87'),_0x4abd30+'%')['or'](_0x94f9('0x88'),_0x4abd30+'%');}else{_0x846bc8['or'](_0x94f9('0x89'),qs[_0x94f9('0x68')](_0x4abd30))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4abd30+'%');}}}_0x4bd458[_0x94f9('0x46')](_0x846bc8);_0x4bd458[_0x94f9('0x8a')](_0x94f9('0x8b'));var _0x1f325b={'type':db[_0x94f9('0x8c')]['QueryTypes'][_0x94f9('0x8d')],'raw':!![]};var _0x495373=_0x4bd458[_0x94f9('0x8e')]();_0x495373[_0x94f9('0x48')](_0x94f9('0x8b'));_0x495373['field'](_0x94f9('0x8f'),_0x94f9('0x63'));if(_0x4dc5c5[_0x94f9('0x44')]){_0x4dc5c5['order'][_0x94f9('0x78')](function(_0x464986){var _0x5c4896=_0x464986[0x0]===_0x94f9('0x90')?_0x464986[0x0]:'i.'+_0x464986[0x0];_0x4bd458[_0x94f9('0x44')](_0x5c4896,_0x464986[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x2d4f71)){_0x4bd458[_0x94f9('0x64')](_0x4d7622);_0x495373[_0x94f9('0x46')](_0x94f9('0x91'),_0x2d4f71);}BPromise[_0x94f9('0x92')]()['then'](function(){if(!_0x3f4983){if(_0x48e5e0[_0x94f9('0x3d')][_0x94f9('0x79')])return;_0x495373['where'](_0x94f9('0x93'));_0x4bd458[_0x94f9('0x46')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x48e5e0['user']['role']!==_0x94f9('0x94'))return;return _0x48e5e0[_0x94f9('0x95')]['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0x94f9('0x2b')](function(_0x18d4ff){if(_[_0x94f9('0x77')](_0x18d4ff)){_0x495373[_0x94f9('0x46')](_0x94f9('0x96'));_0x4bd458['where'](_0x94f9('0x96'));}else{_0x495373[_0x94f9('0x46')](_0x94f9('0x7a'),_[_0x94f9('0x31')](_0x18d4ff,'id'));_0x4bd458['where'](_0x94f9('0x7a'),_[_0x94f9('0x31')](_0x18d4ff,'id'));}});})['then'](function(){if(_0x48e5e0[_0x94f9('0x95')][_0x94f9('0x97')]===_0x94f9('0x94')&&!_0x3f4983&&!_0x48e5e0[_0x94f9('0x3d')]['WhatsappAccountId'])return[];return db[_0x94f9('0x98')][_0x94f9('0x3d')](_0x495373[_0x94f9('0x99')](),_0x1f325b);})[_0x94f9('0x2b')](function(_0x2f880d){_0x8fc7b8[_0x94f9('0x26')]=_0x2f880d[_0x94f9('0x61')];if(_0x8fc7b8['count']===0x0)return[];return db[_0x94f9('0x98')][_0x94f9('0x3d')](_0x3d3ba3['toString'](),_0x1f325b)[_0x94f9('0x2b')](function(_0x884ae2){_0x3f18ac=_[_0x94f9('0x9a')](_0x884ae2,'id');_0x1f325b=_['merge'](_0x1f325b,{'model':db[_0x94f9('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x48e5e0[_0x94f9('0x3d')]['fields']){_0x4dc5c5['attributes'][_0x94f9('0x78')](function(_0x3dcb85){_0x4bd458[_0x94f9('0x48')]('i.'+_0x3dcb85);});}else{_0x4bd458[_0x94f9('0x48')](_0x94f9('0x8f'),_0x94f9('0x63'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0x9b'),_0x94f9('0x9c'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0x9d'),_0x94f9('0x9e'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0x9f'),_0x94f9('0x90'));_0x4bd458[_0x94f9('0x48')]('i.*');_0x4bd458['field'](_0x94f9('0xa0'),_0x94f9('0xa1'));_0x4bd458['field']('c.lastName','Contact.lastName');_0x4bd458[_0x94f9('0x48')](_0x94f9('0xa2'),_0x94f9('0xa3'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0xa4'),'Contact.phone');_0x4bd458[_0x94f9('0x48')]('c.mobile',_0x94f9('0xa5'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0xa6'),_0x94f9('0xa7'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0xa8'),_0x94f9('0xa9'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0xaa'),_0x94f9('0xab'));_0x4bd458[_0x94f9('0x48')](_0x94f9('0xac'),_0x94f9('0x33'));}if(_0x4dc5c5[_0x94f9('0x24')])_0x4bd458[_0x94f9('0x24')](_0x4dc5c5[_0x94f9('0x24')]);if(_0x4dc5c5[_0x94f9('0x23')])_0x4bd458['offset'](_0x4dc5c5[_0x94f9('0x23')]);return db['sequelize'][_0x94f9('0x3d')](_0x4bd458[_0x94f9('0x99')](),_0x1f325b);})[_0x94f9('0x2b')](function(_0x4c16df){if(_0x4c16df[_0x94f9('0x61')]>0x0)_0x422578[_0x94f9('0x46')]('ui.WhatsappInteractionId\x20IN\x20?',_[_0x94f9('0x31')](_0x4c16df,'id'));return db[_0x94f9('0x98')]['query'](_0x422578['toString'](),_0x1f325b)[_0x94f9('0x2b')](function(_0x2e7380){var _0xfa4488=_['groupBy'](_0x2e7380,_0x94f9('0xad'));var _0x238c64=[];_0x4c16df['forEach'](function(_0x1932fb){_0x238c64[_0x94f9('0x36')](updateWhatsappInteraction(_0x1932fb,_0x3f18ac,_0xfa4488));});return BPromise['all'](_0x238c64);});});})[_0x94f9('0x2b')](function(_0x5cf7cb){_0x8fc7b8[_0x94f9('0xae')]=_0x5cf7cb;return _0x8fc7b8;})[_0x94f9('0x2b')](respondWithFilteredResult(_0x5aab32,_0x4dc5c5))[_0x94f9('0x37')](handleError(_0x5aab32,null));};exports[_0x94f9('0xaf')]=function(_0x5b13b3,_0x2bb0a0){var _0x1a4b8e={'raw':![],'where':{'id':_0x5b13b3['params']['id']}},_0x8cc1d3={};_0x8cc1d3[_0x94f9('0x3c')]=_['keys'](db[_0x94f9('0x39')][_0x94f9('0x3a')]);_0x8cc1d3[_0x94f9('0x3d')]=_['keys'](_0x5b13b3[_0x94f9('0x3d')]);_0x8cc1d3[_0x94f9('0x3f')]=_[_0x94f9('0x41')](_0x8cc1d3[_0x94f9('0x3c')],_0x8cc1d3[_0x94f9('0x3d')]);_0x1a4b8e[_0x94f9('0x40')]=_[_0x94f9('0x41')](_0x8cc1d3[_0x94f9('0x3c')],qs[_0x94f9('0x42')](_0x5b13b3[_0x94f9('0x3d')][_0x94f9('0x42')]));_0x1a4b8e[_0x94f9('0x40')]=_0x1a4b8e[_0x94f9('0x40')][_0x94f9('0x61')]?_0x1a4b8e[_0x94f9('0x40')]:_0x8cc1d3[_0x94f9('0x3c')];if(_0x5b13b3['query'][_0x94f9('0xb0')]){_0x1a4b8e['include']=[{'all':!![]}];}_0x1a4b8e=_[_0x94f9('0xb1')]({},_0x1a4b8e,_0x5b13b3[_0x94f9('0xb2')]);return db[_0x94f9('0x39')][_0x94f9('0x62')](_0x1a4b8e)[_0x94f9('0x2b')](handleEntityNotFound(_0x2bb0a0,null))['then'](respondWithResult(_0x2bb0a0,null))[_0x94f9('0x37')](handleError(_0x2bb0a0,null));};exports[_0x94f9('0xb3')]=function(_0x4d660c,_0x427e5b){return db[_0x94f9('0x39')][_0x94f9('0xb3')](_0x4d660c[_0x94f9('0xb4')],{})['then'](respondWithResult(_0x427e5b,0xc9))[_0x94f9('0x37')](handleError(_0x427e5b,null));};exports[_0x94f9('0x2a')]=function(_0x10fc9e,_0x43b30b){if(_0x10fc9e[_0x94f9('0xb4')]['id']){delete _0x10fc9e[_0x94f9('0xb4')]['id'];}return db[_0x94f9('0x39')][_0x94f9('0x62')]({'where':{'id':_0x10fc9e[_0x94f9('0xb5')]['id']}})[_0x94f9('0x2b')](handleEntityNotFound(_0x43b30b,null))['then'](saveUpdates(_0x10fc9e['body'],null))[_0x94f9('0x2b')](respondWithResult(_0x43b30b,null))['catch'](handleError(_0x43b30b,null));};exports['destroy']=function(_0x3310d4,_0x49c156){return db[_0x94f9('0x39')]['find']({'where':{'id':_0x3310d4[_0x94f9('0xb5')]['id']}})[_0x94f9('0x2b')](handleEntityNotFound(_0x49c156,null))[_0x94f9('0x2b')](removeEntity(_0x49c156,null))[_0x94f9('0x37')](handleError(_0x49c156,null));};exports[_0x94f9('0xb6')]=function(_0x1862e4,_0x230be8){return db[_0x94f9('0x39')][_0x94f9('0xb6')]()['then'](respondWithResult(_0x230be8,null))[_0x94f9('0x37')](handleError(_0x230be8,null));};exports[_0x94f9('0xb7')]=function(_0x570e86,_0x1c5dc6,_0x401ebb){return db[_0x94f9('0xb8')][_0x94f9('0x62')]({'where':{'id':_0x570e86[_0x94f9('0xb5')]['id']}})[_0x94f9('0x2b')](handleEntityNotFound(_0x1c5dc6,null))[_0x94f9('0x2b')](function(_0x31dc58){if(_0x31dc58){return _0x31dc58[_0x94f9('0xb7')](_0x570e86[_0x94f9('0xb4')]['ids'],_[_0x94f9('0xb9')](_0x570e86[_0x94f9('0xb4')],[_0x94f9('0xba'),'id'])||{});}})[_0x94f9('0x2b')](respondWithResult(_0x1c5dc6,null))[_0x94f9('0x37')](handleError(_0x1c5dc6,null));};exports[_0x94f9('0xbb')]=function(_0x128bbd,_0x53a37d,_0x2a0b2f){var _0x1074af={'raw':![],'where':{}};var _0x4e917d={};var _0x4f058c={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x94f9('0xbc')]({'where':{'id':_0x128bbd[_0x94f9('0xb5')]['id']}})[_0x94f9('0x2b')](handleEntityNotFound(_0x53a37d,null))[_0x94f9('0x2b')](function(_0x2e1734){if(_0x2e1734){_0x4e917d[_0x94f9('0x3c')]=_['keys'](db[_0x94f9('0xb8')][_0x94f9('0x3a')]);_0x4e917d[_0x94f9('0x3d')]=_[_0x94f9('0x3e')](_0x128bbd[_0x94f9('0x3d')]);_0x4e917d[_0x94f9('0x3f')]=_[_0x94f9('0x41')](_0x4e917d[_0x94f9('0x3c')],_0x4e917d[_0x94f9('0x3d')]);_0x1074af['attributes']=_[_0x94f9('0x41')](_0x4e917d[_0x94f9('0x3c')],qs[_0x94f9('0x42')](_0x128bbd[_0x94f9('0x3d')][_0x94f9('0x42')]));_0x1074af[_0x94f9('0x40')]=_0x1074af['attributes']['length']?_0x1074af[_0x94f9('0x40')]:_0x4e917d[_0x94f9('0x3c')];if(!_0x128bbd[_0x94f9('0x3d')][_0x94f9('0x43')](_0x94f9('0xbd'))){_0x1074af[_0x94f9('0x24')]=qs[_0x94f9('0x24')](_0x128bbd['query'][_0x94f9('0x24')]);_0x1074af['offset']=qs['offset'](_0x128bbd[_0x94f9('0x3d')][_0x94f9('0x23')]);}_0x1074af['order']=qs[_0x94f9('0x45')](_0x128bbd[_0x94f9('0x3d')][_0x94f9('0x45')]);_0x1074af[_0x94f9('0x46')]=qs[_0x94f9('0x3f')](_[_0x94f9('0x47')](_0x128bbd[_0x94f9('0x3d')],_0x4e917d[_0x94f9('0x3f')]));_0x1074af['where'][_0x94f9('0xad')]=_0x2e1734['id'];if(_0x128bbd[_0x94f9('0x3d')][_0x94f9('0xbe')]){_0x1074af['where']=_['merge'](_0x1074af[_0x94f9('0x46')],{'$or':_['map'](_0x1074af['attributes'],function(_0x17c543){var _0x23ed29={};_0x23ed29[_0x17c543]={'$like':'%'+_0x128bbd[_0x94f9('0x3d')][_0x94f9('0xbe')]+'%'};return _0x23ed29;})});}if(_0x128bbd['query'][_0x94f9('0xbf')]){var _0x1754e4=_0x128bbd[_0x94f9('0x3d')][_0x94f9('0xbf')][_0x94f9('0x35')](',');var _0x33f02e={};_0x33f02e[_0x1754e4[0x0]]={'$gte':moment(_0x1754e4[0x1])[_0x94f9('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1074af['where']=_[_0x94f9('0xb1')](_0x1074af[_0x94f9('0x46')],_0x33f02e);}_0x1074af=_['merge']({},_0x1074af,_0x128bbd[_0x94f9('0xb2')]);return db[_0x94f9('0xb8')]['count']({'where':_0x1074af['where']})[_0x94f9('0x2b')](function(_0x3dad05){_0x4f058c[_0x94f9('0x26')]=_0x3dad05;if(_0x128bbd[_0x94f9('0x3d')][_0x94f9('0xb0')]){_0x1074af[_0x94f9('0xc1')]=[{'all':!![]}];}return db[_0x94f9('0xb8')][_0x94f9('0xc2')](_0x1074af);})[_0x94f9('0x2b')](function(_0x177d4e){_0x4f058c[_0x94f9('0xae')]=_0x177d4e;return _0x4f058c;});}})[_0x94f9('0x2b')](respondWithFilteredResult(_0x53a37d,_0x1074af))[_0x94f9('0x37')](handleError(_0x53a37d,null));};exports[_0x94f9('0xc3')]=function(_0x11eec4,_0x168dbd,_0x56ae23){return db[_0x94f9('0x39')][_0x94f9('0x62')]({'where':{'id':_0x11eec4[_0x94f9('0xb5')]['id']}})[_0x94f9('0x2b')](handleEntityNotFound(_0x168dbd,null))[_0x94f9('0x2b')](function(_0x4a0556){if(_0x4a0556){return _0x4a0556['setTags'](_0x11eec4[_0x94f9('0xb4')][_0x94f9('0xba')],_[_0x94f9('0xb9')](_0x11eec4[_0x94f9('0xb4')],[_0x94f9('0xba'),'id'])||{})[_0x94f9('0xc4')](function(){return db['Tag'][_0x94f9('0xc2')]({'attributes':['id',_0x94f9('0x2f'),_0x94f9('0x49')],'where':{'id':_0x11eec4['body'][_0x94f9('0xba')]}});})['then'](function(_0x552004){socket[_0x94f9('0xc5')](_0x94f9('0xc6'),{'id':Number(_0x11eec4['params']['id']),'tags':_0x552004||[]});return{'id':Number(_0x11eec4[_0x94f9('0xb5')]['id']),'tags':_0x552004||[]};});}})[_0x94f9('0x2b')](respondWithResult(_0x168dbd,null))[_0x94f9('0x37')](handleError(_0x168dbd,null));};exports[_0x94f9('0xc7')]=function(_0x5a0112,_0x2bb815,_0x2afeab){return db[_0x94f9('0x39')][_0x94f9('0x62')]({'where':{'id':_0x5a0112[_0x94f9('0xb5')]['id']}})[_0x94f9('0x2b')](handleEntityNotFound(_0x2bb815,null))[_0x94f9('0x2b')](function(_0x193522){if(_0x193522){return _0x193522[_0x94f9('0xc7')](_0x5a0112[_0x94f9('0x3d')][_0x94f9('0xba')]);}})[_0x94f9('0x2b')](respondWithStatusCode(_0x2bb815,null))[_0x94f9('0x37')](handleError(_0x2bb815,null));};exports[_0x94f9('0xc8')]=function(_0xcd63f7,_0x2db3ac){var _0x483a8c=moment()[_0x94f9('0xc9')]()[_0x94f9('0x99')]();var _0x12d5ca=path[_0x94f9('0xca')](config[_0x94f9('0xcb')],_0x94f9('0xcc'),_0x94f9('0xcd'),_0x94f9('0xce'));var _0x1fddf7=path[_0x94f9('0xca')](config[_0x94f9('0xcb')],_0x94f9('0xcc'),_0x94f9('0xcd'),_0x94f9('0xcf'));var _0xfd77c8=path[_0x94f9('0xca')](_0x12d5ca,_0x483a8c);var _0x3da9b3=util[_0x94f9('0xc0')]('transcript-%d-%s.zip',_0xcd63f7['params']['id'],_0x483a8c);var _0x568de5=path[_0x94f9('0xca')](_0x12d5ca,_0x3da9b3);var _0x357117=[];_0x357117['push']({'model':db[_0x94f9('0xd0')],'as':_0x94f9('0xd0'),'attributes':['id',_0x94f9('0x32')],'raw':!![]});_0x357117[_0x94f9('0x36')]({'model':db[_0x94f9('0xd1')],'as':_0x94f9('0xd2'),'attributes':['id','firstName','lastName'],'raw':!![]});if(_0xcd63f7[_0x94f9('0x3d')][_0x94f9('0xcf')]){_0x357117[_0x94f9('0x36')]({'model':db['Attachment'],'as':_0x94f9('0xd3'),'raw':!![]});}var _0x47e338=[{'model':db[_0x94f9('0xb8')],'as':_0x94f9('0xd4'),'attributes':['id','body',_0x94f9('0xd5'),_0x94f9('0xd6'),'secret',_0x94f9('0x82')],'include':_0x357117}];_0x47e338['push']({'model':db[_0x94f9('0xd7')],'as':_0x94f9('0xd8'),'attributes':['id',_0x94f9('0x2f')]});_0x47e338['push']({'model':db[_0x94f9('0xd0')],'as':_0x94f9('0xd9'),'attributes':['id',_0x94f9('0x32')]});return db['WhatsappInteraction'][_0x94f9('0x62')]({'where':{'id':_0xcd63f7[_0x94f9('0xb5')]['id']},'include':_0x47e338})['then'](handleEntityNotFound(_0x2db3ac,null))[_0x94f9('0x2b')](function(_0x350ec0){if(_0x350ec0){var _0x14a975=_0x350ec0[_0x94f9('0xda')]({'plain':!![]});fs[_0x94f9('0xdb')](_0xfd77c8);var _0x2eb0de={'channel':_0x94f9('0xdc'),'account':_0x14a975[_0x94f9('0xd8')][_0x94f9('0x2f')],'agent':_0x14a975[_0x94f9('0xd9')]?_0x14a975['Owner']['fullname']:_0x94f9('0xdd'),'createdAt':moment(_0x14a975[_0x94f9('0xd5')])[_0x94f9('0xc0')](_0x94f9('0xde'))[_0x94f9('0x99')](),'closedAt':_0x14a975[_0x94f9('0xdf')]?moment(_0x14a975[_0x94f9('0xe0')])[_0x94f9('0xc0')](_0x94f9('0xde'))[_0x94f9('0x99')]():'','disposition':_0x14a975[_0x94f9('0xe1')],'messages':_(_0x14a975[_0x94f9('0xd4')])[_0x94f9('0xbe')]({'secret':![]})[_0x94f9('0x31')](function(_0x1212d0){if(_0x1212d0[_0x94f9('0xd3')]){var _0x2abfac=path[_0x94f9('0xca')](_0x1fddf7,_0x1212d0[_0x94f9('0xd3')]['basename']);if(fs['existsSync'](_0x2abfac)){fs['createReadStream'](_0x2abfac)[_0x94f9('0xe2')](fs[_0x94f9('0xe3')](path[_0x94f9('0xca')](_0xfd77c8,_0x1212d0[_0x94f9('0xd3')][_0x94f9('0xe4')])));}}return{'date':moment(_0x1212d0[_0x94f9('0xd5')])[_0x94f9('0xc0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x94f9('0x99')](),'sender':_0x1212d0[_0x94f9('0xd6')]===_0x94f9('0xe5')?_0x1212d0['User']?_0x1212d0['User'][_0x94f9('0x32')]:_0x94f9('0xe6'):_0x1212d0[_0x94f9('0xd2')][_0x94f9('0xe7')]+(_0x1212d0[_0x94f9('0xd2')]['lastName']?'\x20'+_0x1212d0[_0x94f9('0xd2')][_0x94f9('0xe8')]:''),'body':_0x1212d0['Attachment']?_0x1212d0[_0x94f9('0xd3')][_0x94f9('0xe4')]:_0x1212d0[_0x94f9('0xb4')],'direction':_0x1212d0[_0x94f9('0xd6')]===_0x94f9('0xe5')?'A':'C','secret':_0x1212d0[_0x94f9('0xe9')],'read':_0x1212d0[_0x94f9('0x82')],'attachment':_0x1212d0[_0x94f9('0xd3')]};})[_0x94f9('0x67')]()};return ejs[_0x94f9('0xea')](path[_0x94f9('0xca')](config[_0x94f9('0xcb')],_0x94f9('0xcc'),_0x94f9('0xeb'),_0x94f9('0xec')),{'interaction':_0x2eb0de})['then'](function(_0x51a1f1){var _0xb1c6f9=path[_0x94f9('0xca')](_0xfd77c8,_0x94f9('0xed')+_0x14a975['id']+'-'+_0x483a8c+'.pdf');var _0x43bc91={'path':_0xb1c6f9,'channel':'Whatsapp','interactionId':_0x14a975['id']};return pdf[_0x94f9('0xee')](_0x51a1f1,_0x43bc91);})[_0x94f9('0x2b')](function(){return new BPromise(function(_0x152f67,_0x569a0b){zipdir(_0xfd77c8,{'saveTo':_0x568de5},function(_0x402aab,_0x58c83f){if(_0x402aab)return _0x569a0b(_0x402aab);return _0x152f67(_0x58c83f);});})[_0x94f9('0x2b')](function(){return new BPromise(function(_0x1ec720,_0x676bb6){rimraf(_0xfd77c8,function(_0x1a7b70){if(_0x1a7b70)_0x676bb6(_0x1a7b70);return _0x1ec720();});});})[_0x94f9('0x2b')](function(){return _0x2db3ac[_0x94f9('0xc8')](_0x568de5,_0x3da9b3,function(_0x36c857){if(_0x36c857){console[_0x94f9('0xef')](_0x94f9('0xf0'),_0x36c857);}else{fs[_0x94f9('0xf1')](_0x568de5);}});});});}else{return _0x2db3ac['sendStatus'](0xc8);}})[_0x94f9('0x37')](handleError(_0x2db3ac,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 4f31d54..c571487 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 _0x3276=['exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x3276,0xc7));var _0x6327=function(_0x345afb,_0x2bef6d){_0x345afb=_0x345afb-0x0;var _0x4074fd=_0x3276[_0x345afb];return _0x4074fd;};'use strict';var EventEmitter=require(_0x6327('0x0'));var WhatsappInteraction=require('../../mysqldb')['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x6327('0x1'))['db'][_0x6327('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x6327('0x3')](0x0);var events={'afterCreate':_0x6327('0x4'),'afterUpdate':_0x6327('0x5'),'afterDestroy':_0x6327('0x6')};function emitEvent(_0x436055){return function(_0x4e3309,_0x56405e,_0x10b982){_0x4e3309[_0x6327('0x7')]({'attributes':['id'],'raw':!![]})[_0x6327('0x8')](function(_0x498821){_0x4e3309[_0x6327('0x9')](_0x6327('0xa'),_0x498821[_0x6327('0xb')](function(_0x1dc34b){return{'id':_0x1dc34b['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x4e3309['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6327('0x8')](function(_0x1687c4){_0x4e3309['setDataValue'](_0x6327('0xc'),_0x1687c4[_0x6327('0xd')]);WhatsappInteractionEvents['emit'](_0x436055+':'+_0x4e3309['id'],_0x4e3309);WhatsappInteractionEvents[_0x6327('0xe')](_0x436055,_0x4e3309);_0x10b982(null);})[_0x6327('0xf')](_0x10b982(null));};}for(var e in events){if(events[_0x6327('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x6327('0x11')]=WhatsappInteractionEvents; \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index ecf526c..c7e3d7b 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 _0xfbf7=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closed','format'];(function(_0x3a2b6e,_0x5ba75b){var _0x593ef1=function(_0x283dcc){while(--_0x283dcc){_0x3a2b6e['push'](_0x3a2b6e['shift']());}};_0x593ef1(++_0x5ba75b);}(_0xfbf7,0x14b));var _0x7fbf=function(_0x33f602,_0x31417f){_0x33f602=_0x33f602-0x0;var _0x18f4c5=_0xfbf7[_0x33f602];return _0x18f4c5;};'use strict';var _=require('lodash');var util=require(_0x7fbf('0x0'));var logger=require(_0x7fbf('0x1'))('api');var moment=require(_0x7fbf('0x2'));var BPromise=require(_0x7fbf('0x3'));var rp=require(_0x7fbf('0x4'));var fs=require('fs');var path=require(_0x7fbf('0x5'));var rimraf=require(_0x7fbf('0x6'));var config=require('../../config/environment');var attributes=require(_0x7fbf('0x7'));module[_0x7fbf('0x8')]=function(_0x12d9cb,_0x44c8fc){return _0x12d9cb[_0x7fbf('0x9')]('WhatsappInteraction',attributes,{'tableName':_0x7fbf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58a9c6,_0x307581,_0x4439b1){if(_0x58a9c6[_0x7fbf('0xb')](_0x7fbf('0xc'))){_0x58a9c6['closedAt']=moment()[_0x7fbf('0xd')](_0x7fbf('0xe'));}_0x4439b1(null,_0x58a9c6);}}});}; \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index c6c26ac..84784d1 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 _0x0e45=['stringify','error','message','result','UpdateWhatsappInteraction','WhatsappInteraction','update','options','raw','attributes','catch','AddTagsToWhatsappInteraction','find','where','ids','body','spread','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x0e45,0xb6));var _0x50e4=function(_0x4ada81,_0x19d968){_0x4ada81=_0x4ada81-0x0;var _0x27cedd=_0x0e45[_0x4ada81];return _0x27cedd;};'use strict';var _=require(_0x50e4('0x0'));var util=require('util');var moment=require(_0x50e4('0x1'));var BPromise=require('bluebird');var rs=require(_0x50e4('0x2'));var fs=require('fs');var Redis=require(_0x50e4('0x3'));var db=require(_0x50e4('0x4'))['db'];var utils=require(_0x50e4('0x5'));var logger=require(_0x50e4('0x6'))(_0x50e4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x50e4('0x8')][_0x50e4('0x9')]({'port':0x232a});config[_0x50e4('0xa')]=_[_0x50e4('0xb')](config[_0x50e4('0xa')],{'host':_0x50e4('0xc'),'port':0x18eb});var socket=require(_0x50e4('0xd'))(new Redis(config[_0x50e4('0xa')]));require(_0x50e4('0xe'))[_0x50e4('0xf')](socket);function respondWithRpcPromise(_0x5c852c,_0x4257e7,_0x21a278){return new BPromise(function(_0x385691,_0x22c060){return client[_0x50e4('0x10')](_0x5c852c,_0x21a278)[_0x50e4('0x11')](function(_0x5a5b30){logger[_0x50e4('0x12')](_0x50e4('0x13'),_0x4257e7,_0x50e4('0x14'));logger[_0x50e4('0x15')](_0x50e4('0x16'),_0x4257e7,'request\x20sent',JSON[_0x50e4('0x17')](_0x5a5b30));if(_0x5a5b30[_0x50e4('0x18')]){if(_0x5a5b30['error']['code']===0x1f4){logger[_0x50e4('0x18')](_0x50e4('0x13'),_0x4257e7,_0x5a5b30[_0x50e4('0x18')][_0x50e4('0x19')]);return _0x22c060(_0x5a5b30[_0x50e4('0x18')]['message']);}logger['error'](_0x50e4('0x13'),_0x4257e7,_0x5a5b30['error'][_0x50e4('0x19')]);return _0x385691(_0x5a5b30[_0x50e4('0x18')]['message']);}else{logger['info'](_0x50e4('0x13'),_0x4257e7,_0x50e4('0x14'));_0x385691(_0x5a5b30[_0x50e4('0x1a')][_0x50e4('0x19')]);}})['catch'](function(_0x1ffa7d){logger['error']('WhatsappInteraction,\x20%s,\x20%s',_0x4257e7,_0x1ffa7d);_0x22c060(_0x1ffa7d);});});}exports[_0x50e4('0x1b')]=function(_0x551131){var _0x1521a9=this;return new Promise(function(_0x1b039f,_0x49ff9e){return db[_0x50e4('0x1c')][_0x50e4('0x1d')](_0x551131['body'],{'raw':_0x551131[_0x50e4('0x1e')]?_0x551131[_0x50e4('0x1e')][_0x50e4('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551131[_0x50e4('0x1e')]?_0x551131[_0x50e4('0x1e')]['where']||null:null,'attributes':_0x551131[_0x50e4('0x1e')]?_0x551131[_0x50e4('0x1e')][_0x50e4('0x20')]||null:null,'limit':_0x551131[_0x50e4('0x1e')]?_0x551131['options']['limit']||null:null})[_0x50e4('0x11')](function(_0x53450c){logger['info'](_0x50e4('0x1b'),_0x551131);logger[_0x50e4('0x15')](_0x50e4('0x1b'),_0x551131,JSON['stringify'](_0x53450c));_0x1b039f(_0x53450c);})[_0x50e4('0x21')](function(_0xdc2bf){logger['error'](_0x50e4('0x1b'),_0xdc2bf['message'],_0x551131);_0x49ff9e(_0x1521a9[_0x50e4('0x18')](0x1f4,_0xdc2bf[_0x50e4('0x19')]));});});};exports[_0x50e4('0x22')]=function(_0x5a3871){return new Promise(function(_0x36e52f,_0x331905){return db[_0x50e4('0x1c')][_0x50e4('0x23')]({'where':_0x5a3871['options']?_0x5a3871[_0x50e4('0x1e')][_0x50e4('0x24')]||null:null})['then'](function(_0x1b382a){if(_0x1b382a){return _0x1b382a['addTags'](_0x5a3871['body'][_0x50e4('0x25')],_['omit'](_0x5a3871[_0x50e4('0x26')],[_0x50e4('0x25'),'id'])||{});}})[_0x50e4('0x27')](function(_0x33a311){logger[_0x50e4('0x12')](_0x50e4('0x28'),_0x5a3871);logger[_0x50e4('0x15')]('AddTags',_0x5a3871,JSON[_0x50e4('0x17')](_0x33a311));_0x36e52f(_0x33a311);})[_0x50e4('0x21')](function(_0x546c5d){logger[_0x50e4('0x18')]('AddTags',_0x546c5d['message'],_0x5a3871);_0x331905(_this[_0x50e4('0x18')](0x1f4,_0x546c5d[_0x50e4('0x19')]));});});}; \ No newline at end of file +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 diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 187d1e2..f1f4211 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 _0x6a17=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update'];(function(_0x5a95d6,_0x3613d5){var _0x52db91=function(_0x5a1546){while(--_0x5a1546){_0x5a95d6['push'](_0x5a95d6['shift']());}};_0x52db91(++_0x3613d5);}(_0x6a17,0x1a0));var _0x76a1=function(_0xfe675d,_0xe15b08){_0xfe675d=_0xfe675d-0x0;var _0x434174=_0x6a17[_0xfe675d];return _0x434174;};'use strict';var WhatsappInteractionEvents=require(_0x76a1('0x0'));var events=[_0x76a1('0x1'),_0x76a1('0x2'),_0x76a1('0x3')];function createListener(_0x105480,_0x31c5c8){return function(_0x4adbf9){_0x31c5c8['emit'](_0x105480,_0x4adbf9);};}function removeListener(_0x2f1d66,_0x49b95c){return function(){WhatsappInteractionEvents['removeListener'](_0x2f1d66,_0x49b95c);};}exports[_0x76a1('0x4')]=function(_0x2a082a){for(var _0x415aee=0x0,_0x20d44c=events[_0x76a1('0x5')];_0x415aee<_0x20d44c;_0x415aee++){var _0x300267=events[_0x415aee];var _0x18e421=createListener(_0x76a1('0x6')+_0x300267,_0x2a082a);WhatsappInteractionEvents['on'](_0x300267,_0x18e421);}}; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 1f65531..c11e5e7 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 _0x7856=['/:id','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','update','put','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','get','isAuthenticated','/describe'];(function(_0x1d99eb,_0x17c88a){var _0x29336c=function(_0x480a5b){while(--_0x480a5b){_0x1d99eb['push'](_0x1d99eb['shift']());}};_0x29336c(++_0x17c88a);}(_0x7856,0x152));var _0x6785=function(_0x169909,_0x1b06ec){_0x169909=_0x169909-0x0;var _0x28470e=_0x7856[_0x169909];return _0x28470e;};'use strict';var multer=require(_0x6785('0x0'));var util=require(_0x6785('0x1'));var path=require(_0x6785('0x2'));var timeout=require(_0x6785('0x3'));var express=require(_0x6785('0x4'));var router=express[_0x6785('0x5')]();var fs_extra=require(_0x6785('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6785('0x7'));var config=require(_0x6785('0x8'));var controller=require(_0x6785('0x9'));router[_0x6785('0xa')]('/',auth[_0x6785('0xb')](),controller['index']);router[_0x6785('0xa')](_0x6785('0xc'),auth[_0x6785('0xb')](),controller['describe']);router[_0x6785('0xa')](_0x6785('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x6785('0xe')]('/',auth['isAuthenticated'](),interaction[_0x6785('0xf')](_0x6785('0x10'),_0x6785('0x11')),controller[_0x6785('0x12')]);router[_0x6785('0xe')](_0x6785('0x13'),controller[_0x6785('0x14')]);router['put'](_0x6785('0xd'),auth['isAuthenticated'](),controller[_0x6785('0x15')]);router[_0x6785('0x16')]('/:id/accept',auth[_0x6785('0xb')](),controller['accept']);router[_0x6785('0x16')](_0x6785('0x17'),auth['isAuthenticated'](),controller[_0x6785('0x18')]);router[_0x6785('0x19')](_0x6785('0xd'),auth[_0x6785('0xb')](),controller[_0x6785('0x1a')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index efe4933..2308a4a 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 _0x4067=['sequelize','exports','TEXT','medium','ENUM','STRING','DATE','BOOLEAN'];(function(_0xb42507,_0x50d08b){var _0x407177=function(_0x52ec36){while(--_0x52ec36){_0xb42507['push'](_0xb42507['shift']());}};_0x407177(++_0x50d08b);}(_0x4067,0x110));var _0x7406=function(_0x590641,_0x271cf9){_0x590641=_0x590641-0x0;var _0x4e31fd=_0x4067[_0x590641];return _0x4e31fd;};'use strict';var Sequelize=require(_0x7406('0x0'));module[_0x7406('0x1')]={'body':{'type':Sequelize[_0x7406('0x2')](_0x7406('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7406('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x7406('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7406('0x5')]},'readAt':{'type':Sequelize[_0x7406('0x6')]},'secret':{'type':Sequelize[_0x7406('0x7')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7406('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 48518e2..5122ba2 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 _0x1eff=['filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','include','findAll','show','create','update','body','find','params','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','WhatsappInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','agent','email','internal','interface','SIP/%s','channel','motionChannel','EventManager','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','Sequelize','fullname','event','rejectmessage','WhatsappAccountId','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','type','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../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','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xe3ba5b,_0x22bacc){var _0x50b6b4=function(_0x290de9){while(--_0x290de9){_0xe3ba5b['push'](_0xe3ba5b['shift']());}};_0x50b6b4(++_0x22bacc);}(_0x1eff,0xc9));var _0xf1ef=function(_0x532e50,_0x53bf90){_0x532e50=_0x532e50-0x0;var _0x5f346a=_0x1eff[_0x532e50];return _0x5f346a;};'use strict';var emlformat=require(_0xf1ef('0x0'));var rimraf=require(_0xf1ef('0x1'));var zipdir=require(_0xf1ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1ef('0x3'));var moment=require('moment');var BPromise=require(_0xf1ef('0x4'));var Mustache=require('mustache');var util=require(_0xf1ef('0x5'));var path=require(_0xf1ef('0x6'));var sox=require(_0xf1ef('0x7'));var csv=require('to-csv');var ejs=require(_0xf1ef('0x8'));var fs=require('fs');var fs_extra=require(_0xf1ef('0x9'));var _=require('lodash');var squel=require(_0xf1ef('0xa'));var crypto=require('crypto');var jsforce=require(_0xf1ef('0xb'));var deskjs=require(_0xf1ef('0xc'));var toCsv=require(_0xf1ef('0xd'));var querystring=require(_0xf1ef('0xe'));var Papa=require(_0xf1ef('0xf'));var Redis=require(_0xf1ef('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf1ef('0x11'));var hardwareService=require(_0xf1ef('0x12'));var logger=require(_0xf1ef('0x13'))(_0xf1ef('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1ef('0x15'));var db=require(_0xf1ef('0x16'))['db'];config[_0xf1ef('0x17')]=_['defaults'](config[_0xf1ef('0x17')],{'host':_0xf1ef('0x18'),'port':0x18eb});var socket=require(_0xf1ef('0x19'))(new Redis(config[_0xf1ef('0x17')]));require(_0xf1ef('0x1a'))[_0xf1ef('0x1b')](socket);var jayson=require(_0xf1ef('0x1c'));var client=jayson[_0xf1ef('0x1d')][_0xf1ef('0x1e')]({'port':0x232c});var client9002=jayson[_0xf1ef('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5311b1,_0x143de4,_0x134d50,_0x2272b8){return new BPromise(function(_0x5859e5,_0x59c583){var _0x43b1d6=_0x2272b8||client;return _0x43b1d6[_0xf1ef('0x1f')](_0x5311b1,_0x134d50)[_0xf1ef('0x20')](function(_0x180066){logger[_0xf1ef('0x21')](_0xf1ef('0x22'),_0x143de4,_0xf1ef('0x23'));logger['debug'](_0xf1ef('0x24'),_0x143de4,_0xf1ef('0x23'),JSON[_0xf1ef('0x25')](_0x180066));if(_0x180066[_0xf1ef('0x26')]){if(_0x180066[_0xf1ef('0x26')]['code']===0x1f4){logger[_0xf1ef('0x26')](_0xf1ef('0x22'),_0x143de4,_0x180066[_0xf1ef('0x26')]['message']);return _0x59c583(_0x180066[_0xf1ef('0x26')][_0xf1ef('0x27')]);}logger[_0xf1ef('0x26')](_0xf1ef('0x22'),_0x143de4,_0x180066[_0xf1ef('0x26')][_0xf1ef('0x27')]);return _0x5859e5(_0x180066[_0xf1ef('0x26')]['message']);}else{logger['info'](_0xf1ef('0x22'),_0x143de4,_0xf1ef('0x23'));_0x5859e5(_0x180066['result'][_0xf1ef('0x27')]);}})[_0xf1ef('0x28')](function(_0x585853){logger['error'](_0xf1ef('0x22'),_0x143de4,_0x585853);_0x59c583(_0x585853);});});}function respondWithStatusCode(_0x49dbeb,_0x253659){_0x253659=_0x253659||0xcc;return function(_0x353303){if(_0x353303){return _0x49dbeb[_0xf1ef('0x29')](_0x253659);}return _0x49dbeb['status'](_0x253659)[_0xf1ef('0x2a')]();};}function respondWithResult(_0x54231f,_0x181142){_0x181142=_0x181142||0xc8;return function(_0x5e97ca){if(_0x5e97ca){return _0x54231f['status'](_0x181142)[_0xf1ef('0x2b')](_0x5e97ca);}};}function respondWithFilteredResult(_0x4b31b8,_0x3bfe5d){return function(_0x4bca7f){if(_0x4bca7f){var _0x2f7319=typeof _0x3bfe5d[_0xf1ef('0x2c')]==='undefined'&&typeof _0x3bfe5d[_0xf1ef('0x2d')]===_0xf1ef('0x2e');var _0x17b132=_0x4bca7f[_0xf1ef('0x2f')];var _0x1b583e=_0x2f7319?0x0:_0x3bfe5d[_0xf1ef('0x2c')];var _0x12348d=_0x2f7319?_0x4bca7f[_0xf1ef('0x2f')]:_0x3bfe5d[_0xf1ef('0x2c')]+_0x3bfe5d[_0xf1ef('0x2d')];var _0x1a7bff;if(_0x12348d>=_0x17b132){_0x12348d=_0x17b132;_0x1a7bff=0xc8;}else{_0x1a7bff=0xce;}_0x4b31b8[_0xf1ef('0x30')](_0x1a7bff);return _0x4b31b8['set'](_0xf1ef('0x31'),_0x1b583e+'-'+_0x12348d+'/'+_0x17b132)[_0xf1ef('0x2b')](_0x4bca7f);}return null;};}function patchUpdates(_0x12af37){return function(_0x19008a){try{jsonpatch[_0xf1ef('0x32')](_0x19008a,_0x12af37,!![]);}catch(_0x329629){return BPromise[_0xf1ef('0x33')](_0x329629);}return _0x19008a[_0xf1ef('0x34')]();};}function saveUpdates(_0x5a4b3c,_0x675997){return function(_0x208684){if(_0x208684){return _0x208684['update'](_0x5a4b3c)['then'](function(_0x4f1478){return _0x4f1478;});}return null;};}function removeEntity(_0x43fd6f,_0x1df70e){return function(_0x324940){if(_0x324940){return _0x324940[_0xf1ef('0x35')]()[_0xf1ef('0x20')](function(){_0x43fd6f[_0xf1ef('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ce194,_0x4e103b){return function(_0x10690e){if(!_0x10690e){_0x1ce194['sendStatus'](0x194);}return _0x10690e;};}function handleError(_0x2e4bc3,_0x3e3a74){_0x3e3a74=_0x3e3a74||0x1f4;return function(_0x361132){logger[_0xf1ef('0x26')](_0x361132[_0xf1ef('0x36')]);if(_0x361132['name']){delete _0x361132[_0xf1ef('0x37')];}_0x2e4bc3['status'](_0x3e3a74)[_0xf1ef('0x38')](_0x361132);};}exports[_0xf1ef('0x39')]=function(_0x19f7f5,_0x17d4e3){var _0x5e52f6={},_0x24dd54={},_0x144116={'count':0x0,'rows':[]};var _0x592910=_[_0xf1ef('0x3a')](db['WhatsappMessage'][_0xf1ef('0x3b')],function(_0x328ba3){return{'name':_0x328ba3[_0xf1ef('0x3c')],'type':_0x328ba3['type']['key']};});_0x24dd54[_0xf1ef('0x3d')]=_[_0xf1ef('0x3a')](_0x592910,'name');_0x24dd54[_0xf1ef('0x3e')]=_[_0xf1ef('0x3f')](_0x19f7f5[_0xf1ef('0x3e')]);_0x24dd54[_0xf1ef('0x40')]=_['intersection'](_0x24dd54[_0xf1ef('0x3d')],_0x24dd54['query']);_0x5e52f6[_0xf1ef('0x41')]=_[_0xf1ef('0x42')](_0x24dd54[_0xf1ef('0x3d')],qs['fields'](_0x19f7f5[_0xf1ef('0x3e')][_0xf1ef('0x43')]));_0x5e52f6[_0xf1ef('0x41')]=_0x5e52f6[_0xf1ef('0x41')][_0xf1ef('0x44')]?_0x5e52f6[_0xf1ef('0x41')]:_0x24dd54['model'];if(!_0x19f7f5[_0xf1ef('0x3e')][_0xf1ef('0x45')](_0xf1ef('0x46'))){_0x5e52f6[_0xf1ef('0x2d')]=qs[_0xf1ef('0x2d')](_0x19f7f5[_0xf1ef('0x3e')][_0xf1ef('0x2d')]);_0x5e52f6[_0xf1ef('0x2c')]=qs[_0xf1ef('0x2c')](_0x19f7f5['query'][_0xf1ef('0x2c')]);}_0x5e52f6[_0xf1ef('0x47')]=qs[_0xf1ef('0x48')](_0x19f7f5[_0xf1ef('0x3e')]['sort']);_0x5e52f6[_0xf1ef('0x49')]=qs['filters'](_[_0xf1ef('0x4a')](_0x19f7f5['query'],_0x24dd54[_0xf1ef('0x40')]),_0x592910);if(_0x19f7f5['query'][_0xf1ef('0x4b')]){_0x5e52f6[_0xf1ef('0x49')]=_[_0xf1ef('0x4c')](_0x5e52f6[_0xf1ef('0x49')],{'$or':_[_0xf1ef('0x3a')](_0x592910,function(_0x41a01b){if(_0x41a01b['type']!==_0xf1ef('0x4d')){var _0x31098d={};_0x31098d[_0x41a01b[_0xf1ef('0x37')]]={'$like':'%'+_0x19f7f5[_0xf1ef('0x3e')][_0xf1ef('0x4b')]+'%'};return _0x31098d;}})});}_0x5e52f6=_[_0xf1ef('0x4c')]({},_0x5e52f6,_0x19f7f5[_0xf1ef('0x4e')]);var _0x3e4d82={'where':_0x5e52f6[_0xf1ef('0x49')]};return db[_0xf1ef('0x4f')][_0xf1ef('0x2f')](_0x3e4d82)[_0xf1ef('0x20')](function(_0x1ae6a4){_0x144116[_0xf1ef('0x2f')]=_0x1ae6a4;if(_0x19f7f5[_0xf1ef('0x3e')][_0xf1ef('0x50')]){_0x5e52f6[_0xf1ef('0x51')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xf1ef('0x52')](_0x5e52f6);})[_0xf1ef('0x20')](function(_0x462a3e){_0x144116['rows']=_0x462a3e;return _0x144116;})[_0xf1ef('0x20')](respondWithFilteredResult(_0x17d4e3,_0x5e52f6))[_0xf1ef('0x28')](handleError(_0x17d4e3,null));};exports[_0xf1ef('0x53')]=function(_0x561b03,_0x303865){var _0x359c70={'raw':!![],'where':{'id':_0x561b03['params']['id']}},_0x13f3bd={};_0x13f3bd[_0xf1ef('0x3d')]=_[_0xf1ef('0x3f')](db[_0xf1ef('0x4f')]['rawAttributes']);_0x13f3bd['query']=_[_0xf1ef('0x3f')](_0x561b03['query']);_0x13f3bd[_0xf1ef('0x40')]=_['intersection'](_0x13f3bd[_0xf1ef('0x3d')],_0x13f3bd[_0xf1ef('0x3e')]);_0x359c70['attributes']=_[_0xf1ef('0x42')](_0x13f3bd[_0xf1ef('0x3d')],qs[_0xf1ef('0x43')](_0x561b03[_0xf1ef('0x3e')]['fields']));_0x359c70[_0xf1ef('0x41')]=_0x359c70[_0xf1ef('0x41')][_0xf1ef('0x44')]?_0x359c70['attributes']:_0x13f3bd['model'];if(_0x561b03['query'][_0xf1ef('0x50')]){_0x359c70['include']=[{'all':!![]}];}_0x359c70=_[_0xf1ef('0x4c')]({},_0x359c70,_0x561b03[_0xf1ef('0x4e')]);return db[_0xf1ef('0x4f')]['find'](_0x359c70)[_0xf1ef('0x20')](handleEntityNotFound(_0x303865,null))[_0xf1ef('0x20')](respondWithResult(_0x303865,null))[_0xf1ef('0x28')](handleError(_0x303865,null));};exports['create']=function(_0x1d0eff,_0x3b3e36){return db[_0xf1ef('0x4f')][_0xf1ef('0x54')](_0x1d0eff['body'],{})[_0xf1ef('0x20')](respondWithResult(_0x3b3e36,0xc9))[_0xf1ef('0x28')](handleError(_0x3b3e36,null));};exports[_0xf1ef('0x55')]=function(_0x56d9cb,_0x35facc){if(_0x56d9cb[_0xf1ef('0x56')]['id']){delete _0x56d9cb[_0xf1ef('0x56')]['id'];}return db['WhatsappMessage'][_0xf1ef('0x57')]({'where':{'id':_0x56d9cb[_0xf1ef('0x58')]['id']}})['then'](handleEntityNotFound(_0x35facc,null))[_0xf1ef('0x20')](saveUpdates(_0x56d9cb[_0xf1ef('0x56')],null))[_0xf1ef('0x20')](respondWithResult(_0x35facc,null))[_0xf1ef('0x28')](handleError(_0x35facc,null));};exports[_0xf1ef('0x35')]=function(_0x385aec,_0x2c3ca7){return db[_0xf1ef('0x4f')][_0xf1ef('0x57')]({'where':{'id':_0x385aec[_0xf1ef('0x58')]['id']}})[_0xf1ef('0x20')](handleEntityNotFound(_0x2c3ca7,null))[_0xf1ef('0x20')](removeEntity(_0x2c3ca7,null))[_0xf1ef('0x28')](handleError(_0x2c3ca7,null));};exports['describe']=function(_0x2d2423,_0x224675){return db[_0xf1ef('0x4f')]['describe']()[_0xf1ef('0x20')](respondWithResult(_0x224675,null))[_0xf1ef('0x28')](handleError(_0x224675,null));};var interaction_log=require(_0xf1ef('0x13'))(_0xf1ef('0x59'));exports[_0xf1ef('0x5a')]=function(_0x42ac88,_0x13a345,_0x322e16){var _0x429c93={'agent':{},'channel':_0xf1ef('0x5b')};if(_0x42ac88['body']['id']){delete _0x42ac88[_0xf1ef('0x56')]['id'];}_0x42ac88[_0xf1ef('0x56')][_0xf1ef('0x5c')]=!![];_0x42ac88[_0xf1ef('0x56')][_0xf1ef('0x5d')]=moment()[_0xf1ef('0x5e')](_0xf1ef('0x5f'));_0x42ac88[_0xf1ef('0x56')][_0xf1ef('0x60')]=_0x42ac88[_0xf1ef('0x56')][_0xf1ef('0x60')]||_0x42ac88[_0xf1ef('0x61')]['id'];_0x429c93['agent']['id']=_0x42ac88[_0xf1ef('0x56')][_0xf1ef('0x60')];return db[_0xf1ef('0x4f')][_0xf1ef('0x57')]({'where':{'id':_0x42ac88[_0xf1ef('0x58')]['id'],'UserId':null}})[_0xf1ef('0x20')](handleEntityNotFound(_0x13a345,null))[_0xf1ef('0x20')](saveUpdates(_0x42ac88[_0xf1ef('0x56')],null))[_0xf1ef('0x20')](function(_0x3c9f6e){if(_0x3c9f6e){_0x429c93[_0xf1ef('0x27')]=_0x3c9f6e[_0xf1ef('0x62')]({'plain':!![]});return db['WhatsappInteraction'][_0xf1ef('0x57')]({'where':{'id':_0x3c9f6e[_0xf1ef('0x63')]}});}return null;})[_0xf1ef('0x20')](handleEntityNotFound(_0x13a345,null))[_0xf1ef('0x20')](function(_0x38340a){if(_0x38340a){return _0x38340a[_0xf1ef('0x55')]({'UserId':_0x42ac88[_0xf1ef('0x56')]['UserId'],'read1stAt':_[_0xf1ef('0x64')](_0x38340a[_0xf1ef('0x65')])?moment()[_0xf1ef('0x5e')](_0xf1ef('0x5f')):undefined});}return null;})[_0xf1ef('0x20')](function(_0x5a469b){if(_0x5a469b){_0x429c93[_0xf1ef('0x66')]=_0x5a469b[_0xf1ef('0x62')]({'plain':!![]});interaction_log[_0xf1ef('0x21')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42ac88[_0xf1ef('0x61')]['id'],_0x42ac88[_0xf1ef('0x61')][_0xf1ef('0x37')],_0x42ac88['user']['role'],_0x429c93['interaction']['id'],_0x42ac88['body']?JSON['stringify'](_0x42ac88[_0xf1ef('0x56')]):_0xf1ef('0x67'));return respondWithRpcPromise(_0xf1ef('0x68'),_0xf1ef('0x69'),_0x429c93);}return null;})['then'](function(_0x5cd5e4){var _0x29c900=_0xf1ef('0x6a')+_0x5cd5e4['message'][_0xf1ef('0x6b')];return db[_0xf1ef('0x6c')][_0xf1ef('0x3e')](_0x29c900,{'type':db['Sequelize'][_0xf1ef('0x6d')][_0xf1ef('0x6e')],'raw':!![]})[_0xf1ef('0x20')](function(_0x450ca9){return _0x450ca9;});})[_0xf1ef('0x20')](function(_0x5bed89){if(_0x5bed89){_0x429c93[_0xf1ef('0x27')][_0xf1ef('0x6f')]=_0x5bed89[0x0];if(!_0x42ac88['body']['UserId'])return;return db[_0xf1ef('0x70')][_0xf1ef('0x57')]({'where':{'id':_0x42ac88[_0xf1ef('0x56')][_0xf1ef('0x60')],'role':_0xf1ef('0x71')},'attributes':['id',_0xf1ef('0x37'),'fullname',_0xf1ef('0x72'),_0xf1ef('0x73')],'raw':!![]});}return null;})[_0xf1ef('0x20')](function(_0x3694f0){if(!_0x3694f0)return null;_0x429c93[_0xf1ef('0x27')][_0xf1ef('0x71')]=_0x3694f0;return _0x429c93;})[_0xf1ef('0x20')](function(_0x51a670){if(_0x51a670){if(_0x42ac88['body']['manual']){_0x429c93[_0xf1ef('0x27')][_0xf1ef('0x74')]=util[_0xf1ef('0x5e')](_0xf1ef('0x75'),_0x42ac88[_0xf1ef('0x61')]['name']);_0x429c93['message']['channel']=_0x429c93[_0xf1ef('0x76')];_0x429c93[_0xf1ef('0x27')][_0xf1ef('0x77')]=_0x429c93['channel'];_0x429c93['message']['event']=_0xf1ef('0x5a');return respondWithRpcPromise('EventManager',_0xf1ef('0x78'),{'event':'acceptmessage','message':_0x429c93[_0xf1ef('0x27')]},client9002)[_0xf1ef('0x20')](function(){return _0x429c93;});}return _0x429c93;}return null;})[_0xf1ef('0x20')](respondWithResult(_0x13a345,null))[_0xf1ef('0x28')](handleError(_0x13a345,null));};var interaction_log=require(_0xf1ef('0x13'))('whatsapp-interactions');exports[_0xf1ef('0x33')]=function(_0x4156d6,_0x3fb061,_0x85dcf2){var _0x2d3389={'agent':{},'channel':_0xf1ef('0x5b')};if(_0x4156d6['body']['id']){delete _0x4156d6[_0xf1ef('0x56')]['id'];}_0x4156d6[_0xf1ef('0x56')][_0xf1ef('0x60')]=_0x4156d6[_0xf1ef('0x56')][_0xf1ef('0x60')]||_0x4156d6['user']['id'];_0x2d3389[_0xf1ef('0x71')]['id']=_0x4156d6[_0xf1ef('0x56')][_0xf1ef('0x60')];return db[_0xf1ef('0x4f')][_0xf1ef('0x57')]({'where':{'id':_0x4156d6[_0xf1ef('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3fb061,null))[_0xf1ef('0x20')](function(_0x31e54f){if(_0x31e54f){_0x2d3389[_0xf1ef('0x27')]=_0x31e54f[_0xf1ef('0x62')]({'plain':!![]});return db[_0xf1ef('0x79')][_0xf1ef('0x57')]({'where':{'id':_0x31e54f[_0xf1ef('0x63')]}});}return null;})[_0xf1ef('0x20')](handleEntityNotFound(_0x3fb061,null))['then'](function(_0x2fac1c){if(_0x2fac1c){_0x2d3389[_0xf1ef('0x66')]=_0x2fac1c['get']({'plain':!![]});interaction_log[_0xf1ef('0x21')](_0xf1ef('0x7a'),_0x4156d6['user']['id'],_0x4156d6[_0xf1ef('0x61')][_0xf1ef('0x37')],_0x4156d6[_0xf1ef('0x61')][_0xf1ef('0x7b')],_0x2d3389[_0xf1ef('0x66')]['id'],_0x4156d6[_0xf1ef('0x56')]?JSON['stringify'](_0x4156d6[_0xf1ef('0x56')]):_0xf1ef('0x67'));return respondWithRpcPromise('RejectMessage',_0xf1ef('0x7c'),_0x2d3389);}return null;})['then'](function(_0x101d40){var _0x12b383=_0xf1ef('0x6a')+_0x101d40['message'][_0xf1ef('0x6b')];return db['sequelize']['query'](_0x12b383,{'type':db[_0xf1ef('0x7d')][_0xf1ef('0x6d')]['SELECT'],'raw':!![]})[_0xf1ef('0x20')](function(_0x21505a){return _0x21505a;});})[_0xf1ef('0x20')](function(_0x2a76f4){if(_0x2a76f4){_0x2d3389[_0xf1ef('0x27')][_0xf1ef('0x6f')]=_0x2a76f4[0x0];if(!_0x4156d6[_0xf1ef('0x56')][_0xf1ef('0x60')])return;return db[_0xf1ef('0x70')]['find']({'where':{'id':_0x4156d6['body'][_0xf1ef('0x60')],'role':_0xf1ef('0x71')},'attributes':['id',_0xf1ef('0x37'),_0xf1ef('0x7e'),_0xf1ef('0x72'),'internal'],'raw':!![]});}return null;})[_0xf1ef('0x20')](function(_0x2610b8){if(!_0x2610b8)return null;_0x2d3389[_0xf1ef('0x27')][_0xf1ef('0x71')]=_0x2610b8;return _0x2d3389;})[_0xf1ef('0x20')](function(_0x37f67e){if(_0x37f67e){_0x37f67e[_0xf1ef('0x27')][_0xf1ef('0x74')]=util[_0xf1ef('0x5e')]('SIP/%s',_0x4156d6[_0xf1ef('0x61')][_0xf1ef('0x37')]);_0x37f67e[_0xf1ef('0x27')][_0xf1ef('0x76')]=_0x2d3389[_0xf1ef('0x76')];_0x37f67e[_0xf1ef('0x27')][_0xf1ef('0x77')]=_0x2d3389[_0xf1ef('0x76')];_0x37f67e['message'][_0xf1ef('0x7f')]=_0xf1ef('0x33');respondWithRpcPromise('EventManager',_0xf1ef('0x78'),{'event':_0xf1ef('0x80'),'message':_0x37f67e[_0xf1ef('0x27')]},client9002);return _0x2d3389;}return null;})[_0xf1ef('0x20')](respondWithResult(_0x3fb061,null))[_0xf1ef('0x28')](handleError(_0x3fb061,null));};exports[_0xf1ef('0x30')]=function(_0x337daa,_0x355719,_0xd4119c){if(_0x337daa[_0xf1ef('0x56')]['id']){delete _0x337daa[_0xf1ef('0x56')]['id'];}var _0x46af53;return db[_0xf1ef('0x4f')][_0xf1ef('0x57')]({'where':{'id':_0x337daa[_0xf1ef('0x58')]['id']}})[_0xf1ef('0x20')](handleEntityNotFound(_0x355719,null))[_0xf1ef('0x20')](function(_0x3b5342){if(_0x3b5342){_0x46af53=_0x3b5342;return db['WhatsappAccount'][_0xf1ef('0x57')]({'where':{'id':_0x3b5342[_0xf1ef('0x81')]}});}})[_0xf1ef('0x20')](handleEntityNotFound(_0x355719,null))[_0xf1ef('0x20')](function(_0x385cf0){if(_0x385cf0){logger[_0xf1ef('0x82')](_0xf1ef('0x83'),_0xf1ef('0x30'),'received\x20delivery\x20report\x20from',_0x385cf0[_0xf1ef('0x84')],util['inspect'](_0x337daa[_0xf1ef('0x56')],{'showHidden':![],'depth':null}));switch(_0x385cf0[_0xf1ef('0x84')]){case _0xf1ef('0x85'):if(_0x337daa['body']['MessageSid']&&_0x337daa[_0xf1ef('0x56')]['MessageSid']===_0x46af53[_0xf1ef('0x86')]&&_0x337daa[_0xf1ef('0x56')][_0xf1ef('0x87')]&&_0x337daa['body'][_0xf1ef('0x87')]===_0xf1ef('0x5c')){return _0x46af53[_0xf1ef('0x55')]({'read':!![]});}else{logger['error'](_0xf1ef('0x88'),_0xf1ef('0x30'),_0xf1ef('0x85'),util[_0xf1ef('0x89')](_0x337daa[_0xf1ef('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x46af53;}})['then'](respondWithResult(_0x355719,null))['catch'](handleError(_0x355719,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index fd36c30..78b747c 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 _0x4b0f=['exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x4b0f,0xa3));var _0xf4b0=function(_0x5774af,_0x411c94){_0x5774af=_0x5774af-0x0;var _0x480589=_0x4b0f[_0x5774af];return _0x480589;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xf4b0('0x0'))['db'][_0xf4b0('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf4b0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf4b0('0x3'),'afterDestroy':_0xf4b0('0x4')};function emitEvent(_0x141c87){return function(_0x28be5f,_0x2a08dc,_0x354cb3){WhatsappMessageEvents[_0xf4b0('0x5')](_0x141c87+':'+_0x28be5f['id'],_0x28be5f);WhatsappMessageEvents[_0xf4b0('0x5')](_0x141c87,_0x28be5f);_0x354cb3(null);};}for(var e in events){if(events[_0xf4b0('0x6')](e)){var event=events[e];WhatsappMessage[_0xf4b0('0x7')](e,emitEvent(event));}}module[_0xf4b0('0x8')]=WhatsappMessageEvents; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index 2206d9b..7680cc0 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 _0xed21=['UserId','WhatsappInteraction','findOne','WhatsappInteractionId','createdAt','catch','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','phone','accountSid','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0xed21,0x166));var _0x1ed2=function(_0xf46a82,_0x7002d6){_0xf46a82=_0xf46a82-0x0;var _0x5befba=_0xed21[_0xf46a82];return _0x5befba;};'use strict';var _=require('lodash');var util=require(_0x1ed2('0x0'));var logger=require(_0x1ed2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1ed2('0x2'));var rp=require(_0x1ed2('0x3'));var fetch=require(_0x1ed2('0x4'));var fs=require('fs');var path=require(_0x1ed2('0x5'));var rimraf=require('rimraf');var config=require(_0x1ed2('0x6'));var attributes=require(_0x1ed2('0x7'));module['exports']=function(_0x446f14,_0x11c47e){return _0x446f14['define'](_0x1ed2('0x8'),attributes,{'tableName':_0x1ed2('0x9'),'paranoid':![],'indexes':[{'name':_0x1ed2('0xa'),'fields':['messageId']},{'name':_0x1ed2('0xb'),'fields':[_0x1ed2('0xc')],'type':_0x1ed2('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49dba1,_0x4c324d,_0x104c78){var _0x1a36be=_0x446f14[_0x1ed2('0xe')];var _0x5e4ae9=_0x49dba1[_0x1ed2('0xf')]({'plain':!![]});if(_0x5e4ae9[_0x1ed2('0x10')][_0x1ed2('0x11')]()==='in'||_0x5e4ae9[_0x1ed2('0x10')]['toLowerCase']()===_0x1ed2('0x12')&&!_0x5e4ae9[_0x1ed2('0x13')]&&!_['isNil'](_0x5e4ae9[_0x1ed2('0x14')])){_0x1a36be[_0x1ed2('0x15')][_0x1ed2('0x16')]({'where':{'id':_0x5e4ae9[_0x1ed2('0x17')]}})['then'](function(_0x223ac3){if(_0x223ac3){_0x223ac3['update']({'lastMsgAt':_0x5e4ae9[_0x1ed2('0x18')],'lastMsgDirection':_0x5e4ae9[_0x1ed2('0x10')][_0x1ed2('0x11')]()});}})[_0x1ed2('0x19')](function(_0x447f49){console[_0x1ed2('0x1a')](_0x447f49);});}if(_0x5e4ae9[_0x1ed2('0x10')]===_0x1ed2('0x12')&&!_0x5e4ae9[_0x1ed2('0x13')]){var _0x2cf0b6;_0x1a36be[_0x1ed2('0x1b')][_0x1ed2('0x1c')]({'where':{'id':_0x5e4ae9[_0x1ed2('0x1d')]},'raw':!![]})['then'](function(_0x10c51c){_0x2cf0b6=_0x10c51c;if(_0x2cf0b6&&_0x2cf0b6[_0x1ed2('0x1e')]){switch(_0x2cf0b6[_0x1ed2('0x1e')]){case _0x1ed2('0x1f'):var _0x568eeb=require(_0x1ed2('0x1f'));if(_0x2cf0b6['accountSid']&&_0x2cf0b6['authToken']&&_0x2cf0b6[_0x1ed2('0x20')]){var _0xbf5ef8=new _0x568eeb(_0x2cf0b6[_0x1ed2('0x21')],_0x2cf0b6['authToken']);_0xbf5ef8[_0x1ed2('0x22')][_0x1ed2('0x23')]({'body':_0x5e4ae9[_0x1ed2('0xc')],'to':_0x1ed2('0x24')+_0x5e4ae9[_0x1ed2('0x20')],'from':'whatsapp:'+_0x2cf0b6[_0x1ed2('0x20')],'statusCallback':_0x2cf0b6[_0x1ed2('0x25')]+_0x1ed2('0x26')+_0x5e4ae9['id']+_0x1ed2('0x27')+_0x2cf0b6[_0x1ed2('0x28')]})[_0x1ed2('0x29')](function(_0xc130c9){if(_0xc130c9[_0x1ed2('0x2a')]){return _0x49dba1[_0x1ed2('0x2b')]({'messageId':_0xc130c9[_0x1ed2('0x2a')]});}})[_0x1ed2('0x19')](function(_0x280bf6){logger['error'](_0x1ed2('0x2c'),_0x1ed2('0x2d'),_0x1ed2('0x1f'),util[_0x1ed2('0x2e')](_0x280bf6,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1ed2('0x2c'),_0x1ed2('0x2d'),_0x1ed2('0x1f'),_0x1ed2('0x2f'));}break;case _0x1ed2('0x30'):var _0x261d54=_0x2cf0b6[_0x1ed2('0x21')];var _0x3be0b0=_0x2cf0b6['authToken'];var _0x27bf91=_0x2cf0b6[_0x1ed2('0x31')]+_0x1ed2('0x32')+_0x261d54+_0x1ed2('0x33');var _0x37c26d={'to':[_0x5e4ae9[_0x1ed2('0x20')]],'message':{'type':_0x1ed2('0x34'),'text':_0x5e4ae9[_0x1ed2('0xc')]}};var _0x11b536={'method':_0x1ed2('0x35'),'uri':_0x27bf91,'headers':{'Authorization':_0x1ed2('0x36')+_0x3be0b0,'Content-Type':_0x1ed2('0x37')},'body':_0x37c26d,'json':!![]};rp(_0x11b536)[_0x1ed2('0x29')](function(_0x1e4d1e){if(_0x1e4d1e[_0x1ed2('0x38')][0x0]['message_id']){return _0x49dba1[_0x1ed2('0x2b')]({'messageId':_0x1e4d1e[_0x1ed2('0x38')][0x0][_0x1ed2('0x39')]});}})['catch'](function(_0x24d7ce){logger[_0x1ed2('0x3a')](_0x1ed2('0x3b'),_0x24d7ce);});break;}}})[_0x1ed2('0x3c')](function(){_0x104c78();});}else{_0x104c78();}}},'charset':_0x1ed2('0x3d'),'collate':_0x1ed2('0x3e')});}; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index 3226f8a..fb42744 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 _0xe876=['CreateWhatsappMessage','WhatsappMessage','create','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','WhatsappMessage,\x20%s,\x20%s','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','catch'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe876,0x145));var _0x6e87=function(_0x67e5d4,_0x3a6f43){_0x67e5d4=_0x67e5d4-0x0;var _0x102b85=_0xe876[_0x67e5d4];return _0x102b85;};'use strict';var _=require(_0x6e87('0x0'));var util=require(_0x6e87('0x1'));var moment=require(_0x6e87('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e87('0x3'));var fs=require('fs');var Redis=require(_0x6e87('0x4'));var db=require(_0x6e87('0x5'))['db'];var utils=require(_0x6e87('0x6'));var logger=require(_0x6e87('0x7'))(_0x6e87('0x8'));var config=require(_0x6e87('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6e87('0xa')]['http']({'port':0x232a});config['redis']=_[_0x6e87('0xb')](config[_0x6e87('0xc')],{'host':_0x6e87('0xd'),'port':0x18eb});var socket=require(_0x6e87('0xe'))(new Redis(config['redis']));require(_0x6e87('0xf'))['register'](socket);function respondWithRpcPromise(_0x584c02,_0x478de5,_0x2ac537){return new BPromise(function(_0x1e0ecb,_0x35bfe2){return client[_0x6e87('0x10')](_0x584c02,_0x2ac537)[_0x6e87('0x11')](function(_0x1338ba){logger['info'](_0x6e87('0x12'),_0x478de5,'request\x20sent');logger[_0x6e87('0x13')](_0x6e87('0x14'),_0x478de5,'request\x20sent',JSON[_0x6e87('0x15')](_0x1338ba));if(_0x1338ba['error']){if(_0x1338ba['error'][_0x6e87('0x16')]===0x1f4){logger[_0x6e87('0x17')](_0x6e87('0x12'),_0x478de5,_0x1338ba[_0x6e87('0x17')]['message']);return _0x35bfe2(_0x1338ba['error'][_0x6e87('0x18')]);}logger[_0x6e87('0x17')](_0x6e87('0x12'),_0x478de5,_0x1338ba[_0x6e87('0x17')][_0x6e87('0x18')]);return _0x1e0ecb(_0x1338ba[_0x6e87('0x17')][_0x6e87('0x18')]);}else{logger[_0x6e87('0x19')](_0x6e87('0x12'),_0x478de5,'request\x20sent');_0x1e0ecb(_0x1338ba['result'][_0x6e87('0x18')]);}})[_0x6e87('0x1a')](function(_0x4bb048){logger['error'](_0x6e87('0x12'),_0x478de5,_0x4bb048);_0x35bfe2(_0x4bb048);});});}exports[_0x6e87('0x1b')]=function(_0x1d1234){var _0x3fce5f=this;return new Promise(function(_0x395c3f,_0x20de69){return db[_0x6e87('0x1c')][_0x6e87('0x1d')](_0x1d1234['body'],{'raw':_0x1d1234[_0x6e87('0x1e')]?_0x1d1234[_0x6e87('0x1e')][_0x6e87('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x176427){logger['info'](_0x6e87('0x1b'),_0x1d1234);logger[_0x6e87('0x13')]('CreateWhatsappMessage',_0x1d1234,JSON[_0x6e87('0x15')](_0x176427));_0x395c3f(_0x176427);})[_0x6e87('0x1a')](function(_0xa3c709){logger[_0x6e87('0x17')](_0x6e87('0x1b'),_0xa3c709[_0x6e87('0x18')],_0x1d1234);_0x20de69(_0x3fce5f[_0x6e87('0x17')](0x1f4,_0xa3c709[_0x6e87('0x18')]));});});}; \ No newline at end of file +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 diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 6d93cc9..3288566 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 _0xfdb7=['whatsappMessage:','./whatsappMessage.events','save','update','emit','removeListener','register','length'];(function(_0x438ca9,_0x4809b3){var _0x8912ad=function(_0x573aa8){while(--_0x573aa8){_0x438ca9['push'](_0x438ca9['shift']());}};_0x8912ad(++_0x4809b3);}(_0xfdb7,0x129));var _0x7fdb=function(_0x57d12c,_0x2becd1){_0x57d12c=_0x57d12c-0x0;var _0x1a7205=_0xfdb7[_0x57d12c];return _0x1a7205;};'use strict';var WhatsappMessageEvents=require(_0x7fdb('0x0'));var events=[_0x7fdb('0x1'),'remove',_0x7fdb('0x2')];function createListener(_0xd1865c,_0x3167b2){return function(_0x5d37d1){_0x3167b2[_0x7fdb('0x3')](_0xd1865c,_0x5d37d1);};}function removeListener(_0x2d6902,_0xbd942d){return function(){WhatsappMessageEvents[_0x7fdb('0x4')](_0x2d6902,_0xbd942d);};}exports[_0x7fdb('0x5')]=function(_0x2acff3){for(var _0x483bdb=0x0,_0x31d6bd=events[_0x7fdb('0x6')];_0x483bdb<_0x31d6bd;_0x483bdb++){var _0x5656e5=events[_0x483bdb];var _0x2e084b=createListener(_0x7fdb('0x7')+_0x5656e5,_0x2acff3);WhatsappMessageEvents['on'](_0x5656e5,_0x2e084b);}}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index f48798f..b56d4da 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 _0x35e6=['update','delete','removeTeams','removeAgents','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','describe','get','isAuthenticated','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','/:id/users','addAgents','put','/:id'];(function(_0x33029e,_0x244f63){var _0x1835ab=function(_0x149fe2){while(--_0x149fe2){_0x33029e['push'](_0x33029e['shift']());}};_0x1835ab(++_0x244f63);}(_0x35e6,0xb2));var _0x635e=function(_0xf65eff,_0x4724eb){_0xf65eff=_0xf65eff-0x0;var _0x33f806=_0x35e6[_0xf65eff];return _0x33f806;};'use strict';var multer=require(_0x635e('0x0'));var util=require('util');var path=require(_0x635e('0x1'));var timeout=require(_0x635e('0x2'));var express=require(_0x635e('0x3'));var router=express['Router']();var fs_extra=require(_0x635e('0x4'));var auth=require(_0x635e('0x5'));var interaction=require(_0x635e('0x6'));var config=require(_0x635e('0x7'));var controller=require('./whatsappQueue.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x635e('0x8')]);router['get'](_0x635e('0x9'),auth['isAuthenticated'](),controller[_0x635e('0xa')]);router[_0x635e('0xb')]('/:id',auth[_0x635e('0xc')](),controller[_0x635e('0xd')]);router[_0x635e('0xb')](_0x635e('0xe'),auth[_0x635e('0xc')](),controller[_0x635e('0xf')]);router[_0x635e('0xb')](_0x635e('0x10'),auth[_0x635e('0xc')](),controller[_0x635e('0x11')]);router[_0x635e('0xb')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x635e('0xc')](),controller[_0x635e('0x12')]);router[_0x635e('0x13')](_0x635e('0x10'),auth[_0x635e('0xc')](),controller[_0x635e('0x14')]);router[_0x635e('0x13')](_0x635e('0x15'),auth[_0x635e('0xc')](),controller[_0x635e('0x16')]);router[_0x635e('0x17')](_0x635e('0x18'),auth[_0x635e('0xc')](),controller[_0x635e('0x19')]);router[_0x635e('0x1a')](_0x635e('0x18'),auth[_0x635e('0xc')](),controller['destroy']);router[_0x635e('0x1a')](_0x635e('0x10'),auth[_0x635e('0xc')](),controller[_0x635e('0x1b')]);router['delete'](_0x635e('0x15'),auth[_0x635e('0xc')](),controller[_0x635e('0x1c')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 1fc9785..751ec60 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 _0x9b9b=['beepall','roundrobin','STRING','exports','INTEGER','ENUM','rrmemory'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x9b9b,0x114));var _0xb9b9=function(_0x232d32,_0x3ccf6d){_0x232d32=_0x232d32-0x0;var _0x163cf2=_0x9b9b[_0x232d32];return _0x163cf2;};'use strict';var Sequelize=require('sequelize');module[_0xb9b9('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xb9b9('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9b9('0x2')](_0xb9b9('0x3'),_0xb9b9('0x4'),_0xb9b9('0x5'))},'description':{'type':Sequelize[_0xb9b9('0x6')]}}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 1ea799e..cf3dbee 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 _0xb969=['clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','all','union','compact','value','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','WhatsappQueue','includeAll','findAll','catch','params','keys','length','include','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','nolimit','order','User','UserId','agent','whatsappPause','updatedAt','createdAt','rows','%s/%s','SIP','getTeams','addTeams','ids','Team','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId'];(function(_0x14a8de,_0x3cc2e8){var _0xb4c2aa=function(_0x51ab3f){while(--_0x51ab3f){_0x14a8de['push'](_0x14a8de['shift']());}};_0xb4c2aa(++_0x3cc2e8);}(_0xb969,0x138));var _0x9b96=function(_0x45f350,_0x1ade1b){_0x45f350=_0x45f350-0x0;var _0x56129f=_0xb969[_0x45f350];return _0x56129f;};'use strict';var emlformat=require(_0x9b96('0x0'));var rimraf=require(_0x9b96('0x1'));var zipdir=require(_0x9b96('0x2'));var jsonpatch=require(_0x9b96('0x3'));var rp=require(_0x9b96('0x4'));var moment=require(_0x9b96('0x5'));var BPromise=require(_0x9b96('0x6'));var Mustache=require('mustache');var util=require(_0x9b96('0x7'));var path=require('path');var sox=require(_0x9b96('0x8'));var csv=require('to-csv');var ejs=require(_0x9b96('0x9'));var fs=require('fs');var fs_extra=require(_0x9b96('0xa'));var _=require(_0x9b96('0xb'));var squel=require('squel');var crypto=require(_0x9b96('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9b96('0xd'));var toCsv=require(_0x9b96('0xe'));var querystring=require(_0x9b96('0xf'));var Papa=require(_0x9b96('0x10'));var Redis=require(_0x9b96('0x11'));var authService=require(_0x9b96('0x12'));var qs=require(_0x9b96('0x13'));var as=require(_0x9b96('0x14'));var hardwareService=require(_0x9b96('0x15'));var logger=require(_0x9b96('0x16'))(_0x9b96('0x17'));var utils=require(_0x9b96('0x18'));var config=require(_0x9b96('0x19'));var licenseUtil=require(_0x9b96('0x1a'));var db=require(_0x9b96('0x1b'))['db'];config[_0x9b96('0x1c')]=_[_0x9b96('0x1d')](config[_0x9b96('0x1c')],{'host':_0x9b96('0x1e'),'port':0x18eb});var socket=require(_0x9b96('0x1f'))(new Redis(config[_0x9b96('0x1c')]));require(_0x9b96('0x20'))[_0x9b96('0x21')](socket);function respondWithStatusCode(_0x5d15f0,_0xeaeb1){_0xeaeb1=_0xeaeb1||0xcc;return function(_0xd9dbbb){if(_0xd9dbbb){return _0x5d15f0[_0x9b96('0x22')](_0xeaeb1);}return _0x5d15f0[_0x9b96('0x23')](_0xeaeb1)[_0x9b96('0x24')]();};}function respondWithResult(_0x3ae00e,_0xeda065){_0xeda065=_0xeda065||0xc8;return function(_0x56ecba){if(_0x56ecba){return _0x3ae00e[_0x9b96('0x23')](_0xeda065)['json'](_0x56ecba);}};}function respondWithFilteredResult(_0x3b68b2,_0xa8fbf6){return function(_0x39567d){if(_0x39567d){var _0x2114fe=typeof _0xa8fbf6[_0x9b96('0x25')]===_0x9b96('0x26')&&typeof _0xa8fbf6[_0x9b96('0x27')]===_0x9b96('0x26');var _0x5c8afd=_0x39567d[_0x9b96('0x28')];var _0x5ee67e=_0x2114fe?0x0:_0xa8fbf6[_0x9b96('0x25')];var _0x4b94f1=_0x2114fe?_0x39567d[_0x9b96('0x28')]:_0xa8fbf6[_0x9b96('0x25')]+_0xa8fbf6[_0x9b96('0x27')];var _0x125f03;if(_0x4b94f1>=_0x5c8afd){_0x4b94f1=_0x5c8afd;_0x125f03=0xc8;}else{_0x125f03=0xce;}_0x3b68b2[_0x9b96('0x23')](_0x125f03);return _0x3b68b2['set'](_0x9b96('0x29'),_0x5ee67e+'-'+_0x4b94f1+'/'+_0x5c8afd)[_0x9b96('0x2a')](_0x39567d);}return null;};}function patchUpdates(_0x11787f){return function(_0x415309){try{jsonpatch[_0x9b96('0x2b')](_0x415309,_0x11787f,!![]);}catch(_0x4d05cd){return BPromise[_0x9b96('0x2c')](_0x4d05cd);}return _0x415309[_0x9b96('0x2d')]();};}function saveUpdates(_0xcfe92e,_0x2a18c2){return function(_0x1878e7){if(_0x1878e7){return _0x1878e7[_0x9b96('0x2e')](_0xcfe92e)[_0x9b96('0x2f')](function(_0x35c410){return _0x35c410;});}return null;};}function removeEntity(_0x2b7994,_0x52032f){return function(_0x22d4b2){if(_0x22d4b2){return _0x22d4b2[_0x9b96('0x30')]()['then'](function(){var _0x194c8e=_0x22d4b2[_0x9b96('0x31')]({'plain':!![]});var _0x2224ab=_0x9b96('0x32');return db[_0x9b96('0x33')][_0x9b96('0x30')]({'where':{'type':_0x2224ab,'resourceId':_0x194c8e['id']}})[_0x9b96('0x2f')](function(){return _0x22d4b2;});})[_0x9b96('0x2f')](function(){_0x2b7994[_0x9b96('0x23')](0xcc)[_0x9b96('0x24')]();});}};}function handleEntityNotFound(_0x38195d,_0x1b8006){return function(_0x4d02a6){if(!_0x4d02a6){_0x38195d[_0x9b96('0x22')](0x194);}return _0x4d02a6;};}function handleError(_0x5254e2,_0x2b3e02){_0x2b3e02=_0x2b3e02||0x1f4;return function(_0x268f09){logger[_0x9b96('0x34')](_0x268f09[_0x9b96('0x35')]);if(_0x268f09[_0x9b96('0x36')]){delete _0x268f09[_0x9b96('0x36')];}_0x5254e2['status'](_0x2b3e02)[_0x9b96('0x37')](_0x268f09);};}exports[_0x9b96('0x38')]=function(_0x16ecfc,_0xd7aa2e){var _0x26f77d={},_0x1d8da0={},_0x18772c={'count':0x0,'rows':[]};var _0x3187ef=_[_0x9b96('0x39')](db['WhatsappQueue'][_0x9b96('0x3a')],function(_0x39273f){return{'name':_0x39273f['fieldName'],'type':_0x39273f['type'][_0x9b96('0x3b')]};});_0x1d8da0['model']=_[_0x9b96('0x39')](_0x3187ef,_0x9b96('0x36'));_0x1d8da0[_0x9b96('0x3c')]=_['keys'](_0x16ecfc[_0x9b96('0x3c')]);_0x1d8da0[_0x9b96('0x3d')]=_[_0x9b96('0x3e')](_0x1d8da0[_0x9b96('0x3f')],_0x1d8da0[_0x9b96('0x3c')]);_0x26f77d['attributes']=_['intersection'](_0x1d8da0[_0x9b96('0x3f')],qs[_0x9b96('0x40')](_0x16ecfc['query'][_0x9b96('0x40')]));_0x26f77d[_0x9b96('0x41')]=_0x26f77d[_0x9b96('0x41')]['length']?_0x26f77d[_0x9b96('0x41')]:_0x1d8da0[_0x9b96('0x3f')];if(!_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x42')]('nolimit')){_0x26f77d[_0x9b96('0x27')]=qs[_0x9b96('0x27')](_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x27')]);_0x26f77d[_0x9b96('0x25')]=qs[_0x9b96('0x25')](_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x25')]);}_0x26f77d['order']=qs[_0x9b96('0x43')](_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x43')]);_0x26f77d['where']=qs[_0x9b96('0x3d')](_[_0x9b96('0x44')](_0x16ecfc[_0x9b96('0x3c')],_0x1d8da0[_0x9b96('0x3d')]),_0x3187ef);if(_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x45')]){_0x26f77d[_0x9b96('0x46')]=_[_0x9b96('0x47')](_0x26f77d[_0x9b96('0x46')],{'$or':_['map'](_0x3187ef,function(_0x399199){if(_0x399199[_0x9b96('0x48')]!==_0x9b96('0x49')){var _0x11aed6={};_0x11aed6[_0x399199['name']]={'$like':'%'+_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x45')]+'%'};return _0x11aed6;}})});}_0x26f77d=_[_0x9b96('0x47')]({},_0x26f77d,_0x16ecfc['options']);var _0x3150ae={'where':_0x26f77d[_0x9b96('0x46')]};return db[_0x9b96('0x4a')][_0x9b96('0x28')](_0x3150ae)[_0x9b96('0x2f')](function(_0x5aeb06){_0x18772c[_0x9b96('0x28')]=_0x5aeb06;if(_0x16ecfc[_0x9b96('0x3c')][_0x9b96('0x4b')]){_0x26f77d['include']=[{'all':!![]}];}return db[_0x9b96('0x4a')][_0x9b96('0x4c')](_0x26f77d);})[_0x9b96('0x2f')](function(_0x598cf4){_0x18772c['rows']=_0x598cf4;return _0x18772c;})[_0x9b96('0x2f')](respondWithFilteredResult(_0xd7aa2e,_0x26f77d))[_0x9b96('0x4d')](handleError(_0xd7aa2e,null));};exports['show']=function(_0x1d31e0,_0x3acc04){var _0x293a6f={'raw':!![],'where':{'id':_0x1d31e0[_0x9b96('0x4e')]['id']}},_0x12e186={};_0x12e186[_0x9b96('0x3f')]=_[_0x9b96('0x4f')](db[_0x9b96('0x4a')][_0x9b96('0x3a')]);_0x12e186['query']=_[_0x9b96('0x4f')](_0x1d31e0['query']);_0x12e186['filters']=_['intersection'](_0x12e186[_0x9b96('0x3f')],_0x12e186[_0x9b96('0x3c')]);_0x293a6f[_0x9b96('0x41')]=_[_0x9b96('0x3e')](_0x12e186[_0x9b96('0x3f')],qs[_0x9b96('0x40')](_0x1d31e0[_0x9b96('0x3c')][_0x9b96('0x40')]));_0x293a6f['attributes']=_0x293a6f[_0x9b96('0x41')][_0x9b96('0x50')]?_0x293a6f[_0x9b96('0x41')]:_0x12e186['model'];if(_0x1d31e0[_0x9b96('0x3c')][_0x9b96('0x4b')]){_0x293a6f[_0x9b96('0x51')]=[{'all':!![]}];}_0x293a6f=_['merge']({},_0x293a6f,_0x1d31e0[_0x9b96('0x52')]);return db['WhatsappQueue'][_0x9b96('0x53')](_0x293a6f)[_0x9b96('0x2f')](handleEntityNotFound(_0x3acc04,null))[_0x9b96('0x2f')](respondWithResult(_0x3acc04,null))[_0x9b96('0x4d')](handleError(_0x3acc04,null));};exports[_0x9b96('0x54')]=function(_0x295d20,_0x345f12){return db['WhatsappQueue'][_0x9b96('0x54')](_0x295d20[_0x9b96('0x55')],{})[_0x9b96('0x2f')](function(_0x2bbfa9){var _0x57f4fb=_0x295d20[_0x9b96('0x56')]['get']({'plain':!![]});if(!_0x57f4fb)throw new Error(_0x9b96('0x57'));if(_0x57f4fb[_0x9b96('0x58')]===_0x9b96('0x56')){var _0x321d1a=_0x2bbfa9['get']({'plain':!![]});var _0x47f7b0='WhatsappQueues';return db[_0x9b96('0x59')][_0x9b96('0x53')]({'where':{'name':_0x47f7b0,'userProfileId':_0x57f4fb[_0x9b96('0x5a')]},'raw':!![]})[_0x9b96('0x2f')](function(_0x441cf6){if(_0x441cf6&&_0x441cf6[_0x9b96('0x5b')]===0x0){return db[_0x9b96('0x33')][_0x9b96('0x54')]({'name':_0x321d1a['name'],'resourceId':_0x321d1a['id'],'type':_0x441cf6[_0x9b96('0x36')],'sectionId':_0x441cf6['id']},{})[_0x9b96('0x2f')](function(){return _0x2bbfa9;});}else{return _0x2bbfa9;}})[_0x9b96('0x4d')](function(_0x1a4fd1){logger[_0x9b96('0x34')](_0x9b96('0x5c'),_0x1a4fd1);throw _0x1a4fd1;});}return _0x2bbfa9;})[_0x9b96('0x2f')](respondWithResult(_0x345f12,0xc9))[_0x9b96('0x4d')](handleError(_0x345f12,null));};exports[_0x9b96('0x2e')]=function(_0x4d3741,_0x3d9fde){if(_0x4d3741[_0x9b96('0x55')]['id']){delete _0x4d3741['body']['id'];}return db[_0x9b96('0x4a')]['find']({'where':{'id':_0x4d3741[_0x9b96('0x4e')]['id']}})[_0x9b96('0x2f')](handleEntityNotFound(_0x3d9fde,null))['then'](saveUpdates(_0x4d3741[_0x9b96('0x55')],null))['then'](respondWithResult(_0x3d9fde,null))[_0x9b96('0x4d')](handleError(_0x3d9fde,null));};exports[_0x9b96('0x30')]=function(_0x233f2d,_0x34a4d7){return db['WhatsappQueue'][_0x9b96('0x53')]({'where':{'id':_0x233f2d['params']['id']}})[_0x9b96('0x2f')](handleEntityNotFound(_0x34a4d7,null))['then'](removeEntity(_0x34a4d7,null))[_0x9b96('0x4d')](handleError(_0x34a4d7,null));};exports[_0x9b96('0x5d')]=function(_0x28cf9b,_0x2a2fc5){return db[_0x9b96('0x4a')][_0x9b96('0x5d')]()[_0x9b96('0x2f')](respondWithResult(_0x2a2fc5,null))[_0x9b96('0x4d')](handleError(_0x2a2fc5,null));};exports[_0x9b96('0x5e')]=function(_0x33d1fa,_0x428a5e,_0x5c971f){var _0x234709={'raw':!![],'where':{}},_0x3d3c9b={},_0x9eacdd;return db['WhatsappQueue'][_0x9b96('0x5f')]({'where':{'id':_0x33d1fa[_0x9b96('0x4e')]['id']}})[_0x9b96('0x2f')](handleEntityNotFound(_0x428a5e,null))['then'](function(_0xdf6e8){if(_0xdf6e8){_0x9eacdd=_0xdf6e8[_0x9b96('0x31')]({'plain':!![]});_0x3d3c9b[_0x9b96('0x3f')]=_[_0x9b96('0x4f')](db[_0x9b96('0x60')][_0x9b96('0x3a')]);_0x3d3c9b[_0x9b96('0x3c')]=_[_0x9b96('0x4f')](_0x33d1fa[_0x9b96('0x3c')]);_0x3d3c9b['filters']=_['intersection'](_0x3d3c9b[_0x9b96('0x3f')],_0x3d3c9b[_0x9b96('0x3c')]);_0x234709[_0x9b96('0x41')]=_['intersection'](_0x3d3c9b[_0x9b96('0x3f')],qs['fields'](_0x33d1fa[_0x9b96('0x3c')][_0x9b96('0x40')]));_0x234709[_0x9b96('0x41')]=_0x234709[_0x9b96('0x41')]['length']?_0x234709[_0x9b96('0x41')]:_0x3d3c9b[_0x9b96('0x3f')];if(!_0x33d1fa[_0x9b96('0x3c')][_0x9b96('0x42')](_0x9b96('0x61'))){_0x234709['limit']=qs['limit'](_0x33d1fa['query'][_0x9b96('0x27')]);_0x234709[_0x9b96('0x25')]=qs[_0x9b96('0x25')](_0x33d1fa['query'][_0x9b96('0x25')]);}_0x234709[_0x9b96('0x62')]=qs[_0x9b96('0x43')](_0x33d1fa[_0x9b96('0x3c')][_0x9b96('0x43')]);_0x234709['where']=qs[_0x9b96('0x3d')](_[_0x9b96('0x44')](_0x33d1fa[_0x9b96('0x3c')],_0x3d3c9b[_0x9b96('0x3d')]));_0x234709['where']['WhatsappQueueId']=_0xdf6e8['id'];if(_0x33d1fa['query'][_0x9b96('0x45')]){_0x234709[_0x9b96('0x46')]=_[_0x9b96('0x47')](_0x234709['where'],{'$or':_['map'](_0x234709[_0x9b96('0x41')],function(_0x198891){var _0x5bf52e={};_0x5bf52e[_0x198891]={'$like':'%'+_0x33d1fa['query'][_0x9b96('0x45')]+'%'};return _0x5bf52e;})});}_0x234709=_['merge']({},_0x234709,_0x33d1fa[_0x9b96('0x52')]);return db[_0x9b96('0x60')][_0x9b96('0x4c')](_0x234709);}})[_0x9b96('0x2f')](function(_0x2eb637){if(_0x2eb637){return db[_0x9b96('0x63')]['findAndCountAll']({'where':{'id':_[_0x9b96('0x39')](_0x2eb637,_0x9b96('0x64')),'role':_0x9b96('0x65')},'attributes':['id',_0x9b96('0x36'),_0x9b96('0x66'),_0x9b96('0x67'),_0x9b96('0x68')]});}})[_0x9b96('0x2f')](function(_0x362694){if(_0x362694){return{'count':_0x362694[_0x9b96('0x28')],'rows':_[_0x9b96('0x39')](_0x362694[_0x9b96('0x69')],function(_0x286cf0){return{'membername':_0x286cf0[_0x9b96('0x36')],'UserId':_0x286cf0['id'],'queue_name':_0x9eacdd['name'],'WhatsappQueueId':_0x9eacdd['id'],'interface':util['format'](_0x9b96('0x6a'),_0x9b96('0x6b'),_0x286cf0[_0x9b96('0x36')]),'penalty':0x0,'paused':_0x286cf0[_0x9b96('0x66')],'createdAt':_0x286cf0['createdAt'],'updatedAt':_0x286cf0[_0x9b96('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x428a5e,_0x234709))[_0x9b96('0x4d')](handleError(_0x428a5e,null));};exports[_0x9b96('0x6c')]=function(_0x5ca375,_0x3809ab,_0x4051e6){var _0x53e034={};var _0x56714d={};var _0x48f211;var _0x5926e8;return db['WhatsappQueue']['findOne']({'where':{'id':_0x5ca375['params']['id']}})[_0x9b96('0x2f')](handleEntityNotFound(_0x3809ab,null))['then'](function(_0x56ebb2){if(_0x56ebb2){_0x48f211=_0x56ebb2;_0x56714d['model']=_[_0x9b96('0x4f')](db['Team'][_0x9b96('0x3a')]);_0x56714d['query']=_[_0x9b96('0x4f')](_0x5ca375[_0x9b96('0x3c')]);_0x56714d[_0x9b96('0x3d')]=_[_0x9b96('0x3e')](_0x56714d[_0x9b96('0x3f')],_0x56714d[_0x9b96('0x3c')]);_0x53e034['attributes']=_[_0x9b96('0x3e')](_0x56714d[_0x9b96('0x3f')],qs[_0x9b96('0x40')](_0x5ca375[_0x9b96('0x3c')][_0x9b96('0x40')]));_0x53e034[_0x9b96('0x41')]=_0x53e034[_0x9b96('0x41')]['length']?_0x53e034[_0x9b96('0x41')]:_0x56714d[_0x9b96('0x3f')];_0x53e034[_0x9b96('0x62')]=qs[_0x9b96('0x43')](_0x5ca375[_0x9b96('0x3c')][_0x9b96('0x43')]);_0x53e034[_0x9b96('0x46')]=qs['filters'](_['pick'](_0x5ca375[_0x9b96('0x3c')],_0x56714d[_0x9b96('0x3d')]));if(_0x5ca375['query'][_0x9b96('0x45')]){_0x53e034[_0x9b96('0x46')]=_[_0x9b96('0x47')](_0x53e034[_0x9b96('0x46')],{'$or':_[_0x9b96('0x39')](_0x53e034[_0x9b96('0x41')],function(_0x83b089){var _0x8c44a={};_0x8c44a[_0x83b089]={'$like':'%'+_0x5ca375['query']['filter']+'%'};return _0x8c44a;})});}_0x53e034=_['merge']({},_0x53e034,_0x5ca375[_0x9b96('0x52')]);return _0x48f211[_0x9b96('0x6c')](_0x53e034);}})[_0x9b96('0x2f')](function(_0x2e9cf6){if(_0x2e9cf6){_0x5926e8=_0x2e9cf6[_0x9b96('0x50')];if(!_0x5ca375['query'][_0x9b96('0x42')](_0x9b96('0x61'))){_0x53e034['limit']=qs[_0x9b96('0x27')](_0x5ca375[_0x9b96('0x3c')][_0x9b96('0x27')]);_0x53e034[_0x9b96('0x25')]=qs[_0x9b96('0x25')](_0x5ca375[_0x9b96('0x3c')][_0x9b96('0x25')]);}return _0x48f211[_0x9b96('0x6c')](_0x53e034);}})[_0x9b96('0x2f')](function(_0x3af228){if(_0x3af228){return _0x3af228?{'count':_0x5926e8,'rows':_0x3af228}:null;}})[_0x9b96('0x2f')](respondWithResult(_0x3809ab,null))[_0x9b96('0x4d')](handleError(_0x3809ab,null));};exports[_0x9b96('0x6d')]=function(_0x5f8803,_0x2decad,_0x53a1e4){var _0x83dd6=_0x5f8803[_0x9b96('0x55')][_0x9b96('0x6e')];return db[_0x9b96('0x6f')][_0x9b96('0x4c')]({'where':{'id':_0x83dd6},'attributes':['id'],'include':[{'model':db[_0x9b96('0x63')],'as':'Agents','attributes':['id',_0x9b96('0x36'),_0x9b96('0x70'),_0x9b96('0x71'),'interface'],'raw':!![]}]})[_0x9b96('0x2f')](function(_0x150d2e){if(_0x150d2e){var _0x44d197=_[_0x9b96('0x72')](_0x150d2e,function(_0x373910){var _0x264a35=_0x373910[_0x9b96('0x31')]({'plain':!![]});return _0x264a35[_0x9b96('0x73')];});return db[_0x9b96('0x4a')]['find']({'where':{'id':_0x5f8803[_0x9b96('0x4e')]['id']}})[_0x9b96('0x2f')](function(_0x3aec42){return db[_0x9b96('0x74')][_0x9b96('0x75')](function(_0x5332ca){return _0x3aec42[_0x9b96('0x6d')](_0x83dd6,{'transaction':_0x5332ca})[_0x9b96('0x2f')](function(){return BPromise[_0x9b96('0x76')](_0x44d197,function(_0x1cf2aa){return db['UserWhatsappQueue'][_0x9b96('0x77')]({'where':{'UserId':_0x1cf2aa['id'],'WhatsappQueueId':_0x5f8803[_0x9b96('0x4e')]['id']},'transaction':_0x5332ca});});})[_0x9b96('0x2f')](function(){_0x44d197[_0x9b96('0x78')](function(_0x13ed87){socket[_0x9b96('0x79')](_0x9b96('0x7a'),{'UserId':_0x13ed87['id'],'WhatsappQueueId':_0x3aec42['id']});});});});});}})[_0x9b96('0x2f')](respondWithStatusCode(_0x2decad,null))[_0x9b96('0x4d')](handleError(_0x2decad,null));};exports[_0x9b96('0x7b')]=function(_0x5c23bf,_0x338960,_0x17f8d8){return db['Team']['findAll']({'where':{'id':_0x5c23bf[_0x9b96('0x3c')][_0x9b96('0x6e')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9b96('0x73'),'attributes':['id'],'raw':!![]}]})[_0x9b96('0x2f')](handleEntityNotFound(_0x338960,null))[_0x9b96('0x2f')](function(_0x252a0b){var _0x4a49fa=_[_0x9b96('0x39')](_0x252a0b,'id');var _0x2eeec8=[];var _0x39a306=[];var _0x8964d=squel[_0x9b96('0x7c')]();_0x8964d[_0x9b96('0x7d')](_0x9b96('0x7e'))[_0x9b96('0x7f')](_0x9b96('0x80'),'tq')[_0x9b96('0x81')](_0x9b96('0x82'),'ut',_0x9b96('0x83'))[_0x9b96('0x46')]('WhatsappQueueId\x20=\x20?',_0x5c23bf[_0x9b96('0x4e')]['id']);for(var _0xdd0615=0x0;_0xdd0615<_0x252a0b[_0x9b96('0x50')];_0xdd0615+=0x1){let _0x428ec4=_0x252a0b[_0xdd0615];for(var _0x182f37=0x0;_0x182f37<_0x428ec4['Agents']['length'];_0x182f37+=0x1){let _0x23edeb=_0x428ec4[_0x9b96('0x73')][_0x182f37];var _0x22ede1=_0x8964d[_0x9b96('0x84')]();_0x22ede1[_0x9b96('0x46')](_0x9b96('0x85'),_0x23edeb['id']);_0x39a306[_0x9b96('0x86')](db[_0x9b96('0x74')][_0x9b96('0x3c')](_0x22ede1[_0x9b96('0x87')](),{'type':db[_0x9b96('0x74')][_0x9b96('0x88')]['SELECT']})[_0x9b96('0x2f')](function(_0x38f970){if(_0x38f970[_0x9b96('0x50')]===0x1){return _0x23edeb['id'];}else{var _0xb5859f=_[_0x9b96('0x89')](_[_0x9b96('0x39')](_0x38f970,'TeamId'),function(_0xaf1c8a){return _['includes'](_0x4a49fa,_0xaf1c8a);});if(_0xb5859f){return _0x23edeb['id'];}}}));}}return BPromise[_0x9b96('0x8a')](_0x39a306)[_0x9b96('0x2f')](function(_0xdef849){_0x2eeec8=_(_0x2eeec8)[_0x9b96('0x8b')](_0xdef849)[_0x9b96('0x8c')]()[_0x9b96('0x8d')]();return db['WhatsappQueue']['find']({'where':{'id':_0x5c23bf[_0x9b96('0x4e')]['id']}})[_0x9b96('0x2f')](function(_0x3e54b5){return db[_0x9b96('0x74')][_0x9b96('0x75')](function(_0x1ecc8a){return _0x3e54b5['removeTeams'](_0x5c23bf['query'][_0x9b96('0x6e')],{'transaction':_0x1ecc8a})[_0x9b96('0x2f')](function(){if(!_['isEmpty'](_0x2eeec8)){return _0x3e54b5[_0x9b96('0x8e')](_0x2eeec8,{'transaction':_0x1ecc8a});}})[_0x9b96('0x2f')](function(){_0x2eeec8['forEach'](function(_0x2c7eaa){socket[_0x9b96('0x79')](_0x9b96('0x8f'),{'UserId':_0x2c7eaa,'WhatsappQueueId':_0x3e54b5['id']});});});});});});})['then'](respondWithStatusCode(_0x338960,null))[_0x9b96('0x4d')](handleError(_0x338960,null));};exports[_0x9b96('0x90')]=function(_0x3f2c17,_0x77ee62,_0x2a058c){return db['WhatsappQueue'][_0x9b96('0x53')]({'where':{'id':_0x3f2c17[_0x9b96('0x4e')]['id']}})[_0x9b96('0x2f')](handleEntityNotFound(_0x77ee62,null))[_0x9b96('0x2f')](function(_0x41a045){if(_0x41a045){return _0x41a045[_0x9b96('0x90')](_0x3f2c17[_0x9b96('0x55')]['ids'],_[_0x9b96('0x91')](_0x3f2c17['body'],['ids','id'])||{})[_0x9b96('0x92')](function(_0x3a06a1){for(var _0x4c2ebc=0x0;_0x4c2ebc<_0x3f2c17[_0x9b96('0x55')][_0x9b96('0x6e')][_0x9b96('0x50')];_0x4c2ebc+=0x1){socket[_0x9b96('0x79')]('userWhatsappQueue:save',{'UserId':Number(_0x3f2c17[_0x9b96('0x55')][_0x9b96('0x6e')][_0x4c2ebc]),'WhatsappQueueId':Number(_0x3f2c17[_0x9b96('0x4e')]['id'])});}return _0x3a06a1;});}})[_0x9b96('0x2f')](respondWithResult(_0x77ee62,null))[_0x9b96('0x4d')](handleError(_0x77ee62,null));};exports['removeAgents']=function(_0x403d81,_0x5a54d0,_0x140338){return db['WhatsappQueue'][_0x9b96('0x53')]({'where':{'id':_0x403d81[_0x9b96('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5a54d0,null))[_0x9b96('0x2f')](function(_0x2b14cf){if(_0x2b14cf){return _0x2b14cf[_0x9b96('0x8e')](_0x403d81[_0x9b96('0x3c')][_0x9b96('0x6e')])[_0x9b96('0x2f')](function(){if(_['isArray'](_0x403d81[_0x9b96('0x3c')][_0x9b96('0x6e')])){for(var _0x28d946=0x0;_0x28d946<_0x403d81[_0x9b96('0x3c')]['ids'][_0x9b96('0x50')];_0x28d946+=0x1){socket[_0x9b96('0x79')](_0x9b96('0x8f'),{'UserId':Number(_0x403d81[_0x9b96('0x3c')][_0x9b96('0x6e')][_0x28d946]),'WhatsappQueueId':Number(_0x403d81['params']['id'])});}}else{socket[_0x9b96('0x79')](_0x9b96('0x8f'),{'UserId':Number(_0x403d81[_0x9b96('0x3c')]['ids']),'WhatsappQueueId':Number(_0x403d81[_0x9b96('0x4e')]['id'])});}});}})[_0x9b96('0x2f')](respondWithStatusCode(_0x5a54d0,null))['catch'](handleError(_0x5a54d0,null));};exports[_0x9b96('0x93')]=function(_0x4cb41a,_0x4ddf84,_0x40b7ca){var _0x14ccb6={};var _0x5a11e3={};var _0x520825;var _0x3d4826;return db[_0x9b96('0x4a')][_0x9b96('0x5f')]({'where':{'id':_0x4cb41a[_0x9b96('0x4e')]['id']}})[_0x9b96('0x2f')](handleEntityNotFound(_0x4ddf84,null))[_0x9b96('0x2f')](function(_0x53c020){if(_0x53c020){_0x520825=_0x53c020;_0x5a11e3['model']=_[_0x9b96('0x4f')](db[_0x9b96('0x63')][_0x9b96('0x3a')]);_0x5a11e3['query']=_[_0x9b96('0x4f')](_0x4cb41a['query']);_0x5a11e3[_0x9b96('0x3d')]=_[_0x9b96('0x3e')](_0x5a11e3[_0x9b96('0x3f')],_0x5a11e3[_0x9b96('0x3c')]);_0x14ccb6[_0x9b96('0x41')]=_[_0x9b96('0x3e')](_0x5a11e3[_0x9b96('0x3f')],qs[_0x9b96('0x40')](_0x4cb41a[_0x9b96('0x3c')]['fields']));_0x14ccb6[_0x9b96('0x41')]=_0x14ccb6['attributes'][_0x9b96('0x50')]?_0x14ccb6['attributes']:_0x5a11e3[_0x9b96('0x3f')];_0x14ccb6[_0x9b96('0x62')]=qs[_0x9b96('0x43')](_0x4cb41a['query'][_0x9b96('0x43')]);_0x14ccb6[_0x9b96('0x46')]=qs[_0x9b96('0x3d')](_[_0x9b96('0x44')](_0x4cb41a['query'],_0x5a11e3['filters']));if(_0x4cb41a[_0x9b96('0x3c')][_0x9b96('0x45')]){_0x14ccb6[_0x9b96('0x46')]=_[_0x9b96('0x47')](_0x14ccb6[_0x9b96('0x46')],{'$or':_[_0x9b96('0x39')](_0x14ccb6['attributes'],function(_0x5b7d45){var _0x14a560={};_0x14a560[_0x5b7d45]={'$like':'%'+_0x4cb41a[_0x9b96('0x3c')][_0x9b96('0x45')]+'%'};return _0x14a560;})});}_0x14ccb6=_['merge']({},_0x14ccb6,_0x4cb41a[_0x9b96('0x52')]);return _0x520825['getAgents'](_0x14ccb6);}})[_0x9b96('0x2f')](function(_0x2b0829){if(_0x2b0829){_0x3d4826=_0x2b0829[_0x9b96('0x50')];if(!_0x4cb41a[_0x9b96('0x3c')][_0x9b96('0x42')](_0x9b96('0x61'))){_0x14ccb6[_0x9b96('0x27')]=qs[_0x9b96('0x27')](_0x4cb41a[_0x9b96('0x3c')][_0x9b96('0x27')]);_0x14ccb6[_0x9b96('0x25')]=qs[_0x9b96('0x25')](_0x4cb41a['query'][_0x9b96('0x25')]);}return _0x520825[_0x9b96('0x93')](_0x14ccb6);}})[_0x9b96('0x2f')](function(_0x3848d6){if(_0x3848d6){return _0x3848d6?{'count':_0x3d4826,'rows':_0x3848d6}:null;}})[_0x9b96('0x2f')](respondWithResult(_0x4ddf84,null))[_0x9b96('0x4d')](handleError(_0x4ddf84,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index c9bd929..77cff2b 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 _0xffc1=['events','../../mysqldb','WhatsappQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xffc1,0x120));var _0x1ffc=function(_0x276880,_0x11e208){_0x276880=_0x276880-0x0;var _0x3c52d7=_0xffc1[_0x276880];return _0x3c52d7;};'use strict';var EventEmitter=require(_0x1ffc('0x0'));var WhatsappQueue=require(_0x1ffc('0x1'))['db'][_0x1ffc('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1ffc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1ffc('0x4'),'afterDestroy':'remove'};function emitEvent(_0xdcf095){return function(_0x4bea09,_0x58fe93,_0x5151e6){WhatsappQueueEvents[_0x1ffc('0x5')](_0xdcf095+':'+_0x4bea09['id'],_0x4bea09);WhatsappQueueEvents[_0x1ffc('0x5')](_0xdcf095,_0x4bea09);_0x5151e6(null);};}for(var e in events){if(events[_0x1ffc('0x6')](e)){var event=events[e];WhatsappQueue[_0x1ffc('0x7')](e,emitEvent(event));}}module[_0x1ffc('0x8')]=WhatsappQueueEvents; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index cb33823..16b3d06 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 _0x1e9b=['./whatsappQueue.attributes','define','lodash','util','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x4c853d,_0x4d0d22){var _0x184d07=function(_0x2f29c2){while(--_0x2f29c2){_0x4c853d['push'](_0x4c853d['shift']());}};_0x184d07(++_0x4d0d22);}(_0x1e9b,0xad));var _0xb1e9=function(_0x3ff257,_0x28c9bd){_0x3ff257=_0x3ff257-0x0;var _0x438afb=_0x1e9b[_0x3ff257];return _0x438afb;};'use strict';var _=require(_0xb1e9('0x0'));var util=require(_0xb1e9('0x1'));var logger=require('../../config/logger')(_0xb1e9('0x2'));var moment=require(_0xb1e9('0x3'));var BPromise=require(_0xb1e9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb1e9('0x5'));var config=require(_0xb1e9('0x6'));var attributes=require(_0xb1e9('0x7'));module['exports']=function(_0x34bf2f,_0x4117b5){return _0x34bf2f[_0xb1e9('0x8')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index edd6cc0..f9c9947 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 _0x044c=['attributes','include','map','model','ShowWhatsappQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x044c,0xa6));var _0xc044=function(_0x2d71a5,_0x14f966){_0x2d71a5=_0x2d71a5-0x0;var _0x1bfdd7=_0x044c[_0x2d71a5];return _0x1bfdd7;};'use strict';var _=require(_0xc044('0x0'));var util=require(_0xc044('0x1'));var moment=require(_0xc044('0x2'));var BPromise=require(_0xc044('0x3'));var rs=require(_0xc044('0x4'));var fs=require('fs');var Redis=require(_0xc044('0x5'));var db=require(_0xc044('0x6'))['db'];var utils=require(_0xc044('0x7'));var logger=require(_0xc044('0x8'))(_0xc044('0x9'));var config=require(_0xc044('0xa'));var jayson=require(_0xc044('0xb'));var client=jayson[_0xc044('0xc')][_0xc044('0xd')]({'port':0x232a});config[_0xc044('0xe')]=_['defaults'](config[_0xc044('0xe')],{'host':_0xc044('0xf'),'port':0x18eb});var socket=require(_0xc044('0x10'))(new Redis(config[_0xc044('0xe')]));require(_0xc044('0x11'))['register'](socket);function respondWithRpcPromise(_0x379e28,_0x4fc286,_0x2b84a6){return new BPromise(function(_0x3ffdad,_0x347883){return client[_0xc044('0x12')](_0x379e28,_0x2b84a6)[_0xc044('0x13')](function(_0x191f23){logger[_0xc044('0x14')](_0xc044('0x15'),_0x4fc286,_0xc044('0x16'));logger[_0xc044('0x17')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x4fc286,_0xc044('0x16'),JSON[_0xc044('0x18')](_0x191f23));if(_0x191f23['error']){if(_0x191f23[_0xc044('0x19')]['code']===0x1f4){logger[_0xc044('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x4fc286,_0x191f23['error']['message']);return _0x347883(_0x191f23[_0xc044('0x19')]['message']);}logger[_0xc044('0x19')](_0xc044('0x15'),_0x4fc286,_0x191f23[_0xc044('0x19')][_0xc044('0x1a')]);return _0x3ffdad(_0x191f23[_0xc044('0x19')][_0xc044('0x1a')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x4fc286,_0xc044('0x16'));_0x3ffdad(_0x191f23[_0xc044('0x1b')][_0xc044('0x1a')]);}})[_0xc044('0x1c')](function(_0x2b5786){logger[_0xc044('0x19')](_0xc044('0x15'),_0x4fc286,_0x2b5786);_0x347883(_0x2b5786);});});}exports[_0xc044('0x1d')]=function(_0xd9f848){var _0x21c9ba=this;return new Promise(function(_0x3507a8,_0xf6cae4){return db[_0xc044('0x1e')][_0xc044('0x1f')]({'raw':_0xd9f848[_0xc044('0x20')]?_0xd9f848['options']['raw']===undefined?!![]:![]:!![],'where':_0xd9f848[_0xc044('0x20')]?_0xd9f848[_0xc044('0x20')][_0xc044('0x21')]||null:null,'attributes':_0xd9f848[_0xc044('0x20')]?_0xd9f848['options'][_0xc044('0x22')]||null:null,'limit':_0xd9f848[_0xc044('0x20')]?_0xd9f848[_0xc044('0x20')]['limit']||null:null,'include':_0xd9f848['options']?_0xd9f848[_0xc044('0x20')][_0xc044('0x23')]?_[_0xc044('0x24')](_0xd9f848[_0xc044('0x20')][_0xc044('0x23')],function(_0x5d23cf){return{'model':db[_0x5d23cf[_0xc044('0x25')]],'as':_0x5d23cf['as'],'attributes':_0x5d23cf[_0xc044('0x22')],'include':_0x5d23cf['include']?_[_0xc044('0x24')](_0x5d23cf[_0xc044('0x23')],function(_0x5144b4){return{'model':db[_0x5144b4['model']],'as':_0x5144b4['as'],'attributes':_0x5144b4[_0xc044('0x22')],'include':_0x5144b4[_0xc044('0x23')]?_[_0xc044('0x24')](_0x5144b4['include'],function(_0x15a5ba){return{'model':db[_0x15a5ba['model']],'as':_0x15a5ba['as'],'attributes':_0x15a5ba[_0xc044('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc044('0x13')](function(_0x50f774){logger[_0xc044('0x14')]('GetWhatsappQueue',_0xd9f848);logger[_0xc044('0x17')](_0xc044('0x1d'),_0xd9f848,JSON[_0xc044('0x18')](_0x50f774));_0x3507a8(_0x50f774);})['catch'](function(_0xfddb99){logger[_0xc044('0x19')](_0xc044('0x1d'),_0xfddb99[_0xc044('0x1a')],_0xd9f848);_0xf6cae4(_0x21c9ba[_0xc044('0x19')](0x1f4,_0xfddb99[_0xc044('0x1a')]));});});};exports[_0xc044('0x26')]=function(_0x34fca1){var _0x23516c=this;return new Promise(function(_0x23fab3,_0x42e246){return db[_0xc044('0x1e')]['find']({'raw':_0x34fca1[_0xc044('0x20')]?_0x34fca1[_0xc044('0x20')][_0xc044('0x27')]===undefined?!![]:![]:!![],'where':_0x34fca1['options']?_0x34fca1['options'][_0xc044('0x21')]||null:null,'attributes':_0x34fca1[_0xc044('0x20')]?_0x34fca1['options'][_0xc044('0x22')]||null:null,'include':_0x34fca1['options']?_0x34fca1['options']['include']?_[_0xc044('0x24')](_0x34fca1[_0xc044('0x20')]['include'],function(_0x232eb4){return{'model':db[_0x232eb4[_0xc044('0x25')]],'as':_0x232eb4['as'],'attributes':_0x232eb4[_0xc044('0x22')],'include':_0x232eb4[_0xc044('0x23')]?_[_0xc044('0x24')](_0x232eb4[_0xc044('0x23')],function(_0xc0d096){return{'model':db[_0xc0d096[_0xc044('0x25')]],'as':_0xc0d096['as'],'attributes':_0xc0d096[_0xc044('0x22')],'include':_0xc0d096[_0xc044('0x23')]?_[_0xc044('0x24')](_0xc0d096['include'],function(_0x152b0b){return{'model':db[_0x152b0b[_0xc044('0x25')]],'as':_0x152b0b['as'],'attributes':_0x152b0b[_0xc044('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc044('0x13')](function(_0x3dcc58){logger['info']('ShowWhatsappQueue',_0x34fca1);logger[_0xc044('0x17')](_0xc044('0x26'),_0x34fca1,JSON[_0xc044('0x18')](_0x3dcc58));_0x23fab3(_0x3dcc58);})['catch'](function(_0x409341){logger[_0xc044('0x19')]('ShowWhatsappQueue',_0x409341[_0xc044('0x1a')],_0x34fca1);_0x42e246(_0x23516c[_0xc044('0x19')](0x1f4,_0x409341[_0xc044('0x1a')]));});});}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index ff246d1..b9945c3 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 _0x0072=['save','update','emit','register','whatsappQueue:','./whatsappQueue.events'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x0072,0x19d));var _0x2007=function(_0x4e753f,_0x534cde){_0x4e753f=_0x4e753f-0x0;var _0x1e1960=_0x0072[_0x4e753f];return _0x1e1960;};'use strict';var WhatsappQueueEvents=require(_0x2007('0x0'));var events=[_0x2007('0x1'),'remove',_0x2007('0x2')];function createListener(_0x1b3894,_0xc416b6){return function(_0x2ef3fd){_0xc416b6[_0x2007('0x3')](_0x1b3894,_0x2ef3fd);};}function removeListener(_0x43a6d6,_0x4d5fa2){return function(){WhatsappQueueEvents['removeListener'](_0x43a6d6,_0x4d5fa2);};}exports[_0x2007('0x4')]=function(_0x1f0192){for(var _0x2df9b6=0x0,_0x103345=events['length'];_0x2df9b6<_0x103345;_0x2df9b6++){var _0x25440d=events[_0x2df9b6];var _0x103465=createListener(_0x2007('0x5')+_0x25440d,_0x1f0192);WhatsappQueueEvents['on'](_0x25440d,_0x103465);}}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index e912594..2e0bc40 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 _0x8888=['get','isAuthenticated','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','./whatsappQueueReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8888,0x175));var _0x8888=function(_0x1a7abd,_0x47297c){_0x1a7abd=_0x1a7abd-0x0;var _0x12ecc9=_0x8888[_0x1a7abd];return _0x12ecc9;};'use strict';var multer=require(_0x8888('0x0'));var util=require('util');var path=require(_0x8888('0x1'));var timeout=require(_0x8888('0x2'));var express=require(_0x8888('0x3'));var router=express[_0x8888('0x4')]();var fs_extra=require(_0x8888('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8888('0x6'));router[_0x8888('0x7')]('/',auth[_0x8888('0x8')](),controller['index']);router[_0x8888('0x7')](_0x8888('0x9'),auth[_0x8888('0x8')](),controller[_0x8888('0xa')]);router['get'](_0x8888('0xb'),auth[_0x8888('0x8')](),controller[_0x8888('0xc')]);router[_0x8888('0xd')]('/',auth[_0x8888('0x8')](),controller[_0x8888('0xe')]);router[_0x8888('0xf')](_0x8888('0xb'),auth[_0x8888('0x8')](),controller[_0x8888('0x10')]);router[_0x8888('0x11')](_0x8888('0xb'),auth[_0x8888('0x8')](),controller[_0x8888('0x12')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 0cc3b46..4b872c2 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5e0dfa,_0x2c26a4){var _0x417e77=function(_0x7df41d){while(--_0x7df41d){_0x5e0dfa['push'](_0x5e0dfa['shift']());}};_0x417e77(++_0x2c26a4);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 0acda20..e300cab 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 _0x69d3=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','WhatsappQueueReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','find','create','body','catch','update','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv'];(function(_0x2b4512,_0x5a229a){var _0x43fc16=function(_0x33b15b){while(--_0x33b15b){_0x2b4512['push'](_0x2b4512['shift']());}};_0x43fc16(++_0x5a229a);}(_0x69d3,0xda));var _0x369d=function(_0x3d5569,_0x335838){_0x3d5569=_0x3d5569-0x0;var _0x2c157d=_0x69d3[_0x3d5569];return _0x2c157d;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dfe83,_0x16145e){return function(_0x46de2b){if(!_0x46de2b){_0x4dfe83[_0x369d('0x17')](0x194);}return _0x46de2b;};}function handleError(_0xe01d2b,_0x8aa521){_0x8aa521=_0x8aa521||0x1f4;return function(_0x41e0cf){logger[_0x369d('0x25')](_0x41e0cf['stack']);if(_0x41e0cf[_0x369d('0x26')]){delete _0x41e0cf[_0x369d('0x26')];}_0xe01d2b[_0x369d('0x18')](_0x8aa521)[_0x369d('0x27')](_0x41e0cf);};}exports[_0x369d('0x28')]=function(_0x41367a,_0x3d1ce0){var _0x4d42ea={},_0x157291={},_0x56efb1={'count':0x0,'rows':[]};var _0x57b94c=_[_0x369d('0x29')](db[_0x369d('0x2a')]['rawAttributes'],function(_0x104540){return{'name':_0x104540['fieldName'],'type':_0x104540[_0x369d('0x2b')][_0x369d('0x2c')]};});_0x157291[_0x369d('0x2d')]=_[_0x369d('0x29')](_0x57b94c,_0x369d('0x26'));_0x157291[_0x369d('0x2e')]=_[_0x369d('0x2f')](_0x41367a['query']);_0x157291[_0x369d('0x30')]=_[_0x369d('0x31')](_0x157291[_0x369d('0x2d')],_0x157291[_0x369d('0x2e')]);_0x4d42ea[_0x369d('0x32')]=_[_0x369d('0x31')](_0x157291[_0x369d('0x2d')],qs[_0x369d('0x33')](_0x41367a['query'][_0x369d('0x33')]));_0x4d42ea[_0x369d('0x32')]=_0x4d42ea[_0x369d('0x32')][_0x369d('0x34')]?_0x4d42ea[_0x369d('0x32')]:_0x157291['model'];if(!_0x41367a[_0x369d('0x2e')][_0x369d('0x35')](_0x369d('0x36'))){_0x4d42ea[_0x369d('0x37')]=qs[_0x369d('0x37')](_0x41367a[_0x369d('0x2e')]['limit']);_0x4d42ea[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x41367a[_0x369d('0x2e')][_0x369d('0x1b')]);}_0x4d42ea[_0x369d('0x38')]=qs[_0x369d('0x39')](_0x41367a[_0x369d('0x2e')][_0x369d('0x39')]);_0x4d42ea[_0x369d('0x3a')]=qs[_0x369d('0x30')](_[_0x369d('0x3b')](_0x41367a[_0x369d('0x2e')],_0x157291[_0x369d('0x30')]),_0x57b94c);if(_0x41367a[_0x369d('0x2e')][_0x369d('0x3c')]){_0x4d42ea[_0x369d('0x3a')]=_[_0x369d('0x3d')](_0x4d42ea[_0x369d('0x3a')],{'$or':_[_0x369d('0x29')](_0x57b94c,function(_0x7fd64b){if(_0x7fd64b[_0x369d('0x2b')]!==_0x369d('0x3e')){var _0xb7837f={};_0xb7837f[_0x7fd64b[_0x369d('0x26')]]={'$like':'%'+_0x41367a['query']['filter']+'%'};return _0xb7837f;}})});}_0x4d42ea=_[_0x369d('0x3d')]({},_0x4d42ea,_0x41367a[_0x369d('0x3f')]);var _0x8a1ef5={'where':_0x4d42ea[_0x369d('0x3a')]};return db[_0x369d('0x2a')][_0x369d('0x1d')](_0x8a1ef5)[_0x369d('0x24')](function(_0x169340){_0x56efb1[_0x369d('0x1d')]=_0x169340;if(_0x41367a['query'][_0x369d('0x40')]){_0x4d42ea[_0x369d('0x41')]=[{'all':!![]}];}return db[_0x369d('0x2a')][_0x369d('0x42')](_0x4d42ea);})[_0x369d('0x24')](function(_0x25cf4e){_0x56efb1[_0x369d('0x43')]=_0x25cf4e;return _0x56efb1;})[_0x369d('0x24')](respondWithFilteredResult(_0x3d1ce0,_0x4d42ea))['catch'](handleError(_0x3d1ce0,null));};exports['show']=function(_0x20b351,_0x3222ce){var _0x30909a={'raw':!![],'where':{'id':_0x20b351['params']['id']}},_0x4dad71={};_0x4dad71['model']=_[_0x369d('0x2f')](db[_0x369d('0x2a')]['rawAttributes']);_0x4dad71[_0x369d('0x2e')]=_[_0x369d('0x2f')](_0x20b351[_0x369d('0x2e')]);_0x4dad71[_0x369d('0x30')]=_['intersection'](_0x4dad71[_0x369d('0x2d')],_0x4dad71['query']);_0x30909a[_0x369d('0x32')]=_['intersection'](_0x4dad71[_0x369d('0x2d')],qs[_0x369d('0x33')](_0x20b351[_0x369d('0x2e')]['fields']));_0x30909a['attributes']=_0x30909a[_0x369d('0x32')][_0x369d('0x34')]?_0x30909a[_0x369d('0x32')]:_0x4dad71['model'];if(_0x20b351[_0x369d('0x2e')][_0x369d('0x40')]){_0x30909a[_0x369d('0x41')]=[{'all':!![]}];}_0x30909a=_[_0x369d('0x3d')]({},_0x30909a,_0x20b351[_0x369d('0x3f')]);return db[_0x369d('0x2a')][_0x369d('0x44')](_0x30909a)[_0x369d('0x24')](handleEntityNotFound(_0x3222ce,null))[_0x369d('0x24')](respondWithResult(_0x3222ce,null))['catch'](handleError(_0x3222ce,null));};exports[_0x369d('0x45')]=function(_0x41066d,_0xcc1465){return db[_0x369d('0x2a')][_0x369d('0x45')](_0x41066d[_0x369d('0x46')],{})['then'](respondWithResult(_0xcc1465,0xc9))[_0x369d('0x47')](handleError(_0xcc1465,null));};exports[_0x369d('0x48')]=function(_0x16dd8f,_0x44a357){if(_0x16dd8f[_0x369d('0x46')]['id']){delete _0x16dd8f[_0x369d('0x46')]['id'];}return db[_0x369d('0x2a')][_0x369d('0x44')]({'where':{'id':_0x16dd8f[_0x369d('0x49')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x44a357,null))[_0x369d('0x24')](saveUpdates(_0x16dd8f[_0x369d('0x46')],null))['then'](respondWithResult(_0x44a357,null))[_0x369d('0x47')](handleError(_0x44a357,null));};exports[_0x369d('0x23')]=function(_0x289eb8,_0x85edd6){return db[_0x369d('0x2a')]['find']({'where':{'id':_0x289eb8[_0x369d('0x49')]['id']}})['then'](handleEntityNotFound(_0x85edd6,null))[_0x369d('0x24')](removeEntity(_0x85edd6,null))[_0x369d('0x47')](handleError(_0x85edd6,null));};exports[_0x369d('0x4a')]=function(_0x851746,_0x46c62c){return db[_0x369d('0x2a')][_0x369d('0x4a')]()[_0x369d('0x24')](respondWithResult(_0x46c62c,null))[_0x369d('0x47')](handleError(_0x46c62c,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 893baea..76801b3 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 _0x2581=['api','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','util','../../config/logger'];(function(_0x3a886b,_0x2ced0d){var _0x159768=function(_0x23737b){while(--_0x23737b){_0x3a886b['push'](_0x3a886b['shift']());}};_0x159768(++_0x2ced0d);}(_0x2581,0x142));var _0x1258=function(_0x5c4112,_0x38c2db){_0x5c4112=_0x5c4112-0x0;var _0xcc8c4e=_0x2581[_0x5c4112];return _0xcc8c4e;};'use strict';var _=require('lodash');var util=require(_0x1258('0x0'));var logger=require(_0x1258('0x1'))(_0x1258('0x2'));var moment=require('moment');var BPromise=require(_0x1258('0x3'));var rp=require(_0x1258('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1258('0x5'));var config=require(_0x1258('0x6'));var attributes=require(_0x1258('0x7'));module[_0x1258('0x8')]=function(_0x4d43c0,_0x2f7c82){return _0x4d43c0[_0x1258('0x9')](_0x1258('0xa'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x1258('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index ddea59f..fb652e6 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 _0x3eff=['attributes','limit','UpdateWhatsappQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','WhatsappQueueReport,\x20%s,\x20%s','message','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','stringify','update'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x3eff,0xc3));var _0xf3ef=function(_0x449e84,_0x505ae7){_0x449e84=_0x449e84-0x0;var _0x72d311=_0x3eff[_0x449e84];return _0x72d311;};'use strict';var _=require('lodash');var util=require(_0xf3ef('0x0'));var moment=require(_0xf3ef('0x1'));var BPromise=require(_0xf3ef('0x2'));var rs=require(_0xf3ef('0x3'));var fs=require('fs');var Redis=require(_0xf3ef('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf3ef('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf3ef('0x6'));var jayson=require(_0xf3ef('0x7'));var client=jayson[_0xf3ef('0x8')][_0xf3ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x482649,_0x331e7e,_0x2624bc){return new BPromise(function(_0x1c75c1,_0x22913b){return client[_0xf3ef('0xa')](_0x482649,_0x2624bc)[_0xf3ef('0xb')](function(_0x29f53c){logger[_0xf3ef('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x331e7e,_0xf3ef('0xd'));logger[_0xf3ef('0xe')](_0xf3ef('0xf'),_0x331e7e,_0xf3ef('0xd'),JSON['stringify'](_0x29f53c));if(_0x29f53c['error']){if(_0x29f53c[_0xf3ef('0x10')][_0xf3ef('0x11')]===0x1f4){logger[_0xf3ef('0x10')](_0xf3ef('0x12'),_0x331e7e,_0x29f53c['error'][_0xf3ef('0x13')]);return _0x22913b(_0x29f53c[_0xf3ef('0x10')][_0xf3ef('0x13')]);}logger[_0xf3ef('0x10')](_0xf3ef('0x12'),_0x331e7e,_0x29f53c[_0xf3ef('0x10')][_0xf3ef('0x13')]);return _0x1c75c1(_0x29f53c[_0xf3ef('0x10')][_0xf3ef('0x13')]);}else{logger[_0xf3ef('0xc')]('WhatsappQueueReport,\x20%s,\x20%s',_0x331e7e,_0xf3ef('0xd'));_0x1c75c1(_0x29f53c['result'][_0xf3ef('0x13')]);}})[_0xf3ef('0x14')](function(_0x1f6d60){logger[_0xf3ef('0x10')](_0xf3ef('0x12'),_0x331e7e,_0x1f6d60);_0x22913b(_0x1f6d60);});});}exports[_0xf3ef('0x15')]=function(_0x1feb8d){var _0x4d197c=this;return new Promise(function(_0xf1c80b,_0x38b81f){return db[_0xf3ef('0x16')][_0xf3ef('0x17')](_0x1feb8d[_0xf3ef('0x18')],{'raw':_0x1feb8d['options']?_0x1feb8d[_0xf3ef('0x19')][_0xf3ef('0x1a')]===undefined?!![]:![]:!![]})[_0xf3ef('0xb')](function(_0x4fe484){logger[_0xf3ef('0xc')](_0xf3ef('0x15'),_0x1feb8d);logger[_0xf3ef('0xe')](_0xf3ef('0x15'),_0x1feb8d,JSON[_0xf3ef('0x1b')](_0x4fe484));_0xf1c80b(_0x4fe484);})[_0xf3ef('0x14')](function(_0x1a0e5a){logger[_0xf3ef('0x10')](_0xf3ef('0x15'),_0x1a0e5a[_0xf3ef('0x13')],_0x1feb8d);_0x38b81f(_0x4d197c[_0xf3ef('0x10')](0x1f4,_0x1a0e5a[_0xf3ef('0x13')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x2090ce){var _0x14fa3e=this;return new Promise(function(_0x52a910,_0x2a8af8){return db[_0xf3ef('0x16')][_0xf3ef('0x1c')](_0x2090ce[_0xf3ef('0x18')],{'raw':_0x2090ce[_0xf3ef('0x19')]?_0x2090ce[_0xf3ef('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2090ce[_0xf3ef('0x19')]?_0x2090ce[_0xf3ef('0x19')]['where']||null:null,'attributes':_0x2090ce['options']?_0x2090ce['options'][_0xf3ef('0x1d')]||null:null,'limit':_0x2090ce[_0xf3ef('0x19')]?_0x2090ce[_0xf3ef('0x19')][_0xf3ef('0x1e')]||null:null})[_0xf3ef('0xb')](function(_0x2ea6c1){logger['info'](_0xf3ef('0x1f'),_0x2090ce);logger[_0xf3ef('0xe')](_0xf3ef('0x1f'),_0x2090ce,JSON['stringify'](_0x2ea6c1));_0x52a910(_0x2ea6c1);})['catch'](function(_0x130ba2){logger[_0xf3ef('0x10')](_0xf3ef('0x1f'),_0x130ba2['message'],_0x2090ce);_0x2a8af8(_0x14fa3e[_0xf3ef('0x10')](0x1f4,_0x130ba2['message']));});});}; \ No newline at end of file +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 diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 1a2599c..f2d7ddf 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 _0x632c=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','show','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x2fca92,_0x42aa4f){var _0x3138c7=function(_0x19f425){while(--_0x19f425){_0x2fca92['push'](_0x2fca92['shift']());}};_0x3138c7(++_0x42aa4f);}(_0x632c,0x172));var _0xc632=function(_0x11ec99,_0x6a5921){_0x11ec99=_0x11ec99-0x0;var _0x3a693a=_0x632c[_0x11ec99];return _0x3a693a;};'use strict';var multer=require(_0xc632('0x0'));var util=require(_0xc632('0x1'));var path=require(_0xc632('0x2'));var timeout=require(_0xc632('0x3'));var express=require(_0xc632('0x4'));var router=express[_0xc632('0x5')]();var fs_extra=require(_0xc632('0x6'));var auth=require(_0xc632('0x7'));var interaction=require(_0xc632('0x8'));var config=require(_0xc632('0x9'));var controller=require(_0xc632('0xa'));router[_0xc632('0xb')]('/',auth[_0xc632('0xc')](),controller[_0xc632('0xd')]);router['get'](_0xc632('0xe'),auth[_0xc632('0xc')](),controller['describe']);router[_0xc632('0xb')]('/:id',auth[_0xc632('0xc')](),controller[_0xc632('0xf')]);router[_0xc632('0x10')]('/',auth[_0xc632('0xc')](),controller[_0xc632('0x11')]);router['put'](_0xc632('0x12'),auth[_0xc632('0xc')](),controller[_0xc632('0x13')]);router[_0xc632('0x14')](_0xc632('0x12'),auth[_0xc632('0xc')](),controller[_0xc632('0x15')]);module['exports']=router; \ No newline at end of file +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 diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 39c2ea2..8931b52 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 _0x7fce=['sequelize','exports','STRING','account','queue'];(function(_0x3c73d1,_0x2c5b98){var _0x200bba=function(_0x23c557){while(--_0x23c557){_0x3c73d1['push'](_0x3c73d1['shift']());}};_0x200bba(++_0x2c5b98);}(_0x7fce,0xdc));var _0xe7fc=function(_0x1385ba,_0x3b0d6a){_0x1385ba=_0x1385ba-0x0;var _0x52018f=_0x7fce[_0x1385ba];return _0x52018f;};'use strict';var Sequelize=require(_0xe7fc('0x0'));module[_0xe7fc('0x1')]={'uniqueid':{'type':Sequelize[_0xe7fc('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe7fc('0x3'),'agent',_0xe7fc('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +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 diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 7ea0314..87a3307 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 _0xa3c3=['status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','include','show','params','catch','create','body','find','describe','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3c3,0xcc));var _0x3a3c=function(_0x2f36f1,_0x263fdf){_0x2f36f1=_0x2f36f1-0x0;var _0x5d1223=_0xa3c3[_0x2f36f1];return _0x5d1223;};'use strict';var emlformat=require(_0x3a3c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3a3c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3a3c('0x2'));var moment=require('moment');var BPromise=require(_0x3a3c('0x3'));var Mustache=require(_0x3a3c('0x4'));var util=require('util');var path=require(_0x3a3c('0x5'));var sox=require(_0x3a3c('0x6'));var csv=require(_0x3a3c('0x7'));var ejs=require(_0x3a3c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3a3c('0x9'));var crypto=require(_0x3a3c('0xa'));var jsforce=require(_0x3a3c('0xb'));var deskjs=require(_0x3a3c('0xc'));var toCsv=require(_0x3a3c('0x7'));var querystring=require('querystring');var Papa=require(_0x3a3c('0xd'));var Redis=require(_0x3a3c('0xe'));var authService=require(_0x3a3c('0xf'));var qs=require(_0x3a3c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3a3c('0x11'));var logger=require(_0x3a3c('0x12'))(_0x3a3c('0x13'));var utils=require(_0x3a3c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3a3c('0x15'));var db=require(_0x3a3c('0x16'))['db'];function respondWithStatusCode(_0xfd482e,_0x3c0888){_0x3c0888=_0x3c0888||0xcc;return function(_0xbcc66e){if(_0xbcc66e){return _0xfd482e[_0x3a3c('0x17')](_0x3c0888);}return _0xfd482e[_0x3a3c('0x18')](_0x3c0888)[_0x3a3c('0x19')]();};}function respondWithResult(_0x1a3d3f,_0x1e3364){_0x1e3364=_0x1e3364||0xc8;return function(_0x479a40){if(_0x479a40){return _0x1a3d3f[_0x3a3c('0x18')](_0x1e3364)[_0x3a3c('0x1a')](_0x479a40);}};}function respondWithFilteredResult(_0x48da64,_0x40da17){return function(_0x2e31e5){if(_0x2e31e5){var _0x2dc0d9=typeof _0x40da17[_0x3a3c('0x1b')]===_0x3a3c('0x1c')&&typeof _0x40da17[_0x3a3c('0x1d')]===_0x3a3c('0x1c');var _0x43c87c=_0x2e31e5[_0x3a3c('0x1e')];var _0x9cf87e=_0x2dc0d9?0x0:_0x40da17[_0x3a3c('0x1b')];var _0x1e38b0=_0x2dc0d9?_0x2e31e5[_0x3a3c('0x1e')]:_0x40da17[_0x3a3c('0x1b')]+_0x40da17['limit'];var _0x35825a;if(_0x1e38b0>=_0x43c87c){_0x1e38b0=_0x43c87c;_0x35825a=0xc8;}else{_0x35825a=0xce;}_0x48da64[_0x3a3c('0x18')](_0x35825a);return _0x48da64[_0x3a3c('0x1f')](_0x3a3c('0x20'),_0x9cf87e+'-'+_0x1e38b0+'/'+_0x43c87c)[_0x3a3c('0x1a')](_0x2e31e5);}return null;};}function patchUpdates(_0x56079e){return function(_0x24af26){try{jsonpatch[_0x3a3c('0x21')](_0x24af26,_0x56079e,!![]);}catch(_0x1ca24a){return BPromise[_0x3a3c('0x22')](_0x1ca24a);}return _0x24af26[_0x3a3c('0x23')]();};}function saveUpdates(_0x42fa28,_0x17a04c){return function(_0x97e5c8){if(_0x97e5c8){return _0x97e5c8[_0x3a3c('0x24')](_0x42fa28)[_0x3a3c('0x25')](function(_0x28ff23){return _0x28ff23;});}return null;};}function removeEntity(_0x36691a,_0x2fb642){return function(_0x49df72){if(_0x49df72){return _0x49df72[_0x3a3c('0x26')]()[_0x3a3c('0x25')](function(){_0x36691a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2144,_0x269605){return function(_0x55e925){if(!_0x55e925){_0x1b2144[_0x3a3c('0x17')](0x194);}return _0x55e925;};}function handleError(_0x3a3886,_0x5a69bf){_0x5a69bf=_0x5a69bf||0x1f4;return function(_0xa08e7a){logger[_0x3a3c('0x27')](_0xa08e7a[_0x3a3c('0x28')]);if(_0xa08e7a['name']){delete _0xa08e7a[_0x3a3c('0x29')];}_0x3a3886[_0x3a3c('0x18')](_0x5a69bf)[_0x3a3c('0x2a')](_0xa08e7a);};}exports[_0x3a3c('0x2b')]=function(_0x28a0c7,_0xb921ec){var _0x2d5f8c={},_0x5a9abd={},_0x169bac={'count':0x0,'rows':[]};var _0x119ca6=_[_0x3a3c('0x2c')](db[_0x3a3c('0x2d')][_0x3a3c('0x2e')],function(_0x34aa92){return{'name':_0x34aa92[_0x3a3c('0x2f')],'type':_0x34aa92['type'][_0x3a3c('0x30')]};});_0x5a9abd[_0x3a3c('0x31')]=_['map'](_0x119ca6,_0x3a3c('0x29'));_0x5a9abd[_0x3a3c('0x32')]=_[_0x3a3c('0x33')](_0x28a0c7['query']);_0x5a9abd['filters']=_[_0x3a3c('0x34')](_0x5a9abd['model'],_0x5a9abd[_0x3a3c('0x32')]);_0x2d5f8c['attributes']=_[_0x3a3c('0x34')](_0x5a9abd['model'],qs[_0x3a3c('0x35')](_0x28a0c7[_0x3a3c('0x32')][_0x3a3c('0x35')]));_0x2d5f8c[_0x3a3c('0x36')]=_0x2d5f8c['attributes'][_0x3a3c('0x37')]?_0x2d5f8c['attributes']:_0x5a9abd['model'];if(!_0x28a0c7['query'][_0x3a3c('0x38')](_0x3a3c('0x39'))){_0x2d5f8c[_0x3a3c('0x1d')]=qs[_0x3a3c('0x1d')](_0x28a0c7['query']['limit']);_0x2d5f8c[_0x3a3c('0x1b')]=qs[_0x3a3c('0x1b')](_0x28a0c7[_0x3a3c('0x32')][_0x3a3c('0x1b')]);}_0x2d5f8c[_0x3a3c('0x3a')]=qs[_0x3a3c('0x3b')](_0x28a0c7['query'][_0x3a3c('0x3b')]);_0x2d5f8c[_0x3a3c('0x3c')]=qs['filters'](_[_0x3a3c('0x3d')](_0x28a0c7['query'],_0x5a9abd[_0x3a3c('0x3e')]),_0x119ca6);if(_0x28a0c7[_0x3a3c('0x32')]['filter']){_0x2d5f8c[_0x3a3c('0x3c')]=_[_0x3a3c('0x3f')](_0x2d5f8c['where'],{'$or':_['map'](_0x119ca6,function(_0x466bf6){if(_0x466bf6['type']!==_0x3a3c('0x40')){var _0x22d6b3={};_0x22d6b3[_0x466bf6[_0x3a3c('0x29')]]={'$like':'%'+_0x28a0c7[_0x3a3c('0x32')][_0x3a3c('0x41')]+'%'};return _0x22d6b3;}})});}_0x2d5f8c=_[_0x3a3c('0x3f')]({},_0x2d5f8c,_0x28a0c7[_0x3a3c('0x42')]);var _0x193093={'where':_0x2d5f8c[_0x3a3c('0x3c')]};return db[_0x3a3c('0x2d')][_0x3a3c('0x1e')](_0x193093)['then'](function(_0x15882b){_0x169bac[_0x3a3c('0x1e')]=_0x15882b;if(_0x28a0c7[_0x3a3c('0x32')][_0x3a3c('0x43')]){_0x2d5f8c[_0x3a3c('0x44')]=[{'all':!![]}];}return db[_0x3a3c('0x2d')]['findAll'](_0x2d5f8c);})[_0x3a3c('0x25')](function(_0xa4197f){_0x169bac['rows']=_0xa4197f;return _0x169bac;})[_0x3a3c('0x25')](respondWithFilteredResult(_0xb921ec,_0x2d5f8c))['catch'](handleError(_0xb921ec,null));};exports[_0x3a3c('0x45')]=function(_0xfc13b1,_0x279aa3){var _0x3b866b={'raw':!![],'where':{'id':_0xfc13b1[_0x3a3c('0x46')]['id']}},_0x48204b={};_0x48204b[_0x3a3c('0x31')]=_['keys'](db[_0x3a3c('0x2d')][_0x3a3c('0x2e')]);_0x48204b[_0x3a3c('0x32')]=_[_0x3a3c('0x33')](_0xfc13b1[_0x3a3c('0x32')]);_0x48204b[_0x3a3c('0x3e')]=_['intersection'](_0x48204b['model'],_0x48204b[_0x3a3c('0x32')]);_0x3b866b[_0x3a3c('0x36')]=_[_0x3a3c('0x34')](_0x48204b['model'],qs[_0x3a3c('0x35')](_0xfc13b1['query'][_0x3a3c('0x35')]));_0x3b866b['attributes']=_0x3b866b[_0x3a3c('0x36')][_0x3a3c('0x37')]?_0x3b866b[_0x3a3c('0x36')]:_0x48204b[_0x3a3c('0x31')];if(_0xfc13b1[_0x3a3c('0x32')][_0x3a3c('0x43')]){_0x3b866b[_0x3a3c('0x44')]=[{'all':!![]}];}_0x3b866b=_[_0x3a3c('0x3f')]({},_0x3b866b,_0xfc13b1[_0x3a3c('0x42')]);return db[_0x3a3c('0x2d')]['find'](_0x3b866b)[_0x3a3c('0x25')](handleEntityNotFound(_0x279aa3,null))[_0x3a3c('0x25')](respondWithResult(_0x279aa3,null))[_0x3a3c('0x47')](handleError(_0x279aa3,null));};exports['create']=function(_0x497306,_0x32a96e){return db[_0x3a3c('0x2d')][_0x3a3c('0x48')](_0x497306['body'],{})[_0x3a3c('0x25')](respondWithResult(_0x32a96e,0xc9))[_0x3a3c('0x47')](handleError(_0x32a96e,null));};exports[_0x3a3c('0x24')]=function(_0x2f7527,_0x25d481){if(_0x2f7527[_0x3a3c('0x49')]['id']){delete _0x2f7527[_0x3a3c('0x49')]['id'];}return db[_0x3a3c('0x2d')][_0x3a3c('0x4a')]({'where':{'id':_0x2f7527[_0x3a3c('0x46')]['id']}})['then'](handleEntityNotFound(_0x25d481,null))[_0x3a3c('0x25')](saveUpdates(_0x2f7527[_0x3a3c('0x49')],null))[_0x3a3c('0x25')](respondWithResult(_0x25d481,null))[_0x3a3c('0x47')](handleError(_0x25d481,null));};exports[_0x3a3c('0x26')]=function(_0x1edbd5,_0x105d4d){return db[_0x3a3c('0x2d')][_0x3a3c('0x4a')]({'where':{'id':_0x1edbd5[_0x3a3c('0x46')]['id']}})['then'](handleEntityNotFound(_0x105d4d,null))['then'](removeEntity(_0x105d4d,null))['catch'](handleError(_0x105d4d,null));};exports[_0x3a3c('0x4b')]=function(_0x414fbb,_0x3b597c){return db['WhatsappTransferReport'][_0x3a3c('0x4b')]()[_0x3a3c('0x25')](respondWithResult(_0x3b597c,null))[_0x3a3c('0x47')](handleError(_0x3b597c,null));}; \ No newline at end of file +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 diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index aab7fed..de4f9d4 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 _0x6b0f=['request-promise','exports','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','bluebird'];(function(_0x3ff343,_0x237ada){var _0x2a0ad4=function(_0x28851e){while(--_0x28851e){_0x3ff343['push'](_0x3ff343['shift']());}};_0x2a0ad4(++_0x237ada);}(_0x6b0f,0xa7));var _0xf6b0=function(_0x4f41e5,_0x49b1c6){_0x4f41e5=_0x4f41e5-0x0;var _0x53da2a=_0x6b0f[_0x4f41e5];return _0x53da2a;};'use strict';var _=require(_0xf6b0('0x0'));var util=require('util');var logger=require(_0xf6b0('0x1'))(_0xf6b0('0x2'));var moment=require('moment');var BPromise=require(_0xf6b0('0x3'));var rp=require(_0xf6b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappTransferReport.attributes');module[_0xf6b0('0x5')]=function(_0x3eec44,_0x9fdcd8){return _0x3eec44['define'](_0xf6b0('0x6'),attributes,{'tableName':_0xf6b0('0x7'),'paranoid':![],'indexes':[{'name':_0xf6b0('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +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 diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 49ece2c..1cbca69 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 _0xe22f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x3e9c8f,_0x487e03){var _0x4ab645=function(_0xe86563){while(--_0xe86563){_0x3e9c8f['push'](_0x3e9c8f['shift']());}};_0x4ab645(++_0x487e03);}(_0xe22f,0x1e0));var _0xfe22=function(_0x1928db,_0x175da4){_0x1928db=_0x1928db-0x0;var _0x45b23e=_0xe22f[_0x1928db];return _0x45b23e;};'use strict';var _=require(_0xfe22('0x0'));var util=require(_0xfe22('0x1'));var moment=require(_0xfe22('0x2'));var BPromise=require(_0xfe22('0x3'));var rs=require(_0xfe22('0x4'));var fs=require('fs');var Redis=require(_0xfe22('0x5'));var db=require(_0xfe22('0x6'))['db'];var utils=require(_0xfe22('0x7'));var logger=require(_0xfe22('0x8'))(_0xfe22('0x9'));var config=require('../../config/environment');var jayson=require(_0xfe22('0xa'));var client=jayson[_0xfe22('0xb')][_0xfe22('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x28b469,_0x5930b5,_0x34313a){return new BPromise(function(_0x2717e8,_0x5f3f77){return client[_0xfe22('0xd')](_0x28b469,_0x34313a)[_0xfe22('0xe')](function(_0x528f68){logger[_0xfe22('0xf')](_0xfe22('0x10'),_0x5930b5,_0xfe22('0x11'));logger[_0xfe22('0x12')](_0xfe22('0x13'),_0x5930b5,_0xfe22('0x11'),JSON['stringify'](_0x528f68));if(_0x528f68[_0xfe22('0x14')]){if(_0x528f68['error']['code']===0x1f4){logger['error'](_0xfe22('0x10'),_0x5930b5,_0x528f68[_0xfe22('0x14')][_0xfe22('0x15')]);return _0x5f3f77(_0x528f68[_0xfe22('0x14')][_0xfe22('0x15')]);}logger['error'](_0xfe22('0x10'),_0x5930b5,_0x528f68[_0xfe22('0x14')][_0xfe22('0x15')]);return _0x2717e8(_0x528f68[_0xfe22('0x14')]['message']);}else{logger[_0xfe22('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5930b5,_0xfe22('0x11'));_0x2717e8(_0x528f68[_0xfe22('0x16')][_0xfe22('0x15')]);}})[_0xfe22('0x17')](function(_0x526175){logger[_0xfe22('0x14')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5930b5,_0x526175);_0x5f3f77(_0x526175);});});} \ No newline at end of file +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 diff --git a/server/app.js b/server/app.js index b0249db..5b56de5 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcee4=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen','info','then','start','Online\x20apps:','map','online','name','join','Offline\x20apps:','status','None','./config/seedDB','default','./config/license','catch'];(function(_0x2126f0,_0x537e93){var _0x33618c=function(_0x27f9f8){while(--_0x27f9f8){_0x2126f0['push'](_0x2126f0['shift']());}};_0x33618c(++_0x537e93);}(_0xcee4,0x72));var _0x4cee=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xcee4[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x4cee('0x0'));var mysqldb=require(_0x4cee('0x1'));var rpc=require(_0x4cee('0x2'));var config=require(_0x4cee('0x3'));var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require('./config/pm2/config');var schedule=require(_0x4cee('0x4'));var chat=require(_0x4cee('0x5'));var whatsapp=require(_0x4cee('0x6'));var transcribe=require(_0x4cee('0x7'));function main(){return mysqldb['db'][_0x4cee('0x8')][_0x4cee('0x9')]()['then'](function(){return rpc[_0x4cee('0xa')]();})['then'](function(_0x3bb037){logger[_0x4cee('0xb')](_0x3bb037);return chat['start']();})[_0x4cee('0xc')](function(){return whatsapp[_0x4cee('0xd')]();})[_0x4cee('0xc')](function(){return schedule[_0x4cee('0xd')]();})[_0x4cee('0xc')](function(){return transcribe[_0x4cee('0xd')]();})[_0x4cee('0xc')](function(_0x1441a8){logger[_0x4cee('0xb')](_0x1441a8);return pm2['start'](pm2Config);})[_0x4cee('0xc')](function(_0x10cf6f){logger['info'](_0x4cee('0xe'),_[_0x4cee('0xf')](_['filter'](_0x10cf6f,{'status':_0x4cee('0x10')}),_0x4cee('0x11'))[_0x4cee('0x12')]());logger['info'](_0x4cee('0x13'),_[_0x4cee('0xf')](_['filter'](_0x10cf6f,function(_0x150a1f){return _0x150a1f[_0x4cee('0x14')]!==_0x4cee('0x10');}),_0x4cee('0x11'))[_0x4cee('0x12')]()||_0x4cee('0x15'));config['seedDB']&&require(_0x4cee('0x16'))[_0x4cee('0x17')]();require(_0x4cee('0x18'))['default']();})[_0x4cee('0x19')](function(_0x553dd3){logger['error'](_0x4cee('0x1a'),_0x553dd3);process[_0x4cee('0x1b')](0x1);});}main(); \ No newline at end of file +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 diff --git a/server/components/auth/service.js b/server/components/auth/service.js index c92f0ed..2cc1da4 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 _0xd87c=['status','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','Basic','User','find','name','then','authenticate','pass','startsWith','headers','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blockedAt','minutes','Invalid\x20API\x20access\x20key','User\x20object\x20not\x20found.','getLicense','Forbidden','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','join','secret','session','payload','options','verify','secrets','randomBytes','toString','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','lodash','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','fullname','internal','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','showWebBar','lastLoginAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','userProfileId','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','disposition','closed'];(function(_0x483310,_0x5db3b1){var _0x80b5a2=function(_0x27e0f9){while(--_0x27e0f9){_0x483310['push'](_0x483310['shift']());}};_0x80b5a2(++_0x5db3b1);}(_0xd87c,0x13d));var _0xcd87=function(_0x357d66,_0x4445c3){_0x357d66=_0x357d66-0x0;var _0x295370=_0xd87c[_0x357d66];return _0x295370;};'use strict';var db=require(_0xcd87('0x0'))['db'];var config=require(_0xcd87('0x1'));var hardwareConf=require(_0xcd87('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0xcd87('0x3'));var _=require(_0xcd87('0x4'));var jwt=require('jsonwebtoken');var expressJwt=require(_0xcd87('0x5'));var compose=require(_0xcd87('0x6'));var basicAuth=require(_0xcd87('0x7'));var crypto=require(_0xcd87('0x8'));var BPromise=require(_0xcd87('0x9'));var util=require(_0xcd87('0xa'));var moment=require(_0xcd87('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id','role',_0xcd87('0xc'),'name',_0xcd87('0xd'),'email',_0xcd87('0xe'),_0xcd87('0xf'),_0xcd87('0x10'),_0xcd87('0x11'),_0xcd87('0x12'),_0xcd87('0x13'),_0xcd87('0x14'),_0xcd87('0x15'),'openchannelPause','pauseType',_0xcd87('0x16'),_0xcd87('0x17'),'lastPauseAt',_0xcd87('0x18'),_0xcd87('0x19'),'passwordResetAt','alias',_0xcd87('0x1a'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xcd87('0x1b'),_0xcd87('0x1c'),_0xcd87('0x1d'),_0xcd87('0x1e'),_0xcd87('0x1f'),'phoneBarRemoteControl',_0xcd87('0x20'),_0xcd87('0x21'),'interface',_0xcd87('0x22'),'privacyEnabled',_0xcd87('0x23'),_0xcd87('0x24'),'downloadVoiceRecordings',_0xcd87('0x25'),_0xcd87('0x26'),_0xcd87('0x27'),_0xcd87('0x28')];exports[_0xcd87('0x29')]=function(){return this[_0xcd87('0x2a')](!![])[_0xcd87('0x2b')](function(_0x48e9ae,_0x17075f,_0x1775aa){if(_0x48e9ae[_0xcd87('0x2c')]){_0x1775aa();}else{return db[_0xcd87('0x2d')][_0xcd87('0x2e')]({'where':{'id':_0x48e9ae['params']['id']},'attributes':['id','closed',_0xcd87('0x2f')],'raw':!![]})['then'](function(_0xcfcf53){if(_0xcfcf53&&_0xcfcf53[_0xcd87('0x30')]){return _0x17075f[_0xcd87('0x31')](_0xcfcf53[_0xcd87('0x2f')]===_0xcd87('0x32')?0x195:0x193)[_0xcd87('0x33')]({'message':_0xcfcf53[_0xcd87('0x2f')]===_0xcd87('0x32')?_0xcd87('0x34'):_0xcd87('0x35')});}else{_0x1775aa();}})[_0xcd87('0x36')](function(_0x56d7a2){_0x1775aa(_0x56d7a2);});}});};exports['isAuthenticated']=function isAuthenticated(_0x1fdee4){return compose()[_0xcd87('0x2b')](function(_0x1b17e8,_0x2b38e1,_0x1929d6){var _0xdaa2f7;if(_0x1b17e8['headers'][_0xcd87('0x37')]){if(_['startsWith'](_0x1b17e8['headers'][_0xcd87('0x37')],_0xcd87('0x38'))){var _0x5b82d8=basicAuth(_0x1b17e8);db[_0xcd87('0x39')][_0xcd87('0x3a')]({'where':{'name':_0x5b82d8[_0xcd87('0x3b')]}})[_0xcd87('0x3c')](function(_0x403016){if(!_0x403016||!_0x403016[_0xcd87('0x3d')](_0x5b82d8[_0xcd87('0x3e')])){return _0x2b38e1[_0xcd87('0x31')](0x191)[_0xcd87('0x33')]({'message':'Wrong\x20credentials.'});}_0x1b17e8[_0xcd87('0x2c')]={'id':_0x403016['id']};_0x1929d6();})['catch'](function(_0x5dab3d){_0x1929d6(_0x5dab3d);});}else if(_[_0xcd87('0x3f')](_0x1b17e8[_0xcd87('0x40')][_0xcd87('0x37')],_0xcd87('0x41'))){validateJwt(_0x1b17e8,_0x2b38e1,_0x1929d6);}else{if(_0x1fdee4){_0x1929d6();}else{return _0x2b38e1['status'](0x193)['json']({'message':_0xcd87('0x42')});}}}else if(_0x1b17e8['query'][_0xcd87('0x43')]){try{var _0x40ed35={'audience':hardwareConf[_0xcd87('0x44')](),'issuer':hardwareConf[_0xcd87('0x44')]()};verifyJwt(_0x1b17e8[_0xcd87('0x45')][_0xcd87('0x43')],_0x40ed35)[_0xcd87('0x3c')](function(_0x350b9f){return db['User']['find']({'where':{'id':_0x350b9f[_0xcd87('0x46')]}})[_0xcd87('0x3c')](function(_0x88e218){_0xdaa2f7=_0x88e218;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xcd87('0x47'),_0xcd87('0x48')],'raw':!![]});})[_0xcd87('0x3c')](function(_0x2a4f4f){if(!_0xdaa2f7||!_[_0xcd87('0x49')](_0xdaa2f7[_0xcd87('0x4a')],_0x350b9f[_0xcd87('0x4b')])){return _0x2b38e1['status'](0x191)[_0xcd87('0x33')]({'message':_0xcd87('0x4c')});}if(_0xdaa2f7[_0xcd87('0x4d')]){return _0x2b38e1[_0xcd87('0x31')](0x191)[_0xcd87('0x33')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0xdaa2f7['blocked']){if(_0x2a4f4f[_0xcd87('0x48')]>0x0){if(moment(_0xdaa2f7[_0xcd87('0x4e')])['add'](_0x2a4f4f[_0xcd87('0x48')],_0xcd87('0x4f'))>moment()){return _0x2b38e1[_0xcd87('0x31')](0x191)[_0xcd87('0x33')]({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x2b38e1[_0xcd87('0x31')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}_0x1b17e8[_0xcd87('0x2c')]={'id':_0xdaa2f7['id']};_0x1929d6();});})['catch'](function(){return _0x2b38e1['status'](0x191)[_0xcd87('0x33')]({'message':_0xcd87('0x50')});});}catch(_0x5a8d64){_0x1929d6(_0x5a8d64);}}else if(_0x1fdee4){_0x1929d6();}else{return _0x2b38e1[_0xcd87('0x31')](0x193)[_0xcd87('0x33')]({'message':_0xcd87('0x42')});}})[_0xcd87('0x2b')](function(_0x578271,_0x5c7d0d,_0x520929){if(_0x578271['user']){db[_0xcd87('0x39')][_0xcd87('0x3a')]({'where':{'id':_0x578271[_0xcd87('0x2c')]['id']},'attributes':userAttributes})[_0xcd87('0x3c')](function(_0x79566){if(!_0x79566){return _0x5c7d0d[_0xcd87('0x31')](0x194)['json']({'message':'User\x20not\x20found.'});}_0x578271[_0xcd87('0x2c')]=_0x79566;_0x520929();})[_0xcd87('0x36')](function(_0x32ab79){_0x520929(_0x32ab79);});}else if(_0x1fdee4){_0x520929();}else{return _0x5c7d0d[_0xcd87('0x31')](0x194)[_0xcd87('0x33')]({'message':_0xcd87('0x51')});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xcd87('0x2b')](function(_0x2d700b,_0x2701c0,_0x4c198f){return licenseUtil[_0xcd87('0x52')]()[_0xcd87('0x3c')](function(_0x38ec12){if(_0x38ec12['update']){_0x4c198f();}else{return _0x2701c0[_0xcd87('0x31')](0x193)[_0xcd87('0x33')]({'message':_0xcd87('0x53')});}})[_0xcd87('0x36')](function(_0x5536d8){_0x4c198f(_0x5536d8);});});};exports[_0xcd87('0x54')]=function(_0x2f75d1,_0x32d287,_0x5ebbee){_0x2f75d1[_0xcd87('0x54')]=!![];return _0x5ebbee();};exports[_0xcd87('0x55')]=function signToken(_0x14c364){return signJwt(_0x14c364);};exports['setTokenCookie']=function(_0x325a7b,_0x44eb01){if(!_0x325a7b[_0xcd87('0x2c')]){return _0x44eb01[_0xcd87('0x31')](0x194)[_0xcd87('0x33')]({'message':_0xcd87('0x56')});}var _0x171135={'payload':{'id':_0x325a7b[_0xcd87('0x2c')]['id'],'role':_0x325a7b[_0xcd87('0x2c')][_0xcd87('0x57')]},'options':{'expiresIn':0x15180}};return signJwt(_0x171135)['then'](function(_0x5d5215){_0x44eb01[_0xcd87('0x58')](_0xcd87('0x59'),_0x5d5215);_0x44eb01[_0xcd87('0x5a')](_0xcd87('0x5b'));})[_0xcd87('0x36')](function(_0x2c1888){return _0x44eb01['status'](0x1f4)[_0xcd87('0x5c')](_0x2c1888);});};exports[_0xcd87('0x5d')]=function(_0x570dec){if(_['isNil'](_0x570dec['apiKeyNonce'])||_[_0xcd87('0x5e')](_0x570dec['apiKeyIat'])){return null;}else{return createJwt(_0x570dec);}};exports[_0xcd87('0x5f')]=function(_0x512ce0){_0x512ce0['apiKeyNonce']=generateNonce();_0x512ce0[_0xcd87('0x60')]=generateIssuedAt();return createJwt(_0x512ce0);};exports[_0xcd87('0x61')]=function(_0x17bf5a,_0x146180){var _0x3e2422=_0x17bf5a[_0xcd87('0x45')][_0xcd87('0x43')];if(_0x3e2422){var _0x276890={'nonce':_0x146180[_0xcd87('0x4a')],'iat':_0x146180[_0xcd87('0x60')],'audience':hardwareConf[_0xcd87('0x44')](),'issuer':hardwareConf[_0xcd87('0x44')]()};return verifyJwt(_0x3e2422,_0x276890)[_0xcd87('0x3c')](function(){return generateApiKey(_0x146180);});}else{throw{'message':_0xcd87('0x62')};}};exports[_0xcd87('0x63')]=function(_0x64469c){var _0x970b9e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x970b9e['test'](_0x64469c))throw new db[(_0xcd87('0x64'))][(_0xcd87('0x65'))](_0xcd87('0x66'));return;};exports[_0xcd87('0x67')]=function(_0x18bf23,_0x2033a8,_0x38e532){var _0x217734=encryptor[_0xcd87('0x68')](_0x2033a8)[_0xcd87('0x69')](',');for(var _0x2b0b0e=0x0;_0x2b0b0e<_0x38e532;_0x2b0b0e++){if(!_0x217734[_0x2b0b0e])break;if(_0x18bf23[_0xcd87('0x6a')]()===_0x217734[_0x2b0b0e]['toLowerCase']()){var _0xe3b21f=util['format'](_0xcd87('0x6b'),_0x38e532);if(_0x38e532===0x1){_0xe3b21f=_0xcd87('0x6c');}throw new db[(_0xcd87('0x64'))][(_0xcd87('0x65'))](_0xe3b21f);}}return;};exports[_0xcd87('0x6d')]=function(_0x5e0314,_0x43d5eb){var _0x112830=_0x43d5eb?encryptor[_0xcd87('0x68')](_0x43d5eb)[_0xcd87('0x69')](','):[];if(_0x112830['length']===0x5){_0x112830[_0xcd87('0x6e')](-0x1,0x1);}_0x112830['unshift'](_0x5e0314);return encryptor['encryptString'](_0x112830[_0xcd87('0x6f')](','));};function signJwt(_0x3de8fd){var _0x219ba6=BPromise['promisify'](jwt['sign'],{'context':jwt});var _0x5e047e=_0x3de8fd[_0xcd87('0x70')]||config['secrets'][_0xcd87('0x71')];return new BPromise(function(_0x5b95a7,_0x362dad){_0x219ba6(_0x3de8fd[_0xcd87('0x72')],_0x5e047e,_0x3de8fd[_0xcd87('0x73')])[_0xcd87('0x3c')](function(_0x57df10){_0x5b95a7(_0x57df10);})[_0xcd87('0x36')](function(_0x5aebad){_0x362dad(_0x5aebad);});});}function verifyJwt(_0x222eee,_0x5b90b5,_0x808d5a){var _0x4c755=BPromise['promisify'](jwt[_0xcd87('0x74')],{'context':jwt});var _0x52aba2=_0x808d5a||config[_0xcd87('0x75')][_0xcd87('0x71')];return new BPromise(function(_0x166a53,_0x263619){_0x4c755(_0x222eee,_0x52aba2,_0x5b90b5)[_0xcd87('0x3c')](function(_0xf1840c){_0x166a53(_0xf1840c);})['catch'](function(_0x5b4285){_0x263619(_0x5b4285);});});}function generateNonce(){return crypto[_0xcd87('0x76')](0x10)[_0xcd87('0x77')]('hex');}function generateIssuedAt(){return Math['floor'](Date[_0xcd87('0x78')]()/0x3e8)[_0xcd87('0x77')]();}function createJwt(_0x482ebb){var _0x17b5bc={'payload':{'iat':_0x482ebb[_0xcd87('0x60')],'nonce':_0x482ebb[_0xcd87('0x4a')]},'options':{'algorithm':_0xcd87('0x79'),'subject':_0x482ebb['id'][_0xcd87('0x77')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xcd87('0x44')]()}};return signJwt(_0x17b5bc)[_0xcd87('0x3c')](function(_0x3ddf55){return{'iat':_0x482ebb[_0xcd87('0x60')],'nonce':_0x482ebb['apiKeyNonce'],'token':_0x3ddf55};});} \ No newline at end of file +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 diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index bb858b2..217694f 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 _0x88bc=['indexOf','hasOwnProperty','createCipher','update','write','end','binary','close','decryptFile','createWriteStream','createDecipher','final','unlink','utf8','base64','decryptString','secret','crypto','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter'];(function(_0x47f7a7,_0x2136b6){var _0x4aa075=function(_0xf4be8){while(--_0xf4be8){_0x47f7a7['push'](_0x47f7a7['shift']());}};_0x4aa075(++_0x2136b6);}(_0x88bc,0x18a));var _0xc88b=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x88bc[_0x4953da];return _0x2d3780;};'use strict';var crypto=require(_0xc88b('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0xc88b('0x1'));var logger=require(_0xc88b('0x2'))(_0xc88b('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xc88b('0x4')]['session'],'algorithm':_0xc88b('0x5')};const fileOptions={'algorithm':'aes192'};if(config[_0xc88b('0x6')]&&config[_0xc88b('0x6')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0xc88b('0x6')][_0xc88b('0x7')]);if(isSupported){fileOptions[_0xc88b('0x7')]=config['encrypt']['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0xc88b('0x8')](',\x20');logger['error'](config[_0xc88b('0x6')][_0xc88b('0x7')],_0xc88b('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x10d65f){return AES_SUPPORTED_RX[_0xc88b('0xa')](_0x10d65f);}function getSupportedCiphers(){return crypto['getCiphers']()[_0xc88b('0xb')](isASupportedCipher);}function isAlgorithmSupported(_0x43e471){return getSupportedCiphers()[_0xc88b('0xc')](_0x43e471)>-0x1;}function combineOptions(_0x1f5d35){var _0x9cf104={};for(var _0x37a333 in fileOptions){if(fileOptions['hasOwnProperty'](_0x37a333)){_0x9cf104[_0x37a333]=fileOptions[_0x37a333];}}if(_0x1f5d35){for(var _0x466997 in _0x1f5d35){if(_0x1f5d35[_0xc88b('0xd')](_0x466997)){_0x9cf104[_0x466997]=_0x1f5d35[_0x466997];}}}return _0x9cf104;}exports['encryptFile']=function(_0xb16e52,_0x4175fa,_0x5f408f,_0xc16692){return new BPromise(function(_0x29a9de,_0x4154fd){_0xc16692=combineOptions(_0xc16692);var _0x268b4e=new Buffer(_0x5f408f);var _0x2513b6=fs['createReadStream'](_0xb16e52);var _0x449bf8=fs['createWriteStream'](_0x4175fa);var _0x291d64=crypto[_0xc88b('0xe')](_0xc16692[_0xc88b('0x7')],_0x268b4e);_0x2513b6['on']('data',function(_0x157be1){var _0x3f141c=new Buffer(_0x291d64[_0xc88b('0xf')](_0x157be1),'binary');_0x449bf8[_0xc88b('0x10')](_0x3f141c);});_0x2513b6['on'](_0xc88b('0x11'),function(){try{var _0x17f5ee=new Buffer(_0x291d64['final']('binary'),_0xc88b('0x12'));_0x449bf8['write'](_0x17f5ee);_0x449bf8[_0xc88b('0x11')]();_0x449bf8['on'](_0xc88b('0x13'),function(){return _0x29a9de(_0x4175fa);});}catch(_0x137e91){fs['unlink'](_0x4175fa);return _0x4154fd(_0x137e91);}});});};exports[_0xc88b('0x14')]=function(_0x48a07e,_0x1a907c,_0x46c418,_0xf7d558){return new BPromise(function(_0x1ae315,_0x4bbb64){_0xf7d558=combineOptions(_0xf7d558);var _0x51a3d1=new Buffer(_0x46c418);var _0x30c36d=fs['createReadStream'](_0x48a07e);var _0x194623=fs[_0xc88b('0x15')](_0x1a907c);var _0x2e96b7=crypto[_0xc88b('0x16')](_0xf7d558['algorithm'],_0x51a3d1);_0x30c36d['on']('data',function(_0x43c1f4){var _0x1c9a31=new Buffer(_0x2e96b7[_0xc88b('0xf')](_0x43c1f4),_0xc88b('0x12'));_0x194623[_0xc88b('0x10')](_0x1c9a31);});_0x30c36d['on']('end',function(){try{var _0x2bbb5b=new Buffer(_0x2e96b7[_0xc88b('0x17')](_0xc88b('0x12')),_0xc88b('0x12'));_0x194623['write'](_0x2bbb5b);_0x194623[_0xc88b('0x11')]();_0x194623['on'](_0xc88b('0x13'),function(){return _0x1ae315(_0x1a907c);});}catch(_0x419022){fs[_0xc88b('0x18')](_0x1a907c);return _0x4bbb64(_0x419022);}});});};exports['encryptString']=function(_0x5454b9,_0x16c8b1,_0x3f9a55){var _0x4da5e6=_0x3f9a55||stringOptions[_0xc88b('0x7')];var _0x23355b=_0x16c8b1||stringOptions['secret'];var _0x5dc3a5=crypto[_0xc88b('0xe')](_0x4da5e6,_0x23355b);var _0x23f7ab=_0x5dc3a5[_0xc88b('0xf')](_0x5454b9,_0xc88b('0x19'),_0xc88b('0x1a'));_0x23f7ab+=_0x5dc3a5['final']('base64');return _0x23f7ab;};exports[_0xc88b('0x1b')]=function(_0x476755,_0x48be30,_0x278ed5){var _0x3f9b5c=_0x278ed5||stringOptions[_0xc88b('0x7')];var _0x5ba768=_0x48be30||stringOptions[_0xc88b('0x1c')];var _0x2ff80e=crypto['createDecipher'](_0x3f9b5c,_0x5ba768);var _0x393fd5=_0x2ff80e['update'](_0x476755,_0xc88b('0x1a'),_0xc88b('0x19'));_0x393fd5+=_0x2ff80e[_0xc88b('0x17')](_0xc88b('0x19'));return _0x393fd5;}; \ No newline at end of file +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 diff --git a/server/components/export/csv.js b/server/components/export/csv.js index ed4871e..58fe3da 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 _0x67b4=['update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','range','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','push','dirname','.csv','existsSync','join','%s%d.%s','csv','%s.%s','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport'];(function(_0x54c29e,_0x1d94f9){var _0x3c8201=function(_0x28a61a){while(--_0x28a61a){_0x54c29e['push'](_0x54c29e['shift']());}};_0x3c8201(++_0x1d94f9);}(_0x67b4,0x8c));var _0x467b=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x67b4[_0x36c5b0];return _0xf19333;};'use strict';var util=require(_0x467b('0x0'));var path=require(_0x467b('0x1'));var _=require(_0x467b('0x2'));var csv=require(_0x467b('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x467b('0x4'));var rimraf=require(_0x467b('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0x467b('0x6'))[_0x467b('0x7')];var logger=require(_0x467b('0x8'))(_0x467b('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x467b('0xa')][0x2]);var QUERY=process[_0x467b('0xa')][0x3];var PATH=process[_0x467b('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x1d3eca,_0x3467c2){var _0x426c9d={'status':_0x1d3eca};var _0x133887={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3467c2){_0x426c9d[_0x467b('0xb')]=_0x3467c2;}return db[_0x467b('0xc')][_0x467b('0xd')](_0x426c9d,_0x133887);}function main(){var _0x4d72d4=0x1388;var _0x455b1d;logger[_0x467b('0xe')](util['format'](_0x467b('0xf'),EXTRACTED_REPORT_ID,_0x467b('0x10')));return db[_0x467b('0x11')][_0x467b('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x467b('0x13'),_0x467b('0x14')]})['then'](function(_0x278ffe){if(_0x278ffe){_0x455b1d=_0x278ffe;_0x4d72d4=_0x455b1d[_0x467b('0x14')]||0x1388;}})[_0x467b('0x15')](function(){return dbH[_0x467b('0x16')][_0x467b('0x17')](util[_0x467b('0x18')](_0x467b('0x19'),QUERY),{'type':dbH[_0x467b('0x16')][_0x467b('0x1a')]['SELECT']});})[_0x467b('0x15')](function(_0x47f8a2){if(!_0x47f8a2[0x0][_0x467b('0x1b')]){return analyticExtractedReport('Empty');}var _0x212480=[];var _0x4f4eea=0x0;if(_0x455b1d['split']){if(_0x47f8a2&&_0x47f8a2[_0x467b('0x1c')]){var _0x3e492a=_[_0x467b('0x1d')](_0x47f8a2[0x0][_0x467b('0x1b')]/_0x4d72d4);var _0x13fb13=Number['isInteger'](_0x47f8a2[0x0][_0x467b('0x1b')]/_0x4d72d4)?_0x47f8a2[0x0]['num']%_0x4d72d4:0x0;_0x3e492a[_0x467b('0x1e')](function(_0x4b0e82){if(_0x4b0e82>0x0){_0x4f4eea+=_0x4d72d4;}_0x212480['push'](dbH[_0x467b('0x16')][_0x467b('0x17')](util[_0x467b('0x18')](_0x467b('0x1f'),QUERY,_0x4d72d4,_0x4f4eea),{'type':dbH[_0x467b('0x16')][_0x467b('0x1a')]['SELECT']}));});if(_0x13fb13>0x0){_0x4f4eea+=_0x4d72d4;_0x212480['push'](dbH[_0x467b('0x16')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x13fb13,_0x4f4eea),{'type':dbH['sequelize'][_0x467b('0x1a')][_0x467b('0x20')]}));}}}else{_0x212480[_0x467b('0x21')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x467b('0x16')]['QueryTypes'][_0x467b('0x20')]}));}var _0x1ef1c0=path[_0x467b('0x22')](PATH);var _0x439c59=path['basename'](PATH,_0x467b('0x23'));var _0x244fae=_0x455b1d[_0x467b('0x13')]&&_0x212480[_0x467b('0x1c')]>0x1;var _0x287aeb=[];if(!fs[_0x467b('0x24')](path[_0x467b('0x25')](_0x1ef1c0,_0x439c59))&&_0x244fae){fs['mkdirSync'](path[_0x467b('0x25')](_0x1ef1c0,_0x439c59));}return BPromise['each'](_0x212480,function(_0x5cbd3d){_0x287aeb['push'](_0x5cbd3d);})[_0x467b('0x15')](function(){for(var _0x5da5eb=0x0;_0x5da5eb<_0x287aeb[_0x467b('0x1c')];_0x5da5eb+=0x1){var _0x29685b;var _0x1cacc3=_0x287aeb[_0x5da5eb];if(_0x244fae){_0x29685b=path[_0x467b('0x25')](_0x1ef1c0,_0x439c59,util[_0x467b('0x18')](_0x467b('0x26'),_0x439c59,_0x5da5eb,_0x467b('0x27')));}else{_0x29685b=path[_0x467b('0x25')](_0x1ef1c0,util['format'](_0x467b('0x28'),_0x439c59,_0x467b('0x27')));}fs[_0x467b('0x29')](_0x29685b,csv(_0x1cacc3));}})['then'](function(){if(_0x244fae){return new Promise(function(_0x18943b){zipdir(path[_0x467b('0x25')](_0x1ef1c0,_0x439c59),{'saveTo':path[_0x467b('0x25')](_0x1ef1c0,util[_0x467b('0x18')](_0x467b('0x28'),_0x439c59,_0x467b('0x2a')))},function(_0x53cf8e,_0xda63b4){rimraf(path[_0x467b('0x25')](_0x1ef1c0,_0x439c59),function(){});_0x18943b(_0x467b('0x2b'));});});}})[_0x467b('0x15')](function(){logger[_0x467b('0xe')](util['format'](_0x467b('0x2c'),EXTRACTED_REPORT_ID,_0x467b('0x10')));return analyticExtractedReport(_0x467b('0x2d'),_0x244fae?util[_0x467b('0x18')](_0x467b('0x28'),_0x439c59,_0x244fae?_0x467b('0x2a'):_0x467b('0x27')):null);});})[_0x467b('0x2e')](function(_0x15e01c){logger[_0x467b('0xe')](util[_0x467b('0x18')](_0x467b('0x2f'),EXTRACTED_REPORT_ID,_0x467b('0x10')),util[_0x467b('0x30')](_0x15e01c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x467b('0x31')](function(){process[_0x467b('0x32')](EXIT_CODE);});}main(); \ No newline at end of file +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 diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index f9be602..64d230b 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 _0xcc68=['Arial','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','end','createPdfFromHTML','path','pdfmake/src/printer','zip-dir','rimraf','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','value','fill','length','auto','body','concat','chunk','keys','forEach','push','format','name','startDate','endDate','header','pageBreak','landscape','\x20/\x20','footer','black','right','Empty','find','split','then','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','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'];(function(_0x491642,_0x43736d){var _0x81d75c=function(_0x533b02){while(--_0x533b02){_0x491642['push'](_0x491642['shift']());}};_0x81d75c(++_0x43736d);}(_0xcc68,0x113));var _0x8cc6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xcc68[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var fs=require('fs');var util=require('util');var path=require(_0x8cc6('0x0'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x8cc6('0x1'));var zipdir=require(_0x8cc6('0x2'));var rimraf=require(_0x8cc6('0x3'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')[_0x8cc6('0x4')];var BPromise=require(_0x8cc6('0x5'));var db=require(_0x8cc6('0x6'))['db'];var dbH=require(_0x8cc6('0x6'))[_0x8cc6('0x7')];var logger=require(_0x8cc6('0x8'))(_0x8cc6('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x8cc6('0xa')][0x4];var NAME=process[_0x8cc6('0xa')][0x5];var FORMAT='MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a';var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1036f4,_0x18ea5c){var _0x30109f={'status':_0x1036f4};var _0x5a8740={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x18ea5c){_0x30109f[_0x8cc6('0xb')]=_0x18ea5c;}return db[_0x8cc6('0xc')]['update'](_0x30109f,_0x5a8740);}function getHeaders(_0x49a8cc){return _[_0x8cc6('0xd')](_0x49a8cc,function(_0x35e475){return{'text':_0x35e475,'style':_0x8cc6('0xe')};});}function getRows(_0x3dde42,_0x459d78){return _['map'](_0x459d78,function(_0x3ecb3b){return _(_0x3ecb3b)[_0x8cc6('0xf')](_0x3dde42)[_0x8cc6('0xd')](function(_0x5aec67){return _0x5aec67?_[_0x8cc6('0x10')](_0x5aec67):'';})[_0x8cc6('0x11')]();});}function createTable(_0x55a796,_0x129840){var _0x3226ef={'widths':_[_0x8cc6('0x12')](Array(_0x55a796[_0x8cc6('0x13')]),0x91),'heights':function(_0x532687){return _0x532687===0x0?_0x8cc6('0x14'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2eb9ac=getHeaders(_0x55a796);_0x3226ef['body']['push'](_0x2eb9ac);var _0x1e91ec=getRows(_0x55a796,_0x129840);_0x3226ef['body']=_0x3226ef[_0x8cc6('0x15')][_0x8cc6('0x16')](_0x1e91ec);return _0x3226ef;}function createTables(_0xd1324){var _0x15cdd7=[];var _0x3c19fe=_[_0x8cc6('0x17')](Object[_0x8cc6('0x18')](_0xd1324[0x0]),0x5);_0x3c19fe[_0x8cc6('0x19')](function(_0x295c76){_0x15cdd7[_0x8cc6('0x1a')](createTable(_0x295c76,_0xd1324));});return _0x15cdd7;}function getPDFDocDefinition(_0x8eca9f){var _0xfdb5b=util[_0x8cc6('0x1b')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x8cc6('0x1c')],moment(EXTRACTED_REPORT[_0x8cc6('0x1d')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0x8cc6('0x1e')])[_0x8cc6('0x1b')](FORMAT));var _0x519175=[];for(var _0x52d989=0x0;_0x52d989<_0x8eca9f['length'];_0x52d989++){var _0x2b214a=[];if(_0x52d989===0x0){_0x2b214a[_0x8cc6('0x1a')]({'text':_0xfdb5b,'style':_0x8cc6('0x1f')});}var _0x237d5b={'table':_0x8eca9f[_0x52d989]};if(_0x52d989>0x0){_0x237d5b[_0x8cc6('0x20')]='before';_0x237d5b['margin']=[0x0,0x46,0x0,0x0];}_0x2b214a[_0x8cc6('0x1a')](_0x237d5b);_0x519175[_0x8cc6('0x1a')](_0x2b214a);}return{'pageSize':'A4','pageOrientation':_0x8cc6('0x21'),'content':_0x519175,'footer':function(_0x3c97f9,_0x153a61){return{'text':_0x3c97f9[_0x8cc6('0x10')]()+_0x8cc6('0x22')+_0x153a61,'style':_0x8cc6('0x23')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x8cc6('0x24')},'footer':{'alignment':_0x8cc6('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x531b01){var _0x41a3db=0x1388;var _0x484fa8;if(!_0x531b01[0x0]['num']){return analyticExtractedReport(_0x8cc6('0x26'));}return db['Setting'][_0x8cc6('0x27')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8cc6('0x28'),'splitSizePdf']})[_0x8cc6('0x29')](function(_0x436946){if(_0x436946){_0x484fa8=_0x436946;_0x41a3db=_0x484fa8['splitSizePdf']||0x3e8;}})['then'](function(){var _0x512960=[];var _0x4b10dc=0x0;if(_0x484fa8['split']){if(_0x531b01&&_0x531b01[_0x8cc6('0x13')]){var _0x4bd75a=_[_0x8cc6('0x2a')](_0x531b01[0x0]['num']/_0x41a3db);var _0x77baa=Number[_0x8cc6('0x2b')](_0x531b01[0x0]['num']/_0x41a3db)?_0x531b01[0x0]['num']%_0x41a3db:0x0;_0x4bd75a[_0x8cc6('0x19')](function(_0x4a16f8){if(_0x4a16f8>0x0){_0x4b10dc+=_0x41a3db;}_0x512960[_0x8cc6('0x1a')](dbH[_0x8cc6('0x2c')][_0x8cc6('0x2d')](util[_0x8cc6('0x1b')](_0x8cc6('0x2e'),QUERY,_0x41a3db,_0x4b10dc),{'type':dbH[_0x8cc6('0x2c')][_0x8cc6('0x2f')][_0x8cc6('0x30')]}));});if(_0x77baa>0x0){_0x4b10dc+=_0x41a3db;_0x512960[_0x8cc6('0x1a')](dbH[_0x8cc6('0x2c')][_0x8cc6('0x2d')](util[_0x8cc6('0x1b')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x77baa,_0x4b10dc),{'type':dbH['sequelize']['QueryTypes'][_0x8cc6('0x30')]}));}}}else{_0x512960[_0x8cc6('0x1a')](dbH[_0x8cc6('0x2c')][_0x8cc6('0x2d')](QUERY,{'type':dbH[_0x8cc6('0x2c')][_0x8cc6('0x2f')][_0x8cc6('0x30')]}));}var _0x14e5f0=path['dirname'](PATH);var _0x1d9236=path[_0x8cc6('0x31')](PATH,_0x8cc6('0x32'));var _0x25603e=_0x484fa8[_0x8cc6('0x28')]&&_0x512960['length']>0x1;var _0x3acd79=[];if(!fs[_0x8cc6('0x33')](path[_0x8cc6('0x34')](_0x14e5f0,_0x1d9236))&&_0x25603e){fs[_0x8cc6('0x35')](path[_0x8cc6('0x34')](_0x14e5f0,_0x1d9236));}return BPromise[_0x8cc6('0x36')](_0x512960,function(_0xc6031f){_0x3acd79[_0x8cc6('0x1a')](_0xc6031f);})[_0x8cc6('0x29')](function(){var _0x3d83ea=[];for(var _0x5a5f3c=0x0;_0x5a5f3c<_0x3acd79[_0x8cc6('0x13')];_0x5a5f3c+=0x1){var _0x2b7b13=_0x3acd79[_0x5a5f3c];var _0xa5794=createTables(_[_0x8cc6('0x37')](_0x2b7b13));var _0x4c9b4d;var _0x28622f=getPDFDocDefinition(_0xa5794);var _0x27e5cd=getPDFPrinter();var _0xd03a09=_0x27e5cd[_0x8cc6('0x38')](_0x28622f);if(_0x25603e){_0x4c9b4d=path[_0x8cc6('0x34')](_0x14e5f0,_0x1d9236,util['format'](_0x8cc6('0x39'),_0x1d9236,_0x5a5f3c,_0x8cc6('0x3a')));}else{_0x4c9b4d=path[_0x8cc6('0x34')](_0x14e5f0,util[_0x8cc6('0x1b')](_0x8cc6('0x3b'),_0x1d9236,_0x8cc6('0x3a')));}_0x3d83ea['push'](writePDFDocument(_0xd03a09,_0x4c9b4d));}return Promise[_0x8cc6('0x3c')](_0x3d83ea);})[_0x8cc6('0x29')](function(){if(_0x25603e){return new Promise(function(_0x1b0b3b){zipdir(path['join'](_0x14e5f0,_0x1d9236),{'saveTo':path[_0x8cc6('0x34')](_0x14e5f0,util[_0x8cc6('0x1b')](_0x8cc6('0x3b'),_0x1d9236,_0x8cc6('0x3d')))},function(){rimraf(path[_0x8cc6('0x34')](_0x14e5f0,_0x1d9236),function(){});_0x1b0b3b('zip\x20finished');});});}})['then'](function(){if(!_0x25603e)return;rimraf(path[_0x8cc6('0x34')](_0x14e5f0,_0x1d9236),function(){});})['then'](function(){logger[_0x8cc6('0x3e')](util[_0x8cc6('0x1b')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8cc6('0x3f')));return analyticExtractedReport(_0x8cc6('0x40'),_0x25603e?util[_0x8cc6('0x1b')]('%s.%s',_0x1d9236,_0x25603e?_0x8cc6('0x3d'):_0x8cc6('0x3a')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x8cc6('0x3e')](util[_0x8cc6('0x1b')](_0x8cc6('0x41'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x8cc6('0x42')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x8cc6('0x29')](function(_0x495c8b){EXTRACTED_REPORT=_0x495c8b;return dbH[_0x8cc6('0x2c')][_0x8cc6('0x2d')](util['format'](_0x8cc6('0x43'),QUERY),{'type':dbH[_0x8cc6('0x2c')][_0x8cc6('0x2f')][_0x8cc6('0x30')]});})[_0x8cc6('0x29')](extractReport)[_0x8cc6('0x44')](function(_0x170b95){logger[_0x8cc6('0x3e')](util[_0x8cc6('0x1b')](_0x8cc6('0x45'),EXTRACTED_REPORT_ID,_0x8cc6('0x3f')),util[_0x8cc6('0x46')](_0x170b95,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8cc6('0x47'));})[_0x8cc6('0x48')](function(){process[_0x8cc6('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x1874bc=new PdfPrinter({'Arial':{'normal':__dirname+_0x8cc6('0x4a'),'bold':__dirname+_0x8cc6('0x4b'),'italics':__dirname+_0x8cc6('0x4c'),'bolditalics':__dirname+_0x8cc6('0x4d')}});return _0x1874bc;}function getPDFDocDefinitionFromHTML(_0x1ad6d5,_0x4ff318){var _0x35c6c1=util[_0x8cc6('0x1b')](_0x8cc6('0x4e'),_0x4ff318[_0x8cc6('0x4f')],_0x4ff318[_0x8cc6('0x50')]);var _0x3b921b=moment()['format']('YYYY-MM-DD')[_0x8cc6('0x10')]();var _0x1f0a80=htmlToPdfmake(_0x1ad6d5,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1f0a80],'defaultStyle':{'font':_0x8cc6('0x51')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x8cc6('0x52'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0x8cc6('0x1f')}];},'footer':function(_0x3ed141,_0x312590){return[{'text':util[_0x8cc6('0x1b')](_0x8cc6('0x53'),_0x35c6c1,_0x3ed141,_0x312590,_0x3b921b),'style':_0x8cc6('0x23')}];}};}function writePDFDocument(_0x2876f5,_0x2cbc41){return new Promise(function(_0x252788,_0x26a440){var _0x2e7c11=_0x2876f5[_0x8cc6('0x54')](fs[_0x8cc6('0x55')](_0x2cbc41));_0x2e7c11['on']('finish',function(){_0x252788(_0x8cc6('0x56'));});_0x2e7c11['on']('error',function(_0x69631a){_0x26a440(_0x69631a);});_0x2876f5[_0x8cc6('0x57')]();});}exports[_0x8cc6('0x58')]=function(_0x11511c,_0x3899b8){var _0x5fd237=getPDFPrinter();var _0x37015e=getPDFDocDefinitionFromHTML(_0x11511c,_0x3899b8);var _0x25ade3=_0x5fd237[_0x8cc6('0x38')](_0x37015e);return writePDFDocument(_0x25ade3,_0x3899b8[_0x8cc6('0x0')])[_0x8cc6('0x44')](function(_0x53c173){throw _0x53c173;});}; \ No newline at end of file +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 diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 6b42224..e07d814 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 _0x1a9b=['zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','bluebird'];(function(_0x3882d7,_0x566a50){var _0x566333=function(_0x4d1111){while(--_0x4d1111){_0x3882d7['push'](_0x3882d7['shift']());}};_0x566333(++_0x566a50);}(_0x1a9b,0xf6));var _0xb1a9=function(_0x460ed5,_0x2e85b1){_0x460ed5=_0x460ed5-0x0;var _0x73c7eb=_0x1a9b[_0x460ed5];return _0x73c7eb;};'use strict';var util=require(_0xb1a9('0x0'));var path=require(_0xb1a9('0x1'));var _=require(_0xb1a9('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xb1a9('0x3'));var zipdir=require(_0xb1a9('0x4'));var rimraf=require(_0xb1a9('0x5'));var db=require(_0xb1a9('0x6'))['db'];var dbH=require(_0xb1a9('0x6'))[_0xb1a9('0x7')];var logger=require(_0xb1a9('0x8'))(_0xb1a9('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xb1a9('0xa')][0x3];var PATH=process[_0xb1a9('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2e2854,_0x988ae1){var _0x591b96={'status':_0x2e2854};var _0x3fe2aa={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x988ae1){_0x591b96[_0xb1a9('0xb')]=_0x988ae1;}return db[_0xb1a9('0xc')][_0xb1a9('0xd')](_0x591b96,_0x3fe2aa);}function main(){var _0x17e717=0x1388;var _0x2c42f1;logger[_0xb1a9('0xe')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xb1a9('0xf')));return db[_0xb1a9('0x10')][_0xb1a9('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xb1a9('0x12')]})[_0xb1a9('0x13')](function(_0x23f012){if(_0x23f012){_0x2c42f1=_0x23f012;_0x17e717=_0x2c42f1[_0xb1a9('0x12')]||0x1388;}})['then'](function(){return dbH[_0xb1a9('0x14')][_0xb1a9('0x15')](util[_0xb1a9('0x16')](_0xb1a9('0x17'),QUERY),{'type':dbH[_0xb1a9('0x14')][_0xb1a9('0x18')][_0xb1a9('0x19')]});})[_0xb1a9('0x13')](function(_0x4ccc71){if(!_0x4ccc71[0x0][_0xb1a9('0x1a')]){return analyticExtractedReport(_0xb1a9('0x1b'));}var _0x42638c=[];var _0x5d2586=0x0;if(_0x2c42f1[_0xb1a9('0x1c')]){if(_0x4ccc71&&_0x4ccc71[_0xb1a9('0x1d')]){var _0x41e6d1=_['range'](_0x4ccc71[0x0][_0xb1a9('0x1a')]/_0x17e717);var _0x2d35b0=Number[_0xb1a9('0x1e')](_0x4ccc71[0x0][_0xb1a9('0x1a')]/_0x17e717)?_0x4ccc71[0x0][_0xb1a9('0x1a')]%_0x17e717:0x0;_0x41e6d1['forEach'](function(_0x4a9ae1){if(_0x4a9ae1>0x0){_0x5d2586+=_0x17e717;}_0x42638c[_0xb1a9('0x1f')](dbH['sequelize'][_0xb1a9('0x15')](util['format'](_0xb1a9('0x20'),QUERY,_0x17e717,_0x5d2586),{'type':dbH[_0xb1a9('0x14')][_0xb1a9('0x18')]['SELECT']}));});if(_0x2d35b0>0x0){_0x5d2586+=_0x17e717;_0x42638c[_0xb1a9('0x1f')](dbH[_0xb1a9('0x14')][_0xb1a9('0x15')](util['format'](_0xb1a9('0x20'),QUERY,_0x2d35b0,_0x5d2586),{'type':dbH[_0xb1a9('0x14')][_0xb1a9('0x18')][_0xb1a9('0x19')]}));}}}else{_0x42638c['push'](dbH['sequelize'][_0xb1a9('0x15')](QUERY,{'type':dbH[_0xb1a9('0x14')]['QueryTypes'][_0xb1a9('0x19')]}));}var _0x4d5fc2=path[_0xb1a9('0x21')](PATH);var _0x478b55=path['basename'](PATH,_0xb1a9('0x22'));var _0x41530b=_0x2c42f1[_0xb1a9('0x1c')]&&_0x42638c[_0xb1a9('0x1d')]>0x1;var _0x4c0a86=[];if(!fs['existsSync'](path[_0xb1a9('0x23')](_0x4d5fc2,_0x478b55))&&_0x41530b){fs['mkdirSync'](path[_0xb1a9('0x23')](_0x4d5fc2,_0x478b55));}return BPromise[_0xb1a9('0x24')](_0x42638c,function(_0x4428d5){_0x4c0a86[_0xb1a9('0x1f')](_0x4428d5);})['then'](function(){for(var _0x4ffea8=0x0;_0x4ffea8<_0x4c0a86[_0xb1a9('0x1d')];_0x4ffea8+=0x1){var _0x567849;var _0x5d4b96=_0x4c0a86[_0x4ffea8];if(_0x41530b){_0x567849=path['join'](_0x4d5fc2,_0x478b55,util['format'](_0xb1a9('0x25'),_0x478b55,_0x4ffea8,_0xb1a9('0x26')));}else{_0x567849=path[_0xb1a9('0x23')](_0x4d5fc2,util[_0xb1a9('0x16')](_0xb1a9('0x27'),_0x478b55,_0xb1a9('0x26')));}fs[_0xb1a9('0x28')](_0x567849,json2xls(_0x5d4b96),_0xb1a9('0x29'));}})[_0xb1a9('0x13')](function(){if(_0x41530b){return new Promise(function(_0x2a593c){zipdir(path[_0xb1a9('0x23')](_0x4d5fc2,_0x478b55),{'saveTo':path['join'](_0x4d5fc2,util[_0xb1a9('0x16')](_0xb1a9('0x27'),_0x478b55,'zip'))},function(_0x3d3477,_0x7d9009){rimraf(path[_0xb1a9('0x23')](_0x4d5fc2,_0x478b55),function(){});_0x2a593c(_0xb1a9('0x2a'));});});}})['then'](function(){logger['info'](util[_0xb1a9('0x16')](_0xb1a9('0x2b'),EXTRACTED_REPORT_ID,_0xb1a9('0xf')));return analyticExtractedReport(_0xb1a9('0x2c'),_0x41530b?util[_0xb1a9('0x16')](_0xb1a9('0x27'),_0x478b55,_0x41530b?'zip':_0xb1a9('0x26')):null);});})['catch'](function(_0x870f42){logger['info'](util[_0xb1a9('0x16')](_0xb1a9('0x2d'),EXTRACTED_REPORT_ID,_0xb1a9('0xf')),util[_0xb1a9('0x2e')](_0x870f42,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb1a9('0x2f'));})[_0xb1a9('0x30')](function(){process[_0xb1a9('0x31')](EXIT_CODE);});}main(); \ No newline at end of file +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 diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 5dae4df..452ba0d 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 _0xdbae=['CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','interval','*,*,*,*','tag','CDR(tag)=','length','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','custom','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime',',${EXTEN},','last','Hangup','concat','bulkCreate','catch','error','rewrite','lodash','util','Interval','intervals','models','VoiceExtension','findAll','IntervalId','then','map','exten','filter','groupBy','queue','playback','priority','extensions','find','type','Set','format','CDR(type)=%s','VoiceExtensionId','inbound','push','context','extension'];(function(_0x9757a3,_0x2752fe){var _0x44b86e=function(_0x4b1876){while(--_0x4b1876){_0x9757a3['push'](_0x9757a3['shift']());}};_0x44b86e(++_0x2752fe);}(_0xdbae,0x9f));var _0xedba=function(_0x35f180,_0x371169){_0x35f180=_0x35f180-0x0;var _0x45ea07=_0xdbae[_0x35f180];return _0x45ea07;};'use strict';var _=require(_0xedba('0x0'));var util=require(_0xedba('0x1'));function rewrite(_0x4e05d8,_0x3a55ba){var _0x155d18=this;return _0x4e05d8['models'][_0xedba('0x2')]['findAll']({'raw':!![]})['then'](function(_0x169f83){_0x155d18[_0xedba('0x3')]=_0x169f83;return _0x4e05d8[_0xedba('0x4')][_0xedba('0x5')][_0xedba('0x6')]({'where':{'IntervalId':_0x3a55ba[_0xedba('0x7')]},'raw':!![]});})[_0xedba('0x8')](function(_0x2e8c43){return _0x4e05d8[_0xedba('0x4')][_0xedba('0x5')][_0xedba('0x6')]({'where':{'exten':{'$in':_['uniq'](_[_0xedba('0x9')](_0x2e8c43,_0xedba('0xa')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xedba('0x8')](function(_0x34e1fc){var _0x153183=_['filter'](_0x34e1fc,{'priority':'1'});var _0x4a4613=_[_0xedba('0xb')](_0x34e1fc,{'isApp':0x1});var _0x197297=_[_0xedba('0xc')](_0x4a4613,_0xedba('0xa'));var _0x4e5b99=[_0xedba('0xd'),_0xedba('0xe')];var _0x1bfe15=[];var _0x1e2955=[];for(var _0x12c51e in _0x197297){if(_0x197297['hasOwnProperty'](_0x12c51e)){_0x155d18[_0xedba('0xf')]=0x2;_0x155d18[_0xedba('0x10')]=[];_0x155d18['extension']=_[_0xedba('0x11')](_0x153183,{'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')]});_0x155d18[_0xedba('0x10')]['push']({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':util[_0xedba('0x14')](_0xedba('0x15'),_0x197297[_0x12c51e][0x0][_0xedba('0x12')]),'context':_0x197297[_0x12c51e][0x0]['context'],'exten':_0x197297[_0x12c51e][0x0]['exten'],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});if(_0x197297[_0x12c51e][0x0][_0xedba('0x12')]===_0xedba('0x17')){_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':'Set','appdata':'CDR(routeid)='+_0x197297[_0x12c51e][0x0][_0xedba('0x16')],'context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});}else if(_0x197297[_0x12c51e][0x0][_0xedba('0x12')]==='outbound'){if(_0x155d18[_0xedba('0x1a')]){_0x155d18['extensions'][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0]['type'],'app':_0xedba('0x13'),'appdata':_0xedba('0x1b')+(_0x155d18[_0xedba('0x1a')][_0xedba('0x1c')]?_0xedba('0x1d')+_0x155d18[_0xedba('0x1a')]['cutdigits']+'}':_0xedba('0x1e')),'context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});}_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':'CDR(routeid)='+_0x197297[_0x12c51e][0x0]['VoiceExtensionId'],'context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0]['exten'],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});var _0x134dd0=_0x155d18[_0xedba('0xf')]++;_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x1f'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x134dd0+0x2)+_0xedba('0x20')+(_0x134dd0+0x1)+')','context':_0x197297[_0x12c51e][0x0]['context'],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x134dd0,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});if(_0x155d18['extension']){_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':'Set','appdata':_0x155d18[_0xedba('0x1a')][_0xedba('0x1c')]?_0xedba('0x21')+_0x155d18[_0xedba('0x1a')][_0xedba('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0]['exten'],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});}_0x155d18['extensions']['push']({'type':_0x197297[_0x12c51e][0x0]['type'],'app':_0xedba('0x13'),'appdata':'outboundrouteid='+_0x197297[_0x12c51e][0x0][_0xedba('0x16')],'context':_0x197297[_0x12c51e][0x0]['context'],'exten':_0x197297[_0x12c51e][0x0]['exten'],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0]['VoiceExtensionId']});if(_0x155d18['extension']&&_0x155d18['extension'][_0xedba('0x22')](_0xedba('0x23'))&&_0x155d18[_0xedba('0x1a')][_0xedba('0x23')]!=='none'){_0x155d18[_0xedba('0x10')]['push']({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':_0xedba('0x24'),'context':_0x197297[_0x12c51e][0x0]['context'],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});_0x155d18[_0xedba('0x10')]['push']({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x155d18[_0xedba('0x1a')][_0xedba('0x23')]||'wav','context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});}}_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0]['type'],'app':_0xedba('0x13'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});_0x155d18['extensions'][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':_0xedba('0x25'),'context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'exten':_0x197297[_0x12c51e][0x0]['exten'],'priority':_0x155d18['priority']++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':_0xedba('0x26'),'context':_0x197297[_0x12c51e][0x0]['context'],'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'priority':_0x155d18[_0xedba('0xf')]++,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});for(var _0x1f575c=0x0,_0x36d02c=0x0;_0x1f575c<_0x197297[_0x12c51e]['length'];_0x1f575c+=0x1,_0x36d02c=0x0){var _0x353884=_0x197297[_0x12c51e][_0x1f575c];if(_0x353884[_0xedba('0x12')]){_0x353884[_0xedba('0x12')]=_0x353884[_0xedba('0x12')][_0xedba('0x27')]();}var _0x1eaf60=[];var _0x72ecce=[];delete _0x353884['id'];delete _0x353884[_0xedba('0x28')];delete _0x353884['updatedAt'];var _0xfcebee=_0x353884[_0xedba('0x29')]!==_0xedba('0x2a')?[_0x353884['interval']]:_0x353884[_0xedba('0x7')]?_[_0xedba('0x9')](_[_0xedba('0xb')](_0x155d18['intervals'],{'IntervalId':_0x353884[_0xedba('0x7')]}),_0xedba('0x29')):[];if(_0x353884['hasOwnProperty'](_0xedba('0x2b'))){if(_0x353884[_0xedba('0x2b')]&&_0x353884[_0xedba('0x2b')]!=='--'){_0x1eaf60[_0xedba('0x18')]({'type':_0x353884[_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':_0xedba('0x2c')+_0x353884['tag'],'context':_0x353884['context'],'exten':_0x353884[_0xedba('0xa')],'priority':_0xfcebee[_0xedba('0x2d')]+_0x155d18[_0xedba('0xf')]+_0x36d02c++,'VoiceExtensionId':_0x353884[_0xedba('0x16')]});}}if(_0x353884[_0xedba('0x12')]===_0xedba('0x2e')&&_0x353884['hasOwnProperty'](_0xedba('0x2f'))){if(_0x353884[_0xedba('0x2f')]){_0x1eaf60[_0xedba('0x18')]({'type':_0x353884['type'],'app':_0xedba('0x1f'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x353884['callerID']+')','context':_0x353884['context'],'exten':_0x353884['exten'],'priority':_0xfcebee[_0xedba('0x2d')]+_0x155d18[_0xedba('0xf')]+_0x36d02c++,'VoiceExtensionId':_0x353884['VoiceExtensionId']});}else{_0x1eaf60[_0xedba('0x18')]({'type':_0x353884[_0xedba('0x12')],'app':_0xedba('0x1f'),'appdata':_0xedba('0x30'),'context':_0x353884[_0xedba('0x19')],'exten':_0x353884[_0xedba('0xa')],'priority':_0xfcebee['length']+_0x155d18['priority']+_0x36d02c++,'VoiceExtensionId':_0x353884[_0xedba('0x16')]});}}if(_0x353884[_0xedba('0x22')](_0xedba('0x31'))){if(_0x4e5b99['indexOf'](_0x353884[_0xedba('0x32')][_0xedba('0x27')]())>=0x0&&_0x353884['appType']!==_0xedba('0x33')){if(_0x353884[_0xedba('0x31')]){_0x1eaf60[_0xedba('0x18')]({'type':_0x353884[_0xedba('0x12')],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x353884[_0xedba('0x19')],'exten':_0x353884[_0xedba('0xa')],'priority':_0xfcebee[_0xedba('0x2d')]+_0x155d18[_0xedba('0xf')]+_0x36d02c++,'VoiceExtensionId':_0x353884[_0xedba('0x16')]});_0x1eaf60[_0xedba('0x18')]({'type':_0x353884['type'],'app':_0xedba('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x353884[_0xedba('0x19')],'exten':_0x353884['exten'],'priority':_0xfcebee[_0xedba('0x2d')]+_0x155d18[_0xedba('0xf')]+_0x36d02c++,'VoiceExtensionId':_0x353884[_0xedba('0x16')]});}else{_0x1eaf60[_0xedba('0x18')]({'type':_0x353884['type'],'app':_0xedba('0x1f'),'appdata':_0xedba('0x34'),'context':_0x353884[_0xedba('0x19')],'exten':_0x353884['exten'],'priority':_0xfcebee['length']+_0x155d18[_0xedba('0xf')]+_0x36d02c++,'VoiceExtensionId':_0x353884[_0xedba('0x16')]});_0x1eaf60[_0xedba('0x18')]({'type':_0x353884[_0xedba('0x12')],'app':_0xedba('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x353884[_0xedba('0x19')],'exten':_0x353884['exten'],'priority':_0xfcebee[_0xedba('0x2d')]+_0x155d18[_0xedba('0xf')]+_0x36d02c++,'VoiceExtensionId':_0x353884[_0xedba('0x16')]});}}}for(var _0x2d57ed=0x0;_0x2d57ed<_0xfcebee[_0xedba('0x2d')];_0x2d57ed+=0x1){var _0x48b99d=_0x155d18['priority']+_0xfcebee[_0xedba('0x2d')];var _0x5955ee=_0x2d57ed===_0xfcebee[_0xedba('0x2d')]-0x1?_0x155d18['priority']+_0x1eaf60[_0xedba('0x2d')]+_0x72ecce['length']+0x2:_0x155d18[_0xedba('0xf')]+_0x2d57ed+0x1;_0x1eaf60['splice'](_0x2d57ed,0x0,{'type':_0x353884[_0xedba('0x12')],'app':_0xedba('0x35'),'appdata':_0xfcebee[_0x2d57ed]+'?'+_0x353884[_0xedba('0x19')]+_0xedba('0x36')+_0x48b99d+':'+_0x353884[_0xedba('0x19')]+_0xedba('0x36')+_0x5955ee,'exten':_0x353884[_0xedba('0xa')],'context':_0x353884['context'],'priority':_0x155d18['priority']+_0x2d57ed,'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});}_0x353884[_0xedba('0xf')]=_0x1eaf60[_0xedba('0x2d')]?_[_0xedba('0x37')](_0x1eaf60)[_0xedba('0xf')]+0x1:_0x155d18['priority'];_0x155d18[_0xedba('0xf')]=(_0x72ecce[_0xedba('0x2d')]?_[_0xedba('0x37')](_0x72ecce)[_0xedba('0xf')]:_0x353884[_0xedba('0xf')])+0x1;_0x155d18[_0xedba('0x10')]=_['concat'](_0x155d18[_0xedba('0x10')],_0x1eaf60,[_0x353884],_0x72ecce);}_0x155d18[_0xedba('0x10')][_0xedba('0x18')]({'type':_0x197297[_0x12c51e][0x0][_0xedba('0x12')],'app':_0xedba('0x38'),'exten':_0x197297[_0x12c51e][0x0][_0xedba('0xa')],'context':_0x197297[_0x12c51e][0x0][_0xedba('0x19')],'priority':_0x155d18[_0xedba('0xf')],'VoiceExtensionId':_0x197297[_0x12c51e][0x0][_0xedba('0x16')]});_0x1bfe15[_0xedba('0x18')](_0x197297[_0x12c51e][0x0][_0xedba('0x16')]);_0x1e2955=_[_0xedba('0x39')](_0x1e2955,_0x155d18[_0xedba('0x10')]);}}return _0x4e05d8['transaction'](function(_0x33d375){return _0x4e05d8[_0xedba('0x4')]['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x1bfe15}},'transaction':_0x33d375})[_0xedba('0x8')](function(_0x278aa2){return _0x4e05d8[_0xedba('0x4')][_0xedba('0x5')][_0xedba('0x3a')](_['sortBy'](_0x1e2955,'priority'),{'transaction':_0x33d375});});});})[_0xedba('0x3b')](function(_0x340c7a){console[_0xedba('0x3c')](_0x340c7a);});}exports[_0xedba('0x3d')]=rewrite; \ No newline at end of file +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 diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index be2639e..e44dc1f 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 _0x2427=['stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','createdAt','field','NOW()','scheduledAt','toString','updatedAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','ContactId','str','calleridnum','cm_hopper_final','\x20=\x20?','id\x20IN\x20?','VoiceQueue','CmList','Lists','get','push','sequelize','query','VoiceQueueId','onlyIfOpen','findAll','outbound','BlackLists','all','dialCheckDuplicateType','always','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','CSV\x20parse\x20error','util','lodash','squel','papaparse','../../../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!','error','index','test','isNil','errors','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','email','ListId','CompanyId','length','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','Error\x20while\x20creating\x20contact:\x20'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x2427,0x182));var _0x7242=function(_0x9f8df3,_0x29e098){_0x9f8df3=_0x9f8df3-0x0;var _0x124ca4=_0x2427[_0x9f8df3];return _0x124ca4;};'use strict';var BPromise=require('bluebird');var util=require(_0x7242('0x0'));var _=require(_0x7242('0x1'));var fs=require('fs');var squel=require(_0x7242('0x2'));var Papa=require(_0x7242('0x3'));var Redis=require('ioredis');var db=require(_0x7242('0x4'))['db'];var config=require(_0x7242('0x5'));var logger=require(_0x7242('0x6'))(_0x7242('0x7'));config[_0x7242('0x8')]=_[_0x7242('0x9')](config['redis'],{'host':_0x7242('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7242('0x8')]));require('../../../api/cmContact/cmContact.socket')[_0x7242('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x7242('0xc')][0x2]===_0x7242('0xd')||process['argv'][0x2]===_0x7242('0xe')){throw new Error(_0x7242('0xf'));}var FILEPATH=process[_0x7242('0xc')][0x2];if(!process[_0x7242('0xc')][0x3]||process[_0x7242('0xc')][0x3]===_0x7242('0xd')||process[_0x7242('0xc')][0x3]==='null'||!process[_0x7242('0xc')][0x4]||process[_0x7242('0xc')][0x4]===_0x7242('0xd')||process[_0x7242('0xc')][0x4]===_0x7242('0xe')){throw new Error(_0x7242('0x10'));}var FIELDS=_[_0x7242('0x11')](process[_0x7242('0xc')][0x3][_0x7242('0x12')](','),process[_0x7242('0xc')][0x4][_0x7242('0x12')](','));if(!process['argv'][0x5]||process[_0x7242('0xc')][0x5]===_0x7242('0xd')||process['argv'][0x5]===_0x7242('0xe')){throw new Error(_0x7242('0x13'));}var LISTID=process[_0x7242('0xc')][0x5];var COMPANYID=process[_0x7242('0xc')][0x6]&&process[_0x7242('0xc')][0x6]!==_0x7242('0xd')&&process[_0x7242('0xc')][0x6]!=='null'?process[_0x7242('0xc')][0x6]:null;var DUPLICATES=process[_0x7242('0xc')][0x7]&&process[_0x7242('0xc')][0x7]!=='undefined'&&process[_0x7242('0xc')][0x7]!==_0x7242('0xe')?process['argv'][0x7]:null;if(!process[_0x7242('0xc')][0x8]||process[_0x7242('0xc')][0x8]===_0x7242('0xd')||process['argv'][0x8]===_0x7242('0xe')){throw new Error(_0x7242('0x14'));}var SOCKET_TIMESTAMP=process[_0x7242('0xc')][0x8];}catch(_0x51bfdf){logger[_0x7242('0x15')](_0x51bfdf);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(_0x49cd12,_0x4246e4,_0x13bca4,_0x1fe959){var _0x2c7797={'message':_0x4246e4};_0x2c7797[_0x49cd12]=!![];if(_0x13bca4){_0x2c7797['contact']=_0x13bca4;}if(_0x1fe959){_0x2c7797[_0x7242('0x16')]=_0x1fe959;}return _0x2c7797;}function isEmail(_0x138828){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))*$/[_0x7242('0x17')](_0x138828);}function checkRow(_0x57a32d,_0x2a151d,_0x7a989d){return new BPromise(function(_0x353a3c,_0x58e8a8){if(_[_0x7242('0x18')](_0x57a32d)){return _0x58e8a8(handleCheckRowError(_0x7242('0x15'),'The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!',null,_0x7a989d));}if(_0x57a32d[_0x7242('0x19')]&&_0x57a32d['errors']['length']){var _0x3473d8=_[_0x7242('0x1a')](_0x57a32d[_0x7242('0x19')],_0x7242('0x1b'))[_0x7242('0x1c')](';');return _0x58e8a8(handleCheckRowError('error',_0x3473d8,null,_0x7a989d));}var _0x268569={};for(var _0x164df9 in FIELDS){if(FIELDS[_0x7242('0x1d')](_0x164df9)&&FIELDS[_0x164df9]){_0x268569[_0x164df9]=_0x57a32d[_0x7242('0x1e')][0x0][FIELDS[_0x164df9]]||_0x57a32d[_0x7242('0x1e')][0x0]['\ufeff'+FIELDS[_0x164df9]];}}if(!_0x268569[_0x7242('0x1f')]){return _0x58e8a8(handleCheckRowError(_0x7242('0x15'),_0x7242('0x20'),null,_0x7a989d));}if(!_0x268569[_0x7242('0x21')]){return _0x58e8a8(handleCheckRowError(_0x7242('0x15'),_0x7242('0x22'),null,_0x7a989d));}if(_0x268569['birthDate']){var _0x5bc64f=moment(_0x268569['birthDate'],_0x7242('0x23'));if(!_0x5bc64f[_0x7242('0x24')]()){return _0x58e8a8(handleCheckRowError('error','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x7a989d));}}if(_0x268569[_0x7242('0x25')]){if(!isEmail(_0x268569[_0x7242('0x25')])){return _0x58e8a8(handleCheckRowError(_0x7242('0x15'),'email\x20format\x20is\x20not\x20valid!',null,_0x7a989d));}}_0x268569[_0x7242('0x26')]=LISTID;_0x268569[_0x7242('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7242('0x28')]&&_0x2a151d){var _0x140b9d={};for(var _0xa13005=0x0,_0x1c1cf2=DUPLICATES['length'];_0xa13005<_0x1c1cf2;_0xa13005+=0x1){_0x140b9d[DUPLICATES[_0xa13005]]=_0x268569[DUPLICATES[_0xa13005]];}var _0x3a4e6b=_['find'](_0x2a151d,_0x140b9d);if(_0x3a4e6b){return _0x58e8a8(handleCheckRowError(_0x7242('0x29'),_0x7242('0x2a'),_0x3a4e6b,_0x7a989d));}}return db[_0x7242('0x2b')][_0x7242('0x2c')](_0x268569,{'raw':!![],'hooks':![],'fields':_[_0x7242('0x2d')](_0x268569)})[_0x7242('0x2e')](function(_0x39fd08){if(DUPLICATES&&DUPLICATES[_0x7242('0x28')]&&_0x2a151d){_0x2a151d['push'](_[_0x7242('0x2f')](_0x268569,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x39fd08['id'];return _0x353a3c();})[_0x7242('0x30')](function(_0x134d99){return _0x58e8a8(handleCheckRowError(_0x7242('0x15'),_0x7242('0x31')+(_0x134d99[_0x7242('0x1b')]||JSON[_0x7242('0x32')](_0x134d99)),null,_0x7a989d));});});}function checkHopper(){function _0x2597c5(){return function(_0x22709f){logger['error'](_0x7242('0x33'),_0x7242('0x34'),util[_0x7242('0x35')](_0x22709f,{'showHidden':![],'depth':null}));};}var _0x475fcd=function(_0x12fc4c,_0x35ce6b){var _0x4ae7a6=squel[_0x7242('0x36')]()[_0x7242('0x37')](_0x7242('0x38'))[_0x7242('0x39')]([_0x7242('0x21'),'scheduledAt','ContactId','ListId',_0x35ce6b,_0x7242('0x3a'),'updatedAt'],squel['select']()[_0x7242('0x3b')](_0x7242('0x21'),'phone')[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3d'))[_0x7242('0x3b')]('id','ContactId')[_0x7242('0x3b')](LISTID[_0x7242('0x3e')](),'ListId')[_0x7242('0x3b')](_0x12fc4c['id']['toString'](),_0x35ce6b)[_0x7242('0x3b')](_0x7242('0x3c'),'createdAt')[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3f'))[_0x7242('0x40')](_0x7242('0x41'))[_0x7242('0x42')](_0x7242('0x43'))[_0x7242('0x42')](_0x7242('0x44'),LISTID['toString']())['where'](_0x7242('0x45'))[_0x7242('0x42')](_0x7242('0x46'),squel[_0x7242('0x47')]()[_0x7242('0x3b')](_0x7242('0x21'))['from'](_0x7242('0x38'))[_0x7242('0x42')](_0x35ce6b+'\x20=\x20?',_0x12fc4c['id'][_0x7242('0x3e')]())))[_0x7242('0x3e')]();return _0x4ae7a6;};var _0x430268=function(_0x3c9604,_0x409b9d){var _0x1760f0=squel[_0x7242('0x36')]()[_0x7242('0x37')](_0x7242('0x38'))[_0x7242('0x39')](['phone',_0x7242('0x3d'),_0x7242('0x48'),_0x7242('0x26'),_0x409b9d,'createdAt','updatedAt'],squel[_0x7242('0x47')]()['field'](_0x7242('0x21'),_0x7242('0x21'))[_0x7242('0x3b')]('NOW()',_0x7242('0x3d'))[_0x7242('0x3b')]('id','ContactId')[_0x7242('0x3b')](LISTID['toString'](),_0x7242('0x26'))['field'](_0x3c9604['id'][_0x7242('0x3e')](),_0x409b9d)[_0x7242('0x3b')](_0x7242('0x3c'),'createdAt')['field'](_0x7242('0x3c'),_0x7242('0x3f'))[_0x7242('0x40')]('cm_contacts')['where'](_0x7242('0x43'))[_0x7242('0x42')](_0x7242('0x44'),LISTID[_0x7242('0x3e')]())[_0x7242('0x42')]('id\x20IN\x20?',squel[_0x7242('0x49')](hopperContacts))[_0x7242('0x42')](_0x7242('0x45'))['where'](_0x7242('0x46'),squel[_0x7242('0x47')]()[_0x7242('0x3b')](_0x7242('0x4a'))[_0x7242('0x40')](_0x7242('0x4b'))['where'](_0x409b9d+_0x7242('0x4c'),_0x3c9604['id']['toString']()))[_0x7242('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7242('0x47')]()['field'](_0x7242('0x21'))[_0x7242('0x40')](_0x7242('0x38'))[_0x7242('0x42')](_0x409b9d+_0x7242('0x4c'),_0x3c9604['id'][_0x7242('0x3e')]())))[_0x7242('0x3e')]();return _0x1760f0;};function _0xb42a17(_0xed9cf8,_0x3cc43f){var _0x2aaafe=squel['insert']()[_0x7242('0x37')]('cm_hopper')[_0x7242('0x39')](['phone',_0x7242('0x3d'),_0x7242('0x48'),_0x7242('0x26'),_0x3cc43f,_0x7242('0x3a'),'updatedAt'],squel[_0x7242('0x47')]()[_0x7242('0x3b')]('phone',_0x7242('0x21'))[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3d'))['field']('id','ContactId')[_0x7242('0x3b')](LISTID['toString'](),_0x7242('0x26'))[_0x7242('0x3b')](_0xed9cf8['id'][_0x7242('0x3e')](),_0x3cc43f)[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3a'))[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3f'))[_0x7242('0x40')](_0x7242('0x41'))[_0x7242('0x42')](_0x7242('0x43'))[_0x7242('0x42')](_0x7242('0x44'),LISTID[_0x7242('0x3e')]())[_0x7242('0x42')](_0x7242('0x4d'),squel['str'](hopperContacts))[_0x7242('0x42')](_0x7242('0x45')))[_0x7242('0x3e')]();return _0x2aaafe;}function _0x12fdc1(_0x331f04,_0x18abac){var _0x2e15d4=squel[_0x7242('0x36')]()['into']('cm_hopper_black')[_0x7242('0x39')]([_0x7242('0x21'),_0x7242('0x48'),'ListId',_0x18abac,_0x7242('0x3a'),'updatedAt'],squel[_0x7242('0x47')]()[_0x7242('0x3b')](_0x7242('0x21'),_0x7242('0x21'))[_0x7242('0x3b')]('id',_0x7242('0x48'))[_0x7242('0x3b')](LISTID[_0x7242('0x3e')](),_0x7242('0x26'))[_0x7242('0x3b')](_0x331f04['id'][_0x7242('0x3e')](),_0x18abac)[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3a'))[_0x7242('0x3b')](_0x7242('0x3c'),_0x7242('0x3f'))[_0x7242('0x40')]('cm_contacts')[_0x7242('0x42')](_0x7242('0x43'))[_0x7242('0x42')](_0x7242('0x44'),LISTID['toString']())[_0x7242('0x42')](_0x7242('0x4d'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x7242('0x3e')]();return _0x2e15d4;}return db[_0x7242('0x4e')]['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x7242('0x4f')],'as':_0x7242('0x50'),'where':{'id':LISTID}}]})[_0x7242('0x2e')](function(_0x511d66){var _0x1929ba=[];if(_0x511d66){var _0x2e5d16;for(var _0x4b9ce2=0x0,_0x2493a8;_0x4b9ce2<_0x511d66['length'];_0x4b9ce2+=0x1){_0x2493a8=_0x511d66[_0x4b9ce2][_0x7242('0x51')]({'plain':!![]});switch(_0x2493a8['dialCheckDuplicateType']){case'always':_0x1929ba[_0x7242('0x52')](db[_0x7242('0x53')][_0x7242('0x54')](_0x430268(_0x2493a8,_0x7242('0x55')))[_0x7242('0x2e')](function(){})[_0x7242('0x30')](_0x2597c5()));break;case _0x7242('0x56'):_0x1929ba[_0x7242('0x52')](db['sequelize']['query'](_0x475fcd(_0x2493a8,_0x7242('0x55')))[_0x7242('0x2e')](function(){})[_0x7242('0x30')](_0x2597c5()));break;default:_0x1929ba['push'](db[_0x7242('0x53')]['query'](_0xb42a17(_0x2493a8,_0x7242('0x55')))[_0x7242('0x2e')](function(){})[_0x7242('0x30')](_0x2597c5()));}}}return _0x1929ba;})['all']()['then'](function(){return db[_0x7242('0x4e')][_0x7242('0x57')]({'where':{'type':_0x7242('0x58')},'attributes':['id'],'include':[{'model':db[_0x7242('0x4f')],'as':_0x7242('0x59'),'where':{'id':LISTID}}]})['then'](function(_0x236b69){var _0x47f38b=[];if(_0x236b69){var _0x364d93;for(var _0x53894a=0x0,_0x369028;_0x53894a<_0x236b69['length'];_0x53894a+=0x1){_0x369028=_0x236b69[_0x53894a][_0x7242('0x51')]({'plain':!![]});_0x47f38b[_0x7242('0x52')](db[_0x7242('0x53')][_0x7242('0x54')](_0x12fdc1(_0x369028,_0x7242('0x55')))[_0x7242('0x2e')](function(){})[_0x7242('0x30')](_0x2597c5()));}}return _0x47f38b;})[_0x7242('0x5a')]();})[_0x7242('0x2e')](function(){return db['Campaign'][_0x7242('0x57')]({'attributes':['id',_0x7242('0x5b')],'include':[{'model':db['CmList'],'as':'Lists','where':{'id':LISTID}}]})[_0x7242('0x2e')](function(_0x50183a){var _0x5471bd=[];if(_0x50183a){for(var _0x554303=0x0,_0x3ce663;_0x554303<_0x50183a[_0x7242('0x28')];_0x554303+=0x1){_0x3ce663=_0x50183a[_0x554303][_0x7242('0x51')]({'plain':!![]});switch(_0x3ce663['dialCheckDuplicateType']){case _0x7242('0x5c'):_0x5471bd[_0x7242('0x52')](db[_0x7242('0x53')][_0x7242('0x54')](_0x430268(_0x3ce663,'CampaignId'))['then'](function(){})[_0x7242('0x30')](_0x2597c5()));break;case _0x7242('0x56'):_0x5471bd[_0x7242('0x52')](db[_0x7242('0x53')]['query'](_0x475fcd(_0x3ce663,_0x7242('0x5d')))[_0x7242('0x2e')](function(){})[_0x7242('0x30')](_0x2597c5()));break;default:_0x5471bd[_0x7242('0x52')](db[_0x7242('0x53')][_0x7242('0x54')](_0xb42a17(_0x3ce663,_0x7242('0x5d')))[_0x7242('0x2e')](function(){})[_0x7242('0x30')](_0x2597c5()));}}}return _0x5471bd;})[_0x7242('0x5a')]();})[_0x7242('0x2e')](function(){return db['Campaign'][_0x7242('0x57')]({'attributes':['id'],'include':[{'model':db[_0x7242('0x4f')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x7242('0x2e')](function(_0x2df9d8){var _0xd84a4e=[];if(_0x2df9d8){for(var _0x3e8ece=0x0,_0xd1b462;_0x3e8ece<_0x2df9d8[_0x7242('0x28')];_0x3e8ece+=0x1){_0xd1b462=_0x2df9d8[_0x3e8ece]['get']({'plain':!![]});_0xd84a4e[_0x7242('0x52')](db[_0x7242('0x53')][_0x7242('0x54')](_0x12fdc1(_0xd1b462,'CampaignId'))[_0x7242('0x2e')](function(){})['catch'](_0x2597c5()));}}return _0xd84a4e;})[_0x7242('0x5a')]();})[_0x7242('0x30')](function(_0xd6f571){logger[_0x7242('0x15')](_0x7242('0x5e'),_0x7242('0x5f'),_0xd6f571[_0x7242('0x1b')]);});}var processPromises=function(_0x412489){return BPromise[_0x7242('0x5a')](promises)[_0x7242('0x2e')](function(_0x76a87d){})[_0x7242('0x30')](function(_0x160a6e){logger['error'](_0x7242('0x60'),JSON[_0x7242('0x32')](_0x160a6e));})[_0x7242('0x61')](function(){socket[_0x7242('0x62')](_0x7242('0x63')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x412489){return _0x412489[_0x7242('0x64')]();}});};var endCsv=function(){return BPromise[_0x7242('0x65')]()[_0x7242('0x2e')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x7242('0x62')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x7242('0x66')](FILEPATH);}catch(_0xba00ae){logger[_0x7242('0x15')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x7242('0x32')](_0xba00ae));}finally{process[_0x7242('0x67')](0x0);}});};process['on']('SIGINT',function(){logger[_0x7242('0x68')](_0x7242('0x69'));endCsv();});function main(){return BPromise['resolve']()[_0x7242('0x2e')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7242('0x12')](',');return db[_0x7242('0x2b')][_0x7242('0x57')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x7242('0x2e')](function(_0x578ddc){var _0x1199fe=fs[_0x7242('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7242('0x6b')](_0x1199fe,{'header':!![],'skipEmptyLines':!![],'step':function(_0xd62582,_0x1ba366){total+=0x1;var _0x332eb6=total;promises[_0x7242('0x52')](checkRow(_0xd62582,_0x578ddc,_0x332eb6)['then'](function(){success+=0x1;})[_0x7242('0x30')](function(_0x1e11af){if(_0x1e11af['error']){errors+=0x1;delete _0x1e11af[_0x7242('0x15')];}else if(_0x1e11af[_0x7242('0x29')]){duplicates+=0x1;delete _0x1e11af[_0x7242('0x29')];}rows['push'](_0x1e11af);}));if(total%0xc8===0x0){_0x1ba366['pause']();return processPromises(_0x1ba366);}},'complete':function(){return processPromises()[_0x7242('0x2e')](function(){logger[_0x7242('0x68')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0xa2e398,_0x4cc46c){logger[_0x7242('0x68')](_0x7242('0x6c'),JSON[_0x7242('0x32')](_0xa2e398));endCsv();}});})[_0x7242('0x30')](function(_0x4a3603){logger['error']('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x4a3603));});}main(); \ No newline at end of file +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 diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 007ee86..87b966b 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 _0x5886=['redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','insert','into','fromQuery','ContactId','ListId','createdAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22onlyIfOpen\x22','toString','updatedAt','cm_hopper_black','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','info','Received\x20SIGINT','exit','errors','code','message','sequelize','query','spread','catch','error','main','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','push','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','emit','Abort\x20parser','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','affectedRows','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','../../../config/environment','../../../config/logger','defaults'];(function(_0x52ef79,_0x23f3f0){var _0x23f33f=function(_0x353634){while(--_0x353634){_0x52ef79['push'](_0x52ef79['shift']());}};_0x23f33f(++_0x23f3f0);}(_0x5886,0x10a));var _0x6588=function(_0x324b38,_0x3063e0){_0x324b38=_0x324b38-0x0;var _0x529084=_0x5886[_0x324b38];return _0x529084;};'use strict';var fs=require('fs');var path=require(_0x6588('0x0'));var _=require(_0x6588('0x1'));var Papa=require(_0x6588('0x2'));var util=require('util');var BPromise=require(_0x6588('0x3'));var moment=require(_0x6588('0x4'));var squel=require(_0x6588('0x5'));var Redis=require('ioredis');var db=require(_0x6588('0x6'))['db'];var config=require(_0x6588('0x7'));var logger=require(_0x6588('0x8'))('import');config['redis']=_[_0x6588('0x9')](config[_0x6588('0xa')],{'host':_0x6588('0xb'),'port':0x18eb});var socket=require(_0x6588('0xc'))(new Redis(config[_0x6588('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x6588('0xd')](_0x6588('0xe'));function isEmail(_0x2c2792){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))*$/[_0x6588('0xf')](_0x2c2792);}function selectNotIn(_0x5a0c6a,_0x2f0bb9,_0x5f50be,_0x34c3d8,_0x51897b){return squel[_0x6588('0x10')]()[_0x6588('0x11')](_0x6588('0x12'))[_0x6588('0x13')](_0x34c3d8)[_0x6588('0x14')](_0x2f0bb9,null,_0x2f0bb9+_0x6588('0x15')+_0x34c3d8+'.'+_0x5f50be)[_0x6588('0x16')](_0x34c3d8+'.'+_0x5f50be+_0x6588('0x17')+_0x5a0c6a+'.'+_0x5f50be)['where'](_0x2f0bb9+_0x6588('0x18')+_0x51897b[_0x6588('0x14')]()+')');}function insertCmHopper(_0x29cb1e,_0x217dcb,_0x1bf1b,_0x2719b0,_0x38e2e2){var _0x42a79a=[_0x6588('0x19'),'cm_contacts.scheduledat',_0x6588('0x1a'),_0x6588('0x1b'),_0x217dcb+'.'+_0x2719b0,_0x6588('0x1c'),_0x6588('0x1d'),'cm_contacts.priority','cm_contacts.UserId','\x22'+_0x38e2e2+'\x22'];return squel[_0x6588('0x1e')]()[_0x6588('0x1f')]('cm_hopper')[_0x6588('0x20')]([_0x6588('0x12'),'scheduledat',_0x6588('0x21'),_0x6588('0x22'),_0x2719b0,_0x6588('0x23'),'updatedAt','priority',_0x6588('0x24'),_0x6588('0x25')],squel[_0x6588('0x10')]()[_0x6588('0x26')](_0x42a79a)[_0x6588('0x13')](_0x217dcb)[_0x6588('0x14')](_0x6588('0x27'),null,_0x6588('0x28')+_0x217dcb+_0x6588('0x29'))['join'](_0x1bf1b,null,_0x1bf1b+_0x6588('0x15')+_0x217dcb+'.'+_0x2719b0)['where'](_0x217dcb+_0x6588('0x2a'),_0x29cb1e)[_0x6588('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x6588('0x2b'),selectNotIn(_0x217dcb,_0x1bf1b,_0x2719b0,_0x6588('0x2c'),['\x22always\x22',_0x6588('0x2d')]))[_0x6588('0x16')](_0x6588('0x2b'),selectNotIn(_0x217dcb,_0x1bf1b,_0x2719b0,'cm_hopper',['\x22always\x22'])))[_0x6588('0x2e')]();}function insertCmHopperBlack(_0xc33cb8,_0x228a60,_0x4b8978,_0x588e75){var _0x5a8b31=['cm_contacts.phone','cm_contacts.id','cm_contacts.ListId',_0x228a60+'.'+_0x588e75,_0x6588('0x1c'),'cm_contacts.updatedAt'];return squel[_0x6588('0x1e')]()[_0x6588('0x1f')]('cm_hopper_black')['fromQuery']([_0x6588('0x12'),'ContactId',_0x6588('0x22'),_0x588e75,_0x6588('0x23'),_0x6588('0x2f')],squel['select']()[_0x6588('0x26')](_0x5a8b31)[_0x6588('0x13')](_0x228a60)['join'](_0x6588('0x27'),null,'cm_contacts.ListId\x20=\x20'+_0x228a60+_0x6588('0x29'))[_0x6588('0x14')](_0x4b8978,null,_0x4b8978+_0x6588('0x15')+_0x228a60+'.'+_0x588e75)[_0x6588('0x16')](_0x228a60+'.CmListId\x20=\x20?',_0xc33cb8)[_0x6588('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x6588('0x16')](_0x6588('0x2b'),squel[_0x6588('0x10')]()['field']('phone')[_0x6588('0x13')](_0x6588('0x30'))[_0x6588('0x16')]('ListId\x20=\x20?',_0xc33cb8)[_0x6588('0x16')](_0x588e75+_0x6588('0x31'),_0x228a60+'.'+_0x588e75)))[_0x6588('0x2e')]();}function insertCmContact(_0xe126ec,_0x3f9c72,_0x543afc,_0x88115c){var _0x1808b7=_[_0x6588('0x32')](_[_0x6588('0x33')](_0x88115c),['ListId',_0x6588('0x34'),'createdAt','updatedAt']);return squel['insert']()[_0x6588('0x1f')](_0x6588('0x27'))['fromQuery'](_0x1808b7,squel['select']()[_0x6588('0x26')](_0x1808b7)[_0x6588('0x13')](_0x3f9c72)[_0x6588('0x16')]('('+_0x543afc['join'](',')+_0x6588('0x35'),squel[_0x6588('0x10')]()['fields'](_0x543afc)['from']('cm_contacts')['where']('ListId\x20=\x20?',_0xe126ec)['where'](_0x6588('0x36')))[_0x6588('0x16')](_0x6588('0x37'),squel[_0x6588('0x10')]()[_0x6588('0x11')](_0x6588('0x38'),_0x6588('0x39'))[_0x6588('0x13')](_0x3f9c72)['group'](_0x543afc[_0x6588('0x14')](','))))[_0x6588('0x2e')]();}function handleStop(){logger[_0x6588('0x3a')](_0x6588('0x3b'));stopped=!![];}function handleUncaughtException(_0x19817b){logger['error'](_0x19817b['message']);process[_0x6588('0x3c')](0x1);}function handleError(_0x913816,_0x46c7a9){stats[_0x6588('0x3d')]['push']({'name':_0x46c7a9[_0x6588('0x3e')],'message':_0x46c7a9[_0x6588('0x3f')],'row':_0x913816});}function handleQuery(_0x4e6d78){logger['info'](_0x4e6d78);return db[_0x6588('0x40')][_0x6588('0x41')](_0x4e6d78)[_0x6588('0x42')](function(_0x3a7f48){results['push'](_0x3a7f48);})[_0x6588('0x43')](function(_0x1352e1){logger[_0x6588('0x44')](_0x1352e1[_0x6588('0x3f')]);});}function main(_0x4ad2c4,_0x5dbf96,_0x367b24,_0x4d5cd6){logger[_0x6588('0x3a')](_0x6588('0x45'),_0x4ad2c4,JSON[_0x6588('0x46')](_0x5dbf96));process[_0x6588('0x47')](_0x6588('0x48'));var _0x5da0fd=_0x5dbf96[_0x6588('0x49')];var _0x27149f=_0x5dbf96[_0x6588('0x4a')];var _0x14d52f=path[_0x6588('0x14')](config[_0x6588('0x4b')],_0x6588('0x4c'),_0x27149f+_0x6588('0x4d'));var _0x5c9dd7=_[_0x6588('0x33')](_0x5da0fd)[_0x6588('0x14')]();logger[_0x6588('0x3a')](_0x6588('0x4e'),_0x5c9dd7);fs[_0x6588('0x4f')](_0x14d52f,_0x5c9dd7+'\x0a');Papa[_0x6588('0x50')](fs[_0x6588('0x51')](_0x4ad2c4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3674be,_0x36aaaf){try{for(var _0x53a326=0x0,_0x5284ee=[];_0x53a326<_0x3674be[_0x6588('0x52')][_0x6588('0x53')];_0x53a326++){stats[_0x6588('0x54')]+=0x1;if(_0x3674be['errors'][_0x53a326]){handleError(_0x3674be['data'][_0x53a326],_0x3674be[_0x6588('0x3d')][_0x53a326]);}else{var _0x5697ea=[];for(var _0x25271c in _0x5da0fd){if(_0x5da0fd[_0x6588('0x55')](_0x25271c)){if(_0x3674be[_0x6588('0x52')][_0x53a326][_0x5da0fd[_0x25271c]]){var _0x20f581=_['trim'](_0x3674be[_0x6588('0x52')][_0x53a326][_0x5da0fd[_0x25271c]][_0x6588('0x56')](/"/g,'\x27'));switch(_0x25271c){case'scheduledat':var _0x47aab7=moment(_0x20f581,_0x6588('0xe'),!![]);if(_0x47aab7['isValid']()){_0x5284ee['push']('\x22'+_0x20f581+'\x22');}else{_0x5697ea['push'](_0x6588('0x57'));}break;case _0x6588('0x58'):var _0x83fb0a=parseInt(_0x20f581);_0x20f581=_['isNaN'](_0x83fb0a)||_0x83fb0a<0x0||_0x83fb0a>0x4?_0x4d5cd6?0x3:0x2:_0x83fb0a;_0x5284ee[_0x6588('0x59')]('\x22'+_0x20f581+'\x22');break;case'UserId':var _0x1384b3=parseInt(_0x20f581);if(_[_0x6588('0x5a')](_0x1384b3)&&_[_0x6588('0x5b')](_0x367b24,_0x1384b3)){_0x5284ee['push']('\x22'+_0x1384b3+'\x22');}else{_0x5697ea[_0x6588('0x59')](_0x6588('0x5c'));}break;case _0x6588('0x5d'):if(isEmail(_0x20f581)){_0x5284ee[_0x6588('0x59')]('\x22'+_0x20f581+'\x22');}else{_0x5697ea[_0x6588('0x59')](_0x6588('0x5e'));}break;case _0x6588('0x5f'):var _0xfbb551=moment(_0x20f581,_0x6588('0x60'),!![]);if(_0xfbb551['isValid']()){_0x5284ee['push']('\x22'+_0x20f581+'\x22');}else{_0x5697ea[_0x6588('0x59')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x5284ee['push']('\x22'+_0x20f581+'\x22');}}else{switch(_0x25271c){case _0x6588('0x61'):case _0x6588('0x12'):_0x5697ea[_0x6588('0x59')](_0x25271c+_0x6588('0x62'));break;default:_0x5284ee[_0x6588('0x59')]('\x22\x22');}}}}if(_0x5697ea[_0x6588('0x53')]){handleError(_0x3674be[_0x6588('0x52')][_0x53a326],{'code':_0x6588('0x63'),'message':_0x5697ea['join']()});}else{fs['appendFileSync'](_0x14d52f,_0x5284ee[_0x6588('0x14')]()+'\x0a');}_0x5284ee=[];}if(!(stats['rows']%0xc8)){socket[_0x6588('0x64')]('contact:import:'+_0x27149f,stats);stats[_0x6588('0x3d')]=[];}}if(stopped){logger['info'](_0x6588('0x65'));_0x36aaaf[_0x6588('0x66')]();}}catch(_0x23b0bd){handleError(_0x3674be['data'][_0x53a326],{'code':'SystemError','message':_0x23b0bd[_0x6588('0x3f')]});logger[_0x6588('0x44')](_0x6588('0x67'),_0x23b0bd[_0x6588('0x3f')]);}},'complete':function(){try{var _0x299253=[];var _0x2e5db7='cm_contacts';if(_0x5dbf96[_0x6588('0x68')]&&_0x5dbf96[_0x6588('0x68')][_0x6588('0x53')]){_0x2e5db7=_0x6588('0x69')+_0x27149f;_0x299253[_0x6588('0x59')](_0x6588('0x6a')+_0x2e5db7+_0x6588('0x6b'));}var _0xf3ff5f=util[_0x6588('0xd')](_0x6588('0x6c'),_0x14d52f,_0x2e5db7,_0x5c9dd7,_0x5dbf96[_0x6588('0x22')],_0x5dbf96[_0x6588('0x34')]||null,NOW,NOW);if(_[_0x6588('0x6d')](_0x5da0fd[_0x6588('0x6e')])){_0xf3ff5f+=_0x6588('0x6f');}_0x299253['push'](_0xf3ff5f);if(_0x5dbf96[_0x6588('0x68')]&&_0x5dbf96[_0x6588('0x68')][_0x6588('0x53')]){_0x299253[_0x6588('0x59')](insertCmContact(_0x5dbf96[_0x6588('0x22')],_0x2e5db7,_0x5dbf96[_0x6588('0x68')],_0x5da0fd));_0x299253[_0x6588('0x59')](_0x6588('0x70')+_0x2e5db7+';');}_0x299253[_0x6588('0x59')](insertCmHopper(_0x5dbf96[_0x6588('0x22')],_0x6588('0x71'),_0x6588('0x72'),_0x6588('0x73'),_0x4d5cd6));_0x299253['push'](insertCmHopperBlack(_0x5dbf96[_0x6588('0x22')],_0x6588('0x74'),_0x6588('0x72'),_0x6588('0x73')));_0x299253['push'](insertCmHopper(_0x5dbf96[_0x6588('0x22')],_0x6588('0x75'),_0x6588('0x76'),_0x6588('0x77'),_0x4d5cd6));_0x299253['push'](insertCmHopperBlack(_0x5dbf96['ListId'],_0x6588('0x78'),_0x6588('0x76'),'CampaignId'));BPromise[_0x6588('0x79')](_0x299253,handleQuery)[_0x6588('0x7a')](function(_0x50ad02){stats['finish']=!![];stats[_0x6588('0x7b')]=_0x5dbf96['duplicates']&&_0x5dbf96[_0x6588('0x68')][_0x6588('0x53')]?results[0x2]['affectedRows']:results[0x0][_0x6588('0x7b')];socket['emit'](_0x6588('0x7c')+_0x27149f,stats);fs[_0x6588('0x7d')](_0x4ad2c4);fs[_0x6588('0x7d')](_0x14d52f);process[_0x6588('0x3c')](0x0);})[_0x6588('0x43')](function(_0x44caaf){logger[_0x6588('0x44')](_0x44caaf['message']);process[_0x6588('0x3c')](0x1);});}catch(_0x59a8c0){logger[_0x6588('0x44')](_0x6588('0x7e'),_0x59a8c0['message']);process[_0x6588('0x3c')](0x1);}},'error':function(_0x87e5a4,_0x4562b3,_0x58e6ce,_0x155503){throw new Error(_0x155503);}});}function validate(){if(process[_0x6588('0x7f')]&&process['argv']['length']<0x4){throw new Error(_0x6588('0x80'));}var _0x320723=path[_0x6588('0x14')](config[_0x6588('0x4b')],_0x6588('0x4c'),process[_0x6588('0x7f')][0x2]);if(!fs[_0x6588('0x81')](_0x320723)){throw new Error(_0x6588('0x82'));}var _0x1d0044={};try{_0x1d0044=JSON[_0x6588('0x50')](process['argv'][0x3]);if(!_0x1d0044[_0x6588('0x49')]){throw new Error(_0x6588('0x83'));}if(!_0x1d0044[_0x6588('0x49')][_0x6588('0x12')]){throw new Error(_0x6588('0x84'));}if(!_0x1d0044['binding']['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x688623=0x0;if(_0x1d0044[_0x6588('0x49')][_0x6588('0x24')]){_0x688623=0x1;}if(!_0x1d0044[_0x6588('0x22')]){throw new Error(_0x6588('0x85'));}}catch(_0x2b7364){throw new Error(_0x6588('0x86'));}var _0xcf46f=[];try{_0xcf46f=_[_0x6588('0x87')](JSON[_0x6588('0x50')](process['argv'][0x4]),'id');}catch(_0x11b032){logger[_0x6588('0x3a')](_0x6588('0x88'));}main(_0x320723,_0x1d0044,_0xcf46f,_0x688623);}validate();process['on']('SIGINT',handleStop);process['on'](_0x6588('0x89'),handleUncaughtException); \ No newline at end of file +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 diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index cff67df..cbbedb5 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 _0x6f88=['getSubjects','toLowerCase','inbound','push','variable','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','keyValue','calleridname','Call\x20To','destexten','Queue','queue','UniqueId','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x6f88,0x18c));var _0x86f8=function(_0x2aead8,_0x13bd4a){_0x2aead8=_0x2aead8-0x0;var _0x291f35=_0x6f88[_0x2aead8];return _0x291f35;};'use strict';exports[_0x86f8('0x0')]=function(_0xeb1449,_0x5990af){var _0x1143b=[{'type':'string','content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0xeb1449[_0x86f8('0x1')]()){case'voice':switch(_0x5990af[_0x86f8('0x1')]()){case _0x86f8('0x2'):_0x1143b[_0x86f8('0x3')]({'type':'variable','content':'','variableName':'queue'});_0x1143b[_0x86f8('0x3')]({'type':_0x86f8('0x4'),'content':'','variableName':_0x86f8('0x5')});break;case _0x86f8('0x6'):_0x1143b[_0x86f8('0x3')]({'type':_0x86f8('0x7'),'content':_0x86f8('0x8'),'variableName':null});_0x1143b[_0x86f8('0x3')]({'type':_0x86f8('0x4'),'content':'','variableName':_0x86f8('0x9')});break;}}return _0x1143b;};exports['getDescriptions']=function(_0x5757af,_0x284b0b){var _0x2554e1=[];switch(_0x5757af[_0x86f8('0x1')]()){case'voice':switch(_0x284b0b[_0x86f8('0x1')]()){case _0x86f8('0x2'):_0x2554e1=[{'type':'string','content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x86f8('0xa'),'content':'','key':'Caller\x20Number','keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x5')},{'type':'keyValue','content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0x86f8('0xb')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0xc'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0xd')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0xe'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0xf')},{'type':'keyValue','content':'','key':_0x86f8('0x10'),'keyType':'variable','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x86f8('0x11'),'keyType':'variable','variableName':_0x86f8('0x12')},{'type':_0x86f8('0x7'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x13'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x14')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x15'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x9')},{'type':_0x86f8('0x7'),'content':_0x86f8('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x17'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x12')},{'type':'keyValue','content':'','key':_0x86f8('0x18'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x19')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x1a'),'keyType':'variable','variableName':_0x86f8('0x1b')},{'type':'keyValue','content':'','key':'Hold\x20Time','keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x1c')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x1d'),'keyType':_0x86f8('0x4'),'variableName':_0x86f8('0x1e')}];break;case _0x86f8('0x6'):_0x2554e1=[{'type':_0x86f8('0x7'),'content':_0x86f8('0x1f'),'variableName':null},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x20'),'keyType':'variable','keyContent':'','variableName':_0x86f8('0x9')},{'type':'keyValue','content':'','key':_0x86f8('0x21'),'keyType':_0x86f8('0x4'),'keyContent':'','variableName':_0x86f8('0x22')},{'type':_0x86f8('0xa'),'content':'','key':'UniqueId','keyType':_0x86f8('0x4'),'keyContent':'','variableName':'uniqueid'},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x11'),'keyType':_0x86f8('0x4'),'keyContent':'','variableName':_0x86f8('0x23')},{'type':_0x86f8('0x7'),'content':_0x86f8('0x16')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x24'),'keyType':'variable','keyContent':'','variableName':_0x86f8('0x25')},{'type':_0x86f8('0xa'),'content':'','key':_0x86f8('0x26'),'keyType':'variable','keyContent':'','variableName':_0x86f8('0x27')},{'type':'keyValue','content':'','key':_0x86f8('0x28'),'keyType':_0x86f8('0x4'),'keyContent':'','variableName':_0x86f8('0x29')},{'type':'keyValue','content':'','key':_0x86f8('0x2a'),'keyType':_0x86f8('0x4'),'keyContent':'','variableName':_0x86f8('0x2b')}];break;}}return _0x2554e1;}; \ No newline at end of file +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 diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 828ac86..54066bb 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 _0x7a21=['mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','toUpperCase','role','stringify','null','Interaction','findOne','then','update','info','catch','error','tracked','user','omit','html','phone','fax'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x7a21,0x1ee));var _0x17a2=function(_0x55cba1,_0x45e97e){_0x55cba1=_0x55cba1-0x0;var _0x2eaee9=_0x7a21[_0x55cba1];return _0x2eaee9;};'use strict';var _=require('lodash');var db=require(_0x17a2('0x0'))['db'];var loggers={'openchannel':require(_0x17a2('0x1'))(_0x17a2('0x2')),'mail':require(_0x17a2('0x1'))(_0x17a2('0x3')),'fax':require(_0x17a2('0x1'))(_0x17a2('0x4')),'sms':require(_0x17a2('0x1'))(_0x17a2('0x5')),'chat':require(_0x17a2('0x1'))(_0x17a2('0x6')),'whatsapp':require(_0x17a2('0x1'))('whatsapp-interactions')};function getInteractionId(_0x5c5520,_0x13ff04,_0x1b8d49){if(_0x5c5520&&_0x5c5520[_[_0x17a2('0x7')](_0x1b8d49)+_0x17a2('0x8')]){return _0x5c5520[_[_0x17a2('0x7')](_0x1b8d49)+_0x17a2('0x8')];}else if(_0x5c5520&&_0x5c5520['id']){return _0x5c5520['id'];}else if(_0x13ff04&&_0x13ff04['id']){return _0x13ff04['id'];}else{return _0x17a2('0x9');}}function log(_0x1d0b13,_0x4b35fe,_0x64eb27,_0x20d684,_0x4bea48,_0x2560eb){loggers[_0x4bea48[_0x17a2('0xa')]()][_0x1d0b13]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2560eb[_0x17a2('0xb')](),_0x4b35fe?_0x4b35fe['id']:null,_0x4b35fe?_0x4b35fe['name']:null,_0x4b35fe?_0x4b35fe[_0x17a2('0xc')]:null,getInteractionId(_0x64eb27,_0x20d684,_0x4bea48),_0x64eb27?JSON[_0x17a2('0xd')](_0x64eb27):_0x17a2('0xe'));}function updateUser(_0x19b9b9,_0x5bf5bb,_0x9f3cff,_0x139d92,_0x28458d){db[_[_0x17a2('0x7')](_0x139d92)+_0x17a2('0xf')][_0x17a2('0x10')]({'where':{'id':getInteractionId(_0x5bf5bb,_0x9f3cff,_0x139d92)}})[_0x17a2('0x11')](function(_0x5073d7){if(_0x5073d7){return _0x5073d7[_0x17a2('0x12')]({'UserId':_0x19b9b9?_0x19b9b9['id']:null});}})['then'](function(_0x694579){if(_0x694579){log(_0x17a2('0x13'),_0x19b9b9,_0x5bf5bb,_0x9f3cff,_0x139d92,_0x28458d);}})[_0x17a2('0x14')](function(){log(_0x17a2('0x15'),_0x19b9b9,_0x5bf5bb,_0x9f3cff,_0x139d92,_0x28458d);});}exports[_0x17a2('0x16')]=function(_0x4aa15f,_0x3ec965){return function(_0x30aa49,_0x2c5463,_0x3ed23f){var _0x3e3ae7=_0x30aa49[_0x17a2('0x17')];var _0x4f3c4a={};var _0x351f3b=_0x30aa49['query'];if(_0x4f3c4a){_0x4f3c4a=_['clone'](_0x30aa49['body']);_0x4f3c4a=_[_0x17a2('0x18')](_0x4f3c4a,['body',_0x17a2('0x19'),_0x17a2('0x1a'),_0x17a2('0x1b'),_0x17a2('0x1c')]);}updateUser(_0x3e3ae7,_0x4f3c4a,_0x351f3b,_0x4aa15f,_0x3ec965);_0x3ed23f(null);};}; \ No newline at end of file +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 diff --git a/server/components/license/service.js b/server/components/license/service.js index bfc172e..84b9722 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 _0xb9dd=['json','catch','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','use','License','findOne','then','count','status'];(function(_0xc7024f,_0xb29395){var _0x47f5ee=function(_0x55d520){while(--_0x55d520){_0xc7024f['push'](_0xc7024f['shift']());}};_0x47f5ee(++_0xb29395);}(_0xb9dd,0x1c7));var _0xdb9d=function(_0x3bca71,_0x3afcc8){_0x3bca71=_0x3bca71-0x0;var _0x53b29e=_0xb9dd[_0x3bca71];return _0x53b29e;};'use strict';var crypto=require(_0xdb9d('0x0'));var util=require('util');var compose=require(_0xdb9d('0x1'));var db=require(_0xdb9d('0x2'))['db'];var config=require(_0xdb9d('0x3'));function getValueFromLicense(_0x3e39d8,_0x304d03){if(_0x3e39d8&&_0x304d03){if(_0x304d03[_0xdb9d('0x4')]&&_0x304d03[_0xdb9d('0x5')]){var _0x1e6b77=_0x304d03[_0xdb9d('0x4')];var _0x2f1845=_0x304d03[_0xdb9d('0x5')];var _0x3cb85d=_0x1e6b77[_0xdb9d('0x6')]('-')[0x4];var _0x2516b4=_0x1e6b77[_0xdb9d('0x6')]('-')[0x0];var _0x3e8553=crypto[_0xdb9d('0x7')]('aes-256-ctr',util[_0xdb9d('0x8')](_0xdb9d('0x9'),_0x3cb85d,_0x1e6b77,_0x2516b4));var _0x4340eb=_0x3e8553[_0xdb9d('0xa')](_0x2f1845,_0xdb9d('0xb'),_0xdb9d('0xc'));_0x4340eb+=_0x3e8553[_0xdb9d('0xd')](_0xdb9d('0xc'));var _0x78a8c7=JSON[_0xdb9d('0xe')](_0x4340eb);return _0x78a8c7['hasOwnProperty'](_0x3e39d8)?_0x78a8c7[_0x3e39d8]:null;}}return null;}function isLimit(_0x4f881c,_0x38fd74,_0x1d9911,_0x56ca6e){var _0x4200d5=_0x38fd74;return compose()[_0xdb9d('0xf')](function(_0x469d23,_0x56e23d,_0x386a62){return db[_0xdb9d('0x10')][_0xdb9d('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xdb9d('0x12')](function(_0x4b236e){var _0xacec67=getValueFromLicense(_0x4f881c,_0x4b236e);return _0xacec67?_0xacec67:_0x4200d5;})[_0xdb9d('0x12')](function(_0x3a8205){_0x4200d5=_0x3a8205;return _0x1d9911[_0xdb9d('0x13')](_0x56ca6e);})['then'](function(_0x26a496){if(_0x26a496>=_0x4200d5){return _0x56e23d[_0xdb9d('0x14')](0x193)[_0xdb9d('0x15')]({'message':util[_0xdb9d('0x8')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4f881c)});}_0x386a62();})[_0xdb9d('0x16')](function(_0x393329){_0x386a62(_0x393329);});});}function isUserLimit(){return isLimit(_0xdb9d('0x17'),0x1,db[_0xdb9d('0x18')],{'where':{'$or':[{'role':_0xdb9d('0x19')},{'role':_0xdb9d('0x1a')}]}});}exports[_0xdb9d('0x1b')]=isUserLimit; \ No newline at end of file +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 diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index a408fb4..26c6613 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 _0xb796=['lodash','moment','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','slice','forEach','shift','match','filter','indexOf','conditions','push','DATE','operator','$eq','$between','value','includes','$lte','days','YYYY-MM-DD','castTo','field','\x20AS\x20','text','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$endsWith','utcOffset','add','seconds'];(function(_0x399b87,_0x34c174){var _0x2b1ae4=function(_0x334dda){while(--_0x334dda){_0x399b87['push'](_0x399b87['shift']());}};_0x2b1ae4(++_0x34c174);}(_0xb796,0x1b8));var _0x6b79=function(_0x5e7113,_0x4f0e18){_0x5e7113=_0x5e7113-0x0;var _0x528018=_0xb796[_0x5e7113];return _0x528018;};'use strict';var _=require(_0x6b79('0x0'));var moment=require(_0x6b79('0x1'));exports['parseSearch']=function(_0x14bd53){var _0x5a2c44={'conditions':[]};_0x5a2c44[_0x6b79('0x2')]=_[_0x6b79('0x3')](_0x14bd53,_0x6b79('0x4'))?'or':'and';var _0x2d0521=_0x14bd53[_0x6b79('0x5')](_0x6b79('0x6'),'')[_0x6b79('0x5')](_0x6b79('0x4'),'')[_0x6b79('0x7')]('||');for(var _0x4ae6fd=0x0;_0x4ae6fd<_0x2d0521[_0x6b79('0x8')];_0x4ae6fd++){var _0x1d4da3=_0x2d0521[_0x4ae6fd][_0x6b79('0x7')](':=');var _0x20188=_0x1d4da3[0x0];var _0x10ac23=_0x1d4da3[_0x6b79('0x9')](0x1);_0x10ac23[_0x6b79('0xa')](function(_0x52c868){var _0x4fcfbf=_0x52c868[_0x6b79('0x7')]('[')[_0x6b79('0xb')]();var _0x3477e7=_0x52c868[_0x6b79('0xc')](/\[(.*?)\]/g);_0x3477e7[_0x6b79('0xa')](function(_0x5f253f){var _0x19f545=_0x5f253f[_0x6b79('0x7')]('[')[_0x6b79('0xd')](function(_0x108385){return _0x108385[_0x6b79('0xe')](']')>-0x1;})['map'](function(_0x3067a0){return _0x3067a0[_0x6b79('0x7')](']')[0x0];})[0x0];_0x5a2c44[_0x6b79('0xf')][_0x6b79('0x10')]({'field':_0x20188,'operator':_0x4fcfbf,'value':_0x19f545});});});}return _0x5a2c44;};exports['buildExpression']=function(_0x485363,_0x3ea85c,_0x340c39){var _0x5125ba={};if(_0x3ea85c===_0x6b79('0x11')){if(_0x340c39[_0x6b79('0x12')]===_0x6b79('0x13')){_0x340c39['operator']=_0x6b79('0x14');_0x340c39[_0x6b79('0x15')]+=','+_0x340c39[_0x6b79('0x15')];}else if(_[_0x6b79('0x16')](['$gt',_0x6b79('0x17')],_0x340c39[_0x6b79('0x12')])){_0x340c39[_0x6b79('0x15')]=moment(_0x340c39[_0x6b79('0x15')])['add'](0x1,_0x6b79('0x18'))['format'](_0x6b79('0x19'));}}if(_0x340c39[_0x6b79('0x1a')]){_0x3ea85c=_0x340c39[_0x6b79('0x1a')];_0x5125ba['text']='CAST('+_0x485363+'.'+_0x340c39[_0x6b79('0x1b')]+_0x6b79('0x1c')+_0x340c39[_0x6b79('0x1a')]+')\x20'+parseOperator(_0x340c39['operator']);}else{_0x5125ba[_0x6b79('0x1d')]=_0x485363+'.'+_0x340c39['field']+'\x20'+parseOperator(_0x340c39[_0x6b79('0x12')]);}if(_[_0x6b79('0x16')]([_0x6b79('0x1e'),_0x6b79('0x1f')],_0x340c39['operator']))_0x5125ba[_0x6b79('0x1d')]='('+_0x5125ba[_0x6b79('0x1d')]+_0x6b79('0x20')+_0x485363+'.'+_0x340c39[_0x6b79('0x1b')]+_0x6b79('0x21');_0x5125ba[_0x6b79('0x15')]=parseValue(_0x3ea85c,_0x340c39['operator'],_0x340c39[_0x6b79('0x15')]);return _0x5125ba;};function parseOperator(_0x3b5809){var _0x2bc5bc;switch(_0x3b5809){case _0x6b79('0x22'):_0x2bc5bc=_0x6b79('0x23');break;case _0x6b79('0x1f'):_0x2bc5bc=_0x6b79('0x24');break;case _0x6b79('0x13'):_0x2bc5bc=_0x6b79('0x25');break;case _0x6b79('0x1e'):_0x2bc5bc=_0x6b79('0x26');break;case _0x6b79('0x27'):case _0x6b79('0x28'):case'$endsWith':_0x2bc5bc=_0x6b79('0x29');break;case _0x6b79('0x2a'):_0x2bc5bc=_0x6b79('0x2b');break;case _0x6b79('0x2c'):_0x2bc5bc=_0x6b79('0x2d');break;case _0x6b79('0x17'):_0x2bc5bc=_0x6b79('0x2e');break;case _0x6b79('0x2f'):_0x2bc5bc=_0x6b79('0x30');break;case'$between':_0x2bc5bc=_0x6b79('0x31');break;}return _0x2bc5bc;}function parseValue(_0x2c8af4,_0x4a0ca5,_0x1b22de){var _0x4702c7={'start':undefined,'end':undefined};switch(_0x4a0ca5){case _0x6b79('0x22'):case _0x6b79('0x1f'):_0x4702c7['start']=_0x1b22de[_0x6b79('0x7')](',');break;case _0x6b79('0x27'):_0x4702c7['start']='%'+_0x1b22de+'%';break;case _0x6b79('0x28'):_0x4702c7[_0x6b79('0x32')]=_0x1b22de+'%';break;case _0x6b79('0x33'):_0x4702c7[_0x6b79('0x32')]='%'+_0x1b22de;break;case _0x6b79('0x14'):var _0x5d1941=_0x1b22de[_0x6b79('0x7')](',');var _0x1b22de=_0x5d1941[_0x6b79('0xb')]();var _0x2ebca4=_0x5d1941['pop']();if(_0x2c8af4===_0x6b79('0x11')){_0x1b22de=moment(_0x1b22de)[_0x6b79('0x34')](0x0,!![])['format']();_0x2ebca4=moment(_0x2ebca4)[_0x6b79('0x34')](0x0,!![])[_0x6b79('0x35')](0x17,'hours')[_0x6b79('0x35')](0x3b,'minutes')[_0x6b79('0x35')](0x3b,_0x6b79('0x36'))['format']();}_0x4702c7={'start':_0x1b22de,'end':_0x2ebca4};break;default:_0x4702c7[_0x6b79('0x32')]=_0x1b22de;break;}return _0x4702c7;} \ No newline at end of file +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 diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index f4bb14e..a99d888 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 _0x161d=['name','uniqueid','limit','map','indexOf','priority','cast','col','unsigned','substr','DESC','ASC','omit','isArray','isObject','isString','length','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','getFullTextValue','replace','push','getOptions','query','$id','model','attributes','intersection','nolimit','offset','order','sort','where','pick','filter','object','columns','value','merge','type','lodash','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','find','DATE','$gte','format','YYYY-MM-DD'];(function(_0x36bbc6,_0x43f2d3){var _0x513539=function(_0x5b3ad1){while(--_0x5b3ad1){_0x36bbc6['push'](_0x36bbc6['shift']());}};_0x513539(++_0x43f2d3);}(_0x161d,0x65));var _0xd161=function(_0x224bc9,_0x3b3e91){_0x224bc9=_0x224bc9-0x0;var _0x53499d=_0x161d[_0x224bc9];return _0x53499d;};'use strict';var _=require(_0xd161('0x0'));var sequelize=require(_0xd161('0x1'));var moment=require(_0xd161('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x113d32){var _0x3becf0=['ne'];try{var _0xc06e05=JSON[_0xd161('0x3')](_0x113d32);var _0x4dcc6f=Object[_0xd161('0x4')](_0xc06e05)[0x0];return _0x3becf0[_0xd161('0x5')](_0x4dcc6f);}catch(_0x2b1311){return![];}}function getOperatorValue(_0xb481d8){var _0x1570ae=JSON[_0xd161('0x3')](_0xb481d8);var _0x14f052=Object[_0xd161('0x4')](_0x1570ae)[0x0];var _0x268659=_0x1570ae[_0x14f052];return{['$'+_0x14f052]:_0x268659};}exports[_0xd161('0x6')]=function(_0x27ff7d){var _0x1492f9=null;if(_0x27ff7d){_0x1492f9=_0x27ff7d[_0xd161('0x7')](',');}return _0x1492f9;};exports[_0xd161('0x8')]=function(_0x6afe7b,_0x589947){var _0x59e947={};if(!_[_0xd161('0x9')](_0x6afe7b)){_['forOwn'](_0x6afe7b,function(_0x33b273,_0x5c3a4e){try{if(_0x589947){var _0x414eaf=_[_0xd161('0xa')](_0x589947,{'name':_0x5c3a4e})||{};if(hasSequelizeOperator(_0x33b273)){_0x59e947[_0x5c3a4e]=getOperatorValue(_0x33b273);}else if(_0x414eaf['type']===_0xd161('0xb')&&_['isPlainObject'](_0x33b273)){var _0x2bc190=JSON[_0xd161('0x3')](_0x33b273);var _0x1edc5a={'$gte':moment(moment(_0x2bc190[_0xd161('0xc')])[_0xd161('0xd')](_0xd161('0xe')))['utc']()['format'](),'$lte':moment(moment(_0x2bc190['$lte'])[_0xd161('0xd')]('YYYY-MM-DD'))['utc']()['subtract'](0x1,'s')[_0xd161('0xd')]()};_0x59e947[_0x5c3a4e]=_0x1edc5a;}else if(_0x414eaf[_0xd161('0xf')]===_0xd161('0x10')){_0x59e947[_0x5c3a4e]=_0x33b273;}else{_0x59e947[_0x5c3a4e]=_['isArray'](_0x33b273)?_0x33b273:JSON[_0xd161('0x3')](_0x33b273);}}else{_0x59e947[_0x5c3a4e]=_['isArray'](_0x33b273)?_0x33b273:JSON[_0xd161('0x3')](_0x33b273);}}catch(_0x445500){_0x59e947[_0x5c3a4e]=_0x33b273[_0xd161('0x7')](',');}});}return _0x59e947;};exports[_0xd161('0x11')]=function(_0x11fa7c){_0x11fa7c=parseInt(_0x11fa7c,0xa);if(!_0x11fa7c||_0x11fa7c<0x0){_0x11fa7c=LIMIT_VALUE;}return _0x11fa7c;};exports['offset']=function(_0x10fec8){_0x10fec8=parseInt(_0x10fec8,0xa);if(!_0x10fec8||_0x10fec8<0x0){_0x10fec8=0x0;}return _0x10fec8;};exports['sort']=function(_0x1cfcb7){var _0x1a11fd,_0x514af5=null;if(_0x1cfcb7){_0x1a11fd=_0x1cfcb7[_0xd161('0x7')](',');_0x514af5=_[_0xd161('0x12')](_0x1a11fd,function(_0x4540fa){if(_0x4540fa[_0xd161('0x13')]('-')===0x0){return[_0x4540fa===_0xd161('0x14')?sequelize[_0xd161('0x15')](sequelize[_0xd161('0x16')]('priority'),_0xd161('0x17')):_0x4540fa[_0xd161('0x18')](0x1),_0xd161('0x19')];}else{return[_0x4540fa===_0xd161('0x14')?sequelize['cast'](sequelize[_0xd161('0x16')](_0xd161('0x14')),_0xd161('0x17')):_0x4540fa,_0xd161('0x1a')];}});}return _0x514af5;};exports[_0xd161('0x1b')]=function(_0x10bf93,_0x437756){if(_[_0xd161('0x9')](_0x10bf93)){return _0x10bf93;}if(_[_0xd161('0x1c')](_0x10bf93)){for(var _0x5c27e3=0x0;_0x5c27e3<_0x10bf93['length'];_0x5c27e3+=0x1){_0x10bf93[_0x5c27e3]=this['omit'](_0x10bf93[_0x5c27e3],_0x437756);}return _0x10bf93;}if(!_[_0xd161('0x1d')](_0x10bf93)){return _0x10bf93;}if(_[_0xd161('0x1e')](_0x437756)){_0x437756=[_0x437756];}if(!_[_0xd161('0x1c')](_0x437756)){return _0x10bf93;}for(var _0x1aac6f=0x0;_0x1aac6f<_0x437756[_0xd161('0x1f')];_0x1aac6f+=0x1){_[_0xd161('0x20')](_0x10bf93,_0x437756[_0x1aac6f]);}for(var _0x17c143 in _0x10bf93){if(_0x10bf93[_0xd161('0x21')](_0x17c143)){_0x10bf93[_0x17c143]=this[_0xd161('0x1b')](_0x10bf93[_0x17c143],_0x437756);}}return _0x10bf93;};exports[_0xd161('0x22')]=function(_0x37ad00){return _0x37ad00[_0xd161('0x23')](RegExp(_0xd161('0x24')))?!![]:![];};exports['isEmail']=function(_0x5d2105){return _0x5d2105[_0xd161('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0xd161('0x25')]=function(_0x3909f0){var _0x48852d=[];_0x3909f0[_0xd161('0x7')](/[ ,]+/)['forEach'](function(_0x22cba0){_0x22cba0=_0x22cba0[_0xd161('0x26')](/([^:]")"+/g,'$1');_0x22cba0='+'+_0x22cba0+'*';if(_0x22cba0['includes']('@'))_0x22cba0='\x22'+_0x22cba0+'\x22';_0x48852d[_0xd161('0x27')](_0x22cba0);});return _0x48852d['join']('\x20');};exports[_0xd161('0x28')]=function(_0x40bc87,_0x10e0c8,_0x3d0693){var _0x5e9897={},_0xe70f8={};if(_0x10e0c8[_0xd161('0x29')][_0xd161('0x2a')]){_0x10e0c8[_0xd161('0x29')]['id']=_0x10e0c8[_0xd161('0x29')]['$id'];delete _0x10e0c8['query']['$id'];}_0x5e9897[_0xd161('0x2b')]=_[_0xd161('0x12')](_0x40bc87,_0xd161('0xf'));_0x5e9897[_0xd161('0x29')]=_[_0xd161('0x4')](_0x10e0c8[_0xd161('0x29')]);_0x5e9897[_0xd161('0x8')]=_['intersection'](_0x5e9897[_0xd161('0x2b')],_0x5e9897['query']);_0xe70f8[_0xd161('0x2c')]=_[_0xd161('0x2d')](_0x5e9897['model'],this[_0xd161('0x6')](_0x10e0c8[_0xd161('0x29')][_0xd161('0x6')]));_0xe70f8[_0xd161('0x2c')]=_0xe70f8['attributes'][_0xd161('0x1f')]?_0xe70f8[_0xd161('0x2c')]:_0x5e9897[_0xd161('0x2b')];if(!_0x10e0c8['query']['hasOwnProperty'](_0xd161('0x2e'))){_0xe70f8[_0xd161('0x11')]=this[_0xd161('0x11')](_0x10e0c8[_0xd161('0x29')][_0xd161('0x11')]);_0xe70f8[_0xd161('0x2f')]=this[_0xd161('0x2f')](_0x10e0c8[_0xd161('0x29')][_0xd161('0x2f')]);}_0xe70f8[_0xd161('0x30')]=this['sort'](_0x10e0c8[_0xd161('0x29')][_0xd161('0x31')]);_0xe70f8[_0xd161('0x32')]=this['filters'](_[_0xd161('0x33')](_0x10e0c8[_0xd161('0x29')],_0x5e9897[_0xd161('0x8')]),_0x40bc87);if(_0x10e0c8['query'][_0xd161('0x34')]){var _0x45232c=_0x40bc87;var _0x252b0c=_0x10e0c8[_0xd161('0x29')][_0xd161('0x34')];if(typeof _0x252b0c===_0xd161('0x35')){_0x45232c=_['filter'](_0x40bc87,function(_0x3f4f9b){return _[_0xd161('0x5')](_0x252b0c[_0xd161('0x36')],_0x3f4f9b[_0xd161('0xf')]);});_0x252b0c=_0x252b0c[_0xd161('0x37')];}_0xe70f8[_0xd161('0x32')]=_[_0xd161('0x38')](_0xe70f8[_0xd161('0x32')],{'$or':_[_0xd161('0x12')](_0x45232c,function(_0x34e1f3){if(_0x34e1f3[_0xd161('0x39')]!=='VIRTUAL'){if(_0x3d0693){return sequelize[_0xd161('0x32')](sequelize['fn']('lower',sequelize['col'](_0x34e1f3[_0xd161('0xf')])),{'$like':sequelize['fn']('lower','%'+_0x10e0c8['query'][_0xd161('0x34')]+'%')});}else{var _0x2ffb7f={};_0x2ffb7f[_0x34e1f3['name']]={'$like':'%'+_0x10e0c8[_0xd161('0x29')][_0xd161('0x34')]+'%'};return _0x2ffb7f;}}})});}_0xe70f8=_[_0xd161('0x38')]({},_0xe70f8,_0x10e0c8['options']);return _0xe70f8;}; \ No newline at end of file +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 diff --git a/server/config/express.js b/server/config/express.js index 8c08aeb..95cfe6c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1016=['html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','serve-favicon','body-parser','method-override','errorhandler','cors','moment','./environment','../mysqldb','default','get','env','set','appPath','join','root','public','development','json\x20replacer','toISOString','split','use','static','/server/views'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1016,0x115));var _0x6101=function(_0x403feb,_0x5de3bc){_0x403feb=_0x403feb-0x0;var _0x1a74ae=_0x1016[_0x403feb];return _0x1a74ae;};'use strict';var express=require('express');var favicon=require(_0x6101('0x0'));var bodyParser=require(_0x6101('0x1'));var methodOverride=require(_0x6101('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x6101('0x3'));var path=require('path');var passport=require('passport');var cors=require(_0x6101('0x4'));var moment=require(_0x6101('0x5'));var config=require(_0x6101('0x6'));var db=require(_0x6101('0x7'))['db'];exports[_0x6101('0x8')]=function(_0x1d8877){var _0x7dae5=_0x1d8877[_0x6101('0x9')](_0x6101('0xa'));if(_0x7dae5==='production'){_0x1d8877[_0x6101('0xb')](_0x6101('0xc'),path[_0x6101('0xd')](config[_0x6101('0xe')],_0x6101('0xf')));}if(_0x7dae5===_0x6101('0x10')||_0x7dae5==='test'){_0x1d8877[_0x6101('0xb')](_0x6101('0xc'),path[_0x6101('0xd')](config[_0x6101('0xe')],'client'));_0x1d8877['use'](errorHandler());}_0x1d8877[_0x6101('0xb')](_0x6101('0x11'),function(_0xfb3d60,_0x4529e7){if(this[_0xfb3d60]instanceof Date){_0x4529e7=this[_0xfb3d60][_0x6101('0x12')]()[_0x6101('0x13')]('.')[0x0]+'Z';}return _0x4529e7;});_0x1d8877[_0x6101('0x14')](express[_0x6101('0x15')](_0x1d8877['get'](_0x6101('0xc'))));_0x1d8877[_0x6101('0xb')]('views',config['root']+_0x6101('0x16'));_0x1d8877['engine'](_0x6101('0x17'),require(_0x6101('0x18'))[_0x6101('0x19')]);_0x1d8877[_0x6101('0xb')](_0x6101('0x1a'),'html');_0x1d8877[_0x6101('0x14')](bodyParser[_0x6101('0x1b')]({'limit':_0x6101('0x1c'),'extended':!![]}));_0x1d8877[_0x6101('0x14')](bodyParser[_0x6101('0x1d')]({'limit':_0x6101('0x1c')}));_0x1d8877[_0x6101('0x14')](cors());_0x1d8877[_0x6101('0x14')](methodOverride());_0x1d8877[_0x6101('0x14')](cookieParser());_0x1d8877['use'](passport['initialize']());}; \ No newline at end of file +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 diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 3d0f926..e1aeef9 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 _0xf3f6=['platform','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','macAddress','ipAddress','md5','substring','lodash','bimedia-machine-uuid','execSync','networkInterfaces','keys','length','filter','family','IPv4','internal','concat','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','update','digest','hex','getUuid'];(function(_0x1ce168,_0x29633e){var _0x397ee4=function(_0x26786f){while(--_0x26786f){_0x1ce168['push'](_0x1ce168['shift']());}};_0x397ee4(++_0x29633e);}(_0xf3f6,0x73));var _0x6f3f=function(_0x236612,_0x35eb98){_0x236612=_0x236612-0x0;var _0x28d630=_0xf3f6[_0x236612];return _0x28d630;};'use strict';var _=require(_0x6f3f('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x6f3f('0x1'));var exec=require('child_process')[_0x6f3f('0x2')];var config=require('../environment');function getInterfaces(){var _0x444889=[];var _0x3a4932=os[_0x6f3f('0x3')]();var _0x1a8023=_['orderBy'](_[_0x6f3f('0x4')](_0x3a4932));for(var _0x26dc51=0x0;_0x26dc51<_0x1a8023[_0x6f3f('0x5')];_0x26dc51++){var _0x57f80d=_0x3a4932[_0x1a8023[_0x26dc51]][_0x6f3f('0x6')](function(_0x51f8b7){return _0x51f8b7[_0x6f3f('0x7')]===_0x6f3f('0x8')&&_0x51f8b7[_0x6f3f('0x9')]===![];});_0x444889=_0x444889[_0x6f3f('0xa')](_0x57f80d);}return _0x444889;}function getFirstInterface(){var _0x9ccd00=_['head'](getInterfaces());return{'macAddress':_0x9ccd00&&_0x9ccd00[_0x6f3f('0xb')]?_0x9ccd00[_0x6f3f('0xb')]:_0x6f3f('0xc'),'ipAddress':_0x9ccd00&&_0x9ccd00[_0x6f3f('0xd')]?_0x9ccd00['address']:_0x6f3f('0xe')};}exports[_0x6f3f('0xf')]=getFirstInterface;function getCPUhash(){var _0x4c72eb=_[_0x6f3f('0x10')](os[_0x6f3f('0x11')]()[_0x6f3f('0x12')](function(_0x5f3141){return _0x5f3141[_0x6f3f('0x13')];}))[_0x6f3f('0x14')](':');return crypto['createHash']('md5')[_0x6f3f('0x15')](_0x4c72eb)[_0x6f3f('0x16')](_0x6f3f('0x17'));}exports[_0x6f3f('0x18')]=function(){var _0x55dd28=os[_0x6f3f('0x19')]();var _0x49b84b=/[0-9a-f-]{36}/;if(config[_0x6f3f('0x1a')]&&_0x49b84b['test'](config[_0x6f3f('0x1a')])){return config['licenseToken'];}else if(_0x55dd28===_0x6f3f('0x1b')){return exec(_0x6f3f('0x1c'),{'encoding':_0x6f3f('0x1d')})[_0x6f3f('0x1e')]('\x0d\x0a','');}else{var _0x76cd41=getFirstInterface();var _0xa81c80=getCPUhash();var _0x2c914b=_0xa81c80+'|'+os['hostname']()+'|'+_0x76cd41[_0x6f3f('0x1f')]+'|'+_0x76cd41[_0x6f3f('0x20')];var _0x318bf4=crypto['createHash'](_0x6f3f('0x21'))[_0x6f3f('0x15')](_0x2c914b)[_0x6f3f('0x16')](_0x6f3f('0x17'));return _0x318bf4['substring'](0x0,0x8)+'-'+_0x318bf4[_0x6f3f('0x22')](0x8,0xc)+'-'+_0x318bf4[_0x6f3f('0x22')](0xc,0x10)+'-'+_0x318bf4[_0x6f3f('0x22')](0x10,0x14)+'-'+_0x318bf4[_0x6f3f('0x22')](0x14);}}; \ No newline at end of file +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 diff --git a/server/config/license/index.js b/server/config/license/index.js index 28937dd..42382e3 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 _0xb9af=['toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','then','catch','get','data2','data1','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s'];(function(_0x405868,_0x3b6e2c){var _0x51873d=function(_0x53e793){while(--_0x53e793){_0x405868['push'](_0x405868['shift']());}};_0x51873d(++_0x3b6e2c);}(_0xb9af,0x155));var _0xfb9a=function(_0x5083da,_0x174589){_0x5083da=_0x5083da-0x0;var _0x5c3887=_0xb9af[_0x5083da];return _0x5c3887;};'use strict';var util=require(_0xfb9a('0x0'));var moment=require(_0xfb9a('0x1'));var rp=require(_0xfb9a('0x2'));var BPromise=require(_0xfb9a('0x3'));var pkginfo=require(_0xfb9a('0x4'))(module,_0xfb9a('0x5'));var db=require(_0xfb9a('0x6'))['db'];var encryptor=require(_0xfb9a('0x7'));var hardware=require(_0xfb9a('0x8'));var logger=require('../logger')('license');var HOST=_0xfb9a('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3755ce){return new BPromise(function(_0x39cf24,_0x57c992){var _0xa61e76=util[_0xfb9a('0xa')](_0xfb9a('0xb'),HOST,_0x3755ce,module[_0xfb9a('0xc')][_0xfb9a('0x5')]);if(oldToken){_0xa61e76=util[_0xfb9a('0xa')](_0xfb9a('0xd'),HOST,_0x3755ce,module[_0xfb9a('0xc')][_0xfb9a('0x5')],oldToken);}var _0x1bf1a5={'uri':_0xa61e76,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x1bf1a5)[_0xfb9a('0xe')](function(_0xc87f){_0x39cf24(_0xc87f);})[_0xfb9a('0xf')](function(_0x5a07ba){_0x57c992(_0x5a07ba);});});}function manageLicense(_0x40a601,_0x471c11){var _0x5f41ff=_0x471c11[_0xfb9a('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x5f41ff['data1']!==_0x40a601&&!_0x5f41ff[_0xfb9a('0x11')]){oldToken=_0x5f41ff[_0xfb9a('0x12')];}httpRequest(_0x40a601)[_0xfb9a('0xe')](function(_0x5ec49f){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x5ec49f[_0xfb9a('0x13')]){isOldTokenSent=![];if(!_0x5f41ff['license']&&_0x5f41ff[_0xfb9a('0x14')]!=_0x5ec49f[_0xfb9a('0x14')]||_0x5f41ff[_0xfb9a('0x14')]&&_0x5f41ff['data2']){logger['info'](_0xfb9a('0x15'));}if(_0x5f41ff[_0xfb9a('0x14')]&&!_0x5f41ff[_0xfb9a('0x11')]&&_0x5f41ff['license']!=_0x5ec49f[_0xfb9a('0x14')]){logger[_0xfb9a('0x16')](_0xfb9a('0x17'));}if(_0x5f41ff[_0xfb9a('0x14')]&&!_0x5f41ff[_0xfb9a('0x11')]&&_0x5f41ff['license']==_0x5ec49f[_0xfb9a('0x14')]){return _0x471c11;}return _0x471c11[_0xfb9a('0x18')]({'data1':_0x40a601,'data2':null,'license':_0x5ec49f[_0xfb9a('0x14')]});}else{if(_0x5ec49f[_0xfb9a('0x14')]||_0x5f41ff[_0xfb9a('0x14')]){if(!_0x5f41ff[_0xfb9a('0x11')]){if(_0x5f41ff['data1']==_0x40a601){GRAY_PERIOD_REASON='Disabled';logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xfb9a('0x19');logger[_0xfb9a('0x16')](_0xfb9a('0x1a'),_0x5f41ff[_0xfb9a('0x12')],_0x40a601);}logger[_0xfb9a('0x16')](_0xfb9a('0x1b'),GRAY_PERIOD_REASON[_0xfb9a('0x1c')](),moment()[_0xfb9a('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x471c11[_0xfb9a('0x18')]({'data2':encryptor['encryptString'](moment()[_0xfb9a('0xa')](_0xfb9a('0x1d')))});}else{if(moment()[_0xfb9a('0x1e')](encryptor[_0xfb9a('0x1f')](_0x5f41ff[_0xfb9a('0x11')]),'days')>DAYS){logger['info'](_0xfb9a('0x20'),moment()['format']('YYYY-MM-DD\x20HH:mm'));isOldTokenSent=![];return _0x471c11[_0xfb9a('0x18')]({'data1':_0x40a601,'data2':null,'license':null});}}}else{if(_0x5f41ff[_0xfb9a('0x12')]!=_0x40a601){logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x5f41ff[_0xfb9a('0x12')],_0x40a601);return _0x471c11[_0xfb9a('0x18')]({'data1':_0x40a601,'data2':null,'license':null});}}}return _0x471c11;})[_0xfb9a('0xe')](function(_0x2e0f20){_0x471c11=_0x2e0f20;})[_0xfb9a('0xf')](function(_0x5ef300){logger[_0xfb9a('0x21')](_0x5ef300[_0xfb9a('0x22')]);})[_0xfb9a('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xfb9a('0x24')](),_0x471c11);},TIME);});}function defaultLicense(){var _0x1b2584=hardware[_0xfb9a('0x24')]();if(_0x1b2584){return db[_0xfb9a('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x1b2584}})[_0xfb9a('0x26')](function(_0x21283b,_0x562451){logger[_0xfb9a('0x16')](_0xfb9a('0x27'),_0x1b2584);manageLicense(_0x1b2584,_0x21283b);})['catch'](function(_0x177fce){logger[_0xfb9a('0x21')](_0x177fce['message']);});}}exports[_0xfb9a('0x28')]=defaultLicense; \ No newline at end of file +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 diff --git a/server/config/license/util.js b/server/config/license/util.js index acbb30d..9a82a5e 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 _0xc281=['uuid','data1','isEmpty','data2','split','decryptString','%s:%s:%s','parse','machineUuid','gray','deadline','add','days','format','grayReason','changed','disabled','message','User','role','sequelize','COUNT','col','count','admin','user','users','telephones','pick','telephone','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','catch'];(function(_0x4bb2b9,_0x459c78){var _0x40e2a2=function(_0x19a26c){while(--_0x19a26c){_0x4bb2b9['push'](_0x4bb2b9['shift']());}};_0x40e2a2(++_0x459c78);}(_0xc281,0x110));var _0x1c28=function(_0x997ede,_0x5a0814){_0x997ede=_0x997ede-0x0;var _0x1f3288=_0xc281[_0x997ede];return _0x1f3288;};'use strict';var util=require(_0x1c28('0x0'));var _=require(_0x1c28('0x1'));var moment=require(_0x1c28('0x2'));var BPromise=require(_0x1c28('0x3'));var hardware=require(_0x1c28('0x4'));var encryptor=require(_0x1c28('0x5'));var db=require(_0x1c28('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1c28('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1c28('0x8'),'machineUuid':hardware[_0x1c28('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x1c28('0xa'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x216a65){return new BPromise(function(_0x505b74,_0x118bd4){return db[_0x1c28('0xb')][_0x1c28('0xc')](_[_0x1c28('0xd')](_0x216a65,{'raw':!![],'where':{'id':0x1}}))[_0x1c28('0xe')](function(_0x285e93){return checkLicense(_0x285e93,null);})[_0x1c28('0xe')](function(_0x84243b){_0x505b74(_0x84243b);return;})[_0x1c28('0xf')](function(_0x73a90a){_0x118bd4(_0x73a90a);});});}function checkLicense(_0x3ea8c3,_0x397aa8){if(!_0x3ea8c3){demoLicense[_0x1c28('0x10')]=_0x3ea8c3[_0x1c28('0x11')];return demoLicense;}try{var _0xf92254=_0x397aa8||_0x3ea8c3['license'];if(_[_0x1c28('0x12')](_0xf92254)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x1a2e67=_0x3ea8c3[_0x1c28('0x11')];var _0x39d702=_0x3ea8c3[_0x1c28('0x13')];var _0x488b28=_0x1a2e67[_0x1c28('0x14')]('-')[0x4];var _0x141800=_0x1a2e67[_0x1c28('0x14')]('-')[0x0];var _0x4de242=encryptor[_0x1c28('0x15')](_0xf92254,util['format'](_0x1c28('0x16'),_0x488b28,_0x1a2e67,_0x141800));var _0x48c58c=JSON[_0x1c28('0x17')](_0x4de242);_0x48c58c['demo']=![];_0x48c58c['uuid']=_0x1a2e67;_0x48c58c[_0x1c28('0x18')]=hardware[_0x1c28('0x9')]();if(_0x39d702){var _0x213118=encryptor['decryptString'](_0x39d702);_0x48c58c[_0x1c28('0x19')]=_0x213118;_0x48c58c[_0x1c28('0x1a')]=moment(_0x213118)[_0x1c28('0x1b')](0x7,_0x1c28('0x1c'))[_0x1c28('0x1d')]();_0x48c58c[_0x1c28('0x1e')]=_0x48c58c['uuid']!=_0x48c58c[_0x1c28('0x18')]?_0x1c28('0x1f'):_0x1c28('0x20');}return _0x48c58c;}catch(_0x3f9010){breakingLicense['uuid']=_0x3ea8c3[_0x1c28('0x11')];breakingLicense[_0x1c28('0x21')]=_0x3f9010[_0x1c28('0x21')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x596b6f,_0x528906){getLicense()[_0x1c28('0xe')](function(_0x25b7a9){return db[_0x1c28('0x22')]['findAll']({'attributes':[_0x1c28('0x23'),[db[_0x1c28('0x24')]['fn'](_0x1c28('0x25'),db[_0x1c28('0x24')][_0x1c28('0x26')](_0x1c28('0x23'))),_0x1c28('0x27')]],'group':_0x1c28('0x23'),'where':{'role':{'$or':[_0x1c28('0x28'),_0x1c28('0x29'),'telephone']}},'raw':!![]})[_0x1c28('0xe')](function(_0x502240){var _0x542629={'user':_0x25b7a9[_0x1c28('0x2a')]||0x0,'telephone':_0x25b7a9[_0x1c28('0x2b')]||0x0};_0x502240['forEach'](function(_0x856e1c){var _0x1e4fc9=_0x856e1c[_0x1c28('0x23')]===_0x1c28('0x28')?_0x1c28('0x29'):_0x856e1c[_0x1c28('0x23')];_0x542629[_0x1e4fc9]-=_0x856e1c[_0x1c28('0x27')];if(_0x542629[_0x1e4fc9]<0x0)_0x542629[_0x1e4fc9]=0x0;});_0x596b6f(_0x542629);return;});})[_0x1c28('0xf')](function(_0x1341ba){_0x528906(_0x1341ba);});});}function checkUserLimits(_0x274149){return new BPromise(function(_0x2b2b52,_0x474607){getLimits()[_0x1c28('0xe')](function(_0x3870f8){var _0x310545=_[_0x1c28('0x2c')](_['countBy'](_0x274149,_0x1c28('0x23')),[_0x1c28('0x28'),'user',_0x1c28('0x2d')]);var _0x1c17d4=(_0x310545['admin']||0x0)+(_0x310545['user']||0x0);var _0x33a9fd=_0x310545[_0x1c28('0x2d')]||0x0;if(_0x1c17d4>_0x3870f8[_0x1c28('0x29')])return _0x474607(_0x1c28('0x2e'));if(_0x33a9fd>_0x3870f8[_0x1c28('0x2d')])return _0x474607(_0x1c28('0x2f'));return _0x2b2b52();})[_0x1c28('0xf')](function(_0x427cee){_0x474607(_0x427cee);});});}module['exports']={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +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 diff --git a/server/config/local.env.js b/server/config/local.env.js index c725fd4..c09af6d 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 _0x430c=['exports','app-id','secret'];(function(_0x38c0b2,_0x4be4d0){var _0x299da6=function(_0x381b16){while(--_0x381b16){_0x38c0b2['push'](_0x38c0b2['shift']());}};_0x299da6(++_0x4be4d0);}(_0x430c,0x1a1));var _0xc430=function(_0x3ec333,_0x26bcbe){_0x3ec333=_0x3ec333-0x0;var _0x15ccb8=_0x430c[_0x3ec333];return _0x15ccb8;};'use strict';module[_0xc430('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0xc430('0x1'),'GOOGLE_SECRET':_0xc430('0x2'),'DEBUG':''}; \ No newline at end of file +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 diff --git a/server/config/logger.js b/server/config/logger.js index 42faa6e..9ac3518 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8f89=['toUpperCase','exports','transports','File','%s-%s','error','info','env','moment','winston','util','path','INFO','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level'];(function(_0x6aa2b5,_0x5ad58f){var _0x3958d9=function(_0x3ed4d7){while(--_0x3ed4d7){_0x6aa2b5['push'](_0x6aa2b5['shift']());}};_0x3958d9(++_0x5ad58f);}(_0x8f89,0x1eb));var _0x98f8=function(_0x3df856,_0x5a5667){_0x3df856=_0x3df856-0x0;var _0x47e03e=_0x8f89[_0x3df856];return _0x47e03e;};'use strict';var moment=require(_0x98f8('0x0'));var winston=require(_0x98f8('0x1'));var util=require(_0x98f8('0x2'));var path=require(_0x98f8('0x3'));var debugLevel=_0x98f8('0x4');function filename(_0x3db405,_0x43c163){return path['join']('/var','log','xcally',util[_0x98f8('0x5')](_0x98f8('0x6'),_0x3db405,_0x43c163));}function formatter(_0x2c26a2,_0x5e4da8){_0x5e4da8[_0x98f8('0x7')]=_0x5e4da8[_0x98f8('0x7')]['replace'](/@@{/g,'{{{')[_0x98f8('0x8')](/}@@/g,_0x98f8('0x9'))['replace'](/@{/g,'{{')['replace'](/}@/g,'}}');return util['format'](_0x98f8('0xa'),moment()[_0x98f8('0x5')](_0x98f8('0xb')),_0x5e4da8[_0x98f8('0xc')][_0x98f8('0xd')](),_0x2c26a2,_0x5e4da8[_0x98f8('0x7')]);}module[_0x98f8('0xe')]=function(_0x23d771){return new winston['Logger']({'transports':[new winston[(_0x98f8('0xf'))][(_0x98f8('0x10'))]({'name':util[_0x98f8('0x5')](_0x98f8('0x11'),_0x23d771,_0x98f8('0x12')),'filename':filename(_0x23d771,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x512372){return formatter(_0x23d771,_0x512372);}}),new winston[(_0x98f8('0xf'))]['File']({'name':util['format']('%s-%s',_0x23d771,_0x98f8('0x13')),'filename':filename(_0x23d771,_0x98f8('0x13')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42bf62){return formatter(_0x23d771,_0x42bf62);}}),new winston['transports']['Console']({'level':process[_0x98f8('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x4979aa){return formatter(_0x23d771,_0x4979aa);}})]});}; \ No newline at end of file +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 diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index ac118cb..9f1f03b 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 _0x41ec=['exports','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','join','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x46e8d7,_0x24cfac){var _0x55d7e2=function(_0x12472a){while(--_0x12472a){_0x46e8d7['push'](_0x46e8d7['shift']());}};_0x55d7e2(++_0x24cfac);}(_0x41ec,0x143));var _0xc41e=function(_0x584fef,_0x715b3c){_0x584fef=_0x584fef-0x0;var _0x287b04=_0x41ec[_0x584fef];return _0x287b04;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0xc41e('0x0'),'script':path['join'](__dirname,_0xc41e('0x1'))},{'name':_0xc41e('0x2'),'script':path['join'](__dirname,_0xc41e('0x3'))},{'name':_0xc41e('0x4'),'script':path[_0xc41e('0x5')](__dirname,_0xc41e('0x6'))},{'name':_0xc41e('0x7'),'script':path[_0xc41e('0x5')](__dirname,_0xc41e('0x8'))},{'name':_0xc41e('0x9'),'script':path[_0xc41e('0x5')](__dirname,_0xc41e('0xa'))},{'name':_0xc41e('0xb'),'script':path['join'](__dirname,_0xc41e('0xc'))}]};module[_0xc41e('0xd')]=config; \ No newline at end of file +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 diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 0ac0afd..6a78099 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 _0xc6a5=['stop','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connected','start','then'];(function(_0x2a83af,_0x4fa9ed){var _0x2e1648=function(_0x59c429){while(--_0x59c429){_0x2a83af['push'](_0x2a83af['shift']());}};_0x2e1648(++_0x4fa9ed);}(_0xc6a5,0x174));var _0x5c6a=function(_0x26822a,_0x4e595a){_0x26822a=_0x26822a-0x0;var _0x5d9155=_0xc6a5[_0x26822a];return _0x5d9155;};'use strict';var pm2=require('pm2');var BPromise=require(_0x5c6a('0x0'));var config=require(_0x5c6a('0x1'));function connect(){return new BPromise(function(_0x5a574e,_0x549539){return pm2['connect'](function(_0x584cfd){if(_0x584cfd){return _0x549539(_0x584cfd);}return _0x5a574e(_0x5c6a('0x2'));});});};exports[_0x5c6a('0x3')]=function(_0x568bd2){return connect()[_0x5c6a('0x4')](function(){return new BPromise(function(_0x27426b,_0xd0791c){return pm2[_0x5c6a('0x3')](_0x568bd2,function(_0x30f47e,_0xed68d5){if(_0x30f47e){return _0xd0791c(_0x30f47e);}pm2['disconnect']();return _0x27426b(_0xed68d5);});});});};exports[_0x5c6a('0x5')]=function(_0x18f048){return connect()['then'](function(){return new BPromise(function(_0xd4f5a5,_0x4bd9fd){return pm2[_0x5c6a('0x5')](_0x18f048,function(_0x6bf84c,_0x1e25a6){if(_0x6bf84c){return _0x4bd9fd(_0x6bf84c);}pm2[_0x5c6a('0x6')]();return _0xd4f5a5(_0x1e25a6);});});});};exports[_0x5c6a('0x7')]=function(_0x2f3d90){return connect()[_0x5c6a('0x4')](function(){return new BPromise(function(_0x5d1dd3,_0x3626ff){return pm2[_0x5c6a('0x7')](_0x2f3d90,function(_0x46f658,_0x184519){if(_0x46f658){return _0x3626ff(_0x46f658);}pm2['disconnect']();return _0x5d1dd3(_0x184519);});});});};exports[_0x5c6a('0x8')]=function(){return connect()[_0x5c6a('0x4')](function(){return new BPromise(function(_0x2e4591,_0x2f37ca){return pm2[_0x5c6a('0x8')](function(_0x5674a1,_0x3a0b24){if(_0x5674a1){return _0x2f37ca(_0x5674a1);}pm2[_0x5c6a('0x6')]();return _0x2e4591(_0x3a0b24);});});});};exports[_0x5c6a('0x9')]=function(_0x2503b3){return connect()[_0x5c6a('0x4')](function(){return new BPromise(function(_0x4481f3,_0xb7a1c){return pm2[_0x5c6a('0x9')](_0x2503b3,function(_0x930e52,_0x481381){if(_0x930e52){return _0xb7a1c(_0x930e52);}pm2[_0x5c6a('0x6')]();return _0x4481f3(_0x481381);});});});};exports['delete']=function(_0x1958cf){return connect()[_0x5c6a('0x4')](function(){return new BPromise(function(_0x373e69,_0x38e755){return pm2[_0x5c6a('0xa')](_0x1958cf,function(_0x37e2b1,_0x2b8150){if(_0x37e2b1){return _0x38e755(_0x37e2b1);}pm2[_0x5c6a('0x6')]();return _0x373e69(_0x2b8150);});});});};exports[_0x5c6a('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x18e023,_0x490e90){return pm2[_0x5c6a('0xb')](function(_0x56564c){if(_0x56564c){return _0x490e90(_0x56564c);}return _0x18e023(_0x5c6a('0xc'));});});});}; \ No newline at end of file +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 diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7d16c45..09d0e66 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 _0x4714=['../../config/environment','../logger','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','lastMsgAt','subtract','minutes','then','length','map','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','inspect','start','lodash','moment'];(function(_0x39d654,_0x275a7d){var _0x18efa1=function(_0x1d09f8){while(--_0x1d09f8){_0x39d654['push'](_0x39d654['shift']());}};_0x18efa1(++_0x275a7d);}(_0x4714,0x153));var _0x4471=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4714[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x4471('0x0'));var moment=require(_0x4471('0x1'));var Redis=require('ioredis');var util=require('util');var config=require(_0x4471('0x2'));var db=require('../../mysqldb')['db'];var logger=require(_0x4471('0x3'))('schedule');config[_0x4471('0x4')]=_[_0x4471('0x5')](config[_0x4471('0x4')],{'host':_0x4471('0x6'),'port':0x18eb});var io=require(_0x4471('0x7'))(new Redis(config[_0x4471('0x4')]));function closeInteractions(){var _0x4dddbb=0x0;var _0x171c85=[];return db['Setting'][_0x4471('0x8')]({'raw':!![],'attributes':['id',_0x4471('0x9')],'where':{'id':0x1}})['then'](function(_0x277e2d){_0x4dddbb=_0x277e2d[_0x4471('0x9')];if(_0x4dddbb){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x4471('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4471('0xb')](_0x277e2d[_0x4471('0x9')],_0x4471('0xc'))}}});}else{return[];}})[_0x4471('0xd')](function(_0x2ccd1c){if(_0x2ccd1c&&_0x2ccd1c[_0x4471('0xe')]){_0x171c85=_[_0x4471('0xf')](_0x2ccd1c||[],'id');logger['info'](_0x4471('0x10'),_0x171c85[_0x4471('0x11')]());return db[_0x4471('0x12')][_0x4471('0x13')]({'closeReason':_0x4471('0x14'),'disposition':_0x4471('0x15'),'closed':!![],'closedAt':moment()[_0x4471('0x16')](_0x4471('0x17'))},{'where':{'id':_0x171c85}});}})[_0x4471('0xd')](function(){if(_0x171c85&&_0x171c85['length']){logger[_0x4471('0x18')](_0x4471('0x19'),_0x171c85[_0x4471('0x11')]());for(var _0x213e8f=0x0;_0x213e8f<_0x171c85[_0x4471('0xe')];_0x213e8f++){io[_0x4471('0x1a')]('chatInteraction:update',{'id':_0x171c85[_0x213e8f],'closed':!![]});}}})[_0x4471('0x1b')](function(_0x49b19e){logger[_0x4471('0x1c')]('[CHAT]\x20Error\x20closing\x20interactions',_0x49b19e?util[_0x4471('0x1d')](_0x49b19e,{'showHidden':![],'depth':null}):'');});}exports[_0x4471('0x1e')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +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 diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index eb7ee91..21dee98 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 _0x75c0=['pass','name','email','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','savename','format','%s.%s','basename','extname','zip','existsSync','status','Sent','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','message','attachments','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','exec\x20custom\x20report\x20id:%s','runReport','CustomReportId','Schedule','findAll','MailServerOut','keys','jobs','map','toString','intersection','difference','length','exists','stop','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','start','deleteJob','active','update','update\x20cron','util','path','lodash','moment','jayson/promise','../logger','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','MailAccount','Smtp','service','host','port','secure','user'];(function(_0x268152,_0x363750){var _0xfb477=function(_0x34d987){while(--_0x34d987){_0x268152['push'](_0x268152['shift']());}};_0xfb477(++_0x363750);}(_0x75c0,0x151));var _0x075c=function(_0x2f938f,_0x923379){_0x2f938f=_0x2f938f-0x0;var _0x360c98=_0x75c0[_0x2f938f];return _0x360c98;};'use strict';var fs=require('fs');var util=require(_0x075c('0x0'));var path=require(_0x075c('0x1'));var _=require(_0x075c('0x2'));var moment=require(_0x075c('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x075c('0x4'));var BPromise=require('bluebird');var logger=require(_0x075c('0x5'))('schedule');var db=require(_0x075c('0x6'))['db'];var analyticCustomReportController=require(_0x075c('0x7'));var analyticDefaultReportController=require(_0x075c('0x8'));var client=jayson[_0x075c('0x9')][_0x075c('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x30eec0,_0x2c8dcc){return function(){logger[_0x075c('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x30eec0['email']);var _0x6bd71f=!![];var _0x3816ef={'tls':{'rejectUnauthorized':![]}};if(_0x30eec0[_0x075c('0xc')][_0x075c('0xd')][_0x075c('0xe')]){_0x3816ef[_0x075c('0xe')]=_0x30eec0[_0x075c('0xc')]['Smtp'][_0x075c('0xe')];}else{_0x3816ef[_0x075c('0xf')]=_0x30eec0[_0x075c('0xc')][_0x075c('0xd')][_0x075c('0xf')];_0x3816ef[_0x075c('0x10')]=_0x30eec0[_0x075c('0xc')][_0x075c('0xd')]['port'];_0x3816ef[_0x075c('0x11')]=_0x30eec0[_0x075c('0xc')][_0x075c('0xd')][_0x075c('0x11')];}if(_0x30eec0[_0x075c('0xc')]['Smtp']['authentication']){_0x3816ef['auth']={'user':_0x30eec0['MailAccount'][_0x075c('0xd')][_0x075c('0x12')],'pass':_0x30eec0[_0x075c('0xc')]['Smtp'][_0x075c('0x13')]};}var _0x58f243={'account':_0x3816ef,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x30eec0[_0x075c('0xc')][_0x075c('0x14')],_0x30eec0['MailAccount']['email']||_0x30eec0[_0x075c('0xc')][_0x075c('0xd')][_0x075c('0x12')]),'to':_0x30eec0[_0x075c('0x15')],'cc':_0x30eec0['cc'],'bcc':_0x30eec0['bcc'],'subject':util['format'](_0x075c('0x16'),_0x2c8dcc[_0x075c('0x14')],_0x30eec0[_0x075c('0x17')],_0x30eec0[_0x075c('0x18')])}};var _0x352445=path[_0x075c('0x19')](__dirname,_0x075c('0x1a'));var _0x513609=_0x2c8dcc[_0x075c('0x1b')];var _0x39a7f2=util[_0x075c('0x1c')](_0x075c('0x1d'),path[_0x075c('0x1e')](_0x2c8dcc[_0x075c('0x1b')],path[_0x075c('0x1f')](_0x2c8dcc[_0x075c('0x1b')])),_0x075c('0x20'));var _0x1a4e76=path[_0x075c('0x19')](_0x352445,_0x513609);var _0x41b8a7=path[_0x075c('0x19')](_0x352445,_0x39a7f2);if(fs[_0x075c('0x21')](_0x1a4e76)){_0x2c8dcc[_0x075c('0x22')]=_0x075c('0x23');_0x58f243['message']['attachments']=[{'filename':_0x513609,'path':_0x1a4e76}];_0x58f243['message'][_0x075c('0x24')]=util[_0x075c('0x1c')](_0x075c('0x25'),JSON['stringify'](_0x2c8dcc,null,0x2));}else if(fs[_0x075c('0x21')](_0x41b8a7)){_0x2c8dcc[_0x075c('0x22')]=_0x075c('0x23');_0x58f243[_0x075c('0x26')][_0x075c('0x27')]=[{'filename':_0x39a7f2,'path':_0x41b8a7}];}else{_0x58f243['message'][_0x075c('0x24')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x30eec0[_0x075c('0x28')]){_0x6bd71f=![];logger[_0x075c('0xb')](_0x075c('0x29'));}}if(_0x6bd71f){return client[_0x075c('0x2a')](_0x075c('0x2b'),_0x58f243)[_0x075c('0x2c')](function(_0x188861){if(_0x188861[_0x075c('0x2d')]){return logger[_0x075c('0x2d')](_0x075c('0x2e'),JSON[_0x075c('0x2f')](_0x188861));}return logger[_0x075c('0xb')]('email\x20sent');})[_0x075c('0x30')](function(_0x5593de){return logger[_0x075c('0x2d')]('error\x20mail',JSON[_0x075c('0x2f')](_0x5593de));});}};}function handleError(){return function(_0x1ee860){return logger[_0x075c('0x2d')](JSON[_0x075c('0x2f')](_0x1ee860));};}function handleResult(_0x5a211a){return function(_0x265be2){logger[_0x075c('0xb')](_0x075c('0x31'),JSON['stringify'](_0x265be2));if(_0x5a211a[_0x075c('0xc')]&&_0x5a211a[_0x075c('0xc')]['Smtp']&&!_[_0x075c('0x32')](_0x5a211a[_0x075c('0x15')])){setTimeout(handleSendEmail(_0x5a211a,_0x265be2),0x3c*0x3e8);}};}function handleJob(_0x36dc85){return function(){try{if(_[_0x075c('0x32')](_0x36dc85[_0x075c('0x17')])){return logger['info'](_0x075c('0x33'));}if(_[_0x075c('0x32')](_0x36dc85[_0x075c('0x18')])){return logger[_0x075c('0xb')](_0x075c('0x34'));}var _0x858666={'startDate':moment()[_0x075c('0x35')](_0x36dc85['subtractNumber'],_0x36dc85[_0x075c('0x18')])[_0x075c('0x1c')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x075c('0x1c')](_0x075c('0x36')),'type':_0x075c('0x37'),'output':_0x36dc85[_0x075c('0x38')],'name':_0x36dc85['name']};if(!_[_0x075c('0x32')](_0x36dc85['DefaultReportId'])){logger['info'](_0x075c('0x39'),_0x36dc85[_0x075c('0x3a')]);return analyticDefaultReportController['runReport']({'id':_0x36dc85[_0x075c('0x3a')]},_0x858666)[_0x075c('0x2c')](handleResult(_0x36dc85))[_0x075c('0x30')](handleError());}if(!_['isNil'](_0x36dc85['CustomReportId'])){logger['info'](_0x075c('0x3b'),_0x36dc85['CustomReportId']);return analyticCustomReportController[_0x075c('0x3c')]({'id':_0x36dc85[_0x075c('0x3d')]},_0x858666)[_0x075c('0x2c')](handleResult(_0x36dc85))[_0x075c('0x30')](handleError());}}catch(_0x521c6b){logger[_0x075c('0x2d')](JSON['stringify'](_0x521c6b));}return logger[_0x075c('0xb')]('no\x20report\x20id');};}function getJobs(_0x13810e){var _0x57c098={};if(_0x13810e){_0x57c098['id']=_0x13810e;}return db[_0x075c('0x3e')][_0x075c('0x3f')]({'where':_0x57c098,'include':[{'model':db[_0x075c('0xc')],'attributes':['id','name',_0x075c('0x15')],'include':[{'model':db[_0x075c('0x40')],'as':_0x075c('0xd')}]}]})[_0x075c('0x2c')](function(_0x1641d9){var _0x4ef325=_[_0x075c('0x41')](manager[_0x075c('0x42')]);var _0x1e9c18=_[_0x075c('0x43')](_0x1641d9,function(_0x318db5){return _0x318db5['id'][_0x075c('0x44')]();});var _0x4c84aa=_['keyBy'](_0x1641d9,function(_0x3c7b3d){return _0x3c7b3d['id'][_0x075c('0x44')]();});var _0x4f2cb3=_0x13810e?_0x1e9c18:_['difference'](_0x1e9c18,_0x4ef325);var _0xbfc922=_[_0x075c('0x45')](_0x1e9c18,_0x4ef325);var _0x421648=_[_0x075c('0x46')](_0x4ef325,_0x1e9c18);var _0x3682a5;var _0x829690;for(_0x3682a5=0x0;_0x3682a5<_0x421648[_0x075c('0x47')]&&!_0x13810e;_0x3682a5+=0x1){_0x829690=_0x421648[_0x3682a5][_0x075c('0x44')]();if(manager[_0x075c('0x48')](_0x829690)){manager[_0x075c('0x49')](_0x829690);manager['deleteJob'](_0x829690);logger[_0x075c('0xb')](_0x075c('0x4a'),_0x829690);}}logger[_0x075c('0xb')]('toRun',JSON[_0x075c('0x2f')](_0x4f2cb3));for(_0x3682a5=0x0;_0x3682a5<_0x4f2cb3[_0x075c('0x47')];_0x3682a5+=0x1){_0x829690=_0x4f2cb3[_0x3682a5]['toString']();logger['info'](_0x075c('0x4b'),_0x829690);if(_0x13810e){logger['info'](_0x075c('0x4c'),_0x13810e);logger[_0x075c('0xb')](JSON[_0x075c('0x2f')](_0x4c84aa[_0x829690]));BPromise[_0x075c('0x4d')]()['then'](handleJob(_0x4c84aa[_0x829690]));logger[_0x075c('0xb')](_0x075c('0x4e'),_0x4c84aa[_0x829690][_0x075c('0x14')],_0x4c84aa[_0x829690][_0x075c('0x4f')]);}else if(_0x4c84aa[_0x829690]['cron']&&_0x4c84aa[_0x829690]['active']&&moment()[_0x075c('0x50')](_0x4c84aa[_0x829690][_0x075c('0x51')],_0x4c84aa[_0x829690][_0x075c('0x52')])){manager[_0x075c('0x53')](_0x829690,_0x4c84aa[_0x829690]['cron'],handleJob(_0x4c84aa[_0x829690]));manager[_0x075c('0x54')](_0x829690);logger[_0x075c('0xb')]('add\x20cron',_0x4c84aa[_0x829690][_0x075c('0x14')],_0x4c84aa[_0x829690][_0x075c('0x4f')]);}else if(manager[_0x075c('0x48')](_0x829690)){manager[_0x075c('0x49')](_0x829690);manager[_0x075c('0x55')](_0x829690);logger[_0x075c('0xb')]('stop\x20cron',_0x4c84aa[_0x829690][_0x075c('0x14')],_0x4c84aa[_0x829690][_0x075c('0x4f')]);}}for(_0x3682a5=0x0,_0x829690;_0x3682a5<_0xbfc922[_0x075c('0x47')]&&!_0x13810e;_0x3682a5+=0x1){_0x829690=_0xbfc922[_0x3682a5][_0x075c('0x44')]();if(manager[_0x075c('0x48')](_0x829690)){if(_0x4c84aa[_0x829690]['cron']&&_0x4c84aa[_0x829690][_0x075c('0x56')]&&moment()[_0x075c('0x50')](_0x4c84aa[_0x829690][_0x075c('0x51')],_0x4c84aa[_0x829690]['endAt'])){manager[_0x075c('0x57')](_0x829690,_0x4c84aa[_0x829690][_0x075c('0x4f')],handleJob(_0x4c84aa[_0x829690]));logger[_0x075c('0xb')](_0x075c('0x58'),_0x4c84aa[_0x829690][_0x075c('0x14')],_0x4c84aa[_0x829690][_0x075c('0x4f')]);}else{manager[_0x075c('0x49')](_0x829690);manager[_0x075c('0x55')](_0x829690);logger[_0x075c('0xb')]('stop\x20cron',_0x4c84aa[_0x829690]['name'],_0x4c84aa[_0x829690][_0x075c('0x4f')]);}}}})[_0x075c('0x30')](function(_0x323b84){logger[_0x075c('0x2d')](JSON[_0x075c('0x2f')](_0x323b84));});}exports['run']=function(_0xfbd4a5){return getJobs(_0xfbd4a5);};exports[_0x075c('0x54')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +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 diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 88493aa..7096e9c 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 _0x1f75=['[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','update','Sentiment','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Transcript\x20not\x20available','Cloud\x20Provider\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Positive','catch','name','SequelizeValidationError','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeRegion','transcribeAccountId','all','aws-sdk','request-promise','util','bluebird','../../mysqldb','transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','COMPLETED','TranscriptionJob','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','results','transcripts','length','transcript'];(function(_0x2d2c6c,_0x1ba3f7){var _0xbf36f8=function(_0x5dfc57){while(--_0x5dfc57){_0x2d2c6c['push'](_0x2d2c6c['shift']());}};_0xbf36f8(++_0x1ba3f7);}(_0x1f75,0x13c));var _0x51f7=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x1f75[_0x334841];return _0x5beb4b;};var _=require('lodash');var AWS=require(_0x51f7('0x0'));var rp=require(_0x51f7('0x1'));var util=require(_0x51f7('0x2'));var BPromise=require(_0x51f7('0x3'));var db=require(_0x51f7('0x4'))['db'];var logger=require('../../config/logger')(_0x51f7('0x5'));function getTranscriptionJob(_0x4273aa,_0xb25a20,_0x331fd3,_0x23eea5){return new Promise(function(_0x1fe16a,_0x244646){var _0xb4e621=new AWS[(_0x51f7('0x6'))]({'accessKeyId':_0xb25a20,'secretAccessKey':_0x4273aa,'region':_0x331fd3});_0xb4e621[_0x51f7('0x7')]({'TranscriptionJobName':_0x23eea5},function(_0x20d374,_0x4158a6){if(_0x20d374){return _0x244646(_0x20d374);}else{return _0x1fe16a(_0x4158a6);}});});}function sentiment(_0x4ee384,_0x2fb7ee,_0x450767,_0x4d7014,_0x11e24c){return new Promise(function(_0x3ad08e,_0x4c5629){var _0x4ddeb4=new AWS[(_0x51f7('0x8'))]({'accessKeyId':_0x2fb7ee,'secretAccessKey':_0x4ee384,'region':_0x450767});_0x4ddeb4[_0x51f7('0x9')]({'Text':_0x4d7014,'LanguageCode':_0x11e24c['substring'](0x0,0x2)},function(_0x457791,_0x30190a){if(_0x457791){return _0x4c5629(_0x457791);}else{return _0x3ad08e(_0x30190a);}});});}function checkTranscribeJob(_0x49c0dd,_0x452c6b,_0x180e9d){var _0x11cc37;return new BPromise(function(_0x58919c,_0x546f55){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0xc'),_0x49c0dd['id'],_0x49c0dd[_0x51f7('0xd')]));return getTranscriptionJob(_0x180e9d[_0x51f7('0xe')],_0x180e9d[_0x51f7('0xf')],_0x452c6b['transcribeRegion'],_0x49c0dd[_0x51f7('0xd')])[_0x51f7('0x10')](function(_0x12e09d){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x11'),_0x49c0dd['id'],_0x49c0dd[_0x51f7('0xd')],_0x12e09d['TranscriptionJob'][_0x51f7('0x12')]));if(!_0x49c0dd[_0x51f7('0x13')]){switch(_0x12e09d['TranscriptionJob'][_0x51f7('0x12')]){case _0x51f7('0x14'):var _0x4dfdef={'transcribeStatus':_0x12e09d['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x12e09d[_0x51f7('0x15')]['Transcript']['TranscriptFileUri']};logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x16'),_0x49c0dd['id']));return rp({'uri':_0x12e09d[_0x51f7('0x15')][_0x51f7('0x17')][_0x51f7('0x18')],'json':!![]})[_0x51f7('0x10')](function(_0x22f585){logger['info'](util[_0x51f7('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x49c0dd['id']));if(_0x22f585&&_0x22f585[_0x51f7('0x19')]&&_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')]&&_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')][_0x51f7('0x1b')]){_0x4dfdef[_0x51f7('0x13')]='';for(var _0x1b7282=0x0;_0x1b7282<_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')][_0x51f7('0x1b')];_0x1b7282++){_0x4dfdef['fileText']+=_0x22f585[_0x51f7('0x19')][_0x51f7('0x1a')][_0x1b7282][_0x51f7('0x1c')]+'';}}return _0x49c0dd['update'](_0x4dfdef);})[_0x51f7('0x10')](function(){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x1d'),_0x49c0dd['id']));if(!_0x49c0dd['tempSentiment']){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x20'));}if(!_0x452c6b[_0x51f7('0x21')]||!_0x452c6b[_0x51f7('0x22')]||!_0x452c6b['sentimentRegion']||!_0x452c6b[_0x51f7('0x23')]||!_0x452c6b[_0x51f7('0x24')]){throw new db[(_0x51f7('0x1e'))]['ValidationError'](_0x51f7('0x25'));}if(!_0x4dfdef['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x452c6b[_0x51f7('0x22')]===_0x180e9d['id']){return _0x180e9d;}else{return db[_0x51f7('0x26')][_0x51f7('0x27')]({'where':{'id':_settings[_0x51f7('0x22')]}});}})[_0x51f7('0x10')](function(_0x44bca8){if(!_0x44bca8){throw new db[(_0x51f7('0x1e'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x44bca8[_0x51f7('0xe')]||!_0x44bca8[_0x51f7('0xf')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x28'));}_0x11cc37=_0x44bca8;logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x29'),_0x49c0dd['id']));return sentiment(_0x11cc37[_0x51f7('0xe')],_0x11cc37['data2'],_0x452c6b[_0x51f7('0x2a')],_0x4dfdef['fileText'],_0x452c6b[_0x51f7('0x23')]);})['then'](function(_0x3c1c80){logger['info'](util[_0x51f7('0xb')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x49c0dd['id']));return _0x49c0dd[_0x51f7('0x2b')]({'sentiment':_0x3c1c80[_0x51f7('0x2c')],'sPositive':_0x3c1c80[_0x51f7('0x2d')]['Positive'],'sNegative':_0x3c1c80[_0x51f7('0x2d')][_0x51f7('0x2e')],'sMixed':_0x3c1c80['SentimentScore']['Mixed'],'sNeutral':_0x3c1c80['SentimentScore'][_0x51f7('0x2f')]});})[_0x51f7('0x10')](function(){logger[_0x51f7('0xa')](util['format'](_0x51f7('0x1d'),_0x49c0dd['id']));_0x58919c();});case _0x51f7('0x30'):return _0x49c0dd[_0x51f7('0x2b')]({'transcribeStatus':'FAILED','failureReason':_0x12e09d[_0x51f7('0x15')][_0x51f7('0x31')]})[_0x51f7('0x10')](function(){logger['info'](util[_0x51f7('0xb')](_0x51f7('0x1d'),_0x49c0dd['id']));_0x58919c();});default:logger[_0x51f7('0xa')](util['format'](_0x51f7('0x32'),_0x49c0dd['id']));break;}}else{return BPromise[_0x51f7('0x33')]()[_0x51f7('0x10')](function(){if(!_0x49c0dd[_0x51f7('0x34')]){throw new db[(_0x51f7('0x1e'))]['ValidationError'](_0x51f7('0x20'));}if(!_0x452c6b[_0x51f7('0x21')]||!_0x452c6b[_0x51f7('0x22')]||!_0x452c6b[_0x51f7('0x2a')]||!_0x452c6b['language']||!_0x452c6b[_0x51f7('0x24')]){throw new db['Sequelize'][(_0x51f7('0x1f'))](_0x51f7('0x25'));}if(!_0x49c0dd[_0x51f7('0x13')]){throw new Error(_0x51f7('0x35'));}if(_0x452c6b[_0x51f7('0x22')]===_0x180e9d['id']){return _0x180e9d;}else{return db[_0x51f7('0x26')][_0x51f7('0x27')]({'where':{'id':_settings[_0x51f7('0x22')]}});}})[_0x51f7('0x10')](function(_0x3b4139){if(!_0x3b4139){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x36'));}if(!_0x3b4139['data1']||!_0x3b4139['data2']){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x11cc37=_0x3b4139;logger['info'](util[_0x51f7('0xb')](_0x51f7('0x29'),_0x49c0dd['id']));return sentiment(_0x11cc37[_0x51f7('0xe')],_0x11cc37['data2'],_0x452c6b[_0x51f7('0x2a')],_0x49c0dd[_0x51f7('0x13')],_0x452c6b[_0x51f7('0x23')]);})[_0x51f7('0x10')](function(_0x4c2817){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x37'),_0x49c0dd['id']));return _0x49c0dd[_0x51f7('0x2b')]({'sentiment':_0x4c2817[_0x51f7('0x2c')],'sPositive':_0x4c2817[_0x51f7('0x2d')][_0x51f7('0x38')],'sNegative':_0x4c2817[_0x51f7('0x2d')]['Negative'],'sMixed':_0x4c2817[_0x51f7('0x2d')]['Mixed'],'sNeutral':_0x4c2817[_0x51f7('0x2d')][_0x51f7('0x2f')],'transcribeStatus':_0x51f7('0x14')});})[_0x51f7('0x10')](function(){logger[_0x51f7('0xa')](util[_0x51f7('0xb')](_0x51f7('0x1d'),_0x49c0dd['id']));_0x58919c();});}})[_0x51f7('0x39')](function(_0x59d062){if(_0x59d062){if(!_0x59d062[_0x51f7('0x3a')]||_0x59d062['name']!==_0x51f7('0x3b')){logger['error'](util[_0x51f7('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x49c0dd['id']),util[_0x51f7('0x3c')](_0x59d062,{'showHidden':![],'depth':null}));}}_0x58919c();});});}function checkTranscribe(){var _0x97e23b;var _0xed6254;var _0x501cb8;return db['VoiceRecording'][_0x51f7('0x3d')]({'where':{'transcribeStatus':_0x51f7('0x3e')}})[_0x51f7('0x10')](function(_0xb39a71){if(!_0xb39a71||!_0xb39a71[_0x51f7('0x1b')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x3f'));}_0x97e23b=_0xb39a71;return db[_0x51f7('0x40')][_0x51f7('0x27')]({'where':{'id':0x1}});})[_0x51f7('0x10')](function(_0x2ea89d){if(!_0x2ea89d){throw new db['Sequelize'][(_0x51f7('0x1f'))](_0x51f7('0x41'));}_0xed6254=_0x2ea89d;if(!_0xed6254['transcribe']||!_0xed6254['transcribeAccountId']||!_0xed6254[_0x51f7('0x42')]||!_0xed6254['language']||!_0xed6254[_0x51f7('0x24')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))]('Transcribe\x20not\x20configured');}return db[_0x51f7('0x26')]['findOne']({'where':{'id':_0xed6254[_0x51f7('0x43')]}});})[_0x51f7('0x10')](function(_0x1eadbc){if(!_0x1eadbc){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x1eadbc[_0x51f7('0xe')]||!_0x1eadbc[_0x51f7('0xf')]){throw new db[(_0x51f7('0x1e'))][(_0x51f7('0x1f'))](_0x51f7('0x28'));}_0x501cb8=_0x1eadbc;var _0x1310c2=[];_0x97e23b['forEach'](function(_0x27a1c5){_0x1310c2['push'](checkTranscribeJob(_0x27a1c5,_0xed6254,_0x501cb8));});return BPromise[_0x51f7('0x44')](_0x1310c2);})[_0x51f7('0x39')](function(_0x5a6b0b){if(_0x5a6b0b){if(!_0x5a6b0b[_0x51f7('0x3a')]||_0x5a6b0b[_0x51f7('0x3a')]!==_0x51f7('0x3b')){logger['error'](util[_0x51f7('0x3c')](_0x5a6b0b,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +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 diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 3db9102..9767902 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 _0x643a=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','join','WhatsappInteraction','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xcdac34,_0x43f665){var _0x269d23=function(_0x3f2d6f){while(--_0x3f2d6f){_0xcdac34['push'](_0xcdac34['shift']());}};_0x269d23(++_0x43f665);}(_0x643a,0x18d));var _0xa643=function(_0x323bf6,_0x19aed6){_0x323bf6=_0x323bf6-0x0;var _0x18da88=_0x643a[_0x323bf6];return _0x18da88;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require('ioredis');var util=require(_0xa643('0x0'));var config=require(_0xa643('0x1'));var db=require(_0xa643('0x2'))['db'];var logger=require(_0xa643('0x3'))(_0xa643('0x4'));config[_0xa643('0x5')]=_[_0xa643('0x6')](config[_0xa643('0x5')],{'host':_0xa643('0x7'),'port':0x18eb});var io=require(_0xa643('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0xc0e53f=[];return db['WhatsappInteraction'][_0xa643('0x9')]({'raw':!![],'attributes':['id',_0xa643('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xa643('0xb')](0x18,_0xa643('0xc'))}}})[_0xa643('0xd')](function(_0x4866e7){if(_0x4866e7&&_0x4866e7[_0xa643('0xe')]){_0xc0e53f=_[_0xa643('0xf')](_0x4866e7||[],'id');logger[_0xa643('0x10')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0xc0e53f[_0xa643('0x11')]());return db[_0xa643('0x12')]['update']({'closeReason':_0xa643('0x13'),'disposition':_0xa643('0x14'),'closed':!![],'closedAt':moment()[_0xa643('0x15')](_0xa643('0x16'))},{'where':{'id':_0xc0e53f}});}})[_0xa643('0xd')](function(){if(_0xc0e53f&&_0xc0e53f['length']){logger[_0xa643('0x10')](_0xa643('0x17'),_0xc0e53f[_0xa643('0x11')]());for(var _0x175fd3=0x0;_0x175fd3<_0xc0e53f['length'];_0x175fd3++){io[_0xa643('0x18')]('whatsappInteraction:update',{'id':_0xc0e53f[_0x175fd3],'closed':!![]});}}})['catch'](function(_0xa9ddaa){logger['error'](_0xa643('0x19'),_0xa9ddaa?util[_0xa643('0x1a')](_0xa9ddaa,{'showHidden':![],'depth':null}):'');});}exports[_0xa643('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +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 diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 211b1ff..554e768 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xffd3=['CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','hopper2','catch','util','../mysqldb','Innocenzo','innocenzo.biondo','now','push','Biondo','@xcally.com'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xffd3,0xc9));var _0x3ffd=function(_0x5af4e4,_0x453696){_0x5af4e4=_0x5af4e4-0x0;var _0x2828b0=_0xffd3[_0x5af4e4];return _0x2828b0;};'use strict';var util=require(_0x3ffd('0x0'));var db=require(_0x3ffd('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x3ffd('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x3ffd('0x3')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x3ffd('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3ffd('0x4')](),'updatedAt':Date[_0x3ffd('0x4')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x3ffd('0x5')]({'id':i,'firstName':_0x3ffd('0x2')+i,'lastName':_0x3ffd('0x6')+i,'phone':0xf879fb460+i,'email':_0x3ffd('0x3')+i+_0x3ffd('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x3ffd('0x4')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3ffd('0x4')](),'updatedAt':Date['now']()});}db[_0x3ffd('0x8')][_0x3ffd('0x9')]({'where':{}})['then'](function(){return db[_0x3ffd('0x8')][_0x3ffd('0xa')](contacts);})[_0x3ffd('0xb')](function(){console[_0x3ffd('0xc')](_0x3ffd('0xd'),_0x3ffd('0xe'));return db[_0x3ffd('0xf')][_0x3ffd('0x9')]({'where':{}});})[_0x3ffd('0xb')](function(){return db['CmHopper'][_0x3ffd('0xa')](hopper);})[_0x3ffd('0xb')](function(){console[_0x3ffd('0xc')]('finished\x20populating',_0x3ffd('0x10'));return db[_0x3ffd('0x8')][_0x3ffd('0xa')](contacts2);})[_0x3ffd('0xb')](function(){console[_0x3ffd('0xc')](_0x3ffd('0xd'),'contacts2');return db[_0x3ffd('0xf')]['bulkCreate'](hopper2);})[_0x3ffd('0xb')](function(){console[_0x3ffd('0xc')](_0x3ffd('0xd'),_0x3ffd('0x11'));})[_0x3ffd('0x12')](function(_0x302c75){console[_0x3ffd('0xc')](_0x302c75);}); \ No newline at end of file +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 diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 9d71cd8..1c58bdd 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0464=['password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com'];(function(_0x4e9946,_0x4bdc35){var _0x53f122=function(_0xc87210){while(--_0xc87210){_0x4e9946['push'](_0x4e9946['shift']());}};_0x53f122(++_0x4bdc35);}(_0x0464,0xc8));var _0x4046=function(_0x50b27c,_0x4ca83f){_0x50b27c=_0x50b27c-0x0;var _0x4a303f=_0x0464[_0x50b27c];return _0x4a303f;};'use strict';var util=require(_0x4046('0x0'));var db=require(_0x4046('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4046('0x2')]({'name':util[_0x4046('0x3')](_0x4046('0x4'),_0x4046('0x5'),i),'fullname':util['format'](_0x4046('0x4'),_0x4046('0x5'),i),'email':util[_0x4046('0x3')](_0x4046('0x6'),_0x4046('0x5'),i),'role':_0x4046('0x5'),'password':_0x4046('0x7'),'internal':0xfa0+i,'type':_0x4046('0x8'),'transport':[_0x4046('0x9'),'ws',_0x4046('0xa')],'disallow':[_0x4046('0xb')],'allow':[_0x4046('0xc')],'defaultuser':util[_0x4046('0x3')]('%s%s',_0x4046('0x5'),i),'encryption':_0x4046('0xd'),'avpf':_0x4046('0xd'),'force_avp':_0x4046('0xd'),'icesupport':'yes','dtlsenable':_0x4046('0xd'),'dtlsverify':'no','dtlscertfile':_0x4046('0xe'),'dtlsprivatekey':_0x4046('0xf'),'dtlssetup':_0x4046('0x10'),'callerid':util['format'](_0x4046('0x11'),util['format'](_0x4046('0x4'),_0x4046('0x5'),i),0xfa0+i)});}db[_0x4046('0x12')][_0x4046('0x13')](users)[_0x4046('0x14')](function(){console['log'](_0x4046('0x15'));})[_0x4046('0x16')](function(_0x4dcdd1){console['log'](_0x4dcdd1);}); \ No newline at end of file +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 diff --git a/server/config/socketio.js b/server/config/socketio.js index f4c4543..eeaa384 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbe2c=['util','../mysqldb','name','Agents','User','role','telephone','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','resourceId','where','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','Campaign','user','FaxQueue','WhatsappQueues','WhatsappQueue','getVoiceQueues','getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','default','request','remotePort','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED','lodash'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x1d95e2,_0x4304a3){_0x1d95e2=_0x1d95e2-0x0;var _0x574de0=_0xbe2c[_0x1d95e2];return _0x574de0;};'use strict';var _=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var BPromise=require('bluebird');var db=require(_0xcbe2('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0xcbe2('0x3')],'include':[{'as':_0xcbe2('0x4'),'model':db[_0xcbe2('0x5')],'attributes':['id',_0xcbe2('0x3'),_0xcbe2('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xcbe2('0x3')],'where':{'role':_0xcbe2('0x7')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0xcbe2('0x3')],'where':{'role':_0xcbe2('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xcbe2('0x3'),_0xcbe2('0x9')],'where':{'type':_0xcbe2('0xa')}};function getAssociatedResources(_0x4f9a8d,_0x538ca6,_0xb7fe3c){return db[_0xcbe2('0xb')][_0xcbe2('0xc')]({'where':{'name':_0x4f9a8d,'userProfileId':_0x538ca6},'raw':!![]})[_0xcbe2('0xd')](function(_0x4af901){if(_0x4af901){if(_0x4af901['autoAssociation']){switch(_0x4f9a8d){case _0xcbe2('0xe'):case _0xcbe2('0xf'):case _0xcbe2('0x10'):case _0xcbe2('0x11'):case _0xcbe2('0x12'):case _0xcbe2('0x13'):case'WhatsappQueues':return db[_0xb7fe3c][_0xcbe2('0x14')](queryQueues);case _0xcbe2('0x15'):return db[_0xb7fe3c]['findAll'](queryTelephones);case _0xcbe2('0x16'):return db[_0xb7fe3c]['findAll'](queryTrunks);case _0xcbe2('0x17'):return db[_0xb7fe3c]['findAll'](queryCampaigns);}}else{return db[_0xcbe2('0x18')]['findAll']({'attributes':['resourceId'],'where':{'sectionId':_0x4af901['id']},'raw':!![]})[_0xcbe2('0xd')](function(_0x4ec284){if(_0x4ec284){var _0xb2995b={'where':{'id':_[_0xcbe2('0x19')](_0x4ec284,_0xcbe2('0x1a'))},'raw':!![]};switch(_0xb7fe3c){case _0xcbe2('0x5'):_0xb2995b[_0xcbe2('0x1b')][_0xcbe2('0x6')]=_0xcbe2('0x7');break;case'Campaign':_0xb2995b[_0xcbe2('0x1b')]['type']=_0xcbe2('0xa');break;}return db[_0xb7fe3c][_0xcbe2('0x14')](_0xb2995b);}else{return[];}});}}else{return[];}})[_0xcbe2('0xd')](function(_0x1c0698){return _0x1c0698;});}function joinOrLeaveQueues(_0x537eb2,_0x29a65e,_0x4cba2b,_0x552a9a){_0x537eb2[_0x29a65e](util[_0xcbe2('0x1c')](_0xcbe2('0x1d'),_0x4cba2b,_0x552a9a[_0xcbe2('0x3')]));if(_0x552a9a['Agents']){for(var _0x104706=0x0;_0x104706<_0x552a9a[_0xcbe2('0x4')][_0xcbe2('0x1e')];_0x104706+=0x1){_0x537eb2[_0x29a65e](util['format'](_0xcbe2('0x1f'),_0x552a9a[_0xcbe2('0x4')][_0x104706][_0xcbe2('0x3')]));}}}function joinOrLeave(_0x50d6c6,_0x38048c,_0x285fc7){var _0x2f1e25;if(_0x50d6c6[_0xcbe2('0x20')]['query']['id']){db[_0xcbe2('0x5')][_0xcbe2('0x21')]({'attributes':['id','name',_0xcbe2('0x6'),_0xcbe2('0x22')],'where':{'id':_0x50d6c6[_0xcbe2('0x20')][_0xcbe2('0x23')]['id']},'include':[{'model':db[_0xcbe2('0x24')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xcbe2('0x25')],'as':_0xcbe2('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xcbe2('0x27'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xcbe2('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0xcbe2('0x29')],'as':_0xcbe2('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0xcbe2('0x2b')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})[_0xcbe2('0xd')](function(_0x37eb8b){if(_0x37eb8b){_0x2f1e25=_0x37eb8b;_0x50d6c6[_0x38048c](util['format'](_0xcbe2('0x1f'),_0x37eb8b[_0xcbe2('0x3')]));var _0x2def48=[];switch(_0x37eb8b[_0xcbe2('0x6')]){case _0xcbe2('0x2c'):_0x50d6c6[_0x38048c](_0xcbe2('0x2d'));_0x50d6c6[_0x38048c](_0xcbe2('0x2e'));if(queryQueues[_0xcbe2('0x2f')](_0xcbe2('0x30'))){delete queryQueues[_0xcbe2('0x30')];}_0x2def48[_0xcbe2('0x31')](db[_0xcbe2('0x32')][_0xcbe2('0x14')](queryQueues));_0x2def48['push'](db[_0xcbe2('0x33')][_0xcbe2('0x14')](queryQueues));_0x2def48['push'](db['FaxQueue'][_0xcbe2('0x14')](queryQueues));_0x2def48['push'](db[_0xcbe2('0x34')][_0xcbe2('0x14')](queryQueues));_0x2def48[_0xcbe2('0x31')](db[_0xcbe2('0x35')][_0xcbe2('0x14')](queryQueues));_0x2def48[_0xcbe2('0x31')](db[_0xcbe2('0x36')]['findAll'](queryQueues));_0x2def48[_0xcbe2('0x31')](db['WhatsappQueue']['findAll'](queryQueues));_0x2def48[_0xcbe2('0x31')](db['User'][_0xcbe2('0x14')](queryTelephones));_0x2def48['push'](db[_0xcbe2('0x37')][_0xcbe2('0x14')](queryTrunks));_0x2def48['push'](db[_0xcbe2('0x38')]['findAll'](queryCampaigns));_0x2def48[_0xcbe2('0x31')](db['User']['findAll'](queryAgents));break;case _0xcbe2('0x39'):_0x50d6c6[_0x38048c]('voice:inbound');_0x50d6c6[_0x38048c]('voice:outbound');_0x2def48[_0xcbe2('0x31')](getAssociatedResources('VoiceQueues',_0x37eb8b[_0xcbe2('0x22')],_0xcbe2('0x32')));_0x2def48[_0xcbe2('0x31')](getAssociatedResources('ChatQueues',_0x37eb8b[_0xcbe2('0x22')],_0xcbe2('0x33')));_0x2def48['push'](getAssociatedResources('FaxQueues',_0x37eb8b['userProfileId'],_0xcbe2('0x3a')));_0x2def48[_0xcbe2('0x31')](getAssociatedResources(_0xcbe2('0x11'),_0x37eb8b[_0xcbe2('0x22')],_0xcbe2('0x34')));_0x2def48['push'](getAssociatedResources(_0xcbe2('0x12'),_0x37eb8b[_0xcbe2('0x22')],'MailQueue'));_0x2def48[_0xcbe2('0x31')](getAssociatedResources(_0xcbe2('0x13'),_0x37eb8b[_0xcbe2('0x22')],_0xcbe2('0x36')));_0x2def48[_0xcbe2('0x31')](getAssociatedResources(_0xcbe2('0x3b'),_0x37eb8b['userProfileId'],_0xcbe2('0x3c')));_0x2def48['push'](getAssociatedResources(_0xcbe2('0x15'),_0x37eb8b['userProfileId'],_0xcbe2('0x5')));_0x2def48['push'](getAssociatedResources(_0xcbe2('0x16'),_0x37eb8b[_0xcbe2('0x22')],_0xcbe2('0x37')));_0x2def48[_0xcbe2('0x31')](getAssociatedResources('IvrCampaigns',_0x37eb8b[_0xcbe2('0x22')],'Campaign'));_0x2def48[_0xcbe2('0x31')](db[_0xcbe2('0x5')][_0xcbe2('0x14')](queryAgents));break;case'agent':_0x50d6c6[_0x38048c](_0xcbe2('0x2d'));_0x50d6c6[_0x38048c](_0xcbe2('0x2e'));_0x2def48['push'](_0x37eb8b[_0xcbe2('0x3d')]({'attributes':['id','name']}));_0x2def48[_0xcbe2('0x31')](_0x37eb8b[_0xcbe2('0x3e')]({'attributes':['id',_0xcbe2('0x3')]}));_0x2def48[_0xcbe2('0x31')](_0x37eb8b[_0xcbe2('0x3f')]({'attributes':['id',_0xcbe2('0x3')]}));_0x2def48['push'](_0x37eb8b['getSmsQueues']({'attributes':['id',_0xcbe2('0x3')]}));_0x2def48['push'](_0x37eb8b[_0xcbe2('0x40')]({'attributes':['id',_0xcbe2('0x3')]}));_0x2def48[_0xcbe2('0x31')](_0x37eb8b[_0xcbe2('0x41')]({'attributes':['id',_0xcbe2('0x3')]}));_0x2def48[_0xcbe2('0x31')](_0x37eb8b[_0xcbe2('0x42')]({'attributes':['id',_0xcbe2('0x3')]}));break;}return BPromise[_0xcbe2('0x43')](_0x2def48);}})[_0xcbe2('0xd')](function(_0x37c585){if(_0x37c585&&_0x37c585[_0xcbe2('0x1e')]){for(var _0x24c1c3=0x0;_0x24c1c3<_0x37c585[_0xcbe2('0x1e')];_0x24c1c3+=0x1){for(var _0x56b9a0=0x0;_0x56b9a0<_0x37c585[_0x24c1c3][_0xcbe2('0x1e')];_0x56b9a0+=0x1){switch(_0x24c1c3){case 0x0:joinOrLeaveQueues(_0x50d6c6,_0x38048c,_0xcbe2('0x44'),_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x1:joinOrLeaveQueues(_0x50d6c6,_0x38048c,_0xcbe2('0x45'),_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x2:joinOrLeaveQueues(_0x50d6c6,_0x38048c,_0xcbe2('0x46'),_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x3:joinOrLeaveQueues(_0x50d6c6,_0x38048c,_0xcbe2('0x47'),_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x4:joinOrLeaveQueues(_0x50d6c6,_0x38048c,'mail',_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x5:joinOrLeaveQueues(_0x50d6c6,_0x38048c,_0xcbe2('0x48'),_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x6:joinOrLeaveQueues(_0x50d6c6,_0x38048c,_0xcbe2('0x49'),_0x37c585[_0x24c1c3][_0x56b9a0]);break;case 0x7:if(_0x2f1e25['role']!==_0xcbe2('0x8'))_0x50d6c6[_0x38048c](util[_0xcbe2('0x1c')](_0xcbe2('0x4a'),_0x37c585[_0x24c1c3][_0x56b9a0]['name']));break;case 0x8:if(_0x2f1e25['role']!=='agent')_0x50d6c6[_0x38048c](util[_0xcbe2('0x1c')](_0xcbe2('0x4b'),_0x37c585[_0x24c1c3][_0x56b9a0][_0xcbe2('0x3')]));break;case 0x9:if(_0x2f1e25[_0xcbe2('0x6')]!==_0xcbe2('0x8'))_0x50d6c6[_0x38048c](util[_0xcbe2('0x1c')](_0xcbe2('0x4c'),_0x37c585[_0x24c1c3][_0x56b9a0][_0xcbe2('0x9')],_0x37c585[_0x24c1c3][_0x56b9a0][_0xcbe2('0x3')]));break;case 0xa:_0x50d6c6[_0x38048c](util['format']('user:%s',_0x37c585[_0x24c1c3][_0x56b9a0]['name']));break;}}}}})[_0xcbe2('0xd')](function(){if(_0x38048c===_0xcbe2('0x4d')){var _0x16ae22=_[_0xcbe2('0x19')](_0x2f1e25[_0xcbe2('0x4e')],'id');return _0x2f1e25[_0xcbe2('0x4f')](_0x16ae22)[_0xcbe2('0xd')](function(){for(var _0x5a5b17=0x0;_0x5a5b17<_0x16ae22['length'];_0x5a5b17+=0x1){_0x285fc7[_0xcbe2('0x50')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x16ae22[_0x5a5b17]),'UserId':Number(_0x2f1e25['id'])});}});}})['then'](function(){if(_0x38048c===_0xcbe2('0x4d')){var _0x32635d=_[_0xcbe2('0x19')](_0x2f1e25[_0xcbe2('0x26')],'id');return _0x2f1e25[_0xcbe2('0x51')](_0x32635d)[_0xcbe2('0xd')](function(){for(var _0x3d7ea5=0x0;_0x3d7ea5<_0x32635d[_0xcbe2('0x1e')];_0x3d7ea5+=0x1){_0x285fc7[_0xcbe2('0x50')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x32635d[_0x3d7ea5]),'UserId':Number(_0x2f1e25['id'])});}});}})[_0xcbe2('0xd')](function(){if(_0x38048c===_0xcbe2('0x4d')){var _0x488dfd=_[_0xcbe2('0x19')](_0x2f1e25[_0xcbe2('0x27')],'id');return _0x2f1e25[_0xcbe2('0x52')](_0x488dfd)[_0xcbe2('0xd')](function(){for(var _0x5acfa3=0x0;_0x5acfa3<_0x488dfd[_0xcbe2('0x1e')];_0x5acfa3+=0x1){_0x285fc7['emit'](_0xcbe2('0x53'),{'FaxInteractionId':Number(_0x488dfd[_0x5acfa3]),'UserId':Number(_0x2f1e25['id'])});}});}})['then'](function(){if(_0x38048c===_0xcbe2('0x4d')){var _0x4f623c=_[_0xcbe2('0x19')](_0x2f1e25[_0xcbe2('0x28')],'id');return _0x2f1e25[_0xcbe2('0x54')](_0x4f623c)[_0xcbe2('0xd')](function(){for(var _0xc289bd=0x0;_0xc289bd<_0x4f623c[_0xcbe2('0x1e')];_0xc289bd+=0x1){_0x285fc7['emit'](_0xcbe2('0x55'),{'SmsInteractionId':Number(_0x4f623c[_0xc289bd]),'UserId':Number(_0x2f1e25['id'])});}});}})[_0xcbe2('0xd')](function(){if(_0x38048c===_0xcbe2('0x4d')){var _0x42b625=_[_0xcbe2('0x19')](_0x2f1e25[_0xcbe2('0x2a')],'id');return _0x2f1e25['removeOpenchannelInteractions'](_0x42b625)['then'](function(){for(var _0x510285=0x0;_0x510285<_0x42b625[_0xcbe2('0x1e')];_0x510285+=0x1){_0x285fc7[_0xcbe2('0x50')](_0xcbe2('0x56'),{'OpenchannelInteractionId':Number(_0x42b625[_0x510285]),'UserId':Number(_0x2f1e25['id'])});}});}})['then'](function(){if(_0x38048c===_0xcbe2('0x4d')){var _0x280967=_[_0xcbe2('0x19')](_0x2f1e25[_0xcbe2('0x57')],'id');return _0x2f1e25[_0xcbe2('0x58')](_0x280967)['then'](function(){for(var _0x1f97bd=0x0;_0x1f97bd<_0x280967[_0xcbe2('0x1e')];_0x1f97bd+=0x1){_0x285fc7['emit'](_0xcbe2('0x59'),{'WhatsappInteractionId':Number(_0x280967[_0x1f97bd]),'UserId':Number(_0x2f1e25['id'])});}});}})[_0xcbe2('0x5a')](function(_0x493a51){_0x50d6c6[_0xcbe2('0x5b')](_0x493a51);});}}function onDisconnect(_0x26a60b,_0x392803){joinOrLeave(_0x26a60b,'leave',_0x392803);}function onConnect(_0x417c7a){joinOrLeave(_0x417c7a,'join');}exports[_0xcbe2('0x5c')]=function(_0x11a7ed){_0x11a7ed['on']('connection',function(_0x31e2fe){_0x31e2fe['setMaxListeners'](0x0);_0x31e2fe['address']=_0x31e2fe[_0xcbe2('0x5d')]['connection']['remoteAddress']+':'+_0x31e2fe['request']['connection'][_0xcbe2('0x5e')];_0x31e2fe[_0xcbe2('0x5f')]=new Date();_0x31e2fe[_0xcbe2('0x5b')]=function(_0x2b9b71){console[_0xcbe2('0x5b')]('SocketIO\x20'+_0x31e2fe[_0xcbe2('0x60')]['name']+'['+_0x31e2fe['address']+']',_0x2b9b71);};_0x31e2fe['on'](_0xcbe2('0x61'),function(){onDisconnect(_0x31e2fe,_0x11a7ed);_0x31e2fe[_0xcbe2('0x5b')](_0xcbe2('0x62'));});onConnect(_0x31e2fe);_0x31e2fe[_0xcbe2('0x5b')](_0xcbe2('0x63'));});}; \ No newline at end of file +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 diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index b3d98dd..6b546ad 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 _0x93c3=['Chat','ChatInteraction','closedinteraction','afterCreate','newmessage','Sms','SmsInteraction','newinteraction','afterUpdate','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','SELECT','then','contact','UserId','interface','format','SIP/%s','name','agent','AfterCreateMessage','channel','opened','Sequelize','QueryTypes','changed','closed','substatus','motionChannel','AfterUpdate','User','email','length','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','client'];(function(_0x4a4a32,_0x2ba798){var _0x154d37=function(_0x491588){while(--_0x491588){_0x4a4a32['push'](_0x4a4a32['shift']());}};_0x154d37(++_0x2ba798);}(_0x93c3,0x195));var _0x393c=function(_0x2db287,_0x4b208c){_0x2db287=_0x2db287-0x0;var _0x57239=_0x93c3[_0x2db287];return _0x57239;};'use strict';var util=require(_0x393c('0x0'));var db=require(_0x393c('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')('triggers');var client=jayson[_0x393c('0x2')]['http']({'port':0x232a});var triggers=[{'channel':_0x393c('0x3'),'model':_0x393c('0x4'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x393c('0x3'),'model':_0x393c('0x4'),'event':'afterUpdate','condition':_0x393c('0x5'),'callback':afterUpdate},{'channel':'Chat','model':'ChatMessage','event':_0x393c('0x6'),'condition':_0x393c('0x7'),'callback':afterCreateMessage},{'channel':_0x393c('0x8'),'model':_0x393c('0x9'),'event':_0x393c('0x6'),'condition':_0x393c('0xa'),'callback':afterCreate},{'channel':_0x393c('0x8'),'model':_0x393c('0x9'),'event':_0x393c('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x393c('0x8'),'model':'SmsMessage','event':_0x393c('0x6'),'condition':_0x393c('0x7'),'callback':afterCreateMessage},{'channel':_0x393c('0xc'),'model':_0x393c('0xd'),'event':_0x393c('0x6'),'condition':_0x393c('0xa'),'callback':afterCreate},{'channel':'Whatsapp','model':'WhatsappInteraction','event':'afterUpdate','condition':_0x393c('0x5'),'callback':afterUpdate},{'channel':_0x393c('0xc'),'model':_0x393c('0xe'),'event':_0x393c('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0x393c('0xf'),'model':_0x393c('0x10'),'event':_0x393c('0x6'),'condition':_0x393c('0xa'),'callback':afterCreate},{'channel':_0x393c('0xf'),'model':_0x393c('0x10'),'event':_0x393c('0xb'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x393c('0xf'),'model':_0x393c('0x11'),'event':_0x393c('0x6'),'condition':_0x393c('0x7'),'callback':afterCreateMessage},{'channel':_0x393c('0x12'),'model':_0x393c('0x13'),'event':_0x393c('0x6'),'condition':_0x393c('0xa'),'callback':afterCreate},{'channel':'Mail','model':_0x393c('0x13'),'event':'afterUpdate','condition':_0x393c('0x5'),'callback':afterUpdate},{'channel':_0x393c('0x12'),'model':_0x393c('0x14'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x393c('0x15'),'model':_0x393c('0x16'),'event':_0x393c('0x6'),'condition':_0x393c('0xa'),'callback':afterCreate},{'channel':_0x393c('0x15'),'model':_0x393c('0x16'),'event':_0x393c('0xb'),'condition':_0x393c('0x5'),'callback':afterUpdate},{'channel':_0x393c('0x15'),'model':_0x393c('0x17'),'event':_0x393c('0x6'),'condition':_0x393c('0x7'),'callback':afterCreateMessage}];function request(_0x4929e6){return client[_0x393c('0x18')](_0x393c('0x19'),_0x4929e6)['then'](function(_0x4d603b){logger[_0x393c('0x1a')](_0x393c('0x1b'),_0x393c('0x19'),_0x4d603b);if(_0x4d603b[_0x393c('0x1c')]){if(_0x4d603b[_0x393c('0x1c')][_0x393c('0x1d')]===0x1f4){logger['error'](_0x393c('0x1b'),_0x393c('0x19'),_0x4d603b[_0x393c('0x1c')]);}}})[_0x393c('0x1e')](function(_0x4bcae8){logger[_0x393c('0x1c')](_0x393c('0x1b'),_0x393c('0x19'),_0x4bcae8);});}function afterCreateMessage(_0x1a1606){return function(_0x4dc804){_0x4dc804=_0x4dc804[_0x393c('0x1f')]({'plain':!![]});_0x4dc804['channel']=_0x1a1606;_0x4dc804['motionChannel']=_0x1a1606;_0x4dc804[_0x393c('0x20')]=_0x4dc804[_0x393c('0x21')];Promise[_0x393c('0x22')]()['then'](function(){if(typeof _0x4dc804[_0x393c('0x23')]===_0x393c('0x24'))return null;var _0x36c5aa=_0x393c('0x25')+_0x4dc804[_0x393c('0x23')];return db[_0x393c('0x26')][_0x393c('0x27')](_0x36c5aa,{'type':db['Sequelize']['QueryTypes'][_0x393c('0x28')],'raw':!![]});})[_0x393c('0x29')](function(_0x393aa0){if(_0x393aa0){_0x4dc804[_0x393c('0x2a')]=_0x393aa0[0x0];}if(typeof _0x4dc804[_0x393c('0x2b')]===_0x393c('0x24'))return;return getAgent(_0x4dc804[_0x393c('0x2b')]);})['then'](function(_0x143c7f){if(_0x143c7f){_0x4dc804[_0x393c('0x2c')]=util[_0x393c('0x2d')](_0x393c('0x2e'),_0x143c7f[_0x393c('0x2f')]);_0x4dc804[_0x393c('0x30')]=_0x143c7f;_0x4dc804['channel']=_0x1a1606;return request({'event':'incomingmessage','message':_0x4dc804});}else{return request({'event':'outgoingmessage','message':_0x4dc804});}})[_0x393c('0x1e')](function(_0xb29467){logger[_0x393c('0x1c')](_0x393c('0x1b'),_0x393c('0x31'),_0xb29467);});};}function afterCreate(_0x52604a,_0x251d7a){return function(_0x19bb79){_0x19bb79=_0x19bb79[_0x393c('0x1f')]({'plain':!![]});_0x19bb79[_0x393c('0x32')]=_0x52604a;_0x19bb79['motionChannel']=_0x52604a;_0x19bb79[_0x393c('0x20')]=_0x393c('0x33');Promise[_0x393c('0x22')]()[_0x393c('0x29')](function(){var _0x2584d9=_0x393c('0x25')+_0x19bb79[_0x393c('0x23')];return db[_0x393c('0x26')]['query'](_0x2584d9,{'type':db[_0x393c('0x34')][_0x393c('0x35')][_0x393c('0x28')],'raw':!![]});})[_0x393c('0x29')](function(_0x54b76f){if(_0x54b76f){_0x19bb79['contact']=_0x54b76f[0x0];}if(typeof _0x19bb79[_0x393c('0x2b')]===_0x393c('0x24'))return;return getAgent(_0x19bb79[_0x393c('0x2b')]);})[_0x393c('0x29')](function(_0xdaf04c){if(_0xdaf04c){_0x19bb79[_0x393c('0x2c')]=util['format'](_0x393c('0x2e'),_0xdaf04c[_0x393c('0x2f')]);_0x19bb79[_0x393c('0x30')]=_0xdaf04c;}return request({'event':_0x251d7a,'message':_0x19bb79});})[_0x393c('0x1e')](function(_0x2ff73d){logger[_0x393c('0x1c')](_0x393c('0x1b'),'AfterCreate',_0x2ff73d);});};}function afterUpdate(_0x4c9eed){return function(_0x5e6929){var _0x2b0b8d=_0x5e6929[_0x393c('0x36')]('closed')&&_0x5e6929[_0x393c('0x37')];var _0x29eb95=_0x5e6929[_0x393c('0x36')](_0x393c('0x38'));if(_0x2b0b8d||_0x29eb95){var _0x45bbe0=_0x2b0b8d?_0x393c('0x5'):'substatus';var _0x44d5dc=_0x5e6929[_0x393c('0x1f')]({'plain':!![]});_0x44d5dc[_0x393c('0x32')]=_0x4c9eed;_0x44d5dc[_0x393c('0x39')]=_0x4c9eed;_0x44d5dc[_0x393c('0x20')]=_0x2b0b8d?_0x393c('0x37'):'substatus';var _0x3ec81b=_0x393c('0x25')+_0x44d5dc[_0x393c('0x23')];return db[_0x393c('0x26')][_0x393c('0x27')](_0x3ec81b,{'type':db[_0x393c('0x34')][_0x393c('0x35')][_0x393c('0x28')],'raw':!![]})[_0x393c('0x29')](function(_0x2e1679){if(_0x2e1679){_0x44d5dc[_0x393c('0x2a')]=_0x2e1679[0x0];}if(typeof _0x44d5dc[_0x393c('0x2b')]===_0x393c('0x24'))return;return getAgent(_0x44d5dc[_0x393c('0x2b')]);})['then'](function(_0x17d3b2){if(_0x17d3b2){_0x44d5dc[_0x393c('0x2c')]=util[_0x393c('0x2d')](_0x393c('0x2e'),_0x17d3b2[_0x393c('0x2f')]);_0x44d5dc['agent']=_0x17d3b2;}return request({'event':_0x45bbe0,'message':_0x44d5dc});})['catch'](function(_0x728a1e){logger[_0x393c('0x1c')](_0x393c('0x1b'),_0x393c('0x3a'),_0x728a1e);});}};}function getAgent(_0xfec677){return db[_0x393c('0x3b')]['find']({'where':{'id':_0xfec677},'attributes':['id',_0x393c('0x2f'),'fullname',_0x393c('0x3c'),'internal'],'raw':!![]})[_0x393c('0x29')](function(_0x396e34){return _0x396e34;});}exports['default']=function(){for(var _0x302798=0x0;_0x302798=_0x4ac39e['agents']){throw Error(_0xc781('0x17'));}_0x41322d(_0x5aa6c5);})['catch'](function(_0x20167c){_0x4c25be(_0x20167c);});});}; \ No newline at end of file +var _0xbc76=['isUndefined','blockedAt','updateAttributes','getLicense','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','mail','chat','fax','sms','whatsapp','getChannels','isValidChannel','includes'];(function(_0x503596,_0x11541a){var _0x4e4d02=function(_0x3c3717){while(--_0x3c3717){_0x503596['push'](_0x503596['shift']());}};_0x4e4d02(++_0x11541a);}(_0xbc76,0x1ad));var _0x6bc7=function(_0xb6ccc7,_0x559242){_0xb6ccc7=_0xb6ccc7-0x0;var _0xfbfcda=_0xbc76[_0xb6ccc7];return _0xfbfcda;};'use strict';var _=require(_0x6bc7('0x0'));var BPromise=require(_0x6bc7('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x6bc7('0x2'));var channels=['voice',_0x6bc7('0x3'),_0x6bc7('0x4'),_0x6bc7('0x5'),_0x6bc7('0x6'),_0x6bc7('0x7'),'openchannel'];exports[_0x6bc7('0x8')]=function(){return channels;};exports[_0x6bc7('0x9')]=function(_0x55dc6c){_0x55dc6c=_0x55dc6c['toLowerCase']();return _[_0x6bc7('0xa')](channels,_0x55dc6c);};exports['clearBlockUser']=function(_0x1fcc7d,_0x2b9e03,_0x54a5ad,_0x15875d){var _0x5c26a={'loginAttempts':_0x2b9e03,'blocked':_0x54a5ad};if(!_[_0x6bc7('0xb')](_0x15875d)){_0x5c26a[_0x6bc7('0xc')]=_0x15875d;}return _0x1fcc7d[_0x6bc7('0xd')](_0x5c26a);};exports[_0x6bc7('0xe')]=function(_0x31fe87){return new BPromise(function(_0x274594,_0x219095){var _0x56086b=0x0;if(_0x31fe87['role']!==_0x6bc7('0xf')){_0x274594(_0x31fe87);}db[_0x6bc7('0x10')][_0x6bc7('0x11')]({'where':{'role':_0x6bc7('0xf'),'online':!![],'id':{'$ne':_0x31fe87['id']}}})[_0x6bc7('0x12')](function(_0x56fa25){_0x56086b=_0x56fa25;return util[_0x6bc7('0xe')]();})[_0x6bc7('0x12')](function(_0x3b8ecd){if(_0x3b8ecd&&_0x3b8ecd['agents']&&_0x56086b>=_0x3b8ecd[_0x6bc7('0x13')]){throw Error(_0x6bc7('0x14'));}_0x274594(_0x31fe87);})[_0x6bc7('0x15')](function(_0x8a71cf){_0x219095(_0x8a71cf);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 64f51f1..c893b68 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x86c4=['exports','404','status','render'];(function(_0x313834,_0x287b33){var _0x1378de=function(_0x15cdee){while(--_0x15cdee){_0x313834['push'](_0x313834['shift']());}};_0x1378de(++_0x287b33);}(_0x86c4,0x64));var _0x486c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x86c4[_0x17d9e3];return _0x14192d;};'use strict';module[_0x486c('0x0')][0x194]=function pageNotFound(_0x4d3e9a,_0x1002b7){var _0x16ce8e=_0x486c('0x1');var _0x1319c7=0x194;var _0x4c5ab7={'status':_0x1319c7};_0x1002b7['status'](_0x4c5ab7[_0x486c('0x2')]);_0x1002b7[_0x486c('0x3')](_0x16ce8e,{},function(_0x1caa48,_0x317618){if(_0x1caa48){return _0x1002b7['status'](_0x4c5ab7[_0x486c('0x2')])['json'](_0x4c5ab7);}_0x1002b7['send'](_0x317618);});}; \ No newline at end of file +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 diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index fb6395b..e080f80 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa74f=['MailAccountId','Imap','hasOne','Smtp','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Team','team_has_mail_queues','MailInteractionId','Account','mail_interaction_has_tags','Tags','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','IntervalId','TagId','DashboardItem','Exntensions','FaxAccountId','fax_interaction_has_tags','ThroughTags','Users','FaxInteractionId','Attachment','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteraction','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','Pause','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','ProactiveActions','ChatMessage','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','Attachments','team_has_chat_queues','ChatGroupId','CompanyId','Company','cm_contact_has_tags','CampaignId','OwnerId','All','OneAll','AutomationAllId','Any','AutomationAnyId','Actions','ParentId','ChatApplications','FaxApplications','SmsApplications','Schedule','CustomReportId','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','Trigger','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','DefaultReportId','Fields','MetricId','SalesforceAccount','Configurations','AccountId','SalesforceField','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Subjects','Field','VariableId','DeskAccount','DeskField','int_desk_configuration_has_tags','ZendeskAccount','ZendeskField','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerConfiguration','FromId','SessionId','SmsQueueReport','ProjectId','MailQueues','ChatQueues','FaxQueues','SmsQueues','team_has_openchannel_queues','team_has_whatsapp_queues','TrunkId','TrunkBackupId','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromUserId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappMessage','WhatsappInteractionId','ToWhatsappAccountId','ToQueueId','exports','lodash','sequelize','defaultsDeep','motion2','xC@LL1234','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','127.0.0.1','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','MailInteractions','user_has_mail_interactions','ChatInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserMailQueue','OpenchannelQueues','WhatsappQueues','UserWhatsappQueue','ChatWebsite','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccount','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','CmHopperBlack','HopperBlacks','JscriptySessions','Trunk','TrunkBackup','Lists','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId'];(function(_0x3b2675,_0x1423a4){var _0x2e92ae=function(_0x2268a0){while(--_0x2268a0){_0x3b2675['push'](_0x3b2675['shift']());}};_0x2e92ae(++_0x1423a4);}(_0xa74f,0x9a));var _0xfa74=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0xa74f[_0x1573ea];return _0x51c0e2;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0xfa74('0x0'));var jstz=require('jstz');var timezone=jstz['determine']();config[_0xfa74('0x1')]=_[_0xfa74('0x2')](config[_0xfa74('0x1')],{'database':_0xfa74('0x3'),'username':'xcall','password':_0xfa74('0x4'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfa74('0x5')},'logging':![],'timezone':timezone[_0xfa74('0x6')](),'define':{'charset':_0xfa74('0x7'),'collate':_0xfa74('0x8')}}});config[_0xfa74('0x9')]=_[_0xfa74('0x2')](config['sequelizeHistory'],{'database':_0xfa74('0x3'),'username':_0xfa74('0xa'),'password':_0xfa74('0x4'),'options':{'host':_0xfa74('0xb'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfa74('0x5')},'logging':![],'timezone':timezone[_0xfa74('0x6')](),'define':{'charset':'utf8','collate':_0xfa74('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfa74('0x1')][_0xfa74('0xc')],config[_0xfa74('0x1')]['username'],config[_0xfa74('0x1')][_0xfa74('0xd')],config[_0xfa74('0x1')][_0xfa74('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xfa74('0xc')],config[_0xfa74('0x9')][_0xfa74('0xf')],config[_0xfa74('0x9')][_0xfa74('0xd')],config['sequelizeHistory'][_0xfa74('0xe')])};db[_0xfa74('0x10')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x12'));db[_0xfa74('0x13')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x14'));db[_0xfa74('0x15')]=db['sequelize']['import'](_0xfa74('0x16'));db[_0xfa74('0x17')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x18'));db[_0xfa74('0x19')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x1a'));db[_0xfa74('0x1b')]=db[_0xfa74('0x1')]['import']('../api/voiceQueue/voiceQueue.model');db[_0xfa74('0x1c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x1d'));db[_0xfa74('0x1e')]=db['sequelize']['import'](_0xfa74('0x1f'));db['VoiceMail']=db['sequelize']['import'](_0xfa74('0x20'));db[_0xfa74('0x21')]=db[_0xfa74('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db[_0xfa74('0x22')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x23'));db['VoiceDialReport']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/voiceDialReport/voiceDialReport.model');db[_0xfa74('0x24')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x25'));db['VoiceQueueReport']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x26'));db['MemberReport']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x27'));db['Trunk']=db['sequelize'][_0xfa74('0x11')]('../api/trunk/trunk.model');db[_0xfa74('0x28')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x29'));db[_0xfa74('0x2a')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x2b'));db[_0xfa74('0x2c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x2d'));db[_0xfa74('0x2e')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x2f'));db['UserMailQueue']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x30'));db[_0xfa74('0x31')]=db['sequelize']['import'](_0xfa74('0x32'));db[_0xfa74('0x33')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/userSmsQueue/userSmsQueue.model');db[_0xfa74('0x34')]=db[_0xfa74('0x1')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['UserWhatsappQueue']=db['sequelize']['import'](_0xfa74('0x35'));db[_0xfa74('0x36')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x37'));db[_0xfa74('0x38')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x39'));db['MailAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3a'));db[_0xfa74('0x3b')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/mailQueue/mailQueue.model');db[_0xfa74('0x3c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3d'));db['MailInteraction']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x3e'));db[_0xfa74('0x3f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x40'));db[_0xfa74('0x41')]=db['sequelize']['import'](_0xfa74('0x42'));db[_0xfa74('0x43')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/mailQueueReport/mailQueueReport.model');db[_0xfa74('0x44')]=db[_0xfa74('0x1')]['import']('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x45'));db[_0xfa74('0x46')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x47'));db[_0xfa74('0x48')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x49'));db[_0xfa74('0x4a')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/faxInteraction/faxInteraction.model');db[_0xfa74('0x4b')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x4c'));db[_0xfa74('0x4d')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x4e'));db[_0xfa74('0x4f')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x50'));db['SmsAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x51'));db[_0xfa74('0x52')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x53'));db['SmsInteraction']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/smsInteraction/smsInteraction.model');db[_0xfa74('0x54')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x55'));db[_0xfa74('0x56')]=db['sequelize']['import'](_0xfa74('0x57'));db[_0xfa74('0x58')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x59'));db[_0xfa74('0x5a')]=db['sequelize']['import'](_0xfa74('0x5b'));db[_0xfa74('0x5c')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x5d'));db[_0xfa74('0x5e')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/openchannelMessage/openchannelMessage.model');db[_0xfa74('0x5f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x60'));db['ChatWebsite']=db['sequelize'][_0xfa74('0x11')]('../api/chatWebsite/chatWebsite.model');db[_0xfa74('0x61')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x62'));db[_0xfa74('0x63')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatApplication/chatApplication.model');db[_0xfa74('0x64')]=db['sequelize'][_0xfa74('0x11')]('../api/chatInteraction/chatInteraction.model');db['ChatMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatMessage/chatMessage.model');db['ChatOfflineMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x65'));db[_0xfa74('0x66')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x67'));db[_0xfa74('0x68')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatGroup/chatGroup.model');db[_0xfa74('0x69')]=db[_0xfa74('0x1')]['import']('../api/chatProactiveAction/chatProactiveAction.model');db[_0xfa74('0x6a')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x6b'));db[_0xfa74('0x6c')]=db['sequelize'][_0xfa74('0x11')]('../api/cmContact/cmContact.model');db[_0xfa74('0x6d')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x6e'));db[_0xfa74('0x6f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x70'));db['CmHopperHistory']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x71'));db[_0xfa74('0x72')]=db['sequelize'][_0xfa74('0x11')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0xfa74('0x73')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x74'));db[_0xfa74('0x75')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x76'));db[_0xfa74('0x77')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x78'));db[_0xfa74('0x79')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/cannedAnswer/cannedAnswer.model');db[_0xfa74('0x7a')]=db[_0xfa74('0x1')]['import']('../api/disposition/disposition.model');db[_0xfa74('0x7b')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x7c'));db[_0xfa74('0x7d')]=db['sequelize'][_0xfa74('0x11')]('../api/interval/interval.model');db['Pause']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x7e'));db[_0xfa74('0x7f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x80'));db[_0xfa74('0x81')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x82'));db['Schedule']=db[_0xfa74('0x1')]['import'](_0xfa74('0x83'));db[_0xfa74('0x84')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x85'));db[_0xfa74('0x86')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x87'));db[_0xfa74('0x88')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x89'));db['Trigger']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8a'));db[_0xfa74('0x8b')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8c'));db[_0xfa74('0x8d')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x8e'));db[_0xfa74('0x8f')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x90'));db[_0xfa74('0x91')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x92'));db[_0xfa74('0x93')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x94'));db[_0xfa74('0x95')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0xfa74('0x96')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x97'));db['AnalyticFieldReport']=db[_0xfa74('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xfa74('0x98')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x99'));db['SalesforceAccount']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x9a'));db[_0xfa74('0x9b')]=db[_0xfa74('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x9c'));db[_0xfa74('0x9d')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x9e'));db[_0xfa74('0x9f')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa0'));db[_0xfa74('0xa1')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa2'));db['DeskAccount']=db['sequelize']['import'](_0xfa74('0xa3'));db[_0xfa74('0xa4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa5'));db['DeskField']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intDeskField/intDeskField.model');db[_0xfa74('0xa6')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xa7'));db[_0xfa74('0xa8')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xa9'));db[_0xfa74('0xaa')]=db[_0xfa74('0x1')]['import']('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xfa74('0xab')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xac'));db['ZendeskField']=db[_0xfa74('0x1')]['import']('../api/intZendeskField/intZendeskField.model');db[_0xfa74('0xad')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xfa74('0xae')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xaf'));db['FreshdeskField']=db['sequelize']['import'](_0xfa74('0xb0'));db[_0xfa74('0xb1')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb2'));db['VtigerConfiguration']=db['sequelize'][_0xfa74('0x11')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0xfa74('0xb3')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb4'));db[_0xfa74('0xb5')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xb6'));db[_0xfa74('0xb7')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xb8'));db[_0xfa74('0xb9')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xba'));db[_0xfa74('0xbb')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xbc'));db[_0xfa74('0xbd')]=db['sequelize']['import'](_0xfa74('0xbe'));db[_0xfa74('0xbf')]=db[_0xfa74('0x1')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xfa74('0xc0')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xc1'));db[_0xfa74('0xc2')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xfa74('0xc3')]=db['sequelize']['import'](_0xfa74('0xc4'));db[_0xfa74('0x8d')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x8e'));db['Network']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xc5'));db[_0xfa74('0xc6')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xc7'));db['ChatInternalMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xfa74('0xc8')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xfa74('0xc9')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xca'));db[_0xfa74('0xcb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xcc'));db['SmsQueueReport']=db['sequelize'][_0xfa74('0x11')]('../api/smsQueueReport/smsQueueReport.model');db[_0xfa74('0xcd')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xce'));db[_0xfa74('0xcf')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd0'));db[_0xfa74('0xd1')]=db[_0xfa74('0x1')]['import']('../api/jscriptyProject/jscriptyProject.model');db['Setting']=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xd2'));db['SquareOdbc']=db[_0xfa74('0x1')]['import'](_0xfa74('0xd3'));db[_0xfa74('0xd4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd5'));db[_0xfa74('0xd6')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xd7'));db[_0xfa74('0xd8')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xd9'));db['Team']=db[_0xfa74('0x1')]['import'](_0xfa74('0xda'));db[_0xfa74('0xdb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xdc'));db[_0xfa74('0xdd')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xde'));db['Migration']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xdf'));db['Attachment']=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/attachment/attachment.model');db[_0xfa74('0xe0')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xe1'));db[_0xfa74('0xe2')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xe3'));db[_0xfa74('0xe4')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xe5'));db[_0xfa74('0xe6')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/faxTransferReport/faxTransferReport.model');db[_0xfa74('0xe7')]=db['sequelize'][_0xfa74('0x11')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xfa74('0xe8')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/smsTransferReport/smsTransferReport.model');db[_0xfa74('0xe9')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xea'));db[_0xfa74('0xeb')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xec'));db[_0xfa74('0xed')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xee'));db[_0xfa74('0xef')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xf0'));db[_0xfa74('0xf1')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xf2'));db[_0xfa74('0xf3')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xf4'));db[_0xfa74('0xf5')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0xf6'));db[_0xfa74('0xf7')]=db['sequelize']['import'](_0xfa74('0xf8'));db[_0xfa74('0xf9')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xfa'));db['WhatsappMessage']=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0xfb'));db[_0xfa74('0xfc')]=db[_0xfa74('0x1')]['import'](_0xfa74('0xfd'));db[_0xfa74('0xfe')]=db[_0xfa74('0x1')][_0xfa74('0x11')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xfa74('0xff')]=db[_0xfa74('0x1')]['import'](_0xfa74('0x100'));db[_0xfa74('0x101')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x102'));db[_0xfa74('0x103')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x104'));db[_0xfa74('0x105')]=db[_0xfa74('0x1')][_0xfa74('0x11')](_0xfa74('0x106'));db[_0xfa74('0x107')]=db['sequelize'][_0xfa74('0x11')](_0xfa74('0x108'));db[_0xfa74('0x10')]['hasOne'](db[_0xfa74('0x109')],{'as':'VoiceMail','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x1c')],{'as':'Recordings','foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x2a')],{'as':_0xfa74('0x10d'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'onDelete':'cascade','hooks':!![]});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':_0xfa74('0x110'),'foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x72')],{'as':_0xfa74('0x72'),'foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x64')],{'as':'ChatInteractions','foreignKey':_0xfa74('0x10b')});db['User'][_0xfa74('0x10c')](db['SmsInteraction'],{'as':_0xfa74('0x112'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x4a')],{'as':_0xfa74('0x113'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0x114')],{'as':'MailInteractions','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x10')][_0xfa74('0x10c')](db[_0xfa74('0xf9')],{'as':_0xfa74('0x115'),'foreignKey':'UserId'});db[_0xfa74('0x10')][_0xfa74('0x10c')](db['UserNotification'],{'as':_0xfa74('0x116'),'foreignKey':_0xfa74('0x117')});db['User'][_0xfa74('0x118')](db[_0xfa74('0xed')],{'as':'UserProfile','foreignKey':'userProfileId'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x68')],{'as':'Groups','through':_0xfa74('0x11a')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['CmContact'],{'as':_0xfa74('0x11b'),'through':_0xfa74('0x11c')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':'Lists','through':_0xfa74('0x11d')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['Team'],{'through':_0xfa74('0x11e')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x114')],{'as':_0xfa74('0x11f'),'through':_0xfa74('0x120')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x64')],{'as':_0xfa74('0x121'),'through':'user_has_chat_interactions'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x4a')],{'as':'FaxInteractions','through':'user_has_fax_interactions'});db['User'][_0xfa74('0x119')](db['SmsInteraction'],{'as':_0xfa74('0x112'),'through':_0xfa74('0x122')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'through':_0xfa74('0x123')});db[_0xfa74('0x10')][_0xfa74('0x119')](db['WhatsappInteraction'],{'as':_0xfa74('0x115'),'through':_0xfa74('0x124')});db['User'][_0xfa74('0x119')](db['VoiceQueue'],{'as':_0xfa74('0x125'),'through':_0xfa74('0x2c'),'required':![]});db['User'][_0xfa74('0x119')](db[_0xfa74('0xeb')],{'as':_0xfa74('0x126'),'through':_0xfa74('0x107'),'required':![]});db['User'][_0xfa74('0x119')](db[_0xfa74('0x3b')],{'as':'MailQueues','through':_0xfa74('0x127'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x66')],{'as':'ChatQueues','through':'UserChatQueue','required':![],'hooks':!![]});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x4d')],{'as':'FaxQueues','through':_0xfa74('0x31'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x56')],{'as':'SmsQueues','through':_0xfa74('0x33'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x5f')],{'as':_0xfa74('0x128'),'through':_0xfa74('0x34'),'required':![]});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0xff')],{'as':_0xfa74('0x129'),'through':_0xfa74('0x12a'),'required':![]});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'through':_0xfa74('0x11d')});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x12c'),'through':_0xfa74('0x12d')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x46')],{'as':'FaxAccounts','through':_0xfa74('0x12e')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x12f')],{'as':_0xfa74('0x130'),'through':_0xfa74('0x131')});db['User'][_0xfa74('0x119')](db[_0xfa74('0x58')],{'as':_0xfa74('0x132'),'through':_0xfa74('0x133')});db[_0xfa74('0x10')]['belongsToMany'](db[_0xfa74('0x134')],{'as':'SmsAccounts','through':'user_has_sms_accounts'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xf5')],{'as':'WhatsappAccounts','through':'user_has_whatsapp_accounts'});db[_0xfa74('0x10')][_0xfa74('0x119')](db[_0xfa74('0xd4')],{'as':_0xfa74('0x135'),'through':_0xfa74('0x136')});db['VoiceChanSpy'][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':'SpiedAgents','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x137')});db['VoiceContext'][_0xfa74('0x10c')](db['VoiceExtension'],{'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x17')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x138'),'onDelete':'cascade'});db[_0xfa74('0x19')][_0xfa74('0x119')](db[_0xfa74('0x84')],{'as':_0xfa74('0x139'),'through':'moh_has_sounds'});db['VoiceQueue'][_0xfa74('0x10c')](db['UserVoiceQueueRt'],{'as':_0xfa74('0x13a'),'foreignKey':_0xfa74('0x13b')});db[_0xfa74('0x1b')][_0xfa74('0x10c')](db['CmHopper'],{'as':_0xfa74('0x13c'),'foreignKey':'VoiceQueueId'});db[_0xfa74('0x1b')][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':_0xfa74('0x13d'),'foreignKey':'VoiceQueueId'});db[_0xfa74('0x1b')]['hasMany'](db[_0xfa74('0x72')],{'as':'ReportAgentPreview','foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x10c')](db[_0xfa74('0x13e')],{'as':_0xfa74('0x13f'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xfa74('0x10c')](db[_0xfa74('0xcb')],{'as':_0xfa74('0x140'),'foreignKey':_0xfa74('0x13b')});db['VoiceQueue'][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141'),'foreignKey':'TrunkId'});db[_0xfa74('0x1b')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x142'),'foreignKey':'TrunkBackupId'});db[_0xfa74('0x1b')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':'IntervalId'});db['VoiceQueue'][_0xfa74('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x143'),'through':_0xfa74('0x144')});db[_0xfa74('0x1b')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x2c')});db[_0xfa74('0x1b')][_0xfa74('0x119')](db['Team'],{'as':_0xfa74('0x146'),'through':_0xfa74('0x103')});db[_0xfa74('0x1b')]['belongsToMany'](db[_0xfa74('0xe9')],{'as':_0xfa74('0x147'),'through':_0xfa74('0x148')});db[_0xfa74('0x1c')][_0xfa74('0x118')](db['User'],{'as':'User','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x1e')]['belongsTo'](db[_0xfa74('0x10')],{'as':_0xfa74('0x10'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x109')][_0xfa74('0x10c')](db['VoiceMailMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x14a'),'sourceKey':_0xfa74('0x14b')});db[_0xfa74('0x21')]['belongsTo'](db['VoiceMail'],{'foreignKey':_0xfa74('0x14a'),'targetKey':_0xfa74('0x14b')});db['VoiceCallReport'][_0xfa74('0x10c')](db[_0xfa74('0x14c')],{'as':_0xfa74('0x14d'),'foreignKey':_0xfa74('0x14e'),'constraints':![]});db[_0xfa74('0x22')][_0xfa74('0x10c')](db['VoiceAgentReport'],{'as':_0xfa74('0x14f'),'foreignKey':'uniqueid','constraints':![]});db[_0xfa74('0x22')]['belongsTo'](db['User'],{'as':_0xfa74('0x10'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x22')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x36')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x12f'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x38')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x12f'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')]['hasOne'](db[_0xfa74('0x36')],{'as':_0xfa74('0x153'),'onDelete':'cascade'});db[_0xfa74('0x12f')][_0xfa74('0x154')](db[_0xfa74('0x38')],{'as':_0xfa74('0x155'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x152'),'onDelete':'cascade'});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x3f')],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12f')][_0xfa74('0x10c')](db[_0xfa74('0x114')],{'as':_0xfa74('0x158')});db[_0xfa74('0x12f')]['hasMany'](db[_0xfa74('0x41')],{'as':_0xfa74('0x138')});db['MailAccount'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x12f')][_0xfa74('0x118')](db[_0xfa74('0x88')],{'as':_0xfa74('0x88'),'foreignKey':_0xfa74('0x15b')});db[_0xfa74('0x12f')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x12f')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x131')});db[_0xfa74('0x3b')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x127')});db[_0xfa74('0x3b')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x15f'),'as':_0xfa74('0x146')});db[_0xfa74('0x114')][_0xfa74('0x10c')](db['MailMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x114')]['belongsTo'](db[_0xfa74('0x12f')],{'as':_0xfa74('0x161'),'foreignKey':'MailAccountId'});db[_0xfa74('0x114')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x114')][_0xfa74('0x118')](db['User'],{'as':'Owner','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x114')]['belongsToMany'](db[_0xfa74('0x86')],{'through':_0xfa74('0x162'),'as':_0xfa74('0x163')});db[_0xfa74('0x114')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x162'),'as':'ThroughTags'});db['MailInteraction'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Users','through':_0xfa74('0x120'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x3f')][_0xfa74('0x10c')](db['Attachment'],{'as':'Attachments','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db['User'],{'as':_0xfa74('0x10')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x114')],{'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x160')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x152')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x12b'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x3f')][_0xfa74('0x118')](db[_0xfa74('0x166')],{'as':_0xfa74('0x166'),'foreignKey':_0xfa74('0x167')});db[_0xfa74('0x41')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db['MailApplication']['belongsTo'](db[_0xfa74('0x3b')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x41')]['belongsTo'](db[_0xfa74('0x12f')],{'onDelete':_0xfa74('0x168')});db['MailApplication']['belongsTo'](db['Interval'],{'onDelete':'restrict','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x41')]['belongsTo'](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db['MailQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x114')],{});db[_0xfa74('0x43')][_0xfa74('0x118')](db[_0xfa74('0x3f')],{});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x10')],{});db[_0xfa74('0x43')]['belongsTo'](db[_0xfa74('0x3b')],{});db[_0xfa74('0x44')][_0xfa74('0x10c')](db[_0xfa74('0x16b')],{'as':'Items','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x46')]['hasMany'](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':'FaxAccountId','onDelete':_0xfa74('0x10a')});db['FaxAccount'][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':'Answers','foreignKey':'FaxAccountId'});db[_0xfa74('0x46')][_0xfa74('0x10c')](db['FaxInteraction'],{'as':_0xfa74('0x158')});db['FaxAccount']['hasMany'](db[_0xfa74('0x48')],{'as':_0xfa74('0x138')});db[_0xfa74('0x46')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x16c'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x46')]['hasMany'](db['FaxMessage'],{'as':_0xfa74('0x149')});db[_0xfa74('0x46')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141')});db[_0xfa74('0x46')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x46')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x46')][_0xfa74('0x119')](db['User'],{'as':'Agents','through':_0xfa74('0x12e')});db['FaxApplication']['belongsTo'](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x4d')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x46')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x48')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db['FaxInteraction'][_0xfa74('0x10c')](db[_0xfa74('0x4b')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':'FaxInteractionId'});db[_0xfa74('0x4a')]['belongsTo'](db[_0xfa74('0x46')],{'as':'Account','foreignKey':_0xfa74('0x16d')});db[_0xfa74('0x4a')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x4a')][_0xfa74('0x118')](db['User'],{'as':'Owner','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x4a')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x16e'),'as':'Tags'});db[_0xfa74('0x4a')]['belongsToMany'](db[_0xfa74('0x86')],{'through':'fax_interaction_has_tags','as':_0xfa74('0x16f')});db[_0xfa74('0x4a')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':'user_has_fax_interactions','foreignKey':'FaxInteractionId'});db[_0xfa74('0x4b')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':'cascade','as':'User'});db[_0xfa74('0x4b')][_0xfa74('0x118')](db[_0xfa74('0x4a')],{'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x171')});db['FaxMessage']['belongsTo'](db[_0xfa74('0x6c')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db['FaxMessage'][_0xfa74('0x118')](db['Attachment'],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x4b')][_0xfa74('0x118')](db['FaxAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x16d')});db['FaxQueue']['belongsToMany'](db[_0xfa74('0x10')],{'as':'Agents','through':_0xfa74('0x31')});db[_0xfa74('0x4d')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x174'),'as':_0xfa74('0x146')});db[_0xfa74('0x4f')][_0xfa74('0x118')](db[_0xfa74('0x46')],{});db[_0xfa74('0x4f')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x4f')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db[_0xfa74('0x4f')][_0xfa74('0x118')](db['FaxInteraction'],{});db['FaxQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x4b')],{});db['FaxQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db['FaxQueueReport'][_0xfa74('0x118')](db['FaxQueue'],{});db[_0xfa74('0x134')][_0xfa74('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa74('0x175'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db['CannedAnswer'],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db[_0xfa74('0x54')],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x134')][_0xfa74('0x10c')](db[_0xfa74('0x176')],{'as':_0xfa74('0x158')});db['SmsAccount'][_0xfa74('0x10c')](db[_0xfa74('0x52')],{'as':_0xfa74('0x138')});db['SmsAccount'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x134')][_0xfa74('0x118')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x134')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':'user_has_sms_accounts'});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')]['belongsTo'](db[_0xfa74('0x56')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')]['belongsTo'](db[_0xfa74('0x134')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x52')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db[_0xfa74('0x176')][_0xfa74('0x10c')](db[_0xfa74('0x54')],{'as':_0xfa74('0x149'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0xfa74('0x176')][_0xfa74('0x118')](db['SmsAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x175')});db[_0xfa74('0x176')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x176')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'Owner','foreignKey':'UserId'});db[_0xfa74('0x176')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x177'),'as':_0xfa74('0x163')});db[_0xfa74('0x176')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'sms_interaction_has_tags','as':_0xfa74('0x16f')});db[_0xfa74('0x176')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x122'),'foreignKey':_0xfa74('0x178')});db[_0xfa74('0x54')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':'Contact'});db['SmsMessage'][_0xfa74('0x118')](db['SmsInteraction'],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x164'),'foreignKey':'SmsInteractionId'});db[_0xfa74('0x54')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'as':'Account','foreignKey':_0xfa74('0x175')});db[_0xfa74('0x56')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x33'),'foreignKey':_0xfa74('0x179')});db[_0xfa74('0x56')][_0xfa74('0x119')](db[_0xfa74('0x15e')],{'through':_0xfa74('0x17a'),'as':_0xfa74('0x146')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':'Dispositions','foreignKey':_0xfa74('0x17b'),'onDelete':'cascade'});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x158'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5e')],{'as':'Messages','foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x10c')](db[_0xfa74('0x5a')],{'as':_0xfa74('0x138'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x58')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x58')]['belongsTo'](db[_0xfa74('0x17c')],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db[_0xfa74('0x58')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x133')});db['OpenchannelApplication'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0x5a')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x17d')});db[_0xfa74('0x5a')][_0xfa74('0x118')](db[_0xfa74('0x58')],{'onDelete':'restrict','foreignKey':_0xfa74('0x17b')});db['OpenchannelApplication']['belongsTo'](db[_0xfa74('0x7d')],{'onDelete':'restrict','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x5a')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xfa74('0x5c')][_0xfa74('0x10c')](db['OpenchannelMessage'],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5c')][_0xfa74('0x118')](db['OpenchannelAccount'],{'as':_0xfa74('0x161'),'foreignKey':'OpenchannelAccountId'});db[_0xfa74('0x5c')][_0xfa74('0x118')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xfa74('0x5c')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x5c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x180'),'as':_0xfa74('0x163')});db[_0xfa74('0x5c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'openchannel_interaction_has_tags','as':'ThroughTags'});db['OpenchannelInteraction']['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':'user_has_openchannel_interactions','foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5e')]['belongsTo'](db[_0xfa74('0x10')],{'onDelete':'cascade','as':_0xfa74('0x10')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db['CmContact'],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x150')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{'onDelete':_0xfa74('0x10a'),'as':'Interaction','foreignKey':_0xfa74('0x17e')});db[_0xfa74('0x5e')][_0xfa74('0x118')](db[_0xfa74('0x172')],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x5e')]['belongsTo'](db[_0xfa74('0x58')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x17b')});db[_0xfa74('0x5f')][_0xfa74('0x119')](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x34'),'foreignKey':_0xfa74('0x17d')});db[_0xfa74('0x5f')][_0xfa74('0x119')](db['Team'],{'through':'team_has_openchannel_queues','as':_0xfa74('0x146')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db['Disposition'],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x165'),'onDelete':'cascade'});db[_0xfa74('0x12b')]['hasMany'](db[_0xfa74('0x79')],{'as':_0xfa74('0x157'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x69')],{'as':_0xfa74('0x181')});db['ChatWebsite'][_0xfa74('0x10c')](db['ChatInteraction'],{'as':_0xfa74('0x158')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x63')],{'as':_0xfa74('0x138')});db[_0xfa74('0x12b')][_0xfa74('0x10c')](db[_0xfa74('0x182')],{'as':_0xfa74('0x149')});db[_0xfa74('0x12b')]['belongsTo'](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x12b')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':'IntervalId'});db[_0xfa74('0x12b')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'as':'MailAccount','foreignKey':_0xfa74('0x152')});db[_0xfa74('0x12b')]['belongsTo'](db[_0xfa74('0x17c')],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db['ChatWebsite'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Agents','through':_0xfa74('0x12d')});db['OpenchannelQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x58')],{});db[_0xfa74('0x61')][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{});db[_0xfa74('0x61')][_0xfa74('0x118')](db[_0xfa74('0x5e')],{});db['OpenchannelQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelQueue'],{});db[_0xfa74('0x63')]['belongsTo'](db[_0xfa74('0x10')],{'as':'Agent','foreignKey':'UserId','onDelete':_0xfa74('0x168')});db[_0xfa74('0x63')]['belongsTo'](db['ChatQueue'],{'as':_0xfa74('0x183'),'foreignKey':_0xfa74('0x184'),'onDelete':_0xfa74('0x168')});db['ChatApplication']['belongsTo'](db[_0xfa74('0x12b')],{'as':_0xfa74('0x185'),'foreignKey':_0xfa74('0x165'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x63')][_0xfa74('0x118')](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':'TagId'});db[_0xfa74('0x64')][_0xfa74('0x10c')](db[_0xfa74('0x182')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x64')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x161'),'foreignKey':'ChatWebsiteId'});db[_0xfa74('0x64')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db['ChatInteraction'][_0xfa74('0x118')](db['User'],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x64')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x187'),'as':_0xfa74('0x163')});db[_0xfa74('0x64')][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x187'),'as':'ThroughTags'});db['ChatInteraction'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x188'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x182')][_0xfa74('0x118')](db['User'],{'onDelete':'cascade','as':_0xfa74('0x10')});db['ChatMessage'][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xfa74('0x151')});db[_0xfa74('0x182')][_0xfa74('0x118')](db['ChatInteraction'],{'onDelete':'cascade','as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x186')});db[_0xfa74('0x182')][_0xfa74('0x118')](db[_0xfa74('0x172')],{'as':_0xfa74('0x172'),'foreignKey':_0xfa74('0x173')});db[_0xfa74('0x182')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x161'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0xfa74('0x10c')](db[_0xfa74('0x172')],{'as':_0xfa74('0x189'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xfa74('0x10a'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db['CmContact'],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0xfa74('0x166')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':'UserChatQueue','hooks':!![]});db[_0xfa74('0x66')][_0xfa74('0x119')](db['Team'],{'through':_0xfa74('0x18a'),'as':'Teams'});db[_0xfa74('0x68')][_0xfa74('0x10c')](db['ChatInternalMessage'],{'as':'Messages','foreignKey':_0xfa74('0x18b'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x68')][_0xfa74('0x119')](db['User'],{'as':'Members','through':_0xfa74('0x11a')});db[_0xfa74('0x69')][_0xfa74('0x118')](db[_0xfa74('0x12b')],{'as':_0xfa74('0x185'),'foreignKey':_0xfa74('0x165')});db[_0xfa74('0x6a')]['hasMany'](db[_0xfa74('0x6c')],{'as':'Contacts','foreignKey':_0xfa74('0x18c')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['CmHopper'],{'as':_0xfa74('0x13c'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['CmHopperFinal'],{'as':_0xfa74('0x10f'),'foreignKey':'ContactId'});db[_0xfa74('0x6c')]['hasMany'](db['CmHopperHistory'],{'as':_0xfa74('0x13d'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0x6c')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xfa74('0x151')});db['CmContact']['hasMany'](db[_0xfa74('0xcb')],{'as':'JscriptySessions','foreignKey':_0xfa74('0x151')});db['CmContact'][_0xfa74('0x10c')](db[_0xfa74('0x5c')],{'as':_0xfa74('0x111'),'foreignKey':'ContactId','onDelete':_0xfa74('0x168')});db['CmContact'][_0xfa74('0x10c')](db['ChatInteraction'],{'as':_0xfa74('0x121'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db[_0xfa74('0x176')],{'as':_0xfa74('0x112'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')]['hasMany'](db[_0xfa74('0x4a')],{'as':'FaxInteractions','foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x10c')](db['MailInteraction'],{'as':_0xfa74('0x11f'),'foreignKey':'ContactId','onDelete':_0xfa74('0x168')});db[_0xfa74('0x6c')][_0xfa74('0x118')](db[_0xfa74('0x6a')],{'as':_0xfa74('0x18d'),'foreignKey':_0xfa74('0x18c')});db['CmContact'][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6c')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x11c')});db['CmContact'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'as':_0xfa74('0x163'),'through':_0xfa74('0x18e')});db[_0xfa74('0x6c')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'cm_contact_has_tags','as':'ThroughTags'});db[_0xfa74('0x6d')][_0xfa74('0x118')](db['CmContact'],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6d')]['belongsTo'](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db['CmHopper'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':'Agent','foreignKey':_0xfa74('0x10b')});db[_0xfa74('0x6d')][_0xfa74('0x118')](db[_0xfa74('0x1b')],{'as':_0xfa74('0x183'),'foreignKey':_0xfa74('0x13b'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x6d')][_0xfa74('0x118')](db[_0xfa74('0xdd')],{'as':_0xfa74('0xdd'),'foreignKey':_0xfa74('0x18f'),'onDelete':_0xfa74('0x10a')});db['CmHopper'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x190')});db[_0xfa74('0x13e')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151'),'onDelete':'cascade'});db[_0xfa74('0x13e')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x13e')][_0xfa74('0x118')](db[_0xfa74('0x1b')],{'as':_0xfa74('0x183'),'foreignKey':'VoiceQueueId','onDelete':_0xfa74('0x10a')});db[_0xfa74('0x13e')]['belongsTo'](db['Campaign'],{'as':_0xfa74('0xdd'),'foreignKey':_0xfa74('0x18f'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x77')][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x191'),'singular':_0xfa74('0x192')},'foreignKey':_0xfa74('0x193'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db['Automation'][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x194'),'singular':'OneAny'},'foreignKey':_0xfa74('0x195'),'onDelete':'cascade','hooks':!![]});db[_0xfa74('0x77')][_0xfa74('0x10c')](db[_0xfa74('0x75')],{'as':_0xfa74('0x196'),'foreignKey':'AutomationId','onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x7a')][_0xfa74('0x10c')](db[_0xfa74('0x7a')],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x197'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x7d')],{'as':'Intervals','foreignKey':'IntervalId','onDelete':'cascade','hooks':!![],'required':![]});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'foreignKey':_0xfa74('0x169'),'onDelete':_0xfa74('0x168')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db['MailApplication'],{'as':'MailApplications','foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x63')],{'as':_0xfa74('0x198'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db['FaxApplication'],{'as':_0xfa74('0x199'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0x7d')][_0xfa74('0x10c')](db[_0xfa74('0x52')],{'as':_0xfa74('0x19a'),'foreignKey':'IntervalId'});db[_0xfa74('0x19b')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{});db['Schedule'][_0xfa74('0x118')](db[_0xfa74('0x93')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xfa74('0x118')](db[_0xfa74('0x91')],{'foreignKey':_0xfa74('0x19c')});db[_0xfa74('0x84')][_0xfa74('0x119')](db[_0xfa74('0x19')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xfa74('0x168')});db['Tag'][_0xfa74('0x119')](db[_0xfa74('0x6c')],{'through':'cm_contact_has_tags'});db[_0xfa74('0x86')][_0xfa74('0x119')](db[_0xfa74('0x64')],{'through':_0xfa74('0x187')});db[_0xfa74('0x86')][_0xfa74('0x119')](db[_0xfa74('0x114')],{'through':_0xfa74('0x162')});db['Tag'][_0xfa74('0x119')](db[_0xfa74('0x176')],{'through':_0xfa74('0x177')});db[_0xfa74('0x86')]['belongsToMany'](db['FaxInteraction'],{'through':_0xfa74('0x16e')});db['Tag']['belongsToMany'](db[_0xfa74('0x5c')],{'through':'openchannel_interaction_has_tags'});db[_0xfa74('0x86')]['belongsToMany'](db['WhatsappInteraction'],{'through':_0xfa74('0x19d')});db['Trigger'][_0xfa74('0x10c')](db[_0xfa74('0x7b')],{'as':{'plural':_0xfa74('0x19e'),'singular':_0xfa74('0x19f')},'foreignKey':_0xfa74('0x1a0'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x1a1')]['hasMany'](db[_0xfa74('0x7b')],{'as':{'plural':'AnyConditions','singular':_0xfa74('0x1a2')},'foreignKey':_0xfa74('0x1a3'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db['Trigger']['hasMany'](db['Action'],{'as':_0xfa74('0x196'),'foreignKey':_0xfa74('0x1a4'),'onDelete':_0xfa74('0x10a'),'hooks':!![]});db[_0xfa74('0x91')][_0xfa74('0x10c')](db[_0xfa74('0x1a5')],{'as':'Fields','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x19c'),'hooks':!![]});db[_0xfa74('0x93')][_0xfa74('0x10c')](db['AnalyticFieldReport'],{'as':'Fields','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1a6')});db[_0xfa74('0x96')][_0xfa74('0x10c')](db['AnalyticFieldReport'],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1a8')});db[_0xfa74('0x1a5')][_0xfa74('0x118')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xfa74('0x1a9')][_0xfa74('0x10c')](db[_0xfa74('0x9b')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x9b')]['hasMany'](db[_0xfa74('0x1ac')],{'as':'Subjects','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x9b')]['hasMany'](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1ae'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1af')});db['SalesforceConfiguration'][_0xfa74('0x10c')](db['SalesforceField'],{'as':_0xfa74('0x1a7'),'onDelete':'cascade','foreignKey':_0xfa74('0x1b0')});db['SalesforceConfiguration']['belongsTo'](db[_0xfa74('0x1a9')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x1ac')][_0xfa74('0x10c')](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1ac')]['hasMany'](db[_0xfa74('0x1ac')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1ac')]['hasMany'](db['SalesforceField'],{'as':'Field','foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0x1ac')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':'VariableId'});db[_0xfa74('0x9d')][_0xfa74('0x10c')](db[_0xfa74('0x9f')],{'as':'Configurations','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db['SugarcrmConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1b3'),'onDelete':'cascade','foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x9f')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1ae'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x9f')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db[_0xfa74('0x9f')][_0xfa74('0x118')](db[_0xfa74('0x9d')],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db[_0xfa74('0xa1')][_0xfa74('0x10c')](db['SugarcrmField'],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xa1')]['hasMany'](db['SugarcrmField'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xa1')][_0xfa74('0x10c')](db[_0xfa74('0xa1')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xa1')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0x1b6')]['hasMany'](db[_0xfa74('0xa4')],{'as':_0xfa74('0x1aa'),'onDelete':'cascade','foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xa4')][_0xfa74('0x10c')](db['DeskField'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db[_0xfa74('0xa4')][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['DeskConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xa4')][_0xfa74('0x118')](db[_0xfa74('0x1b6')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db['DeskConfiguration'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x1b8')});db[_0xfa74('0x1b7')][_0xfa74('0x10c')](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1b7')][_0xfa74('0x10c')](db['DeskField'],{'as':'Description','foreignKey':_0xfa74('0x1af')});db['DeskField']['hasMany'](db[_0xfa74('0x1b7')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0x1b7')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':'VariableId'});db[_0xfa74('0xa6')][_0xfa74('0x10c')](db[_0xfa74('0xa8')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xa8')][_0xfa74('0x10c')](db['ZohoField'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa74('0xa8')][_0xfa74('0x10c')](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['ZohoConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xa6')],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db['ZohoField']['hasMany'](db[_0xfa74('0xaa')],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xaa')][_0xfa74('0x10c')](db['ZohoField'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xaa')]['hasMany'](db[_0xfa74('0xaa')],{'as':'Field','foreignKey':'FieldId'});db[_0xfa74('0xaa')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0x1b9')][_0xfa74('0x10c')](db[_0xfa74('0xab')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db[_0xfa74('0xab')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1b3'),'foreignKey':'SubjectId'});db[_0xfa74('0xab')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xab')][_0xfa74('0x118')](db['ZendeskAccount'],{'as':_0xfa74('0x161'),'foreignKey':'AccountId'});db[_0xfa74('0xab')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField']['hasMany'](db['ZendeskField'],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0x1ba')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1ba')][_0xfa74('0x10c')](db[_0xfa74('0x1ba')],{'as':'Field','foreignKey':'FieldId'});db['ZendeskField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db['FreshdeskAccount'][_0xfa74('0x10c')](db['FreshdeskConfiguration'],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xfa74('0x10c')](db['FreshdeskField'],{'as':_0xfa74('0x1b3'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0xfa74('0xae')][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfa74('0xae')][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['FreshdeskConfiguration'][_0xfa74('0x118')](db['FreshdeskAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db['FreshdeskConfiguration'][_0xfa74('0x119')](db['Tag'],{'through':_0xfa74('0x1bc')});db['FreshdeskField'][_0xfa74('0x10c')](db['FreshdeskField'],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':'Description','foreignKey':_0xfa74('0x1af')});db['FreshdeskField'][_0xfa74('0x10c')](db[_0xfa74('0x1bb')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db['FreshdeskField']['belongsTo'](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xb1')][_0xfa74('0x10c')](db[_0xfa74('0x1bd')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1ae'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0x1bd')][_0xfa74('0x10c')](db['VtigerField'],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db['VtigerConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xb1')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xb3')]['hasMany'](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0xb3')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xb3')][_0xfa74('0x10c')](db[_0xfa74('0xb3')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb3')][_0xfa74('0x118')](db['Variable'],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xb5')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db['ServicenowConfiguration'][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xb7')][_0xfa74('0x10c')](db['ServicenowField'],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfa74('0xb7')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb7')][_0xfa74('0x118')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xb9')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xfa74('0xb9')][_0xfa74('0x10c')](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xb9')]['hasMany'](db[_0xfa74('0xb9')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xb9')][_0xfa74('0x118')](db[_0xfa74('0x8b')],{'as':'Variable','foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xbb')]['hasMany'](db[_0xfa74('0xbd')],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':'AccountId'});db['Dynamics365Configuration'][_0xfa74('0x10c')](db['Dynamics365Field'],{'as':_0xfa74('0x1b3'),'onDelete':_0xfa74('0x10a'),'foreignKey':'SubjectId'});db[_0xfa74('0xbd')][_0xfa74('0x10c')](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1ae'),'onDelete':'cascade','foreignKey':_0xfa74('0x1af')});db['Dynamics365Configuration'][_0xfa74('0x10c')](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1a7'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1b0')});db['Dynamics365Configuration'][_0xfa74('0x118')](db['Dynamics365Account'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xbf')]['hasMany'](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1b1'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xbf')][_0xfa74('0x10c')](db['Dynamics365Field'],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xbf')]['hasMany'](db[_0xfa74('0xbf')],{'as':_0xfa74('0x1b4'),'foreignKey':_0xfa74('0x1b0')});db[_0xfa74('0xbf')]['belongsTo'](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db[_0xfa74('0xc0')][_0xfa74('0x10c')](db['FreshsalesConfiguration'],{'as':_0xfa74('0x1aa'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1ab')});db[_0xfa74('0xc2')]['hasMany'](db['FreshsalesField'],{'as':_0xfa74('0x1b3'),'foreignKey':_0xfa74('0x1ad')});db[_0xfa74('0xc2')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfa74('0xc2')]['hasMany'](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1a7'),'foreignKey':_0xfa74('0x1b0')});db['FreshsalesConfiguration'][_0xfa74('0x118')](db[_0xfa74('0xc0')],{'as':'Account','foreignKey':_0xfa74('0x1ab')});db['FreshsalesField'][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b1'),'foreignKey':'SubjectId'});db[_0xfa74('0xc3')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b2'),'foreignKey':_0xfa74('0x1af')});db[_0xfa74('0xc3')][_0xfa74('0x10c')](db[_0xfa74('0xc3')],{'as':_0xfa74('0x1b4'),'foreignKey':'FieldId'});db[_0xfa74('0xc3')]['belongsTo'](db[_0xfa74('0x8b')],{'as':_0xfa74('0x8b'),'foreignKey':_0xfa74('0x1b5')});db['ChatQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x12b')],{});db['ChatQueueReport'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xc6')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db['ChatQueueReport'][_0xfa74('0x118')](db['ChatInteraction'],{});db[_0xfa74('0xc6')][_0xfa74('0x118')](db[_0xfa74('0x182')],{});db[_0xfa74('0xc6')]['belongsTo'](db[_0xfa74('0x10')],{});db['ChatQueueReport']['belongsTo'](db[_0xfa74('0x66')],{});db['ChatInternalMessage'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1be')});db['ChatInternalMessage'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x10a'),'foreignKey':'ToId'});db[_0xfa74('0xcb')][_0xfa74('0x10c')](db[_0xfa74('0xc9')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xfa74('0xcb')][_0xfa74('0x10c')](db[_0xfa74('0xc8')],{'foreignKey':_0xfa74('0x1bf'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db[_0xfa74('0x134')],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0x1c0')]['belongsTo'](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':'ContactId'});db['SmsQueueReport'][_0xfa74('0x118')](db[_0xfa74('0x176')],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db['SmsMessage'],{});db[_0xfa74('0x1c0')][_0xfa74('0x118')](db['User'],{});db[_0xfa74('0x1c0')]['belongsTo'](db[_0xfa74('0x56')],{});db[_0xfa74('0xd1')][_0xfa74('0x10c')](db[_0xfa74('0xcb')],{'foreignKey':_0xfa74('0x1c1')});db[_0xfa74('0xd1')][_0xfa74('0x10c')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xfa74('0xd1')]['hasMany'](db[_0xfa74('0xc8')],{'foreignKey':_0xfa74('0x1c1')});db[_0xfa74('0xd4')]['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x136')});db['Team']['belongsToMany'](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x11e')});db[_0xfa74('0x15e')][_0xfa74('0x119')](db['VoiceQueue'],{'through':_0xfa74('0x103'),'as':_0xfa74('0x125')});db[_0xfa74('0x15e')]['belongsToMany'](db[_0xfa74('0x3b')],{'through':_0xfa74('0x15f'),'as':_0xfa74('0x1c2')});db[_0xfa74('0x15e')]['belongsToMany'](db[_0xfa74('0x66')],{'through':'team_has_chat_queues','as':_0xfa74('0x1c3')});db['Team']['belongsToMany'](db[_0xfa74('0x4d')],{'through':_0xfa74('0x174'),'as':_0xfa74('0x1c4')});db[_0xfa74('0x15e')][_0xfa74('0x119')](db[_0xfa74('0x56')],{'through':_0xfa74('0x17a'),'as':_0xfa74('0x1c5')});db['Team'][_0xfa74('0x119')](db['OpenchannelQueue'],{'through':_0xfa74('0x1c6'),'as':_0xfa74('0x128')});db['Team'][_0xfa74('0x119')](db[_0xfa74('0xff')],{'through':_0xfa74('0x1c7'),'as':'WhatsappQueues'});db[_0xfa74('0x15e')][_0xfa74('0x119')](db[_0xfa74('0xeb')],{'through':'TeamVoicePrefix','as':_0xfa74('0x126')});db[_0xfa74('0xdd')]['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xfa74('0x18f')});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':_0xfa74('0x10f'),'foreignKey':'CampaignId'});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':'CampaignId'});db[_0xfa74('0xdd')][_0xfa74('0x10c')](db[_0xfa74('0x13e')],{'as':_0xfa74('0x13f'),'foreignKey':_0xfa74('0x18f')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x141'),'foreignKey':_0xfa74('0x1c8')});db['Campaign'][_0xfa74('0x118')](db[_0xfa74('0x141')],{'as':_0xfa74('0x142'),'foreignKey':_0xfa74('0x1c9')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'as':_0xfa74('0x7d'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0xdd')][_0xfa74('0x118')](db[_0xfa74('0xd4')],{'as':_0xfa74('0xd4'),'foreignKey':_0xfa74('0x1ca')});db[_0xfa74('0xdd')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xfa74('0xdd')][_0xfa74('0x119')](db[_0xfa74('0xe9')],{'as':_0xfa74('0x147'),'through':_0xfa74('0x1cb')});db[_0xfa74('0x172')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0xfa74('0x166'),'foreignKey':_0xfa74('0x167')});db['MailTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x3f')],{});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x114')],{});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'foreignKey':_0xfa74('0x1cc'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'FromUserId','as':_0xfa74('0x1ce')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db['MailTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x3b')],{'foreignKey':_0xfa74('0x1d0'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xe2')][_0xfa74('0x118')](db[_0xfa74('0x12f')],{'foreignKey':_0xfa74('0x1d2'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db[_0xfa74('0x182')],{});db[_0xfa74('0xe4')][_0xfa74('0x118')](db[_0xfa74('0x64')],{});db[_0xfa74('0xe4')]['belongsTo'](db[_0xfa74('0x12b')],{'foreignKey':_0xfa74('0x1d4'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfa74('0xe4')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':_0xfa74('0x1d5'),'as':'ToAgent'});db['ChatTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x66')],{'foreignKey':_0xfa74('0x1d6'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xe4')][_0xfa74('0x118')](db['ChatWebsite'],{'foreignKey':_0xfa74('0x1d7'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe6')]['belongsTo'](db[_0xfa74('0x4b')],{});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x4a')],{});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x46')],{'foreignKey':_0xfa74('0x1d8'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe6')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe6')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db['FaxTransferReport'][_0xfa74('0x118')](db[_0xfa74('0x4d')],{'foreignKey':'ToFaxQueueId','as':_0xfa74('0x1d1')});db[_0xfa74('0xe6')]['belongsTo'](db[_0xfa74('0x46')],{'foreignKey':_0xfa74('0x1da'),'as':'ToAccount'});db[_0xfa74('0xe7')]['belongsTo'](db[_0xfa74('0x5e')],{});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x5c')],{});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x58')],{'foreignKey':_0xfa74('0x1db'),'as':'FromAccount'});db[_0xfa74('0xe7')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe7')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':_0xfa74('0x1d5'),'as':_0xfa74('0x1cf')});db[_0xfa74('0xe7')][_0xfa74('0x118')](db[_0xfa74('0x5f')],{'foreignKey':_0xfa74('0x1dc'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0xfa74('0x118')](db['OpenchannelAccount'],{'foreignKey':_0xfa74('0x1dd'),'as':_0xfa74('0x1d3')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x54')],{});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x176')],{});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'foreignKey':_0xfa74('0x1de'),'as':_0xfa74('0x1cd')});db[_0xfa74('0xe8')][_0xfa74('0x118')](db['User'],{'foreignKey':_0xfa74('0x1d9'),'as':_0xfa74('0x1ce')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x10')],{'foreignKey':'ToUserId','as':_0xfa74('0x1cf')});db[_0xfa74('0xe8')]['belongsTo'](db[_0xfa74('0x56')],{'foreignKey':_0xfa74('0x1df'),'as':'ToQueue'});db[_0xfa74('0xe8')][_0xfa74('0x118')](db[_0xfa74('0x134')],{'foreignKey':'ToSmsAccountId','as':_0xfa74('0x1d3')});db['CmList'][_0xfa74('0x10c')](db['Disposition'],{'as':_0xfa74('0x156'),'foreignKey':_0xfa74('0x15a'),'onDelete':'cascade'});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db[_0xfa74('0x73')],{'as':_0xfa74('0x1e0'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['CmContact'],{'as':'Contacts','onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x15a')});db['CmList'][_0xfa74('0x10c')](db[_0xfa74('0x6f')],{'as':'HopperFinals','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xe9')][_0xfa74('0x10c')](db['ReportAgentPreview'],{'as':_0xfa74('0x72'),'foreignKey':_0xfa74('0x15a')});db['CmList'][_0xfa74('0x119')](db['VoiceQueue'],{'as':_0xfa74('0x1e1'),'through':'voice_queues_has_cm_lists'});db['CmList']['belongsToMany'](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x11d')});db[_0xfa74('0xeb')][_0xfa74('0x10c')](db[_0xfa74('0x17')],{'as':_0xfa74('0x10e'),'onDelete':'cascade'});db[_0xfa74('0xeb')][_0xfa74('0x119')](db['User'],{'as':_0xfa74('0x145'),'through':_0xfa74('0x107')});db[_0xfa74('0xeb')]['belongsToMany'](db[_0xfa74('0x15e')],{'through':_0xfa74('0x105'),'as':_0xfa74('0x146')});db[_0xfa74('0xed')][_0xfa74('0x10c')](db[_0xfa74('0x10')],{'as':'Users','foreignKey':_0xfa74('0x1e2')});db['UserProfile'][_0xfa74('0x10c')](db[_0xfa74('0xef')],{'as':_0xfa74('0x1e3'),'foreignKey':'userProfileId','onDelete':_0xfa74('0x10a')});db['UserProfileSection'][_0xfa74('0x10c')](db[_0xfa74('0xf1')],{'as':'Resources','foreignKey':_0xfa74('0x1e4'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xfa74('0x1e5'),'onDelete':_0xfa74('0x10a')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0x79')],{'as':'Answers','foreignKey':'WhatsappAccountId'});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db['WhatsappMessage'],{'as':_0xfa74('0x149'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0xf9')],{'as':'Interactions'});db[_0xfa74('0xf5')][_0xfa74('0x10c')](db[_0xfa74('0xf7')],{'as':'Applications'});db[_0xfa74('0xf5')][_0xfa74('0x118')](db['CmList'],{'as':_0xfa74('0x159'),'foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xf5')][_0xfa74('0x118')](db['Pause'],{'as':_0xfa74('0x15c'),'foreignKey':_0xfa74('0x15d')});db['WhatsappAccount'][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x145'),'through':_0xfa74('0x1e6')});db['WhatsappApplication'][_0xfa74('0x118')](db[_0xfa74('0x10')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0xff')],{'onDelete':'restrict'});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'onDelete':_0xfa74('0x168')});db[_0xfa74('0xf7')][_0xfa74('0x118')](db[_0xfa74('0x7d')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x169')});db[_0xfa74('0xf7')]['belongsTo'](db[_0xfa74('0x86')],{'onDelete':_0xfa74('0x168'),'foreignKey':_0xfa74('0x16a')});db['WhatsappInteraction'][_0xfa74('0x10c')](db[_0xfa74('0x1e7')],{'as':_0xfa74('0x149'),'onDelete':_0xfa74('0x10a'),'foreignKey':_0xfa74('0x1e8')});db[_0xfa74('0xf9')][_0xfa74('0x118')](db['WhatsappAccount'],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xf9')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'as':_0xfa74('0x150'),'foreignKey':_0xfa74('0x151')});db[_0xfa74('0xf9')]['belongsTo'](db[_0xfa74('0x10')],{'as':_0xfa74('0x17f'),'foreignKey':_0xfa74('0x10b')});db['WhatsappInteraction'][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':_0xfa74('0x19d'),'as':_0xfa74('0x163')});db[_0xfa74('0xf9')][_0xfa74('0x119')](db[_0xfa74('0x86')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db[_0xfa74('0xf9')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':_0xfa74('0x170'),'through':_0xfa74('0x124'),'foreignKey':_0xfa74('0x1e8')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0x10')],{'as':_0xfa74('0x10')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0x6c')],{'onDelete':'cascade','as':_0xfa74('0x150')});db[_0xfa74('0x1e7')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{'onDelete':_0xfa74('0x10a'),'as':_0xfa74('0x164'),'foreignKey':_0xfa74('0x1e8')});db['WhatsappMessage']['belongsTo'](db[_0xfa74('0xf5')],{'as':_0xfa74('0x161'),'foreignKey':_0xfa74('0x1e5')});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{});db['WhatsappQueueReport'][_0xfa74('0x118')](db[_0xfa74('0xe9')],{'as':'List','foreignKey':_0xfa74('0x15a')});db[_0xfa74('0xfc')]['belongsTo'](db[_0xfa74('0x6c')],{'as':'Contact','foreignKey':_0xfa74('0x151')});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db['WhatsappQueue'],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0x1e7')],{});db[_0xfa74('0xfc')][_0xfa74('0x118')](db[_0xfa74('0x10')],{});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0x1e7')],{});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xf9')],{});db['WhatsappTransferReport'][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'foreignKey':'FromWhatsappAccountId','as':_0xfa74('0x1cd')});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xf5')],{'foreignKey':_0xfa74('0x1e9'),'as':'ToAccount'});db[_0xfa74('0xfe')][_0xfa74('0x118')](db[_0xfa74('0xff')],{'foreignKey':_0xfa74('0x1ea'),'as':_0xfa74('0x1d1')});db[_0xfa74('0xfe')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0xfa74('0x1ce')});db[_0xfa74('0xfe')]['belongsTo'](db['User'],{'foreignKey':_0xfa74('0x1d5'),'as':_0xfa74('0x1cf')});db[_0xfa74('0xff')][_0xfa74('0x119')](db[_0xfa74('0x10')],{'as':'Agents','through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue']['belongsToMany'](db[_0xfa74('0x15e')],{'through':_0xfa74('0x1c7'),'as':_0xfa74('0x146')});module[_0xfa74('0x1eb')]={'db':db,'dbH':dbH}; \ No newline at end of file +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 diff --git a/server/routes.js b/server/routes.js index 1dc8894..6c8f689 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x098a=['/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxInteraction','./api/faxMessage','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelMessage','./api/openchannelQueue','./api/chatWebsite','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','./api/team','/api/license','./api/campaign','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','/www','root','/demo','join','/snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','newPassword','apiKey','lastName','street','phone','mobile','fax','clientId','clientSecret','code','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','privateKey','accesskeyid','secretaccesskey','key','pass','accountSid','localstationid','dsn','registry','isPlainObject','isArray','isString','replace','@@{','lodash','path','express-winston','util','./config/environment','./config/logger','api','./safe-template','safeTemplate','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','method','headers','x-forwarded-for','url','statusCode','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','responseTime','device','other','agent_id','agent_name','test','/api/users','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus'];(function(_0x56d72a,_0x24622a){var _0x53e1e1=function(_0xf78243){while(--_0xf78243){_0x56d72a['push'](_0x56d72a['shift']());}};_0x53e1e1(++_0x24622a);}(_0x098a,0x10d));var _0xa098=function(_0x1356c1,_0x44c379){_0x1356c1=_0x1356c1-0x0;var _0x6ab8f8=_0x098a[_0x1356c1];return _0x6ab8f8;};'use strict';var _=require(_0xa098('0x0'));var path=require(_0xa098('0x1'));var express=require('express');var ewinston=require(_0xa098('0x2'));var util=require(_0xa098('0x3'));var errors=require('./errors');var config=require(_0xa098('0x4'));var logger=require(_0xa098('0x5'))(_0xa098('0x6'));var authLogger=require('./config/logger')('auth');var safeTemplate=require(_0xa098('0x7'))[_0xa098('0x8')];exports['default']=function(_0x43d663){_0x43d663[_0xa098('0x9')](ewinston[_0xa098('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x362295,_0x162757){var _0x58b11b=_0xa098('0xb');if(!_[_0xa098('0xc')](_0x362295['body'])){_0x58b11b+=_0xa098('0xd');var _0xd50679=_0x362295[_0xa098('0xe')];maskSensitiveData(_0xd50679);}return safeTemplate(util[_0xa098('0xf')](_0x58b11b,_0x362295[_0xa098('0x10')],_0x362295[_0xa098('0x11')][_0xa098('0x12')]?_0x362295[_0xa098('0x11')][_0xa098('0x12')]:_0x362295['connection']['remoteAddress']||_0x362295['ip'],_0x362295[_0xa098('0x13')],_0x162757[_0xa098('0x14')],_0x162757['responseTime'],_0x362295[_0xa098('0x15')]?_0x362295[_0xa098('0x15')]['id']:null,_0x362295[_0xa098('0x15')]?_0x362295[_0xa098('0x15')][_0xa098('0x16')]:null,_0x362295['user']?_0x362295['user'][_0xa098('0x17')]:null,_0xd50679?util[_0xa098('0x18')](_0xd50679,![],null):''));}}));_0x43d663[_0xa098('0x9')](ewinston[_0xa098('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x30adfc,_0x5ecd24){var _0x22e305=_0xa098('0x19');if(_0x30adfc['body']&&_0x30adfc[_0xa098('0xe')]['device']&&_0x30adfc[_0xa098('0xe')]['agent_id']){_0x22e305=_0xa098('0x1a');}return util[_0xa098('0xf')](_0x22e305,_0x30adfc[_0xa098('0x10')],_0x30adfc[_0xa098('0x11')][_0xa098('0x12')]?_0x30adfc[_0xa098('0x11')][_0xa098('0x12')]:_0x30adfc[_0xa098('0x1b')]['remoteAddress']||_0x30adfc['ip'],_0x30adfc['url'],_0x5ecd24['statusCode'],_0x5ecd24[_0xa098('0x1c')],_0x30adfc[_0xa098('0x15')]?_0x30adfc[_0xa098('0x15')]['id']:null,_0x30adfc[_0xa098('0x15')]?_0x30adfc[_0xa098('0x15')][_0xa098('0x16')]:null,_0x30adfc[_0xa098('0x15')]?_0x30adfc[_0xa098('0x15')][_0xa098('0x17')]:null,_0x30adfc[_0xa098('0xe')]&&_0x30adfc['body'][_0xa098('0x1d')]?_0x30adfc[_0xa098('0xe')][_0xa098('0x1d')]:_0xa098('0x1e'),_0x30adfc[_0xa098('0xe')]&&_0x30adfc[_0xa098('0xe')][_0xa098('0x1f')]?_0x30adfc[_0xa098('0xe')][_0xa098('0x1f')]:'',_0x30adfc['body']&&_0x30adfc[_0xa098('0xe')][_0xa098('0x20')]?_0x30adfc['body'][_0xa098('0x20')]:'');},'ignoreRoute':function(_0x18e283){var _0x42b184=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x42b184[_0xa098('0x21')](_0x18e283[_0xa098('0x13')]);}}));_0x43d663[_0xa098('0x9')](_0xa098('0x22'),require('./api/user'));_0x43d663[_0xa098('0x9')]('/api/voice/chanspy',require(_0xa098('0x23')));_0x43d663[_0xa098('0x9')](_0xa098('0x24'),require('./api/voiceContext'));_0x43d663['use'](_0xa098('0x25'),require(_0xa098('0x26')));_0x43d663[_0xa098('0x9')](_0xa098('0x27'),require('./api/voiceMusicOnHold'));_0x43d663[_0xa098('0x9')](_0xa098('0x28'),require('./api/voiceQueue'));_0x43d663[_0xa098('0x9')]('/api/voice/recordings',require(_0xa098('0x29')));_0x43d663[_0xa098('0x9')](_0xa098('0x2a'),require(_0xa098('0x2b')));_0x43d663['use']('/api/voice/mails',require(_0xa098('0x2c')));_0x43d663[_0xa098('0x9')](_0xa098('0x2d'),require('./api/voiceMailMessage'));_0x43d663[_0xa098('0x9')](_0xa098('0x2e'),require(_0xa098('0x2f')));_0x43d663[_0xa098('0x9')](_0xa098('0x30'),require(_0xa098('0x31')));_0x43d663[_0xa098('0x9')]('/api/voice/agents/reports',require(_0xa098('0x32')));_0x43d663[_0xa098('0x9')]('/api/voice/queues/reports',require(_0xa098('0x33')));_0x43d663[_0xa098('0x9')]('/api/members/reports',require(_0xa098('0x34')));_0x43d663[_0xa098('0x9')](_0xa098('0x35'),require('./api/trunk'));_0x43d663[_0xa098('0x9')]('/api/voice/transfers/reports',require(_0xa098('0x36')));_0x43d663[_0xa098('0x9')](_0xa098('0x37'),require(_0xa098('0x38')));_0x43d663['use'](_0xa098('0x39'),require(_0xa098('0x3a')));_0x43d663['use'](_0xa098('0x3b'),require(_0xa098('0x3c')));_0x43d663[_0xa098('0x9')](_0xa098('0x3d'),require(_0xa098('0x3e')));_0x43d663[_0xa098('0x9')](_0xa098('0x3f'),require(_0xa098('0x40')));_0x43d663[_0xa098('0x9')](_0xa098('0x41'),require(_0xa098('0x42')));_0x43d663[_0xa098('0x9')](_0xa098('0x43'),require(_0xa098('0x44')));_0x43d663[_0xa098('0x9')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x43d663['use'](_0xa098('0x45'),require(_0xa098('0x46')));_0x43d663[_0xa098('0x9')]('/api/dashboards/items',require(_0xa098('0x47')));_0x43d663[_0xa098('0x9')](_0xa098('0x48'),require('./api/faxAccount'));_0x43d663[_0xa098('0x9')](_0xa098('0x49'),require('./api/faxApplication'));_0x43d663['use']('/api/fax/interactions',require(_0xa098('0x4a')));_0x43d663[_0xa098('0x9')]('/api/fax/messages',require(_0xa098('0x4b')));_0x43d663[_0xa098('0x9')]('/api/fax/queues',require(_0xa098('0x4c')));_0x43d663[_0xa098('0x9')](_0xa098('0x4d'),require(_0xa098('0x4e')));_0x43d663[_0xa098('0x9')]('/api/sms/accounts',require('./api/smsAccount'));_0x43d663[_0xa098('0x9')](_0xa098('0x4f'),require(_0xa098('0x50')));_0x43d663[_0xa098('0x9')](_0xa098('0x51'),require(_0xa098('0x52')));_0x43d663[_0xa098('0x9')](_0xa098('0x53'),require(_0xa098('0x54')));_0x43d663[_0xa098('0x9')]('/api/sms/queues',require(_0xa098('0x55')));_0x43d663['use'](_0xa098('0x56'),require(_0xa098('0x57')));_0x43d663['use'](_0xa098('0x58'),require(_0xa098('0x59')));_0x43d663[_0xa098('0x9')](_0xa098('0x5a'),require('./api/openchannelInteraction'));_0x43d663[_0xa098('0x9')]('/api/openchannel/messages',require(_0xa098('0x5b')));_0x43d663[_0xa098('0x9')]('/api/openchannel/queues',require(_0xa098('0x5c')));_0x43d663[_0xa098('0x9')]('/api/chat/websites',require(_0xa098('0x5d')));_0x43d663[_0xa098('0x9')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x43d663['use']('/api/chat/applications',require(_0xa098('0x5e')));_0x43d663[_0xa098('0x9')](_0xa098('0x5f'),require(_0xa098('0x60')));_0x43d663[_0xa098('0x9')](_0xa098('0x61'),require(_0xa098('0x62')));_0x43d663[_0xa098('0x9')](_0xa098('0x63'),require(_0xa098('0x64')));_0x43d663[_0xa098('0x9')](_0xa098('0x65'),require(_0xa098('0x66')));_0x43d663[_0xa098('0x9')](_0xa098('0x67'),require(_0xa098('0x68')));_0x43d663[_0xa098('0x9')](_0xa098('0x69'),require(_0xa098('0x6a')));_0x43d663[_0xa098('0x9')](_0xa098('0x6b'),require(_0xa098('0x6c')));_0x43d663[_0xa098('0x9')](_0xa098('0x6d'),require(_0xa098('0x6e')));_0x43d663[_0xa098('0x9')]('/api/cm/hopper',require('./api/cmHopper'));_0x43d663[_0xa098('0x9')](_0xa098('0x6f'),require(_0xa098('0x70')));_0x43d663[_0xa098('0x9')](_0xa098('0x71'),require(_0xa098('0x72')));_0x43d663[_0xa098('0x9')](_0xa098('0x73'),require(_0xa098('0x74')));_0x43d663['use'](_0xa098('0x75'),require('./api/cmCustomField'));_0x43d663[_0xa098('0x9')]('/api/actions',require(_0xa098('0x76')));_0x43d663[_0xa098('0x9')]('/api/automations',require(_0xa098('0x77')));_0x43d663[_0xa098('0x9')](_0xa098('0x78'),require(_0xa098('0x79')));_0x43d663[_0xa098('0x9')]('/api/dispositions',require(_0xa098('0x7a')));_0x43d663[_0xa098('0x9')](_0xa098('0x7b'),require('./api/condition'));_0x43d663[_0xa098('0x9')](_0xa098('0x7c'),require('./api/interval'));_0x43d663['use'](_0xa098('0x7d'),require(_0xa098('0x7e')));_0x43d663[_0xa098('0x9')](_0xa098('0x7f'),require(_0xa098('0x80')));_0x43d663[_0xa098('0x9')]('/api/voiceQueuesLog',require(_0xa098('0x81')));_0x43d663[_0xa098('0x9')](_0xa098('0x82'),require(_0xa098('0x83')));_0x43d663[_0xa098('0x9')](_0xa098('0x84'),require(_0xa098('0x85')));_0x43d663['use'](_0xa098('0x86'),require(_0xa098('0x87')));_0x43d663[_0xa098('0x9')](_0xa098('0x88'),require(_0xa098('0x89')));_0x43d663[_0xa098('0x9')](_0xa098('0x8a'),require(_0xa098('0x8b')));_0x43d663['use'](_0xa098('0x8c'),require('./api/variable'));_0x43d663[_0xa098('0x9')](_0xa098('0x8d'),require(_0xa098('0x8e')));_0x43d663[_0xa098('0x9')](_0xa098('0x8f'),require(_0xa098('0x90')));_0x43d663['use']('/api/analytics/custom_reports',require(_0xa098('0x91')));_0x43d663[_0xa098('0x9')](_0xa098('0x92'),require('./api/analyticDefaultReport'));_0x43d663[_0xa098('0x9')](_0xa098('0x93'),require(_0xa098('0x94')));_0x43d663[_0xa098('0x9')](_0xa098('0x95'),require(_0xa098('0x96')));_0x43d663[_0xa098('0x9')](_0xa098('0x97'),require('./api/analyticFieldReport'));_0x43d663[_0xa098('0x9')](_0xa098('0x98'),require(_0xa098('0x99')));_0x43d663[_0xa098('0x9')](_0xa098('0x9a'),require(_0xa098('0x9b')));_0x43d663[_0xa098('0x9')](_0xa098('0x9c'),require(_0xa098('0x9d')));_0x43d663['use'](_0xa098('0x9e'),require('./api/intSalesforceField'));_0x43d663[_0xa098('0x9')](_0xa098('0x9f'),require(_0xa098('0xa0')));_0x43d663[_0xa098('0x9')](_0xa098('0xa1'),require(_0xa098('0xa2')));_0x43d663[_0xa098('0x9')](_0xa098('0xa3'),require('./api/intSugarcrmField'));_0x43d663[_0xa098('0x9')](_0xa098('0xa4'),require(_0xa098('0xa5')));_0x43d663['use'](_0xa098('0xa6'),require('./api/intDeskConfiguration'));_0x43d663[_0xa098('0x9')]('/api/integrations/desk/fields',require(_0xa098('0xa7')));_0x43d663['use'](_0xa098('0xa8'),require('./api/intZohoAccount'));_0x43d663[_0xa098('0x9')](_0xa098('0xa9'),require(_0xa098('0xaa')));_0x43d663['use']('/api/integrations/zoho/fields',require(_0xa098('0xab')));_0x43d663[_0xa098('0x9')](_0xa098('0xac'),require(_0xa098('0xad')));_0x43d663['use'](_0xa098('0xae'),require(_0xa098('0xaf')));_0x43d663[_0xa098('0x9')](_0xa098('0xb0'),require(_0xa098('0xb1')));_0x43d663[_0xa098('0x9')](_0xa098('0xb2'),require(_0xa098('0xb3')));_0x43d663[_0xa098('0x9')]('/api/integrations/freshdesk/configurations',require(_0xa098('0xb4')));_0x43d663[_0xa098('0x9')](_0xa098('0xb5'),require(_0xa098('0xb6')));_0x43d663[_0xa098('0x9')](_0xa098('0xb7'),require(_0xa098('0xb8')));_0x43d663['use'](_0xa098('0xb9'),require('./api/intVtigerConfiguration'));_0x43d663['use'](_0xa098('0xba'),require(_0xa098('0xbb')));_0x43d663[_0xa098('0x9')](_0xa098('0xbc'),require('./api/intServicenowAccount'));_0x43d663['use'](_0xa098('0xbd'),require(_0xa098('0xbe')));_0x43d663[_0xa098('0x9')](_0xa098('0xbf'),require(_0xa098('0xc0')));_0x43d663['use'](_0xa098('0xc1'),require(_0xa098('0xc2')));_0x43d663[_0xa098('0x9')](_0xa098('0xc3'),require(_0xa098('0xc4')));_0x43d663['use'](_0xa098('0xc5'),require(_0xa098('0xc6')));_0x43d663[_0xa098('0x9')](_0xa098('0xc7'),require(_0xa098('0xc8')));_0x43d663[_0xa098('0x9')](_0xa098('0xc9'),require(_0xa098('0xca')));_0x43d663[_0xa098('0x9')](_0xa098('0xcb'),require(_0xa098('0xcc')));_0x43d663[_0xa098('0x9')](_0xa098('0xcd'),require(_0xa098('0xce')));_0x43d663[_0xa098('0x9')]('/api/chat/reports/queue',require(_0xa098('0xcf')));_0x43d663['use'](_0xa098('0xd0'),require(_0xa098('0xd1')));_0x43d663['use'](_0xa098('0xd2'),require(_0xa098('0xd3')));_0x43d663[_0xa098('0x9')](_0xa098('0xd4'),require(_0xa098('0xd5')));_0x43d663[_0xa098('0x9')](_0xa098('0xd6'),require(_0xa098('0xd7')));_0x43d663[_0xa098('0x9')](_0xa098('0xd8'),require(_0xa098('0xd9')));_0x43d663[_0xa098('0x9')](_0xa098('0xda'),require(_0xa098('0xdb')));_0x43d663['use'](_0xa098('0xdc'),require(_0xa098('0xdd')));_0x43d663[_0xa098('0x9')](_0xa098('0xde'),require(_0xa098('0xdf')));_0x43d663[_0xa098('0x9')](_0xa098('0xe0'),require(_0xa098('0xe1')));_0x43d663[_0xa098('0x9')](_0xa098('0xe2'),require('./api/squareOdbc'));_0x43d663['use']('/api/square/projects',require(_0xa098('0xe3')));_0x43d663[_0xa098('0x9')](_0xa098('0xe4'),require('./api/squareRecording'));_0x43d663[_0xa098('0x9')](_0xa098('0xe5'),require(_0xa098('0xe6')));_0x43d663[_0xa098('0x9')]('/api/teams',require(_0xa098('0xe7')));_0x43d663[_0xa098('0x9')](_0xa098('0xe8'),require('./api/license'));_0x43d663[_0xa098('0x9')]('/api/campaigns',require(_0xa098('0xe9')));_0x43d663[_0xa098('0x9')]('/api/migrations',require(_0xa098('0xea')));_0x43d663[_0xa098('0x9')](_0xa098('0xeb'),require(_0xa098('0xec')));_0x43d663[_0xa098('0x9')](_0xa098('0xed'),require(_0xa098('0xee')));_0x43d663[_0xa098('0x9')](_0xa098('0xef'),require('./api/mailTransferReport'));_0x43d663[_0xa098('0x9')](_0xa098('0xf0'),require(_0xa098('0xf1')));_0x43d663['use'](_0xa098('0xf2'),require(_0xa098('0xf3')));_0x43d663[_0xa098('0x9')](_0xa098('0xf4'),require(_0xa098('0xf5')));_0x43d663[_0xa098('0x9')](_0xa098('0xf6'),require(_0xa098('0xf7')));_0x43d663['use'](_0xa098('0xf8'),require(_0xa098('0xf9')));_0x43d663[_0xa098('0x9')](_0xa098('0xfa'),require('./api/voicePrefix'));_0x43d663[_0xa098('0x9')](_0xa098('0xfb'),require('./api/userProfile'));_0x43d663[_0xa098('0x9')]('/api/userProfile/sections',require(_0xa098('0xfc')));_0x43d663[_0xa098('0x9')](_0xa098('0xfd'),require(_0xa098('0xfe')));_0x43d663['use'](_0xa098('0xff'),require(_0xa098('0x100')));_0x43d663[_0xa098('0x9')](_0xa098('0x101'),require(_0xa098('0x102')));_0x43d663[_0xa098('0x9')]('/api/whatsapp/applications',require(_0xa098('0x103')));_0x43d663['use']('/api/whatsapp/interactions',require(_0xa098('0x104')));_0x43d663[_0xa098('0x9')](_0xa098('0x105'),require(_0xa098('0x106')));_0x43d663[_0xa098('0x9')](_0xa098('0x107'),require('./api/whatsappQueueReport'));_0x43d663[_0xa098('0x9')](_0xa098('0x108'),require(_0xa098('0x109')));_0x43d663[_0xa098('0x9')]('/api/whatsapp/queues',require(_0xa098('0x10a')));_0x43d663[_0xa098('0x9')](_0xa098('0x10b'),require(_0xa098('0x10c')));_0x43d663[_0xa098('0x9')](_0xa098('0x10d'),require(_0xa098('0x10e')));_0x43d663[_0xa098('0x9')]('/api/auth/local',require('./api/authLocal'));_0x43d663['use']('/api/auth/google',require('./api/authGoogle'));_0x43d663[_0xa098('0x9')](_0xa098('0x10f'),require('./api/jira'));_0x43d663['use'](_0xa098('0x110'),require(_0xa098('0x111')));_0x43d663['use']('/api/version',require(_0xa098('0x112')));_0x43d663[_0xa098('0x9')](_0xa098('0x113'),require(_0xa098('0x114')));_0x43d663[_0xa098('0x9')](_0xa098('0x115'),require(_0xa098('0x116')));_0x43d663[_0xa098('0x9')]('/api/webbar',require('./api/webbar'));_0x43d663[_0xa098('0x9')](_0xa098('0x117'),express[_0xa098('0x118')](path['join'](config['root'],_0xa098('0x117'))));_0x43d663[_0xa098('0x9')](_0xa098('0x119'),express[_0xa098('0x118')](path['join'](config[_0xa098('0x11a')],_0xa098('0x119'))));_0x43d663[_0xa098('0x9')](_0xa098('0x11b'),express['static'](path[_0xa098('0x11c')](config[_0xa098('0x11a')],_0xa098('0x11b'))));_0x43d663[_0xa098('0x9')](_0xa098('0x11d'),express[_0xa098('0x118')](path[_0xa098('0x11c')](config[_0xa098('0x11a')],'snippet',_0xa098('0x11e'))));_0x43d663[_0xa098('0x9')](_0xa098('0x11f'),express[_0xa098('0x118')](path[_0xa098('0x11c')](config['root'],_0xa098('0x120'))));_0x43d663[_0xa098('0x121')](_0xa098('0x122'))[_0xa098('0x123')](errors[0x194]);_0x43d663[_0xa098('0x121')]('/*')[_0xa098('0x123')](function(_0x58afb8,_0x368452){_0x368452['sendFile'](path[_0xa098('0x124')](_0x43d663[_0xa098('0x123')](_0xa098('0x125'))+_0xa098('0x126')));});};var sensitiveFields=[_0xa098('0x127'),'password',_0xa098('0x128'),_0xa098('0x129'),'firstName',_0xa098('0x12a'),_0xa098('0x12b'),_0xa098('0x12c'),_0xa098('0x12d'),_0xa098('0x12e'),'email',_0xa098('0x12f'),_0xa098('0x130'),'securityToken',_0xa098('0x131'),'accessKey',_0xa098('0x132'),_0xa098('0x133'),_0xa098('0x134'),_0xa098('0x135'),_0xa098('0x136'),_0xa098('0x137'),_0xa098('0x138'),_0xa098('0x139'),_0xa098('0x13a'),_0xa098('0x13b'),_0xa098('0x13c'),_0xa098('0x13d'),'vidaooApiKey','clientEmail',_0xa098('0x13e'),_0xa098('0x13f'),_0xa098('0x140'),_0xa098('0x141'),_0xa098('0x15'),_0xa098('0x142'),_0xa098('0x143'),_0xa098('0x144'),_0xa098('0x145'),'secret',_0xa098('0x146'),'oldPassword'];function maskSensitiveData(_0x1d190b){var _0x47f091=/(?!^)[\s\S](?!$)/g;if(!_[_0xa098('0x147')](_0x1d190b))return;for(var _0x1fbf72 in _0x1d190b){if(_[_0xa098('0x148')](_0x1d190b[_0x1fbf72])){for(var _0x4505b6=0x0;_0x4505b6<_0x1d190b[_0x1fbf72]['length'];_0x4505b6++){maskSensitiveData(_0x1d190b[_0x1fbf72][_0x4505b6]);}}else if(_['isPlainObject'](_0x1d190b[_0x1fbf72])){maskSensitiveData(_0x1d190b[_0x1fbf72]);}else if(_[_0xa098('0x149')](_0x1d190b[_0x1fbf72])){_0x1d190b[_0x1fbf72]=_0x1d190b[_0x1fbf72][_0xa098('0x14a')](/{{{/g,_0xa098('0x14b'))[_0xa098('0x14a')](/}}}/g,'}@@')[_0xa098('0x14a')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x1fbf72)){_0x1d190b[_0x1fbf72]=_0x1d190b[_0x1fbf72][_0xa098('0x14a')](_0x47f091,'*');}}}} \ No newline at end of file +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 diff --git a/server/rpc/index.js b/server/rpc/index.js index 2b1fc68..18d79b0 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d1b=['../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.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/whatsappQueueReport/whatsappQueueReport.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','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailApplication/mailApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.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'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2d1b,0xa8));var _0xb2d1=function(_0x53b044,_0x47b6b4){_0x53b044=_0x53b044-0x0;var _0x286911=_0x2d1b[_0x53b044];return _0x286911;};'use strict';var jayson=require(_0xb2d1('0x0'));var BPromise=require(_0xb2d1('0x1'));var _=require(_0xb2d1('0x2'));var config=require(_0xb2d1('0x3'));exports[_0xb2d1('0x4')]=function(){return new BPromise(function(_0x85d260,_0x34d2ad){var _0x538ec4={};_0x538ec4=_['merge'](_0x538ec4,require('../api/user/user.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x6')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/voiceQueue/voiceQueue.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/voiceRecording/voiceRecording.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x7')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x8')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x9')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0xa')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0xb')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0xc')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/mailServerIn/mailServerIn.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0xd')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0xe')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0xf')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/mailMessage/mailMessage.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x10')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/faxAccount/faxAccount.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/faxApplication/faxApplication.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x11')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x12')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x13')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x14')));_0x538ec4=_['merge'](_0x538ec4,require('../api/smsAccount/smsAccount.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/smsInteraction/smsInteraction.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x15')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x16')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x17')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x18')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x19')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x1a')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x1b')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x1c')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/cmContact/cmContact.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x1d')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x1e')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x1f')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x20')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x21')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x22')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/pause/pause.rpc'));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x23')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x24')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x25')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x26')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x27')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x28')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x29')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x2a')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x2b')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x2c')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x2d')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x2e')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x2f')));_0x538ec4=_['merge'](_0x538ec4,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x30')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x31')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/squareProject/squareProject.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/squareRecording/squareRecording.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x32')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x33')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x34')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x35')));_0x538ec4=_['merge'](_0x538ec4,require(_0xb2d1('0x36')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require(_0xb2d1('0x37')));_0x538ec4=_[_0xb2d1('0x5')](_0x538ec4,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x18d723=jayson[_0xb2d1('0x38')](_0x538ec4)[_0xb2d1('0x39')]();var _0x14d627=config[_0xb2d1('0x3a')][_0xb2d1('0x3b')]||config[_0xb2d1('0x3b')]+0x1;var _0xddbe5b=config[_0xb2d1('0x3a')]['ip']||_0xb2d1('0x3c');_0x18d723['on'](_0xb2d1('0x3d'),function(_0x189c8f){return _0x34d2ad(_0x189c8f);});_0x18d723['listen'](_0x14d627,_0xddbe5b,function(){console[_0xb2d1('0x3e')](_0xb2d1('0x3f'),_0xddbe5b,_0x14d627);require(_0xb2d1('0x40'))[_0xb2d1('0x41')]();return _0x85d260(_0xb2d1('0x42')+_0xddbe5b+':'+_0x14d627);});});}; \ No newline at end of file +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 diff --git a/server/safe-template.js b/server/safe-template.js index 7c8b4be..6b5e5a2 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['\x20}\x20}','string','isArray','map','isPlainObject','reduce','safeTemplate','lodash'];(function(_0x394703,_0x8adb56){var _0x220407=function(_0x501db7){while(--_0x501db7){_0x394703['push'](_0x394703['shift']());}};_0x220407(++_0x8adb56);}(_0xe511,0x16f));var _0x1e51=function(_0x18d3d2,_0x48809e){_0x18d3d2=_0x18d3d2-0x0;var _0x582ee2=_0xe511[_0x18d3d2];return _0x582ee2;};var _=require(_0x1e51('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x3a7329){return _0x3a7329==='{{'?'{\x20{\x20':_0x1e51('0x1');}function safeTemplate(_0x5b9e45){var _0x253e96=_0x5b9e45;if(typeof _0x5b9e45===_0x1e51('0x2')){_0x253e96=_0x5b9e45['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1e51('0x3')](_0x5b9e45)){_0x253e96=_0x5b9e45[_0x1e51('0x4')](function(_0x204da7){return safeTemplate(_0x204da7);});}else if(_[_0x1e51('0x5')](_0x5b9e45)){_0x253e96=Object['keys'](_0x5b9e45)[_0x1e51('0x6')](function(_0x21ed6b,_0x5c4590){_0x21ed6b[_0x5c4590]=safeTemplate(_0x5b9e45[_0x5c4590]);return _0x21ed6b;},{});}return _0x253e96;}module['exports'][_0x1e51('0x7')]=safeTemplate; \ No newline at end of file +var _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 diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 4d6845d..07cab46 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 _0xeae8=['replace','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','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','wait','WAIT','label','exports','util','lodash','events','./reply','call','setEncoding','utf8','setTimeout','headers','ready','line','toLowerCase','hangup','520-Invalid','search','function','substring','no\x20code','result=','indexOf','substr','startsWith','split','length','match','emit','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','inherits','prototype','sendRequest','command','sync','answer','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','format','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0xeae8,0x66));var _0x8eae=function(_0x30561c,_0x1866fa){_0x30561c=_0x30561c-0x0;var _0xabb952=_0xeae8[_0x30561c];return _0xabb952;};'use strict';var util=require(_0x8eae('0x0'));var _=require(_0x8eae('0x1'));var EventEmitter=require(_0x8eae('0x2'))['EventEmitter'];var AGIReply=require(_0x8eae('0x3'));var AGIError=require('./error');function AGIChannel(_0x540ce7){var _0x5f311f=this,_0x355d48=new AGIReply(),_0x18cccf=![],_0x30e4cc={};EventEmitter[_0x8eae('0x4')](_0x5f311f);_0x540ce7[_0x8eae('0x5')](_0x8eae('0x6'));_0x540ce7[_0x8eae('0x7')](0x8*0x3c*0x3c*0x3e8);_0x355d48[_0x8eae('0x5')](_0x8eae('0x6'));_0x355d48['on'](_0x8eae('0x8'),function(_0x476ba1){for(var _0x48581b in _0x476ba1){_0x5f311f[_0x48581b]=_0x476ba1[_0x48581b];}_0x5f311f['emit'](_0x8eae('0x9'));});_0x355d48['on'](_0x8eae('0xa'),function(_0x2c8e25){if(_0x2c8e25[_0x8eae('0xb')]()==_0x8eae('0xc')){_0x5f311f['emit']('hangup');return;}if(_0x2c8e25['substring'](0x0,0xb)==_0x8eae('0xd')){_0x18cccf=!![];}if(_0x18cccf){_0x30e4cc['rx']+=_0x2c8e25+'\x0a';if(_0x2c8e25[_0x8eae('0xe')]('520\x20End\x20of\x20proper')!=-0x1){_0x18cccf=![];}}else{_0x30e4cc['rx']=_0x2c8e25;}if(_0x18cccf){return;}if(typeof _0x30e4cc['cb']==_0x8eae('0xf')){var _0x50e569=_0x30e4cc['rx'][_0x8eae('0x10')](0x0,0x3),_0xa29afd=null,_0x38d257=null;_0x50e569=parseInt(_0x50e569);if(isNaN(_0x50e569)){_0x30e4cc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8eae('0x11')});return;}if(_0x50e569!=0xc8){_0x30e4cc['cb'](null,{'code':_0x50e569,'result':-0x1,'extra':'KO'});return;}_0xa29afd=_0x30e4cc['rx'][_0x8eae('0x10')](0x4)['replace'](_0x8eae('0x12'),'');if(_0xa29afd[_0x8eae('0x13')]('\x20')!=-0x1){_0xa29afd=_0xa29afd[_0x8eae('0x14')](0x0,_0xa29afd[_0x8eae('0x13')]('\x20'));}if(_[_0x8eae('0x15')](_0xa29afd,'-1')){_0xa29afd=parseInt(_0xa29afd);}_0x38d257=_0x30e4cc['rx'][_0x8eae('0x16')]('\x20');if(_0x38d257[_0x8eae('0x17')]==0x3){_0x38d257=_0x38d257[0x2][_0x8eae('0x10')](0x1,_0x38d257[0x2][_0x8eae('0x17')]-0x1);}else if(_0x38d257['length']>0x3){var _0x5e214e=/\((.+)\)/;var _0x4e3950=_0x30e4cc['rx'][_0x8eae('0x18')](_0x5e214e);if(_0x4e3950){_0x38d257=_0x4e3950[0x1];}else{_0x38d257=null;}}else{_0x38d257=null;}_0x30e4cc['cb'](null,{'code':_0x50e569,'result':_0xa29afd,'extra':_0x38d257});}});_0x540ce7['on']('error',function(_0x3db47b){_0x5f311f[_0x8eae('0x19')](_0x8eae('0x1a'),new AGIError(_0x8eae('0x1b'),_0x3db47b[_0x8eae('0x1c')]));});_0x540ce7['on'](_0x8eae('0x1d'),function(){_0x5f311f[_0x8eae('0x19')](_0x8eae('0x1d'),new AGIError(_0x8eae('0x1e')));});_0x540ce7['on'](_0x8eae('0x1f'),function(){_0x5f311f['emit']('timeout',new AGIError(_0x8eae('0x20')));_0x540ce7[_0x8eae('0x21')]();});_0x540ce7[_0x8eae('0x22')](_0x355d48);this['command']=function(_0x1ee7fb,_0x8e69cb){var _0x1ee7fb=_0x1ee7fb||'',_0x8e69cb=typeof _0x8e69cb==_0x8eae('0xf')?_0x8e69cb:new Function();_0x30e4cc={'tx':_0x1ee7fb,'rx':'','cb':_0x8e69cb};_0x540ce7['write'](_0x1ee7fb+'\x0a');},this[_0x8eae('0x1d')]=function(){_0x540ce7[_0x8eae('0x21')]();};}util[_0x8eae('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x8eae('0x24')][_0x8eae('0x25')]=function(_0x2bda3a){return this[_0x8eae('0x26')][_0x8eae('0x27')](this,_0x2bda3a);};AGIChannel[_0x8eae('0x24')][_0x8eae('0x28')]=function(){return this[_0x8eae('0x25')]('ANSWER');};AGIChannel[_0x8eae('0x24')][_0x8eae('0x29')]=function(_0x141940,_0x34dff7,_0x149b83){_0x141940=_0x141940===undefined?_0x8eae('0x2a'):_0x141940;_0x34dff7=_0x34dff7===undefined?'5':_0x34dff7;_0x149b83=_0x149b83===undefined?'1':_0x149b83;return this[_0x8eae('0x25')](util['format'](_0x8eae('0x2b'),_0x141940,_0x34dff7*0x3e8,_0x149b83));};AGIChannel['prototype'][_0x8eae('0x2c')]=function(_0xf4f03c){_0xf4f03c=_0xf4f03c||_0x8eae('0x2d');return this[_0x8eae('0x25')](util[_0x8eae('0x2e')]('VERBOSE\x20\x22%s\x22',_0xf4f03c));};AGIChannel['prototype'][_0x8eae('0x2f')]=function(_0x28431c,_0x35c717){if(_[_0x8eae('0x30')](_0x35c717)){return this['sendRequest'](util[_0x8eae('0x2e')](_0x8eae('0x31'),_0x28431c,_0x35c717[_0x8eae('0x32')](',')));}return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x31'),_0x28431c,_0x35c717));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x33')]=function(_0x116024){return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x34'),_0x116024));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x35')]=function(_0x1f247e){return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x36'),_0x1f247e));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x37')]=function(_0x143075){return this['sendRequest'](util[_0x8eae('0x2e')](_0x8eae('0x38'),_0x143075));};AGIChannel[_0x8eae('0x24')]['hangup']=function(){return this[_0x8eae('0x25')](_0x8eae('0x39'));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x3a')]=function(_0x52c049,_0xa885ad){var _0x538121=_['isBoolean'](_0xa885ad)||_[_0x8eae('0x3b')](_0xa885ad)?_0xa885ad[_0x8eae('0x3c')]():_0xa885ad;return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x3d'),_0x52c049,_0x538121?_0x538121[_0x8eae('0x3c')]()[_0x8eae('0x3e')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x8eae('0x3f')]=function(_0x477b13,_0x47968b){return this['sendRequest'](util['format'](_0x8eae('0x40'),_0x477b13,_0x47968b));};AGIChannel[_0x8eae('0x24')]['sayDigits']=function(_0xcaf893,_0x1a7539){return this['sendRequest'](util[_0x8eae('0x2e')](_0x8eae('0x41'),_0xcaf893,_0x1a7539));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x42')]=function(_0x139c25,_0x580c86){return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x43'),_0x139c25,_0x580c86));};AGIChannel['prototype'][_0x8eae('0x44')]=function(_0x12778e,_0x59695d,_0x44dad2){_0x59695d=_0x59695d||this[_0x8eae('0x45')];_0x44dad2=_0x44dad2||0x1;this[_0x8eae('0x33')](_0x12778e);this[_0x8eae('0x35')](_0x59695d);this['setPriority'](_0x44dad2);return this[_0x8eae('0x2c')](util[_0x8eae('0x2e')](_0x8eae('0x46'),_0x12778e,_0x59695d,_0x44dad2));};AGIChannel[_0x8eae('0x24')]['getVariable']=function(_0x985430){return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x47'),_0x985430));};AGIChannel['prototype'][_0x8eae('0x48')]=function(_0x4d24d7,_0x18f1ae,_0x502214,_0x26712e,_0x2972d7,_0x4f0e5c){_0x18f1ae=_0x18f1ae||_0x8eae('0x49');_0x502214=_0x502214||'';_0x26712e=_0x26712e===undefined?-0x1:_0x26712e==='-1'?-0x1:_0x26712e*0x3e8;_0x2972d7=_0x2972d7===undefined?'':'s='+_0x2972d7;_0x4f0e5c=_0x4f0e5c?_0x8eae('0x4a'):'';return this[_0x8eae('0x25')](util[_0x8eae('0x2e')](_0x8eae('0x4b'),_0x4d24d7,_0x18f1ae,_0x502214,_0x26712e,_0x4f0e5c,_0x2972d7));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x4c')]=function(_0x214117,_0x24a3ff){_0x24a3ff=_0x24a3ff||'';return this['sendRequest'](util[_0x8eae('0x2e')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x214117,_0x24a3ff));};AGIChannel[_0x8eae('0x24')][_0x8eae('0x4d')]=function(_0x316ad5){return this[_0x8eae('0x2f')]('AGI',_0x316ad5);};AGIChannel[_0x8eae('0x24')][_0x8eae('0x4e')]=function(_0x27cccb){return this[_0x8eae('0x2f')](_0x8eae('0x4f'),_0x27cccb);};AGIChannel[_0x8eae('0x24')][_0x8eae('0x1a')]=function(_0x41eca2,_0x324da8){this[_0x8eae('0x2c')](util[_0x8eae('0x2e')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x41eca2['id'],_0x41eca2[_0x8eae('0x50')],_0x324da8));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8eae('0x51')]=AGIChannel; \ No newline at end of file +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 diff --git a/server/services/agi/error.js b/server/services/agi/error.js index ac63982..64c5e11 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 _0x539d=['message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','apply'];(function(_0xec7927,_0x417df7){var _0xb16197=function(_0x34cd85){while(--_0x34cd85){_0xec7927['push'](_0xec7927['shift']());}};_0xb16197(++_0x417df7);}(_0x539d,0x9c));var _0xd539=function(_0xa3e0f7,_0x1b06db){_0xa3e0f7=_0xa3e0f7-0x0;var _0x4ce604=_0x539d[_0xa3e0f7];return _0x4ce604;};'use strict';var util=require(_0xd539('0x0'));var error={'E_AGI_UNDEFINED':_0xd539('0x1'),'E_AGI_ARGUMENT_PORT':_0xd539('0x2'),'E_AGI_SERVER_ERROR':_0xd539('0x3'),'E_AGI_SERVER_CLOSE':_0xd539('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0xd539('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0xd539('0x6'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xd539('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xd539('0x8'),'E_AGI_COMMAND_EMPTY':_0xd539('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xd539('0xa'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x3d5761){var _0x3d5761=_0x3d5761||null,_0x5e1e94=_0x5e1e94||[],_0x55509d=0x1,_0x14f72a='';if(!error[_0x3d5761]){_0x3d5761=_0xd539('0xb');}_0x5e1e94['push'](error[_0x3d5761]);while(arguments[_0x55509d]){_0x5e1e94[_0xd539('0xc')](arguments[_0x55509d]);_0x55509d++;}_0x14f72a=util['format'][_0xd539('0xd')](util,_0x5e1e94);this[_0xd539('0xe')]=_0x14f72a;this[_0xd539('0xf')]=_0x3d5761;}module[_0xd539('0x10')]=AGIError; \ No newline at end of file +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 diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e66ae38..8b5f7c2 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 _0xe426=['addVertex','edges','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','length','info','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','prototype'];(function(_0x81f000,_0x15df85){var _0x337aa2=function(_0x37f6a4){while(--_0x37f6a4){_0x81f000['push'](_0x81f000['shift']());}};_0x337aa2(++_0x15df85);}(_0xe426,0xf8));var _0x6e42=function(_0x4d2e0b,_0x11da70){_0x4d2e0b=_0x4d2e0b-0x0;var _0x4d9af6=_0xe426[_0x4d2e0b];return _0x4d9af6;};'use strict';var _=require(_0x6e42('0x0'));var logger=require('../../../config/logger')(_0x6e42('0x1'));var verticesWithRetry=[_0x6e42('0x2'),_0x6e42('0x3'),_0x6e42('0x4')];var Graph=function(){this[_0x6e42('0x5')]={};this['edges']={};this[_0x6e42('0x6')]=0x0;};Graph[_0x6e42('0x7')][_0x6e42('0x8')]=function(_0x81c410){this['vertices'][_0x81c410['id']]=_0x81c410;this[_0x6e42('0x9')][_0x81c410['id']]=[];};Graph[_0x6e42('0x7')][_0x6e42('0xa')]=function(_0x4d5d96,_0x190e17,_0x24687d){this[_0x6e42('0x9')][_0x4d5d96][_0x6e42('0xb')]({'target':_0x190e17,'condition':_0x24687d});this['numberOfEdges']+=0x1;};Graph[_0x6e42('0x7')][_0x6e42('0xc')]=function(){return _[_0x6e42('0xc')](this['vertices']);};Graph[_0x6e42('0x7')][_0x6e42('0xd')]=function(){return this[_0x6e42('0x6')];};Graph[_0x6e42('0x7')][_0x6e42('0xe')]=function(_0x5932fb){return this[_0x6e42('0x5')][_0x5932fb];};Graph[_0x6e42('0x7')][_0x6e42('0xf')]=function(_0x15643c,_0x33f09c){if(!this[_0x6e42('0x5')][_0x15643c]){return logger['info'](_0x6e42('0x10'));}var _0x1dfa61=_0x33f09c(this[_0x6e42('0x5')][_0x15643c]);if(!_0x1dfa61){return logger['info']('stop\x20traverse');}if(this[_0x6e42('0x9')][_0x15643c][_0x6e42('0x11')]===0x0){return logger[_0x6e42('0x12')](_0x6e42('0x13'));}for(var _0x271014=0x0,_0x4f6eb6=[],_0x5958b7=![];_0x271014\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','evtHangup','toJson','mxGraphModel','root','agicommand','retry','addVertex','omit','mxCell','hasOwnProperty','isArray','length','source','target','addEdge','value','then','catch','createSquareReport','agi_','inspect','debug','variables','stringify','close','hangup','production','joinAt','[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','response','code','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x915d,0x1f1));var _0xd915=function(_0x44c7c0,_0x3c7325){_0x44c7c0=_0x44c7c0-0x0;var _0x129546=_0x915d[_0x44c7c0];return _0x129546;};'use strict';var parser=require(_0xd915('0x0'));var _=require('lodash');var syncho=require(_0xd915('0x1'));var util=require(_0xd915('0x2'));var moment=require(_0xd915('0x3'));var config=require(_0xd915('0x4'));var logger=require(_0xd915('0x5'))(_0xd915('0x6'));var utilLicense=require(_0xd915('0x7'));var rpc=require('./rpc');var mailRpc=require(_0xd915('0x8'));var Graph=require(_0xd915('0x9'));var Vertices=require(_0xd915('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xd915('0x6')]=_[_0xd915('0xb')](config['agi'],{'ip':_0xd915('0xc'),'port':0x11dd});function connectionHandler(_0x24679f){process[_0xd915('0xd')](function(){syncho(function(){try{setChannelVariables(_0x24679f);agiHandler(_0x24679f);}catch(_0x4af7ad){logger[_0xd915('0xe')](_0x4af7ad[_0xd915('0xf')]);}});});}function listeningHandler(){console[_0xd915('0x10')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0xd915('0x6')][_0xd915('0x11')]);logger[_0xd915('0x12')](util[_0xd915('0x13')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0xd915('0x6')]['ip'],config[_0xd915('0x6')][_0xd915('0x11')]));}function errorHandler(_0x499883){if(_0x499883&&_0x499883[_0xd915('0x14')]&&_0x499883['message']){logger[_0xd915('0xe')](util[_0xd915('0x13')](_0xd915('0x15'),_0x499883['name'],_0x499883[_0xd915('0x16')]));}else{logger['error'](util[_0xd915('0x13')]('[ERROR]\x20%s',_0x499883[_0xd915('0xf')]));}}function closeHandler(){logger[_0xd915('0x12')](util['format'](_0xd915('0x17'),this['arg_1'],this['calleridname'],this[_0xd915('0x18')],this['dnid'],this[_0xd915('0x19')]));try{createSquareReport(this);}catch(_0xa9bd0a){logger[_0xd915('0xe')](_0xa9bd0a[_0xd915('0xf')]);}}function timeoutHandler(){logger[_0xd915('0x12')](util[_0xd915('0x13')](_0xd915('0x1a'),this[_0xd915('0x1b')],this[_0xd915('0x1c')],this['callerid'],this['dnid'],this[_0xd915('0x19')]));}function hangupHandler(){logger[_0xd915('0x12')](util[_0xd915('0x13')]('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xd915('0x1c')],this['callerid'],this[_0xd915('0x1d')],this[_0xd915('0x19')]));this[_0xd915('0x1e')]=!![];}function getRoot(_0x56dd39){return parser[_0xd915('0x1f')](_0x56dd39,{'object':!![]})[_0xd915('0x20')][_0xd915('0x21')];}function addVertex(_0x202a0a,_0x587080,_0xc1789b){_0x587080[_0xd915('0x22')]=_0xc1789b;if(_0x587080['hasOwnProperty'](_0xd915('0x23'))){_0x587080['maxRetry']=parseInt(_0x587080[_0xd915('0x23')],0xa);}_0x202a0a[_0xd915('0x24')](_[_0xd915('0x25')](_0x587080,_0xd915('0x26')));}function initGraph(_0x14e1fc,_0x3b1543){var _0x2e8093=new Graph();for(var _0x55bdee in _0x14e1fc){if(_0x14e1fc[_0xd915('0x27')](_0x55bdee)){if(_[_0xd915('0x28')](_0x14e1fc[_0x55bdee])){for(var _0x47d92b=0x0;_0x47d92b<_0x14e1fc[_0x55bdee]['length'];_0x47d92b+=0x1){addVertex(_0x2e8093,_0x14e1fc[_0x55bdee][_0x47d92b],_0x55bdee);}}else{addVertex(_0x2e8093,_0x14e1fc[_0x55bdee],_0x55bdee);}}}for(var _0x1e60f2=0x0;_0x1e60f2<_0x3b1543[_0xd915('0x29')];_0x1e60f2+=0x1){if(_0x3b1543[_0x1e60f2][_0xd915('0x2a')]&&_0x3b1543[_0x1e60f2][_0xd915('0x2b')]){_0x2e8093[_0xd915('0x2c')](_0x3b1543[_0x1e60f2][_0xd915('0x2a')],_0x3b1543[_0x1e60f2][_0xd915('0x2b')],_0x3b1543[_0x1e60f2][_0xd915('0x2d')]);}}return _0x2e8093;}function getSquareProject(_0x358445,_0x41ce47){rpc['getSquareProject'](_0x358445)[_0xd915('0x2e')](function(_0x51bf48){_0x41ce47(null,_0x51bf48);})[_0xd915('0x2f')](function(_0x250dce){_0x41ce47(null,_0x250dce);});}function createSquareReport(_0x381935,_0x3a6aa0){rpc[_0xd915('0x30')](_0x381935)['then'](function(_0x53d726){if(_0x3a6aa0){_0x3a6aa0(null,_0x53d726);}})['catch'](function(_0x2b5c0f){if(_0x3a6aa0){_0x3a6aa0(null,_0x2b5c0f);}});}function setChannelVariables(_0x302642){for(var _0x428595 in _0x302642){if(_0x302642['hasOwnProperty'](_0x428595)){if(_0x428595['indexOf'](_0xd915('0x31'))===0x0){_0x302642[_0x428595['substring'](0x4)]=_0x302642[_0x428595];delete _0x302642[_0x428595];}}}}function getLogFromObject(_0x41525b){return util[_0xd915('0x32')](_0x41525b,{'showHidden':![],'depth':null});}function agiHandler(_0x52559e){var _0x21322e,_0x5a71e,_0x318bb1,_0x45d54b,_0x437023;logger[_0xd915('0x33')](_0xd915('0x34'),JSON[_0xd915('0x35')](_0x52559e,null,0x2));logger[_0xd915('0x12')](util['format']('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x52559e[_0xd915('0x1b')],_0x52559e[_0xd915('0x1c')],_0x52559e[_0xd915('0x18')],_0x52559e['dnid'],_0x52559e[_0xd915('0x19')]));_0x52559e['on'](_0xd915('0xe'),errorHandler);_0x52559e['on'](_0xd915('0x36'),closeHandler);_0x52559e['on']('timeout',timeoutHandler);_0x52559e[_0xd915('0x1e')]=![];_0x52559e['on'](_0xd915('0x37'),hangupHandler);var _0x28e021=getSquareProject['sync'](null,_0x52559e['arg_1']);if(_0x28e021){if(_0x28e021['production']){_0x21322e=getRoot(_0x28e021[_0xd915('0x38')]);if(_0x21322e&&_0x21322e['start']){logger['debug'](_0xd915('0x21'),JSON[_0xd915('0x35')](_0x21322e,null,0x2));_0x52559e[_0xd915('0x39')]=moment()[_0xd915('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x5a71e=initGraph(_[_0xd915('0x25')](_0x21322e,_0xd915('0x26')),_0x21322e[_0xd915('0x26')]);_0x318bb1=new Vertices(_0x52559e,rpc,mailRpc);logger[_0xd915('0x12')](util[_0xd915('0x13')](_0xd915('0x3a'),_0x52559e['arg_1'],_0x52559e[_0xd915('0x1c')],_0x52559e[_0xd915('0x18')],_0x52559e[_0xd915('0x1d')],_0x52559e['uniqueid']));_0x5a71e[_0xd915('0x3b')](_0x21322e['start']['id'],function(_0x21cf86){try{_0x21cf86=_0x318bb1['clear'](_0x21cf86);logger[_0xd915('0x33')](_0xd915('0x3c'),JSON[_0xd915('0x35')](_0x21cf86,null,0x2));if(_0x21cf86['agicommand']===_0xd915('0x3d')){logger[_0xd915('0x12')](_0xd915('0x3e'));_0x52559e[_0xd915('0x3f')]=_0x21cf86[_0xd915('0x3f')]||_0x52559e['context'];_0x52559e[_0xd915('0x40')]=_0x21cf86[_0xd915('0x40')];_0x52559e[_0xd915('0x41')]=_0x21cf86[_0xd915('0x41')]?_0x21cf86[_0xd915('0x41')]-0x1:0x1;return null;}else if(_0x21cf86&&_0x318bb1[_0x21cf86['agicommand']]){_0x437023=_0x318bb1[_0x21cf86['agicommand']](_0x21cf86);logger['info'](_0xd915('0x42'),JSON[_0xd915('0x35')](_0x437023,null,0x2));if(_0x437023&&_0x437023[_0xd915('0x43')]===AGI_CODE_SUCCESS&&_0x437023[_0xd915('0x44')]!==AGI_RESULT_ERROR&&!_0x52559e[_0xd915('0x1e')]){logger['debug'](_0xd915('0x42'),getLogFromObject(_0x437023));return _[_0xd915('0x45')](_0x437023[_0xd915('0x44')])?null:_0x437023[_0xd915('0x44')][_0xd915('0x46')]();}else{logger[_0xd915('0xe')](_0xd915('0x42'),getLogFromObject(_0x437023));return null;}}else{logger[_0xd915('0xe')](_0xd915('0x47'));return null;}}catch(_0x505355){logger[_0xd915('0xe')](_0x505355['stack']);return null;}});if(_0x21322e['finally']){logger['info'](util[_0xd915('0x13')](_0xd915('0x48'),_0x52559e[_0xd915('0x1b')],_0x52559e['calleridname'],_0x52559e['callerid'],_0x52559e['dnid'],_0x52559e[_0xd915('0x19')]));_0x5a71e['traverseBFS'](_0x21322e[_0xd915('0x49')]['id'],function(_0x2637bd){try{_0x2637bd=_0x318bb1['clear'](_0x2637bd);logger['debug']('vertex',JSON[_0xd915('0x35')](_0x2637bd,null,0x2));if(_0x2637bd&&_0x318bb1[_0x2637bd[_0xd915('0x22')]]){_0x437023=_0x318bb1[_0x2637bd[_0xd915('0x22')]](_0x2637bd);if(_0x437023){logger[_0xd915('0x33')](_0xd915('0x42'),getLogFromObject(_0x437023));return _[_0xd915('0x45')](_0x437023[_0xd915('0x44')])?null:_0x437023[_0xd915('0x44')][_0xd915('0x46')]();}else{logger['error']('response',getLogFromObject(_0x437023));return null;}}else{logger[_0xd915('0xe')](_0xd915('0x47'));return null;}}catch(_0x2d09a1){logger[_0xd915('0xe')](_0x2d09a1['stack']);return null;}});}logger[_0xd915('0x12')](util[_0xd915('0x13')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x52559e[_0xd915('0x1b')],_0x52559e[_0xd915('0x1c')],_0x52559e['callerid'],_0x52559e[_0xd915('0x1d')],_0x52559e[_0xd915('0x19')]));logger['info'](util['format'](_0xd915('0x4a'),_0x52559e[_0xd915('0x3f')],_0x52559e[_0xd915('0x40')],parseInt(_0x52559e[_0xd915('0x41')],0xa)+0x1));_0x52559e[_0xd915('0x4b')](_0x52559e[_0xd915('0x3f')],_0x52559e[_0xd915('0x40')],parseInt(_0x52559e[_0xd915('0x41')],0xa)+0x1);_0x52559e[_0xd915('0x36')]();}}else{logger['error'](util['format'](_0xd915('0x4c'),_0x52559e[_0xd915('0x1b')]));_0x52559e[_0xd915('0x4b')](_0x52559e[_0xd915('0x3f')],_0x52559e['extension'],parseInt(_0x52559e[_0xd915('0x41')],0xa)+0x1);_0x52559e[_0xd915('0x36')]();}}else{logger[_0xd915('0xe')](util[_0xd915('0x13')](_0xd915('0x4d'),_0x52559e[_0xd915('0x1b')]));_0x52559e[_0xd915('0x4b')](_0x52559e['context'],_0x52559e[_0xd915('0x40')],parseInt(_0x52559e[_0xd915('0x41')],0xa)+0x1);_0x52559e['close']();}}function main(){var _0x24c1f4;return utilLicense[_0xd915('0x4e')]()[_0xd915('0x2e')](function(_0x12d080){if(_0x12d080){if(_0x12d080[_0xd915('0x4f')]){if(_0x12d080[_0xd915('0x50')]&&_0x12d080[_0xd915('0x50')]>0x0){logger[_0xd915('0x12')](util[_0xd915('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x12d080[_0xd915('0x50')]));_0x24c1f4=_0x12d080['callysquare'];}else{logger[_0xd915('0x12')](_0xd915('0x51'));}}else{logger[_0xd915('0x12')](_0xd915('0x52'));_0x24c1f4=-0x1;}}})[_0xd915('0x2f')](function(_0x3bcc90){logger[_0xd915('0xe')](_0xd915('0x53'),_0x3bcc90['stack']);})[_0xd915('0x49')](function(){var _0x1a85ff=require('./server')(config[_0xd915('0x6')][_0xd915('0x11')],config[_0xd915('0x6')]['ip'],_0x24c1f4);_0x1a85ff['on'](_0xd915('0xe'),errorHandler);_0x1a85ff['on']('listening',listeningHandler);_0x1a85ff['on']('connection',connectionHandler);_0x1a85ff['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x12f2=['value','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\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 diff --git a/server/services/agi/mailRpc/index.js b/server/services/agi/mailRpc/index.js index 3f7c422..7496737 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 _0x54f3=['result','sendMailMessage','bluebird','client','request','error','message'];(function(_0x9a62de,_0x127f28){var _0x14d7b3=function(_0x23d73f){while(--_0x23d73f){_0x9a62de['push'](_0x9a62de['shift']());}};_0x14d7b3(++_0x127f28);}(_0x54f3,0xdb));var _0x354f=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x54f3[_0x4e676e];return _0x336a3c;};'use strict';var BPromise=require(_0x354f('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x354f('0x1')]['http']({'port':0x232b});function request(_0x548b2a,_0x277a4a){return new BPromise(function(_0x601cb6,_0x130f45){return client[_0x354f('0x2')](_0x548b2a,_0x277a4a)['then'](function(_0x26ae1d){if(_0x26ae1d[_0x354f('0x3')]){return _0x130f45(_0x26ae1d[_0x354f('0x3')][_0x354f('0x4')]);}else{return _0x601cb6(_0x26ae1d[_0x354f('0x5')]);}})['catch'](function(_0x1c79e5){return _0x130f45(_0x1c79e5);});});}exports[_0x354f('0x6')]=function(_0x4fe6df,_0x52e51e){return request('SendMail',{'account':_0x4fe6df,'message':_0x52e51e});}; \ No newline at end of file +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 diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b1db16b..5397c1e 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 _0x31ff=['length','split','slice','trim','headers','line','exports','util','stream','Transform','_inBody','inherits','prototype','\x0d\x0a\x0d\x0a','_localBuffer','toString','substring'];(function(_0x350f0f,_0x549a3b){var _0x1ea456=function(_0x27c9ec){while(--_0x27c9ec){_0x350f0f['push'](_0x350f0f['shift']());}};_0x1ea456(++_0x549a3b);}(_0x31ff,0xd3));var _0xf31f=function(_0x1e339d,_0x1484ee){_0x1e339d=_0x1e339d-0x0;var _0x126d4b=_0x31ff[_0x1e339d];return _0x126d4b;};'use strict';var util=require(_0xf31f('0x0'));var Transform=require(_0xf31f('0x1'))[_0xf31f('0x2')];function AGIReply(_0x1e2d5b){Transform['call'](this,_0x1e2d5b);this['_localBuffer']='';this[_0xf31f('0x3')]=![];}util[_0xf31f('0x4')](AGIReply,Transform);AGIReply[_0xf31f('0x5')]['_transform']=function(_0x191258,_0x45c341,_0x35b9a5){var _0x432c1b='\x0a',_0xca0680=['\x0a\x0a',_0xf31f('0x6')],_0x2f9393=-0x1,_0x2b8cb7=-0x1,_0x93dd82='',_0x2e6f90=0x0,_0x23ea08='',_0x3f7de1='';this[_0xf31f('0x7')]+=_0x191258[_0xf31f('0x8')]();_0x23ea08=this[_0xf31f('0x7')];if(!this['_inBody']){_0x2e6f90=0x0;while(_0xca0680[_0x2e6f90]){while((_0x2b8cb7=_0x23ea08['indexOf'](_0xca0680[_0x2e6f90]))!=-0x1){_0x93dd82=_0xca0680[_0x2e6f90];_0x3f7de1=_0x23ea08[_0xf31f('0x9')](0x0,_0x2b8cb7);_0x23ea08=_0x23ea08[_0xf31f('0x9')](_0x2b8cb7+_0x93dd82[_0xf31f('0xa')]);var _0x1c1996=_0x3f7de1[_0xf31f('0xb')](_0x432c1b),_0x40c996=0x0,_0x18cbed={},_0x5a8b32='',_0x332b8b='',_0x289807=-0x1;while(_0x1c1996[_0x40c996]){_0x289807=_0x1c1996[_0x40c996]['indexOf'](':');if(_0x289807!=-0x1){_0x5a8b32=_0x1c1996[_0x40c996][_0xf31f('0xc')](0x0,_0x289807)[_0xf31f('0xd')]();_0x332b8b=_0x1c1996[_0x40c996]['slice'](_0x289807+0x1)['trim']();if(_0x5a8b32['length']>0x0){_0x18cbed[_0x5a8b32]=_0x332b8b;}}else{}_0x40c996++;}this['emit'](_0xf31f('0xe'),_0x18cbed);this[_0xf31f('0x3')]=!![];}_0x2e6f90++;}this['_localBuffer']=_0x23ea08;}else{while((_0x2f9393=_0x23ea08['indexOf'](_0x432c1b))!=-0x1){_0x3f7de1=_0x23ea08[_0xf31f('0x9')](0x0,_0x2f9393);this['emit'](_0xf31f('0xf'),_0x3f7de1);_0x23ea08=_0x23ea08['substring'](_0x2f9393+_0x432c1b[_0xf31f('0xa')]);}this['_localBuffer']=_0x23ea08;}_0x35b9a5();};module[_0xf31f('0x10')]=AGIReply; \ No newline at end of file +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 diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index b6033a2..f1e98f9 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 _0x1b23=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','save_name','Interval','Intervals','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','phone','ListId','then','ShowPause','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','lodash','jayson/promise','client','request','error','message','catch','getSquareProject','ShowSquareProject','production'];(function(_0x46dec0,_0x592d85){var _0x3dea89=function(_0x281efb){while(--_0x281efb){_0x46dec0['push'](_0x46dec0['shift']());}};_0x3dea89(++_0x592d85);}(_0x1b23,0x116));var _0x31b2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1b23[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require(_0x31b2('0x0'));var moment=require(_0x31b2('0x1'));var _=require(_0x31b2('0x2'));var util=require('util');var jayson=require(_0x31b2('0x3'));var client=jayson[_0x31b2('0x4')]['http']({'port':0x2329});function request(_0x4c451e,_0x48cba1){return new BPromise(function(_0x35192a,_0x500823){return client[_0x31b2('0x5')](_0x4c451e,_0x48cba1)['then'](function(_0x61a7e6){if(_0x61a7e6[_0x31b2('0x6')]){return _0x500823(_0x61a7e6['error'][_0x31b2('0x7')]);}else{return _0x35192a(_0x61a7e6['result']);}})[_0x31b2('0x8')](function(_0x3a3f37){return _0x500823(_0x3a3f37);});});}exports[_0x31b2('0x9')]=function(_0x539131){return request(_0x31b2('0xa'),{'options':{'raw':![],'where':{'name':_0x539131},'attributes':[_0x31b2('0xb')]}});};exports[_0x31b2('0xc')]=function(_0x10a441){return request(_0x31b2('0xd'),{'options':{'raw':![],'where':{'id':_0x10a441},'include':[{'model':_0x31b2('0xe'),'as':_0x31b2('0xf')}],'attributes':['id',_0x31b2('0x10'),_0x31b2('0x11')]}});};exports[_0x31b2('0x12')]=function(_0x2be17e){return request(_0x31b2('0xa'),{'options':{'where':{'id':_0x2be17e},'attributes':[_0x31b2('0x10')]}});};exports[_0x31b2('0x13')]=function(_0x59f1f6){return request(_0x31b2('0x14'),{'options':{'where':{'id':_0x59f1f6},'attributes':[_0x31b2('0x10')]}});};exports['getVariableById']=function(_0x5d4192){return request(_0x31b2('0x15'),{'options':{'where':{'id':_0x5d4192},'attributes':[_0x31b2('0x10')]}});};exports[_0x31b2('0x16')]=function(_0x2cb2b9){return request(_0x31b2('0x17'),{'options':{'where':{'id':_0x2cb2b9},'attributes':[_0x31b2('0x18')]}});};exports['getUserById']=function(_0x359880){return request(_0x31b2('0x19'),{'options':{'where':{'id':_0x359880},'attributes':[_0x31b2('0x10')]}});};exports[_0x31b2('0x1a')]=function(_0x109bd6){return request(_0x31b2('0x1b'),{'options':{'where':{'id':_0x109bd6},'attributes':[_0x31b2('0x10')]}});};exports[_0x31b2('0x1c')]=function(_0xfbbcd6){return request('ShowSound',{'options':{'where':{'id':_0xfbbcd6},'attributes':[_0x31b2('0x1d')]}});};exports['getIntervalById']=function(_0x42749f){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x42749f},'include':[{'model':_0x31b2('0x1e'),'as':_0x31b2('0x1f')}]}});};exports[_0x31b2('0x20')]=function(_0x5afb45){return request(_0x31b2('0x21'),{'options':{'where':{'id':_0x5afb45},'attributes':['id',_0x31b2('0x10')]}});};exports['createSmsMessage']=function(_0x516e0a){return request(_0x31b2('0x22'),{'body':_0x516e0a});};exports[_0x31b2('0x23')]=function(_0x4a29c9){return request(_0x31b2('0x24'),{'body':_0x4a29c9});};exports[_0x31b2('0x25')]=function(_0x30b1){return request(_0x31b2('0x26'),{'body':_[_0x31b2('0x27')](_0x30b1,{'project_name':_0x30b1['arg_1'],'prev_project_name':_0x30b1['arg_2']||'','is_subproject':_0x30b1[_0x31b2('0x28')]?!![]:![],'leaveAt':moment()[_0x31b2('0x29')](_0x31b2('0x2a'))})});};exports[_0x31b2('0x2b')]=function(_0x5cae2e){return request(_0x31b2('0x2c'),{'body':_0x5cae2e});};exports[_0x31b2('0x2d')]=function(_0x37d8da){return request('CreateSquareMessage',{'body':_0x37d8da});};exports[_0x31b2('0x2e')]=function(_0x42b0bc){return request(_0x31b2('0x2f'),{'options':{'raw':![],'where':{'phone':_0x42b0bc[_0x31b2('0x30')],'ListId':_0x42b0bc[_0x31b2('0x31')]}}})[_0x31b2('0x32')](function(_0x566e8f){if(_0x566e8f){return _0x566e8f;}return request('CreateCmContact',{'body':_0x42b0bc});});};exports['getPauseById']=function(_0x2b3199){return request(_0x31b2('0x33'),{'options':{'where':{'id':_0x2b3199},'attributes':[_0x31b2('0x10')]}});};exports[_0x31b2('0x34')]=function(_0x20d3ea,_0x39e9bd){return request(_0x31b2('0x35'),{'body':{'interface':_0x39e9bd},'options':{'where':_0x20d3ea}});};exports[_0x31b2('0x36')]=function(_0x1fe1c9,_0x4ee956,_0x29a0d7){return request('PauseUser',{'body':{'type':_0x4ee956,'uniqueid':_0x29a0d7},'options':{'where':_0x1fe1c9}});};exports[_0x31b2('0x37')]=function(_0x1aab11){return request(_0x31b2('0x38'),{'body':{},'options':{'where':_0x1aab11}});};exports[_0x31b2('0x39')]=function(_0x4a2ca2){return request('LogoutUser',{'body':{},'options':{'where':_0x4a2ca2}});}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/aws/index.js b/server/services/agi/scripts/aws/index.js index 70eaa29..a84774d 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 _0x9a5a=['./lex','exports','./polly'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9a5a,0x194));var _0xa9a5=function(_0x1401ad,_0x1125c3){_0x1401ad=_0x1401ad-0x0;var _0x4c09d6=_0x9a5a[_0x1401ad];return _0x4c09d6;};var polly=require(_0xa9a5('0x0'));var lex=require(_0xa9a5('0x1'));module[_0xa9a5('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 5a61ed4..da33d44 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 _0xb688=['exports'];(function(_0x2eaf27,_0x156433){var _0x592480=function(_0xa1e9cb){while(--_0xa1e9cb){_0x2eaf27['push'](_0x2eaf27['shift']());}};_0x592480(++_0x156433);}(_0xb688,0xcf));var _0x8b68=function(_0x28e6de,_0x1926ad){_0x28e6de=_0x28e6de-0x0;var _0x2d484f=_0xb688[_0x28e6de];return _0x2d484f;};'use strict';var lex=require('./lib/api');module[_0x8b68('0x0')]=function(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c){return lex(_0x196cec,_0x266285,_0x1080e8,_0x23bbaa,_0x446b17,_0x4e281c);}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/aws/lex/lib/api.js b/server/services/agi/scripts/aws/lex/lib/api.js index eb2b585..cc4a0e4 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(_0x22ff12,_0x2e2b76){var _0x50f18f=function(_0x57cf33){while(--_0x57cf33){_0x22ff12['push'](_0x22ff12['shift']());}};_0x50f18f(++_0x2e2b76);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_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 diff --git a/server/services/agi/scripts/aws/polly/index.js b/server/services/agi/scripts/aws/polly/index.js index 0920d56..05979e5 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 _0x8aed=['./lib/api','exports'];(function(_0x51248c,_0x5e77cb){var _0x1fcc9f=function(_0x439bd9){while(--_0x439bd9){_0x51248c['push'](_0x51248c['shift']());}};_0x1fcc9f(++_0x5e77cb);}(_0x8aed,0xf0));var _0xd8ae=function(_0x1386c8,_0x478835){_0x1386c8=_0x1386c8-0x0;var _0x1fdae0=_0x8aed[_0x1386c8];return _0x1fdae0;};'use strict';var polly=require(_0xd8ae('0x0'));module[_0xd8ae('0x1')]=function(_0x52ce43,_0x490fb4,_0x7dfa45,_0x295c0f,_0x419c54,_0xe70291,_0x476040){return polly(_0x52ce43,_0x490fb4,_0x7dfa45,_0x295c0f,_0x419c54,_0xe70291,_0x476040);}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/aws/polly/lib/api.js b/server/services/agi/scripts/aws/polly/lib/api.js index 46e435e..432db61 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 _0xf2f9=['mp3','path','randomstring','synthesizeSpeech','AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly'];(function(_0x2e9000,_0x2a3d8f){var _0x5e5381=function(_0x840b38){while(--_0x840b38){_0x2e9000['push'](_0x2e9000['shift']());}};_0x5e5381(++_0x2a3d8f);}(_0xf2f9,0x111));var _0x9f2f=function(_0x501d0d,_0x38b758){_0x501d0d=_0x501d0d-0x0;var _0x37a8b8=_0xf2f9[_0x501d0d];return _0x37a8b8;};'use strict';var fs=require('fs');var path=require(_0x9f2f('0x0'));var BPromise=require('bluebird');var rs=require(_0x9f2f('0x1'));var AWS=require('aws-sdk');function pollyResult(_0xbf9df4,_0x5b112e,_0x3d0759){return new BPromise(function(_0x4b4a56,_0x338914){_0xbf9df4[_0x9f2f('0x2')](_0x5b112e,function(_0x57acd0,_0x13e6ee){if(_0x57acd0){_0x338914(_0x57acd0);}else if(_0x13e6ee){if(_0x13e6ee[_0x9f2f('0x3')]instanceof Buffer){fs['writeFile'](_0x3d0759,_0x13e6ee[_0x9f2f('0x3')],function(_0x52cc29){if(_0x52cc29){_0x338914(_0x52cc29);}else{_0x4b4a56();}});}else{_0x338914(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x338914(new Error(_0x9f2f('0x4')));}});});}module[_0x9f2f('0x5')]=function(_0x2e5e63,_0x23758f,_0x2d5112,_0x190c6a,_0x794a66,_0x34da3c,_0x20cbdb){var _0x37d316=new AWS[(_0x9f2f('0x6'))]({'accessKeyId':_0x2e5e63,'secretAccessKey':_0x23758f,'region':_0x2d5112});var _0x23e511={'Text':_0x794a66,'TextType':_0x34da3c||'text','OutputFormat':_0x9f2f('0x7'),'VoiceId':_0x190c6a};return pollyResult(_0x37d316,_0x23e511,_0x20cbdb);}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/google/asr/index.js b/server/services/agi/scripts/google/asr/index.js index 64fbb9b..58232b7 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 _0x2772=['./lib/api'];(function(_0x3ec1da,_0x1e36f5){var _0x472358=function(_0x1d41b1){while(--_0x1d41b1){_0x3ec1da['push'](_0x3ec1da['shift']());}};_0x472358(++_0x1e36f5);}(_0x2772,0x9c));var _0x2277=function(_0x4dea11,_0x5a5519){_0x4dea11=_0x4dea11-0x0;var _0x4bd33d=_0x2772[_0x4dea11];return _0x4bd33d;};'use strict';var asr=require(_0x2277('0x0'));module['exports']=function(_0x19009c,_0x29d8c1,_0xf20405,_0x35766d){return asr(_0x19009c,_0x29d8c1,_0xf20405);}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/google/asr/lib/api.js b/server/services/agi/scripts/google/asr/lib/api.js index 13f8b9e..735eacf 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 _0x7af2=['readFileSync','toString','base64','POST','8000','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7af2,0x119));var _0x27af=function(_0x421dc0,_0x5eee01){_0x421dc0=_0x421dc0-0x0;var _0x3508c6=_0x7af2[_0x421dc0];return _0x3508c6;};'use strict';var url=require('url');var BPromise=require(_0x27af('0x0'));var fs=require('fs');var host=_0x27af('0x1');module[_0x27af('0x2')]=function(_0x316e13,_0x4baeb8,_0x8556d){return new BPromise(function(_0x1067e7,_0x709cb6){var _0x2a542f;if(typeof _0x316e13!==_0x27af('0x3')||_0x316e13[_0x27af('0x4')]===0x0){return _0x709cb6(_0x27af('0x5'));}if(typeof _0x4baeb8!==_0x27af('0x3')||_0x4baeb8[_0x27af('0x4')]===0x0){return _0x709cb6('key\x20should\x20be\x20a\x20string');}if(typeof _0x8556d!==_0x27af('0x6')&&(typeof _0x8556d!==_0x27af('0x3')||_0x8556d[_0x27af('0x4')]===0x0)){return _0x709cb6('lang\x20should\x20be\x20a\x20string');}try{_0x2a542f=fs[_0x27af('0x7')](_0x316e13)[_0x27af('0x8')](_0x27af('0x9'));}catch(_0x4e27bf){return _0x709cb6(_0x4e27bf);}return _0x1067e7({'method':_0x27af('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x4baeb8,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':_0x27af('0xb'),'languageCode':_0x8556d},'audio':{'content':_0x2a542f}},'json':!![]});});}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 41d415f..732def8 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 _0x0ac4=['exports','./asr'];(function(_0x408be0,_0x294799){var _0x1211ad=function(_0x5487b1){while(--_0x5487b1){_0x408be0['push'](_0x408be0['shift']());}};_0x1211ad(++_0x294799);}(_0x0ac4,0x99));var _0x40ac=function(_0x1b92a6,_0x14444b){_0x1b92a6=_0x1b92a6-0x0;var _0x24be5b=_0x0ac4[_0x1b92a6];return _0x24be5b;};var asr=require(_0x40ac('0x0'));module[_0x40ac('0x1')]={'asr':asr}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 93ca1e1..edd812e 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 _0x1f0e=['./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','finish','info','finish\x20download\x20file','close','unlink','pipe','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','readFileSync','toString','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','split','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','resolve','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','status','code','endConversation','isFallbackIntent','googleDialogflowV2','sessionPath','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','confidence','polly','lex','ispeechTTS','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','sestekNDA','nda','text','channelData','CustomAction','AudioFromTts','audiofile','dirName','apiai-promise','bluebird','dialogflow','https','md5','querystring','randomstring','sox','google-tts-api','url','parse','util','./aws','./google'];(function(_0x2ead8f,_0x278b9e){var _0x995ae9=function(_0x369be3){while(--_0x369be3){_0x2ead8f['push'](_0x2ead8f['shift']());}};_0x995ae9(++_0x278b9e);}(_0x1f0e,0x102));var _0xe1f0=function(_0x1b438d,_0x12e35d){_0x1b438d=_0x1b438d-0x0;var _0x28e8a3=_0x1f0e[_0x1b438d];return _0x28e8a3;};'use strict';var apiai=require(_0xe1f0('0x0'));var BPromise=require(_0xe1f0('0x1'));var dialogflow=require(_0xe1f0('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xe1f0('0x3'));var md5=require(_0xe1f0('0x4'));var path=require('path');var querystring=require(_0xe1f0('0x5'));var rp=require('request-promise');var rs=require(_0xe1f0('0x6'));var sox=require(_0xe1f0('0x7'));var tts=require(_0xe1f0('0x8'));var urlParse=require(_0xe1f0('0x9'))[_0xe1f0('0xa')];var util=require(_0xe1f0('0xb'));var aws=require(_0xe1f0('0xc'));var google=require(_0xe1f0('0xd'));var sestek=require(_0xe1f0('0xe'));var tilde=require(_0xe1f0('0xf'));var logger=require(_0xe1f0('0x10'))(_0xe1f0('0x11'));var ISPEECH_API=_0xe1f0('0x12');function downloadFile(_0x517c17,_0x430efd){return new BPromise(function(_0x253e4c,_0x43a7d9){var _0x267e3b=urlParse(_0x517c17);var _0x4c5f2b=_0x267e3b[_0xe1f0('0x13')]===_0xe1f0('0x14')?https:http;var _0x33269c={'host':_0x267e3b[_0xe1f0('0x15')],'path':_0x267e3b[_0xe1f0('0x16')],'headers':{'user-agent':_0xe1f0('0x17')}};_0x4c5f2b[_0xe1f0('0x18')](_0x33269c,function(_0xfd708){if(_0xfd708[_0xe1f0('0x19')]!==0xc8){logger[_0xe1f0('0x1a')](_0xe1f0('0x1b')+_0x517c17+_0xe1f0('0x1c')+_0xfd708['statusCode']+'\x20('+_0xfd708[_0xe1f0('0x1d')]+')');_0x43a7d9(new Error(_0xe1f0('0x1b')+_0x517c17+_0xe1f0('0x1c')+_0xfd708[_0xe1f0('0x19')]+'\x20('+_0xfd708[_0xe1f0('0x1d')]+')'));return;}var _0x4c5ab3=fs['createWriteStream'](_0x430efd);_0x4c5ab3['on'](_0xe1f0('0x1e'),function(){logger[_0xe1f0('0x1f')](_0xe1f0('0x20'));_0x4c5ab3[_0xe1f0('0x21')](_0x253e4c);});_0x4c5ab3['on'](_0xe1f0('0x1a'),function(_0x1bdaf2){fs[_0xe1f0('0x22')](_0x430efd);logger[_0xe1f0('0x1a')]('download\x20error',_0x1bdaf2);_0x43a7d9(_0x1bdaf2);});_0xfd708[_0xe1f0('0x23')](_0x4c5ab3);})['on'](_0xe1f0('0x1a'),function(_0x465e62){logger[_0xe1f0('0x1a')](_0x465e62);_0x43a7d9(_0x465e62);})[_0xe1f0('0x24')]();});}function uploadFile(_0x1dbb50){return new BPromise(function(_0xc953c0,_0x3cd394){var _0x44e14d=urlParse(_0x1dbb50);var _0x400c01=_0x44e14d[_0xe1f0('0x13')]==='https:'?https:http;var _0x3b5a06={'host':_0x44e14d[_0xe1f0('0x15')],'path':_0x44e14d[_0xe1f0('0x16')],'headers':{'user-agent':_0xe1f0('0x17')}};_0x400c01[_0xe1f0('0x18')](_0x3b5a06,function(_0x3786aa){if(_0x3786aa[_0xe1f0('0x19')]!==0xc8){_0x3cd394(new Error(_0xe1f0('0x1b')+_0x1dbb50+_0xe1f0('0x1c')+_0x3786aa[_0xe1f0('0x19')]+'\x20('+_0x3786aa[_0xe1f0('0x1d')]+')'));return;}var _0x4dbded='';_0x3786aa['on'](_0xe1f0('0x25'),function(_0x5c0aa1){_0x4dbded+=_0x5c0aa1;});_0x3786aa['on'](_0xe1f0('0x24'),function(){_0xc953c0(_0x4dbded);});})['on']('error',function(_0x557047){_0x3cd394(_0x557047);})[_0xe1f0('0x24')]();});}function convertFile(_0x3b6924,_0x1c3447){return new BPromise(function(_0x4d514a,_0x1024ec){var _0x2211a9=sox[_0xe1f0('0x26')](_0x3b6924,_0x1c3447,{'sampleRate':0x1f40,'format':_0xe1f0('0x27'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2211a9['on'](_0xe1f0('0x1a'),function(_0x410abc){logger['error'](_0xe1f0('0x28'),_0x410abc);_0x1024ec(_0x410abc);});_0x2211a9['on']('end',function(){logger[_0xe1f0('0x1f')](_0xe1f0('0x29'));_0x4d514a();});_0x2211a9[_0xe1f0('0x2a')]();});}function base64Decode(_0x451a72,_0x3daf7f){var _0x1d182d=path['resolve'](__dirname,_0xe1f0('0x2b'),rs[_0xe1f0('0x2c')](0x4)+_0xe1f0('0x2d'));fs[_0xe1f0('0x2e')](_0x1d182d,_0x451a72,_0xe1f0('0x2f'));return convertFile(_0x1d182d,_0x3daf7f)[_0xe1f0('0x30')](function(){try{fs['unlink'](_0x1d182d);fs[_0xe1f0('0x31')](_0x3daf7f,'777');}catch(_0x13db1c){logger['error'](_0x13db1c);}return _0x3daf7f['split']('.')[0x0];});}function base64Encode(_0x3d7e38){var _0x493fd0=fs[_0xe1f0('0x32')](_0x3d7e38);return new Buffer(_0x493fd0)[_0xe1f0('0x33')](_0xe1f0('0x2f'));}exports['googleCloudTTS']=function(_0x2e7e95,_0x1f7631,_0x36a20a,_0x5f3aae,_0xc823c5,_0x5a6c56){var _0x307383,_0x45b4c5;var _0x4b578b=_0xe1f0('0x34');var _0x12a71d='?key='+_0x2e7e95;var _0x3248c2={};if(_0x1f7631===_0xe1f0('0x35')){_0x3248c2[_0xe1f0('0x36')]={'ssml':_0x36a20a};}else{_0x3248c2[_0xe1f0('0x36')]={'text':_0x36a20a};};_0x3248c2[_0xe1f0('0x37')]={'languageCode':_0x5f3aae,'ssmlGender':_0xc823c5};_0x3248c2[_0xe1f0('0x38')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x6064a9={'url':_0x4b578b+_0xe1f0('0x39')+_0x12a71d,'method':_0xe1f0('0x3a'),'json':!![],'body':_0x3248c2};return rp(_0x6064a9)['then'](function(_0x2ce2aa){return new BPromise(function(_0x11c646,_0x21a267){_0x307383=path['resolve'](__dirname,_0xe1f0('0x2b'),rs[_0xe1f0('0x2c')](0x4)+_0xe1f0('0x3b'));var _0x40fc42=Buffer[_0xe1f0('0x3c')](_0x2ce2aa[_0xe1f0('0x3d')],_0xe1f0('0x2f'));return fs[_0xe1f0('0x3e')](_0x307383,_0x40fc42,function(_0x5ed5e9){_0x21a267(_0x5ed5e9);},function(_0x421601){fs[_0xe1f0('0x31')](_0x307383,_0xe1f0('0x3f'));_0x11c646(_0x421601);});});})['then'](function(_0x5e7bc9){_0x45b4c5=path['resolve'](__dirname,'tmp',rs[_0xe1f0('0x2c')](0x4)+_0xe1f0('0x2d'));return convertFile(_0x307383,_0x45b4c5);})['then'](function(){try{fs['unlink'](_0x307383);fs['chmodSync'](_0x45b4c5,_0xe1f0('0x3f'));}catch(_0x269474){logger[_0xe1f0('0x1a')](_0x269474);}logger[_0xe1f0('0x1f')](_0xe1f0('0x40'),_0x45b4c5[_0xe1f0('0x41')]('.')[0x0]);return _0x45b4c5[_0xe1f0('0x41')]('.')[0x0];});};exports[_0xe1f0('0x42')]=function(_0x2b69d6,_0x210cce){var _0x14da33=_0xe1f0('0x43');var _0x10737f,_0x40a849;var _0x305e8f;var _0x5c7e68={'encoding':_0xe1f0('0x44'),'method':_0xe1f0('0x3a'),'timeout':0x2710,'url':_0x14da33,'headers':{'Content-Type':_0xe1f0('0x45')},'body':'f.req='+encodeURIComponent(JSON[_0xe1f0('0x46')]([[[_0xe1f0('0x47'),JSON[_0xe1f0('0x46')]([_0x2b69d6,_0x210cce||'en',![],'null']),null,_0xe1f0('0x48')]]]))};return rp(_0x5c7e68)[_0xe1f0('0x30')](function(_0x32b3e8){try{_0x305e8f=eval(_0x32b3e8[_0xe1f0('0x49')](0x5))[0x0][0x2];}catch(_0x2c9604){throw new Error(_0xe1f0('0x4a')+_0x32b3e8['data']);}if(!_0x305e8f){if(_0x2b69d6[_0xe1f0('0x4b')]>0xc8){throw new Error(_0xe1f0('0x4c'));}else{throw new Error('lang\x20\x22'+_0x210cce+_0xe1f0('0x4d'));}}try{_0x305e8f=eval(_0x305e8f)[0x0];}catch(_0x424388){throw new Error(_0xe1f0('0x4a')+res['data']);}const _0x123c8c=_0x305e8f;_0x10737f=path[_0xe1f0('0x4e')](__dirname,_0xe1f0('0x2b'),rs[_0xe1f0('0x2c')](0x4)+'.mp3');fs[_0xe1f0('0x2e')](_0x10737f,_0x305e8f,{'encoding':_0xe1f0('0x2f')});_0x40a849=path['resolve'](__dirname,_0xe1f0('0x2b'),rs['generate'](0x4)+_0xe1f0('0x2d'));return convertFile(_0x10737f,_0x40a849);})[_0xe1f0('0x30')](function(){try{fs[_0xe1f0('0x22')](_0x10737f);fs[_0xe1f0('0x31')](_0x40a849,_0xe1f0('0x3f'));}catch(_0x285a70){logger[_0xe1f0('0x1a')](_0x285a70);}logger[_0xe1f0('0x1f')](_0xe1f0('0x4f'),_0x40a849[_0xe1f0('0x41')]('.')[0x0]);return _0x40a849['split']('.')[0x0];});};exports[_0xe1f0('0x50')]=function(_0x1163a4,_0x462d28,_0x79720e){return google[_0xe1f0('0x51')](_0x1163a4,_0x462d28,_0x79720e)['then'](function(_0x3c1fd0){logger[_0xe1f0('0x1f')](_0x3c1fd0['uri']);return rp(_0x3c1fd0);})['then'](function(_0x1a522d){var _0x1ec990='';var _0x3116c1=0x0;try{fs['unlink'](_0x1163a4);}catch(_0x475476){logger['error'](_0x475476);}if(_0x1a522d&&_0x1a522d[_0xe1f0('0x52')]){_0x1ec990=_0x1a522d[_0xe1f0('0x52')][_0xe1f0('0x53')](function(_0x56ae28){return _0x56ae28&&_0x56ae28[_0xe1f0('0x54')][0x0]&&_0x56ae28[_0xe1f0('0x54')][0x0][_0xe1f0('0x55')]?_0x56ae28[_0xe1f0('0x54')][0x0][_0xe1f0('0x55')]:'';})['join']('\x0a');_0x3116c1=_0x1a522d[_0xe1f0('0x52')][_0xe1f0('0x53')](function(_0x4c098c){return _0x4c098c&&_0x4c098c[_0xe1f0('0x54')][0x0]&&_0x4c098c[_0xe1f0('0x54')][0x0]['confidence']?_0x4c098c[_0xe1f0('0x54')][0x0]['confidence']:0x0;})[_0xe1f0('0x56')]('\x0a');}logger[_0xe1f0('0x1f')]('googleASR\x20transcription',_0x1ec990);logger[_0xe1f0('0x1f')]('googleASR\x20confidence',_0x3116c1);return{'transcript':_0x1ec990,'confidence':_0x3116c1};})['catch'](function(_0x8995b9){logger[_0xe1f0('0x1a')]('[%s]\x20%s:%s',_0x8995b9['statusCode'],_0x8995b9['name'],_0x8995b9[_0xe1f0('0x57')]);});};exports[_0xe1f0('0x58')]=function(_0x24a0e5,_0x1e7e1a,_0x9b83ce,_0x3a187c){var _0x4411db=apiai(_0x1e7e1a,{'language':_0x3a187c||'en'});return _0x4411db[_0xe1f0('0x59')](_0x9b83ce,{'sessionId':md5(_0x24a0e5)})[_0xe1f0('0x30')](function(_0x426c2d){logger[_0xe1f0('0x1f')](JSON[_0xe1f0('0x46')](_0x426c2d));return{'source':_0x426c2d[_0xe1f0('0x5a')][_0xe1f0('0x5b')],'resolvedQuery':_0x426c2d[_0xe1f0('0x5a')][_0xe1f0('0x5c')],'action':_0x426c2d['result']['action'],'actionIncomplete':_0x426c2d[_0xe1f0('0x5a')][_0xe1f0('0x5d')],'speech':_0x426c2d[_0xe1f0('0x5a')][_0xe1f0('0x5e')][_0xe1f0('0x5f')],'score':_0x426c2d[_0xe1f0('0x5a')]['score'],'statusCode':_0x426c2d[_0xe1f0('0x60')][_0xe1f0('0x61')],'endConversation':_0x426c2d[_0xe1f0('0x5a')]['metadata'][_0xe1f0('0x62')]||![],'isFallbackIntent':_0x426c2d[_0xe1f0('0x5a')]['metadata'][_0xe1f0('0x63')]};});};exports[_0xe1f0('0x64')]=function(_0x218db4,_0x5002a0,_0xb1bbac,_0x518e06,_0x5466d7,_0x296872){var _0xc7c01a=_0x518e06['replace'](/\\n/g,'\x0a');var _0x1241a2={'credentials':{'private_key':_0xc7c01a,'client_email':_0xb1bbac}};var _0x4a5d94=new dialogflow['SessionsClient'](_0x1241a2);var _0x1d24e4=_0x4a5d94[_0xe1f0('0x65')](_0x5002a0,md5(_0x218db4));var _0x4fd8ff={'session':_0x1d24e4,'queryInput':{'text':{'text':_0x5466d7,'languageCode':_0x296872}}};return _0x4a5d94['detectIntent'](_0x4fd8ff)[_0xe1f0('0x30')](function(_0x17e1d6){if(_0x17e1d6&&_0x17e1d6[_0xe1f0('0x4b')]){logger[_0xe1f0('0x1f')](_0xe1f0('0x66'),JSON[_0xe1f0('0x46')](_0x17e1d6));var _0x186041=_0x17e1d6[0x0];if(_0x186041){var _0x4122a2={'action':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x68')],'allRequiredParamsPresent':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x69')],'endConversation':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x6a')]&&_0x186041['queryResult']['diagnosticInfo'][_0xe1f0('0x6b')]?_0x186041[_0xe1f0('0x67')][_0xe1f0('0x6a')]['fields']['end_conversation']['boolValue']:![],'fulfillmentText':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x6c')],'intentName':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x6d')]['name'],'intentDisplayName':_0x186041[_0xe1f0('0x67')]['intent'][_0xe1f0('0x6e')],'isFallbackIntent':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x6d')][_0xe1f0('0x6f')],'languageCode':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x70')],'queryText':_0x186041[_0xe1f0('0x67')]['queryText'],'responseId':_0x186041[_0xe1f0('0x71')],'score':_0x186041[_0xe1f0('0x67')][_0xe1f0('0x72')],'speech':_0x186041[_0xe1f0('0x67')]['fulfillmentText'],'providerResponse':JSON[_0xe1f0('0x46')](_0x17e1d6)};return _0x4122a2;}}});};exports[_0xe1f0('0x73')]=function(_0xcbabdb,_0x2ca1e3,_0x32bd26,_0xab6492){return tilde[_0xe1f0('0x51')](_0xcbabdb,_0x2ca1e3,_0x32bd26,_0xab6492)[_0xe1f0('0x30')](function(_0x9ababc){try{fs[_0xe1f0('0x22')](_0xcbabdb);}catch(_0x1a81ff){logger[_0xe1f0('0x1a')](_0x1a81ff);}logger['info'](_0xe1f0('0x74'),_0x9ababc['transcript']);logger[_0xe1f0('0x1f')](_0xe1f0('0x75'),_0x9ababc[_0xe1f0('0x76')]);return _0x9ababc;});};exports['awsPolly']=function(_0x2c823e,_0x13a211,_0x50de7e,_0x26a20e,_0x5063b2,_0x25997c){var _0x2bed9e=path['resolve'](__dirname,_0xe1f0('0x2b'),rs[_0xe1f0('0x2c')](0x4)+_0xe1f0('0x3b'));var _0x408bce;return aws[_0xe1f0('0x77')](_0x2c823e,_0x13a211,_0x50de7e,_0x26a20e,_0x5063b2,_0x25997c,_0x2bed9e)[_0xe1f0('0x30')](function(){_0x408bce=path[_0xe1f0('0x4e')](__dirname,_0xe1f0('0x2b'),rs[_0xe1f0('0x2c')](0x4)+_0xe1f0('0x2d'));return convertFile(_0x2bed9e,_0x408bce);})[_0xe1f0('0x30')](function(){try{fs[_0xe1f0('0x22')](_0x2bed9e);fs[_0xe1f0('0x31')](_0x408bce,_0xe1f0('0x3f'));}catch(_0x35ac33){logger[_0xe1f0('0x1a')](_0x35ac33);}return _0x408bce[_0xe1f0('0x41')]('.')[0x0];});};exports['awsLex']=function(_0x394971,_0x313767,_0x189c2a,_0x15e867,_0x2febd9,_0x4a6b29){return aws[_0xe1f0('0x78')](_0x394971,_0x313767,_0x189c2a,_0x15e867,_0x2febd9,_0x4a6b29)[_0xe1f0('0x30')](function(_0x36713a){logger['info'](JSON[_0xe1f0('0x46')](_0x36713a));return _0x36713a;});};exports[_0xe1f0('0x79')]=function(_0x59af29,_0x1262a7,_0x5575e2,_0x5b2ff8){var _0x48fd5f=util[_0xe1f0('0x7a')](_0xe1f0('0x7b'),ISPEECH_API,_0x59af29,encodeURIComponent(_0x1262a7),_0x5575e2,_0x5b2ff8);var _0x204855=path[_0xe1f0('0x4e')](__dirname,_0xe1f0('0x2b'),rs['generate'](0x4)+'.mp3');var _0x5e16b7;return downloadFile(_0x48fd5f,_0x204855)[_0xe1f0('0x30')](function(){_0x5e16b7=path[_0xe1f0('0x4e')](__dirname,'tmp',rs[_0xe1f0('0x2c')](0x4)+_0xe1f0('0x2d'));return convertFile(_0x204855,_0x5e16b7);})['then'](function(){try{fs[_0xe1f0('0x22')](_0x204855);fs[_0xe1f0('0x31')](_0x5e16b7,'777');}catch(_0x2592f9){logger[_0xe1f0('0x1a')](_0x2592f9);}return _0x5e16b7[_0xe1f0('0x41')]('.')[0x0];});};exports[_0xe1f0('0x7c')]=function(_0x17897f,_0x1c8dff,_0x1e5881,_0x19b275){var _0x1f5579=util[_0xe1f0('0x7a')](_0xe1f0('0x7d'),ISPEECH_API,_0x1c8dff,_0x1e5881,base64Encode(_0x17897f),_0x19b275?util['format'](_0xe1f0('0x7e'),encodeURIComponent(_0x19b275)):_0xe1f0('0x7f'));return uploadFile(_0x1f5579)[_0xe1f0('0x30')](function(_0x564588){return querystring[_0xe1f0('0xa')](_0x564588);});};exports[_0xe1f0('0x80')]=function(_0x5c875d,_0x3aa2f7){return sestek[_0xe1f0('0x81')](_0x5c875d,_0x3aa2f7)[_0xe1f0('0x30')](function(_0x1e0ef2){logger['info'](JSON['stringify'](_0x1e0ef2));var _0x2ce36d={'speech':_0x1e0ef2[_0xe1f0('0x82')],'action':_0x1e0ef2[_0xe1f0('0x83')]?_0x1e0ef2['channelData'][_0xe1f0('0x84')]:undefined,'actiondata':_0x1e0ef2[_0xe1f0('0x83')]?_0x1e0ef2['channelData']['CustomActionData']:undefined};if(_0x1e0ef2[_0xe1f0('0x83')]&&_0x1e0ef2[_0xe1f0('0x83')][_0xe1f0('0x85')]){return base64Decode(_0x1e0ef2[_0xe1f0('0x83')]['AudioFromTts']['Data'],path[_0xe1f0('0x4e')](__dirname,_0xe1f0('0x2b'),rs['generate'](0x4)+'.wav'))[_0xe1f0('0x30')](function(_0xed981e){_0x2ce36d[_0xe1f0('0x86')]=_0xed981e;return _0x2ce36d;});}return _0x2ce36d;});};exports[_0xe1f0('0x87')]=function(){return __dirname;}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/sestek/index.js b/server/services/agi/scripts/sestek/index.js index 11c25c1..af4d2d1 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 _0xd389=['exports'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xd389,0xe1));var _0x9d38=function(_0x356055,_0x2efe87){_0x356055=_0x356055-0x0;var _0x280917=_0xd389[_0x356055];return _0x280917;};var nda=require('./nda');module[_0x9d38('0x0')]={'nda':nda}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index b66903e..52907cd 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 _0x682e=['text','Bearer\x20','access_token','project','body','channelData','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','CustomActionData','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname'];(function(_0x41aaf4,_0x23f663){var _0x1cc64c=function(_0x1a6e38){while(--_0x1a6e38){_0x41aaf4['push'](_0x41aaf4['shift']());}};_0x1cc64c(++_0x23f663);}(_0x682e,0x1ce));var _0xe682=function(_0x2a875c,_0x5a2c4a){_0x2a875c=_0x2a875c-0x0;var _0x383798=_0x682e[_0x2a875c];return _0x383798;};'use strict';var rp=require(_0xe682('0x0'));var url=require(_0xe682('0x1'));var logger=require(_0xe682('0x2'))(_0xe682('0x3'));module[_0xe682('0x4')]=function(_0x31f019,_0x5cbf47){var _0x2779a7={'method':_0xe682('0x5'),'uri':url[_0xe682('0x6')](_0x5cbf47[_0xe682('0x7')],_0xe682('0x8')),'form':{'grant_type':_0xe682('0x9'),'username':_0x5cbf47[_0xe682('0xa')],'password':_0x5cbf47[_0xe682('0x9')]},'json':!![]};return rp(_0x2779a7)[_0xe682('0xb')](function(_0x1ab428){var _0x4e7e7d={'method':_0xe682('0x5'),'uri':url[_0xe682('0x6')](_0x5cbf47[_0xe682('0xc')],_0xe682('0xd')),'body':{'type':_0x5cbf47[_0xe682('0xe')]||_0xe682('0xf'),'channelId':'Nda','conversation':{'id':_0x31f019[_0xe682('0x10')]},'from':{'id':_0x31f019['callerid'],'name':_0x31f019[_0xe682('0x11')]},'recipient':{'id':_0x31f019['dnid'],'name':_0x31f019['extension']},'text':_0x5cbf47[_0xe682('0x12')],'channelData':{}},'headers':{'Authorization':_0xe682('0x13')+_0x1ab428[_0xe682('0x14')]},'json':!![]};if(_0x5cbf47[_0xe682('0x15')]){_0x4e7e7d[_0xe682('0x16')][_0xe682('0x17')]['ProjectName']=_0x5cbf47[_0xe682('0x15')];}if(_0x5cbf47[_0xe682('0x18')]=='1'){_0x4e7e7d[_0xe682('0x16')][_0xe682('0x17')][_0xe682('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xe682('0x1a')};}if(_0x5cbf47[_0xe682('0x1b')]){_0x4e7e7d[_0xe682('0x16')]['channelData'][_0xe682('0x1c')]=_0x5cbf47['custom_action'];if(_0x5cbf47['custom_action_data']){_0x4e7e7d['body'][_0xe682('0x17')][_0xe682('0x1d')]=_0x5cbf47[_0xe682('0x1e')];}}logger[_0xe682('0x1f')](JSON['stringify'](_0x4e7e7d));return rp(_0x4e7e7d);});}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/tilde/asr/index.js b/server/services/agi/scripts/tilde/asr/index.js index 9930b5f..babe014 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 _0x9c0b=['./lib/api','exports'];(function(_0x4fdf57,_0x17f814){var _0x27ecd4=function(_0x3363a1){while(--_0x3363a1){_0x4fdf57['push'](_0x4fdf57['shift']());}};_0x27ecd4(++_0x17f814);}(_0x9c0b,0x1d2));var _0xb9c0=function(_0x3fbe05,_0x2e38f3){_0x3fbe05=_0x3fbe05-0x0;var _0x5f4d04=_0x9c0b[_0x3fbe05];return _0x5f4d04;};'use strict';var asr=require(_0xb9c0('0x0'));module[_0xb9c0('0x1')]=function(_0x3ccc6b,_0x8dc9e9,_0x5e8502,_0x4dd817){return asr(_0x3ccc6b,_0x8dc9e9,_0x5e8502,_0x4dd817);}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/tilde/asr/lib/api.js b/server/services/agi/scripts/tilde/asr/lib/api.js index 24f0f51..f2815e8 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 _0x1cfe=['hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','close','error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','stringify','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.','Tilde\x20ASR\x20parse\x20error','isNil','isObject','open','message','bluebird','lodash','moment','crypto','agi','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','sha1','digest'];(function(_0x3ba966,_0x2a8f86){var _0x5c2924=function(_0x4a284d){while(--_0x4a284d){_0x3ba966['push'](_0x3ba966['shift']());}};_0x5c2924(++_0x2a8f86);}(_0x1cfe,0x1a7));var _0xe1cf=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x1cfe[_0xb833b1];return _0x1ab87a;};'use strict';var BPromise=require(_0xe1cf('0x0'));var _=require(_0xe1cf('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xe1cf('0x2'));var crypto=require(_0xe1cf('0x3'));var logger=require('../../../../../../config/logger')(_0xe1cf('0x4'));module['exports']=function(_0x439ec9,_0x53ed1d,_0x2f1481,_0x31accc){return new BPromise(function(_0x97596a,_0x33e6af){logger['info']('Tilde\x20URI',_0x31accc||_0xe1cf('0x5'));var _0xaf8b28=new WebSocket(_0x31accc||_0xe1cf('0x5'),{'perMessageDeflate':![]});var _0xbc64d1='';var _0xc6d817='0';var _0x3e6469='1';var _0x551147='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x31d6db(_0x2a5ca2){var _0x2b6a7d=crypto[_0xe1cf('0x6')](_0xe1cf('0x7'));_0x2b6a7d['update'](_0x2a5ca2);return _0x2b6a7d[_0xe1cf('0x8')](_0xe1cf('0x9'));}function _0x29a878(){try{logger[_0xe1cf('0xa')](_0xe1cf('0xb'));var _0x2e2a23=moment()[_0xe1cf('0xc')]();var _0x22527a=_0x31d6db(_0x2e2a23+_0x53ed1d+_0x2f1481);_0xaf8b28[_0xe1cf('0xd')](JSON['stringify']({'appID':_0x53ed1d,'timestamp':_0x2e2a23,'appKey':_0x22527a}));var _0x4d5ed9=fs[_0xe1cf('0xe')](_0x439ec9);_0x4d5ed9['on']('data',function(_0x101723){_0xaf8b28[_0xe1cf('0xd')](_0x101723);});_0x4d5ed9['on'](_0xe1cf('0xf'),function(){_0xaf8b28['send']('EOS');});}catch(_0x61cf3b){logger[_0xe1cf('0x10')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x61cf3b));_0xaf8b28[_0xe1cf('0x11')]();}}function _0x5fb8e2(_0x62ae07){try{if(_0x62ae07){var _0xe872b3=JSON[_0xe1cf('0x12')](_0x62ae07);switch(_0xe872b3[_0xe1cf('0x13')]){case 0x0:if(_0xe872b3[_0xe1cf('0x14')]){if(_0xe872b3['result']['final']){logger[_0xe1cf('0xa')](_0xe1cf('0x15'),JSON[_0xe1cf('0x16')](_0xe872b3['result'][_0xe1cf('0x17')]));_0xbc64d1=_0xe872b3[_0xe1cf('0x14')][_0xe1cf('0x17')][0x0][_0xe1cf('0x18')];_0xc6d817=_0xe872b3['result']['hypotheses'][0x0][_0xe1cf('0x19')];_0x3e6469='0';_0x551147=_0xe1cf('0x1a');_0xaf8b28[_0xe1cf('0x11')]();}}break;case 0x1:logger[_0xe1cf('0xa')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x3e6469='1';_0x551147='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xe1cf('0xa')](_0xe1cf('0x1b'));_0x3e6469='2';_0x551147=_0xe1cf('0x1b');break;case 0x9:logger[_0xe1cf('0xa')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x3e6469='9';_0x551147=_0xe1cf('0x1c');break;case 0xa:logger[_0xe1cf('0xa')](_0xe1cf('0x1d'));_0x3e6469='10';_0x551147=_0xe1cf('0x1d');break;case 0xb:logger[_0xe1cf('0xa')](_0xe1cf('0x1e'));_0x3e6469='11';_0x551147=_0xe1cf('0x1e');}}}catch(_0x33f6cd){logger[_0xe1cf('0x10')](_0xe1cf('0x1f'),JSON[_0xe1cf('0x16')](_0x33f6cd));_0xaf8b28[_0xe1cf('0x11')]();}}function _0x311693(){logger[_0xe1cf('0xa')]('Close\x20Tilde\x20ASR\x20socket');_0x97596a({'transcript':_0xbc64d1,'confidence':_0xc6d817,'status':_0x3e6469,'status_message':_0x551147});}function _0x5d41d6(_0x174174){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xe1cf('0x20')](_0x174174)){logger['error'](_[_0xe1cf('0x21')](_0x174174)?JSON[_0xe1cf('0x16')](_0x174174):_0x174174);}}_0xaf8b28['on'](_0xe1cf('0x22'),_0x29a878);_0xaf8b28['on'](_0xe1cf('0x23'),_0x5fb8e2);_0xaf8b28['on']('close',_0x311693);_0xaf8b28['on'](_0xe1cf('0x10'),_0x5d41d6);});}; \ No newline at end of file +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 diff --git a/server/services/agi/scripts/tilde/index.js b/server/services/agi/scripts/tilde/index.js index 203985f..82d0b08 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 _0xcb50=['./asr','exports'];(function(_0x3f9a09,_0x59befb){var _0xe1b0c1=function(_0x498382){while(--_0x498382){_0x3f9a09['push'](_0x3f9a09['shift']());}};_0xe1b0c1(++_0x59befb);}(_0xcb50,0xde));var _0x0cb5=function(_0x376db5,_0x2b8874){_0x376db5=_0x376db5-0x0;var _0x304c17=_0xcb50[_0x376db5];return _0x304c17;};var asr=require(_0x0cb5('0x0'));module[_0x0cb5('0x1')]={'asr':asr}; \ No newline at end of file +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 diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 9d97003..238fc98 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 _0x330b=['getConnections','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','ready','connection','code','close','E_AGI_SERVER_CLOSE','nextTick','exports','net','EventEmitter','./error','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listening','emit'];(function(_0x52a921,_0x17685f){var _0x2fb53f=function(_0x29f9bb){while(--_0x29f9bb){_0x52a921['push'](_0x52a921['shift']());}};_0x2fb53f(++_0x17685f);}(_0x330b,0x107));var _0xb330=function(_0x3cffcf,_0x52270c){_0x3cffcf=_0x3cffcf-0x0;var _0x37559c=_0x330b[_0x3cffcf];return _0x37559c;};'use strict';var util=require('util');var net=require(_0xb330('0x0'));var EventEmitter=require('events')[_0xb330('0x1')];var AGIError=require(_0xb330('0x2'));var AGIChannel=require('./channel');var AGIServer=function(_0x2ad71d,_0x3c284b,_0x70aa9b){var _0x4f3e06=this,_0x2ad71d=_0x2ad71d||0x11dd,_0x3c284b=_0x3c284b||_0xb330('0x3'),_0x3bb372=null,_0x577ce8=0x0;EventEmitter[_0xb330('0x4')](_0x4f3e06);function _0x235d5f(){if(!_0x2ad71d){_0x4f3e06['emit'](_0xb330('0x5'),new AGIError(_0xb330('0x6')));return![];}_0x3bb372=net[_0xb330('0x7')]();_0x3bb372['listen'](_0x2ad71d,_0x3c284b);_0x3bb372['on'](_0xb330('0x8'),function(){_0x4f3e06[_0xb330('0x9')]('listening');});_0x3bb372['on']('connection',function(_0x4233e9){_0x3bb372[_0xb330('0xa')](function(_0x18791f,_0x1faacf){if(_0x18791f){_0x4f3e06[_0xb330('0x9')](_0xb330('0x5'),new AGIError('E_AGI_SERVER_ERROR',_0x18791f));}else if(_0x70aa9b&&_0x70aa9b<0x0){_0x4f3e06[_0xb330('0x9')](_0xb330('0x5'),new AGIError(_0xb330('0xb')));_0x4233e9['destroy']();}else if(_0x70aa9b&&_0x70aa9b>0x0&&_0x70aa9b<_0x1faacf){_0x577ce8+=0x1;_0x4f3e06[_0xb330('0x9')](_0xb330('0x5'),new AGIError(_0xb330('0xc'),_0x577ce8));_0x4233e9[_0xb330('0xd')]();}else{var _0x85906b=new AGIChannel(_0x4233e9);_0x85906b['on'](_0xb330('0xe'),function(){_0x4f3e06[_0xb330('0x9')](_0xb330('0xf'),_0x85906b);});}});});_0x3bb372['on'](_0xb330('0x5'),function(_0x5089f9){_0x4f3e06[_0xb330('0x9')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x5089f9[_0xb330('0x10')]));});_0x3bb372['on']('close',function(){_0x4f3e06['emit'](_0xb330('0x11'),new AGIError(_0xb330('0x12')));});}process[_0xb330('0x13')](function(){_0x235d5f();});};util['inherits'](AGIServer,EventEmitter);module[_0xb330('0x14')]=function(_0x397e19,_0x5852d3,_0x3ff039){return new AGIServer(_0x397e19,_0x5852d3,_0x3ff039);}; \ No newline at end of file +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 diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 271c852..09fe3d0 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 _0x2343=['sms_text','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','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','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','path','util','lodash','randomstring','mustache','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','getsecretdigits','mailRpc','prototype','getVariable','rpc','then','name','getVoiceQueue','getVoiceQueueById','catch','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','getIntervals','IntervalId','map','interval','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','scheduledAt','Callback\x20scheduled\x20at\x20','callback_priority','getPause','agentPause','agentUnpause','agent','agentLogout','agentLogin','format','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','url','method','timeout','number','POST','PUT','toUpperCase','body','rawBody','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','headers','stringify','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','includes','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','extra','toString','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','mrcprecog','grammar','exec','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','callback','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','add','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','sestektts','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','no\x20grammar\x20configured','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','query','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','getData','response','test','mindigit','maxdigit','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','no\x20valid\x20credentials\x20configured','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','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','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','getSound','digit','output','pause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Executed\x20command\x20%s\x20%s','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','gosub','position','record','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','inspect','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','email','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2343,0x1f1));var _0x3234=function(_0x8854f2,_0x79542c){_0x8854f2=_0x8854f2-0x0;var _0x38505d=_0x2343[_0x8854f2];return _0x38505d;};'use strict';var fs=require('fs');var path=require(_0x3234('0x0'));var util=require(_0x3234('0x1'));var _=require(_0x3234('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x3234('0x3'));var moment=require('moment');var Mustache=require(_0x3234('0x4'));var rp=require('request-promise');var logger=require(_0x3234('0x5'))(_0x3234('0x6'));var config=require(_0x3234('0x7'));var scripts=require('./scripts');var FILES_PATH=_0x3234('0x8');var recursiveMapAttributes=[_0x3234('0x9'),'rawBody'];var verticesWithRetry=['menu','getdigits',_0x3234('0xa')];var AGIVertices=function(_0x100d70,_0x1d2edc,_0x52fa73){this['channel']=_0x100d70;this['rpc']=_0x1d2edc;this[_0x3234('0xb')]=_0x52fa73;};AGIVertices[_0x3234('0xc')][_0x3234('0xd')]=function(_0x288438,_0x1fd913){this[_0x3234('0xe')]['getVariableById'](_0x288438)[_0x3234('0xf')](function(_0x2f8fc9){_0x1fd913(null,_0x2f8fc9?_0x2f8fc9[_0x3234('0x10')]:![]);})['catch'](function(_0x511251){_0x1fd913(_0x511251);});};AGIVertices[_0x3234('0xc')][_0x3234('0x11')]=function(_0x1b0c36,_0x306cd0){this['rpc'][_0x3234('0x12')](_0x1b0c36)[_0x3234('0xf')](function(_0x2f9453){_0x306cd0(null,_0x2f9453?_0x2f9453['name']:![]);})[_0x3234('0x13')](function(_0x437e0e){_0x306cd0(_0x437e0e);});};AGIVertices[_0x3234('0xc')][_0x3234('0x14')]=function(_0x44d260,_0x2955df){this[_0x3234('0xe')][_0x3234('0x15')](_0x44d260)[_0x3234('0xf')](function(_0xbca5f0){_0x2955df(null,_0xbca5f0?_0xbca5f0[_0x3234('0x10')]:![]);})[_0x3234('0x13')](function(_0x49c1fb){_0x2955df(_0x49c1fb);});};AGIVertices[_0x3234('0xc')][_0x3234('0x16')]=function(_0x4d979f,_0x4c4e74){this[_0x3234('0xe')][_0x3234('0x17')](_0x4d979f)[_0x3234('0xf')](function(_0x3ea4fc){_0x4c4e74(null,_0x3ea4fc?_0x3ea4fc['dsn']:![]);})[_0x3234('0x13')](function(_0x521cb9){_0x4c4e74(_0x521cb9);});};AGIVertices['prototype']['getUser']=function(_0x17ee9a,_0x590adb){this[_0x3234('0xe')][_0x3234('0x18')](_0x17ee9a)['then'](function(_0x3c4473){_0x590adb(null,_0x3c4473?_0x3c4473[_0x3234('0x10')]:![]);})[_0x3234('0x13')](function(_0x5bb6ce){_0x590adb(_0x5bb6ce);});};AGIVertices[_0x3234('0xc')][_0x3234('0x19')]=function(_0x42b161,_0x3cd0be){this[_0x3234('0xe')][_0x3234('0x1a')](_0x42b161)['then'](function(_0x1894c7){_0x3cd0be(null,_0x1894c7?_0x1894c7[_0x3234('0x10')]:![]);})[_0x3234('0x13')](function(_0x2a41f3){_0x3cd0be(_0x2a41f3);});};AGIVertices[_0x3234('0xc')]['getSound']=function(_0x41a385,_0x1993e9){var _0x1cadff=this;this[_0x3234('0xe')][_0x3234('0x1b')](_0x41a385)[_0x3234('0xf')](function(_0x263c1f){_0x1993e9(null,_0x263c1f?_0x1cadff[_0x3234('0x1c')](_0x263c1f[_0x3234('0x1d')]):![]);})['catch'](function(_0x18c784){_0x1993e9(_0x18c784);});};AGIVertices['prototype'][_0x3234('0x1e')]=function(_0x154891,_0x547e0c){this['rpc']['getMailAccountById'](_0x154891)[_0x3234('0xf')](function(_0x4b36a2){_0x547e0c(null,_0x4b36a2?_0x4b36a2:![]);})[_0x3234('0x13')](function(_0x57de50){_0x547e0c(_0x57de50);});};AGIVertices[_0x3234('0xc')][_0x3234('0x1f')]=function(_0x2c531d,_0x4dd408,_0x4e76d4){this[_0x3234('0xb')][_0x3234('0x1f')](_0x2c531d,_0x4dd408)[_0x3234('0xf')](function(){_0x4e76d4(null);})['catch'](function(_0x3ebd6d){_0x4e76d4(_0x3ebd6d);});};AGIVertices[_0x3234('0xc')][_0x3234('0x20')]=function(_0x10614c,_0x55aab0){this[_0x3234('0xe')]['getIntervalById'](_0x10614c)[_0x3234('0xf')](function(_0x160283){if(_0x160283){if(_0x160283[_0x3234('0x21')]){_0x55aab0(null,[_0x160283['interval']]);}else{_0x55aab0(null,_[_0x3234('0x22')](_0x160283['Intervals'],_0x3234('0x23')));}}else{_0x55aab0(null,![]);}})['catch'](function(_0x251fe6){_0x55aab0(_0x251fe6);});};AGIVertices[_0x3234('0xc')]['getSoundPath']=function(_0x4150b8){return util['format'](_0x3234('0x24'),FILES_PATH,_0x4150b8);};AGIVertices[_0x3234('0xc')][_0x3234('0x25')]=function(_0x2e6c21,_0x320439,_0x65fa18){odbc[_0x3234('0x26')](_0x2e6c21,function(_0x374c76){if(_0x374c76){logger[_0x3234('0x27')](_0x3234('0x28'),_0x374c76);_0x65fa18(_0x374c76);}else{logger[_0x3234('0x29')](_0x3234('0x2a'));odbc['query'](_0x320439,function(_0x532857,_0x543a15){if(_0x532857){logger[_0x3234('0x29')](_0x3234('0x2b'),_0x320439);_0x65fa18(_0x532857);}else{logger['info'](_0x3234('0x2c'),_0x320439);odbc['close'](function(_0x228cb2){if(_0x228cb2){logger[_0x3234('0x27')](_0x3234('0x2d'),_0x228cb2);}_0x65fa18(null,_0x543a15);});}});}});};AGIVertices[_0x3234('0xc')][_0x3234('0x2e')]=function(_0x2c97ef,_0x17969b){this['rpc'][_0x3234('0x2f')](_0x2c97ef)[_0x3234('0xf')](function(_0x45de31){_0x17969b(null,_0x45de31?_0x45de31:![]);})[_0x3234('0x13')](function(_0x20109d){_0x17969b(_0x20109d);});};AGIVertices['prototype'][_0x3234('0x30')]=function(_0x114c4e,_0x1a8f57){this[_0x3234('0xe')]['createSmsMessage'](_0x114c4e)['then'](function(_0x17848c){_0x1a8f57(null,_0x17848c);})['catch'](function(_0x5eb855){_0x1a8f57(_0x5eb855);});};AGIVertices['prototype'][_0x3234('0x31')]=function(_0x257345,_0x1db0f9,_0x242a7f){this[_0x3234('0xe')]['createSquareDetailsReport']({'uniqueid':this[_0x3234('0x32')][_0x3234('0x33')],'node':_0x257345[_0x3234('0x34')],'application':_0x257345[_0x3234('0x35')],'data':_0x1db0f9||null,'project_name':this['channel'][_0x3234('0x36')],'callerid':this[_0x3234('0x32')][_0x3234('0x37')]})[_0x3234('0xf')](function(_0x5c60e4){if(_0x242a7f){_0x242a7f(null,_0x5c60e4);}})[_0x3234('0x13')](function(_0x3da305){if(_0x242a7f){_0x242a7f(_0x3da305);}});};AGIVertices[_0x3234('0xc')][_0x3234('0x38')]=function(_0x305610,_0x3aa20f,_0x491d44,_0x283160){this[_0x3234('0xe')][_0x3234('0x38')]({'uniqueid':this[_0x3234('0x32')][_0x3234('0x33')],'callerid':this[_0x3234('0x32')][_0x3234('0x37')],'calleridname':this[_0x3234('0x32')][_0x3234('0x39')],'context':this[_0x3234('0x32')][_0x3234('0x3a')],'extension':this[_0x3234('0x32')][_0x3234('0x3b')],'priority':this[_0x3234('0x32')][_0x3234('0x3c')],'accountcode':this[_0x3234('0x32')][_0x3234('0x3d')],'dnid':this[_0x3234('0x32')]['dnid'],'projectName':this[_0x3234('0x32')][_0x3234('0x36')],'saveName':_0x3aa20f,'filename':_0x305610[_0x3234('0x3e')]||_0x3aa20f,'savePath':_0x491d44})[_0x3234('0xf')](function(_0xe7fd72){_0x283160(null,_0xe7fd72);})[_0x3234('0x13')](function(_0x2bf8ce){_0x283160(_0x2bf8ce);});};AGIVertices[_0x3234('0xc')][_0x3234('0x3f')]=function(_0x47196e,_0xfc8fd1,_0x2e0d53,_0x4ec0b2,_0x5afc52){this['rpc'][_0x3234('0x3f')]({'uniqueid':this[_0x3234('0x32')][_0x3234('0x33')],'body':_0x47196e,'direction':_0xfc8fd1,'providerName':_0x2e0d53,'providerResponse':_0x4ec0b2})['then'](function(_0x3bddda){if(_0x5afc52){_0x5afc52(null,_0x3bddda);}})[_0x3234('0x13')](function(_0x4dedda){if(_0x5afc52){_0x5afc52(_0x4dedda);}});};AGIVertices[_0x3234('0xc')][_0x3234('0x40')]=function(_0x7e587c,_0x57a234){this[_0x3234('0xe')][_0x3234('0x40')]({'firstName':_[_0x3234('0x41')](_0x7e587c[_0x3234('0x10')])||_[_0x3234('0x42')](_0x7e587c[_0x3234('0x10')])?_0x3234('0x43')+Math[_0x3234('0x44')]():_0x7e587c[_0x3234('0x10')],'lastName':_[_0x3234('0x41')](_0x7e587c[_0x3234('0x45')])||_[_0x3234('0x42')](_0x7e587c[_0x3234('0x45')])?null:_0x7e587c[_0x3234('0x45')],'phone':_0x7e587c[_0x3234('0x46')],'ListId':_0x7e587c['list_id'],'scheduledat':_0x7e587c[_0x3234('0x47')],'callbackUniqueid':this[_0x3234('0x32')][_0x3234('0x33')],'tags':'callback','description':_0x3234('0x48')+_0x7e587c[_0x3234('0x47')]['toString'](),'priority':_0x7e587c[_0x3234('0x49')]})['then'](function(_0x1ae96d){_0x57a234(null,_0x1ae96d);})[_0x3234('0x13')](function(_0x527c9f){_0x57a234(_0x527c9f);});};AGIVertices['prototype'][_0x3234('0x4a')]=function(_0x5d8f95,_0x8e4515){this[_0x3234('0xe')]['getPauseById'](_0x5d8f95)[_0x3234('0xf')](function(_0x5d0e8b){_0x8e4515(null,_0x5d0e8b?_0x5d0e8b[_0x3234('0x10')]:![]);})[_0x3234('0x13')](function(_0x2f92a6){_0x8e4515(_0x2f92a6);});};AGIVertices[_0x3234('0xc')][_0x3234('0x4b')]=function(_0x51af3b,_0x2673b6,_0x209199){var _0xac9362={'role':'agent'};_0xac9362[_0x51af3b]=this[_0x3234('0x32')][_0x3234('0x37')];this[_0x3234('0xe')][_0x3234('0x4b')](_0xac9362,_0x2673b6,this[_0x3234('0x32')][_0x3234('0x33')])[_0x3234('0xf')](function(_0x45f973){_0x209199(null,_[_0x3234('0x42')](_0x45f973)?![]:!![]);})['catch'](function(_0x2696d6){logger[_0x3234('0x27')](_0x2696d6);_0x209199(null,![]);});};AGIVertices[_0x3234('0xc')][_0x3234('0x4c')]=function(_0x211a83,_0x7af9a4){var _0x278af0={'role':_0x3234('0x4d')};_0x278af0[_0x211a83]=this[_0x3234('0x32')][_0x3234('0x37')];this[_0x3234('0xe')][_0x3234('0x4c')](_0x278af0)['then'](function(_0x521881){_0x7af9a4(null,_[_0x3234('0x42')](_0x521881)?![]:!![]);})[_0x3234('0x13')](function(_0x1b9811){logger['error'](_0x1b9811);_0x7af9a4(null,![]);});};AGIVertices[_0x3234('0xc')][_0x3234('0x4e')]=function(_0x502595,_0x17e0a6){var _0x3023d2={'role':_0x3234('0x4d')};_0x3023d2[_0x502595]=this[_0x3234('0x32')][_0x3234('0x37')];this[_0x3234('0xe')][_0x3234('0x4e')](_0x3023d2)['then'](function(_0x463e92){_0x17e0a6(null,_[_0x3234('0x42')](_0x463e92)?![]:!![]);})['catch'](function(_0x2078a5){logger[_0x3234('0x27')](_0x2078a5);_0x17e0a6(null,![]);});};AGIVertices[_0x3234('0xc')][_0x3234('0x4f')]=function(_0x55b973,_0x5342b3){var _0x1007db={'role':_0x3234('0x4d')};_0x1007db[_0x55b973]=this[_0x3234('0x32')][_0x3234('0x37')];var _0x1b3a8d=_0x55b973!='internal'?util[_0x3234('0x50')]('%s/%s@from-sip/n','LOCAL',this[_0x3234('0x32')]['callerid']):undefined;this[_0x3234('0xe')][_0x3234('0x4f')](_0x1007db,_0x1b3a8d)[_0x3234('0xf')](function(_0x463f0f){_0x5342b3(null,_[_0x3234('0x42')](_0x463f0f)?![]:!![]);})[_0x3234('0x13')](function(_0x4b8c76){logger['error'](_0x4b8c76);_0x5342b3(null,![]);});};AGIVertices[_0x3234('0xc')]['shellCommand']=function(_0x3315be,_0x2108bd){sh['exec'](_[_0x3234('0x51')](_0x3315be),function(_0x5a71ab,_0x272a3c){var _0x3d560d=_0x272a3c[_0x3234('0x52')](/(\r\n|\n|\r)/gm,'');_0x2108bd(null,_0x3d560d);});};AGIVertices[_0x3234('0xc')][_0x3234('0x53')]=function(_0x3fc44d,_0x2171b3){scripts[_0x3234('0x53')](_0x3fc44d[_0x3234('0x54')],_0x3fc44d[_0x3234('0x55')]||_0x3234('0x56'),_0x3fc44d['text'],_0x3fc44d[_0x3234('0x57')]||_0x3234('0x58'),_0x3fc44d[_0x3234('0x59')]||_0x3234('0x5a'),_0x3fc44d[_0x3234('0x5b')]||_0x3234('0x5c'))[_0x3234('0xf')](function(_0xc6b9e2){_0x2171b3(null,_0xc6b9e2);})[_0x3234('0x13')](function(_0x47c443){_0x2171b3(_0x47c443);});};AGIVertices[_0x3234('0xc')][_0x3234('0x5d')]=function(_0x562151,_0x39f6ea){scripts['googleTTS'](_0x562151['text'],_0x562151[_0x3234('0x5e')]||'en',0x1)[_0x3234('0xf')](function(_0x47ba03){_0x39f6ea(null,_0x47ba03);})[_0x3234('0x13')](function(_0x2bf729){_0x39f6ea(_0x2bf729);});};AGIVertices[_0x3234('0xc')]['restAPI']=function(_0x5a3311,_0xa461a5){var _0x3996cb={'uri':_0x5a3311[_0x3234('0x5f')],'method':_0x5a3311[_0x3234('0x60')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x5a3311[_0x3234('0x61')])===_0x3234('0x62')&&parseInt(_0x5a3311['timeout'])>=0x1?parseInt(_0x5a3311[_0x3234('0x61')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x3234('0x63'),_0x3234('0x64')],_0x3996cb['method'][_0x3234('0x65')]())){try{_0x3996cb[_0x3234('0x66')]=_0x5a3311[_0x3234('0x67')]?JSON[_0x3234('0x68')](_0x5a3311[_0x3234('0x67')]):{};}catch(_0x56b834){logger['error'](_0x3234('0x69'),_0x56b834);}}try{_0x3996cb['headers']=_0x5a3311[_0x3234('0x9')]?JSON[_0x3234('0x68')](_0x5a3311['rawHeaders']):{};}catch(_0x60c5f3){logger[_0x3234('0x27')](_0x3234('0x6a'),_0x60c5f3);}if(_0x5a3311[_0x3234('0x6b')]){try{var _0x2f9fa6=require(_0x5a3311[_0x3234('0x6b')])[_0x3234('0x6c')](this,_0x3996cb);_0x3996cb[_0x3234('0x6d')]=Mustache[_0x3234('0x6e')](_0x5a3311[_0x3234('0x5f')],_0x2f9fa6,{},['$$','$$']);if(_0x3996cb[_0x3234('0x6f')]){_0x3996cb['headers']=JSON[_0x3234('0x68')](Mustache[_0x3234('0x6e')](JSON['stringify'](_0x3996cb[_0x3234('0x6f')]),_0x2f9fa6,{},['$$','$$']));}if(_0x3996cb['body']){_0x3996cb[_0x3234('0x66')]=JSON[_0x3234('0x68')](Mustache[_0x3234('0x6e')](JSON[_0x3234('0x70')](_0x3996cb[_0x3234('0x66')]),_0x2f9fa6,{},['$$','$$']));}}catch(_0x41fb0e){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x41fb0e);}}rp(_0x3996cb)[_0x3234('0xf')](function(_0x468c72){var _0x15e396={'statusCode':_0x468c72[_0x3234('0x71')]||0xc8,'statusMessage':_0x468c72[_0x3234('0x72')]||'OK','headers':_0x468c72[_0x3234('0x6f')]||{},'body':_0x468c72[_0x3234('0x66')]||{}};_0xa461a5(null,_0x15e396);})[_0x3234('0x13')](function(_0x323616){var _0x3c66bb={'statusCode':_0x323616['statusCode']||0x1f4,'statusMessage':_0x323616[_0x3234('0x73')]||_0x3234('0x74'),'headers':_0x323616['options'][_0x3234('0x6f')]||{},'body':_0x323616[_0x3234('0x75')][_0x3234('0x66')]||{}};_0xa461a5(null,_0x3c66bb);});};AGIVertices[_0x3234('0xc')][_0x3234('0x76')]=function(_0x3427d1,_0x57bd1c){scripts[_0x3234('0x76')](this[_0x3234('0x32')][_0x3234('0x33')],_0x3427d1[_0x3234('0x77')],_0x3427d1[_0x3234('0x56')],_0x3427d1[_0x3234('0x78')]||'en')['then'](function(_0xf5c96b){_0x57bd1c(null,_0xf5c96b);})[_0x3234('0x13')](function(_0x59d301){_0x57bd1c(_0x59d301);});};AGIVertices[_0x3234('0xc')][_0x3234('0x79')]=function(_0x47e608,_0x46351e){scripts[_0x3234('0x79')](this['channel'][_0x3234('0x33')],_0x47e608[_0x3234('0x7a')],_0x47e608[_0x3234('0x7b')],_0x47e608[_0x3234('0x7c')],_0x47e608[_0x3234('0x56')],_0x47e608[_0x3234('0x7d')]||'en')[_0x3234('0xf')](function(_0x1403b2){_0x46351e(null,_0x1403b2);})[_0x3234('0x13')](function(_0x389548){_0x46351e(_0x389548);});};AGIVertices[_0x3234('0xc')][_0x3234('0x7e')]=function(_0x291f8d,_0x3cdf71){scripts[_0x3234('0x7e')](this[_0x3234('0x32')],_0x291f8d)[_0x3234('0xf')](function(_0x1d734a){_0x3cdf71(null,_0x1d734a);})['catch'](function(_0xd870cb){_0x3cdf71(_0xd870cb);});};AGIVertices[_0x3234('0xc')][_0x3234('0x7f')]=function(_0x1d7557,_0x10f26e){scripts[_0x3234('0x7f')](_0x1d7557[_0x3234('0x77')],_0x1d7557[_0x3234('0x56')],_0x1d7557[_0x3234('0x80')]||_0x3234('0x58'),_0x1d7557[_0x3234('0x81')])[_0x3234('0xf')](function(_0x5e6f7f){_0x10f26e(null,_0x5e6f7f);})[_0x3234('0x13')](function(_0x49596b){_0x10f26e(_0x49596b);});};AGIVertices[_0x3234('0xc')][_0x3234('0x82')]=function(_0x3a4e99,_0x4b285d,_0x42490a){scripts[_0x3234('0x82')](_0x4b285d,_0x3a4e99[_0x3234('0x77')],_0x3a4e99[_0x3234('0x83')]||_0x3234('0x58'),this[_0x3234('0x84')](_0x3a4e99[_0x3234('0x85')])?_0x3a4e99['model']:undefined)['then'](function(_0x11b9fd){_0x42490a(null,_0x11b9fd);})[_0x3234('0x13')](function(_0x17a0fd){_0x42490a(_0x17a0fd);});};AGIVertices['prototype'][_0x3234('0x86')]=function(_0x5199c3,_0x42e999){scripts['awsPolly'](_0x5199c3['aws_access_key_id'],_0x5199c3[_0x3234('0x87')],_0x5199c3[_0x3234('0x88')],_0x5199c3[_0x3234('0x89')]||'Amy',_0x5199c3[_0x3234('0x56')],_0x5199c3[_0x3234('0x8a')]||_0x3234('0x56'))[_0x3234('0xf')](function(_0x91a92f){_0x42e999(null,_0x91a92f);})['catch'](function(_0x5bd01e){_0x42e999(_0x5bd01e);});};AGIVertices[_0x3234('0xc')]['awsLex']=function(_0x24881f,_0xc83e73){scripts[_0x3234('0x8b')](this[_0x3234('0x32')][_0x3234('0x33')],_0x24881f[_0x3234('0x8c')],_0x24881f[_0x3234('0x87')],_0x24881f['aws_lex_region'],_0x24881f['text'],_0x24881f['aws_bot_name'])[_0x3234('0xf')](function(_0x5436a8){_0xc83e73(null,_0x5436a8);})[_0x3234('0x13')](function(_0x4de1a4){_0xc83e73(_0x4de1a4);});};AGIVertices[_0x3234('0xc')][_0x3234('0x8d')]=function(_0xc367c2,_0x39ec23,_0x346096){scripts[_0x3234('0x8d')](_0x39ec23,_0xc367c2[_0x3234('0x77')],_0xc367c2[_0x3234('0x8e')]||_0x3234('0x58'))[_0x3234('0xf')](function(_0x253a12){_0x346096(null,_0x253a12);})[_0x3234('0x13')](function(_0x5547ff){_0x346096(_0x5547ff);});};AGIVertices[_0x3234('0xc')]['tildeASR']=function(_0x5a6386,_0x1ffd6f,_0x177dac){scripts[_0x3234('0x8f')](_0x1ffd6f,_0x5a6386[_0x3234('0x90')],_0x5a6386[_0x3234('0x91')],_0x5a6386['uri'])[_0x3234('0xf')](function(_0x193206){_0x177dac(null,_0x193206);})[_0x3234('0x13')](function(_0x3ae54b){_0x177dac(_0x3ae54b);});};AGIVertices['prototype'][_0x3234('0x92')]=function(_0x454e85){var _0x4ee7f0=_[_0x3234('0x93')](verticesWithRetry,_0x454e85[_0x3234('0x35')])?_0x454e85:_[_0x3234('0x94')](_0x454e85);for(var _0x1ac290 in _0x4ee7f0){if(_0x4ee7f0[_0x3234('0x95')](_0x1ac290)){if(_0x4ee7f0[_0x1ac290]&&_[_0x3234('0x96')](_0x4ee7f0[_0x1ac290])){if(_[_0x3234('0x93')](recursiveMapAttributes,_0x1ac290)){_0x4ee7f0[_0x1ac290]=this['replaceObjectAllVariables'](_0x4ee7f0[_0x1ac290]);}else{_0x4ee7f0[_0x1ac290]=this[_0x3234('0x97')](_0x4ee7f0[_0x1ac290]);}}}}return _0x4ee7f0;};AGIVertices[_0x3234('0xc')][_0x3234('0x98')]=function(_0x5a82fd){for(var _0x208f06 in _0x5a82fd){if(_0x5a82fd[_0x3234('0x95')](_0x208f06)){if(_['isPlainObject'](_0x5a82fd[_0x208f06])){this['recursiveNodeIndex'](_0x5a82fd[_0x208f06]);}else if(_[_0x3234('0x99')](_0x5a82fd[_0x208f06])){for(var _0x222588=0x0;_0x222588<_0x5a82fd[_0x208f06]['length'];_0x222588++){this[_0x3234('0x98')](_0x5a82fd[_0x208f06][_0x222588]);}}else if(_[_0x3234('0x96')](_0x5a82fd[_0x208f06])){_0x5a82fd[_0x208f06]=this[_0x3234('0x97')](_0x5a82fd[_0x208f06]);}}}};AGIVertices['prototype'][_0x3234('0x9a')]=function(_0x34727c,_0x197742){for(var _0x25c1ad in _0x34727c){if(_0x34727c[_0x3234('0x95')](_0x25c1ad)){if(_['isPlainObject'](_0x34727c[_0x25c1ad])){if(!_[_0x3234('0x41')](_0x34727c[_0x25c1ad])){this[_0x3234('0x9a')](_0x34727c[_0x25c1ad],util['format'](_0x3234('0x9b'),_0x197742,_0x25c1ad));}}else if(_['isArray'](_0x34727c[_0x25c1ad])){for(var _0x163862=0x0;_0x163862<_0x34727c[_0x25c1ad][_0x3234('0x9c')];_0x163862++){this[_0x3234('0x9a')](_0x34727c[_0x25c1ad][_0x163862],util['format']('%s.%s',_0x197742,_0x25c1ad+'['+_0x163862+']'));}}else{if(!_[_0x3234('0x42')](_0x34727c[_0x25c1ad])){this[_0x3234('0x32')][_0x3234('0x9d')](util[_0x3234('0x50')]('%s.%s',_0x197742,_0x25c1ad),_0x34727c[_0x25c1ad]);}}}}};AGIVertices['prototype'][_0x3234('0x9e')]=function(_0x58295a){try{var _0x48c240=JSON[_0x3234('0x68')](_0x58295a);this[_0x3234('0x98')](_0x48c240);return JSON[_0x3234('0x70')](_0x48c240);}catch(_0x24bea8){return this[_0x3234('0x97')](_0x58295a);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x2f0e8a){var _0x2356b8=_0x2f0e8a[_0x3234('0x9f')]('{');for(var _0x41513c=0x1;_0x41513c<_0x2356b8[_0x3234('0x9c')];_0x41513c+=0x1){var _0x46487f=_0x2356b8[_0x41513c]['split']('}');if(_0x46487f[_0x3234('0x9c')]>0x1){_0x2f0e8a=_0x2f0e8a[_0x3234('0xa0')]('{'+_0x46487f[0x0]+'}',this[_0x3234('0x32')][_0x3234('0xd')](_0x46487f[0x0])[_0x3234('0xa1')]||_0x46487f[0x0]);}}if(_0x2356b8[_0x3234('0x9c')]===0x1){return _0x2f0e8a[_0x3234('0xa2')]();}return this['replaceAllVariables'](_0x2f0e8a);};AGIVertices[_0x3234('0xc')][_0x3234('0xa3')]=function(_0x554963,_0x640b85){var _0x1d0179=this[_0x3234('0x32')][_0x3234('0xd')](_0x554963);if(_0x1d0179['result']===-0x1){return _0x1d0179;}logger['info'](util['format'](_0x3234('0xa4'),_0x640b85,_0x1d0179[_0x3234('0xa1')]));return this[_0x3234('0x32')][_0x3234('0x9d')](_0x640b85,_0x1d0179[_0x3234('0xa1')]);};AGIVertices['prototype']['isConfigured']=function(_0x45778c){return _0x45778c&&_0x45778c!=='0'&&_0x45778c!=='-1'&&_0x45778c!=='';};AGIVertices[_0x3234('0xc')][_0x3234('0xa5')]=function(_0x4b4f97){this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x4b4f97,'-');_0x4b4f97[_0x3234('0xa6')]=_0x4b4f97[_0x3234('0xa5')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x3234('0xc')][_0x3234('0xa7')]=function(_0x25a45f){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xa8'),_0x25a45f['label']));if(!this['isConfigured'](_0x25a45f[_0x3234('0x56')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xaa'));}var _0x123d45='\x22'+_0x25a45f[_0x3234('0x56')]+'\x22';if(this[_0x3234('0x84')](_0x25a45f[_0x3234('0x75')])){_0x123d45+=','+_0x25a45f['options'];}var _0x3dfa27=this['channel']['exec'](_0x3234('0xab'),_0x123d45);if(_0x3dfa27[_0x3234('0xac')]===-0x1){return _0x3dfa27;}return this[_0x3234('0x32')]['noop'](util[_0x3234('0x50')]('Executed\x20command\x20MRCPSynth\x20%s',_0x123d45));};AGIVertices['prototype'][_0x3234('0xad')]=function(_0x50b49f){logger[_0x3234('0x29')](util['format']('Enter\x20in\x20MRCPRecog\x20(%s)\x20block',_0x50b49f[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x50b49f[_0x3234('0xae')])){return this[_0x3234('0x32')][_0x3234('0xa9')]('no\x20grammar\x20configured');}var _0x53c667=_0x50b49f[_0x3234('0xae')];if(this[_0x3234('0x84')](_0x50b49f[_0x3234('0x75')])){_0x53c667+=','+_0x50b49f['options'];}var _0x4452f7=this['channel'][_0x3234('0xaf')](_0x3234('0xb0'),_0x53c667);if(_0x4452f7[_0x3234('0xac')]===-0x1){return _0x4452f7;}var _0xd074=this['getAndSetVariable'](_0x3234('0xb1'),_0x3234('0xb2'));if(_0xd074['result']===-0x1){return _0xd074;}var _0x5b1cdf=this['getAndSetVariable'](_0x3234('0xb3'),_0x3234('0xb4'));if(_0x5b1cdf['result']===-0x1){return _0x5b1cdf;}var _0x3581ab=this[_0x3234('0xa3')](_0x3234('0xb5'),_0x3234('0xb6'));if(_0x3581ab['result']===-0x1){return _0x3581ab;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xb7'),_0x53c667));};AGIVertices[_0x3234('0xc')]['agi']=function(_0xb0fe19){logger['info'](util[_0x3234('0x50')](_0x3234('0xb8'),_0xb0fe19[_0x3234('0x34')]));return this['channel']['agi']([_0xb0fe19[_0x3234('0xb9')],_0xb0fe19[_0x3234('0xba')]]);};AGIVertices[_0x3234('0xc')]['answer']=function(_0x12716a){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xbb'),_0x12716a[_0x3234('0x34')]));if(this[_0x3234('0x84')](_0x12716a[_0x3234('0x61')])){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xbc'),_0x12716a['timeout']));var _0x6be0a=this[_0x3234('0x32')][_0x3234('0xbd')](_0x12716a['timeout']);if(_0x6be0a[_0x3234('0xac')]===-0x1){return _0x6be0a;}}return this[_0x3234('0x32')][_0x3234('0xbe')]();};AGIVertices[_0x3234('0xc')][_0x3234('0xbf')]=function(_0x341a35){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xc0'),_0x341a35[_0x3234('0x34')]));if(!this['isConfigured'](_0x341a35[_0x3234('0xc1')])){return this[_0x3234('0x32')]['error'](_0x341a35,'no\x20list\x20selected');}_0x341a35[_0x3234('0x47')]=moment();if(this[_0x3234('0x84')](_0x341a35['delay'])){_0x341a35[_0x3234('0x47')]=moment()[_0x3234('0xc2')](_0x341a35[_0x3234('0xc3')],_0x3234('0xc4'));}if(!this[_0x3234('0x84')](_0x341a35['callback_priority'])){_0x341a35[_0x3234('0x49')]=0x2;}this[_0x3234('0x40')][_0x3234('0x6c')](this,_0x341a35);return this['channel'][_0x3234('0xa9')](util['format'](_0x3234('0xc5'),_0x341a35[_0x3234('0x46')],_0x341a35[_0x3234('0xc1')],_0x341a35[_0x3234('0x47')]));};AGIVertices['prototype'][_0x3234('0xc6')]=function(_0x4f355b){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xc7'),_0x4f355b[_0x3234('0x34')]));var _0x5bb309=this[_0x3234('0x32')][_0x3234('0xaf')](_0x4f355b['application'],_0x4f355b[_0x3234('0x75')]);if(_0x5bb309[_0x3234('0xac')]===-0x1){return _0x5bb309;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('Executed\x20command\x20%s\x20%s',_0x4f355b[_0x3234('0xc8')],_0x4f355b[_0x3234('0x75')]));};AGIVertices[_0x3234('0xc')][_0x3234('0xc9')]=function(_0x5ea89e){logger[_0x3234('0x29')](util[_0x3234('0x50')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5ea89e[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x5ea89e[_0x3234('0x56')])){return this['channel'][_0x3234('0xa9')](_0x3234('0xaa'));}var _0x295794='\x22'+_0x5ea89e['text']+'\x22';if(this[_0x3234('0x84')](_0x5ea89e['options'])){_0x295794+=','+_0x5ea89e[_0x3234('0x75')];}var _0x150dac=this['channel']['exec'](_0x3234('0xab'),_0x295794);if(_0x150dac[_0x3234('0xac')]===-0x1){return _0x150dac;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('Executed\x20command\x20MRCPSynth\x20%s',_0x295794));};AGIVertices[_0x3234('0xc')][_0x3234('0xca')]=function(_0x24ba67){logger[_0x3234('0x29')](util[_0x3234('0x50')]('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x24ba67[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x24ba67[_0x3234('0x56')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xaa'));}var _0x9e40cc='\x22'+_0x24ba67[_0x3234('0x56')]+'\x22';if(this[_0x3234('0x84')](_0x24ba67[_0x3234('0x75')])){_0x9e40cc+=','+_0x24ba67[_0x3234('0x75')];}var _0x34cc18=this[_0x3234('0x32')]['exec'](_0x3234('0xab'),_0x9e40cc);if(_0x34cc18[_0x3234('0xac')]===-0x1){return _0x34cc18;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xcb'),_0x9e40cc));};AGIVertices[_0x3234('0xc')]['lumenvoxasr']=function(_0x3707c0){logger[_0x3234('0x29')](util['format'](_0x3234('0xcc'),_0x3707c0[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x3707c0[_0x3234('0xae')])){return this[_0x3234('0x32')]['noop']('no\x20grammar\x20configured');}var _0x3c3301=_0x3707c0[_0x3234('0xae')];if(this['isConfigured'](_0x3707c0[_0x3234('0x75')])){_0x3c3301+=','+_0x3707c0[_0x3234('0x75')];}var _0x54a589=this['channel'][_0x3234('0xaf')](_0x3234('0xb0'),_0x3c3301);if(_0x54a589[_0x3234('0xac')]===-0x1){return _0x54a589;}var _0x5d3c63=this[_0x3234('0xa3')](_0x3234('0xb1'),_0x3234('0xcd'));if(_0x5d3c63['result']===-0x1){return _0x5d3c63;}var _0x2523b9=this[_0x3234('0xa3')](_0x3234('0xb3'),_0x3234('0xce'));if(_0x2523b9[_0x3234('0xac')]===-0x1){return _0x2523b9;}var _0x33adf7=this[_0x3234('0xa3')](_0x3234('0xb5'),_0x3234('0xcf'));if(_0x33adf7[_0x3234('0xac')]===-0x1){return _0x33adf7;}return this[_0x3234('0x32')][_0x3234('0xa9')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x3c3301));};AGIVertices[_0x3234('0xc')][_0x3234('0xd0')]=function(_0x1b8e9f){logger['info'](util[_0x3234('0x50')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1b8e9f[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x1b8e9f[_0x3234('0xae')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xd1'));}var _0x55261d=_0x1b8e9f[_0x3234('0xae')];if(this[_0x3234('0x84')](_0x1b8e9f['options'])){_0x55261d+=','+_0x1b8e9f[_0x3234('0x75')];}var _0x302e27=this[_0x3234('0x32')][_0x3234('0xaf')]('MRCPRecog',_0x55261d);if(_0x302e27['result']===-0x1){return _0x302e27;}var _0x40bd4a=this[_0x3234('0xa3')](_0x3234('0xb1'),_0x3234('0xd2'));if(_0x40bd4a[_0x3234('0xac')]===-0x1){return _0x40bd4a;}var _0x533071=this['getAndSetVariable']('RECOG_INPUT()',_0x3234('0xd3'));if(_0x533071['result']===-0x1){return _0x533071;}var _0x557ca0=this[_0x3234('0xa3')](_0x3234('0xb5'),_0x3234('0xd4'));if(_0x557ca0[_0x3234('0xac')]===-0x1){return _0x557ca0;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xb7'),_0x55261d));};AGIVertices[_0x3234('0xc')][_0x3234('0xd5')]=function(_0x145cb0){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xd6'),_0x145cb0['label']));if(!this[_0x3234('0x84')](_0x145cb0[_0x3234('0xd7')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x145cb0,_0x3234('0xd8'));}var _0x342234=this[_0x3234('0x16')][_0x3234('0x6c')](this,_0x145cb0[_0x3234('0xd7')]);if(!_0x342234){return this[_0x3234('0x32')][_0x3234('0x27')](_0x145cb0,'no\x20odbc\x20database\x20found');}if(!this[_0x3234('0x84')](_0x145cb0[_0x3234('0xd9')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x145cb0,_0x3234('0xda'));}var _0x314ed6=_0x145cb0[_0x3234('0xd9')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xdb'),_0x314ed6));var _0x52fe80=this[_0x3234('0x25')]['sync'](this,_0x342234,_0x314ed6);this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x145cb0,_0x314ed6);if(!this[_0x3234('0x84')](_0x145cb0[_0x3234('0xdc')])){return this['channel'][_0x3234('0xa9')](_0x3234('0xdd'));}var _0xd69585=this[_0x3234('0xd')][_0x3234('0x6c')](this,_0x145cb0[_0x3234('0xdc')]);if(!_0xd69585){return this['channel']['error'](_0x145cb0,_0x3234('0xde'));}var _0xc326e0=this;_0x52fe80['forEach'](function(_0x3f3b95,_0x5803dd){Object[_0x3234('0xdf')](_0x3f3b95)[_0x3234('0xe0')](function(_0x2870c1){_0xc326e0[_0x3234('0x32')][_0x3234('0x9d')](util['format']('%s[%s][%s]',_0xd69585,_0x5803dd,_0x2870c1),_0x3f3b95[_0x2870c1]);});});this[_0x3234('0x32')][_0x3234('0x9d')](util[_0x3234('0x50')](_0x3234('0xe1'),_0xd69585),_0x52fe80['length']);return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xe2'),_0xd69585));};AGIVertices[_0x3234('0xc')][_0x3234('0xe3')]=function(_0xd24f69){logger[_0x3234('0xe4')](util[_0x3234('0x50')](_0x3234('0xe5'),_0xd24f69['label']));if(!this[_0x3234('0x84')](_0xd24f69[_0x3234('0xe6')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0xd24f69,_0x3234('0xe7'));}var _0x1be4c0=this[_0x3234('0xe8')][_0x3234('0x6c')](this,_0xd24f69[_0x3234('0xe6')]);if(!_0x1be4c0){return this[_0x3234('0x32')][_0x3234('0x27')](_0xd24f69,'no\x20user\x20found');}var _0x83b389=this[_0x3234('0x32')]['exec'](_0x3234('0xe9'),[util['format'](_0x3234('0xea'),_0x1be4c0),_0xd24f69[_0x3234('0x61')],_0xd24f69[_0x3234('0xeb')],_0xd24f69[_0x3234('0x5f')]]);if(_0x83b389[_0x3234('0xac')]===-0x1){return _0x83b389;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xec'),'DIAL'));};AGIVertices[_0x3234('0xc')][_0x3234('0xed')]=function(_0x4119d7){logger[_0x3234('0x29')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x4119d7[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x4119d7[_0x3234('0x77')])){return this[_0x3234('0x32')][_0x3234('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x4119d7[_0x3234('0x56')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xaa'));}this['channel'][_0x3234('0xee')]=!![];this['createSquareDetailsReport'](_0x4119d7);this['createSquareMessage'](_0x4119d7[_0x3234('0x56')],'in','','');this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xef'),_0x4119d7['text']));var _0x574340=this[_0x3234('0x76')]['sync'](this,_0x4119d7);if(_0x574340){for(var _0xcd468 in _0x574340){if(_0x574340[_0x3234('0x95')](_0xcd468)){this[_0x3234('0x32')][_0x3234('0x9d')](util[_0x3234('0x50')](_0x3234('0xf0'),_0xcd468[_0x3234('0x65')]()),_0x574340[_0xcd468]);}}this[_0x3234('0x3f')](_0x574340[_0x3234('0xf1')],_0x3234('0xf2'),_0x3234('0xed'),'');return this['channel'][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xf3'),_0x574340[_0x3234('0xf1')]));}return this[_0x3234('0x32')][_0x3234('0x27')](_0x4119d7,_0x3234('0xf4'));};AGIVertices[_0x3234('0xc')][_0x3234('0xf5')]=function(_0x4099c0){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xf6'),_0x4099c0[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x4099c0[_0x3234('0x7a')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xf7'));}if(!this[_0x3234('0x84')](_0x4099c0[_0x3234('0x7b')])){return this[_0x3234('0x32')]['noop']('no\x20client_email\x20configured');}if(!this[_0x3234('0x84')](_0x4099c0['private_key'])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xf8'));}if(!this[_0x3234('0x84')](_0x4099c0[_0x3234('0x7d')])){return this['channel'][_0x3234('0xa9')](_0x3234('0xf9'));}if(!this[_0x3234('0x84')](_0x4099c0[_0x3234('0x56')])){return this['channel'][_0x3234('0xa9')](_0x3234('0xaa'));}this[_0x3234('0x32')][_0x3234('0xee')]=!![];this['createSquareDetailsReport'](_0x4099c0);this[_0x3234('0x3f')](_0x4099c0[_0x3234('0x56')],'in','','');this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0xfa'),_0x4099c0[_0x3234('0x56')]));var _0x1f1d08=this['googleDialogflowV2'][_0x3234('0x6c')](this,_0x4099c0);if(_0x1f1d08){for(var _0xa72c4e in _0x1f1d08){if(_0x1f1d08[_0x3234('0x95')](_0xa72c4e)){if(_0xa72c4e!==_0x3234('0xfb')){this[_0x3234('0x32')][_0x3234('0x9d')](util[_0x3234('0x50')]('DIALOGFLOW_%s',_0xa72c4e[_0x3234('0x65')]()),_0x1f1d08[_0xa72c4e]);}}}this[_0x3234('0x3f')](_0x1f1d08[_0x3234('0xf1')],_0x3234('0xf2'),'dialogflowV2',_0x1f1d08[_0x3234('0xfb')]);return this['channel'][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0xfc'),_0x1f1d08['speech']));}return this[_0x3234('0x32')][_0x3234('0x27')](_0x4099c0,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x3234('0xc')][_0x3234('0xfd')]=function(_0x5cb7c5){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0xfe'),_0x5cb7c5[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x5cb7c5[_0x3234('0xff')])){return this['channel'][_0x3234('0xa9')](_0x3234('0x100'));}if(!this['isConfigured'](_0x5cb7c5[_0x3234('0x101')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x102'));}if(!this[_0x3234('0x84')](_0x5cb7c5[_0x3234('0x103')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x104'));}if(!this['isConfigured'](_0x5cb7c5[_0x3234('0x105')])){return this[_0x3234('0x32')]['noop'](_0x3234('0xaa'));}this[_0x3234('0x32')][_0x3234('0xee')]=!![];this['createSquareDetailsReport'](_0x5cb7c5);this[_0x3234('0x3f')](_0x5cb7c5['text'],'in','','');this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x106'),_0x5cb7c5[_0x3234('0x56')]));var _0x2ba3a1=this[_0x3234('0x7e')][_0x3234('0x6c')](this,_0x5cb7c5);if(_0x2ba3a1){for(var _0x5ed37c in _0x2ba3a1){if(_0x2ba3a1[_0x3234('0x95')](_0x5ed37c)){this[_0x3234('0x32')]['setVariable'](util['format'](_0x3234('0x107'),_0x5ed37c['toUpperCase']()),_0x2ba3a1[_0x5ed37c]);}}this[_0x3234('0x3f')](_0x2ba3a1[_0x3234('0xf1')],'out','sesteknda','');if(_0x2ba3a1[_0x3234('0x108')]){this[_0x3234('0x32')]['noop'](util['format'](_0x3234('0x109'),_0x2ba3a1[_0x3234('0x108')]));var _0x2a700a=this[_0x3234('0x32')][_0x3234('0x10a')](_0x2ba3a1[_0x3234('0x108')]);try{fs[_0x3234('0x10b')](_0x2ba3a1[_0x3234('0x108')]+_0x3234('0x10c'));}catch(_0x27e00f){logger[_0x3234('0x27')](_0x27e00f);}return _0x2a700a;}else{return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x10d'),_0x2ba3a1[_0x3234('0xf1')]));}}return this['channel'][_0x3234('0x27')](_0x5cb7c5,_0x3234('0x10e'));};AGIVertices['prototype']['end']=function(_0x55ddc7){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x10f'),_0x55ddc7[_0x3234('0x34')]));return this['channel']['noop'](_0x3234('0x110'));};AGIVertices[_0x3234('0xc')][_0x3234('0x111')]=function(_0x155e93){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x112'),_0x155e93[_0x3234('0x34')]));var _0xe3d209='';if(_0x155e93[_0x3234('0x113')]){if(!this[_0x3234('0x84')](_0x155e93[_0x3234('0x113')])){return this[_0x3234('0x32')]['error'](_0x155e93,_0x3234('0x114'));}else{var _0x373619=parseInt(_0x155e93['trunk_id'],0xa);if(isNaN(_0x373619)){_0xe3d209=_0x155e93['trunk_id'];}else{_0xe3d209=this['getTrunk'][_0x3234('0x6c')](this,_0x155e93['trunk_id']);if(!_0xe3d209){return this[_0x3234('0x32')][_0x3234('0x27')](_0x155e93,_0x3234('0x115'));}}}}else if(_0x155e93[_0x3234('0x116')]){_0xe3d209=_0x155e93[_0x3234('0x116')];}else{return this['channel'][_0x3234('0x27')](_0x155e93,_0x3234('0x114'));}var _0x126b62=this[_0x3234('0x32')][_0x3234('0xaf')](_0x3234('0xe9'),[util['format']('SIP/%s/%s',_0xe3d209,_0x155e93[_0x3234('0x46')]),_0x155e93[_0x3234('0x61')],_0x155e93[_0x3234('0xeb')],_0x155e93[_0x3234('0x5f')]]);if(_0x126b62['result']===-0x1){return _0x126b62;}return this[_0x3234('0x32')]['noop'](util[_0x3234('0x50')](_0x3234('0xec'),_0x3234('0xe9')));};AGIVertices[_0x3234('0xc')][_0x3234('0x117')]=function(_0x36b5c2){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x118'),_0x36b5c2[_0x3234('0x34')]));return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x117'));};AGIVertices[_0x3234('0xc')][_0x3234('0x119')]=function(_0x3bc0b8){logger[_0x3234('0x29')](util['format'](_0x3234('0x11a'),_0x3bc0b8[_0x3234('0x34')]));if(_0x3bc0b8[_0x3234('0xa6')]===0x0){return this[_0x3234('0xa5')](_0x3bc0b8);}_0x3bc0b8[_0x3234('0xa6')]-=0x1;if(!this['isConfigured'](_0x3bc0b8['file_id'])){return this['channel'][_0x3234('0x27')](_0x3bc0b8,_0x3234('0x11b'));}var _0x52cd9=this['getSound'][_0x3234('0x6c')](this,_0x3bc0b8[_0x3234('0x11c')]);if(!_0x52cd9){return this['channel'][_0x3234('0x27')](_0x3bc0b8,_0x3234('0x11d'));}if(!this[_0x3234('0x84')](_0x3bc0b8[_0x3234('0xdc')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x3234('0xdd'));}var _0x22209a=this[_0x3234('0x32')][_0x3234('0x11e')](_0x52cd9,_0x3bc0b8[_0x3234('0x11f')],_0x3bc0b8['maxdigit']);var _0x383a03=_0x22209a['result']?_0x22209a['result']['toString']():'';logger[_0x3234('0x29')](_0x3234('0x120'),JSON[_0x3234('0x70')](_0x22209a));if(_0x22209a['result']===-0x1){this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x3bc0b8,_0x383a03);return _0x22209a;}else if(_0x22209a[_0x3234('0xa1')]===_0x3234('0x61')){_0x22209a[_0x3234('0xac')]=_0x383a03[_0x3234('0x9c')]>=parseInt(_0x3bc0b8[_0x3234('0x121')])?'x':'i';}else{_0x22209a[_0x3234('0xac')]=_0x383a03[_0x3234('0x9c')]>=parseInt(_0x3bc0b8['mindigit'])&&_0x383a03[_0x3234('0x9c')]<=parseInt(_0x3bc0b8[_0x3234('0x122')])?'x':'i';}var _0x49f82e=this[_0x3234('0xd')][_0x3234('0x6c')](this,_0x3bc0b8['variable_id']);if(!_0x49f82e){return this[_0x3234('0x32')][_0x3234('0x27')](_0x3bc0b8,_0x3234('0xde'));}this[_0x3234('0x32')]['setVariable'](_0x49f82e,_0x383a03);if(this[_0x3234('0x84')](_0x3bc0b8[_0x3234('0x123')])){var _0x44ad90=parseInt(_0x3bc0b8[_0x3234('0x123')],0xa);var _0x27718a=rs['generate']({'charset':'*','length':_0x44ad90});var _0x513bb8=_0x383a03[_0x3234('0x9c')];if(_0x513bb8>0x0){if(_0x513bb8>_0x44ad90){this['createSquareDetailsReport'][_0x3234('0x6c')](this,_0x3bc0b8,_0x3bc0b8[_0x3234('0x124')]==='first'?_0x27718a+_0x383a03[_0x3234('0x125')](_0x44ad90):_0x383a03[_0x3234('0x125')](0x0,_0x513bb8-_0x44ad90)+_0x27718a);}else{this['createSquareDetailsReport'][_0x3234('0x6c')](this,_0x3bc0b8,rs[_0x3234('0x126')]({'charset':'*','length':_0x513bb8}));}}else{this['createSquareDetailsReport'][_0x3234('0x6c')](this,_0x3bc0b8,'');}}else{this[_0x3234('0x31')]['sync'](this,_0x3bc0b8,_0x383a03);}return _0x22209a;};AGIVertices[_0x3234('0xc')][_0x3234('0xa')]=function(_0x5c28d3){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x127'),_0x5c28d3[_0x3234('0x34')]));return this[_0x3234('0x119')](_0x5c28d3);};AGIVertices[_0x3234('0xc')][_0x3234('0x128')]=function(_0x49d2ba){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x129'),_0x49d2ba[_0x3234('0x34')]));this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x49d2ba,_0x49d2ba['goalname']);return this['channel'][_0x3234('0xa9')](util['format'](_0x3234('0x12a'),_0x49d2ba[_0x3234('0x12b')]));};AGIVertices[_0x3234('0xc')][_0x3234('0x12c')]=function(_0x193f49){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x12d'),_0x193f49['label']));if(!this[_0x3234('0x84')](_0x193f49[_0x3234('0x8c')])||!this[_0x3234('0x84')](_0x193f49[_0x3234('0x87')])){return this['channel'][_0x3234('0xa9')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x193f49[_0x3234('0x56')])){return this[_0x3234('0x32')]['noop']('no\x20text\x20configured');}this['channel'][_0x3234('0xa9')](util['format']('Trying\x20aws\x20Polly\x20%s',_0x193f49['text']));var _0x5ca88e=this[_0x3234('0x86')]['sync'](this,_0x193f49);if(_0x5ca88e){this['channel'][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x12e'),_0x5ca88e));var _0x52abd0=this[_0x3234('0x32')]['streamFile'](_0x5ca88e);try{fs[_0x3234('0x10b')](_0x5ca88e+'.wav');}catch(_0x51680a){logger[_0x3234('0x27')](_0x51680a);}return _0x52abd0;}return this[_0x3234('0x32')]['error'](_0x193f49,_0x3234('0x12f'));};AGIVertices[_0x3234('0xc')]['awslex']=function(_0x2f5f22){logger[_0x3234('0x29')](util['format']('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x2f5f22[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x2f5f22[_0x3234('0x8c')])||!this[_0x3234('0x84')](_0x2f5f22[_0x3234('0x87')])){return this[_0x3234('0x32')]['noop'](_0x3234('0x130'));}if(!this[_0x3234('0x84')](_0x2f5f22[_0x3234('0x131')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x132'));}if(!this[_0x3234('0x84')](_0x2f5f22[_0x3234('0x56')])){return this['channel']['noop'](_0x3234('0xaa'));}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x2f5f22);this[_0x3234('0x3f')](_0x2f5f22[_0x3234('0x56')],'in','','');this['channel'][_0x3234('0xa9')](util['format'](_0x3234('0x133'),_0x2f5f22[_0x3234('0x56')]));var _0x183ab7=this[_0x3234('0x8b')][_0x3234('0x6c')](this,_0x2f5f22);if(_0x183ab7){for(var _0xd93b86 in _0x183ab7){if(_0x183ab7['hasOwnProperty'](_0xd93b86)&&_[_0x3234('0x96')](_0x183ab7[_0xd93b86])){this['channel'][_0x3234('0x9d')](util[_0x3234('0x50')]('AWS_LEX_%s',_0xd93b86[_0x3234('0x65')]()),_0x183ab7[_0xd93b86]);}}if(_[_0x3234('0x42')](_0x183ab7[_0x3234('0x73')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x134'));}else{this[_0x3234('0x3f')](_0x183ab7['message'],_0x3234('0xf2'),'amazonlex','');return this[_0x3234('0x32')]['noop'](util[_0x3234('0x50')](_0x3234('0x135'),_0x183ab7[_0x3234('0x73')]));}}return this['channel'][_0x3234('0x27')](_0x2f5f22,_0x3234('0x136'));};AGIVertices[_0x3234('0xc')]['googleasr']=function(_0x5a1984){logger['info'](util[_0x3234('0x50')](_0x3234('0x137'),_0x5a1984[_0x3234('0x34')],_0x5a1984[_0x3234('0x61')]));if(!this[_0x3234('0x84')](_0x5a1984[_0x3234('0x77')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x138'));}var _0x120dd6=_0x3234('0x139');var _0x4cb836=util[_0x3234('0x50')](_0x3234('0x13a'),FILES_PATH,rs[_0x3234('0x126')](0x4));var _0x5d1af2=util[_0x3234('0x50')](_0x3234('0x9b'),_0x4cb836,_0x120dd6);var _0x2445ce=!![];if(_0x5a1984[_0x3234('0x13b')]===_0x3234('0x13c')){_0x2445ce=![];}var _0x4de4da=this[_0x3234('0x32')][_0x3234('0x13d')](_0x4cb836,_0x120dd6,_0x5a1984['intKey'],_0x5a1984[_0x3234('0x61')],undefined,_0x2445ce);if(_0x4de4da[_0x3234('0xac')]!==-0x1){this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('google\x20%s\x20file\x20created',_0x5d1af2));var _0x24df4e=this['googleASR']['sync'](this,_0x5a1984,_0x5d1af2);if(_0x24df4e){for(var _0x4fc467 in _0x24df4e){if(_0x24df4e[_0x3234('0x95')](_0x4fc467)){this[_0x3234('0x32')][_0x3234('0x9d')](util['format'](_0x3234('0x13e'),_0x4fc467[_0x3234('0x65')]()),_0x24df4e[_0x4fc467]);}}return this[_0x3234('0x32')]['noop'](util[_0x3234('0x50')](_0x3234('0x13f'),JSON['stringify'](_0x24df4e)));}}return _0x4de4da;};AGIVertices['prototype'][_0x3234('0x140')]=function(_0x4bf4fe){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x141'),_0x4bf4fe[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x4bf4fe['appid'])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x142'));}if(!this[_0x3234('0x84')](_0x4bf4fe['appsecret'])){return this[_0x3234('0x32')]['noop'](_0x3234('0x143'));}var _0x1a63f0=_0x3234('0x139');var _0x598a4b=util[_0x3234('0x50')](_0x3234('0x13a'),FILES_PATH,rs[_0x3234('0x126')](0x4));var _0x21b390=util['format'](_0x3234('0x9b'),_0x598a4b,_0x1a63f0);var _0x4317b8=!![];if(_0x4bf4fe['beep']===_0x3234('0x13c')){_0x4317b8=![];}var _0x4b095f=this['channel'][_0x3234('0x13d')](_0x598a4b,_0x1a63f0,_0x4bf4fe[_0x3234('0x144')],_0x4bf4fe['timeout'],undefined,_0x4317b8);if(_0x4b095f[_0x3234('0xac')]!==-0x1){this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x145'),_0x21b390));var _0x5b12df=this[_0x3234('0x8f')][_0x3234('0x6c')](this,_0x4bf4fe,_0x21b390);if(_0x5b12df){for(var _0x238614 in _0x5b12df){if(_0x5b12df[_0x3234('0x95')](_0x238614)){this['channel'][_0x3234('0x9d')](util['format'](_0x3234('0x146'),_0x238614[_0x3234('0x65')]()),_0x5b12df[_0x238614]);}}return this['channel']['noop'](util['format'](_0x3234('0x147'),JSON['stringify'](_0x5b12df)));}}return _0x4b095f;};AGIVertices[_0x3234('0xc')]['gotoc']=function(_0x50fcfd){logger['info'](util[_0x3234('0x50')](_0x3234('0x148'),_0x50fcfd['label']));return this['channel'][_0x3234('0x149')](_0x50fcfd[_0x3234('0x3a')],_0x50fcfd['extension'],_0x50fcfd[_0x3234('0x3c')]);};AGIVertices[_0x3234('0xc')][_0x3234('0x14a')]=function(_0x171bca){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x14b'),_0x171bca[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x171bca[_0x3234('0x14c')])){return this['channel']['error'](_0x171bca,_0x3234('0x14d'));}try{var _0x2cb415=eval(_0x171bca[_0x3234('0x14c')])?_0x3234('0x14e'):_0x3234('0x14f');this['channel'][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x150'),_0x171bca['condition'],_0x2cb415));return{'code':0xc8,'result':_0x2cb415};}catch(_0x1f8503){return{'code':0xc8,'result':_0x3234('0x14f')};}};AGIVertices[_0x3234('0xc')][_0x3234('0x151')]=function(_0x37c8f3){logger[_0x3234('0x29')](util[_0x3234('0x50')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x37c8f3[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x37c8f3['interval_id'])){return this[_0x3234('0x32')]['error'](_0x37c8f3,_0x3234('0x152'));}var _0x5c6ec3=this[_0x3234('0x20')][_0x3234('0x6c')](this,_0x37c8f3[_0x3234('0x153')]);if(!_0x5c6ec3){return this[_0x3234('0x32')][_0x3234('0x27')](_0x37c8f3,_0x3234('0x154'));}for(var _0x4a6e37=0x0;_0x4a6e37<_0x5c6ec3[_0x3234('0x9c')];_0x4a6e37+=0x1){var _0x1f0f85=this[_0x3234('0x32')]['getVariable'](util[_0x3234('0x50')](_0x3234('0x155'),_0x5c6ec3[_0x4a6e37]));if(_0x1f0f85[_0x3234('0xac')]===-0x1){return _0x1f0f85;}logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x156'),_0x5c6ec3[_0x4a6e37],_0x1f0f85[_0x3234('0xa1')]));if(_0x1f0f85[_0x3234('0xa1')]==='true'){logger[_0x3234('0x29')](util[_0x3234('0x50')]('IFTIME\x20%s\x20%s',_0x5c6ec3[_0x4a6e37],_0x3234('0x14e')));this[_0x3234('0x32')][_0x3234('0xa9')](util['format']('IFTIME\x20%s\x20%s',_0x5c6ec3[_0x4a6e37],_0x3234('0x14e')));return{'code':0xc8,'result':_0x3234('0x14e')};}else{logger[_0x3234('0x29')](util['format'](_0x3234('0x156'),_0x5c6ec3[_0x4a6e37],_0x3234('0x14f')));this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x156'),_0x5c6ec3[_0x4a6e37],_0x3234('0x14f')));}}return{'code':0xc8,'result':_0x3234('0x14f')};};AGIVertices[_0x3234('0xc')][_0x3234('0x157')]=function(_0x423a88){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x158'),_0x423a88[_0x3234('0x34')]));return this[_0x3234('0x32')]['hangup']();};AGIVertices[_0x3234('0xc')][_0x3234('0x159')]=function(_0x2d3e0d){logger[_0x3234('0x29')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x2d3e0d[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x2d3e0d[_0x3234('0x77')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x138'));}var _0x39d6d7=_0x3234('0x139');var _0x5959a7=util[_0x3234('0x50')](_0x3234('0x13a'),FILES_PATH,rs[_0x3234('0x126')](0x4));var _0xb73b74=util['format'](_0x3234('0x9b'),_0x5959a7,_0x39d6d7);var _0xb3fec8=!![];if(_0x2d3e0d[_0x3234('0x13b')]===_0x3234('0x13c')){_0xb3fec8=![];}var _0x331078=this[_0x3234('0x32')][_0x3234('0x13d')](_0x5959a7,_0x39d6d7,_0x2d3e0d[_0x3234('0x144')],_0x2d3e0d['timeout'],undefined,_0xb3fec8);if(_0x331078[_0x3234('0xac')]!==-0x1){this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x15a'),_0xb73b74));var _0x52e609=this['ispeechASR'][_0x3234('0x6c')](this,_0x2d3e0d,_0xb73b74);if(_0x52e609){for(var _0x3dfe71 in _0x52e609){if(_0x52e609[_0x3234('0x95')](_0x3dfe71)){this['channel'][_0x3234('0x9d')](util[_0x3234('0x50')](_0x3234('0x15b'),_0x3dfe71[_0x3234('0x65')]()),_0x52e609[_0x3dfe71]);}}return this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0x15c'),JSON['stringify'](_0x52e609)));}}return _0x331078;};AGIVertices['prototype'][_0x3234('0x15d')]=function(_0x102ec4){logger['info'](util[_0x3234('0x50')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x102ec4[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x102ec4['key'])){return this['channel'][_0x3234('0xa9')]('no\x20key\x20configured');}if(!this[_0x3234('0x84')](_0x102ec4['text'])){return this[_0x3234('0x32')]['noop'](_0x3234('0xaa'));}this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x15e'),_0x102ec4[_0x3234('0x56')]));var _0x36374c=this['ispeechTTS'][_0x3234('0x6c')](this,_0x102ec4);if(_0x36374c){this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('ispeech\x20%s\x20file\x20created',_0x36374c));var _0x32018c=this[_0x3234('0x32')][_0x3234('0x10a')](_0x36374c,_0x102ec4['intKey']);try{fs[_0x3234('0x10b')](_0x36374c+_0x3234('0x10c'));}catch(_0x34b80e){logger[_0x3234('0x27')](_0x34b80e);}return _0x32018c;}return this[_0x3234('0x32')][_0x3234('0x27')](_0x102ec4,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x3234('0xc')][_0x3234('0x15f')]=function(_0x5e20ba){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x160'),_0x5e20ba[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x5e20ba[_0x3234('0x161')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x5e20ba,'no\x20find\x20by\x20configured');}logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x162'),this[_0x3234('0x32')][_0x3234('0x37')],_0x5e20ba['findBy']));var _0x36b82a=this[_0x3234('0x4f')][_0x3234('0x6c')](this,_0x5e20ba['findBy']);if(_0x36b82a){logger['info'](util[_0x3234('0x50')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3234('0x32')]['callerid'],_0x5e20ba[_0x3234('0x161')]));this['channel'][_0x3234('0xa9')](util['format'](_0x3234('0x163'),this[_0x3234('0x32')][_0x3234('0x37')],_0x5e20ba['findBy']));return{'code':0xc8,'result':_0x3234('0x164')};}else{logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x165'),this[_0x3234('0x32')]['callerid'],_0x5e20ba[_0x3234('0x161')]));this['channel'][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x165'),this[_0x3234('0x32')][_0x3234('0x37')],_0x5e20ba[_0x3234('0x161')]));return{'code':0xc8,'result':_0x3234('0x166')};}};AGIVertices[_0x3234('0xc')][_0x3234('0x167')]=function(_0x49c0aa){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x168'),_0x49c0aa[_0x3234('0x34')]));if(!this['isConfigured'](_0x49c0aa['findBy'])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x49c0aa,_0x3234('0x169'));}logger[_0x3234('0x29')](util[_0x3234('0x50')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x3234('0x32')][_0x3234('0x37')],_0x49c0aa[_0x3234('0x161')]));var _0x318759=this['agentLogout'][_0x3234('0x6c')](this,_0x49c0aa[_0x3234('0x161')]);if(_0x318759){logger['info'](util['format'](_0x3234('0x163'),this[_0x3234('0x32')][_0x3234('0x37')],_0x49c0aa['findBy']));this[_0x3234('0x32')]['noop'](util[_0x3234('0x50')](_0x3234('0x163'),this[_0x3234('0x32')]['callerid'],_0x49c0aa['findBy']));return{'code':0xc8,'result':_0x3234('0x164')};}else{logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x165'),this[_0x3234('0x32')]['callerid'],_0x49c0aa[_0x3234('0x161')]));this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3234('0x32')][_0x3234('0x37')],_0x49c0aa[_0x3234('0x161')]));return{'code':0xc8,'result':_0x3234('0x166')};}};AGIVertices[_0x3234('0xc')][_0x3234('0x16a')]=function(_0x120278){logger[_0x3234('0x29')](util['format'](_0x3234('0x16b'),_0x120278[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x120278[_0x3234('0x16c')])){return this[_0x3234('0x32')]['error'](_0x120278,_0x3234('0x16d'));}this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0x16e'),_0x120278[_0x3234('0x16c')]));var _0x4bacdc=eval(_0x120278[_0x3234('0x16c')]);if(!this[_0x3234('0x84')](_0x120278[_0x3234('0xdc')])){return this['channel']['noop'](_0x3234('0xdd'));}var _0x2f9597=this[_0x3234('0xd')][_0x3234('0x6c')](this,_0x120278['variable_id']);if(!_0x2f9597){return this[_0x3234('0x32')]['error'](_0x120278,'no\x20variable\x20found');}if(_[_0x3234('0x99')](_0x4bacdc)){var _0x552147=this;_0x4bacdc[_0x3234('0xe0')](function(_0xa22f11,_0x76710e){_0x552147[_0x3234('0x32')][_0x3234('0x9d')](util[_0x3234('0x50')]('%s[%s]',_0x2f9597,_0x76710e),_0xa22f11);});return this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0x16f'),_0x2f9597));}else{return this[_0x3234('0x32')]['setVariable'](_0x2f9597,_0x4bacdc);}};AGIVertices[_0x3234('0xc')]['menu']=function(_0x55ca96){logger['info'](util[_0x3234('0x50')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x55ca96[_0x3234('0x34')]));if(_0x55ca96[_0x3234('0xa6')]===0x0){return this['maxRetry'](_0x55ca96);}_0x55ca96['retry']-=0x1;if(!this[_0x3234('0x84')](_0x55ca96[_0x3234('0x11c')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x55ca96,_0x3234('0x11b'));}var _0x378cf6=this[_0x3234('0x170')][_0x3234('0x6c')](this,_0x55ca96[_0x3234('0x11c')]);if(!_0x378cf6){return this['channel'][_0x3234('0x27')](_0x55ca96,'no\x20file\x20audio\x20found');}var _0x180af1=this[_0x3234('0x32')][_0x3234('0x11e')](_0x378cf6,_0x55ca96[_0x3234('0x11f')],_0x55ca96[_0x3234('0x171')]);var _0x20b3fc=_0x180af1['result'];if(_0x180af1[_0x3234('0xac')]===-0x1){this[_0x3234('0x31')]['sync'](this,_0x55ca96,'-1');return _0x180af1;}else if(_0x180af1[_0x3234('0xa1')]===_0x3234('0x61')){_0x180af1['result']=_0x180af1[_0x3234('0xac')][_0x3234('0x9c')]>0x0?_0x180af1['result']:'t';}else if(_[_0x3234('0x41')](_0x180af1[_0x3234('0xac')])){_0x180af1[_0x3234('0xac')]='#';_0x20b3fc='#';}if(!this[_0x3234('0x84')](_0x55ca96[_0x3234('0xdc')])){this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xdd'));}else{var _0x422aa2=this[_0x3234('0xd')][_0x3234('0x6c')](this,_0x55ca96[_0x3234('0xdc')]);if(!_0x422aa2){return this['channel']['error'](_0x55ca96,_0x3234('0xde'));}this[_0x3234('0x32')][_0x3234('0x9d')](_0x422aa2,_0x20b3fc);}this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x55ca96,_0x20b3fc);return _0x180af1;};AGIVertices[_0x3234('0xc')]['noop']=function(_0x4a5175){logger[_0x3234('0x29')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x4a5175[_0x3234('0x34')]));return this[_0x3234('0x32')][_0x3234('0xa9')](_0x4a5175[_0x3234('0x172')]||_0x4a5175[_0x3234('0x34')]);};AGIVertices[_0x3234('0xc')][_0x3234('0x173')]=function(_0x5e0dc2){logger[_0x3234('0x29')](util[_0x3234('0x50')]('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x5e0dc2[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x5e0dc2[_0x3234('0x161')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x5e0dc2,_0x3234('0x169'));}logger[_0x3234('0x29')](util['format'](_0x3234('0x162'),this[_0x3234('0x32')][_0x3234('0x37')],_0x5e0dc2[_0x3234('0x161')]));var _0x1ac4d2=this['getPause'][_0x3234('0x6c')](this,_0x5e0dc2[_0x3234('0x174')]);var _0x4771f9=this[_0x3234('0x4b')][_0x3234('0x6c')](this,_0x5e0dc2[_0x3234('0x161')],_0x1ac4d2);if(_0x4771f9){logger[_0x3234('0x29')](util[_0x3234('0x50')]('AGENT\x20%s\x20FOUND\x20BY',this['channel']['callerid'],_0x5e0dc2[_0x3234('0x161')]));this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x3234('0x32')][_0x3234('0x37')],_0x5e0dc2[_0x3234('0x161')]));return{'code':0xc8,'result':_0x3234('0x164')};}else{logger[_0x3234('0x29')](util[_0x3234('0x50')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x3234('0x32')]['callerid'],_0x5e0dc2[_0x3234('0x161')]));this['channel'][_0x3234('0xa9')](util['format'](_0x3234('0x163'),this[_0x3234('0x32')]['callerid'],_0x5e0dc2[_0x3234('0x161')]));return{'code':0xc8,'result':_0x3234('0x166')};}};AGIVertices['prototype'][_0x3234('0x175')]=function(_0x2859e9){logger[_0x3234('0x29')](util['format'](_0x3234('0x176'),_0x2859e9[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x2859e9[_0x3234('0x11c')])){return this['channel'][_0x3234('0x27')](_0x2859e9,'no\x20file\x20audio\x20selected');}var _0xcd3d52=this['getSound'][_0x3234('0x6c')](this,_0x2859e9['file_id']);if(!_0xcd3d52){return this['channel']['error'](_0x2859e9,'no\x20file\x20audio\x20found');}var _0x1db38c=this[_0x3234('0x32')][_0x3234('0xaf')](_0x3234('0x177'),[_0xcd3d52,_0x2859e9[_0x3234('0xeb')]]);if(_0x1db38c['result']===-0x1){return _0x1db38c;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x178'),_0x3234('0x177'),_0xcd3d52));};AGIVertices[_0x3234('0xc')][_0x3234('0x179')]=function(_0x472115){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x17a'),_0x472115['label']));if(!this[_0x3234('0x84')](_0x472115[_0x3234('0x17b')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x472115,'no\x20queue\x20selected');}var _0x48e076='';var _0x491821=parseInt(_0x472115['queue_id'],0xa);if(isNaN(_0x491821)){_0x48e076=_0x472115[_0x3234('0x17b')];}else{_0x48e076=this['getVoiceQueue']['sync'](this,_0x472115[_0x3234('0x17b')]);if(!_0x48e076){return this['channel'][_0x3234('0x27')](_0x472115,_0x3234('0x17c'));}}var _0x5cc836='';if(this[_0x3234('0x84')](_0x472115[_0x3234('0x11c')])){var _0x19d7f6=this[_0x3234('0x170')][_0x3234('0x6c')](this,_0x472115[_0x3234('0x11c')]);if(_0x19d7f6){_0x5cc836=_0x19d7f6;}}this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x472115,_0x48e076);if(_0x472115[_0x3234('0xeb')][_0x3234('0x17d')]('x')<0x0){_0x472115[_0x3234('0xeb')]+='x';}if(_0x472115['opts'][_0x3234('0x17d')]('X')<0x0){_0x472115[_0x3234('0xeb')]+='X';}this[_0x3234('0x32')][_0x3234('0x9d')](_0x3234('0x17e'),_0x48e076?_0x48e076['toLowerCase']():'');var _0xd47c29=this[_0x3234('0x32')][_0x3234('0xaf')](_0x3234('0x17f'),[_0x48e076,_0x472115['opts'],_0x472115[_0x3234('0x5f')],_0x5cc836,_0x472115['timeout'],_0x472115[_0x3234('0x6')],_0x472115[_0x3234('0x180')],_0x472115[_0x3234('0x181')],'',_0x472115[_0x3234('0x182')]]);if(_0xd47c29[_0x3234('0xac')]===-0x1){return _0xd47c29;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x178'),_0x3234('0x17f'),_0x48e076));};AGIVertices[_0x3234('0xc')][_0x3234('0x183')]=function(_0xc12a1b){logger[_0x3234('0x29')](util[_0x3234('0x50')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0xc12a1b[_0x3234('0x34')]));var _0x156c7e=_0xc12a1b[_0x3234('0x184')]||'wav';var _0xb3567e=util[_0x3234('0x50')]('%s_%s',this[_0x3234('0x32')][_0x3234('0x33')],rs['generate'](0x5));var _0x5f2a3c=util[_0x3234('0x50')]('%s/recordings/%s.%s',FILES_PATH,_0xb3567e,_0x156c7e);var _0x1d1878=util['format'](_0x3234('0x13a'),FILES_PATH,_0xb3567e);this['createSquareRecording'][_0x3234('0x6c')](this,_0xc12a1b,_0xb3567e,_0x5f2a3c);this[_0x3234('0x32')][_0x3234('0x9d')](_0x3234('0x185'),_0xb3567e);logger[_0x3234('0x29')](_0x3234('0x186'),_0x1d1878,_0x156c7e,_0xc12a1b['escape_digits'],_0xc12a1b[_0x3234('0x61')]);return this[_0x3234('0x32')][_0x3234('0x13d')](_0x1d1878,_0x156c7e,_0xc12a1b[_0x3234('0x187')],_0xc12a1b[_0x3234('0x61')],undefined,!![]);};AGIVertices[_0x3234('0xc')][_0x3234('0x188')]=function(_0xa7d43c){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x189'),_0xa7d43c[_0x3234('0x34')]));if(!this['isConfigured'](_0xa7d43c[_0x3234('0x5f')])){return this[_0x3234('0x32')]['noop'](_0x3234('0x18a'));}var _0x35f914=this['restAPI'][_0x3234('0x6c')](this,_0xa7d43c);logger[_0x3234('0x29')](util[_0x3234('0x50')]('Response:',util[_0x3234('0x18b')](_0x35f914,{'showHidden':![],'depth':null})));if(!this[_0x3234('0x84')](_0xa7d43c[_0x3234('0xdc')])){return this[_0x3234('0x32')][_0x3234('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x1eefb5=this['getVariable'][_0x3234('0x6c')](this,_0xa7d43c[_0x3234('0xdc')]);if(!_0x1eefb5){return this['channel'][_0x3234('0x27')](_0xa7d43c,_0x3234('0xde'));}this[_0x3234('0x32')][_0x3234('0x9d')](util['format'](_0x3234('0x18c'),_0x1eefb5),_0x35f914[_0x3234('0x71')]?_0x35f914['statusCode']:_0x3234('0x18d'));this['channel']['setVariable'](util[_0x3234('0x50')](_0x3234('0x18e'),_0x1eefb5),_0x35f914[_0x3234('0x72')]?_0x35f914[_0x3234('0x72')]:'OK');if(_0x35f914['body']){try{this['saveRestApiResult'](_0x35f914[_0x3234('0x66')],_0x1eefb5);}catch(_0x23ea7f){logger['error'](util[_0x3234('0x50')](_0x3234('0x18f'),_0x1eefb5));}}return this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0xe2'),_0x1eefb5));};AGIVertices[_0x3234('0xc')][_0x3234('0x190')]=function(_0x308e8a){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x191'),_0x308e8a[_0x3234('0x34')]));return this['channel'][_0x3234('0x192')](_0x308e8a[_0x3234('0x193')]['replace'](/\s+/g,''),_0x308e8a['escape_digits']);};AGIVertices[_0x3234('0xc')][_0x3234('0x194')]=function(_0x30c17e){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x195'),_0x30c17e[_0x3234('0x34')]));return this[_0x3234('0x32')]['sayNumber'](_0x30c17e[_0x3234('0x62')][_0x3234('0x52')](/\s+/g,''),_0x30c17e[_0x3234('0x187')]);};AGIVertices[_0x3234('0xc')][_0x3234('0x196')]=function(_0x586dc0){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x197'),_0x586dc0[_0x3234('0x34')]));return this['channel'][_0x3234('0x198')](_0x586dc0[_0x3234('0x56')],_0x586dc0['escape_digits']);};AGIVertices[_0x3234('0xc')][_0x3234('0x199')]=function(_0x507df4){logger[_0x3234('0x29')](util['format'](_0x3234('0x19a'),_0x507df4[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x507df4['account_id'])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x19b'));}var _0x5e5ce7=this[_0x3234('0x1e')][_0x3234('0x6c')](this,_0x507df4[_0x3234('0x19c')]);if(!_0x5e5ce7||!_0x5e5ce7[_0x3234('0x19d')]){return this['channel'][_0x3234('0x27')](_0x507df4,_0x3234('0x19e'));}var _0x9174a0={'from':util[_0x3234('0x50')]('\x22%s\x22\x20<%s>',_0x5e5ce7[_0x3234('0x10')],_0x5e5ce7[_0x3234('0x19f')]||_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a0')]),'to':_0x507df4['to']||'','cc':_0x507df4['cc']||'','bcc':_0x507df4[_0x3234('0x1a1')]||'','subject':_0x507df4[_0x3234('0x1a2')],'html':_0x507df4[_0x3234('0x56')],'text':_0x507df4[_0x3234('0x56')]};var _0x2bdb63={'tls':{'rejectUnauthorized':![]}};if(_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a3')]){_0x2bdb63['service']=_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a3')];}else{_0x2bdb63['host']=_0x5e5ce7['Smtp'][_0x3234('0x1a4')];_0x2bdb63[_0x3234('0x1a5')]=_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a5')];_0x2bdb63[_0x3234('0x1a6')]=_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a6')];}if(_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a7')]){_0x2bdb63['auth']={'user':_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a0')],'pass':_0x5e5ce7[_0x3234('0x19d')][_0x3234('0x1a8')]};}if(this[_0x3234('0x84')](_0x507df4[_0x3234('0x1a9')])){}logger[_0x3234('0xe4')](_0x3234('0x1aa'),JSON['stringify'](_0x9174a0));this[_0x3234('0x31')]['sync'](this,_0x507df4,_0x507df4[_0x3234('0x19c')]);this[_0x3234('0x32')]['noop'](util[_0x3234('0x50')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x5e5ce7[_0x3234('0x10')]));this[_0x3234('0x1f')]['sync'](this,_0x2bdb63,_0x9174a0);return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x1ab'));};AGIVertices[_0x3234('0xc')][_0x3234('0x1ac')]=function(_0x499977){logger['info'](util[_0x3234('0x50')](_0x3234('0x1ad'),_0x499977[_0x3234('0x34')]));return this[_0x3234('0x32')][_0x3234('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices['prototype'][_0x3234('0x1ae')]=function(_0x3e4ff0){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x1af'),_0x3e4ff0[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x3e4ff0[_0x3234('0x1b0')])){return this[_0x3234('0x32')][_0x3234('0xa9')]('no\x20sms\x20account\x20configured');}var _0x3496b1=this[_0x3234('0x2e')][_0x3234('0x6c')](this,_0x3e4ff0[_0x3234('0x1b0')]);if(!_0x3496b1){return this[_0x3234('0x32')][_0x3234('0x27')](_0x3e4ff0,'no\x20sms\x20account\x20found');}var _0x11e292={'body':_0x3e4ff0[_0x3234('0x1b1')],'phone':_0x3e4ff0['to']||'','SmsAccountId':_0x3496b1['id']};logger[_0x3234('0xe4')](_0x3234('0x1b2'),JSON[_0x3234('0x70')](_0x11e292));this[_0x3234('0x31')][_0x3234('0x6c')](this,_0x3e4ff0,_0x3e4ff0[_0x3234('0x1b0')]);this['channel']['noop'](util[_0x3234('0x50')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x3496b1['name']));this[_0x3234('0x30')][_0x3234('0x6c')](this,_0x11e292);return this[_0x3234('0x32')]['noop'](_0x3234('0x1b3'));};AGIVertices[_0x3234('0xc')][_0x3234('0x1b4')]=function(_0x2ec235){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x1b5'),_0x2ec235[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x2ec235[_0x3234('0xdc')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x2ec235,_0x3234('0x1b6'));}var _0x2e2084=this['getVariable'][_0x3234('0x6c')](this,_0x2ec235[_0x3234('0xdc')]);if(!_0x2e2084){return this[_0x3234('0x32')][_0x3234('0x27')](_0x2ec235,_0x3234('0xde'));}return this[_0x3234('0x32')]['setVariable'](_0x2e2084,_0x2ec235[_0x3234('0x1b7')]);};AGIVertices[_0x3234('0xc')][_0x3234('0x1b8')]=function(_0x4ad77b){logger['info'](util['format'](_0x3234('0x1b9'),_0x4ad77b['label']));this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x1ba'));if(_0x4ad77b[_0x3234('0xbe')]===_0x3234('0x1bb')){this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x1bc'));return this['channel']['answer']();}return this['channel'][_0x3234('0xa9')]('Skipped\x20Answer');};AGIVertices[_0x3234('0xc')][_0x3234('0x1bd')]=function(_0x3e32e5){logger['info'](util[_0x3234('0x50')](_0x3234('0x1be'),_0x3e32e5[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0x3e32e5[_0x3234('0x1bf')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0x3e32e5,'no\x20subproject\x20selected');}var _0x5b75ed=this[_0x3234('0x14')][_0x3234('0x6c')](this,_0x3e32e5[_0x3234('0x1bf')]);if(!this[_0x3234('0x84')](_0x5b75ed)){return this[_0x3234('0x32')][_0x3234('0x27')](_0x3e32e5,util[_0x3234('0x50')](_0x3234('0x1c0'),_0x3e32e5[_0x3234('0x1bf')]));}if(_0x5b75ed===this['channel'][_0x3234('0x36')]){return this[_0x3234('0x32')]['error'](_0x3e32e5,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x3234('0x31')]['sync'](this,_0x3e32e5,_0x5b75ed);var _0x338003=this[_0x3234('0x32')][_0x3234('0xaf')](_0x3234('0x1c1'),util['format'](_0x3234('0x1c2'),config[_0x3234('0x6')][_0x3234('0x1a4')]||'127.0.0.1',_0x5b75ed,this[_0x3234('0x32')][_0x3234('0x36')]));if(_0x338003['result']===-0x1){return _0x338003;}return this[_0x3234('0x32')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x3234('0x1c1'),_0x5b75ed));};AGIVertices[_0x3234('0xc')]['system']=function(_0x1fdaf1){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x1c3'),_0x1fdaf1[_0x3234('0x34')]));var _0x350edc=this[_0x3234('0x1c4')]['sync'](this,_0x1fdaf1['command']);this['createSquareDetailsReport'][_0x3234('0x6c')](this,_0x1fdaf1,_0x1fdaf1['command']);if(this[_0x3234('0x84')](_0x1fdaf1[_0x3234('0xdc')])){var _0x3edcbf=this[_0x3234('0xd')][_0x3234('0x6c')](this,_0x1fdaf1[_0x3234('0xdc')]);if(_0x3edcbf){this[_0x3234('0x32')][_0x3234('0x9d')](_0x3edcbf,_0x350edc);return this[_0x3234('0x32')][_0x3234('0xa9')](util['format']('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1fdaf1[_0x3234('0xb9')],_0x3edcbf));}}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1fdaf1[_0x3234('0xb9')]));};AGIVertices[_0x3234('0xc')]['google_cloud_tts']=function(_0x1c21b){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x1c5'),_0x1c21b[_0x3234('0x34')]));_0x1c21b['text']=_0x1c21b[_0x3234('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3234('0x84')](_0x1c21b['apiKey'])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0x1c6'));}if(!this[_0x3234('0x84')](_0x1c21b['text'])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xaa'));}this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x1c7'),_0x1c21b[_0x3234('0x56')]));var _0x57b6be=this[_0x3234('0x53')][_0x3234('0x6c')](this,_0x1c21b);if(_0x57b6be){this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x57b6be));var _0x417038=this[_0x3234('0x32')][_0x3234('0x10a')](_0x57b6be);try{fs[_0x3234('0x10b')](_0x57b6be+_0x3234('0x10c'));}catch(_0x6dbe3){logger[_0x3234('0x27')](_0x6dbe3);}return _0x417038;}return this[_0x3234('0x32')][_0x3234('0x27')](_0x1c21b,_0x3234('0x1c8'));};AGIVertices[_0x3234('0xc')]['tts']=function(_0x22a377){logger['info'](util[_0x3234('0x50')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x22a377['label']));_0x22a377[_0x3234('0x56')]=_0x22a377[_0x3234('0x56')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x3234('0x84')](_0x22a377[_0x3234('0x56')])){return this[_0x3234('0x32')][_0x3234('0xa9')](_0x3234('0xaa'));}this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0x1c9'),_0x22a377[_0x3234('0x56')]));var _0x567ff0=this[_0x3234('0x5d')]['sync'](this,_0x22a377);if(_0x567ff0){this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x1ca'),_0x567ff0));var _0x4dc9d2=this[_0x3234('0x32')][_0x3234('0x10a')](_0x567ff0);try{fs[_0x3234('0x10b')](_0x567ff0+'.wav');}catch(_0x1c63e8){logger['error'](_0x1c63e8);}return _0x4dc9d2;}return this[_0x3234('0x32')]['error'](_0x22a377,_0x3234('0x1cb'));};AGIVertices[_0x3234('0xc')][_0x3234('0x1cc')]=function(_0x418fc5){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x1cd'),_0x418fc5[_0x3234('0x34')]));if(!this['isConfigured'](_0x418fc5[_0x3234('0x161')])){return this['channel'][_0x3234('0x27')](_0x418fc5,_0x3234('0x169'));}logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x162'),this[_0x3234('0x32')][_0x3234('0x37')],_0x418fc5[_0x3234('0x161')]));var _0x34da39=this[_0x3234('0x4c')]['sync'](this,_0x418fc5['findBy']);if(_0x34da39){logger['info'](util[_0x3234('0x50')](_0x3234('0x163'),this[_0x3234('0x32')][_0x3234('0x37')],_0x418fc5[_0x3234('0x161')]));this['channel'][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x163'),this[_0x3234('0x32')][_0x3234('0x37')],_0x418fc5[_0x3234('0x161')]));return{'code':0xc8,'result':_0x3234('0x164')};}else{logger['info'](util['format'](_0x3234('0x165'),this[_0x3234('0x32')][_0x3234('0x37')],_0x418fc5['findBy']));this[_0x3234('0x32')][_0x3234('0xa9')](util['format'](_0x3234('0x165'),this['channel'][_0x3234('0x37')],_0x418fc5[_0x3234('0x161')]));return{'code':0xc8,'result':_0x3234('0x166')};}};AGIVertices[_0x3234('0xc')]['voicemail']=function(_0x260e6b){logger[_0x3234('0x29')](util[_0x3234('0x50')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x260e6b['label']));var _0x46a1b8=this[_0x3234('0x32')]['exec'](_0x3234('0x1ce'),[_0x260e6b[_0x3234('0x1cf')],_0x260e6b['options']]);if(_0x46a1b8[_0x3234('0xac')]===-0x1){return _0x46a1b8;}return this[_0x3234('0x32')][_0x3234('0xa9')](util[_0x3234('0x50')](_0x3234('0x178'),'VOICEMAIL',_0x260e6b[_0x3234('0x1cf')]));};AGIVertices['prototype']['vswitch']=function(_0xb48b8b){logger[_0x3234('0x29')](util[_0x3234('0x50')](_0x3234('0x1d0'),_0xb48b8b[_0x3234('0x34')]));if(!this[_0x3234('0x84')](_0xb48b8b[_0x3234('0xdc')])){return this[_0x3234('0x32')][_0x3234('0x27')](_0xb48b8b,'no\x20variable\x20selected');}var _0x1682bf=this['getVariable']['sync'](this,_0xb48b8b[_0x3234('0xdc')]);if(!_0x1682bf){return this[_0x3234('0x32')][_0x3234('0x27')](_0xb48b8b,_0x3234('0xde'));}var _0x476ff8=this[_0x3234('0x32')][_0x3234('0xd')](_0x1682bf);return{'code':0xc8,'result':_0x476ff8[_0x3234('0xa1')]?_0x476ff8[_0x3234('0xa1')]:'-'};};String['prototype'][_0x3234('0xa0')]=function(_0xa7bf4f,_0x9f3c75){return this['split'](_0xa7bf4f)['join'](_0x9f3c75);};module['exports']=AGIVertices; \ No newline at end of file +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 diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 2245b61..3682346 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 _0xc6fc=['[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','ACW','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][UPDATE][ERRORS:%s]','error','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','queue','mandatoryDisposition','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','interface','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid'];(function(_0x1f98ef,_0x26c716){var _0x242565=function(_0x3feab3){while(--_0x3feab3){_0x1f98ef['push'](_0x1f98ef['shift']());}};_0x242565(++_0x26c716);}(_0xc6fc,0xb6));var _0xcc6f=function(_0x1034ee,_0x12998c){_0x1034ee=_0x1034ee-0x0;var _0x2922af=_0xc6fc[_0x1034ee];return _0x2922af;};'use strict';var util=require('util');var _=require(_0xcc6f('0x0'));var moment=require(_0xcc6f('0x1'));var ami=require(_0xcc6f('0x2'));var logger=require(_0xcc6f('0x3'))(_0xcc6f('0x4'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0xcc6f('0x5'));function Acw(_0x46482c){this[_0xcc6f('0x6')]=_0x46482c[_0xcc6f('0x6')];this[_0xcc6f('0x7')]=_0x46482c[_0xcc6f('0x7')];this[_0xcc6f('0x8')]=_0x46482c['timers'];this[_0xcc6f('0x9')]={};ami['on'](_0xcc6f('0xa'),this[_0xcc6f('0xb')][_0xcc6f('0xc')](this));ami['on'](_0xcc6f('0xd'),this[_0xcc6f('0xe')]['bind'](this));ami['on'](_0xcc6f('0xf'),this[_0xcc6f('0x10')]['bind'](this));ami['on']('agentringnoanswer',this[_0xcc6f('0x11')][_0xcc6f('0xc')](this));ami['on']('attendedtransfer',this[_0xcc6f('0x12')][_0xcc6f('0xc')](this));ami['on'](_0xcc6f('0x13'),this[_0xcc6f('0x14')][_0xcc6f('0xc')](this));ami['on'](_0xcc6f('0x15'),this['syncAgentConnectPreview'][_0xcc6f('0xc')](this));}function getDiff(_0x4ea001){var _0x5a602d=moment()[_0xcc6f('0x16')](0x0);var _0x12203a=moment(_0x4ea001)[_0xcc6f('0x16')](0x0);return _0x5a602d[_0xcc6f('0x17')](_0x12203a,_0xcc6f('0x18'));}Acw[_0xcc6f('0x19')][_0xcc6f('0x1a')]=function(_0x5c16fd){try{var _0x15c433=this;var _0x300ee7=this[_0xcc6f('0x9')][_0x5c16fd]['interface'];var _0x565711=this[_0xcc6f('0x9')][_0x5c16fd]['queue'];var _0x49bdd8=this['voiceQueues'][_0x565711];var _0x5eaeaf=![];var _0x197e7b=_0xcc6f('0x1b');if(_0x49bdd8['mandatoryDisposition']){if(_0x49bdd8[_0xcc6f('0x1c')][_0xcc6f('0x1d')]){_0x5eaeaf=!![];_0x197e7b=_0x49bdd8[_0xcc6f('0x1c')]['name'];}}ami[_0xcc6f('0x1e')]({'action':_0xcc6f('0x1f'),'interface':_0x300ee7,'paused':!![],'reason':_0x197e7b})['then'](function(_0x496d05){if(_0x15c433['agents'][_0x300ee7]){return RpcUser['getAgent'](_0x15c433['agents'][_0x300ee7]['id'])[_0xcc6f('0x20')](function(_0x3206e7){if(_0x3206e7&&!_0x3206e7[_0xcc6f('0x21')]){logger['info'](_0xcc6f('0x22'),_0x5c16fd,_0x300ee7,_0x565711);var _0x1e4312=_0x15c433[_0xcc6f('0x9')][_0x5c16fd][_0xcc6f('0x23')]&&_0x15c433['channels'][_0x5c16fd]['destlinkedid']?_0x15c433['channels'][_0x5c16fd][_0xcc6f('0x24')]:_0x5c16fd;return RpcUser[_0xcc6f('0x25')](_0x15c433[_0xcc6f('0x7')][_0x300ee7],_0x197e7b,_0x1e4312)[_0xcc6f('0x20')](function(_0x339e33){if(!_0x5eaeaf){_0x15c433[_0xcc6f('0x8')][_0x300ee7]={};logger[_0xcc6f('0x26')](_0xcc6f('0x27'),_0x5c16fd,_0x15c433['voiceQueues'][_0x565711][_0xcc6f('0x28')],_0x300ee7,_0x565711);_0x15c433['timers'][_0x300ee7][_0xcc6f('0x29')]=setTimeout(_0x15c433['stopAcw'][_0xcc6f('0xc')](_0x15c433,_0x300ee7),_0x15c433[_0xcc6f('0x6')][_0x565711][_0xcc6f('0x28')]*0x3e8);_0x15c433[_0xcc6f('0x8')][_0x300ee7][_0xcc6f('0x2a')]=moment()[_0xcc6f('0x2b')](_0xcc6f('0x2c'));_0x15c433[_0xcc6f('0x8')][_0x300ee7][_0xcc6f('0x2d')]=_0x5c16fd;_0x15c433['timers'][_0x300ee7]['queue']=_0x565711;_0x15c433[_0xcc6f('0x8')][_0x300ee7][_0xcc6f('0x2e')]=function(){var _0x36c84c=getDiff(_0x15c433[_0xcc6f('0x8')][_0x300ee7][_0xcc6f('0x2a')]);clearTimeout(_0x15c433[_0xcc6f('0x8')][_0x300ee7][_0xcc6f('0x29')]);_0x15c433['timers'][_0x300ee7]['timer']=![];RpcVoiceAgentReport[_0xcc6f('0x2f')]({'acwtime':_0x36c84c},_0x15c433[_0xcc6f('0x8')][_0x300ee7][_0xcc6f('0x2d')],_0x300ee7)['then'](function(_0xaf3128){logger[_0xcc6f('0x26')](_0xcc6f('0x30'),_0x5c16fd,_0x36c84c,_0xaf3128);})[_0xcc6f('0x31')](function(_0x131373){logger['error'](_0xcc6f('0x32'),_0x5c16fd,_0x131373);});delete _0x15c433[_0xcc6f('0x8')][_0x300ee7];};}});}else{logger[_0xcc6f('0x26')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5c16fd,_0x300ee7,_0x565711);}});}})[_0xcc6f('0x31')](function(_0x295225){logger[_0xcc6f('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x5c16fd,_0x15c433[_0xcc6f('0x6')][_0x565711][_0xcc6f('0x28')],_0x300ee7,_0x565711);})[_0xcc6f('0x34')](function(){delete _0x15c433[_0xcc6f('0x9')][_0x5c16fd];});}catch(_0x4eb5f1){logger['error'](_0xcc6f('0x35'),_0x4eb5f1[_0xcc6f('0x36')]);}};Acw[_0xcc6f('0x19')]['stopAcw']=function(_0x865fca){try{var _0xacf76b=this;if(_0xacf76b[_0xcc6f('0x8')][_0x865fca]){_0xacf76b[_0xcc6f('0x8')][_0x865fca][_0xcc6f('0x29')]=![];var _0x23d0a4=_0xacf76b[_0xcc6f('0x8')][_0x865fca]['uniqueid'];var _0x1c30da=_0xacf76b[_0xcc6f('0x8')][_0x865fca]['queue'];var _0x2edcdf=_0xacf76b['voiceQueues'][_0x1c30da]['acwTimeout'];logger[_0xcc6f('0x26')](_0xcc6f('0x37'),_0x23d0a4,_0x865fca);RpcUser[_0xcc6f('0x38')](this[_0xcc6f('0x7')][_0x865fca]);RpcVoiceAgentReport[_0xcc6f('0x2f')]({'acwtime':_0x2edcdf,'agentacw':!![]},_0x23d0a4,_0x865fca)[_0xcc6f('0x20')](function(_0x2f25cb){logger[_0xcc6f('0x26')](_0xcc6f('0x30'),_0x23d0a4,_0x2edcdf,_0x2f25cb);})['catch'](function(_0x1dd3eb){logger[_0xcc6f('0x33')](_0xcc6f('0x32'),_0x23d0a4,_0x1dd3eb);});}else{logger[_0xcc6f('0x33')](_0xcc6f('0x39'),_0x865fca);if(_0xacf76b[_0xcc6f('0x8')]){logger[_0xcc6f('0x26')](_0xcc6f('0x3a'),JSON[_0xcc6f('0x3b')](_0xacf76b[_0xcc6f('0x8')]));}}}catch(_0x486218){logger[_0xcc6f('0x33')](_0xcc6f('0x3c'),_0x486218[_0xcc6f('0x36')]);}};Acw[_0xcc6f('0x19')][_0xcc6f('0xb')]=function(_0x34dc92){try{if(this['voiceQueues'][_0x34dc92[_0xcc6f('0x3d')]]&&(this['voiceQueues'][_0x34dc92[_0xcc6f('0x3d')]]['acw']||this[_0xcc6f('0x6')][_0x34dc92['queue']][_0xcc6f('0x3e')])){if(this[_0xcc6f('0x7')][_0x34dc92['interface']]){this[_0xcc6f('0x9')][_0x34dc92['uniqueid']]={'queue':_0x34dc92[_0xcc6f('0x3d')],'interface':_0x34dc92['interface'],'destlinkedid':_0x34dc92[_0xcc6f('0x24')]};}}}catch(_0x4473a7){logger[_0xcc6f('0x33')](_0xcc6f('0x3f'),_0x4473a7[_0xcc6f('0x36')]);}};Acw[_0xcc6f('0x19')][_0xcc6f('0x40')]=function(_0x48a23c){try{if(this['voiceQueues'][_0x48a23c[_0xcc6f('0x3d')]]&&(this[_0xcc6f('0x6')][_0x48a23c[_0xcc6f('0x3d')]]['acw']||this[_0xcc6f('0x6')][_0x48a23c[_0xcc6f('0x3d')]][_0xcc6f('0x3e')])){if(this['agents'][_0x48a23c[_0xcc6f('0x41')]]){this[_0xcc6f('0x9')][_0x48a23c['uniqueid']]={'queue':_0x48a23c['queue'],'interface':_0x48a23c[_0xcc6f('0x41')]};}}}catch(_0x394b0d){logger['error']('[ACW][syncAgentConnectPreview]\x20%s',_0x394b0d[_0xcc6f('0x36')]);}};Acw[_0xcc6f('0x19')][_0xcc6f('0xe')]=function(_0x5f03ad){try{if(this['channels'][_0x5f03ad[_0xcc6f('0x2d')]]&&_[_0xcc6f('0x42')](this['channels'][_0x5f03ad[_0xcc6f('0x2d')]][_0xcc6f('0x23')])){logger[_0xcc6f('0x26')](_0xcc6f('0x43'),_0x5f03ad[_0xcc6f('0x2d')]);this['startAcw'](_0x5f03ad[_0xcc6f('0x2d')]);}else if(this[_0xcc6f('0x9')][_0x5f03ad[_0xcc6f('0x44')]]&&_[_0xcc6f('0x42')](this[_0xcc6f('0x9')][_0x5f03ad['linkedid']][_0xcc6f('0x23')])){logger['info'](_0xcc6f('0x45'),_0x5f03ad[_0xcc6f('0x44')]);this[_0xcc6f('0x1a')](_0x5f03ad[_0xcc6f('0x44')]);}}catch(_0x31ca78){logger[_0xcc6f('0x33')](_0xcc6f('0x46'),_0x31ca78['message']);}};Acw[_0xcc6f('0x19')][_0xcc6f('0x10')]=function(_0x4df89d){try{if(this[_0xcc6f('0x9')][_0x4df89d[_0xcc6f('0x2d')]]&&this[_0xcc6f('0x9')][_0x4df89d[_0xcc6f('0x2d')]][_0xcc6f('0x23')]){logger['info'](_0xcc6f('0x47'),_0x4df89d['uniqueid']);this[_0xcc6f('0x1a')](_0x4df89d[_0xcc6f('0x2d')]);}else if(this[_0xcc6f('0x9')][_0x4df89d['linkedid']]&&this[_0xcc6f('0x9')][_0x4df89d['linkedid']]['attended']){logger[_0xcc6f('0x26')](_0xcc6f('0x48'),_0x4df89d['linkedid']);this[_0xcc6f('0x1a')](_0x4df89d['linkedid']);}}catch(_0x3cc95c){logger['error'](_0xcc6f('0x49'),_0x3cc95c[_0xcc6f('0x36')]);}};Acw[_0xcc6f('0x19')][_0xcc6f('0x12')]=function(_0x204fd8){try{if(!_[_0xcc6f('0x4a')](this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4b')]])){this[_0xcc6f('0x1a')](_0x204fd8[_0xcc6f('0x4b')]);if(this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4c')]]){this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4c')]][_0xcc6f('0x23')]=!![];this[_0xcc6f('0x9')][_0x204fd8['transfertargetuniqueid']]=this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4c')]];delete this['channels'][_0x204fd8[_0xcc6f('0x4c')]];}}else if(!_[_0xcc6f('0x4a')](this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4d')]])){this[_0xcc6f('0x1a')](_0x204fd8[_0xcc6f('0x4d')]);if(this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4e')]]){this[_0xcc6f('0x9')][_0x204fd8[_0xcc6f('0x4e')]][_0xcc6f('0x23')]=!![];this[_0xcc6f('0x9')][_0x204fd8['transfereeuniqueid']]=this['channels'][_0x204fd8[_0xcc6f('0x4e')]];delete this['channels'][_0x204fd8[_0xcc6f('0x4e')]];}}}catch(_0x4a4c53){logger[_0xcc6f('0x33')](_0xcc6f('0x4f'),_0x4a4c53[_0xcc6f('0x36')]);}};Acw[_0xcc6f('0x19')][_0xcc6f('0x14')]=function(_0x5c9c87){try{if(this[_0xcc6f('0x9')][_0x5c9c87[_0xcc6f('0x50')]]){logger[_0xcc6f('0x26')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xcc6f('0x3b')](_0x5c9c87[_0xcc6f('0x50')]));this[_0xcc6f('0x1a')](_0x5c9c87[_0xcc6f('0x50')]);}else if(this['channels'][_0x5c9c87[_0xcc6f('0x51')]]){logger[_0xcc6f('0x26')](_0xcc6f('0x52'),JSON['stringify'](_0x5c9c87['transfererlinkedid']));this[_0xcc6f('0x1a')](_0x5c9c87['transfererlinkedid']);}}catch(_0x1b1ad6){logger[_0xcc6f('0x33')](_0xcc6f('0x53'),_0x1b1ad6['message']);}};Acw[_0xcc6f('0x19')]['syncAgentRingNoAnswer']=function(_0x5e1961){try{if(this['voiceQueues'][_0x5e1961[_0xcc6f('0x3d')]]&&this[_0xcc6f('0x6')][_0x5e1961[_0xcc6f('0x3d')]][_0xcc6f('0x54')]==='all'){if(this[_0xcc6f('0x7')][_0x5e1961[_0xcc6f('0x41')]]){logger[_0xcc6f('0x26')](_0xcc6f('0x55'),_0x5e1961['uniqueid'],_0x5e1961['interface'],_0x5e1961[_0xcc6f('0x3d')]);return RpcUser['savePause'](this[_0xcc6f('0x7')][_0x5e1961['interface']],_0xcc6f('0x56'),_0x5e1961['uniqueid']);}}}catch(_0x21f8b6){logger[_0xcc6f('0x33')](_0xcc6f('0x57'),_0x21f8b6[_0xcc6f('0x36')]);}};module['exports']=Acw; \ No newline at end of file +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 diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 3f71469..2aeb3b4 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 _0x757a=['devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','once','connect','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','exports','bluebird','moment','ami','../../config/environment','asterisk','port','password','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','actionSipShowRegistry','actionDeviceStateList'];(function(_0x23c958,_0x188c34){var _0x1d9b73=function(_0x448da3){while(--_0x448da3){_0x23c958['push'](_0x23c958['shift']());}};_0x1d9b73(++_0x188c34);}(_0x757a,0xde));var _0xa757=function(_0xa0c29c,_0x20265f){_0xa0c29c=_0xa0c29c-0x0;var _0x7286a3=_0x757a[_0xa0c29c];return _0x7286a3;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var util=require('util');var _=require('lodash');var logger=require('../../config/logger')(_0xa757('0x2'));var config=require(_0xa757('0x3'));var ami=new Manager(config[_0xa757('0x4')][_0xa757('0x5')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')]['username'],config[_0xa757('0x4')][_0xa757('0x6')],!![]);ami['keepConnected']();ami[_0xa757('0x7')]=BPromise[_0xa757('0x8')](ami[_0xa757('0x9')]);function error(_0x1a95ee){logger[_0xa757('0xa')](util['format'](_0xa757('0xb'),config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x1a95ee,![],null)));}function close(){logger['error'](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config['asterisk']['username'],config[_0xa757('0x4')]['ip'],config['asterisk']['port']));}ami[_0xa757('0xe')]=function(){return function(){return ami['Action']({'action':'sipshowregistry'});};};ami[_0xa757('0xf')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x10')});};};ami[_0xa757('0x11')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x12')});};};ami[_0xa757('0x13')]=function(){return function(){return ami[_0xa757('0x7')]({'action':_0xa757('0x14')});};};ami[_0xa757('0x15')]=function(){return function(){return ami['Action']({'action':_0xa757('0x16')});};};function connect(_0x44eab8){logger[_0xa757('0x17')](util['format']('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));ami[_0xa757('0x18')]('error',error);ami[_0xa757('0x18')]('close',close);}ami['on'](_0xa757('0x19'),connect);ami['on'](_0xa757('0x1a'),function(_0x14014c){logger[_0xa757('0x17')](util['format']('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xa757('0x4')][_0xa757('0xc')],config[_0xa757('0x4')]['ip'],config[_0xa757('0x4')][_0xa757('0x5')],util[_0xa757('0xd')](_0x14014c,![],null)));});ami['on'](_0xa757('0x1b'),function(_0x21f1af){logger[_0xa757('0x17')](util['format'](_0xa757('0x1c'),config['asterisk'][_0xa757('0xc')],config['asterisk']['ip'],config[_0xa757('0x4')][_0xa757('0x5')]));return BPromise[_0xa757('0x1d')]()['then'](ami[_0xa757('0xe')]())[_0xa757('0x1e')](ami[_0xa757('0xf')]())[_0xa757('0x1e')](ami['actionSipPeerStatus']())[_0xa757('0x1e')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())['catch'](function(_0xfdf69d){logger['error'](_0xa757('0x1f'),util[_0xa757('0xd')](_0xfdf69d,{'showHidden':![],'depth':null}));});});ami['once'](_0xa757('0xa'),error);ami['once'](_0xa757('0x20'),close);module[_0xa757('0x21')]=ami; \ No newline at end of file +var _0x2032=['exports','bluebird','moment','util','../../config/logger','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','format','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','inspect'];(function(_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 diff --git a/server/services/ami/client.js b/server/services/ami/client.js index a4f2635..941f5a9 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 _0xa9e0=['result','catch','exports','jayson/promise','bluebird','../../config/logger','http','request','debug','rpc','error','message'];(function(_0x29bfda,_0x30ad24){var _0x3f3db5=function(_0x238405){while(--_0x238405){_0x29bfda['push'](_0x29bfda['shift']());}};_0x3f3db5(++_0x30ad24);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('ami');var client=jayson['client'][_0x0a9e('0x3')]({'port':0x2329});client['Request']=function(_0x333808,_0x432180){return new BPromise(function(_0x2ab90b,_0x991246){return client[_0x0a9e('0x4')](_0x333808,_0x432180)['then'](function(_0x219af0){logger[_0x0a9e('0x5')](_0x0a9e('0x6'),'memberReport',_0x333808,_0x432180,_0x219af0);if(_0x219af0['error']){logger[_0x0a9e('0x7')]('rpc','memberReport',_0x333808,_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')],_0x432180);return _0x991246(_0x219af0[_0x0a9e('0x7')][_0x0a9e('0x8')]);}else{return _0x2ab90b(_0x219af0[_0x0a9e('0x9')]);}})[_0x0a9e('0xa')](function(_0x4a4c56){logger['error']('rpc','memberReport',_0x333808,_0x4a4c56,_0x432180);return _0x991246(_0x4a4c56);});});};module[_0x0a9e('0xb')]=client; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index e76621f..f6672ea 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 _0x8295=['callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','getQueue','exports','lodash','moment','isNil','string','uniqueid','name','phone','Contact','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','ContactFirstName','starttime','format','callback','callbackuniqueid'];(function(_0x4d765e,_0x4cbc77){var _0x4c3ef8=function(_0x1467fa){while(--_0x1467fa){_0x4d765e['push'](_0x4d765e['shift']());}};_0x4c3ef8(++_0x4cbc77);}(_0x8295,0x184));var _0x5829=function(_0x226ad1,_0x2858e2){_0x226ad1=_0x226ad1-0x0;var _0x16b625=_0x8295[_0x226ad1];return _0x16b625;};'use strict';var util=require('util');var _=require(_0x5829('0x0'));var moment=require(_0x5829('0x1'));function checkNameSurname(_0x566f57,_0xb9eae3,_0x5b7568){var _0x2f139c='';if(!_[_0x5829('0x2')](_0xb9eae3)&&_0x5829('0x3')===typeof _0xb9eae3){_0x2f139c+=_0xb9eae3;}if(!_[_0x5829('0x2')](_0x5b7568)&&_0x5829('0x3')===typeof _0x5b7568){_0x2f139c+='\x20'+_0x5b7568;}if(_0x2f139c!==''){return _0x2f139c;}return _0x566f57;}function Action(_0x51a4c3,_0xf327ab,_0x307185){this['voiceQueue']=_0x51a4c3;this[_0x5829('0x4')]=_0x307185||undefined;this[_0x5829('0x5')]=checkNameSurname(_0xf327ab['Contact'][_0x5829('0x6')],_0xf327ab[_0x5829('0x7')][_0x5829('0x8')],_0xf327ab[_0x5829('0x7')][_0x5829('0x9')]);this[_0x5829('0xa')]=_0xf327ab[_0x5829('0x7')][_0x5829('0x6')];this[_0x5829('0xb')]=_0x51a4c3[_0x5829('0x5')];this[_0x5829('0xc')]=_0xf327ab['active']||![];this['type']=_0x51a4c3[_0x5829('0xd')];this['dialQueueTimeout']=_0x51a4c3[_0x5829('0xe')]||0x3;this[_0x5829('0xf')]=_0xf327ab[_0x5829('0xf')];this[_0x5829('0x10')]=_0xf327ab[_0x5829('0x10')];this['countcongestionretry']=_0xf327ab[_0x5829('0x11')];this[_0x5829('0x12')]=_0xf327ab[_0x5829('0x12')];this[_0x5829('0x13')]=_0xf327ab[_0x5829('0x13')];this[_0x5829('0x14')]=_0xf327ab[_0x5829('0x14')];this['countabandonedretry']=_0xf327ab[_0x5829('0x15')];this['countmachineretry']=_0xf327ab[_0x5829('0x16')];this['countagentrejectretry']=_0xf327ab['countagentrejectretry'];this[_0x5829('0x17')]=_0xf327ab[_0x5829('0x17')];this['ListId']=_0xf327ab[_0x5829('0x18')];this['UserId']=_0xf327ab[_0x5829('0x19')];this['VoiceQueueId']=_0xf327ab[_0x5829('0x1a')];this['CampaignId']=_0xf327ab['CampaignId'];this['idHopper']=_0xf327ab['id'];this[_0x5829('0x1b')]=_0xf327ab[_0x5829('0x7')][_0x5829('0x8')]||'';this[_0x5829('0x1c')]=moment()[_0x5829('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0xf327ab[_0x5829('0x1e')];this['callbackuniqueid']=_0xf327ab[_0x5829('0x1f')];this[_0x5829('0x20')]=_0xf327ab[_0x5829('0x20')];this[_0x5829('0x21')]=_0xf327ab[_0x5829('0x21')];this[_0x5829('0x22')]='';this['originatecalleridname']='';}Action[_0x5829('0x23')][_0x5829('0x24')]=function(){return util['format'](_0x5829('0x25'),this[_0x5829('0x5')],this[_0x5829('0x26')][_0x5829('0x27')]>0x0?this[_0x5829('0xa')]['substring'](this['voiceQueue'][_0x5829('0x27')]):this[_0x5829('0xa')]);};Action[_0x5829('0x23')][_0x5829('0x28')]=function(){return this['queue'];};module[_0x5829('0x29')]=Action; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index e9a8e3a..b63c9aa 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 _0x809f=['countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','diff','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0xc05a2b,_0xd246af){var _0x4116e1=function(_0x1bda4f){while(--_0x1bda4f){_0xc05a2b['push'](_0xc05a2b['shift']());}};_0x4116e1(++_0xd246af);}(_0x809f,0x1f4));var _0xf809=function(_0x327b91,_0x4449a6){_0x327b91=_0x327b91-0x0;var _0x536b83=_0x809f[_0x327b91];return _0x536b83;};'use strict';var util=require('util');var _=require(_0xf809('0x0'));var moment=require('moment');function getSeconds(_0x4ee77a,_0x1f0e07){var _0x44d2a2=moment(_0x4ee77a)[_0xf809('0x1')](0x0);var _0x544c50=moment(_0x1f0e07)[_0xf809('0x1')](0x0);return _0x44d2a2[_0xf809('0x2')](_0x544c50,'seconds');}function AgentComplete(_0x8ac77a,_0x5ecc98){this['state']=0x4;this['statedesc']='Answer';this[_0xf809('0x3')]=_0x8ac77a[_0xf809('0x3')];this[_0xf809('0x4')]=_0x8ac77a[_0xf809('0x4')];this[_0xf809('0x5')]=_0x8ac77a[_0xf809('0x4')]===_0xf809('0x6')?_0xf809('0x7'):_0x8ac77a[_0xf809('0x4')];this[_0xf809('0x8')]=_0x8ac77a[_0xf809('0x8')];this[_0xf809('0x9')]=_0x8ac77a[_0xf809('0x9')];this[_0xf809('0xa')]=_0x8ac77a[_0xf809('0xa')];this[_0xf809('0xb')]=_0x8ac77a[_0xf809('0x8')]+_0x8ac77a[_0xf809('0x9')]+_0x8ac77a[_0xf809('0xa')]+_0x8ac77a[_0xf809('0xc')]+_0x8ac77a[_0xf809('0xd')]+_0x8ac77a[_0xf809('0xe')]+_0x8ac77a[_0xf809('0xf')]+_0x8ac77a[_0xf809('0x10')];this['countnosuchnumberretry']=_0x8ac77a[_0xf809('0xc')];this['countdropretry']=_0x8ac77a[_0xf809('0xd')];this['countabandonedretry']=_0x8ac77a[_0xf809('0xe')];this[_0xf809('0xf')]=_0x8ac77a[_0xf809('0xf')];this[_0xf809('0x10')]=_0x8ac77a[_0xf809('0x10')];this[_0xf809('0x11')]=_0x5ecc98[_0xf809('0x11')];this[_0xf809('0x12')]=_0x8ac77a[_0xf809('0x13')];this['calleridnum']=_0x8ac77a[_0xf809('0x14')];this[_0xf809('0x15')]=_0x8ac77a[_0xf809('0x15')];this[_0xf809('0x16')]=_0x8ac77a[_0xf809('0x16')];this[_0xf809('0x17')]=_0x8ac77a[_0xf809('0x17')];this[_0xf809('0x18')]=moment()[_0xf809('0x19')](_0xf809('0x1a'));this[_0xf809('0x1b')]=getSeconds(_0x8ac77a[_0xf809('0x16')],_0x8ac77a['starttime']);this[_0xf809('0x1c')]=getSeconds(_0x8ac77a[_0xf809('0x17')],_0x8ac77a[_0xf809('0x16')]);this[_0xf809('0x1d')]=getSeconds(this[_0xf809('0x18')],_0x8ac77a['answertime']);this[_0xf809('0x7')]=_0x5ecc98['queue'];this[_0xf809('0x1e')]=_0x5ecc98['membername'];this[_0xf809('0x1f')]=_0x5ecc98[_0xf809('0x1f')];this[_0xf809('0x20')]=_0x8ac77a[_0xf809('0x20')];this['callbackuniqueid']=_0x8ac77a[_0xf809('0x21')];this[_0xf809('0x22')]=_0x8ac77a[_0xf809('0x22')];this[_0xf809('0x23')]=_0x8ac77a[_0xf809('0x23')];this[_0xf809('0x24')]=_0x8ac77a[_0xf809('0x24')];this[_0xf809('0x25')]=_0x8ac77a[_0xf809('0x25')];this[_0xf809('0x26')]=_0x8ac77a['UserId'];this[_0xf809('0x27')]=_0x8ac77a[_0xf809('0x27')];this['CampaignId']=_0x8ac77a['CampaignId'];this[_0xf809('0x28')]=_0x8ac77a['originatecalleridnum']||'';this[_0xf809('0x29')]=_0x8ac77a[_0xf809('0x29')]||'';}module[_0xf809('0x2a')]=AgentComplete; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 6c5ec04..f11415d 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 _0x08d9=['moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util'];(function(_0x3597d2,_0x4046df){var _0x87f797=function(_0x1c2bd7){while(--_0x1c2bd7){_0x3597d2['push'](_0x3597d2['shift']());}};_0x87f797(++_0x4046df);}(_0x08d9,0xc2));var _0x908d=function(_0x36e1f3,_0x5bae3b){_0x36e1f3=_0x36e1f3-0x0;var _0x44e608=_0x08d9[_0x36e1f3];return _0x44e608;};'use strict';var util=require(_0x908d('0x0'));var _=require('lodash');var moment=require(_0x908d('0x1'));function getSeconds(_0x488ec0,_0x1557c3){var _0x739218=moment(_0x488ec0)[_0x908d('0x2')](0x0);var _0x5228dd=moment(_0x1557c3)['milliseconds'](0x0);return _0x739218[_0x908d('0x3')](_0x5228dd,_0x908d('0x4'));}function Final(_0x1fa63e){this[_0x908d('0x5')]=_0x1fa63e[_0x908d('0x5')];this['scheduledat']=_0x1fa63e[_0x908d('0x6')];this[_0x908d('0x7')]=_0x1fa63e[_0x908d('0x7')];this[_0x908d('0x8')]=_0x1fa63e[_0x908d('0x7')]===_0x908d('0x9')?_0x908d('0xa'):_0x1fa63e[_0x908d('0x7')];this[_0x908d('0xb')]=_0x1fa63e[_0x908d('0xb')];this['countcongestionretry']=_0x1fa63e[_0x908d('0xc')];this[_0x908d('0xd')]=_0x1fa63e[_0x908d('0xd')];this[_0x908d('0xe')]=_0x1fa63e[_0x908d('0xb')]+_0x1fa63e['countcongestionretry']+_0x1fa63e['countnoanswerretry']+_0x1fa63e['countnosuchnumberretry']+_0x1fa63e[_0x908d('0xf')]+_0x1fa63e[_0x908d('0x10')]+_0x1fa63e[_0x908d('0x11')]+_0x1fa63e[_0x908d('0x12')];this[_0x908d('0x13')]=_0x1fa63e[_0x908d('0x13')];this[_0x908d('0xf')]=_0x1fa63e['countdropretry'];this['countabandonedretry']=_0x1fa63e[_0x908d('0x10')];this[_0x908d('0x11')]=_0x1fa63e[_0x908d('0x11')];this[_0x908d('0x12')]=_0x1fa63e['countagentrejectretry'];this['queue']=_0x1fa63e[_0x908d('0xa')];this[_0x908d('0x14')]=_0x1fa63e[_0x908d('0x14')];this[_0x908d('0x15')]=_0x1fa63e['calleridnum'];this[_0x908d('0x16')]=_0x1fa63e[_0x908d('0x16')];this[_0x908d('0x17')]=_0x1fa63e[_0x908d('0x17')];this[_0x908d('0x18')]=_0x1fa63e[_0x908d('0x17')];this[_0x908d('0x19')]=_0x1fa63e['ringtime']||0x0;this[_0x908d('0x1a')]=_0x1fa63e[_0x908d('0x1a')]||0x0;this[_0x908d('0x1b')]=_0x1fa63e['talktime']||0x0;this[_0x908d('0x1c')]=_0x1fa63e[_0x908d('0x1c')];this[_0x908d('0x1d')]=_0x1fa63e[_0x908d('0x1d')];this[_0x908d('0x1e')]=_0x1fa63e['callbackat'];this[_0x908d('0x1f')]=_0x1fa63e['recallme'];this[_0x908d('0x20')]=_0x1fa63e[_0x908d('0x20')];this[_0x908d('0x21')]=_0x1fa63e[_0x908d('0x21')];this[_0x908d('0x22')]=_0x1fa63e[_0x908d('0x22')];this[_0x908d('0x23')]=_0x1fa63e[_0x908d('0x23')];this['CampaignId']=_0x1fa63e[_0x908d('0x24')];this[_0x908d('0x25')]=_0x1fa63e[_0x908d('0x25')]||'';this[_0x908d('0x26')]=_0x1fa63e[_0x908d('0x26')]||'';}module['exports']=Final; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index ab500e3..c2233fd 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 _0x0266=['format','holdtime','talktime','endtime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','lodash','moment','milliseconds','diff','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x0266,0xb6));var _0x6026=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x0266[_0x1928c9];return _0x51b5fb;};'use strict';var util=require('util');var _=require(_0x6026('0x0'));var moment=require(_0x6026('0x1'));function getSeconds(_0x53a309,_0x4f4e18){var _0x5e522a=moment(_0x53a309)[_0x6026('0x2')](0x0);var _0x1aa82d=moment(_0x4f4e18)['milliseconds'](0x0);return _0x5e522a[_0x6026('0x3')](_0x1aa82d,'seconds');}function Hangup(_0x22023c,_0x35af73){this['state']=0x4;this['statedesc']=_0x6026('0x4');this[_0x6026('0x5')]=_0x22023c[_0x6026('0x5')];this[_0x6026('0x6')]=_0x22023c[_0x6026('0x6')];this[_0x6026('0x7')]=_0x22023c[_0x6026('0x6')]===_0x6026('0x8')?_0x6026('0x9'):_0x22023c[_0x6026('0x6')];this[_0x6026('0xa')]=_0x22023c[_0x6026('0xa')];this['countcongestionretry']=_0x22023c['countcongestionretry'];this[_0x6026('0xb')]=_0x22023c[_0x6026('0xb')];this['countglobal']=_0x22023c[_0x6026('0xa')]+_0x22023c[_0x6026('0xc')]+_0x22023c['countnoanswerretry']+_0x22023c[_0x6026('0xd')]+_0x22023c[_0x6026('0xe')]+_0x22023c[_0x6026('0xf')]+_0x22023c[_0x6026('0x10')]+_0x22023c[_0x6026('0x11')];this['countnosuchnumberretry']=_0x22023c['countnosuchnumberretry'];this['countdropretry']=_0x22023c['countdropretry'];this[_0x6026('0xf')]=_0x22023c[_0x6026('0xf')];this[_0x6026('0x10')]=_0x22023c[_0x6026('0x10')];this['countagentrejectretry']=_0x22023c[_0x6026('0x11')];this[_0x6026('0x12')]=_0x35af73[_0x6026('0x12')];this['calleridname']=_0x22023c['name'];this[_0x6026('0x13')]=_0x22023c[_0x6026('0x14')];this[_0x6026('0x15')]=_0x22023c[_0x6026('0x15')];this[_0x6026('0x16')]=_0x22023c['responsetime'];this['endtime']=moment()[_0x6026('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x22023c['responsetime'],_0x22023c[_0x6026('0x15')]);this[_0x6026('0x18')]=0x0;this[_0x6026('0x19')]=getSeconds(this[_0x6026('0x1a')],_0x22023c[_0x6026('0x16')]);this[_0x6026('0x9')]=_0x22023c[_0x6026('0x9')];this[_0x6026('0x1b')]=_0x6026('0x1c');this[_0x6026('0x1d')]=_0x35af73[_0x6026('0x1e')];this[_0x6026('0x1f')]=_0x22023c[_0x6026('0x1f')];this[_0x6026('0x20')]=_0x22023c['callbackuniqueid'];this['callbackat']=_0x22023c[_0x6026('0x21')];this[_0x6026('0x22')]=_0x22023c[_0x6026('0x22')];this[_0x6026('0x23')]=_0x22023c[_0x6026('0x23')];this[_0x6026('0x24')]=_0x22023c[_0x6026('0x24')];this['UserId']=_0x22023c[_0x6026('0x25')];this[_0x6026('0x26')]=_0x22023c['VoiceQueueId'];this[_0x6026('0x27')]=_0x22023c[_0x6026('0x27')];}module[_0x6026('0x28')]=Hangup; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 3edf3c5..d105a7d 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 _0xf8c2=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','responsetime','endtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xf8c2,0x7a));var _0x2f8c=function(_0xbd9d78,_0x35160f){_0xbd9d78=_0xbd9d78-0x0;var _0x43df88=_0xf8c2[_0xbd9d78];return _0x43df88;};'use strict';var util=require(_0x2f8c('0x0'));var _=require(_0x2f8c('0x1'));var moment=require(_0x2f8c('0x2'));function getSeconds(_0x272e8a,_0x56a771){var _0x361514=moment(_0x272e8a)[_0x2f8c('0x3')](0x0);var _0x47d598=moment(_0x56a771)[_0x2f8c('0x3')](0x0);return _0x361514[_0x2f8c('0x4')](_0x47d598,_0x2f8c('0x5'));}function History(_0x24a35f){this[_0x2f8c('0x6')]=_0x24a35f[_0x2f8c('0x6')];this[_0x2f8c('0x7')]=_0x24a35f['scheduledat']||undefined;this[_0x2f8c('0x8')]=_0x24a35f['type'];this[_0x2f8c('0x9')]=_0x24a35f[_0x2f8c('0x8')]===_0x2f8c('0xa')?'queue':_0x24a35f[_0x2f8c('0x8')];this['countbusyretry']=_0x24a35f['countbusyretry'];this[_0x2f8c('0xb')]=_0x24a35f[_0x2f8c('0xb')];this[_0x2f8c('0xc')]=_0x24a35f['countnoanswerretry'];this[_0x2f8c('0xd')]=_0x24a35f[_0x2f8c('0xe')]+_0x24a35f[_0x2f8c('0xb')]+_0x24a35f[_0x2f8c('0xc')]+_0x24a35f[_0x2f8c('0xf')]+_0x24a35f[_0x2f8c('0x10')]+_0x24a35f[_0x2f8c('0x11')]+_0x24a35f[_0x2f8c('0x12')]+_0x24a35f[_0x2f8c('0x13')];this['countnosuchnumberretry']=_0x24a35f['countnosuchnumberretry'];this[_0x2f8c('0x10')]=_0x24a35f[_0x2f8c('0x10')];this['countabandonedretry']=_0x24a35f[_0x2f8c('0x11')];this[_0x2f8c('0x12')]=_0x24a35f[_0x2f8c('0x12')];this[_0x2f8c('0x13')]=_0x24a35f[_0x2f8c('0x13')];this[_0x2f8c('0x14')]=_0x24a35f[_0x2f8c('0x14')];this['calleridname']=_0x24a35f[_0x2f8c('0x15')];this[_0x2f8c('0x16')]=_0x24a35f['number'];this['starttime']=_0x24a35f['starttime'];this[_0x2f8c('0x17')]=_0x24a35f['responsetime'];this[_0x2f8c('0x18')]=_0x24a35f[_0x2f8c('0x17')];this['ringtime']=getSeconds(_0x24a35f[_0x2f8c('0x17')],_0x24a35f['starttime']);this['holdtime']=0x0;this[_0x2f8c('0x19')]=0x0;this[_0x2f8c('0x1a')]=_0x24a35f[_0x2f8c('0x1a')];this[_0x2f8c('0x1b')]=_0x24a35f[_0x2f8c('0x1b')];this[_0x2f8c('0x1c')]=_0x24a35f[_0x2f8c('0x1c')];this[_0x2f8c('0x1d')]=_0x24a35f[_0x2f8c('0x1d')];this[_0x2f8c('0x1e')]=_0x24a35f['ContactId'];this['ListId']=_0x24a35f[_0x2f8c('0x1f')];this['UserId']=_0x24a35f[_0x2f8c('0x20')];this['VoiceQueueId']=_0x24a35f[_0x2f8c('0x21')];this['CampaignId']=_0x24a35f[_0x2f8c('0x22')];this[_0x2f8c('0x23')]=_0x24a35f['originatecalleridnum']||'';this[_0x2f8c('0x24')]=_0x24a35f[_0x2f8c('0x24')]||'';}module[_0x2f8c('0x25')]=History; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index d2d8b7a..0ec4b82 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 _0x5b05=['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','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','contacts','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','state','statedesc','endtime','starttime','prototype','clearZombieChannels','[uniqueid]','[actions]','Action','status','channel','updateOriginated','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','catch','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','isTrunkReachable','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','membername','AMD','custom:amd','buildObj','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','countmachineretry','countglobal','amd','emit','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','[syncHangupInAMDIvr][createHistory]','Machine','[syncAgentComplete][createHistory][0]','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','cause-txt','agent','dialQueueProject2','dialAgiAfterHangupAgent','answertime','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','TIMEOUT','agiafterat','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','dropreason','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','roundrobin','paused','agents','stateinterface','locked','rrmemory','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','queueBookedRR','_rr','[booked][RR]','stringify','unlockRR','contactAgent-idHopper:\x20','run','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','interval','content','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','handleIvr','syncQueueSummary','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','launchHandleIvr','[syncCampaigns]','pow','replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','dialQueueTimeout','NONE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','createdAt','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','trim','dialCutDigit','SIP/%s/%s%s','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','Error','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','custom:agentcongestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','outboundUnknownCallsDay','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\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','Predictive\x20after\x20first\x20interval','getDataPredictive','startMethodPredictive','Predictive\x20for\x20every\x20interval',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','busyFactor','one\x20call\x20every:','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','[booked][checkContactBlack][else]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','[Originate][historyBlacklist]','inBlackList','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','pTalking','not_inuse','reachable','dialOrderByScheduledAt','ACTIVE','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','interval\x20=\x20','Umin\x20=\x20','exports','lodash','bluebird','uuid','moment','md5','ioredis','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','milliseconds','seconds','type','strategy','available','loggedIn','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'];(function(_0xbbf320,_0x2dc0f8){var _0x56ad67=function(_0x404c24){while(--_0x404c24){_0xbbf320['push'](_0xbbf320['shift']());}};_0x56ad67(++_0x2dc0f8);}(_0x5b05,0x190));var _0x55b0=function(_0x5c241a,_0x1592a5){_0x5c241a=_0x5c241a-0x0;var _0x17e75a=_0x5b05[_0x5c241a];return _0x17e75a;};'use strict';var util=require('util');var _=require(_0x55b0('0x0'));var BPromise=require(_0x55b0('0x1'));var uuid=require(_0x55b0('0x2'));var moment=require(_0x55b0('0x3'));var rr=require('rr');var md5=require(_0x55b0('0x4'));var Redis=require(_0x55b0('0x5'));var ut=require(_0x55b0('0x6'));var config=require(_0x55b0('0x7'));var logger=require(_0x55b0('0x8'))(_0x55b0('0x9'));var loggerBooked=require('../../../config/logger')('booked');var loggerPredictive=require(_0x55b0('0x8'))(_0x55b0('0xa'));var loggerPredictiveCalls=require(_0x55b0('0x8'))(_0x55b0('0xb'));var loggerSyncQueueSummary=require(_0x55b0('0x8'))('syncQueueSummary');var ami=require(_0x55b0('0xc'));config[_0x55b0('0xd')]=_[_0x55b0('0xe')](config[_0x55b0('0xd')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x55b0('0xd')]));var cmHopper=require(_0x55b0('0xf'));var cmHopperHistory=require(_0x55b0('0x10'));var cmHopperBlack=require(_0x55b0('0x11'));var voiceQueueRt=require(_0x55b0('0x12'));var Action=require(_0x55b0('0x13'));var History=require('./history');var Final=require(_0x55b0('0x14'));var AgentComplete=require(_0x55b0('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x55b0('0x16'));var ipAgi=process[_0x55b0('0x17')][_0x55b0('0x18')]||_0x55b0('0x19');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0x55b0('0x1a')]=function(_0x5ea728){this[_0x55b0('0x1b')]=this[_0x55b0('0x1b')]?this['tail'][_0x55b0('0x1c')](_0x5ea728):_0x5ea728();};function Dialer(_0x470873,_0x32342d){this[_0x55b0('0x1d')]=new Sequence();this[_0x55b0('0x1e')]=_0x32342d;this['voiceQueues']=_0x470873[_0x55b0('0x1f')];this[_0x55b0('0x20')]=_0x470873[_0x55b0('0x20')];this['agents']=_0x470873['agents'];this[_0x55b0('0x21')]=_0x470873[_0x55b0('0x21')];this[_0x55b0('0x22')]=config['maxNumberOriginate']||0x2;this[_0x55b0('0x23')]={};this[_0x55b0('0x24')]={};this[_0x55b0('0x25')]={};this[_0x55b0('0x26')]={};this['optionPredictive']={};this[_0x55b0('0x27')]={};this[_0x55b0('0x28')]={};this[_0x55b0('0x29')]={};this[_0x55b0('0x2a')]={};this['queueBookedRR']={};ami['on'](_0x55b0('0x2b'),this['syncAgentConnect'][_0x55b0('0x2c')](this));ami['on']('queuecallerabandon',this[_0x55b0('0x2d')][_0x55b0('0x2c')](this));ami['on'](_0x55b0('0x2e'),this[_0x55b0('0x2f')][_0x55b0('0x2c')](this));ami['on'](_0x55b0('0x30'),this[_0x55b0('0x31')]['bind'](this));ami['on'](_0x55b0('0x32'),this['syncQueueSummary'][_0x55b0('0x2c')](this));ami['on'](_0x55b0('0x33'),this[_0x55b0('0x34')]['bind'](this));ami['on'](_0x55b0('0x35'),this['syncNewExten'][_0x55b0('0x2c')](this));ami['on'](_0x55b0('0x36'),this[_0x55b0('0x37')][_0x55b0('0x2c')](this));ami['on'](_0x55b0('0x38'),this[_0x55b0('0x39')][_0x55b0('0x2c')](this));ami['on'](_0x55b0('0x3a'),this[_0x55b0('0x3b')][_0x55b0('0x2c')](this));this[_0x55b0('0x3c')]();this[_0x55b0('0x3d')]();}function isNotNull(_0x197c64){return _0x197c64!==null&&!_[_0x55b0('0x3e')](_0x197c64);}function checkIsLoggedIn(_0x11e555,_0xc62841){return function(){if(_0xc62841<=0x0){_0x11e555[_0x55b0('0x3f')]='AGENTS_NOT_LOGGED';throw _0x11e555[_0x55b0('0x40')]+_0x55b0('0x41');}};}function isActive(_0x3bf2c4){return _0x3bf2c4;}function checkIsActive(_0x3c1115,_0x56b411){return function(){if(!isActive(_0x56b411)){_0x3c1115[_0x55b0('0x3f')]=_0x55b0('0x42');throw _0x3c1115[_0x55b0('0x40')]+_0x55b0('0x43');}};}function checkInterval(_0x470198){return function(){if(!isNotNull(_0x470198[_0x55b0('0x44')])){_0x470198['message']=_0x55b0('0x45');throw _0x470198['name']+_0x55b0('0x46');}if(!isNotNull(_0x470198[_0x55b0('0x44')][_0x55b0('0x47')])){_0x470198[_0x55b0('0x3f')]=_0x55b0('0x45');throw _0x470198[_0x55b0('0x40')]+_0x55b0('0x46');}if(!isNotNull(_[_0x55b0('0x48')](_0x470198[_0x55b0('0x44')][_0x55b0('0x47')]))){_0x470198['message']=_0x55b0('0x45');throw _0x470198[_0x55b0('0x40')]+_0x55b0('0x46');}};}function msgResponse(_0x28b3c5,_0x2ef920,_0x17a403){return{'action':_0x28b3c5,'response':_0x2ef920,'message':_0x17a403,'stack':_0x17a403};}function myreject(_0x1126fc){return function(_0xd13274){return _0x1126fc(msgResponse(_0x55b0('0x49'),'Error',JSON['stringify'](_0xd13274)));};}function getSeconds(_0x274d5b,_0x58863d){var _0x365c57=moment(_0x274d5b)['milliseconds'](0x0);var _0x204df3=moment(_0x58863d)[_0x55b0('0x4a')](0x0);return _0x365c57['diff'](_0x204df3,_0x55b0('0x4b'));}function emit(_0x148cc8,_0x433d06,_0x47e99b){io['to'](_0x148cc8)['emit'](_0x433d06,_0x47e99b);}function emitVoiceQueueSummary(_0x512969){if(_0x512969[_0x55b0('0x4c')]==='outbound'){var _0x4b7d7b={'id':_0x512969['id'],'name':_0x512969[_0x55b0('0x40')],'strategy':_0x512969[_0x55b0('0x4d')],'answered':_0x512969['answered'],'available':_0x512969[_0x55b0('0x4e')],'loggedIn':_0x512969[_0x55b0('0x4f')],'pTalking':_0x512969['pTalking'],'sumBillable':_0x512969['sumBillable'],'sumDuration':_0x512969[_0x55b0('0x50')],'sumHoldTime':_0x512969[_0x55b0('0x51')]||0x0,'talking':_0x512969[_0x55b0('0x52')],'total':_0x512969['total'],'type':_0x512969[_0x55b0('0x4c')],'unmanaged':_0x512969[_0x55b0('0x53')],'abandoned':_0x512969[_0x55b0('0x54')],'waiting':_0x512969[_0x55b0('0x55')],'loggedInDb':_0x512969[_0x55b0('0x56')],'dialActive':_0x512969[_0x55b0('0x57')],'dialMethod':_0x512969[_0x55b0('0x58')],'dialOriginateCallerIdName':_0x512969[_0x55b0('0x59')],'dialOriginateCallerIdNumber':_0x512969[_0x55b0('0x5a')],'dialOriginateTimeout':_0x512969['dialOriginateTimeout'],'dialPrefix':_0x512969['dialPrefix'],'outboundAnswerAgiCallsDay':_0x512969[_0x55b0('0x5b')],'outboundAnswerCallsDay':_0x512969[_0x55b0('0x5c')],'outboundBlacklistCallsDay':_0x512969[_0x55b0('0x5d')],'outboundBusyCallsDay':_0x512969[_0x55b0('0x5e')],'outboundCongestionCallsDay':_0x512969['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x512969['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x512969['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x512969[_0x55b0('0x5f')],'outboundNoAnswerCallsDay':_0x512969[_0x55b0('0x60')],'outboundNoSuchCallsDay':_0x512969[_0x55b0('0x61')],'outboundOriginateFailureCallsDay':_0x512969[_0x55b0('0x62')],'outboundReCallsDay':_0x512969[_0x55b0('0x63')],'outboundRejectCallsDay':_0x512969[_0x55b0('0x64')],'outboundUnknownCallsDay':_0x512969['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x512969[_0x55b0('0x65')],'predictiveIntervalAvgHoldtime':_0x512969[_0x55b0('0x66')],'predictiveIntervalAvgTalktime':_0x512969[_0x55b0('0x67')],'predictiveIntervalDroppedCallsCallersExit':_0x512969['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x512969[_0x55b0('0x68')],'predictiveIntervalErlangCalls':_0x512969[_0x55b0('0x69')],'predictiveIntervalErlangCallsDroppedCalls':_0x512969[_0x55b0('0x6a')],'predictiveIntervalHitRate':_0x512969[_0x55b0('0x6b')],'predictiveIntervalMultiplicativeFactor':_0x512969[_0x55b0('0x6c')],'predictiveIntervalPauses':_0x512969[_0x55b0('0x6d')],'predictiveIntervalAvailable':_0x512969['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x512969[_0x55b0('0x6e')],'message':_0x512969['message'],'originated':_0x512969[_0x55b0('0x6f')],'erlangCalls':_0x512969[_0x55b0('0x70')],'erlangCallToSecond':_0x512969[_0x55b0('0x71')],'erlangAbandonmentRate':_0x512969[_0x55b0('0x72')],'erlangBusyFactor':_0x512969[_0x55b0('0x73')],'startPredictive':_0x512969[_0x55b0('0x27')],'startProgressive':_0x512969[_0x55b0('0x28')]};if(_0x512969[_0x55b0('0x74')]){_0x4b7d7b['Trunk']={'id':_0x512969['Trunk']['id'],'name':_0x512969[_0x55b0('0x74')][_0x55b0('0x40')],'active':_0x512969[_0x55b0('0x74')][_0x55b0('0x75')],'callerid':_0x512969['Trunk']['callerid']};}if(_0x512969[_0x55b0('0x44')]){_0x4b7d7b[_0x55b0('0x44')]={'id':_0x512969[_0x55b0('0x44')]['id'],'name':_0x512969['Interval']['name']};}var _0x7e2fc=md5(JSON['stringify'](_0x4b7d7b));if(_0x512969[_0x55b0('0x4')]!==_0x7e2fc){_0x512969[_0x55b0('0x4')]=_0x7e2fc;emit(util[_0x55b0('0x76')](_0x55b0('0x77'),_0x4b7d7b['name']),_0x55b0('0x78'),_0x4b7d7b);}}}function emitCampaignSummary(_0x4e730a){if(_0x4e730a[_0x55b0('0x4c')]===_0x55b0('0x79')){emit(util[_0x55b0('0x76')](_0x55b0('0x7a'),_0x4e730a[_0x55b0('0x40')]),'campaign:save',_0x4e730a);}}function checkGetDataPredictive(_0x3676e6){if(isNotNull(_0x3676e6)&&!_[_0x55b0('0x48')](_0x3676e6)){loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x7c'));loggerPredictive['info'](_0x55b0('0x7d'),_0x3676e6[_0x55b0('0x6e')]);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x7e'),_0x3676e6[_0x55b0('0x65')]);loggerPredictive['info'](_0x55b0('0x7f'),_0x3676e6[_0x55b0('0x68')]);loggerPredictive[_0x55b0('0x7b')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3676e6[_0x55b0('0x80')]);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x81'),_0x3676e6[_0x55b0('0x66')]);loggerPredictive[_0x55b0('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3676e6[_0x55b0('0x67')]);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x82'));if(_0x3676e6['predictiveIntervalTotalCalls']>0x0){if(!_[_0x55b0('0x3e')](_0x3676e6[_0x55b0('0x67')])&&_0x3676e6[_0x55b0('0x67')]>0x0){return!![];}loggerPredictive['info'](_0x55b0('0x83'));if(!_['isUndefined'](_0x3676e6[_0x55b0('0x66')])&&_0x3676e6[_0x55b0('0x66')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x84'));}}else{loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x85'));}return![];}function mergeDataErlangB(_0x182d67){return function(_0x4655f7){loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x86'));loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4655f7['erlangCalls']);loggerPredictive['info'](_0x55b0('0x87'),_0x4655f7[_0x55b0('0x71')]);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x88'),_0x4655f7[_0x55b0('0x72')]);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x89'),_0x4655f7['erlangBusyFactor']);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x88'),_0x4655f7['erlangAbandonmentRate']);loggerPredictive[_0x55b0('0x7b')]('---------------------------');_[_0x55b0('0x8a')](_0x182d67,_0x4655f7);};}function getDiff(_0x49cb02){var _0x153d0a=moment()[_0x55b0('0x4a')](0x0);var _0x354c43=moment(_0x49cb02)['milliseconds'](0x0);return _0x153d0a[_0x55b0('0x8b')](_0x354c43,_0x55b0('0x4b'));}function ifInterval(_0x533267,_0x1c254b){if(_[_0x55b0('0x3e')](_0x1c254b)){return![];}return getDiff(_0x1c254b)<_0x533267*0x3c;}function freeVariablesPredictive(_0x2624f4){if(isNotNull(_0x2624f4)){if(!_[_0x55b0('0x3e')](_0x2624f4[_0x55b0('0x28')])){_0x2624f4[_0x55b0('0x28')]=undefined;loggerPredictive[_0x55b0('0x7b')](_0x2624f4[_0x55b0('0x40')],_0x55b0('0x8c'));}if(!_[_0x55b0('0x3e')](_0x2624f4[_0x55b0('0x27')])){_0x2624f4['startPredictive']=undefined;loggerPredictive[_0x55b0('0x7b')](_0x2624f4['name'],_0x55b0('0x8d'));}if(!_[_0x55b0('0x3e')](_0x2624f4[_0x55b0('0x8e')])){clearInterval(_0x2624f4[_0x55b0('0x8e')]);_0x2624f4[_0x55b0('0x8e')]=undefined;loggerPredictive[_0x55b0('0x7b')](_0x2624f4[_0x55b0('0x40')],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x117610,_0x4ed99d){if(_0x4ed99d===0x0){return 0x0;}var _0x5037e4=0x1;for(var _0x4510b0=0x1;_0x4510b0<=_0x4ed99d;_0x4510b0+=0x1){_0x5037e4=0x1+_0x5037e4*_0x4510b0/_0x117610;}return 0x1/_0x5037e4;}function isVoiceQueueOutbound(_0x3aedc5){return _0x3aedc5===_0x55b0('0x8f');}function isNotPreview(_0x252341){return _0x252341!==_0x55b0('0x1e');}function isCampaignIvr(_0x5299c3){return _0x5299c3==='ivr';}function getCallerId(_0x3c3f3b,_0x2376e3,_0x446efd){if(!_[_0x55b0('0x3e')](_0x446efd)&&typeof _0x446efd===_0x55b0('0x90')&&!_[_0x55b0('0x48')](_0x446efd)){if(!_[_0x55b0('0x3e')](_0x2376e3)&&typeof _0x2376e3==='string'&&!_['isEmpty'](_0x2376e3)){return util[_0x55b0('0x76')]('\x22%s\x22\x20<%s>',_0x2376e3,_0x446efd);}return util['format'](_0x55b0('0x91'),_0x446efd,_0x446efd);}if(!_['isUndefined'](_0x3c3f3b)&&typeof _0x3c3f3b===_0x55b0('0x90')&&!_[_0x55b0('0x48')](_0x3c3f3b)){return _0x3c3f3b;}return _0x55b0('0x92');}function loggerCatchQueueSummary(_0x356abc,_0x277964){return function(_0x5e729c){freeVariablesPredictive(_0x277964);emitVoiceQueueSummary(_0x277964);emitCampaignSummary(_0x277964);loggerSyncQueueSummary[_0x55b0('0x93')](_0x356abc,util[_0x55b0('0x94')](_0x5e729c,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x15e284,_0x173870){return function(_0x312372){loggerPredictive[_0x55b0('0x93')](_0x173870[_0x55b0('0x40')],_0x15e284);loggerPredictive[_0x55b0('0x93')](_0x312372[_0x55b0('0x95')]);freeVariablesPredictive(_0x173870);};}function loggerCatch(_0x35b614){return function(_0x59cfd4){logger[_0x55b0('0x93')](_0x35b614,util['inspect'](_0x59cfd4,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x22a364){return _0x22a364&&!_[_0x55b0('0x3e')](_0x22a364)&&_0x22a364[_0x55b0('0x96')]>0x0;}function decremetOriginate(_0x1147bb){if(!_[_0x55b0('0x3e')](_0x1147bb)&&_0x1147bb!==null){if(typeof _0x1147bb['originated']!==_0x55b0('0x97')){if(_0x1147bb[_0x55b0('0x6f')]>0x0){_0x1147bb[_0x55b0('0x6f')]-=0x1;}else{logger[_0x55b0('0x93')](_0x55b0('0x98'));}}}else{logger[_0x55b0('0x93')](_0x55b0('0x99'));}}function checkContactLowerLimitOriginate(_0x12eca7,_0x272ac7,_0x409e2b){if(_0x272ac7>_0x409e2b){for(var _0x4290e5=0x0;_0x4290e5<_0x272ac7-_0x409e2b;_0x4290e5+=0x1){decremetOriginate(_0x12eca7);}}}function loggerGetContactDialer(_0x147163,_0x18fca3,_0x5c1f08){return function(_0x470b32){checkContactLowerLimitOriginate(_0x18fca3,_0x5c1f08,0x0);logger[_0x55b0('0x93')](_0x147163,util[_0x55b0('0x94')](_0x470b32,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x30664d){return function(_0x29e5b4){if(isNotNull(_0x29e5b4)&&isNotNull(_0x29e5b4[0x0])){if(_0x29e5b4[0x0]['contactsRescheduled']>0x0){_0x30664d[_0x55b0('0x3f')]=_0x55b0('0x9a');logger['info'](_0x55b0('0x9b')+_0x30664d[_0x55b0('0x40')],_0x29e5b4[0x0][_0x55b0('0x9c')],_0x55b0('0x9d'));}else{_0x30664d[_0x55b0('0x3f')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x55b0('0x7b')]('[getContactDialer2][Empty]'+_0x30664d[_0x55b0('0x40')]);}}};}function notSendMessagesQueue(_0x5a0eda){if(_0x5a0eda[_0x55b0('0x9e')]){freeVariablesPredictive(_0x5a0eda);if(_0x5a0eda[_0x55b0('0x6f')]===0x0&&_0x5a0eda['talking']===0x0&&_0x5a0eda[_0x55b0('0x55')]===0x0&&(_0x5a0eda['pTalking']||0x0)===0x0){_0x5a0eda['sendMessageOneNotActive']=![];_0x5a0eda[_0x55b0('0x4e')]=0x0;_0x5a0eda[_0x55b0('0x3f')]=_0x55b0('0x42');loggerSyncQueueSummary[_0x55b0('0x93')](_0x55b0('0x9f'),_0x5a0eda['name'],_0x55b0('0xa0'));}else{_0x5a0eda[_0x55b0('0x3f')]=_0x55b0('0xa1');loggerSyncQueueSummary[_0x55b0('0x93')](_0x55b0('0x9f'),_0x5a0eda[_0x55b0('0x40')],_0x55b0('0xa2'));}emitVoiceQueueSummary(_0x5a0eda);}}function notSendMessagesCampaign(_0x4cf32a){if(_0x4cf32a[_0x55b0('0x9e')]){if(_0x4cf32a[_0x55b0('0x6f')]===0x0){_0x4cf32a['sendMessageOneNotActive']=![];_0x4cf32a['message']=_0x55b0('0x42');loggerSyncQueueSummary[_0x55b0('0x93')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4cf32a['name'],_0x55b0('0xa0'));}else{_0x4cf32a['message']=_0x55b0('0xa1');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4cf32a['name'],_0x55b0('0xa2'));}emitCampaignSummary(_0x4cf32a);}}function createObjHistory(_0x30284,_0xab4c39,_0x179bc2,_0x3a45ab,_0xa63a54){_0x30284[_0x55b0('0x3f')]=_0x179bc2;var _0x372117=new Action(_0x30284,_0xab4c39);var _0x360869=new History(_0x372117);_0x360869[_0x55b0('0xa3')]=_0x3a45ab;_0x360869[_0x55b0('0xa4')]=_0xa63a54;_0x360869[_0x55b0('0xa5')]=_0x372117[_0x55b0('0xa6')];return _0x360869;}Dialer[_0x55b0('0xa7')]['loopClearZombieChannels']=function(){var _0x44b753=this;setInterval(function(){_0x44b753[_0x55b0('0xa8')](_0x44b753[_0x55b0('0x26')],_0x55b0('0xa9'));_0x44b753[_0x55b0('0xa8')](_0x44b753[_0x55b0('0x24')],_0x55b0('0xaa'));},0x32c8);};Dialer[_0x55b0('0xa7')][_0x55b0('0xa8')]=function(_0xabc07a,_0x49f7ce){var _0x4a9b35=this;for(var _0x57a708 in _0xabc07a){if(typeof _0xabc07a[_0x57a708]!=='undefined'){this[_0x55b0('0x1d')]['enqueue'](function(){if(!_['isNil'](_0xabc07a[_0x57a708])){return ami[_0x55b0('0xab')]({'action':_0x55b0('0xac'),'channel':_0xabc07a[_0x57a708][_0x55b0('0xad')]})['catch'](function(_0xca7659){if(_0xca7659[_0x55b0('0x3f')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xabc07a[_0x57a708]&&_0xabc07a[_0x57a708][_0x55b0('0x4c')]!==_0x55b0('0x79')){_0x4a9b35[_0x55b0('0xae')](_0x4a9b35[_0x55b0('0x1f')][_0xabc07a[_0x57a708][_0x55b0('0xaf')]]);logger[_0x55b0('0x93')]('[Dialer][checkChannel]',_0x49f7ce,_0x57a708,_0xabc07a[_0x57a708][_0x55b0('0xaf')]);delete _0xabc07a[_0x57a708];}if(_0xabc07a[_0x57a708]&&_0xabc07a[_0x57a708][_0x55b0('0x4c')]==='ivr'){_0x4a9b35[_0x55b0('0xae')](_0x4a9b35[_0x55b0('0x20')][_0xabc07a[_0x57a708][_0x55b0('0xaf')]]);logger['error'](_0x55b0('0xb0'),_0x49f7ce,_0x57a708,_0xabc07a[_0x57a708][_0x55b0('0xaf')]);delete _0xabc07a[_0x57a708];}},0x2328);}});}});}}};Dialer['prototype'][_0x55b0('0xb1')]=function(_0x2b1fab){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopper[_0x55b0('0xb1')](_0x2b1fab))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xb5')));};Dialer[_0x55b0('0xa7')][_0x55b0('0xb6')]=function(_0x4cbd10){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopperBlack[_0x55b0('0xb6')](_0x4cbd10))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xb7')));};Dialer[_0x55b0('0xa7')]['checkIsBlackListIvr']=function(_0x5e0f16){return BPromise['resolve']()[_0x55b0('0xb3')](cmHopperBlack[_0x55b0('0xb8')](_0x5e0f16))['catch'](loggerCatch(_0x55b0('0xb9')));};Dialer[_0x55b0('0xa7')][_0x55b0('0xba')]=function(_0x2255ea){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopperHistory[_0x55b0('0xbb')](_0x2255ea))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xbc')));};Dialer[_0x55b0('0xa7')][_0x55b0('0xbd')]=function(_0x360639){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopper[_0x55b0('0xbd')](_0x360639))['catch'](loggerCatch(_0x55b0('0xbe')));};Dialer[_0x55b0('0xa7')]['unlockContact']=function(_0x3ebb14,_0x38b449,_0x59ae73){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopper[_0x55b0('0xbf')](_0x3ebb14,_0x38b449,_0x59ae73))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xc0')));};Dialer[_0x55b0('0xa7')][_0x55b0('0xc1')]=function(_0x271c64,_0x4cc1c6,_0x29379b,_0x4b8008,_0x388e3a){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopper['getContactDialer'](_0x271c64,_0x4cc1c6,_0x29379b,_0x4b8008))[_0x55b0('0xb4')](function(_0x32984b){_0x388e3a[_0x55b0('0xc2')]-=_0x29379b;_0x388e3a[_0x55b0('0xc2')]=_0x388e3a[_0x55b0('0xc2')]>0x0?_0x388e3a[_0x55b0('0xc2')]:0x0;loggerCatch(_0x55b0('0xc3'))(_0x32984b);});};Dialer[_0x55b0('0xa7')][_0x55b0('0xc4')]=function(_0x20ac3d,_0x23263e,_0x357172,_0x4a5856){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopper[_0x55b0('0xc4')](_0x20ac3d,_0x23263e,_0x357172))[_0x55b0('0xb4')](function(_0x30a65a){_0x4a5856[_0x55b0('0xc2')]-=_0x23263e;_0x4a5856[_0x55b0('0xc2')]=_0x4a5856[_0x55b0('0xc2')]>0x0?_0x4a5856[_0x55b0('0xc2')]:0x0;loggerCatch(_0x55b0('0xc5'))(_0x30a65a);});};Dialer[_0x55b0('0xa7')][_0x55b0('0xc6')]=function(_0x19f0dc){return BPromise['resolve']()[_0x55b0('0xb3')](voiceQueueRt[_0x55b0('0xc6')](_0x19f0dc))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xc7')));};Dialer['prototype'][_0x55b0('0xc8')]=function(_0x396161){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopper[_0x55b0('0xc8')](_0x396161))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xc9')));};Dialer[_0x55b0('0xa7')]['createHistory']=function(_0x5ff5c1){return BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](cmHopperHistory[_0x55b0('0xca')](_0x5ff5c1))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xcb')));};Dialer[_0x55b0('0xa7')][_0x55b0('0xae')]=function(_0x4f9cf9){if(!_['isUndefined'](_0x4f9cf9)&&_0x4f9cf9!==null){if(typeof _0x4f9cf9[_0x55b0('0x6f')]!==_0x55b0('0x97')){if(_0x4f9cf9[_0x55b0('0x6f')]>0x0){_0x4f9cf9['originated']-=0x1;}else{logger[_0x55b0('0x93')](_0x55b0('0xcc'));}}}else{logger[_0x55b0('0x93')](_0x55b0('0xcd'));}};Dialer['prototype'][_0x55b0('0xce')]=function(_0x7d812e,_0xa132fd){var _0x47da72=this;return function(_0x5a425d){_0x47da72[_0x55b0('0xae')](_0xa132fd);logger[_0x55b0('0x93')](_0x7d812e,util[_0x55b0('0x94')](_0x5a425d,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x55b0('0xcf')]=function(_0x16100f,_0x5b5b67,_0x5c692d){var _0x54a812={'state':0x19,'statedesc':_0x55b0('0xd0')};this[_0x55b0('0xae')](_0x5b5b67);this[_0x55b0('0xd1')](_[_0x55b0('0x8a')](_0x54a812,_['pick'](_0x5c692d,[_0x55b0('0xd2'),_0x55b0('0xd3'),'UserId',_0x55b0('0xd4'),_0x55b0('0xd5')])),_0x55b0('0xd6'),'[emptyContact]');logger[_0x55b0('0x93')](_0x16100f);};Dialer[_0x55b0('0xa7')][_0x55b0('0xd7')]=function(_0x1f336b){return _0x1f336b===_0x55b0('0xd8');};Dialer[_0x55b0('0xa7')][_0x55b0('0xd9')]=function(_0x2db8e2){return!_[_0x55b0('0x3e')](_0x2db8e2)&&_0x2db8e2&&!_[_0x55b0('0x3e')](_0x2db8e2['name'])&&!_[_0x55b0('0x3e')](_0x2db8e2[_0x55b0('0x75')])&&_0x2db8e2[_0x55b0('0x75')]&&(this[_0x55b0('0x21')][util[_0x55b0('0x76')](_0x55b0('0xda'),_0x2db8e2[_0x55b0('0x40')])]['status']==='reachable'||this['trunks'][util['format'](_0x55b0('0xda'),_0x2db8e2[_0x55b0('0x40')])][_0x55b0('0xac')]===_0x55b0('0xdb'));};Dialer[_0x55b0('0xa7')][_0x55b0('0xd1')]=function(_0x4bd9c0,_0x2c6c18,_0x162def){this[_0x55b0('0xca')](_0x4bd9c0)['catch'](loggerCatch(_0x2c6c18));this[_0x55b0('0xc8')](_0x4bd9c0)[_0x55b0('0xb4')](loggerCatch(_0x162def));};Dialer[_0x55b0('0xa7')]['syncVarSet']=function(_0x15ed9e){var _0x3c4695=this[_0x55b0('0x26')][_0x15ed9e[_0x55b0('0xdc')]];var _0x493b9f;if(!_[_0x55b0('0xdd')](_0x15ed9e)&&!_['isNil'](_0x15ed9e[_0x55b0('0xde')])&&!_[_0x55b0('0xdd')](_0x15ed9e[_0x55b0('0xde')][_0x55b0('0xdf')])&&_0x15ed9e[_0x55b0('0xe0')]===_0x55b0('0xe1')&&_0x3c4695){if(_0x3c4695[_0x55b0('0x4c')]!==_0x55b0('0x79')&&this[_0x55b0('0x1f')][_0x3c4695[_0x55b0('0xaf')]][_0x55b0('0xe2')]&&_0x15ed9e[_0x55b0('0xe3')]===_0x55b0('0xe4')){delete this[_0x55b0('0x26')][_0x15ed9e['uniqueid']];this[_0x55b0('0xae')](this[_0x55b0('0x1f')][_0x3c4695[_0x55b0('0xaf')]]);this['voiceQueues'][_0x3c4695['queue']][_0x55b0('0x5c')]+=0x1;this[_0x55b0('0x1f')][_0x3c4695[_0x55b0('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x493b9f=new Hangup(_0x3c4695,_0x15ed9e);_0x493b9f[_0x55b0('0xa3')]=0x12;_0x493b9f[_0x55b0('0xa4')]='HangupInAMD';_0x493b9f[_0x55b0('0xe5')]=_0x55b0('0xe6');ami['emit'](_0x55b0('0xe7'),ut[_0x55b0('0xe8')](_0x493b9f,'amd'));this[_0x55b0('0xd1')](_0x493b9f,_0x55b0('0xe9'),_0x55b0('0xea'));}if(_0x3c4695[_0x55b0('0x4c')]!==_0x55b0('0x79')&&this['voiceQueues'][_0x3c4695[_0x55b0('0xaf')]]['dialAMDActive']&&_0x15ed9e[_0x55b0('0xe3')]===_0x55b0('0xeb')){var _0x1a2407=this;return new BPromise(function(_0x269c93,_0x206af8){delete _0x1a2407['uniqueId'][_0x15ed9e[_0x55b0('0xdc')]];_0x1a2407[_0x55b0('0xae')](_0x1a2407[_0x55b0('0x1f')][_0x3c4695[_0x55b0('0xaf')]]);_0x1a2407['voiceQueues'][_0x3c4695[_0x55b0('0xaf')]][_0x55b0('0x5c')]+=0x1;_0x1a2407[_0x55b0('0x1f')][_0x3c4695[_0x55b0('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x34c35d=_0x1a2407['voiceQueues'][_0x3c4695[_0x55b0('0xaf')]];var _0x3ea112=new Hangup(_0x3c4695,_0x15ed9e);_0x3ea112['state']=0x13;_0x3ea112[_0x55b0('0xa4')]='Machine';_0x3ea112[_0x55b0('0xe5')]=_0x55b0('0xe6');_0x3ea112[_0x55b0('0xec')]+=0x1;_0x3ea112[_0x55b0('0xed')]+=0x1;_0x3ea112[_0x55b0('0xee')]=!![];ami[_0x55b0('0xef')](_0x55b0('0xe7'),ut[_0x55b0('0xe8')](_0x3ea112,'amd'));_0x1a2407[_0x55b0('0xca')](_0x3ea112)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x3ea112[_0x55b0('0xf0')]+_0x3ea112[_0x55b0('0xf1')]+_0x3ea112[_0x55b0('0xf2')]+_0x3ea112[_0x55b0('0xf3')]+_0x3ea112[_0x55b0('0xf4')]+_0x3ea112[_0x55b0('0xf5')]+_0x3ea112[_0x55b0('0xec')]+_0x3ea112[_0x55b0('0xf6')]>=_0x34c35d[_0x55b0('0xf7')]){_0x1a2407[_0x55b0('0xf8')](_0x3ea112,_0x269c93,_0x206af8,_0x55b0('0xf9'));}else{if(_0x3ea112['countmachineretry']>=_0x34c35d[_0x55b0('0xfa')]){_0x1a2407[_0x55b0('0xfb')](_0x3ea112,_0x269c93,_0x206af8,_0x55b0('0xfc'));}else{_0x1a2407[_0x55b0('0xbd')]({'active':![],'countmachineretry':_0x3ea112['countmachineretry'],'scheduledat':moment()[_0x55b0('0xfd')](_0x34c35d['dialMachineRetryFrequency'],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x3ea112[_0x55b0('0xd2')],'ListId':_0x3ea112[_0x55b0('0xd3')],'VoiceQueueId':_0x3ea112['VoiceQueueId']||undefined,'CampaignId':_0x3ea112['CampaignId']||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x100')));_0x269c93({'reschedule':0x1});}}});}if(_0x3c4695[_0x55b0('0x4c')]===_0x55b0('0x79')&&this[_0x55b0('0x20')][_0x3c4695[_0x55b0('0xaf')]][_0x55b0('0xe2')]&&_0x15ed9e['value']===_0x55b0('0xe4')){delete this['uniqueId'][_0x15ed9e[_0x55b0('0xdc')]];this[_0x55b0('0xae')](this[_0x55b0('0x20')][_0x3c4695[_0x55b0('0xaf')]]);_0x493b9f=new Hangup(_0x3c4695,_0x15ed9e);_0x493b9f[_0x55b0('0xa3')]=0x12;_0x493b9f[_0x55b0('0xa4')]=_0x55b0('0x101');_0x493b9f['membername']=_0x55b0('0xe6');ami[_0x55b0('0xef')](_0x55b0('0xe7'),ut[_0x55b0('0xe8')](_0x493b9f,'amd'));this[_0x55b0('0xd1')](_0x493b9f,_0x55b0('0x102'),'[syncHangupInAMDIvr]');}if(_0x3c4695[_0x55b0('0x4c')]==='ivr'&&this[_0x55b0('0x20')][_0x3c4695[_0x55b0('0xaf')]][_0x55b0('0xe2')]&&_0x15ed9e['value']===_0x55b0('0xeb')){var _0x1a2407=this;return new BPromise(function(_0x2f856e,_0x18ef0a){delete _0x1a2407[_0x55b0('0x26')][_0x15ed9e[_0x55b0('0xdc')]];_0x1a2407['updateOriginated'](_0x1a2407[_0x55b0('0x20')][_0x3c4695[_0x55b0('0xaf')]]);_0x1a2407[_0x55b0('0x20')][_0x3c4695[_0x55b0('0xaf')]]['outboundAnswerCallsDay']+=0x1;_0x1a2407['campaigns'][_0x3c4695[_0x55b0('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x23b226=_0x1a2407['campaigns'][_0x3c4695[_0x55b0('0xaf')]];var _0x597e31=new Hangup(_0x3c4695,_0x15ed9e);_0x597e31[_0x55b0('0xa3')]=0x13;_0x597e31[_0x55b0('0xa4')]=_0x55b0('0x103');_0x597e31['membername']=_0x55b0('0xe6');_0x597e31['countmachineretry']+=0x1;_0x597e31['countglobal']+=0x1;_0x597e31[_0x55b0('0xee')]=!![];ami[_0x55b0('0xef')]('custom:amd',ut['buildObj'](_0x597e31,_0x55b0('0xee')));_0x1a2407['createHistory'](_0x597e31)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x104')));if(_0x597e31['countbusyretry']+_0x597e31[_0x55b0('0xf1')]+_0x597e31[_0x55b0('0xf2')]+_0x597e31[_0x55b0('0xf3')]+_0x597e31[_0x55b0('0xf4')]+_0x597e31[_0x55b0('0xf5')]+_0x597e31[_0x55b0('0xec')]+_0x597e31[_0x55b0('0xf6')]>=_0x23b226[_0x55b0('0xf7')]){_0x1a2407['stateGlobal'](_0x597e31,_0x2f856e,_0x18ef0a,_0x55b0('0xf9'));}else{if(_0x597e31[_0x55b0('0xec')]>=_0x23b226[_0x55b0('0xfa')]){_0x1a2407[_0x55b0('0xfb')](_0x597e31,_0x2f856e,_0x18ef0a,_0x55b0('0xfc'));}else{_0x1a2407[_0x55b0('0xbd')]({'active':![],'countmachineretry':_0x597e31['countmachineretry'],'scheduledat':moment()[_0x55b0('0xfd')](_0x23b226[_0x55b0('0x105')],_0x55b0('0xfe'))[_0x55b0('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x597e31[_0x55b0('0xd2')],'ListId':_0x597e31[_0x55b0('0xd3')],'VoiceQueueId':_0x597e31['VoiceQueueId']||undefined,'CampaignId':_0x597e31['CampaignId']||undefined})['catch'](loggerCatch(_0x55b0('0x100')));_0x2f856e({'reschedule':0x1});}}});}}};Dialer[_0x55b0('0xa7')][_0x55b0('0x34')]=function(_0x58eb01){var _0x289983=this[_0x55b0('0x26')][_0x58eb01[_0x55b0('0xdc')]];var _0x33c8d8=this;var _0x52ad80;if(_0x289983&&_0x289983[_0x55b0('0x4c')]===_0x55b0('0x79')){delete this[_0x55b0('0x26')][_0x58eb01[_0x55b0('0xdc')]];this[_0x55b0('0xae')](this['campaigns'][_0x289983[_0x55b0('0xaf')]]);this[_0x55b0('0x20')][_0x289983[_0x55b0('0xaf')]][_0x55b0('0x106')]+=0x1;_0x52ad80=new Hangup(_0x289983,_0x58eb01);this[_0x55b0('0xca')](_0x52ad80)[_0x55b0('0xb4')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x55b0('0xc8')](_0x52ad80)['catch'](loggerCatch(_0x55b0('0x107')));}if(_0x289983&&_0x289983[_0x55b0('0x4c')]!==_0x55b0('0x79')&&isNotNull(this['voiceQueues'][_0x289983[_0x55b0('0xaf')]][_0x55b0('0x108')])){delete this[_0x55b0('0x26')][_0x58eb01[_0x55b0('0xdc')]];this['updateOriginated'](this[_0x55b0('0x1f')][_0x289983[_0x55b0('0xaf')]]);this[_0x55b0('0x1f')][_0x289983[_0x55b0('0xaf')]]['outboundAnswerCallsDay']+=0x1;this[_0x55b0('0x1f')][_0x289983[_0x55b0('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;_0x52ad80=new Hangup(_0x289983,_0x58eb01);_0x52ad80[_0x55b0('0xa3')]=0x10;_0x52ad80[_0x55b0('0xa4')]=_0x55b0('0x109');_0x52ad80[_0x55b0('0xe5')]=_0x55b0('0x10a');this[_0x55b0('0xca')](_0x52ad80)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x10b')));this[_0x55b0('0xc8')](_0x52ad80)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x107')));}if(_0x289983&&_0x289983['type']!==_0x55b0('0x79')&&!isNotNull(this[_0x55b0('0x1f')][_0x289983[_0x55b0('0xaf')]][_0x55b0('0x108')])){delete this[_0x55b0('0x26')][_0x58eb01[_0x55b0('0xdc')]];this[_0x55b0('0xae')](this[_0x55b0('0x1f')][_0x289983[_0x55b0('0xaf')]]);this[_0x55b0('0x1f')][_0x289983[_0x55b0('0xaf')]]['outboundUnknownCallsDay']+=0x1;_0x52ad80=new Hangup(_0x289983,_0x58eb01);_0x52ad80['state']=0xc;_0x52ad80['statedesc']=_0x58eb01[_0x55b0('0x10c')];_0x52ad80[_0x55b0('0xe5')]='Unknow';this[_0x55b0('0xca')](_0x52ad80)[_0x55b0('0xb4')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x55b0('0xc8')](_0x52ad80)['catch'](loggerCatch(_0x55b0('0x107')));}};Dialer['prototype']['syncAgentComplete']=function(_0x2c27f5){var _0x2c52df=this[_0x55b0('0x26')][_0x2c27f5[_0x55b0('0xdc')]];var _0x537921=this;if(this[_0x55b0('0x1f')][_0x2c27f5['queue']]){if(_0x2c52df&&_0x2c52df[_0x55b0('0x4c')]!==_0x55b0('0x79')){delete this[_0x55b0('0x26')][_0x2c27f5[_0x55b0('0xdc')]];this['voiceQueues'][_0x2c27f5[_0x55b0('0xaf')]][_0x55b0('0x5c')]+=0x1;var _0x2263df=new AgentComplete(_0x2c52df,_0x2c27f5);if(_0x2c27f5['reason']===_0x55b0('0x10d')){_0x2263df['agiafterat']=this['voiceQueues'][_0x2c27f5[_0x55b0('0xaf')]][_0x55b0('0x10e')]&&this[_0x55b0('0x1f')][_0x2c27f5[_0x55b0('0xaf')]][_0x55b0('0x10f')]?moment()[_0x55b0('0x76')](_0x55b0('0xff')):undefined;}this[_0x55b0('0xca')](_0x2263df)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this['moveContactManagedDialer'](_0x2263df)[_0x55b0('0xb4')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x55b0('0xa7')]['syncAgentConnect']=function(_0x24f246){if(this['voiceQueues'][_0x24f246[_0x55b0('0xaf')]]){if(this[_0x55b0('0x26')][_0x24f246[_0x55b0('0xdc')]]&&this['uniqueId'][_0x24f246[_0x55b0('0xdc')]][_0x55b0('0x4c')]!==_0x55b0('0x79')){this[_0x55b0('0xae')](this[_0x55b0('0x1f')][_0x24f246[_0x55b0('0xaf')]]);this[_0x55b0('0x26')][_0x24f246[_0x55b0('0xdc')]][_0x55b0('0x110')]=moment()[_0x55b0('0x76')](_0x55b0('0xff'));}}};Dialer[_0x55b0('0xa7')][_0x55b0('0x111')]=function(_0x30bb3a){this[_0x55b0('0xca')](_0x30bb3a)['catch'](loggerCatch(_0x55b0('0x112')));this[_0x55b0('0xc8')](_0x30bb3a)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x113')));};Dialer['prototype']['syncQueueCallerAbandon']=function(_0x5e0e24){var _0x482181=this[_0x55b0('0x26')][_0x5e0e24[_0x55b0('0xdc')]];var _0x56c028=this;if(this['voiceQueues'][_0x5e0e24[_0x55b0('0xaf')]]){if(_0x482181&&_0x482181[_0x55b0('0x4c')]!==_0x55b0('0x79')){delete this[_0x55b0('0x26')][_0x5e0e24['uniqueid']];this[_0x55b0('0xae')](this[_0x55b0('0x1f')][_0x5e0e24[_0x55b0('0xaf')]]);_0x482181[_0x55b0('0x114')]=moment()[_0x55b0('0x76')](_0x55b0('0xff'));var _0x2b43a8=new QueueCallerAbandon(_0x482181,_0x5e0e24);if(getSeconds(_0x482181[_0x55b0('0x114')],_0x482181[_0x55b0('0x115')])>=_0x482181['dialQueueTimeout']){this['voiceQueues'][_0x5e0e24[_0x55b0('0xaf')]][_0x55b0('0x68')]+=0x1;this[_0x55b0('0x1f')][_0x5e0e24[_0x55b0('0xaf')]][_0x55b0('0x5f')]+=0x1;this[_0x55b0('0x1f')][_0x5e0e24['queue']][_0x55b0('0x6a')]+=0x1;_0x2b43a8[_0x55b0('0xa3')]=0xa;_0x2b43a8[_0x55b0('0xa4')]=_0x55b0('0x116');_0x2b43a8['dropreason']=_0x55b0('0x117');_0x2b43a8[_0x55b0('0x118')]=this['voiceQueues'][_0x5e0e24[_0x55b0('0xaf')]][_0x55b0('0x10e')]?moment()[_0x55b0('0x76')](_0x55b0('0xff')):undefined;_0x2b43a8['countdropretry']+=0x1;_0x2b43a8['countglobal']+=0x1;if(_0x2b43a8[_0x55b0('0xf4')]>=this['voiceQueues'][_0x5e0e24['queue']][_0x55b0('0x119')]){this[_0x55b0('0x111')](_0x2b43a8);}else{this[_0x55b0('0xbd')]({'active':![],'countdropretry':_0x2b43a8[_0x55b0('0xf4')],'scheduledat':moment()[_0x55b0('0xfd')](this[_0x55b0('0x1f')][_0x5e0e24[_0x55b0('0xaf')]][_0x55b0('0x11a')],'minutes')[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x482181['ContactId'],'ListId':_0x482181['ListId'],'VoiceQueueId':_0x482181[_0x55b0('0xd4')]||undefined,'CampaignId':_0x482181[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x11b')));var _0x746bcb=new History(_0x2b43a8);_0x746bcb[_0x55b0('0xa3')]=0xa;_0x746bcb[_0x55b0('0xa4')]=_0x55b0('0x116');_0x746bcb[_0x55b0('0xa6')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x746bcb[_0x55b0('0xa5')]=_0x746bcb[_0x55b0('0xa6')];_0x746bcb['calleridname']=_0x2b43a8[_0x55b0('0x11c')];_0x746bcb[_0x55b0('0x11d')]=_0x2b43a8[_0x55b0('0x11d')];this[_0x55b0('0xca')](_0x746bcb)['catch'](loggerCatch(_0x55b0('0x11e')));}}else{this['voiceQueues'][_0x5e0e24[_0x55b0('0xaf')]][_0x55b0('0x80')]+=0x1;this[_0x55b0('0x1f')][_0x5e0e24['queue']][_0x55b0('0x11f')]+=0x1;_0x2b43a8[_0x55b0('0xa3')]=0xb;_0x2b43a8[_0x55b0('0xa4')]='Abandoned';_0x2b43a8[_0x55b0('0x120')]='CALLEREXIT';_0x2b43a8['countabandonedretry']+=0x1;_0x2b43a8[_0x55b0('0xed')]+=0x1;if(_0x2b43a8[_0x55b0('0xf5')]>=this[_0x55b0('0x1f')][_0x5e0e24['queue']][_0x55b0('0x121')]){this[_0x55b0('0x111')](_0x2b43a8);}else{this[_0x55b0('0xbd')]({'active':![],'countabandonedretry':_0x2b43a8['countabandonedretry'],'scheduledat':moment()[_0x55b0('0xfd')](this['voiceQueues'][_0x5e0e24[_0x55b0('0xaf')]][_0x55b0('0x122')],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x482181['ContactId'],'ListId':_0x482181[_0x55b0('0xd3')],'VoiceQueueId':_0x482181[_0x55b0('0xd4')]||undefined,'CampaignId':_0x482181[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x123')));var _0x746bcb=new History(_0x2b43a8);_0x746bcb['state']=0xb;_0x746bcb[_0x55b0('0xa4')]=_0x55b0('0x124');_0x746bcb[_0x55b0('0xa6')]=moment()[_0x55b0('0x76')](_0x55b0('0xff'));_0x746bcb[_0x55b0('0xa5')]=_0x746bcb[_0x55b0('0xa6')];_0x746bcb[_0x55b0('0x11c')]=_0x2b43a8[_0x55b0('0x11c')];_0x746bcb[_0x55b0('0x11d')]=_0x2b43a8[_0x55b0('0x11d')];this['createHistory'](_0x746bcb)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x125')));}}}}};Dialer[_0x55b0('0xa7')][_0x55b0('0x126')]=function(_0x110418){if(this[_0x55b0('0x24')][_0x110418[_0x55b0('0xdc')]]){this[_0x55b0('0x24')][_0x110418[_0x55b0('0xdc')]][_0x55b0('0xad')]=_0x110418[_0x55b0('0xad')];}if(this[_0x55b0('0x26')][_0x110418[_0x55b0('0xdc')]]){this[_0x55b0('0x26')][_0x110418[_0x55b0('0xdc')]][_0x55b0('0xad')]=_0x110418[_0x55b0('0xad')];}};Dialer[_0x55b0('0xa7')][_0x55b0('0x39')]=function(_0x1a3985){if(strategy[this[_0x55b0('0x1f')][this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]][_0x55b0('0xaf')]]['strategy']]===_0x55b0('0x128')){if(this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]]&&_[_0x55b0('0xdd')](this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]]['locked'])&&_0x1a3985[_0x55b0('0xac')]==='1'&&_0x1a3985[_0x55b0('0x129')]==='0'){if(this[_0x55b0('0x12a')][_0x1a3985['stateinterface']]){if(!this[_0x55b0('0x12a')][_0x1a3985[_0x55b0('0x12b')]][_0x55b0('0x12c')]){this[_0x55b0('0x12a')][_0x1a3985[_0x55b0('0x12b')]]['locked']=!![];this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]][_0x55b0('0x12c')]=!![];this['actions'][_0x1a3985[_0x55b0('0x127')]][_0x55b0('0x12b')]=_0x1a3985['stateinterface'];}}}}else if((strategy[this[_0x55b0('0x1f')][this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]][_0x55b0('0xaf')]][_0x55b0('0x4d')]]||_0x55b0('0x12d'))==='rrmemory'){if(this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]]){if(this[_0x55b0('0x12a')][_0x1a3985[_0x55b0('0x12b')]]){this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]]['stateinterface']=_0x1a3985[_0x55b0('0x12b')];if(_[_0x55b0('0xdd')](this[_0x55b0('0x2a')][this['actions'][_0x1a3985['actionid']][_0x55b0('0xaf')]])){this['queueBooked'][this[_0x55b0('0x24')][_0x1a3985[_0x55b0('0x127')]][_0x55b0('0xaf')]]=[];}this[_0x55b0('0x2a')][this[_0x55b0('0x24')][_0x1a3985['actionid']][_0x55b0('0xaf')]][_0x55b0('0x12e')](_['merge'](_[_0x55b0('0x12f')](this[_0x55b0('0x24')][_0x1a3985['actionid']],[_0x55b0('0x130'),_0x55b0('0x12b')]),{'status':_0x1a3985[_0x55b0('0xac')],'paused':_0x1a3985['paused']}));}}}};function unlockQueueStatus(_0x43d381,_0x1becf7){setTimeout(function(){if(_[_0x55b0('0x3e')](_0x43d381[_0x55b0('0x131')])){loggerBooked[_0x55b0('0x93')](_0x55b0('0x132'),_0x1becf7);}_0x43d381[_0x55b0('0x131')]=!![];loggerBooked[_0x55b0('0x7b')]('[booked][unlockQueueStatus]',_0x1becf7,JSON['stringify'](_[_0x55b0('0x12f')](_0x43d381,[_0x55b0('0x40'),_0x55b0('0x131')])));},0x1f3);}Dialer[_0x55b0('0xa7')]['syncQueueStatusComplete']=function(_0x457980){var _0x18ad06=this;var _0x25b797=_0x18ad06[_0x55b0('0x1f')][_0x18ad06[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]]['queue']];if(strategy[this[_0x55b0('0x1f')][this['actions'][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]]['strategy']]===_0x55b0('0x128')){if(this['actions'][_0x457980['actionid']]&&this[_0x55b0('0x24')][_0x457980['actionid']]['stateinterface']){this[_0x55b0('0x1e')]['run'](this[_0x55b0('0x24')][_0x457980['actionid']][_0x55b0('0x130')],this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0x12b')])['catch'](function(_0x5deffd){logger[_0x55b0('0x93')](_0x55b0('0x133'),util[_0x55b0('0x94')](_0x5deffd,{'showHidden':![],'depth':null}));})[_0x55b0('0x1c')](function(){_0x18ad06[_0x55b0('0xae')](_0x18ad06[_0x55b0('0x1f')][_0x18ad06[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]]);_0x18ad06['agents'][_0x18ad06[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0x12b')]][_0x55b0('0x12c')]=![];delete _0x18ad06[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]];unlockQueueStatus(_0x25b797);});}else{this['updateOriginated'](this[_0x55b0('0x1f')][this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]]['queue']]);this['rescheduleContact']({'active':![],'ContactId':this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xd2')],'ListId':this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xd3')],'VoiceQueueId':this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xd4')]||undefined,'CampaignId':this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]];unlockQueueStatus(_0x25b797);}}else if((strategy[this['voiceQueues'][this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]]['strategy']]||'rrmemory')===_0x55b0('0x12d')){var _0x549054;if(this[_0x55b0('0x24')][_0x457980['actionid']]&&!_['isEmpty'](this[_0x55b0('0x2a')][this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]])){if(this[_0x55b0('0x134')][_0x18ad06[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]]['queue']]){this[_0x55b0('0x134')][_0x18ad06['actions'][_0x457980['actionid']]['queue']]=this[_0x55b0('0x134')][this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]]?this['queueBookedRR'][this[_0x55b0('0x24')][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]]:this['queueBooked'][this['actions'][_0x457980[_0x55b0('0x127')]]['queue']]?this[_0x55b0('0x2a')][this[_0x55b0('0x24')][_0x457980['actionid']][_0x55b0('0xaf')]]['_rr']||0x0:0x0;}this['queueBooked'][this['actions'][_0x457980[_0x55b0('0x127')]][_0x55b0('0xaf')]]['_rr']=this['queueBookedRR'][this['actions'][_0x457980['actionid']][_0x55b0('0xaf')]];for(var _0x46ce36=0x0;_0x46ce36=0x0;})[_0x55b0('0xb4')](myreject(_0x131dc0)));}}else{_0x320070[_0x55b0('0x12e')](ami['Action']({'action':'command','command':util[_0x55b0('0x76')]('iftime\x20%s,%s',_0x1870db,!_[_0x55b0('0x3e')](config[_0x55b0('0x149')][_0xed3737])?_0xed3737:'')})[_0x55b0('0xb3')](function(_0x21caa8){return _0x21caa8[_0x55b0('0x14e')]['indexOf'](_0x55b0('0x14f'))>=0x0;})[_0x55b0('0xb4')](myreject(_0x131dc0)));}BPromise[_0x55b0('0x150')](_0x320070)[_0x55b0('0xb3')](function(_0x3dd542){var _0x47c40a=_[_0x55b0('0x151')](_0x3dd542);if(_0x47c40a){return _0x3c1461(_0x47c40a);}else{_0x14f8f9[_0x55b0('0x3f')]=_0x1eca66?_0x55b0('0x152'):_0x55b0('0x153');return _0x131dc0(msgResponse(_0x55b0('0x154'),_0x55b0('0x147'),_0x55b0('0x155')+_0x1eca66+'\x20'+_0x25ea81+_0x55b0('0x156')+util[_0x55b0('0x94')](_0x1870db,{'showHidden':![],'depth':null})+_0x55b0('0x157')+_0xed3737));}})[_0x55b0('0xb4')](function(_0x49f730){return _0x131dc0(msgResponse('ifTime',_0x55b0('0x147'),JSON[_0x55b0('0x137')](_0x49f730)));});});};Dialer[_0x55b0('0xa7')][_0x55b0('0x158')]=function(_0x277c25){var _0x358f29=this;return function(){switch(_0x277c25[_0x55b0('0x58')]){case _0x55b0('0x159'):freeVariablesPredictive(_0x277c25);_0x358f29[_0x55b0('0x15a')](_0x277c25,0x1);break;case'power':freeVariablesPredictive(_0x277c25);_0x358f29['handlePower'](_0x277c25,_0x277c25[_0x55b0('0x15b')]);break;case _0x55b0('0xa'):_0x358f29['predictive'](_0x277c25);break;case'booked':freeVariablesPredictive(_0x277c25);_0x358f29[_0x55b0('0x15a')](_0x277c25,0x1);break;default:freeVariablesPredictive(_0x277c25);logger[_0x55b0('0x93')](_0x55b0('0x15c'),_0x277c25[_0x55b0('0x40')],'method\x20not\x20recognized');}};};Dialer[_0x55b0('0xa7')]['launchHandleIvr']=function(_0xa45b83){var _0x2c526f=this;return function(){_0x2c526f[_0x55b0('0x15d')](_0xa45b83);};};Dialer[_0x55b0('0xa7')][_0x55b0('0x15e')]=function(_0x41a2ff){var _0x4de2c8=this;if(isNotPreview(_0x41a2ff[_0x55b0('0x58')])){if(isVoiceQueueOutbound(_0x41a2ff[_0x55b0('0x4c')])&&isActive(_0x41a2ff[_0x55b0('0x57')])){_0x41a2ff[_0x55b0('0x9e')]=!![];BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](checkIsLoggedIn(_0x41a2ff,_0x41a2ff[_0x55b0('0x4f')]))[_0x55b0('0xb3')](checkIsActive(_0x41a2ff,_0x41a2ff['dialActive']))[_0x55b0('0xb3')](checkInterval(_0x41a2ff))[_0x55b0('0xb3')](_0x4de2c8[_0x55b0('0x15f')](_0x41a2ff))['then'](_0x4de2c8['checkIfTime'](_0x41a2ff[_0x55b0('0x160')],_0x41a2ff['dialTimezone'],_0x41a2ff[_0x55b0('0x40')],_0x41a2ff))[_0x55b0('0xb3')](_0x4de2c8['checkIfTimeIntervals'](_0x41a2ff['Interval'],_0x41a2ff[_0x55b0('0x161')],_0x41a2ff[_0x55b0('0x40')],_0x41a2ff))['then'](_0x4de2c8[_0x55b0('0x158')](_0x41a2ff))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x41a2ff));}else{notSendMessagesQueue(_0x41a2ff);}}else{freeVariablesPredictive(_0x41a2ff);}};Dialer['prototype'][_0x55b0('0x141')]=function(){var _0x783891=this;var _0x21a96d;for(var _0x158554 in this[_0x55b0('0x20')]){if(typeof this[_0x55b0('0x20')][_0x158554]!==_0x55b0('0x97')){_0x21a96d=this[_0x55b0('0x20')][_0x158554];if(isCampaignIvr(_0x21a96d[_0x55b0('0x4c')])&&isActive(_0x21a96d[_0x55b0('0x75')])){_0x21a96d[_0x55b0('0x9e')]=!![];BPromise[_0x55b0('0xb2')]()[_0x55b0('0xb3')](checkIsActive(_0x21a96d,_0x21a96d[_0x55b0('0x75')]))[_0x55b0('0xb3')](checkInterval(_0x21a96d))[_0x55b0('0xb3')](_0x783891[_0x55b0('0x15f')](_0x21a96d))[_0x55b0('0xb3')](_0x783891[_0x55b0('0x144')](_0x21a96d[_0x55b0('0x160')],_0x21a96d[_0x55b0('0x161')],_0x21a96d[_0x55b0('0x40')],_0x21a96d))[_0x55b0('0xb3')](_0x783891[_0x55b0('0x146')](_0x21a96d[_0x55b0('0x44')],_0x21a96d[_0x55b0('0x161')],_0x21a96d['name'],_0x21a96d))[_0x55b0('0xb3')](_0x783891[_0x55b0('0x162')](_0x21a96d))[_0x55b0('0xb4')](loggerCatchQueueSummary(_0x55b0('0x163'),_0x21a96d));}else{notSendMessagesCampaign(_0x21a96d);}}}};function getCallerIdRandom(_0x265a3a,_0x5275a6){var _0x4ed93d;var _0x1452ae;var _0x2c0dc0;if(_0x5275a6<=0x0){_0x5275a6=0x1;}_0x4ed93d=new RegExp('\x5cw{0,'+_0x5275a6+'}$');_0x1452ae=Math[_0x55b0('0x164')](0xa,_0x5275a6-0x1);_0x2c0dc0=Math[_0x55b0('0x164')](0xa,_0x5275a6)-0x1;return util[_0x55b0('0x76')]('%s',_[_0x55b0('0x165')](_0x265a3a,_0x4ed93d,_[_0x55b0('0x166')](_0x1452ae,_0x2c0dc0)));}function extractCalleridName(_0x208c58){var _0x2bb4f0=_0x208c58[_0x55b0('0x167')](/"(.*?)"/);return _0x2bb4f0?_0x2bb4f0[0x1]:_0x208c58;}function extractCalleridNumber(_0x4fd5d9){var _0x448192=_0x4fd5d9['match'](/<(.*?)>/);return _0x448192?_0x448192[0x1]:_0x4fd5d9;}Dialer[_0x55b0('0xa7')][_0x55b0('0x168')]=function(_0x16579b,_0x62809c){var _0x445cf0=this;var _0x53e88d=uuid['v4']();this[_0x55b0('0x24')][_0x53e88d]=new Action(_0x16579b,_0x62809c,_0x53e88d);return new BPromise(function(_0x1b651a,_0x52adc9){if(_[_0x55b0('0x3e')](_0x16579b)&&typeof _0x16579b!=='object'){return _0x52adc9(msgResponse(_0x55b0('0x169'),_0x55b0('0x147'),_0x55b0('0x16a')));}if(_[_0x55b0('0x3e')](_0x62809c[_0x55b0('0x16b')][_0x55b0('0x16c')])||_0x62809c[_0x55b0('0x16b')][_0x55b0('0x16c')]===null){return _0x52adc9(msgResponse(_0x55b0('0x169'),_0x55b0('0x147'),'contact\x20is\x20undefine'));}var _0x45b31f={'XMD-CALLERID':_0x445cf0[_0x55b0('0x24')][_0x53e88d][_0x55b0('0x16d')](),'XMD-AGI':_0x16579b['dialQueueProject']?util[_0x55b0('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x16579b['dialQueueProject']):'NONE','XMD-AGIAFTER':_0x16579b[_0x55b0('0x10e')]?util[_0x55b0('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x16579b['dialQueueProject2']):'NONE','XMD-QUEUE':_0x16579b[_0x55b0('0x4c')]===_0x55b0('0x8f')?util[_0x55b0('0x76')]('\x22%s,%s%s,,,%s\x22',_0x16579b[_0x55b0('0x40')],_0x16579b['dialQueueOptions']||'',_0x16579b[_0x55b0('0x10f')]?'c':'',_0x16579b[_0x55b0('0x16e')]||0x3):_0x55b0('0x16f'),'XMD-CONTACTID':_0x62809c[_0x55b0('0xd2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x445cf0[_0x55b0('0x24')][_0x53e88d][_0x55b0('0x16d')](),'XMD-AMD':_0x16579b[_0x55b0('0xe2')]?'ACTIVE':'NONE','XMD-DESTINATION':_0x55b0('0xe1')};if(_0x16579b[_0x55b0('0xe2')]){_0x45b31f[_0x55b0('0x170')]=_0x16579b[_0x55b0('0x171')]||0x9c4;_0x45b31f[_0x55b0('0x172')]=_0x16579b['dialAMDGreeting']||0x5dc;_0x45b31f[_0x55b0('0x173')]=_0x16579b[_0x55b0('0x174')]||0x320;_0x45b31f[_0x55b0('0x175')]=_0x16579b[_0x55b0('0x176')]||0x1388;_0x45b31f['XMD-AMDMINWORDLENGTH']=_0x16579b[_0x55b0('0x177')]||0x64;_0x45b31f[_0x55b0('0x178')]=_0x16579b[_0x55b0('0x179')]||0x32;_0x45b31f[_0x55b0('0x17a')]=_0x16579b[_0x55b0('0x17b')]||0x3;_0x45b31f[_0x55b0('0x17c')]=_0x16579b[_0x55b0('0x17d')]||0x100;_0x45b31f['XMD-AMDMAXIMUMWORDLENGTH']=_0x16579b[_0x55b0('0x17e')]||0x1388;}if(_0x16579b[_0x55b0('0x4c')]===_0x55b0('0x8f')){_0x45b31f[_0x55b0('0x17f')]=_0x62809c[_0x55b0('0xd4')];}else{_0x45b31f['XMD-CAMPAIGNID']=_0x62809c[_0x55b0('0xd5')];}for(var _0x376bd2 in _0x62809c[_0x55b0('0x16b')]){if(typeof _0x62809c[_0x55b0('0x16b')][_0x376bd2]!==_0x55b0('0x97')){if(isNotNull(_0x62809c['Contact'][_0x376bd2])&&_0x376bd2!=='id'&&_0x376bd2!=='tags'&&_0x376bd2!==_0x55b0('0x180')&&_0x376bd2!=='updatedAt'){_0x45b31f[util['format']('%s%s',_0x55b0('0x181'),_[_0x55b0('0x182')](_0x376bd2))]=_0x62809c[_0x55b0('0x16b')][_0x376bd2];}}}var _0x1b1c33=_0x445cf0['isTrunkReachable'](_0x16579b[_0x55b0('0x74')])?getCallerId(_0x16579b[_0x55b0('0x74')][_0x55b0('0x183')],_0x16579b['dialOriginateCallerIdName'],_0x16579b[_0x55b0('0x184')]>0x0?getCallerIdRandom(_0x16579b[_0x55b0('0x5a')],_0x16579b[_0x55b0('0x184')]):_0x16579b[_0x55b0('0x5a')]):getCallerId(_[_0x55b0('0xdd')](_0x16579b[_0x55b0('0x185')])?_0x16579b[_0x55b0('0x74')][_0x55b0('0x183')]:_0x16579b[_0x55b0('0x185')]['callerid'],_0x16579b['dialOriginateCallerIdName'],_0x16579b[_0x55b0('0x184')]>0x0?getCallerIdRandom(_0x16579b[_0x55b0('0x5a')],_0x16579b[_0x55b0('0x184')]):_0x16579b['dialOriginateCallerIdNumber']);if(_0x1b1c33){_0x45b31f['XMD-ORIGINATECALLERIDNAME']=_0x445cf0[_0x55b0('0x24')][_0x53e88d][_0x55b0('0x186')]=extractCalleridName(_0x1b1c33);_0x45b31f[_0x55b0('0x187')]=_0x445cf0[_0x55b0('0x24')][_0x53e88d][_0x55b0('0x188')]=extractCalleridNumber(_0x1b1c33);}return ami['Action']({'actionid':_0x53e88d,'action':'originate','channel':_0x445cf0[_0x55b0('0xd9')](_0x16579b[_0x55b0('0x74')])?util['format']('SIP/%s/%s%s',_0x16579b[_0x55b0('0x74')]['name'],isNotNull(_0x16579b[_0x55b0('0x189')])?_0x16579b['dialPrefix'][_0x55b0('0x18a')]()||'':'',_0x16579b[_0x55b0('0x18b')]>0x0?_0x62809c['Contact'][_0x55b0('0x16c')]['substring'](_0x16579b[_0x55b0('0x18b')]):_0x62809c['Contact'][_0x55b0('0x16c')]):util['format'](_0x55b0('0x18c'),_[_0x55b0('0xdd')](_0x16579b[_0x55b0('0x185')])?_0x16579b[_0x55b0('0x74')][_0x55b0('0x40')]:_0x16579b[_0x55b0('0x185')][_0x55b0('0x40')],isNotNull(_0x16579b[_0x55b0('0x189')])?_0x16579b[_0x55b0('0x189')][_0x55b0('0x18a')]()||'':'',_0x16579b[_0x55b0('0x18b')]>0x0?_0x62809c[_0x55b0('0x16b')]['phone']['substring'](_0x16579b['dialCutDigit']):_0x62809c[_0x55b0('0x16b')][_0x55b0('0x16c')]),'callerid':_0x1b1c33,'Exten':_0x55b0('0xe1'),'Context':_0x55b0('0x18d'),'Priority':'1','variable':_0x45b31f,'timeout':(_0x16579b[_0x55b0('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x53e88d})[_0x55b0('0xb3')](function(_0x95b873){return _0x1b651a(_0x95b873);})['catch'](function(_0x583095){_0x16579b[_0x55b0('0x62')]+=0x1;var _0x345314=new History(_0x445cf0[_0x55b0('0x24')][_0x53e88d]);logger[_0x55b0('0x93')](util[_0x55b0('0x76')](_0x55b0('0x18f'),JSON['stringify'](_0x583095)));_0x345314['state']=0xe;_0x345314['statedesc']=_0x55b0('0x190');_0x345314['starttime']=moment()[_0x55b0('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x345314[_0x55b0('0xa5')]=_0x345314[_0x55b0('0xa6')];_0x445cf0[_0x55b0('0xca')](_0x345314)['catch'](loggerCatch(_0x55b0('0x191')));_0x445cf0[_0x55b0('0xc8')](_0x345314)['catch'](loggerCatch(_0x55b0('0x191')))[_0x55b0('0x1c')](function(){delete _0x445cf0['actions'][_0x53e88d];return _0x52adc9(msgResponse(_0x55b0('0x169'),_0x55b0('0x192'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x55b0('0x2f')]=function(_0x27f8a3){var _0x2bd932=this['actions'][_0x27f8a3[_0x55b0('0x127')]];if(_0x2bd932){delete this['actions'][_0x27f8a3[_0x55b0('0x127')]];_0x2bd932[_0x55b0('0x115')]=moment()[_0x55b0('0x76')](_0x55b0('0xff'));var _0x5e4f33=_0x2bd932[_0x55b0('0x4c')]==='ivr'?this[_0x55b0('0x20')][_0x2bd932[_0x55b0('0xaf')]]:this['voiceQueues'][_0x2bd932[_0x55b0('0x193')]()];if(!this[_0x55b0('0xd7')](_0x27f8a3[_0x55b0('0x194')])){this[_0x55b0('0xae')](_0x5e4f33);return this[_0x55b0('0x195')](_0x2bd932,_0x5e4f33,_0x27f8a3)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x55b0('0x26')][_0x27f8a3[_0x55b0('0xdc')]]=_0x2bd932;}};Dialer['prototype'][_0x55b0('0x196')]=function(_0x159597,_0x35444e,_0x1decb0){var _0x2701cd=new History(_0x35444e);if(_0x2701cd[_0x55b0('0xf0')]+_0x2701cd[_0x55b0('0xf1')]+_0x2701cd[_0x55b0('0xf2')]+_0x2701cd[_0x55b0('0xf3')]+_0x2701cd['countdropretry']+_0x2701cd['countabandonedretry']+_0x2701cd[_0x55b0('0xec')]+_0x2701cd[_0x55b0('0xf6')]>=_0x1decb0[_0x55b0('0xf7')]-0x1){return!![];}switch(_0x159597){case 0x3:if(_0x2701cd[_0x55b0('0xf2')]>=_0x1decb0[_0x55b0('0x197')]-0x1){return!![];}this[_0x55b0('0xbd')]({'active':![],'countnoanswerretry':_0x2701cd[_0x55b0('0xf2')]+=0x1,'scheduledat':moment()['add'](_0x1decb0[_0x55b0('0x198')],_0x55b0('0xfe'))['format'](_0x55b0('0xff')),'ContactId':_0x2701cd['ContactId'],'ListId':_0x2701cd['ListId'],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x199')));break;case 0x5:if(_0x2701cd[_0x55b0('0xf0')]>=_0x1decb0[_0x55b0('0x19a')]-0x1){return!![];}this[_0x55b0('0xbd')]({'active':![],'countbusyretry':_0x2701cd[_0x55b0('0xf0')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0[_0x55b0('0x19b')],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x2701cd['ContactId'],'ListId':_0x2701cd[_0x55b0('0xd3')],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x19c')));break;case 0x8:if(_0x2701cd[_0x55b0('0xf1')]>=_0x1decb0[_0x55b0('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x2701cd[_0x55b0('0xf1')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0['dialCongestionRetryFrequency'],'minutes')[_0x55b0('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2701cd[_0x55b0('0xd2')],'ListId':_0x2701cd[_0x55b0('0xd3')],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})['catch'](loggerCatch(_0x55b0('0x19e')));break;case 0x0:if(_0x2701cd[_0x55b0('0xf3')]>=_0x1decb0[_0x55b0('0x19f')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x2701cd[_0x55b0('0xf3')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0[_0x55b0('0x1a0')],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x2701cd['ContactId'],'ListId':_0x2701cd[_0x55b0('0xd3')],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x1a1')));}break;case 0xa:if(_0x2701cd['countdropretry']>=_0x1decb0[_0x55b0('0x119')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x2701cd[_0x55b0('0xf4')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0[_0x55b0('0x11a')],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x2701cd[_0x55b0('0xd2')],'ListId':_0x2701cd[_0x55b0('0xd3')],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})['catch'](loggerCatch(_0x55b0('0x11b')));break;case 0xb:if(_0x2701cd[_0x55b0('0xf5')]>=_0x1decb0[_0x55b0('0x121')]-0x1){return!![];}this[_0x55b0('0xbd')]({'active':![],'countabandonedretry':_0x2701cd[_0x55b0('0xf5')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0[_0x55b0('0x122')],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x2701cd[_0x55b0('0xd2')],'ListId':_0x2701cd[_0x55b0('0xd3')],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x123')));break;case 0x13:if(_0x2701cd['countmachineretry']>=_0x1decb0[_0x55b0('0xfa')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countmachineretry':_0x2701cd[_0x55b0('0xec')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0['dialMachineRetryFrequency'],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x2701cd['ContactId'],'ListId':_0x2701cd[_0x55b0('0xd3')],'VoiceQueueId':_0x2701cd['VoiceQueueId']||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x100')));break;case 0x14:if(_0x2701cd['countagentrejectretry']>=_0x1decb0[_0x55b0('0x1a2')]-0x1){return!![];}this[_0x55b0('0xbd')]({'active':![],'countagentrejectretry':_0x2701cd[_0x55b0('0xf6')]+=0x1,'scheduledat':moment()[_0x55b0('0xfd')](_0x1decb0[_0x55b0('0x1a3')],_0x55b0('0xfe'))[_0x55b0('0x76')](_0x55b0('0xff')),'ContactId':_0x2701cd[_0x55b0('0xd2')],'ListId':_0x2701cd['ListId'],'VoiceQueueId':_0x2701cd[_0x55b0('0xd4')]||undefined,'CampaignId':_0x2701cd[_0x55b0('0xd5')]||undefined})['catch'](loggerCatch(_0x55b0('0x1a4')));break;default:return!![];}};Dialer[_0x55b0('0xa7')]['callProgressDetecting']=function(_0x41645a,_0x30eab4,_0x9c2ce1){var _0x18de6d=this;var _0x243667=new History(_0x41645a);return new BPromise(function(_0x7836c1,_0x92c314){if(_[_0x55b0('0x3e')](_0x30eab4)&&typeof _0x30eab4!==_0x55b0('0x1a5')){return _0x92c314(msgResponse(_0x55b0('0x1a6'),_0x55b0('0x147'),_0x55b0('0x1a7')));}if(_[_0x55b0('0x3e')](_0x9c2ce1)&&typeof _0x9c2ce1!==_0x55b0('0x1a5')){return _0x92c314(msgResponse(_0x55b0('0x1a6'),_0x55b0('0x147'),'evt\x20is\x20undefine'));}switch(_0x9c2ce1[_0x55b0('0x1a8')]){case'0':_0x30eab4[_0x55b0('0x61')]+=0x1;_0x243667['state']=0x0;_0x243667[_0x55b0('0xa4')]=_0x55b0('0x1a9');_0x243667['countnosuchnumberretry']+=0x1;_0x243667['countglobal']+=0x1;ami[_0x55b0('0xef')](_0x55b0('0x1aa'),ut[_0x55b0('0xe8')](_0x41645a,_0x55b0('0x1ab')));_0x18de6d[_0x55b0('0xca')](_0x243667)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x18de6d[_0x55b0('0x196')](0x0,_0x41645a,_0x30eab4)){if(_0x243667[_0x55b0('0xf3')]>=_0x30eab4['dialNoSuchNumberMaxRetry']){_0x18de6d[_0x55b0('0xfb')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1ac'));}else{_0x18de6d[_0x55b0('0xf8')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1ac'));}}break;case'3':_0x30eab4[_0x55b0('0x60')]+=0x1;_0x243667['state']=0x3;_0x243667[_0x55b0('0xa4')]=_0x55b0('0x1ad');_0x243667[_0x55b0('0xf2')]+=0x1;_0x243667['countglobal']+=0x1;ami['emit'](_0x55b0('0x1ae'),ut[_0x55b0('0xe8')](_0x41645a,_0x55b0('0x1af')));_0x18de6d[_0x55b0('0xca')](_0x243667)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x1b0')));if(_0x18de6d[_0x55b0('0x196')](0x3,_0x41645a,_0x30eab4)){if(_0x243667[_0x55b0('0xf2')]>=_0x30eab4['dialNoAnswerMaxRetry']){_0x18de6d[_0x55b0('0xfb')](_0x243667,_0x7836c1,_0x92c314,'reason\x203\x20ringing\x20no\x20answer');}else{_0x18de6d[_0x55b0('0xf8')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1b1'));}}break;case'5':_0x30eab4[_0x55b0('0x5e')]+=0x1;_0x243667[_0x55b0('0xa3')]=0x5;_0x243667[_0x55b0('0xa4')]=_0x55b0('0x1b2');_0x243667[_0x55b0('0xf0')]+=0x1;_0x243667['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0x55b0('0xe8')](_0x41645a,_0x55b0('0x1b3')));_0x18de6d[_0x55b0('0xca')](_0x243667)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x1b4')));if(_0x18de6d['checkRetriveMax'](0x5,_0x41645a,_0x30eab4)){if(_0x243667[_0x55b0('0xf0')]>=_0x30eab4[_0x55b0('0x19a')]){_0x18de6d[_0x55b0('0xfb')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1b5'));}else{_0x18de6d[_0x55b0('0xf8')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1b5'));}}break;case'8':_0x30eab4['outboundCongestionCallsDay']+=0x1;_0x243667[_0x55b0('0xa3')]=0x8;_0x243667['statedesc']='Congestion';_0x243667['countcongestionretry']+=0x1;_0x243667[_0x55b0('0xed')]+=0x1;ami['emit'](_0x55b0('0x1b6'),ut[_0x55b0('0xe8')](_0x41645a,_0x55b0('0x1b7')));_0x18de6d[_0x55b0('0xca')](_0x243667)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x1b8')));if(_0x18de6d['checkRetriveMax'](0x8,_0x41645a,_0x30eab4)){if(_0x243667[_0x55b0('0xf1')]>=_0x30eab4[_0x55b0('0x19d')]){_0x18de6d['createStateFinal'](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1b9'));}else{_0x18de6d[_0x55b0('0xf8')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1b9'));}}break;case'11':_0x30eab4[_0x55b0('0x1ba')]+=0x1;_0x243667['state']=0xb;_0x243667[_0x55b0('0xa4')]='Abandoned';_0x243667[_0x55b0('0xf5')]+=0x1;_0x243667[_0x55b0('0xed')]+=0x1;_0x18de6d[_0x55b0('0xca')](_0x243667)[_0x55b0('0xb4')](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x18de6d['checkRetriveMax'](0xb,_0x41645a,_0x30eab4)){if(_0x243667[_0x55b0('0xf5')]>=_0x30eab4['dialAbandonedMaxRetry']){_0x18de6d['createStateFinal'](_0x243667,_0x7836c1,_0x92c314,'reason\x2011\x20abandoned');}else{_0x18de6d[_0x55b0('0xf8')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1bb'));}}break;case'20':_0x30eab4[_0x55b0('0x64')]+=0x1;_0x243667[_0x55b0('0xa3')]=0x14;_0x243667[_0x55b0('0xa4')]=_0x55b0('0x1bc');_0x243667[_0x55b0('0xf6')]+=0x1;_0x243667[_0x55b0('0xed')]+=0x1;ami[_0x55b0('0xef')](_0x55b0('0x1bd'),ut[_0x55b0('0xe8')](_0x41645a,_0x55b0('0x1be')));_0x18de6d[_0x55b0('0xca')](_0x243667)[_0x55b0('0xb4')](loggerCatch(_0x55b0('0x1bf')));if(_0x18de6d[_0x55b0('0x196')](0x14,_0x41645a,_0x30eab4)){if(_0x243667[_0x55b0('0xf6')]>=_0x30eab4['dialAgentRejectMaxRetry']){_0x18de6d[_0x55b0('0xfb')](_0x243667,_0x7836c1,_0x92c314,_0x55b0('0x1c0'));}else{_0x18de6d[_0x55b0('0xf8')](_0x243667,_0x7836c1,_0x92c314,'reason\x2020\x20agentreject');}}break;default:_0x30eab4[_0x55b0('0x1c1')]+=0x1;_0x243667[_0x55b0('0xa3')]=0xc;_0x243667[_0x55b0('0xa4')]=_0x9c2ce1['reason'];_0x18de6d[_0x55b0('0xca')](_0x243667)[_0x55b0('0xb4')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x18de6d[_0x55b0('0x196')](_0x9c2ce1[_0x55b0('0x1a8')],_0x41645a,_0x30eab4)){if(_0x243667['countbusyretry']+_0x243667[_0x55b0('0xf1')]+_0x243667[_0x55b0('0xf2')]+_0x243667[_0x55b0('0xf3')]+_0x243667['countdropretry']+_0x243667[_0x55b0('0xf5')]+_0x243667[_0x55b0('0xec')]+_0x243667['countagentrejectretry']>=_0x30eab4[_0x55b0('0xf7')]){_0x18de6d['stateGlobal'](_0x243667,_0x7836c1,_0x92c314,_0x9c2ce1[_0x55b0('0x1a8')]);}else{_0x18de6d[_0x55b0('0xfb')](_0x243667,_0x7836c1,_0x92c314,_0x9c2ce1[_0x55b0('0x1a8')]);}}}});};Dialer['prototype'][_0x55b0('0xf8')]=function(_0x542486,_0x46379f,_0x35021e,_0x7b2bed){var _0x225043=new Final(_0x542486);_0x225043[_0x55b0('0xa3')]=0xf;_0x225043[_0x55b0('0xa4')]=_0x55b0('0x1c2');this[_0x55b0('0xfb')](_0x225043,_0x46379f,_0x35021e,_0x7b2bed);};Dialer[_0x55b0('0xa7')][_0x55b0('0xfb')]=function(_0x31e3f0,_0x59f021,_0x3ed73f,_0x297778){this[_0x55b0('0xc8')](_0x31e3f0)[_0x55b0('0xb3')](function(){return _0x59f021(msgResponse(_0x55b0('0x1a6'),'Success',_0x297778));})[_0x55b0('0xb4')](function(){return _0x3ed73f(msgResponse(_0x55b0('0x1c3'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x55b0('0xa7')][_0x55b0('0xa')]=function(_0x2f94f3){var _0x4c775b=_0x2f94f3[_0x55b0('0x1c4')]/0x64;var _0x44fc28=_0x2f94f3[_0x55b0('0x5f')]/(_0x2f94f3[_0x55b0('0x5f')]+_0x2f94f3['outboundAnswerCallsDay']);var _0x7be459=Math[_0x55b0('0x1c5')](_0x2f94f3[_0x55b0('0x1c6')]*(_0x2f94f3['predictiveIntervalMaxThreshold']/0x64));var _0x59827b=Math[_0x55b0('0x1c5')](_0x2f94f3[_0x55b0('0x1c6')]*(_0x2f94f3[_0x55b0('0x1c7')]/0x64));var _0x2103d0=_0x2f94f3[_0x55b0('0x4e')]+_0x2f94f3['talking'];var _0x1de0cd=Math[_0x55b0('0x1c8')](_0x2f94f3[_0x55b0('0x70')]*_0x2f94f3[_0x55b0('0x72')]*_0x2f94f3['predictiveIntervalHitRate']*_0x2f94f3['predictiveIntervalMultiplicativeFactor']);if(_[_0x55b0('0x3e')](_0x2f94f3[_0x55b0('0x28')])){if(!_[_0x55b0('0x3e')](_0x2f94f3[_0x55b0('0x27')])){_0x2f94f3[_0x55b0('0x27')]=undefined;loggerPredictive['error'](_0x55b0('0x1c9'),_0x55b0('0x1ca'));}if(!_[_0x55b0('0x3e')](_0x2f94f3['handlePredictive'])){loggerPredictive[_0x55b0('0x93')]('[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x2f94f3['handlePredictive']);_0x2f94f3[_0x55b0('0x8e')]=undefined;}_0x2f94f3['startProgressive']=moment()[_0x55b0('0x76')](_0x55b0('0xff'));loggerPredictive[_0x55b0('0x7b')](_0x2f94f3[_0x55b0('0x40')],_0x55b0('0x1cb'),_0x2f94f3['startProgressive']);this['handlePower'](_0x2f94f3,0x1);}else if(ifInterval(_0x2f94f3[_0x55b0('0x1cc')],_0x2f94f3['startProgressive'])){this[_0x55b0('0x15a')](_0x2f94f3,0x1);loggerPredictiveCalls[_0x55b0('0x7b')](_0x55b0('0x1cd'),_0x2f94f3[_0x55b0('0x28')],_0x2f94f3[_0x55b0('0x40')]);_0x2f94f3['erlangCalls']=0x0;_0x2f94f3[_0x55b0('0x6a')]=0x0;}else if(_0x4c775b<_0x44fc28&&_0x2f94f3[_0x55b0('0x1ce')]===_0x55b0('0x1cf')){freeVariablesPredictive(_0x2f94f3);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x1d0'),_0x55b0('0x1d1'),_0x44fc28,_0x55b0('0x28'),_0x2f94f3[_0x55b0('0x40')]);}else if(_0x1de0cd<_0x2f94f3[_0x55b0('0x6a')]&&_0x2f94f3[_0x55b0('0x1ce')]===_0x55b0('0x1cf')){freeVariablesPredictive(_0x2f94f3);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x1d2'),_0x55b0('0x1d3'),_0x1de0cd,_0x55b0('0x1d4'),_0x2f94f3['predictiveIntervalErlangCallsDroppedCalls'],_0x55b0('0x28'),_0x2f94f3[_0x55b0('0x40')]);}else if(!ifInterval(_0x2f94f3[_0x55b0('0x1cc')],_0x2f94f3[_0x55b0('0x28')])&&_[_0x55b0('0x3e')](_0x2f94f3[_0x55b0('0x27')])&&!_[_0x55b0('0x3e')](_0x2f94f3['startProgressive'])){_0x2f94f3[_0x55b0('0x27')]=moment()[_0x55b0('0x76')](_0x55b0('0xff'));loggerPredictive[_0x55b0('0x7b')](_0x2f94f3[_0x55b0('0x40')],_0x55b0('0x1d5'),_0x2f94f3['startPredictive']);this[_0x55b0('0xba')](_0x2f94f3[_0x55b0('0x1cc')])[_0x55b0('0xb3')](this['getDataPredictive'](_0x2f94f3))[_0x55b0('0xb3')](mergeDataErlangB(_0x2f94f3))['then'](this['startMethodPredictive'](_0x2f94f3))['catch'](loggerCatchPredictive(_0x55b0('0x1d6'),_0x2f94f3));}else if(!ifInterval(_0x2f94f3['dialPredictiveInterval'],_0x2f94f3[_0x55b0('0x27')])){_0x2f94f3[_0x55b0('0x6a')]=0x0;_0x2f94f3['startPredictive']=moment()[_0x55b0('0x76')](_0x55b0('0xff'));loggerPredictive[_0x55b0('0x7b')](_0x2f94f3[_0x55b0('0x40')],'recalculate\x20predictive\x20at',_0x2f94f3['startPredictive']);clearInterval(_0x2f94f3[_0x55b0('0x8e')]);_0x2f94f3[_0x55b0('0x8e')]=undefined;this[_0x55b0('0xba')](_0x2f94f3['dialPredictiveInterval'])[_0x55b0('0xb3')](this[_0x55b0('0x1d7')](_0x2f94f3))[_0x55b0('0xb3')](mergeDataErlangB(_0x2f94f3))['then'](this[_0x55b0('0x1d8')](_0x2f94f3))[_0x55b0('0xb4')](loggerCatchPredictive(_0x55b0('0x1d9'),_0x2f94f3));}else if(_0x2f94f3['predictiveIntervalAvailable']&&_0x2103d0<_0x2f94f3[_0x55b0('0x1c6')]-_0x59827b){freeVariablesPredictive(_0x2f94f3);loggerPredictive[_0x55b0('0x7b')](_0x2f94f3['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2103d0,_0x55b0('0x1da'),_0x2f94f3[_0x55b0('0x1c6')],'-',_0x59827b,'=',_0x2f94f3[_0x55b0('0x1c6')]-_0x59827b,')');}else if(_0x2f94f3[_0x55b0('0x1c6')]&&_0x2103d0>_0x2f94f3['predictiveIntervalAvailable']+_0x7be459){freeVariablesPredictive(_0x2f94f3);loggerPredictive[_0x55b0('0x7b')](_0x2f94f3[_0x55b0('0x40')],_0x55b0('0x1db'),_0x2103d0,_0x55b0('0x1dc'),_0x2f94f3[_0x55b0('0x1c6')],'+',_0x7be459,'=',_0x2f94f3['predictiveIntervalAvailable']+_0x7be459,')');}};Dialer[_0x55b0('0xa7')]['getDataPredictive']=function(_0x319c24){var _0x2a432d=this;return function(_0x2e45fc){return new BPromise(function(_0x67004c,_0x563ada){_[_0x55b0('0x8a')](_0x319c24,_0x2e45fc[0x0]);if(checkGetDataPredictive(_0x2e45fc[0x0])){var _0x3ab2c6=_0x319c24[_0x55b0('0x1c6')]=_0x319c24[_0x55b0('0x52')]+_0x319c24[_0x55b0('0x4e')];var _0x26b73f=_0x319c24[_0x55b0('0x1cc')]*0x3c;var _0x1e469f=_0x2e45fc[0x0][_0x55b0('0x67')]+_0x2e45fc[0x0][_0x55b0('0x66')];var _0x4c8f10=(_0x2e45fc[0x0]['predictiveIntervalAnsweredCalls']+_0x2e45fc[0x0][_0x55b0('0x68')]+_0x2e45fc[0x0][_0x55b0('0x80')])/_0x2e45fc[0x0][_0x55b0('0x6e')];_0x319c24[_0x55b0('0x6b')]=_0x4c8f10>0x0?_0x4c8f10:0x1;switch(_0x319c24[_0x55b0('0x1ce')]){case _0x55b0('0x1cf'):var _0x45dc86=_0x319c24['dialPredictiveOptimizationPercentage']/0x64;return _0x2a432d[_0x55b0('0x1dd')](_0x3ab2c6,_0x26b73f,_0x1e469f,_0x4c8f10,_0x45dc86)[_0x55b0('0xb3')](function(_0x2d0d67){return _0x67004c(_0x2d0d67);});case _0x55b0('0x1de'):var _0x5b1a6e=_0x319c24[_0x55b0('0x1c4')]/0x64;return _0x2a432d['busyFactor'](_0x3ab2c6,_0x26b73f,_0x1e469f,_0x4c8f10,_0x5b1a6e)[_0x55b0('0xb3')](function(_0x3c1f90){return _0x67004c(_0x3c1f90);});default:return _0x563ada(msgResponse(_0x55b0('0x1df'),'Failure','Unknown\x20Predictive'));}}else{return _0x563ada(msgResponse(_0x55b0('0x1df'),'Failure','check\x20failure'));}});};};Dialer[_0x55b0('0xa7')][_0x55b0('0x1e0')]=function(_0x41c6b6){var _0x402d15=this;return function(_0x479481){return new BPromise(function(_0x4fcbd3,_0x14397d){_[_0x55b0('0x8a')](_0x41c6b6,_0x479481[0x0]);if(checkGetDataPredictive(_0x479481[0x0])){loggerPredictive[_0x55b0('0x7b')](JSON[_0x55b0('0x137')](_0x479481[0x0]));if(_0x41c6b6[_0x55b0('0x1ce')]===_0x55b0('0x1cf')){return _0x402d15[_0x55b0('0xc6')](_0x41c6b6['id'])[_0x55b0('0xb3')](function(_0x2cf74c){var _0x16e4aa=_0x41c6b6[_0x55b0('0x4f')]-_0x2cf74c[0x0]['outboundQueuePauses'];var _0xe7582a=_0x41c6b6['dialPredictiveInterval']*0x3c;var _0x93e9c7=_0x479481[0x0][_0x55b0('0x67')]+_0x479481[0x0][_0x55b0('0x66')];var _0x2e9176=(_0x479481[0x0]['predictiveIntervalAnsweredCalls']+_0x479481[0x0][_0x55b0('0x68')]+_0x479481[0x0][_0x55b0('0x80')])/_0x479481[0x0][_0x55b0('0x6e')];var _0x3d1462=_0x41c6b6[_0x55b0('0x1c4')]/0x64;_0x41c6b6[_0x55b0('0x6d')]=_0x2cf74c[0x0][_0x55b0('0x1e1')]||0x0;_0x41c6b6[_0x55b0('0x6b')]=_0x2e9176>0x0?_0x2e9176:0x1;return _0x402d15[_0x55b0('0x1dd')](_0x16e4aa,_0xe7582a,_0x93e9c7,_0x2e9176,_0x3d1462);})[_0x55b0('0xb3')](function(_0x15e7f9){return _0x4fcbd3(_0x15e7f9);})[_0x55b0('0xb4')](function(_0x4289e5){return _0x14397d(msgResponse(_0x55b0('0x1e2'),_0x55b0('0x147'),JSON['stringify'](_0x4289e5)));});}if(_0x41c6b6[_0x55b0('0x1ce')]===_0x55b0('0x1de')){return _0x402d15[_0x55b0('0xc6')](_0x41c6b6['id'])[_0x55b0('0xb3')](function(_0x423f18){var _0x3e0644=_0x41c6b6[_0x55b0('0x4f')]-_0x423f18[0x0]['outboundQueuePauses'];var _0x3dc548=_0x41c6b6['dialPredictiveInterval']*0x3c;var _0x1578fb=_0x479481[0x0][_0x55b0('0x67')]+_0x479481[0x0]['predictiveIntervalAvgHoldtime'];var _0x3b9eea=(_0x479481[0x0]['predictiveIntervalAnsweredCalls']+_0x479481[0x0][_0x55b0('0x68')]+_0x479481[0x0][_0x55b0('0x80')])/_0x479481[0x0][_0x55b0('0x6e')];var _0xe19a81=_0x41c6b6[_0x55b0('0x1c4')]/0x64;_0x41c6b6[_0x55b0('0x6d')]=_0x423f18[0x0][_0x55b0('0x1e1')]||0x0;_0x41c6b6[_0x55b0('0x6b')]=_0x3b9eea>0x0?_0x3b9eea:0x1;return _0x402d15[_0x55b0('0x1e3')](_0x3e0644,_0x3dc548,_0x1578fb,_0x3b9eea,_0xe19a81);})[_0x55b0('0xb3')](function(_0x54914c){return _0x4fcbd3(_0x54914c);})[_0x55b0('0xb4')](function(_0x498d68){return _0x14397d(msgResponse(_0x55b0('0x1e2'),_0x55b0('0x147'),JSON[_0x55b0('0x137')](_0x498d68)));});}}else{return _0x14397d(msgResponse(_0x55b0('0x1df'),_0x55b0('0x147'),'check\x20failure'));}});};};Dialer[_0x55b0('0xa7')][_0x55b0('0x1d8')]=function(_0x32ecc8){var _0x1e4555=this;return function(){var _0x301d78=0x0;var _0x13e4e6=Math['floor'](_0x32ecc8[_0x55b0('0x71')]*0x3e8);if(_0x13e4e6>0x0){_0x13e4e6=_0x13e4e6<0x64?0x64:_0x13e4e6;loggerPredictive['info'](_0x32ecc8[_0x55b0('0x40')],_0x55b0('0x1e4'),_0x13e4e6,_0x55b0('0x4a'));_0x32ecc8[_0x55b0('0x8e')]=setInterval(function(){_0x1e4555[_0x55b0('0x8e')](_0x32ecc8);loggerPredictiveCalls[_0x55b0('0x7b')]('[handlePredictive]',_0x301d78+=0x1);},_0x13e4e6);}else{loggerPredictive['info'](_0x32ecc8['name'],_0x55b0('0x1e5'));}};};Dialer[_0x55b0('0xa7')][_0x55b0('0x1e6')]=function(_0x464a87,_0x1c70d9){var _0x450d21=this;return function(_0x268fc3){if(_[_0x55b0('0x48')](_0x268fc3)){if(_['isNil'](_0x1c70d9['UserId'])||!_0x1c70d9[_0x55b0('0x1e7')]){if(_0x464a87[_0x55b0('0x58')]===_0x55b0('0x1e8')){_0x464a87['queueStatusComplete']=_[_0x55b0('0x3e')](_0x464a87[_0x55b0('0x131')])?!![]:_0x464a87[_0x55b0('0x131')];var _0x14a1d8=uuid['v4']();_0x450d21['actions'][_0x14a1d8]=new Action(_0x464a87,_0x1c70d9,_0x14a1d8);loggerBooked[_0x55b0('0x7b')](_0x55b0('0x1e9'),_0x14a1d8,'queueStatusComplete:\x20',JSON[_0x55b0('0x137')](_0x464a87[_0x55b0('0x131')]),'Queue:\x20',_0x464a87['name']);if(_0x464a87[_0x55b0('0x131')]){_0x464a87[_0x55b0('0x131')]=![];_0x450d21[_0x55b0('0x2a')][_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xaf')]]=[];ami['Action']({'actionid':_0x14a1d8,'action':'queuestatus','queue':_0x464a87[_0x55b0('0x40')]})[_0x55b0('0xb4')](function(){_0x450d21[_0x55b0('0xae')](_0x464a87);_0x450d21[_0x55b0('0xbd')]({'active':![],'ContactId':_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xd2')],'ListId':_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xd3')],'VoiceQueueId':_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xd4')]||undefined,'CampaignId':_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xd5')]||undefined})[_0x55b0('0xb4')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x450d21['actions'][_0x14a1d8];});}else{loggerBooked[_0x55b0('0x7b')](_0x55b0('0x1ea'),JSON[_0x55b0('0x137')](_0x464a87[_0x55b0('0x131')]),_0x55b0('0x1eb'),_0x464a87[_0x55b0('0x40')]);_0x450d21['updateOriginated'](_0x464a87);_0x450d21['rescheduleContact']({'active':![],'ContactId':_0x450d21[_0x55b0('0x24')][_0x14a1d8]['ContactId'],'ListId':_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xd3')],'VoiceQueueId':_0x450d21[_0x55b0('0x24')][_0x14a1d8]['VoiceQueueId']||undefined,'CampaignId':_0x450d21[_0x55b0('0x24')][_0x14a1d8][_0x55b0('0xd5')]||undefined})['catch'](loggerCatch(_0x55b0('0x1ec')));delete _0x450d21[_0x55b0('0x24')][_0x14a1d8];}}else{return _0x450d21[_0x55b0('0x168')](_0x464a87,_0x1c70d9);}}else{if(getDiff(_0x1c70d9[_0x55b0('0x1ed')])<_0x464a87[_0x55b0('0x1ee')]*0x3c){if(_0x1c70d9[_0x55b0('0x1ef')]&&!_0x1c70d9[_0x55b0('0x1ef')][_0x55b0('0x1f0')]){_0x450d21[_0x55b0('0x1e')]['run'](_0x1c70d9['id'])[_0x55b0('0x1c')](function(){_0x450d21[_0x55b0('0xae')](_0x464a87);});}else{_0x450d21[_0x55b0('0xbf')]({'active':![]},_0x1c70d9['id'],0x1)['finally'](function(){_0x450d21[_0x55b0('0xae')](_0x464a87);});}}else{_0x464a87[_0x55b0('0x63')]+=0x1;_0x450d21[_0x55b0('0xae')](_0x464a87);if(_0x464a87[_0x55b0('0x1f1')]){_0x450d21['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x1c70d9['ContactId'],'ListId':_0x1c70d9['ListId'],'VoiceQueueId':_0x1c70d9[_0x55b0('0xd4')]||undefined,'CampaignId':_0x1c70d9['CampaignId']||undefined})[_0x55b0('0xb4')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x450d21[_0x55b0('0xca')](createObjHistory(_0x464a87,_0x1c70d9,_0x55b0('0x1f2'),0x17,'RecallInQueue'))[_0x55b0('0xb4')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x450d21[_0x55b0('0xd1')](createObjHistory(_0x464a87,_0x1c70d9,_0x55b0('0x1f3'),0x16,_0x55b0('0x1f4')),_0x55b0('0x1f5'),'[Originate][HistoryRecallClose]');}}}}else{_0x464a87[_0x55b0('0x5d')]+=0x1;_0x450d21[_0x55b0('0xd1')](createObjHistory(_0x464a87,_0x1c70d9,_0x55b0('0x1f6'),0xd,'Blacklist'),_0x55b0('0x1f7'),'[Originate][MoveBlacklist]');throw _0x55b0('0x1f8');}};};Dialer[_0x55b0('0xa7')][_0x55b0('0x15d')]=function(_0x1f434b){var _0x5ece81=this;var _0x3b1f9b=_0x1f434b['limitCalls']-_0x1f434b[_0x55b0('0x6f')]-_0x1f434b[_0x55b0('0xc2')];emitCampaignSummary(_0x1f434b);if(_0x3b1f9b>0x0){if(_0x3b1f9b>this[_0x55b0('0x22')]){_0x3b1f9b=this[_0x55b0('0x22')];}_0x1f434b['temp']+=_0x3b1f9b;this[_0x55b0('0xc4')](_0x1f434b['id'],_0x3b1f9b,_0x1f434b['dialOrderByScheduledAt'],_0x1f434b)[_0x55b0('0xb3')](function(_0x30fa8b){_0x1f434b[_0x55b0('0xc2')]-=_0x3b1f9b;_0x1f434b['temp']=_0x1f434b['temp']>0x0?_0x1f434b[_0x55b0('0xc2')]:0x0;if(!checkContactEmpty(_0x30fa8b)){_0x1f434b[_0x55b0('0x3f')]=_0x55b0('0x1f9');logger['info'](_0x55b0('0x1fa')+_0x1f434b[_0x55b0('0x40')]);}else{_0x1f434b['originated']+=_0x30fa8b['length'];_0x1f434b[_0x55b0('0x3f')]=_0x55b0('0x1fb');for(var _0x411e67=0x0;_0x411e67<_0x30fa8b[_0x55b0('0x96')];_0x411e67+=0x1){_0x1f434b['ivrTotalCallsDays']+=0x1;if(_[_0x55b0('0xdd')](_0x30fa8b[_0x411e67])||_[_0x55b0('0xdd')](_0x30fa8b[_0x411e67]['Contact'])||_['isNil'](_0x30fa8b[_0x411e67]['Contact'][_0x55b0('0x16c')])){_0x5ece81['emptyContact'](_0x55b0('0x1fc'),_0x1f434b,_0x30fa8b[_0x411e67]);}else{_0x5ece81[_0x55b0('0xb8')](_[_0x55b0('0x12f')](_0x30fa8b[_0x411e67],[_0x55b0('0xd5'),_0x55b0('0x1fd')]))[_0x55b0('0xb3')](_0x5ece81['checkContactBlack'](_0x1f434b,_0x30fa8b[_0x411e67]))[_0x55b0('0xb4')](_0x5ece81[_0x55b0('0xce')]('[actionOriginateIvr]\x20',_0x1f434b));}}}})['catch'](loggerGetContactDialer(_0x55b0('0x1fe'),_0x1f434b,_0x3b1f9b));}};Dialer['prototype'][_0x55b0('0x15a')]=function(_0x14e313,_0x567d1e){var _0x49e11a=this;var _0x67eedf=[];var _0x463a04=_0x567d1e>=0x1?_0x567d1e:0x1;if(_0x14e313[_0x55b0('0x58')]===_0x55b0('0x1e8')){_0x463a04=0x1;}var _0x1d08d2=Math['floor'](_0x14e313[_0x55b0('0x4e')]*_0x463a04)-_0x14e313['originated']-_0x14e313[_0x55b0('0xc2')];emitVoiceQueueSummary(_0x14e313);if(_0x14e313[_0x55b0('0x1ff')]>0x0){var _0x4d54b4=_0x14e313['dialLimitQueue']-_0x14e313['originated']-_0x14e313[_0x55b0('0x52')]-_0x14e313['temp']-_0x14e313[_0x55b0('0x200')];if(_0x1d08d2>_0x4d54b4){_0x1d08d2=_0x4d54b4;}}if(_0x1d08d2>0x0){if(_0x14e313['dialMethod']==='booked'){_0x1d08d2=0x1;}if(_0x1d08d2>this['maxNumberOriginate']){_0x1d08d2=this[_0x55b0('0x22')];}_0x14e313['temp']+=_0x1d08d2;for(var _0x439724 in this[_0x55b0('0x12a')]){if(typeof this['agents'][_0x439724]!=='undefined'){if(this[_0x55b0('0x12a')][_0x439724]['state']===_0x55b0('0x201')&&this[_0x55b0('0x12a')][_0x439724][_0x55b0('0xac')]===_0x55b0('0x202')){_0x67eedf[_0x55b0('0x12e')](this['agents'][_0x439724]['id']);}}}this['getContactDialer'](_0x14e313['id'],_0x67eedf,_0x1d08d2,_0x14e313[_0x55b0('0x203')],_0x14e313)[_0x55b0('0xb3')](function(_0x1737a0){_0x14e313[_0x55b0('0xc2')]-=_0x1d08d2;_0x14e313[_0x55b0('0xc2')]=_0x14e313[_0x55b0('0xc2')]>0x0?_0x14e313[_0x55b0('0xc2')]:0x0;if(!checkContactEmpty(_0x1737a0)){_0x49e11a[_0x55b0('0xb1')](_0x14e313)[_0x55b0('0xb3')](sendMessageReschedule(_0x14e313))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xb5')));}else{_0x14e313[_0x55b0('0x6f')]+=_0x1737a0['length'];_0x14e313['message']=_0x14e313[_0x55b0('0x58')]===_0x55b0('0x1e8')?_0x55b0('0x204'):_0x55b0('0x1fb');for(var _0x2a03fd=0x0;_0x2a03fd<_0x1737a0[_0x55b0('0x96')];_0x2a03fd+=0x1){if(_[_0x55b0('0xdd')](_0x1737a0[_0x2a03fd])||_[_0x55b0('0xdd')](_0x1737a0[_0x2a03fd]['Contact'])||_[_0x55b0('0xdd')](_0x1737a0[_0x2a03fd][_0x55b0('0x16b')]['phone'])){_0x49e11a['emptyContact'](_0x55b0('0x1fc'),_0x14e313,_0x1737a0[_0x2a03fd]);}else{_0x49e11a[_0x55b0('0xb6')](_['pick'](_0x1737a0[_0x2a03fd],[_0x55b0('0xd4'),_0x55b0('0x1fd')]))[_0x55b0('0xb3')](_0x49e11a[_0x55b0('0x1e6')](_0x14e313,_0x1737a0[_0x2a03fd]))[_0x55b0('0xb4')](_0x49e11a[_0x55b0('0xce')](_0x55b0('0x1fc'),_0x14e313));}}}})['catch'](loggerGetContactDialer(_0x55b0('0x205'),_0x14e313,_0x1d08d2));}};Dialer[_0x55b0('0xa7')][_0x55b0('0x8e')]=function(_0x1ba433){if(_0x1ba433[_0x55b0('0x1ff')]>0x0){var _0x548362=_0x1ba433[_0x55b0('0x1ff')]-_0x1ba433[_0x55b0('0x6f')]-_0x1ba433['talking'];if(_0x548362>0x0){this[_0x55b0('0x206')](_0x1ba433);}else{loggerPredictiveCalls[_0x55b0('0x7b')](_0x55b0('0x207'));}}else{this['tryOriginatePredictive'](_0x1ba433);}};Dialer[_0x55b0('0xa7')][_0x55b0('0x206')]=function(_0x28fbd4){var _0x1d1233=this;var _0x354e9a=[];_0x28fbd4[_0x55b0('0x6f')]+=0x1;for(var _0x4c409e in this[_0x55b0('0x12a')]){if(typeof this[_0x55b0('0x12a')][_0x4c409e]!==_0x55b0('0x97')){if(this[_0x55b0('0x12a')][_0x4c409e][_0x55b0('0xa3')]===_0x55b0('0x201')&&this[_0x55b0('0x12a')][_0x4c409e]['status']===_0x55b0('0x202')){_0x354e9a[_0x55b0('0x12e')](this['agents'][_0x4c409e]['id']);}}}this[_0x55b0('0xc1')](_0x28fbd4['id'],_0x354e9a,0x1,_0x28fbd4[_0x55b0('0x203')],_0x28fbd4)['then'](function(_0x30d602){if(!checkContactEmpty(_0x30d602)){checkContactLowerLimitOriginate(_0x28fbd4,0x1,0x0);_0x1d1233[_0x55b0('0xb1')](_0x28fbd4)['then'](sendMessageReschedule(_0x28fbd4))[_0x55b0('0xb4')](loggerCatch(_0x55b0('0xb5')));}else{_0x28fbd4[_0x55b0('0x3f')]=_0x55b0('0x1fb');if(_['isNil'](_0x30d602[0x0])||_[_0x55b0('0xdd')](_0x30d602[0x0][_0x55b0('0x16b')])||_['isNil'](_0x30d602[0x0][_0x55b0('0x16b')]['phone'])){_0x1d1233[_0x55b0('0xcf')](_0x55b0('0x1fc'),_0x28fbd4,_0x30d602[0x0]);}else{_0x1d1233[_0x55b0('0xb6')](_['pick'](_0x30d602[0x0],[_0x55b0('0xd4'),_0x55b0('0x1fd')]))['then'](_0x1d1233['checkContactBlack'](_0x28fbd4,_0x30d602[0x0]))[_0x55b0('0xb4')](_0x1d1233['loggerHandler']('[actionOriginatePredictive]\x20',_0x28fbd4));}}})[_0x55b0('0xb4')](loggerGetContactDialer(_0x55b0('0x208'),_0x28fbd4,0x1));emitVoiceQueueSummary(_0x28fbd4);};Dialer[_0x55b0('0xa7')][_0x55b0('0x1dd')]=function(_0x2e26d7,_0x39f816,_0x4d691d,_0x11e3ac,_0x560c55,_0x555966){loggerPredictive[_0x55b0('0x7b')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x209'),_0x2e26d7);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39f816);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x20a'),_0x4d691d);loggerPredictive[_0x55b0('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',_0x11e3ac);loggerPredictive['info'](_0x55b0('0x20b'),_0x560c55);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x82'));return new BPromise(function(_0x801a5a,_0x5b8305){if(_0x2e26d7<=0x0||isNaN(_0x2e26d7)){return _0x5b8305(msgResponse(_0x55b0('0x20c'),_0x55b0('0x192'),_0x55b0('0x20d')+_0x2e26d7));}if(_0x4d691d<=0x0||isNaN(_0x4d691d)){return _0x5b8305(msgResponse(_0x55b0('0x20c'),_0x55b0('0x192'),_0x55b0('0x20e')+_0x4d691d));}if(_0x11e3ac<=0x0||isNaN(_0x11e3ac)){return _0x5b8305(msgResponse(_0x55b0('0x20c'),_0x55b0('0x192'),_0x55b0('0x20f')+_0x11e3ac));}if(_0x39f816<=0x0||isNaN(_0x39f816)){return _0x5b8305(msgResponse(_0x55b0('0x20c'),_0x55b0('0x192'),'interval\x20=\x20'+_0x39f816));}if(_0x560c55<=0x0||isNaN(_0x560c55)){return _0x5b8305(msgResponse(_0x55b0('0x20c'),'Error',_0x55b0('0x210')+_0x560c55));}_0x555966=_0x555966||0x0;var _0x38b7d2=0x1/_0x4d691d;var _0x14b649=0x0;var _0x73fd2e=0x0;var _0x5dce77=0x0;var _0xb34ff2=0x0;for(var _0x507e54=0x0;_0x5dce77<_0x560c55;_0x507e54+=0x1){_0x73fd2e=_0x507e54/_0x39f816;_0x14b649=(_0x11e3ac*_0x73fd2e+_0x555966)/_0x38b7d2;_0x5dce77=erlangb(_0x14b649,_0x2e26d7);_0xb34ff2=_0x14b649/_0x2e26d7*(0x1-erlangb(_0x14b649,_0x2e26d7));}return _0x801a5a({'erlangCalls':_0x507e54,'erlangCallToSecond':_0x39f816/_0x507e54,'erlangAbandonmentRate':_0x5dce77,'erlangBusyFactor':_0xb34ff2});});};Dialer[_0x55b0('0xa7')][_0x55b0('0x1e3')]=function(_0x2fbb83,_0x58299b,_0x46a8f6,_0x2419a4,_0x13fab8,_0x288620){loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x211'));loggerPredictive['info']('M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2fbb83);loggerPredictive['info'](_0x55b0('0x212'),_0x58299b);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x20a'),_0x46a8f6);loggerPredictive[_0x55b0('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',_0x2419a4);loggerPredictive['info'](_0x55b0('0x213'),_0x13fab8);loggerPredictive[_0x55b0('0x7b')](_0x55b0('0x82'));return new BPromise(function(_0x2a5ea5,_0x5da39c){if(_0x2fbb83<=0x0||isNaN(_0x2fbb83)){return _0x5da39c(msgResponse('[busyFactor]','Error',_0x55b0('0x20d')+_0x2fbb83));}if(_0x46a8f6<=0x0||isNaN(_0x46a8f6)){return _0x5da39c(msgResponse('[busyFactor]','Error',_0x55b0('0x20e')+_0x46a8f6));}if(_0x2419a4<=0x0||isNaN(_0x2419a4)){return _0x5da39c(msgResponse(_0x55b0('0x214'),_0x55b0('0x192'),'p\x20=\x20'+_0x2419a4));}if(_0x58299b<=0x0||isNaN(_0x58299b)){return _0x5da39c(msgResponse(_0x55b0('0x214'),'Error',_0x55b0('0x215')+_0x58299b));}if(_0x13fab8<=0x0||isNaN(_0x13fab8)){return _0x5da39c(msgResponse('[busyFactor]',_0x55b0('0x192'),_0x55b0('0x216')+_0x13fab8));}_0x288620=_0x288620||0x0;var _0x1def52=0x1/_0x46a8f6;var _0x3dcd3d=0x0;var _0xf2aea=0x0;var _0x12cd14=0x0;var _0x2aa9c9=0x0;for(var _0xc20dbb=0x0;_0x2aa9c9<_0x13fab8;_0xc20dbb+=0x1){_0xf2aea=_0xc20dbb/_0x58299b;_0x3dcd3d=(_0x2419a4*_0xf2aea+_0x288620)/_0x1def52;_0x12cd14=erlangb(_0x3dcd3d,_0x2fbb83);_0x2aa9c9=_0x3dcd3d/_0x2fbb83*(0x1-erlangb(_0x3dcd3d,_0x2fbb83));}return _0x2a5ea5({'erlangCalls':_0xc20dbb,'erlangCallToSecond':_0x58299b/_0xc20dbb,'erlangAbandonmentRate':_0x12cd14,'erlangBusyFactor':_0x2aa9c9});});};module[_0x55b0('0x217')]=Dialer; \ No newline at end of file +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 diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index c1011d3..3beab5a 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 _0x6592=['type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','holdtime','talktime','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','scheduledat','campaigntype'];(function(_0x199111,_0x3aecaf){var _0x5d4659=function(_0x45c89c){while(--_0x45c89c){_0x199111['push'](_0x199111['shift']());}};_0x5d4659(++_0x3aecaf);}(_0x6592,0x173));var _0x2659=function(_0x4cd598,_0x357743){_0x4cd598=_0x4cd598-0x0;var _0x1d45d=_0x6592[_0x4cd598];return _0x1d45d;};'use strict';var util=require(_0x2659('0x0'));var _=require(_0x2659('0x1'));var moment=require(_0x2659('0x2'));function getSeconds(_0x58ecba,_0x1bbf17){var _0x5eff86=moment(_0x58ecba)[_0x2659('0x3')](0x0);var _0x48cbf4=moment(_0x1bbf17)[_0x2659('0x3')](0x0);return _0x5eff86[_0x2659('0x4')](_0x48cbf4,'seconds');}function QueueCallerAbandon(_0xcc8557,_0x5f5dbf){this[_0x2659('0x5')]=_0xcc8557[_0x2659('0x5')];this['type']=_0xcc8557['type'];this[_0x2659('0x6')]=_0xcc8557[_0x2659('0x7')]===_0x2659('0x8')?_0x2659('0x9'):_0xcc8557['type'];this['countbusyretry']=_0xcc8557[_0x2659('0xa')];this[_0x2659('0xb')]=_0xcc8557['countcongestionretry'];this['countnoanswerretry']=_0xcc8557[_0x2659('0xc')];this[_0x2659('0xd')]=_0xcc8557[_0x2659('0xa')]+_0xcc8557['countcongestionretry']+_0xcc8557[_0x2659('0xc')]+_0xcc8557[_0x2659('0xe')]+_0xcc8557[_0x2659('0xf')]+_0xcc8557[_0x2659('0x10')]+_0xcc8557['countmachineretry']+_0xcc8557[_0x2659('0x11')];this[_0x2659('0xe')]=_0xcc8557[_0x2659('0xe')];this[_0x2659('0xf')]=_0xcc8557[_0x2659('0xf')];this[_0x2659('0x10')]=_0xcc8557[_0x2659('0x10')];this[_0x2659('0x12')]=_0xcc8557['countmachineretry'];this[_0x2659('0x11')]=_0xcc8557[_0x2659('0x11')];this[_0x2659('0x13')]=_0x5f5dbf[_0x2659('0x13')];this[_0x2659('0x14')]=_0xcc8557[_0x2659('0x15')];this[_0x2659('0x16')]=_0xcc8557[_0x2659('0x17')];this[_0x2659('0x18')]=_0xcc8557[_0x2659('0x18')];this[_0x2659('0x19')]=_0xcc8557[_0x2659('0x19')];this['droptime']=_0xcc8557[_0x2659('0x1a')];this['endtime']=this[_0x2659('0x1a')];this['ringtime']=getSeconds(_0xcc8557[_0x2659('0x19')],_0xcc8557[_0x2659('0x18')]);this[_0x2659('0x1b')]=getSeconds(this['droptime'],_0xcc8557[_0x2659('0x19')]);this[_0x2659('0x1c')]=0x0;this[_0x2659('0x9')]=_0x5f5dbf['queue'];this['membername']=_0x5f5dbf[_0x2659('0x1d')];this[_0x2659('0x1e')]=_0x5f5dbf[_0x2659('0x1e')];this[_0x2659('0x1f')]=_0xcc8557[_0x2659('0x1f')];this[_0x2659('0x20')]=_0xcc8557[_0x2659('0x20')];this[_0x2659('0x21')]=_0xcc8557[_0x2659('0x21')];this[_0x2659('0x22')]=_0xcc8557[_0x2659('0x22')];this['ContactId']=_0xcc8557[_0x2659('0x23')];this['ListId']=_0xcc8557['ListId'];this[_0x2659('0x24')]=_0xcc8557[_0x2659('0x24')];this[_0x2659('0x25')]=_0xcc8557['VoiceQueueId'];this[_0x2659('0x26')]=_0xcc8557[_0x2659('0x26')];this[_0x2659('0x27')]=_0xcc8557['originatecalleridnum']||'';this[_0x2659('0x28')]=_0xcc8557[_0x2659('0x28')]||'';}module[_0x2659('0x29')]=QueueCallerAbandon; \ No newline at end of file +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 diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 3c380b0..31198cc 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(_0x524099,_0x2a091d){var _0x59b437=function(_0x55afe8){while(--_0x55afe8){_0x524099['push'](_0x524099['shift']());}};_0x59b437(++_0x2a091d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'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(_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 diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 2e1b5f2..a5afacc 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 _0xdd4f=['Is\x20Valid','exports','util','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','parse','application/pdf','then','notify','.pdf','error','\x20notify\x20','stringify','catch','\x20receiveFax\x20','merge','pick','reason','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','actions','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','message','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','Trunk','Trunk\x20Reachable','format','%s/%s.tif','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','isNil','active','SIP/%s','reachable','unmonitored','checkTrunk','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path'];(function(_0x13119f,_0x220692){var _0x3f9efd=function(_0x5e49b1){while(--_0x5e49b1){_0x13119f['push'](_0x13119f['shift']());}};_0x3f9efd(++_0x220692);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x52700f,_0x152e8b){_0x52700f=_0x52700f-0x0;var _0x4a9189=_0xdd4f[_0x52700f];return _0x4a9189;};'use strict';var util=require(_0xfdd4('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0xfdd4('0x1'));var path=require(_0xfdd4('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xfdd4('0x3'));var logger=require(_0xfdd4('0x4'))(_0xfdd4('0x5'));var ami=require('../ami');var rpcDb=require(_0xfdd4('0x6'));var Channel=require(_0xfdd4('0x7'));var ut=require(_0xfdd4('0x8'));var Action=require(_0xfdd4('0x9'));var faxAccount=require(_0xfdd4('0xa'));var attachment=require('../rpc/attachment');var faxMessage=require(_0xfdd4('0xb'));function Fax(_0x563ae6){this[_0xfdd4('0xc')]={};this[_0xfdd4('0xd')]=_0x563ae6[_0xfdd4('0xd')];this['trunks']=_0x563ae6[_0xfdd4('0xe')];this['actions']={};ami['on'](_0xfdd4('0xf'),this[_0xfdd4('0x10')][_0xfdd4('0x11')](this));ami['on'](_0xfdd4('0x12'),this[_0xfdd4('0x13')][_0xfdd4('0x11')](this));ami['on'](_0xfdd4('0x14'),this[_0xfdd4('0x15')][_0xfdd4('0x11')](this));ami['on'](_0xfdd4('0x16'),this[_0xfdd4('0x17')]['bind'](this));ami['on'](_0xfdd4('0x18'),this[_0xfdd4('0x19')][_0xfdd4('0x11')](this));ami['on']('receivefax',this[_0xfdd4('0x1a')]['bind'](this));ami['on'](_0xfdd4('0x1b'),this[_0xfdd4('0x1c')][_0xfdd4('0x11')](this));ami['on'](_0xfdd4('0x1d'),this[_0xfdd4('0x1e')]['bind'](this));}Fax['prototype']['syncNewchannel']=function(_0x3a966d){if(_0x3a966d[_0xfdd4('0x1f')]===_0xfdd4('0x20')){for(var _0x2ccc88 in this[_0xfdd4('0xd')]){if(this[_0xfdd4('0xd')][_0xfdd4('0x21')](_0x2ccc88)){if(_0x3a966d[_0xfdd4('0x22')]===this[_0xfdd4('0xd')][_0x2ccc88]['localstationid']){this[_0xfdd4('0xc')][_0x3a966d[_0xfdd4('0x23')]]={};this[_0xfdd4('0xc')][_0x3a966d[_0xfdd4('0x23')]][_0xfdd4('0x24')]=_0x3a966d[_0xfdd4('0x24')];this[_0xfdd4('0xc')][_0x3a966d[_0xfdd4('0x23')]]['id']=this['faxAccounts'][_0x2ccc88]['id'];this[_0xfdd4('0xc')][_0x3a966d[_0xfdd4('0x23')]][_0xfdd4('0x25')]=this[_0xfdd4('0xd')][_0x2ccc88][_0xfdd4('0x25')];logger[_0xfdd4('0x26')](_0x3a966d[_0xfdd4('0x23')],_0xfdd4('0x27'));}}}}if(this['actions'][_0x3a966d[_0xfdd4('0x23')]]){this[_0xfdd4('0xc')][_0x3a966d[_0xfdd4('0x23')]]={};this['channels'][_0x3a966d[_0xfdd4('0x23')]][_0xfdd4('0x24')]=_0x3a966d[_0xfdd4('0x24')];logger[_0xfdd4('0x26')](_0x3a966d[_0xfdd4('0x23')],'\x20syncNewchannel\x20');}};Fax[_0xfdd4('0x28')][_0xfdd4('0x13')]=function(_0x3cd2c9){if(this[_0xfdd4('0xc')][_0x3cd2c9[_0xfdd4('0x23')]]){for(var _0x192471 in _0x3cd2c9[_0xfdd4('0x29')]){if(_0x3cd2c9[_0xfdd4('0x29')]['hasOwnProperty'](_0x192471)){this[_0xfdd4('0xc')][_0x3cd2c9[_0xfdd4('0x23')]][_0x192471]=_0x3cd2c9[_0xfdd4('0x2a')];}}}};Fax[_0xfdd4('0x28')][_0xfdd4('0x15')]=function(_0x4a36a2){if(this[_0xfdd4('0xc')][_0x4a36a2[_0xfdd4('0x23')]]){this[_0xfdd4('0xc')][_0x4a36a2[_0xfdd4('0x23')]][_0xfdd4('0x2b')]=_0x4a36a2['channelstate'];this[_0xfdd4('0xc')][_0x4a36a2[_0xfdd4('0x23')]][_0xfdd4('0x2c')]=_0x4a36a2['channelstatedesc'];}};Fax[_0xfdd4('0x28')]['syncNewExten']=function(_0x2a65c8){if(this[_0xfdd4('0xc')][_0x2a65c8['uniqueid']]){for(var _0x50b748 in _0x2a65c8[_0xfdd4('0x29')]){if(_0x2a65c8[_0xfdd4('0x29')]['hasOwnProperty'](_0x50b748)){this['channels'][_0x2a65c8[_0xfdd4('0x23')]][_0x50b748]=_0x2a65c8[_0xfdd4('0x2a')];}}}};Fax[_0xfdd4('0x28')][_0xfdd4('0x19')]=function(_0x3247f4){if(this[_0xfdd4('0xc')][_0x3247f4[_0xfdd4('0x23')]]){this[_0xfdd4('0xc')][_0x3247f4[_0xfdd4('0x23')]][_0xfdd4('0x2d')]=_0x3247f4[_0xfdd4('0x2d')];this[_0xfdd4('0xc')][_0x3247f4[_0xfdd4('0x23')]][_0xfdd4('0x2e')]=_0x3247f4[_0xfdd4('0x2e')];this[_0xfdd4('0xc')][_0x3247f4[_0xfdd4('0x23')]][_0xfdd4('0x2f')]=_0x3247f4[_0xfdd4('0x2f')];this[_0xfdd4('0xc')][_0x3247f4[_0xfdd4('0x23')]][_0xfdd4('0x30')]=_0x3247f4[_0xfdd4('0x30')];logger[_0xfdd4('0x26')](_0x3247f4[_0xfdd4('0x23')],_0xfdd4('0x31'));}};Fax['prototype'][_0xfdd4('0x1a')]=function(_0x3716da){var _0x42dc1a=this;if(this[_0xfdd4('0xc')][_0x3716da[_0xfdd4('0x23')]]){var _0x5842f1=this['channels'][_0x3716da[_0xfdd4('0x23')]]['id'];this['channels'][_0x3716da[_0xfdd4('0x23')]][_0xfdd4('0x32')]=_0x3716da[_0xfdd4('0x32')];this[_0xfdd4('0xc')][_0x3716da['uniqueid']][_0xfdd4('0x33')]=_0x3716da[_0xfdd4('0x33')];this[_0xfdd4('0xc')][_0x3716da[_0xfdd4('0x23')]][_0xfdd4('0x2f')]=_0x3716da[_0xfdd4('0x2f')];this[_0xfdd4('0xc')][_0x3716da[_0xfdd4('0x23')]][_0xfdd4('0x34')]=_0x3716da[_0xfdd4('0x34')];this['channels'][_0x3716da[_0xfdd4('0x23')]][_0xfdd4('0x35')]=_0x3716da[_0xfdd4('0x35')];this[_0xfdd4('0xc')][_0x3716da['uniqueid']][_0xfdd4('0x30')]=_0x3716da[_0xfdd4('0x30')];this[_0xfdd4('0xc')][_0x3716da[_0xfdd4('0x23')]][_0xfdd4('0x36')]=_0x3716da['calleridnum'];if(this[_0xfdd4('0xc')][_0x3716da[_0xfdd4('0x23')]][_0xfdd4('0x33')]>0x0){tiff2pdf(_0x3716da[_0xfdd4('0x30')],_0xfdd4('0x37'),function(_0x1fc778){logger[_0xfdd4('0x26')](_0x3716da['uniqueid'],_0xfdd4('0x38'),_0x1fc778['message']);attachment[_0xfdd4('0x39')]({'name':path[_0xfdd4('0x3a')](_0x3716da[_0xfdd4('0x30')])[_0xfdd4('0x25')],'basename':path['parse'](_0x3716da[_0xfdd4('0x30')])[_0xfdd4('0x25')]+'.pdf','type':_0xfdd4('0x3b')})[_0xfdd4('0x3c')](function(_0x48d422){faxAccount[_0xfdd4('0x3d')](_0x5842f1,{'from':_0x3716da['calleridnum'],'mapKey':'fax','body':path['parse'](_0x3716da[_0xfdd4('0x30')])[_0xfdd4('0x25')]+_0xfdd4('0x3e'),'AttachmentId':_0x48d422['id']})['catch'](function(_0x393029){logger[_0xfdd4('0x3f')](_0x3716da['uniqueid'],_0xfdd4('0x40'),JSON[_0xfdd4('0x41')](_0x393029));});})[_0xfdd4('0x42')](function(_0x2bb94a){logger[_0xfdd4('0x3f')](_0x3716da[_0xfdd4('0x23')],_0xfdd4('0x43'),JSON[_0xfdd4('0x41')](_0x2bb94a));});});}logger[_0xfdd4('0x26')](_0x3716da[_0xfdd4('0x23')],_0xfdd4('0x43'));}};Fax[_0xfdd4('0x28')][_0xfdd4('0x1e')]=function(_0x3c0ee1){if(this['actions'][_0x3c0ee1['uniqueid']]){_[_0xfdd4('0x44')](this[_0xfdd4('0xc')][_0x3c0ee1[_0xfdd4('0x23')]],_[_0xfdd4('0x45')](_0x3c0ee1,['response',_0xfdd4('0x46')]));}};function updateStatus(_0x30c709){if(_0x30c709['AttachmentId']){faxMessage['update'](_0x30c709['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x12dfb2){ut[_0xfdd4('0x47')](_0xfdd4('0x48'),_0x12dfb2);})[_0xfdd4('0x42')](function(_0x35c032){ut[_0xfdd4('0x47')]('[Fax][Message][Error][NoUpdate1]',_0x35c032);});}else{ut[_0xfdd4('0x47')](_0xfdd4('0x49'));}}Fax[_0xfdd4('0x28')][_0xfdd4('0x4a')]=function(_0x4e790d,_0x375adf,_0x8aa0ea){var _0x4addd6=this;var _0x3e3916={};if(_0x375adf){_0x3e3916={'read':_0x375adf};}else{_0x3e3916={'failMessage':_0x8aa0ea};}if(this[_0xfdd4('0x4b')][_0x4e790d]['AttachmentId']){faxMessage['update'](this[_0xfdd4('0x4b')][_0x4e790d][_0xfdd4('0x4c')],_0x3e3916)[_0xfdd4('0x3c')](function(_0x30ce95){ut[_0xfdd4('0x47')](_0xfdd4('0x4d'),_0x30ce95);})[_0xfdd4('0x42')](function(_0x3de4fd){ut['logger'](_0xfdd4('0x4e'),_0x3de4fd);})['finally'](function(){delete _0x4addd6['channels'][_0x4e790d];delete _0x4addd6[_0xfdd4('0x4b')][_0x4e790d];});}else{ut[_0xfdd4('0x47')]('[Fax][Message][NoUpdate2]');delete this['channels'][_0x4e790d];delete this['actions'][_0x4e790d];}};Fax[_0xfdd4('0x28')][_0xfdd4('0x1c')]=function(_0x4dc113){var _0x86d021=this;if(this[_0xfdd4('0xc')][_0x4dc113[_0xfdd4('0x23')]]){if(this[_0xfdd4('0x4b')][_0x4dc113[_0xfdd4('0x23')]]){this['channels'][_0x4dc113['uniqueid']]['id']=this['actions'][_0x4dc113['uniqueid']]['id'];this[_0xfdd4('0xc')][_0x4dc113[_0xfdd4('0x23')]]['name']=this[_0xfdd4('0x4b')][_0x4dc113[_0xfdd4('0x23')]]['name'];}logger[_0xfdd4('0x26')](_0x4dc113[_0xfdd4('0x23')],this['actions'][_0x4dc113[_0xfdd4('0x23')]]?_0xfdd4('0x4f'):_0xfdd4('0x50'),JSON['stringify'](this[_0xfdd4('0xc')][_0x4dc113[_0xfdd4('0x23')]]));if(this[_0xfdd4('0x4b')][_0x4dc113[_0xfdd4('0x23')]]){if(this[_0xfdd4('0xc')][_0x4dc113['uniqueid']][_0xfdd4('0x51')]>0x0&&this[_0xfdd4('0xc')][_0x4dc113[_0xfdd4('0x23')]][_0xfdd4('0x18')]===_0xfdd4('0x52')){this[_0xfdd4('0x4a')](_0x4dc113[_0xfdd4('0x23')],!![]);}else{this[_0xfdd4('0x4a')](_0x4dc113[_0xfdd4('0x23')],![],this['channels'][_0x4dc113[_0xfdd4('0x23')]][_0xfdd4('0x53')]?_0xfdd4('0x54')+this[_0xfdd4('0xc')][_0x4dc113[_0xfdd4('0x23')]]['faxstatusstring']:_0xfdd4('0x55'));}}}};Fax[_0xfdd4('0x28')][_0xfdd4('0x56')]=function(_0x12e917){var _0x383175=this;return new BPromise(function(_0x2be970,_0x180ad9){_0x383175[_0xfdd4('0x57')](_0x12e917,_0x383175[_0xfdd4('0xd')][_0x12e917[_0xfdd4('0x58')]])[_0xfdd4('0x3c')](function(_0x2792c4){ut[_0xfdd4('0x47')]('[Fax][execOriginate][success]',_0x2792c4);_0x2be970(ut[_0xfdd4('0x59')]('Fax\x20received'));})[_0xfdd4('0x42')](function(_0x158a1d){ut[_0xfdd4('0x47')](_0xfdd4('0x5a'),_0x158a1d);updateStatus(_0x12e917);_0x180ad9(ut[_0xfdd4('0x59')](_0xfdd4('0x5b')));});});};Fax[_0xfdd4('0x28')][_0xfdd4('0x5c')]=function(_0x302b2f){var _0x25f01e=this;return new BPromise(function(_0x5e8d95,_0x207a4c){var _0x50e984=_0x25f01e['checkTrunk'](_0x25f01e['faxAccounts'][_0x302b2f[_0xfdd4('0x58')]][_0xfdd4('0x5d')],_0x302b2f);if(_0x50e984['isValid']){_0x5e8d95(ut[_0xfdd4('0x59')](_0xfdd4('0x5e')));}else{_0x207a4c(ut[_0xfdd4('0x59')](_0x50e984[_0xfdd4('0x59')]));}});};function originate(_0x2a3554,_0x4b14bf,_0x150537){return new BPromise(function(_0x297432,_0x3958cd){if(_0x150537){var _0x523085=util[_0xfdd4('0x5f')]('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[_0xfdd4('0x3a')](_0x2a3554[_0xfdd4('0x2')])[_0xfdd4('0x25')],_0x2a3554[_0xfdd4('0x2')]);gs['execute'](_0x523085)[_0xfdd4('0x3c')](function(){_0x2a3554[_0xfdd4('0x2')]=util['format'](_0xfdd4('0x60'),path[_0xfdd4('0x3a')](_0x2a3554[_0xfdd4('0x2')])['dir'],path[_0xfdd4('0x3a')](_0x2a3554[_0xfdd4('0x2')])[_0xfdd4('0x25')]);_0x4b14bf['XMF-PATH']=_0x2a3554[_0xfdd4('0x2')];ut[_0xfdd4('0x47')](_0xfdd4('0x61'),'');ami[_0xfdd4('0x62')](ut[_0xfdd4('0x63')](_0x2a3554,_0x4b14bf))[_0xfdd4('0x3c')](function(_0x185226){_0x297432(_0x185226);})['catch'](function(_0x147d54){_0x3958cd(_0x147d54);});})[_0xfdd4('0x42')](function(_0xab101d){_0x3958cd(_0xab101d);});}else{ami[_0xfdd4('0x62')](ut[_0xfdd4('0x63')](_0x2a3554,_0x4b14bf))[_0xfdd4('0x3c')](function(_0x39af1e){_0x297432(_0x39af1e);})[_0xfdd4('0x42')](function(_0x58dee0){_0x3958cd(_0x58dee0);});}});}Fax[_0xfdd4('0x28')]['execOriginate']=function(_0x4d9440,_0x40b2e8){var _0x5e8563=this;return new BPromise(function(_0xa0cb11,_0x51711a){var _0x4576ce=uuid['v4']();var _0x32f621=ut[_0xfdd4('0x64')](_0x4d9440,_0x40b2e8);_0x5e8563[_0xfdd4('0x4b')][_0x4576ce]=new Action(_0x4576ce,_0x40b2e8,_0x4d9440);var _0x4e4c7a=_0x5e8563[_0xfdd4('0x4b')][_0x4576ce];if(path[_0xfdd4('0x3a')](_0x4d9440['path'])['ext']===_0xfdd4('0x3e')){originate(_0x4e4c7a,_0x32f621,!![])['then'](function(_0x26c2be){_0xa0cb11(_0x26c2be);})[_0xfdd4('0x42')](function(_0x3b205f){_0x51711a(_0x3b205f);});}else{originate(_0x4e4c7a,_0x32f621,![])[_0xfdd4('0x3c')](function(_0x243848){_0xa0cb11(_0x243848);})[_0xfdd4('0x42')](function(_0x246772){_0x51711a(_0x246772);});}});};Fax['prototype']['isTrunkReachable']=function(_0x37a342){return!_[_0xfdd4('0x65')](_0x37a342)&&!_[_0xfdd4('0x65')](_0x37a342[_0xfdd4('0x25')])&&!_[_0xfdd4('0x65')](_0x37a342[_0xfdd4('0x66')])&&_0x37a342[_0xfdd4('0x66')]&&!_[_0xfdd4('0x65')](this[_0xfdd4('0xe')][util[_0xfdd4('0x5f')](_0xfdd4('0x67'),_0x37a342[_0xfdd4('0x25')])])&&!_[_0xfdd4('0x65')](this['trunks'][util['format'](_0xfdd4('0x67'),_0x37a342[_0xfdd4('0x25')])]['status'])&&(this['trunks'][util[_0xfdd4('0x5f')](_0xfdd4('0x67'),_0x37a342['name'])][_0xfdd4('0x2e')]===_0xfdd4('0x68')||this[_0xfdd4('0xe')][util[_0xfdd4('0x5f')](_0xfdd4('0x67'),_0x37a342[_0xfdd4('0x25')])]['status']===_0xfdd4('0x69'));};Fax[_0xfdd4('0x28')][_0xfdd4('0x6a')]=function(_0x2f8001,_0x2591de){if(!this[_0xfdd4('0x6b')](_0x2f8001)){ut[_0xfdd4('0x47')](_0xfdd4('0x6c'),_['isNil'](_0x2f8001)?'':_0x2f8001['name']+_0xfdd4('0x6d'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xfdd4('0x65')](_0x2591de[_0xfdd4('0x5')])){ut[_0xfdd4('0x47')](_0xfdd4('0x6e'),JSON[_0xfdd4('0x41')](_0x2591de));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x2591de[_0xfdd4('0x2')])){ut['logger'](_0xfdd4('0x6f'),JSON['stringify'](_0x2591de));return{'isValid':![],'message':_0xfdd4('0x70')};}return{'isValid':!![],'message':_0xfdd4('0x71')};};module[_0xfdd4('0x72')]=Fax; \ No newline at end of file +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 diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index eb620bf..53c9d71 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 _0xd7e4=['resolve','then','notify','catch','[Notify]\x20','util','bluebird','lodash','inspect'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xd7e4,0x176));var _0x4d7e=function(_0x3e5364,_0x4ccf59){_0x3e5364=_0x3e5364-0x0;var _0x285675=_0xd7e4[_0x3e5364];return _0x285675;};'use strict';var util=require(_0x4d7e('0x0'));var BPromise=require(_0x4d7e('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x4d7e('0x2'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x190707){return function(_0x208afd){logger['error'](_0x190707,util[_0x4d7e('0x3')](_0x208afd,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x2854fe,_0x47eb8b){return BPromise[_0x4d7e('0x4')]()[_0x4d7e('0x5')](faxAccount[_0x4d7e('0x6')](_0x2854fe,_0x47eb8b))[_0x4d7e('0x7')](loggerCatch(_0x4d7e('0x8')));}; \ No newline at end of file +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 diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 2a1f6de..a3ae7e0 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 _0x46f2=['inspect','util','bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:'];(function(_0x21f035,_0xee30e){var _0x55de4d=function(_0x4147f4){while(--_0x4147f4){_0x21f035['push'](_0x21f035['shift']());}};_0x55de4d(++_0xee30e);}(_0x46f2,0x129));var _0x246f=function(_0x1c9235,_0xd2a505){_0x1c9235=_0x1c9235-0x0;var _0xb6f8ea=_0x46f2[_0x1c9235];return _0xb6f8ea;};'use strict';var util=require(_0x246f('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x246f('0x1'));var exec=require(_0x246f('0x2'))[_0x246f('0x3')];exports['execute']=function(_0x1be12d){return new BPromise(function(_0x331d03,_0x299e81){exec(_0x1be12d,function(_0x1877c5,_0x3bb883,_0x2c3077){logger[_0x246f('0x4')](_0x246f('0x5'),_0x3bb883);if(_0x1877c5){logger[_0x246f('0x4')](_0x246f('0x5'),_0x246f('0x6'),util[_0x246f('0x7')](_0x1877c5,{'showHidden':![],'depth':null}),_0x3bb883,_0x2c3077);_0x299e81(_0x1877c5);}_0x331d03(_0x3bb883);});});}; \ No newline at end of file +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 diff --git a/server/services/ami/fax/util/util.js b/server/services/ami/fax/util/util.js index a8616a7..0b7fe71 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 _0x19bf=['headerinfo','minrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','uniqueid','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','moment','fax','logger','inspect','addVariables'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x19bf,0x19e));var _0xf19b=function(_0x5b0ca7,_0x92ef47){_0x5b0ca7=_0x5b0ca7-0x0;var _0x5c9db8=_0x19bf[_0x5b0ca7];return _0x5c9db8;};'use strict';var util=require(_0xf19b('0x0'));var _=require('lodash');var moment=require(_0xf19b('0x1'));var logger=require('../../../../config/logger')(_0xf19b('0x2'));exports['message']=function(_0x52723f){return{'message':_0x52723f};};exports[_0xf19b('0x3')]=function(_0x24a233,_0x5c5c2f){logger['info'](_0x24a233,util[_0xf19b('0x4')](_0x5c5c2f,{'showHidden':![],'depth':null}));};exports[_0xf19b('0x5')]=function(_0x52e5ed,_0x5523af){var _0x508c18={'XMF-ECM':_0x5523af['ecm'],'XMF-HEADERINFO':_0x5523af[_0xf19b('0x6')],'XMF-MINRATE':_0x5523af[_0xf19b('0x7')],'XMF-MAXRATE':_0x5523af['maxrate'],'XMF-MODEM':util[_0xf19b('0x8')](_0xf19b('0x9'),_0x5523af[_0xf19b('0xa')]),'XMF-GATEWAY':_0x5523af[_0xf19b('0xb')],'XMF-FAXDETECT':_0x5523af[_0xf19b('0xc')],'XMF-T38TIMEOUT':_0x5523af[_0xf19b('0xd')],'XMF-LOCALSTATIONID':_0x5523af[_0xf19b('0xe')],'XMF-PATH':_0x52e5ed['path']};return _0x508c18;};exports['variablesAction']=function(_0x5c53d7,_0xeee0d0){return{'actionid':_0x5c53d7[_0xf19b('0xf')],'action':'originate','channel':_0x5c53d7[_0xf19b('0x10')],'Exten':_0xf19b('0x11'),'Context':_0xf19b('0x12'),'Priority':'1','callerid':util[_0xf19b('0x8')](_0xf19b('0x13'),_0x5c53d7[_0xf19b('0x6')]?_0x5c53d7[_0xf19b('0x6')]:'',_0x5c53d7['localstationid']),'variable':_0xeee0d0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5c53d7[_0xf19b('0xf')]};}; \ No newline at end of file +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 diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 90b39b7..41bb404 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 _0x89d0=['./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initDynamics365Accounts','initVoiceExtensions','getFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','[index.js][main]','bluebird','util','moment','./server','./realtime','./report','./acw','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension'];(function(_0x4e7245,_0xae3d21){var _0x535a1b=function(_0x1b0a1a){while(--_0x1b0a1a){_0x4e7245['push'](_0x4e7245['shift']());}};_0x535a1b(++_0xae3d21);}(_0x89d0,0xf6));var _0x089d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89d0[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x089d('0x0'));var util=require(_0x089d('0x1'));var moment=require(_0x089d('0x2'));var server=require(_0x089d('0x3'));var Realtime=require(_0x089d('0x4'));var Report=require(_0x089d('0x5'));var Acw=require(_0x089d('0x6'));var Trigger=require('./trigger');var Dialer=require(_0x089d('0x7'));var Preview=require(_0x089d('0x8'));var Fax=require(_0x089d('0x9'));var user=require(_0x089d('0xa'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x089d('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x089d('0xc'));var trigger=require(_0x089d('0xd'));var template=require(_0x089d('0xe'));var cmHopperHistory=require(_0x089d('0xf'));var campaign=require(_0x089d('0x10'));var voiceExtension=require(_0x089d('0x11'));var faxAccount=require(_0x089d('0x12'));var zendesk=require(_0x089d('0x13'));var salesforce=require(_0x089d('0x14'));var sugarcrm=require(_0x089d('0x15'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require('./rpc/integrations/desk');var zoho=require(_0x089d('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x089d('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x089d('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x089d('0x19'))(_0x089d('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x089d('0x1b')](_0x089d('0x1c'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get']('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x089d('0x1d')]()[_0x089d('0x1e')](user[_0x089d('0x1f')]())[_0x089d('0x1e')](realtime[_0x089d('0x20')]())[_0x089d('0x1e')](user[_0x089d('0x21')]())[_0x089d('0x1e')](realtime[_0x089d('0x22')]())[_0x089d('0x1e')](trunk[_0x089d('0x23')]())[_0x089d('0x1e')](realtime[_0x089d('0x24')]())[_0x089d('0x1e')](voiceQueue[_0x089d('0x25')]())['then'](realtime[_0x089d('0x26')]())[_0x089d('0x1e')](trigger[_0x089d('0x27')]())[_0x089d('0x1e')](realtime[_0x089d('0x28')]())['then'](template['getTemplates']())[_0x089d('0x1e')](realtime[_0x089d('0x29')]())['then'](zendesk['getZendeskAccounts']())['then'](realtime[_0x089d('0x2a')]())[_0x089d('0x1e')](salesforce[_0x089d('0x2b')]())[_0x089d('0x1e')](realtime[_0x089d('0x2c')]())[_0x089d('0x1e')](sugarcrm['getSugarcrmAccounts']())[_0x089d('0x1e')](realtime[_0x089d('0x2d')]())[_0x089d('0x1e')](freshdesk[_0x089d('0x2e')]())[_0x089d('0x1e')](realtime[_0x089d('0x2f')]())[_0x089d('0x1e')](desk[_0x089d('0x30')]())[_0x089d('0x1e')](realtime['initDeskAccounts']())[_0x089d('0x1e')](zoho['getZohoAccounts']())[_0x089d('0x1e')](realtime[_0x089d('0x31')]())[_0x089d('0x1e')](vtiger['getVtigerAccounts']())[_0x089d('0x1e')](realtime['initVtigerAccounts']())[_0x089d('0x1e')](freshsales[_0x089d('0x32')]())[_0x089d('0x1e')](realtime[_0x089d('0x33')]())[_0x089d('0x1e')](servicenow[_0x089d('0x34')]())[_0x089d('0x1e')](realtime['initServicenowAccounts']())[_0x089d('0x1e')](dynamics365['getDynamics365Accounts']())[_0x089d('0x1e')](realtime[_0x089d('0x35')]())[_0x089d('0x1e')](campaign['getCampaigns']())['then'](realtime['initCampaigns']())['then'](voiceExtension['getVoiceExtensions']())[_0x089d('0x1e')](realtime[_0x089d('0x36')]())[_0x089d('0x1e')](faxAccount[_0x089d('0x37')]())[_0x089d('0x1e')](realtime['initFaxAccounts']())[_0x089d('0x1e')](function(){return realtime;});}function initParams(){return BPromise[_0x089d('0x1d')]()['then'](voiceQueueReport[_0x089d('0x38')]())[_0x089d('0x1e')](realtime[_0x089d('0x39')]())[_0x089d('0x1e')](cmHopperHistory[_0x089d('0x3a')]())[_0x089d('0x1e')](realtime[_0x089d('0x3b')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0x089d('0x1e')](realtime['initCampaignHopperHistory']())[_0x089d('0x1e')](voiceCallReport[_0x089d('0x3c')]())[_0x089d('0x1e')](realtime['initVoiceCallReports']())[_0x089d('0x3d')](function(_0x56fa63){logger[_0x089d('0x3e')](_0x089d('0x3f'),util[_0x089d('0x40')](_0x56fa63,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x59c452){return initRealtime();})[_0x089d('0x1e')](function(){return initParams();})[_0x089d('0x1e')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0x089d('0x3d')](function(_0x1a1ba7){logger[_0x089d('0x3e')](_0x089d('0x41'),util[_0x089d('0x40')](_0x1a1ba7,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +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 diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 931d0af..dedf99d 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 _0xedd9=['phone','mobile','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','state','toLowerCase','idle','inuse','talking','statePause','toNumber','interface','format','user:%s','user:save','emit','user:presence','exports','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','status'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xedd9,0xfc));var _0x9edd=function(_0x459c95,_0x27bf68){_0x459c95=_0x459c95-0x0;var _0x51e71b=_0xedd9[_0x459c95];return _0x51e71b;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));config[_0x9edd('0x5')]=_[_0x9edd('0x6')](config[_0x9edd('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x9edd('0x7'))(new Redis(config[_0x9edd('0x5')]));function Agent(_0x268f9e){this['id']=_0x268f9e['id']||0x0;this[_0x9edd('0x8')]=_0x268f9e['name']||'';this[_0x9edd('0x9')]=_0x268f9e['email']||'';this[_0x9edd('0xa')]=_0x268f9e[_0x9edd('0xa')]||'';this[_0x9edd('0xb')]=_0x268f9e[_0x9edd('0xb')]||'';this['state']=_0x9edd('0xc');this['stateTime']=0x0;this[_0x9edd('0xd')]=_0x9edd('0xc');this['address']='';this[_0x9edd('0xe')]='';this[_0x9edd('0xf')]='';this['interface']='';this[_0x9edd('0x10')]=_0x268f9e[_0x9edd('0x10')]||![];this[_0x9edd('0x11')]=_0x9edd('0xc');this[_0x9edd('0x12')]=0x0;this[_0x9edd('0x13')]='';this[_0x9edd('0x14')]='';this[_0x9edd('0x15')]=![];this['local']=![];this[_0x9edd('0x2')]='';}Agent[_0x9edd('0x16')][_0x9edd('0x17')]=function(_0x4d9a7){var _0x13b6b6;if(_0x4d9a7&&_0x4d9a7[_0x9edd('0x18')]){_0x13b6b6=_0x4d9a7[_0x9edd('0x18')][_0x9edd('0x19')]();switch(_0x13b6b6){case'not_inuse':_0x13b6b6=_0x9edd('0x1a');break;case _0x9edd('0x1b'):_0x13b6b6=_0x9edd('0x1c');break;}}if(_0x13b6b6&&this['voiceStatus']!==_0x13b6b6||_0x4d9a7[_0x9edd('0x1d')]){this[_0x9edd('0x12')]=_[_0x9edd('0x1e')](moment()['format']('x'));}if(_0x13b6b6){this[_0x9edd('0x11')]=_0x13b6b6;}var _0x5d879c={'id':this['id'],'name':this[_0x9edd('0x8')],'email':this[_0x9edd('0x9')],'accountcode':this['accountcode'],'fullname':this['fullname'],'state':this[_0x9edd('0x18')],'stateTime':this['stateTime'],'status':this[_0x9edd('0xd')],'address':this['address'],'online':this['online'],'voiceStatus':this[_0x9edd('0x11')],'voiceStatusTime':this[_0x9edd('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x9edd('0x1f')],'onhold':this[_0x9edd('0x15')]};var _0x477878=md5(JSON['stringify'](_0x5d879c));if(this[_0x9edd('0x2')]!==_0x477878){this[_0x9edd('0x2')]=_0x477878;io['to'](util[_0x9edd('0x20')](_0x9edd('0x21'),_0x5d879c[_0x9edd('0x8')]))['emit'](_0x9edd('0x22'),_0x5d879c);io[_0x9edd('0x23')](_0x9edd('0x24'),_0x5d879c);}};module[_0x9edd('0x25')]=Agent; \ No newline at end of file +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 diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 030ded3..9848ce8 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 _0x2868=['Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup'];(function(_0x34c063,_0x11d3d7){var _0x2c63a3=function(_0x5983d0){while(--_0x5983d0){_0x34c063['push'](_0x34c063['shift']());}};_0x2c63a3(++_0x11d3d7);}(_0x2868,0x140));var _0x8286=function(_0x5a5059,_0x43b452){_0x5a5059=_0x5a5059-0x0;var _0x4ecb66=_0x2868[_0x5a5059];return _0x4ecb66;};'use strict';function Campaign(_0x17a33f){this['id']=_0x17a33f['id']||0x0;this[_0x8286('0x0')]=_0x17a33f[_0x8286('0x0')]||'';this['type']=_0x17a33f['type']||_0x8286('0x1');this[_0x8286('0x2')]=0x0;this['temp']=0x0;this[_0x8286('0x3')]=0x0;this[_0x8286('0x4')]=0x0;this[_0x8286('0x5')]='';this[_0x8286('0x6')]=!![];this[_0x8286('0x7')]=_0x17a33f[_0x8286('0x7')];this[_0x8286('0x8')]=_0x17a33f[_0x8286('0x8')];this[_0x8286('0x9')]=_0x17a33f[_0x8286('0x9')]||null;this[_0x8286('0xa')]=_0x17a33f[_0x8286('0xa')]?_0x17a33f['dialGlobalInterval']:null;this[_0x8286('0xb')]=_0x17a33f[_0x8286('0xb')];this[_0x8286('0xc')]=_0x17a33f[_0x8286('0xc')];this['dialOriginateTimeout']=_0x17a33f[_0x8286('0xd')]||0x1e;this[_0x8286('0xe')]=_0x17a33f[_0x8286('0xe')];this[_0x8286('0xf')]=_0x17a33f[_0x8286('0xf')];this[_0x8286('0x10')]=_0x17a33f['dialBusyMaxRetry'];this[_0x8286('0x11')]=_0x17a33f[_0x8286('0x11')];this[_0x8286('0x12')]=_0x17a33f[_0x8286('0x12')];this[_0x8286('0x13')]=_0x17a33f[_0x8286('0x13')];this[_0x8286('0x14')]=_0x17a33f[_0x8286('0x14')];this[_0x8286('0x15')]=_0x17a33f['dialNoSuchNumberMaxRetry']||0x3;this[_0x8286('0x16')]=_0x17a33f[_0x8286('0x16')]||0x96;this[_0x8286('0x17')]=_0x17a33f[_0x8286('0x17')]||0x3;this[_0x8286('0x18')]=_0x17a33f['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x17a33f[_0x8286('0x19')]||0x3;this[_0x8286('0x1a')]=_0x17a33f[_0x8286('0x1a')]||0x96;this[_0x8286('0x1b')]=_0x17a33f[_0x8286('0x1b')]||0x3;this[_0x8286('0x1c')]=_0x17a33f[_0x8286('0x1c')]||0x96;this[_0x8286('0x1d')]=_0x17a33f[_0x8286('0x1d')]||0x3;this[_0x8286('0x1e')]=_0x17a33f['dialAgentRejectRetryFrequency']||0x96;this[_0x8286('0x1f')]=_0x17a33f[_0x8286('0x1f')]||_0x8286('0x20');this[_0x8286('0x21')]=_0x17a33f[_0x8286('0x21')]||undefined;this[_0x8286('0x22')]=_0x17a33f[_0x8286('0x22')]||undefined;this['dialCutDigit']=_0x17a33f[_0x8286('0x23')]||undefined;this['TrunkBackup']=_0x17a33f[_0x8286('0x24')]?_0x17a33f[_0x8286('0x24')]:undefined;this['Trunk']=_0x17a33f['Trunk']?_0x17a33f['Trunk']:undefined;this[_0x8286('0x25')]=_0x17a33f[_0x8286('0x25')]?_0x17a33f[_0x8286('0x25')]:undefined;this['SquareProject']=_0x17a33f[_0x8286('0x26')]?_0x17a33f[_0x8286('0x26')]:undefined;this[_0x8286('0x27')]=_0x17a33f[_0x8286('0x26')]?_0x17a33f[_0x8286('0x26')]['name']:undefined;this[_0x8286('0x28')]=_0x17a33f[_0x8286('0x28')]||![];this[_0x8286('0x29')]=_0x17a33f[_0x8286('0x29')];this[_0x8286('0x2a')]=_0x17a33f[_0x8286('0x2a')];this[_0x8286('0x2b')]=_0x17a33f['dialAMDAfterGreetingSilence'];this['dialAMDTotalAnalysisTime']=_0x17a33f[_0x8286('0x2c')];this[_0x8286('0x2d')]=_0x17a33f[_0x8286('0x2d')];this[_0x8286('0x2e')]=_0x17a33f['dialAMDBetweenWordsSilence'];this[_0x8286('0x2f')]=_0x17a33f[_0x8286('0x2f')];this[_0x8286('0x30')]=_0x17a33f[_0x8286('0x30')];this[_0x8286('0x31')]=_0x17a33f['dialAMDMaximumWordLength'];}module[_0x8286('0x32')]=Campaign; \ No newline at end of file +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 diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 83ff13e..5477fd1 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 _0x3c36=['context','linkedid','exten','unmanaged','lastapplication','duration','billableseconds','holdtime','type','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode'];(function(_0x434db2,_0x113541){var _0x4e9284=function(_0x5d59b4){while(--_0x5d59b4){_0x434db2['push'](_0x434db2['shift']());}};_0x4e9284(++_0x113541);}(_0x3c36,0x10c));var _0x63c3=function(_0x15450a,_0xa70176){_0x15450a=_0x15450a-0x0;var _0x2f4f6f=_0x3c36[_0x15450a];return _0x2f4f6f;};'use strict';function Channel(){this['starttime']=null;this['channel']='';this[_0x63c3('0x0')]='';this[_0x63c3('0x1')]=0x0;this[_0x63c3('0x2')]='';this['connectedlinenum']=undefined;this[_0x63c3('0x3')]=undefined;this[_0x63c3('0x4')]=0x0;this[_0x63c3('0x5')]='';this['uniqueid']=0x0;this[_0x63c3('0x6')]=0x0;this[_0x63c3('0x7')]=0x0;this['answered']=![];this['answertime']=null;this['endtime']=null;this[_0x63c3('0x8')]=![];this['abandoned']=![];this[_0x63c3('0x9')]='';this['lastdata']='';this[_0x63c3('0xa')]=0x0;this[_0x63c3('0xb')]=0x0;this[_0x63c3('0xc')]=0x0;this[_0x63c3('0xd')]=null;this['tag']=null;this[_0x63c3('0xe')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x63c3('0xf')]=null;this[_0x63c3('0x10')]=[];this[_0x63c3('0x11')]=undefined;this[_0x63c3('0x12')]=undefined;this[_0x63c3('0x13')]=undefined;this[_0x63c3('0x14')]=0x0;}module['exports']=Channel; \ No newline at end of file +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 diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index f0b9e29..02099e7 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 _0x009e=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0xbd2a3,_0x29f8c3){var _0x437157=function(_0x219ccc){while(--_0x219ccc){_0xbd2a3['push'](_0xbd2a3['shift']());}};_0x437157(++_0x29f8c3);}(_0x009e,0xac));var _0xe009=function(_0x53ccf6,_0x7ada48){_0x53ccf6=_0x53ccf6-0x0;var _0x15ca25=_0x009e[_0x53ccf6];return _0x15ca25;};'use strict';function DeskAccount(_0x5677e7){this['id']=_0x5677e7['id']||0x0;this[_0xe009('0x0')]=_0x5677e7[_0xe009('0x0')]||'';this['username']=_0x5677e7[_0xe009('0x1')]||'';this[_0xe009('0x2')]=_0x5677e7[_0xe009('0x2')]||'';this[_0xe009('0x3')]=_0x5677e7[_0xe009('0x3')]||'';this[_0xe009('0x4')]=_0x5677e7[_0xe009('0x4')]||'';this[_0xe009('0x5')]=_0x5677e7[_0xe009('0x5')]||'';this['consumerSecret']=_0x5677e7[_0xe009('0x6')]||'';this['token']=_0x5677e7[_0xe009('0x7')]||'';this[_0xe009('0x8')]=_0x5677e7[_0xe009('0x8')]||'';this[_0xe009('0x9')]=_0x5677e7[_0xe009('0x9')]||'';this[_0xe009('0xa')]=_0x5677e7['serverUrl']||'';this[_0xe009('0xb')]=_0x5677e7[_0xe009('0xb')]||{};}module[_0xe009('0xc')]=DeskAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index d70d834..03a11db 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 _0xda3f=['clientId','serverUrl','Configurations','exports','name','password','remoteUri','tenantId'];(function(_0x47bb55,_0x2aa61d){var _0x170691=function(_0x4e239c){while(--_0x4e239c){_0x47bb55['push'](_0x47bb55['shift']());}};_0x170691(++_0x2aa61d);}(_0xda3f,0xec));var _0xfda3=function(_0x287b54,_0x4e023c){_0x287b54=_0x287b54-0x0;var _0x35b2b5=_0xda3f[_0x287b54];return _0x35b2b5;};'use strict';function Dynamics365Account(_0x33f0ce){this['id']=_0x33f0ce['id']||0x0;this[_0xfda3('0x0')]=_0x33f0ce[_0xfda3('0x0')]||'';this['username']=_0x33f0ce['username']||'';this['password']=_0x33f0ce[_0xfda3('0x1')]||'';this['remoteUri']=_0x33f0ce[_0xfda3('0x2')]||'';this[_0xfda3('0x3')]=_0x33f0ce['tenantId']||'';this[_0xfda3('0x4')]=_0x33f0ce[_0xfda3('0x4')]||'';this['clientSecret']=_0x33f0ce['clientSecret']||{};this[_0xfda3('0x5')]=_0x33f0ce[_0xfda3('0x5')]||'';this[_0xfda3('0x6')]=_0x33f0ce[_0xfda3('0x6')]||{};}module[_0xfda3('0x7')]=Dynamics365Account; \ No newline at end of file +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 diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 047f823..7dd5d87 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 _0x13d5=['gateway','faxdetect','t38timeout','SIP','Trunk','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x13d5,0x117));var _0x513d=function(_0x30a10a,_0x55fd94){_0x30a10a=_0x30a10a-0x0;var _0x5a4c0f=_0x13d5[_0x30a10a];return _0x5a4c0f;};'use strict';function FaxAccount(_0x3371b6){this['id']=_0x3371b6['id']||0x0;this[_0x513d('0x0')]=_0x3371b6[_0x513d('0x0')]||'';this[_0x513d('0x1')]=_0x3371b6[_0x513d('0x1')];this[_0x513d('0x2')]=_0x3371b6[_0x513d('0x2')];this[_0x513d('0x3')]=_0x3371b6['headerinfo'];this[_0x513d('0x4')]=_0x3371b6[_0x513d('0x4')];this[_0x513d('0x5')]=_0x3371b6[_0x513d('0x5')]||0x960;this[_0x513d('0x6')]=_0x3371b6[_0x513d('0x6')]||0x3840;this[_0x513d('0x7')]=_0x3371b6['modem']||_0x513d('0x8');this[_0x513d('0x9')]=_0x3371b6['gateway']||'no';this[_0x513d('0xa')]=_0x3371b6[_0x513d('0xa')]||'no';this['t38timeout']=_0x3371b6[_0x513d('0xb')]||0x1388;this['tech']=_0x3371b6['tech']||_0x513d('0xc');this[_0x513d('0xd')]=_0x3371b6[_0x513d('0xd')]?_0x3371b6[_0x513d('0xd')]:undefined;this['ListId']=_0x3371b6['ListId'];this[_0x513d('0xe')]=_0x3371b6[_0x513d('0xe')];}module[_0x513d('0xf')]=FaxAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 3fef307..fcca609 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 _0x44d3=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x4c0bc7,_0x533cd4){var _0x3fcc0e=function(_0x2c3624){while(--_0x2c3624){_0x4c0bc7['push'](_0x4c0bc7['shift']());}};_0x3fcc0e(++_0x533cd4);}(_0x44d3,0x1b9));var _0x344d=function(_0xb5de76,_0x5ce458){_0xb5de76=_0xb5de76-0x0;var _0x440c27=_0x44d3[_0xb5de76];return _0x440c27;};'use strict';function FreshdeskAccount(_0x3bd1e0){this['id']=_0x3bd1e0['id']||0x0;this[_0x344d('0x0')]=_0x3bd1e0[_0x344d('0x0')]||'';this[_0x344d('0x1')]=_0x3bd1e0[_0x344d('0x1')]||'';this[_0x344d('0x2')]=_0x3bd1e0[_0x344d('0x3')]||'';this[_0x344d('0x4')]=_0x3bd1e0[_0x344d('0x4')]||'';this[_0x344d('0x5')]=_0x3bd1e0['serverUrl']||'';this[_0x344d('0x6')]=_0x3bd1e0[_0x344d('0x6')]||{};}module[_0x344d('0x7')]=FreshdeskAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 5beac75..ccc8fe9 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 _0x05bc=['username','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';function FreshsalesAccount(_0x302471){this['id']=_0x302471['id']||0x0;this[_0xc05b('0x0')]=_0x302471['name']||'';this[_0xc05b('0x1')]=_0x302471[_0xc05b('0x1')]||'';this['apiKey']=_0x302471[_0xc05b('0x2')]||'';this[_0xc05b('0x3')]=_0x302471[_0xc05b('0x3')]||'';this[_0xc05b('0x4')]=_0x302471[_0xc05b('0x4')]||'';this[_0xc05b('0x5')]=_0x302471[_0xc05b('0x5')]||{};}module[_0xc05b('0x6')]=FreshsalesAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index c36f3c4..34481d4 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 _0x5112=['queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinename','context','exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','exports','type','uniqueid','calleridnum'];(function(_0x4d73bd,_0x139c95){var _0x29410c=function(_0x17cf5b){while(--_0x17cf5b){_0x4d73bd['push'](_0x4d73bd['shift']());}};_0x29410c(++_0x139c95);}(_0x5112,0x18d));var _0x2511=function(_0x43d16c,_0x2b5447){_0x43d16c=_0x43d16c-0x0;var _0x208cce=_0x5112[_0x43d16c];return _0x208cce;};'use strict';function QueueReport(){this[_0x2511('0x0')]='inbound';this[_0x2511('0x1')]='';this[_0x2511('0x2')]='';this['calleridname']='';this['queue']='';this[_0x2511('0x3')]=null;this[_0x2511('0x4')]=null;this[_0x2511('0x5')]=0x1;this[_0x2511('0x6')]=0x1;this[_0x2511('0x7')]=![];this[_0x2511('0x8')]=null;this['queuecallercomplete']=![];this[_0x2511('0x9')]=null;this[_0x2511('0xa')]=![];this[_0x2511('0xb')]=null;this[_0x2511('0xc')]=0x1;this[_0x2511('0xd')]='';this['connectedlinenum']='';this[_0x2511('0xe')]='';this['accountcode']='';this[_0x2511('0xf')]='';this[_0x2511('0x10')]='';this[_0x2511('0x11')]='';this[_0x2511('0x12')]=0x0;this[_0x2511('0x13')]=![];this[_0x2511('0x14')]='';this[_0x2511('0x15')]=_0x2511('0x16');this[_0x2511('0x17')]=0x0;this['variables']={};}module[_0x2511('0x18')]=QueueReport; \ No newline at end of file +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 diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 9bf2e36..41217c1 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 _0xb261=['type','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x59197b,_0x35ec49){var _0x2c5edf=function(_0x3c7354){while(--_0x3c7354){_0x59197b['push'](_0x59197b['shift']());}};_0x2c5edf(++_0x35ec49);}(_0xb261,0x1b1));var _0x1b26=function(_0x2b51c2,_0x401991){_0x2b51c2=_0x2b51c2-0x0;var _0x234ecd=_0xb261[_0x2b51c2];return _0x234ecd;};'use strict';function SalesforceAccount(_0x3ebd92){this['id']=_0x3ebd92['id']||0x0;this[_0x1b26('0x0')]=_0x3ebd92[_0x1b26('0x0')]||'';this[_0x1b26('0x1')]=_0x3ebd92[_0x1b26('0x1')]||'';this[_0x1b26('0x2')]=_0x3ebd92[_0x1b26('0x2')]||'';this[_0x1b26('0x3')]=_0x3ebd92[_0x1b26('0x3')]||'';this['clientId']=_0x3ebd92[_0x1b26('0x4')]||'';this[_0x1b26('0x5')]=_0x3ebd92['clientSecret']||'';this[_0x1b26('0x6')]=_0x3ebd92[_0x1b26('0x6')]||'';this[_0x1b26('0x7')]=_0x3ebd92[_0x1b26('0x7')]||'integrationTab';this['serverUrl']=_0x3ebd92[_0x1b26('0x8')]||'';this[_0x1b26('0x9')]=_0x3ebd92[_0x1b26('0x9')]||{};}module[_0x1b26('0xa')]=SalesforceAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 7c9fa98..cf9e926 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 _0x49e7=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x49e7,0xc5));var _0x749e=function(_0x195d9e,_0x4fc668){_0x195d9e=_0x195d9e-0x0;var _0x18fde5=_0x49e7[_0x195d9e];return _0x18fde5;};'use strict';function ServicenowAccount(_0x1ca208){this['id']=_0x1ca208['id']||0x0;this['name']=_0x1ca208[_0x749e('0x0')]||'';this[_0x749e('0x1')]=_0x1ca208[_0x749e('0x1')]||'';this[_0x749e('0x2')]=_0x1ca208['password']||'';this[_0x749e('0x3')]=_0x1ca208[_0x749e('0x3')]||'';this['serverUrl']=_0x1ca208[_0x749e('0x4')]||'';this[_0x749e('0x5')]=_0x1ca208[_0x749e('0x5')]||{};}module[_0x749e('0x6')]=ServicenowAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 8b63f31..4ff9ade 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 _0x79be=['exports','username','password','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x79be,0x6d));var _0xe79b=function(_0x2d9553,_0x546f1f){_0x2d9553=_0x2d9553-0x0;var _0x4ab29d=_0x79be[_0x2d9553];return _0x4ab29d;};'use strict';function SugarcrmAccount(_0xfa4f9f){this['id']=_0xfa4f9f['id']||0x0;this['name']=_0xfa4f9f['name']||'';this[_0xe79b('0x0')]=_0xfa4f9f[_0xe79b('0x0')]||'';this['password']=_0xfa4f9f[_0xe79b('0x1')]||'';this[_0xe79b('0x2')]=_0xfa4f9f[_0xe79b('0x2')]||'';this[_0xe79b('0x3')]=_0xfa4f9f[_0xe79b('0x3')]||'';this[_0xe79b('0x4')]=_0xfa4f9f['Configurations']||{};}module[_0xe79b('0x5')]=SugarcrmAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9ea270c..3069f02 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 _0xb13f=['address','exports','name','accountcode','state','unknown','status'];(function(_0x515fac,_0x1ef5d2){var _0x1887cd=function(_0x5acbe0){while(--_0x5acbe0){_0x515fac['push'](_0x515fac['shift']());}};_0x1887cd(++_0x1ef5d2);}(_0xb13f,0x1de));var _0xfb13=function(_0x430583,_0x29377f){_0x430583=_0x430583-0x0;var _0x2b794a=_0xb13f[_0x430583];return _0x2b794a;};'use strict';function Telephone(_0xa090bb){this['id']=_0xa090bb['id']||0x0;this[_0xfb13('0x0')]=_0xa090bb['name']||'';this[_0xfb13('0x1')]=_0xa090bb['accountcode']||'';this[_0xfb13('0x2')]=_0xfb13('0x3');this['stateTime']=0x0;this[_0xfb13('0x4')]='unknown';this[_0xfb13('0x5')]='';}module[_0xfb13('0x6')]=Telephone; \ No newline at end of file +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 diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index de853ec..f6ed73a 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(_0xd05dde,_0x349eef){var _0x5e9092=function(_0xf5186f){while(--_0xf5186f){_0xd05dde['push'](_0xd05dde['shift']());}};_0x5e9092(++_0x349eef);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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(_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 diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index ec66d3f..d2c8333 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x1bfedc,_0x1e16ca){var _0x4b8d6b=function(_0x4928b2){while(--_0x4928b2){_0x1bfedc['push'](_0x1bfedc['shift']());}};_0x4b8d6b(++_0x1e16ca);}(_0x2032,0xd9));var _0x2203=function(_0x226f6a,_0x4ac1ee){_0x226f6a=_0x226f6a-0x0;var _0xbfcd8b=_0x2032[_0x226f6a];return _0xbfcd8b;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger; \ No newline at end of file +var _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 diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 16172df..b73e1cb 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 _0xfd65=['active','name','state','unknown','status','registry','split','port','domain','domainport','refresh','stateRegistry','registrationtime','address','defaultuser'];(function(_0x26a15e,_0x3d7561){var _0x109826=function(_0x1072e4){while(--_0x1072e4){_0x26a15e['push'](_0x26a15e['shift']());}};_0x109826(++_0x3d7561);}(_0xfd65,0x177));var _0x5fd6=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0xfd65[_0x256b72];return _0x2183e3;};'use strict';function Trunk(_0x98158c){this['id']=_0x98158c['id']||0x0;this[_0x5fd6('0x0')]=_0x98158c[_0x5fd6('0x0')]||![];this[_0x5fd6('0x1')]=_0x98158c[_0x5fd6('0x1')]||'';this[_0x5fd6('0x2')]=_0x5fd6('0x3');this['stateTime']=0x0;this[_0x5fd6('0x4')]=_0x5fd6('0x3');this[_0x5fd6('0x5')]=_0x98158c[_0x5fd6('0x5')]&&_0x98158c[_0x5fd6('0x5')]['indexOf'](':')?_0x98158c[_0x5fd6('0x5')][_0x5fd6('0x6')](':')[0x0]:'';this['host']='';this[_0x5fd6('0x7')]='';this[_0x5fd6('0x8')]='';this[_0x5fd6('0x9')]='';this[_0x5fd6('0xa')]='';this[_0x5fd6('0xb')]=_0x5fd6('0x3');this[_0x5fd6('0xc')]='';this[_0x5fd6('0xd')]='';this[_0x5fd6('0xe')]=_0x98158c[_0x5fd6('0xe')]||'';}module['exports']=Trunk; \ No newline at end of file +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 diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index bf3a7fc..9c9a8e1 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 _0xb58a=['exports','exten','recordingFormat','none','mandatoryDisposition'];(function(_0x108d68,_0x9b39de){var _0x11476a=function(_0x21cc20){while(--_0x21cc20){_0x108d68['push'](_0x108d68['shift']());}};_0x11476a(++_0x9b39de);}(_0xb58a,0x155));var _0xab58=function(_0x348652,_0x1ab849){_0x348652=_0x348652-0x0;var _0x18a9ea=_0xb58a[_0x348652];return _0x18a9ea;};'use strict';function voiceExtension(_0x498e45){this['id']=_0x498e45['id']||0x0;this[_0xab58('0x0')]=_0x498e45[_0xab58('0x0')]||'';this[_0xab58('0x1')]=_0x498e45['recordingFormat']||_0xab58('0x2');this[_0xab58('0x3')]=_0x498e45[_0xab58('0x3')]||![];}module[_0xab58('0x4')]=voiceExtension; \ No newline at end of file +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 diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index eebd2d2..06149c3 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 _0xa4c4=['pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDispositionPause','exports','not_inuse','inuse','busy','ringing','ringinuse','onhold','wav49','rrmemory','name','monitor_format','type','inbound','talking','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialOriginateCallerIdName','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','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength'];(function(_0x425d45,_0x418e47){var _0x413d14=function(_0x4afcb){while(--_0x4afcb){_0x425d45['push'](_0x425d45['shift']());}};_0x413d14(++_0x418e47);}(_0xa4c4,0x117));var _0x4a4c=function(_0x13d470,_0x5d8c1b){_0x13d470=_0x13d470-0x0;var _0x5a2900=_0xa4c4[_0x13d470];return _0x5a2900;};'use strict';var statusDesc=['unknown',_0x4a4c('0x0'),_0x4a4c('0x1'),_0x4a4c('0x2'),'invalid','unavailable',_0x4a4c('0x3'),_0x4a4c('0x4'),_0x4a4c('0x5')];var monitorFormat={'wav':'wav','wav49':_0x4a4c('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0x4a4c('0x7'),'roundrobin':'roundrobin'};function VoiceQueue(_0x142beb){this['id']=_0x142beb['id']||0x0;this[_0x4a4c('0x8')]=_0x142beb['name']||'';this[_0x4a4c('0x9')]=_0x142beb[_0x4a4c('0x9')]||'';this[_0x4a4c('0xa')]=_0x142beb['type']||_0x4a4c('0xb');this['waiting']=0x0;this[_0x4a4c('0xc')]=0x0;this[_0x4a4c('0xd')]=0x0;this[_0x4a4c('0xe')]=0x0;this[_0x4a4c('0xf')]=0x0;this[_0x4a4c('0x10')]=0x0;this[_0x4a4c('0x11')]=0x0;this[_0x4a4c('0x12')]=0x0;this[_0x4a4c('0x13')]=0x0;this[_0x4a4c('0x14')]=0x0;this[_0x4a4c('0x15')]=0x0;this['acw']=_0x142beb[_0x4a4c('0x16')]||![];this[_0x4a4c('0x17')]=_0x142beb[_0x4a4c('0x17')]||0xa;this[_0x4a4c('0x18')]=_0x142beb['autopause']||'no';this[_0x4a4c('0x19')]=!![];this['message']='';this[_0x4a4c('0x1a')]=0x0;this[_0x4a4c('0x1b')]=0x0;this[_0x4a4c('0x1c')]=_0x142beb['dialTimezone']||null;this[_0x4a4c('0x1d')]=_0x142beb['dialGlobalInterval']?_0x142beb['dialGlobalInterval']:null;this[_0x4a4c('0x1e')]=_0x142beb[_0x4a4c('0x1e')];this['dialMethod']=_0x142beb[_0x4a4c('0x1f')]||_0x4a4c('0x20');this[_0x4a4c('0x21')]=_0x142beb[_0x4a4c('0x21')]||0x0;this[_0x4a4c('0x22')]=_0x142beb[_0x4a4c('0x22')]||0x0;this[_0x4a4c('0x23')]=_0x142beb['dialPowerLevel']||0x1;this['dialPredictiveOptimization']=_0x142beb[_0x4a4c('0x24')]||_0x4a4c('0x25');this['dialPredictiveOptimizationPercentage']=_0x142beb['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x142beb['dialPredictiveInterval']||0x258;this[_0x4a4c('0x26')]=_0x142beb[_0x4a4c('0x26')]||_0x4a4c('0x27');this[_0x4a4c('0x28')]=_0x142beb[_0x4a4c('0x28')]||_0x4a4c('0x27');this[_0x4a4c('0x29')]=_0x142beb[_0x4a4c('0x29')]||0x1e;this[_0x4a4c('0x2a')]=_0x142beb['dialQueueOptions']||'tTxX';this[_0x4a4c('0x2b')]=_0x142beb[_0x4a4c('0x2b')]||0x3;this[_0x4a4c('0x2c')]=_0x142beb[_0x4a4c('0x2c')]||undefined;this[_0x4a4c('0x2d')]=_0x142beb['dialCongestionMaxRetry']||0x3;this[_0x4a4c('0x2e')]=_0x142beb[_0x4a4c('0x2e')]||0x96;this['dialBusyMaxRetry']=_0x142beb[_0x4a4c('0x2f')]||0x3;this[_0x4a4c('0x30')]=_0x142beb['dialBusyRetryFrequency']||0x96;this[_0x4a4c('0x31')]=_0x142beb[_0x4a4c('0x31')]||0x3;this['dialNoAnswerRetryFrequency']=_0x142beb[_0x4a4c('0x32')]||0x96;this[_0x4a4c('0x33')]=_0x142beb['dialNoSuchNumberMaxRetry']||0x3;this[_0x4a4c('0x34')]=_0x142beb[_0x4a4c('0x34')]||0x96;this[_0x4a4c('0x35')]=_0x142beb['dialDropMaxRetry']||0x3;this[_0x4a4c('0x36')]=_0x142beb[_0x4a4c('0x36')]||0x96;this[_0x4a4c('0x37')]=_0x142beb['dialAbandonedMaxRetry']||0x3;this[_0x4a4c('0x38')]=_0x142beb[_0x4a4c('0x38')]||0x96;this[_0x4a4c('0x39')]=_0x142beb[_0x4a4c('0x39')]||0x3;this[_0x4a4c('0x3a')]=_0x142beb[_0x4a4c('0x3a')]||0x96;this['dialAgentRejectMaxRetry']=_0x142beb[_0x4a4c('0x3b')]||0x3;this[_0x4a4c('0x3c')]=_0x142beb[_0x4a4c('0x3c')]||0x96;this[_0x4a4c('0x3d')]=_0x142beb[_0x4a4c('0x3d')]||0x4;this[_0x4a4c('0x3e')]=_0x142beb['Trunk']?_0x142beb[_0x4a4c('0x3e')]:undefined;this[_0x4a4c('0x3f')]=_0x142beb[_0x4a4c('0x3f')]?_0x142beb[_0x4a4c('0x3f')]:undefined;this[_0x4a4c('0x40')]=_0x142beb['dialPrefix']||undefined;this[_0x4a4c('0x41')]=_0x142beb[_0x4a4c('0x41')]?_0x142beb[_0x4a4c('0x41')]:undefined;this[_0x4a4c('0x42')]=_0x142beb['dialOrderByScheduledAt']||_0x4a4c('0x43');this[_0x4a4c('0x44')]=_0x142beb[_0x4a4c('0x44')]||undefined;this[_0x4a4c('0x45')]=_0x142beb[_0x4a4c('0x45')]||undefined;this[_0x4a4c('0x46')]=strategy[_0x142beb['strategy']]||_0x4a4c('0x7');this['queueStatusComplete']=!![];this[_0x4a4c('0x47')]=_0x142beb[_0x4a4c('0x47')]||![];this[_0x4a4c('0x48')]=_0x142beb['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x142beb[_0x4a4c('0x49')];this[_0x4a4c('0x4a')]=_0x142beb['dialAMDAfterGreetingSilence'];this[_0x4a4c('0x4b')]=_0x142beb[_0x4a4c('0x4b')];this['dialAMDMinWordLength']=_0x142beb[_0x4a4c('0x4c')];this[_0x4a4c('0x4d')]=_0x142beb['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x142beb[_0x4a4c('0x4e')];this[_0x4a4c('0x4f')]=_0x142beb[_0x4a4c('0x4f')];this[_0x4a4c('0x50')]=_0x142beb[_0x4a4c('0x50')];this['outboundRejectCallsDay']=0x0;this[_0x4a4c('0x51')]=0x0;this['timeout']=_0x142beb[_0x4a4c('0x52')];this[_0x4a4c('0x53')]=0x0;this[_0x4a4c('0x54')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this[_0x4a4c('0x55')]=0x0;this[_0x4a4c('0x56')]=0x0;this[_0x4a4c('0x57')]=0x0;this[_0x4a4c('0x58')]=0x0;this[_0x4a4c('0x59')]=0x0;this[_0x4a4c('0x5a')]=0x0;this[_0x4a4c('0x5b')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x4a4c('0x5c')]=undefined;this[_0x4a4c('0x5d')]=undefined;this[_0x4a4c('0x5e')]=undefined;this[_0x4a4c('0x5f')]=1.05;this[_0x4a4c('0x60')]=0x0;this[_0x4a4c('0x61')]=0x0;this[_0x4a4c('0x62')]=0x0;this[_0x4a4c('0x63')]=0x0;this[_0x4a4c('0x64')]=0x0;this[_0x4a4c('0x65')]=0x0;this[_0x4a4c('0x66')]=0x0;this[_0x4a4c('0x67')]=0x0;this[_0x4a4c('0x68')]=_0x142beb['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x4a4c('0x69')]=_0x142beb[_0x4a4c('0x6a')]||0xa;this[_0x4a4c('0x6b')]=0x0;this[_0x4a4c('0x6c')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x4a4c('0x6d')]=0x0;this[_0x4a4c('0x6e')]=0x0;this[_0x4a4c('0x6f')]=0x0;this[_0x4a4c('0x70')]=0x0;this['dialRecallMeTimeout']=_0x142beb[_0x4a4c('0x71')]||0x1e;this['dialRecallInQueue']=_0x142beb['dialRecallInQueue']||![];this[_0x4a4c('0x72')]=!!_0x142beb[_0x4a4c('0x72')]||![];this[_0x4a4c('0x73')]=_0x142beb[_0x4a4c('0x73')]||undefined;this[_0x4a4c('0x74')]=_0x142beb['dialAgiAfterHangupClient']||![];this[_0x4a4c('0x75')]=_0x142beb['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x142beb[_0x4a4c('0x9')]]?monitorFormat[_0x142beb['monitor_format']]:undefined;this['mandatoryDisposition']=_0x142beb['mandatoryDisposition']||![];this[_0x4a4c('0x76')]=_0x142beb[_0x4a4c('0x76')]?_0x142beb['mandatoryDispositionPause']:undefined;}module[_0x4a4c('0x77')]=VoiceQueue; \ No newline at end of file +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 diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index f405f24..c7973e0 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 _0x035d=['remoteUri','serverUrl','Configurations','exports','username','accessKey'];(function(_0x2fdbf8,_0x461a51){var _0x5dc976=function(_0xb9cea4){while(--_0xb9cea4){_0x2fdbf8['push'](_0x2fdbf8['shift']());}};_0x5dc976(++_0x461a51);}(_0x035d,0x15a));var _0xd035=function(_0x106d07,_0x49029e){_0x106d07=_0x106d07-0x0;var _0x527b38=_0x035d[_0x106d07];return _0x527b38;};'use strict';function VtigerAccount(_0x31b37c){this['id']=_0x31b37c['id']||0x0;this['name']=_0x31b37c['name']||'';this[_0xd035('0x0')]=_0x31b37c[_0xd035('0x0')]||'';this[_0xd035('0x1')]=_0x31b37c[_0xd035('0x1')]||'';this['remoteUri']=_0x31b37c[_0xd035('0x2')]||'';this[_0xd035('0x3')]=_0x31b37c['serverUrl']||'';this[_0xd035('0x4')]=_0x31b37c[_0xd035('0x4')]||{};}module[_0xd035('0x5')]=VtigerAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 07fd26f..132fb76 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 _0x7886=['token','remoteUri','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x2e4009,_0x103752){var _0x1def99=function(_0x2ab08d){while(--_0x2ab08d){_0x2e4009['push'](_0x2e4009['shift']());}};_0x1def99(++_0x103752);}(_0x7886,0x16f));var _0x6788=function(_0x442e2d,_0x4d84c3){_0x442e2d=_0x442e2d-0x0;var _0x157780=_0x7886[_0x442e2d];return _0x157780;};'use strict';function ZendeskAccount(_0x1235a0){this['id']=_0x1235a0['id']||0x0;this[_0x6788('0x0')]=_0x1235a0[_0x6788('0x0')]||'';this[_0x6788('0x1')]=_0x1235a0['username']||'';this[_0x6788('0x2')]=_0x1235a0['password']||'';this[_0x6788('0x3')]=_0x1235a0['token']||'';this[_0x6788('0x4')]=_0x1235a0[_0x6788('0x4')]||'';this['authType']=_0x1235a0['authType']||'';this['type']=_0x1235a0[_0x6788('0x5')]||_0x6788('0x6');this[_0x6788('0x7')]=_0x1235a0[_0x6788('0x7')]||'';this[_0x6788('0x8')]=_0x1235a0['Configurations']||{};}module[_0x6788('0x9')]=ZendeskAccount; \ No newline at end of file +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 diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 50015cd..2d85a7f 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 _0x82e4=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x1c85b0,_0x494790){var _0x280837=function(_0x3f83f5){while(--_0x3f83f5){_0x1c85b0['push'](_0x1c85b0['shift']());}};_0x280837(++_0x494790);}(_0x82e4,0x169));var _0x482e=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x82e4[_0x413feb];return _0x40ee88;};'use strict';function ZohoAccount(_0x1f863b){this['id']=_0x1f863b['id']||0x0;this['name']=_0x1f863b[_0x482e('0x0')]||'';this[_0x482e('0x1')]=_0x1f863b[_0x482e('0x1')]||'';this[_0x482e('0x2')]=_0x1f863b['host']||'';this[_0x482e('0x3')]=_0x1f863b[_0x482e('0x3')]||'';this['clientId']=_0x1f863b[_0x482e('0x4')]||'';this[_0x482e('0x5')]=_0x1f863b[_0x482e('0x5')]||'';this[_0x482e('0x6')]=_0x1f863b[_0x482e('0x6')]||'';this[_0x482e('0x7')]=_0x1f863b[_0x482e('0x7')]||'';this[_0x482e('0x8')]=_0x1f863b[_0x482e('0x8')]||'';this['Configurations']=_0x1f863b[_0x482e('0x9')]||{};}module[_0x482e('0xa')]=ZohoAccount; \ No newline at end of file +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 diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 5fd88d7..ae8329b 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 _0x14f4=['channelAgent','format','SIP/%s','calleridname','Contact','phone','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countdropretry','countmachineretry','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent'];(function(_0xb21600,_0x47ac80){var _0x4f2f7b=function(_0x2b9efc){while(--_0x2b9efc){_0xb21600['push'](_0xb21600['shift']());}};_0x4f2f7b(++_0x47ac80);}(_0x14f4,0xfb));var _0x414f=function(_0x5efa78,_0x53f0dd){_0x5efa78=_0x5efa78-0x0;var _0x3ea15d=_0x14f4[_0x5efa78];return _0x3ea15d;};'use strict';var util=require(_0x414f('0x0'));var _=require('lodash');var moment=require(_0x414f('0x1'));function checkNameSurname(_0x5e17b3,_0x266bea,_0x72f24e){var _0x24353d='';if(!_[_0x414f('0x2')](_0x266bea)&&_0x414f('0x3')===typeof _0x266bea){_0x24353d+=_0x266bea;}if(!_[_0x414f('0x2')](_0x72f24e)&&_0x414f('0x3')===typeof _0x72f24e){_0x24353d+='\x20'+_0x72f24e;}if(_0x24353d!==''){return _0x24353d;}return _0x5e17b3;}function Action(_0x199312,_0x147850,_0xb7d134,_0x28de59,_0x17f31d){this[_0x414f('0x4')]=_0xb7d134||undefined;this[_0x414f('0x5')]=_0x199312['id'];this[_0x414f('0x6')]=_0x147850[_0x414f('0x7')];this[_0x414f('0x8')]=_0x147850[_0x414f('0x8')];this[_0x414f('0x9')]=_0x414f('0x6');this[_0x414f('0xa')]=![];this[_0x414f('0xb')]=_[_0x414f('0x2')](_0x199312[_0x414f('0xc')])?undefined:_0x199312['Agent'][_0x414f('0x7')];this[_0x414f('0xd')]=this[_0x414f('0xb')]?util[_0x414f('0xe')](_0x414f('0xf'),this[_0x414f('0xb')]):_0x28de59||undefined;this[_0x414f('0x10')]=checkNameSurname(_0x199312[_0x414f('0x11')][_0x414f('0x12')],_0x199312['Contact']['firstName'],_0x199312[_0x414f('0x11')]['lastName']);this['active']=_0x199312[_0x414f('0x13')]||![];this[_0x414f('0x14')]=_0x199312[_0x414f('0x11')][_0x414f('0x12')];this[_0x414f('0x15')]=_0x199312['scheduledat'];this['countbusyretry']=_0x199312[_0x414f('0x16')]||0x0;this[_0x414f('0x17')]=_0x199312[_0x414f('0x17')]||0x0;this[_0x414f('0x18')]=_0x199312[_0x414f('0x18')]||0x0;this[_0x414f('0x19')]=(_0x199312[_0x414f('0x16')]||0x0)+(_0x199312[_0x414f('0x17')]||0x0)+(_0x199312[_0x414f('0x18')]||0x0)+(_0x199312['countnosuchnumberretry']||0x0)+(_0x199312['countdropretry']||0x0)+(_0x199312[_0x414f('0x1a')]||0x0)+(_0x199312['countmachineretry']||0x0)+(_0x199312[_0x414f('0x1b')]||0x0);this['countnosuchnumberretry']=_0x199312[_0x414f('0x1c')]||0x0;this[_0x414f('0x1d')]=_0x199312[_0x414f('0x1d')]||0x0;this[_0x414f('0x1a')]=_0x199312[_0x414f('0x1a')]||0x0;this[_0x414f('0x1e')]=_0x199312[_0x414f('0x1e')]||0x0;this[_0x414f('0x1b')]=_0x199312[_0x414f('0x1b')]||0x0;this[_0x414f('0x1f')]=_0x199312[_0x414f('0x1f')];this['callbackuniqueid']=_0x199312[_0x414f('0x20')];this[_0x414f('0x21')]=_0x199312[_0x414f('0x21')];this['recallme']=_0x199312['recallme'];this['ContactId']=_0x199312[_0x414f('0x22')];this['ListId']=_0x199312[_0x414f('0x23')];this[_0x414f('0x24')]=_[_0x414f('0x2')](_0x199312[_0x414f('0xc')])?_0x199312['UserId']:_0x199312['Agent']['id'];this['VoiceQueueId']=_0x199312[_0x414f('0x25')];this[_0x414f('0x26')]='';this[_0x414f('0x27')]='';}Action[_0x414f('0x28')]['getCaller']=function(){return util[_0x414f('0xe')](_0x414f('0x29'),this[_0x414f('0x10')],this[_0x414f('0x2a')]);};module[_0x414f('0x2b')]=Action; \ No newline at end of file +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 diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index cd072d0..5216ef0 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 _0x2bd8=['syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundAbandonedCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','message','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','sendMessageOneNotActive','originated','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','[CampaignPreview]\x20Campaign\x20Queue:\x20','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','dialPreviewAutoRecallMe','clearZombieChannel','actions','[clearZombieChannels][talking]','Queue','queue','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','recallMe','agentReadyId','then','isNil','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','countnosuchnumberretry','unlockAgent','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','\x20Queue','buildObj','connect','acw','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','[callProgressDetectingCustomer][logAnswer]','talktime','[syncHangup][talking][decrement]','uniqueid','linkedid','Busy','busy','[callProgressDetectingCustomer][logBusy]','Global','countbusyretry','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','activeContact','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','isUndefined','object','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','reason','[callProgressDetectingAgent]','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','unlock','unlockContact','execRun','getContactPreview','Contact.phone','checkInBlack','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','starttime','Action','[originated][increment]','originated:\x20','OriginateError','[originateFailure][logOriginateFailure]','channel','actionid','logLookAgent','lookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','syncHangup','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','callProgressDetectingAgent','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfer','syncBlindTransfer','transfererlinkedid','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','actionPreview','../ami','./action','./util/util','redis','defaults','localhost','enqueue','tail','sequence','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup'];(function(_0x5632a6,_0x4a0097){var _0x50e25a=function(_0x5e3293){while(--_0x5e3293){_0x5632a6['push'](_0x5632a6['shift']());}};_0x50e25a(++_0x4a0097);}(_0x2bd8,0x130));var _0x82bd=function(_0x119b7f,_0x838c2){_0x119b7f=_0x119b7f-0x0;var _0x2a868d=_0x2bd8[_0x119b7f];return _0x2a868d;};'use strict';var util=require(_0x82bd('0x0'));var _=require('lodash');var BPromise=require(_0x82bd('0x1'));var uuid=require(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var md5=require(_0x82bd('0x4'));var Redis=require(_0x82bd('0x5'));var config=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('preview');var loggerAction=require(_0x82bd('0x7'))(_0x82bd('0x8'));var ami=require(_0x82bd('0x9'));var rpcDb=require('./rpcDb');var Action=require(_0x82bd('0xa'));var ut=require(_0x82bd('0xb'));config[_0x82bd('0xc')]=_[_0x82bd('0xd')](config['redis'],{'host':_0x82bd('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x82bd('0xf')]=function(_0x5f0434){this['tail']=this[_0x82bd('0x10')]?this['tail']['finally'](_0x5f0434):_0x5f0434();};function Preview(_0x32821a){this[_0x82bd('0x11')]=new Sequence();this['campaignsPreview']=_0x32821a[_0x82bd('0x12')];this['trunks']=_0x32821a[_0x82bd('0x13')];this['actions']={};this[_0x82bd('0x14')]=_0x32821a[_0x82bd('0x14')];this[_0x82bd('0x15')]=0x0;ami['on'](_0x82bd('0x16'),this['syncOriginateResponse'][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x18'),this['syncHangup'][_0x82bd('0x17')](this));ami['on']('hanguprequest',this[_0x82bd('0x19')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x1a'),this[_0x82bd('0x1b')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x1c'),this[_0x82bd('0x1d')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x1e'),this[_0x82bd('0x1f')][_0x82bd('0x17')](this));ami['on'](_0x82bd('0x20'),this[_0x82bd('0x21')][_0x82bd('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x82bd('0x17')](this));this[_0x82bd('0x22')](this[_0x82bd('0x23')]);}function emit(_0xc9fcdf,_0x34899b,_0x28a706){io['to'](_0xc9fcdf)[_0x82bd('0x24')](_0x34899b,_0x28a706);}function emitCampaignPreview(_0x32954d){if(_0x32954d[_0x82bd('0x25')]===_0x82bd('0x26')){var _0x2caa29={'id':_0x32954d['id'],'name':_0x32954d[_0x82bd('0x27')],'strategy':_0x32954d[_0x82bd('0x28')],'answered':_0x32954d[_0x82bd('0x29')],'available':_0x32954d[_0x82bd('0x2a')],'loggedIn':_0x32954d[_0x82bd('0x2b')],'pTalking':_0x32954d[_0x82bd('0x2c')],'sumBillable':_0x32954d[_0x82bd('0x2d')],'sumDuration':_0x32954d[_0x82bd('0x2e')],'sumHoldTime':_0x32954d['sumHoldTime']||0x0,'talking':_0x32954d['talking'],'total':_0x32954d[_0x82bd('0x2f')],'type':_0x32954d[_0x82bd('0x25')],'unmanaged':_0x32954d[_0x82bd('0x30')],'abandoned':_0x32954d[_0x82bd('0x31')],'waiting':_0x32954d[_0x82bd('0x32')],'loggedInDb':_0x32954d[_0x82bd('0x33')],'dialActive':_0x32954d[_0x82bd('0x34')],'dialMethod':_0x32954d[_0x82bd('0x35')],'dialOriginateCallerIdName':_0x32954d[_0x82bd('0x36')],'dialOriginateCallerIdNumber':_0x32954d[_0x82bd('0x37')],'dialOriginateTimeout':_0x32954d['dialOriginateTimeout'],'dialPrefix':_0x32954d['dialPrefix'],'outboundAnswerAgiCallsDay':_0x32954d['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x32954d['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x32954d[_0x82bd('0x38')],'outboundBusyCallsDay':_0x32954d[_0x82bd('0x39')],'outboundCongestionCallsDay':_0x32954d[_0x82bd('0x3a')],'outboundDropCallsDayACS':_0x32954d[_0x82bd('0x3b')],'outboundDropCallsDayCallersExit':_0x32954d[_0x82bd('0x3c')],'outboundDropCallsDayTimeout':_0x32954d['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x32954d['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x32954d['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x32954d[_0x82bd('0x3d')],'outboundReCallsDay':_0x32954d[_0x82bd('0x3e')],'outboundRejectCallsDay':_0x32954d[_0x82bd('0x3f')],'outboundUnknownCallsDay':_0x32954d['outboundUnknownCallsDay'],'outboundAbandonedCallsDay':_0x32954d[_0x82bd('0x40')],'predictiveIntervalAnsweredCalls':_0x32954d['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x32954d[_0x82bd('0x41')],'predictiveIntervalAvgTalktime':_0x32954d[_0x82bd('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x32954d[_0x82bd('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x32954d[_0x82bd('0x44')],'predictiveIntervalErlangCalls':_0x32954d[_0x82bd('0x45')],'predictiveIntervalErlangCallsDroppedCalls':_0x32954d[_0x82bd('0x46')],'predictiveIntervalHitRate':_0x32954d['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x32954d[_0x82bd('0x47')],'predictiveIntervalPauses':_0x32954d[_0x82bd('0x48')],'predictiveIntervalAvailable':_0x32954d[_0x82bd('0x49')],'predictiveIntervalTotalCalls':_0x32954d['predictiveIntervalTotalCalls'],'message':_0x32954d[_0x82bd('0x4a')],'originated':_0x32954d['originated'],'erlangCalls':_0x32954d['erlangCalls'],'erlangCallToSecond':_0x32954d[_0x82bd('0x4b')],'erlangAbandonmentRate':_0x32954d[_0x82bd('0x4c')],'erlangBusyFactor':_0x32954d[_0x82bd('0x4d')],'startPredictive':_0x32954d[_0x82bd('0x4e')],'startProgressive':_0x32954d[_0x82bd('0x4f')]};if(_0x32954d[_0x82bd('0x50')]){_0x2caa29[_0x82bd('0x50')]={'id':_0x32954d[_0x82bd('0x50')]['id'],'name':_0x32954d[_0x82bd('0x50')][_0x82bd('0x27')],'active':_0x32954d[_0x82bd('0x50')][_0x82bd('0x51')],'callerid':_0x32954d[_0x82bd('0x50')][_0x82bd('0x52')]};}if(_0x32954d[_0x82bd('0x53')]){_0x2caa29[_0x82bd('0x53')]={'id':_0x32954d[_0x82bd('0x53')]['id'],'name':_0x32954d['Interval']['name']};}var _0x59319d=md5(JSON[_0x82bd('0x54')](_0x2caa29));if(_0x32954d[_0x82bd('0x4')]!==_0x59319d){_0x32954d['md5']=_0x59319d;emit(util[_0x82bd('0x55')]('voice:queue:%s',_0x2caa29['name']),'voice_queue:save',_0x2caa29);}}}function emitVoiceQueueChannelRemove(_0x2b7675){logger[_0x82bd('0x56')](_0x82bd('0x57'),JSON[_0x82bd('0x54')](_0x2b7675));emit(util[_0x82bd('0x55')]('voice:queue:%s',_0x2b7675['name']),'voice_queue_channel:remove',_0x2b7675);io[_0x82bd('0x24')]('voice_queue_presence:remove',_0x2b7675);}function notSendMessagesQueue(_0x5d09f7){if(_0x5d09f7[_0x82bd('0x58')]){if(_0x5d09f7[_0x82bd('0x59')]===0x0&&_0x5d09f7[_0x82bd('0x2c')]===0x0){_0x5d09f7[_0x82bd('0x58')]=![];_0x5d09f7[_0x82bd('0x2a')]=0x0;_0x5d09f7[_0x82bd('0x5a')]=0x0;_0x5d09f7[_0x82bd('0x4a')]=_0x82bd('0x5b');ut[_0x82bd('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x5d09f7['name']+_0x82bd('0x5d'));}else{_0x5d09f7[_0x82bd('0x4a')]='IS_DISACTIVED';ut['logger'](_0x82bd('0x5e'),_0x5d09f7[_0x82bd('0x27')]+'\x20is\x20disactive');}emitCampaignPreview(_0x5d09f7);}}Preview[_0x82bd('0x5f')][_0x82bd('0x22')]=function(){var _0x42aa82=this;setInterval(function(){_0x42aa82[_0x82bd('0x60')]();},0x7cf);};Preview[_0x82bd('0x5f')][_0x82bd('0x60')]=function(){var _0x2a18c3=this[_0x82bd('0x23')];this[_0x82bd('0x15')]+=0x1;for(var _0x239d48 in _0x2a18c3){if(_0x2a18c3[_0x82bd('0x61')](_0x239d48)&&(_0x2a18c3[_0x239d48][_0x82bd('0x35')]==='preview'||_0x2a18c3[_0x239d48][_0x82bd('0x35')]===_0x82bd('0x62'))&&_0x2a18c3[_0x239d48]['type']==='outbound'){if(this[_0x82bd('0x15')]>0x7){this[_0x82bd('0x15')]=0x0;this[_0x82bd('0x63')]();}}if(_0x2a18c3[_0x82bd('0x61')](_0x239d48)&&_0x2a18c3[_0x239d48][_0x82bd('0x35')]==='preview'&&_0x2a18c3[_0x239d48]['type']===_0x82bd('0x26')){if(_0x2a18c3[_0x239d48][_0x82bd('0x34')]){this['setMessage'](_0x2a18c3[_0x239d48]);if(_0x2a18c3[_0x239d48][_0x82bd('0x64')])this['recallMe'](_0x2a18c3[_0x239d48]);}else{notSendMessagesQueue(_0x2a18c3[_0x239d48]);}}}};Preview[_0x82bd('0x5f')][_0x82bd('0x65')]=function(_0x587aec){var _0x1d582a=this;this[_0x82bd('0x11')]['enqueue'](function(){if(!_['isNil'](_0x1d582a[_0x82bd('0x66')][_0x587aec])){loggerAction['info'](_0x82bd('0x67'),_0x587aec,_0x82bd('0x68'),_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')],'originated:\x20',JSON['stringify'](_0x1d582a[_0x82bd('0x23')][_0x1d582a[_0x82bd('0x66')][_0x587aec]['queue']][_0x82bd('0x59')]),_0x82bd('0x6a'),JSON[_0x82bd('0x54')](_0x1d582a['campaignsPreview'][_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]][_0x82bd('0x2c')]),JSON[_0x82bd('0x54')](_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x6b')]),JSON[_0x82bd('0x54')](_[_0x82bd('0x6c')](_0x1d582a[_0x82bd('0x66')][_0x587aec],[_0x82bd('0x6d'),_0x82bd('0x6e'),_0x82bd('0x6f'),_0x82bd('0x70')])));return ami['Action']({'action':_0x82bd('0x71'),'channel':_0x1d582a[_0x82bd('0x66')][_0x587aec]['channel']})[_0x82bd('0x72')](function(_0xcfb267){if(_0xcfb267[_0x82bd('0x4a')]===_0x82bd('0x73')){setTimeout(function(){if(_0x1d582a['actions'][_0x587aec]){ut['updateOriginated'](_0x1d582a[_0x82bd('0x23')][_0x1d582a['actions'][_0x587aec]['queue']],_0x82bd('0x74'));if(_0x1d582a['actions'][_0x587aec]['dialAnswer']===!![]){ut[_0x82bd('0x75')](_0x1d582a[_0x82bd('0x23')][_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]],_0x82bd('0x74'));ut[_0x82bd('0x76')](_0x82bd('0x77')+_0x587aec,_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]);}ut[_0x82bd('0x76')](_0x82bd('0x78')+_0x587aec,_0x1d582a[_0x82bd('0x66')][_0x587aec][_0x82bd('0x69')]);delete _0x1d582a[_0x82bd('0x66')][_0x587aec];}},0x2328);}});}});};Preview[_0x82bd('0x5f')]['clearZombieChannels']=function(){var _0x16599d=this;loggerAction[_0x82bd('0x56')](_0x82bd('0x79'),_[_0x82bd('0x7a')](this[_0x82bd('0x66')]));for(var _0x5466d9 in this['actions']){if(_0x16599d['actions']['hasOwnProperty'](_0x5466d9)){_0x16599d[_0x82bd('0x65')](_0x5466d9);}}};Preview[_0x82bd('0x5f')][_0x82bd('0x7b')]=function(_0x127f8f){var _0x568fc3=this;rpcDb['getContactRecallMe'](_0x127f8f['id'],ut[_0x82bd('0x7c')](this[_0x82bd('0x14')]))[_0x82bd('0x7d')](function(_0x4d7fb4){if(!_[_0x82bd('0x7e')](_0x4d7fb4)){for(var _0x2252ef=0x0;_0x2252ef<_0x4d7fb4[_0x82bd('0x7f')];_0x2252ef+=0x1){if(ut[_0x82bd('0x80')](_0x4d7fb4[_0x2252ef][_0x82bd('0x81')])<_0x127f8f[_0x82bd('0x82')]*0x3c){if(_0x4d7fb4[_0x2252ef][_0x82bd('0x83')]&&!_0x4d7fb4[_0x2252ef][_0x82bd('0x83')][_0x82bd('0x84')]){_0x568fc3[_0x82bd('0x85')](_0x4d7fb4[_0x2252ef]['id'])[_0x82bd('0x7d')](ut[_0x82bd('0x86')](_0x82bd('0x87')))[_0x82bd('0x72')](ut[_0x82bd('0x86')](_0x82bd('0x87')));}else{rpcDb[_0x82bd('0x88')](_0x4d7fb4[_0x2252ef]['id']);}}else{var _0x1fa71d=new Action(_0x4d7fb4[_0x2252ef],_0x127f8f);_0x1fa71d['starttime']=moment()[_0x82bd('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x127f8f['outboundReCallsDay']+=0x1;ut[_0x82bd('0x89')](_0x1fa71d,0x17,'RecallInQueue');if(_0x127f8f[_0x82bd('0x8a')]){rpcDb[_0x82bd('0x8b')](ut[_0x82bd('0x8c')](_0x4d7fb4[_0x2252ef]));rpcDb[_0x82bd('0x8d')](_0x1fa71d,_0x82bd('0x8e'));}else{ut[_0x82bd('0x89')](_0x1fa71d,0x16,_0x82bd('0x8f'));rpcDb[_0x82bd('0x8d')](_0x1fa71d,_0x82bd('0x90'));rpcDb[_0x82bd('0x91')](_0x1fa71d,_0x82bd('0x90'));}}}}})['catch'](ut['logger2'](_0x82bd('0x92')));};Preview[_0x82bd('0x5f')]['setMessage']=function(_0x47d136){_0x47d136[_0x82bd('0x58')]=!![];if(ut[_0x82bd('0x93')](_0x47d136[_0x82bd('0x2b')])){_0x47d136[_0x82bd('0x4a')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x82bd('0x94')](_0x47d136['dialActive'])){_0x47d136[_0x82bd('0x4a')]=_0x82bd('0x5b');}else if(!this['isTrunkReachable'](_0x47d136[_0x82bd('0x50')])){if(!this[_0x82bd('0x95')](_0x47d136[_0x82bd('0x96')])){_0x47d136[_0x82bd('0x4a')]='TRUNK_IS_NOT_REACHABLE';}else{_0x47d136[_0x82bd('0x4a')]=_0x82bd('0x97');}}else{_0x47d136[_0x82bd('0x4a')]=_0x82bd('0x97');}emitCampaignPreview(_0x47d136);};Preview[_0x82bd('0x5f')][_0x82bd('0x98')]=function(_0x73c194,_0x19af06,_0x1384b0){var _0x544f10=this;var _0x214bb3=this['actions'][_0x19af06];var _0x5b74cb=this[_0x82bd('0x23')][_0x214bb3[_0x82bd('0x69')]];var _0x529cb2;if(_0x5b74cb){switch(_0x1384b0){case'1':_0x5b74cb[_0x82bd('0x99')]+=0x1;_0x214bb3['countnosuchnumberretry']+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut['logCustomer'](_0x214bb3,0x0,_0x82bd('0x9c'));ami[_0x82bd('0x24')]('custom:agentnosuchnumber',ut['buildObj'](_0x214bb3,'nosuchnumber'));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0x9d'));if(ut['totalGlobal'](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,'Global');rpcDb['createCustomerFinal'](_0x529cb2,_0x82bd('0xa0'));}else{if(_0x214bb3['countnosuchnumberretry']>=_0x5b74cb['dialNoSuchNumberMaxRetry']){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xa0'));}else{rpcDb[_0x82bd('0xa1')](ut[_0x82bd('0xa2')](_0x214bb3,_0x82bd('0xa3'),_0x5b74cb['dialNoSuchNumberRetryFrequency']),_0x214bb3[_0x82bd('0xa4')],_0x214bb3['activeContact']);}}delete this[_0x82bd('0x66')][_0x73c194['linkedid']];break;case _0x82bd('0xa5'):var _0x4e1d32=moment()['format'](_0x82bd('0xa6'));_0x214bb3[_0x82bd('0xa7')]=_0x4e1d32;_0x214bb3['answertime']=_0x4e1d32;_0x214bb3[_0x82bd('0x6b')]=!![];_0x5b74cb[_0x82bd('0x2c')]+=0x1;logger[_0x82bd('0x56')]('[syncHangup][talking][increment]',_0x214bb3['uniqueid'],_0x82bd('0xa8'),_0x5b74cb[_0x82bd('0x27')],'pTalking:\x20',_0x5b74cb[_0x82bd('0x2c')]);ami[_0x82bd('0x24')]('custom:agentconnect',ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xaa'),this[_0x82bd('0x23')][_0x214bb3[_0x82bd('0x69')]]));if(_0x5b74cb[_0x82bd('0xab')]){ami[_0x82bd('0x24')]('custom:agentConnectPreview',ut[_0x82bd('0xac')](_0x214bb3));}break;case'16':ami[_0x82bd('0x24')](_0x82bd('0xad'),ut['buildObj'](_0x214bb3,_0x82bd('0xae'),this['campaignsPreview'][_0x214bb3[_0x82bd('0x69')]]));emitVoiceQueueChannelRemove(ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xae')));_0x5b74cb[_0x82bd('0xaf')]+=0x1;_0x5b74cb[_0x82bd('0x2f')]+=0x1;_0x5b74cb['answered']+=0x1;ut[_0x82bd('0x75')](_0x5b74cb,_0x82bd('0xb0'));_0x214bb3['countglobal']=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x4,'Answer');rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xb1'));rpcDb[_0x82bd('0x91')](_0x214bb3,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb['crateCustomerReportQueue'](_0x214bb3);_0x5b74cb[_0x82bd('0x2e')]+=_0x214bb3[_0x82bd('0xb2')];_0x5b74cb[_0x82bd('0x2d')]+=_0x214bb3['talktime'];logger[_0x82bd('0x56')](_0x82bd('0xb3'),_0x214bb3[_0x82bd('0xb4')],'\x20Queue',_0x5b74cb['name'],'pTalking:\x20',_0x5b74cb['pTalking']);delete this[_0x82bd('0x66')][_0x73c194[_0x82bd('0xb5')]];break;case'BUSY':_0x5b74cb[_0x82bd('0x39')]+=0x1;_0x214bb3['countbusyretry']+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut['totalGlobal'](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x5,_0x82bd('0xb6'));ami[_0x82bd('0x24')]('custom:agentbusy',ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xb7')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xb8'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb['dialGlobalMaxRetry']){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb[_0x82bd('0x91')](_0x529cb2,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x214bb3['countbusyretry']>=_0x5b74cb['dialBusyMaxRetry']){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xb8'));}else{rpcDb[_0x82bd('0xa1')](ut[_0x82bd('0xa2')](_0x214bb3,_0x82bd('0xba'),_0x5b74cb['dialBusyRetryFrequency']),_0x214bb3['unlockAgent'],_0x214bb3['activeContact']);}}break;case'NOANSWER':_0x5b74cb[_0x82bd('0xbb')]+=0x1;_0x214bb3[_0x82bd('0xbc')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x3,_0x82bd('0xbd'));ami[_0x82bd('0x24')]('custom:agentnoanswer',ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xbe')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xbf'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb[_0x82bd('0x91')](_0x529cb2,_0x82bd('0xc0'));}else{if(_0x214bb3[_0x82bd('0xbc')]>=_0x5b74cb[_0x82bd('0xc1')]){rpcDb[_0x82bd('0x91')](_0x214bb3,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x82bd('0xa1')](ut[_0x82bd('0xa2')](_0x214bb3,'countnoanswerretry',_0x5b74cb['dialNoAnswerRetryFrequency']),_0x214bb3[_0x82bd('0xa4')],_0x214bb3['activeContact']);}}break;case _0x82bd('0xc2'):_0x5b74cb[_0x82bd('0x3a')]+=0x1;_0x214bb3[_0x82bd('0xc3')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x8,_0x82bd('0xc4'));ami[_0x82bd('0x24')]('custom:agentcongestion',ut[_0x82bd('0xa9')](_0x214bb3,'congestion'));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xc5'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut['cloneAction'](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb[_0x82bd('0x91')](_0x529cb2,_0x82bd('0xc6'));}else{if(_0x214bb3[_0x82bd('0xc3')]>=_0x5b74cb['dialCongestionMaxRetry']){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xc5'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x214bb3,'countcongestionretry',_0x5b74cb[_0x82bd('0xc7')]),_0x214bb3[_0x82bd('0xa4')],_0x214bb3[_0x82bd('0xc8')]);}}break;case _0x82bd('0xc9'):_0x5b74cb[_0x82bd('0x3f')]+=0x1;_0x214bb3[_0x82bd('0xca')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x14,_0x82bd('0xcb'));ami[_0x82bd('0x24')](_0x82bd('0xcc'),ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xcd')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xce'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0x14,_0x82bd('0xcb'));rpcDb[_0x82bd('0x91')](_0x529cb2,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x214bb3['countagentrejectretry']>=_0x5b74cb[_0x82bd('0xcf')]){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xd0'));}else{rpcDb[_0x82bd('0xa1')](ut['scheduledAt'](_0x214bb3,'countagentrejectretry',_0x5b74cb[_0x82bd('0xd1')]),_0x214bb3['unlockAgent'],_0x214bb3[_0x82bd('0xc8')]);}}break;case _0x82bd('0xd2'):_0x5b74cb[_0x82bd('0x40')]+=0x1;_0x214bb3[_0x82bd('0xd3')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0xb,'Abandoned');rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xd4'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut['cloneAction'](_0x214bb3,0xf,'Global');rpcDb[_0x82bd('0x91')](_0x529cb2,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x214bb3[_0x82bd('0xd5')]>=_0x5b74cb[_0x82bd('0xd6')]){rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xd4'));}else{rpcDb[_0x82bd('0xa1')](ut['scheduledAt'](_0x214bb3,_0x82bd('0xd3'),_0x5b74cb[_0x82bd('0xd7')]),_0x214bb3[_0x82bd('0xa4')],_0x214bb3['activeContact']);}}break;case'18':_0x5b74cb['outboundUnknownCallsDay']+=0x1;_0x214bb3[_0x82bd('0xd8')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x12,_0x73c194[_0x82bd('0xd9')]||_0x73c194['dialstatus']);ami[_0x82bd('0x24')](_0x82bd('0xda'),ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xdb')));rpcDb['createCustomerHistory'](_0x214bb3,_0x82bd('0xdc'));if(ut['totalGlobal'](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb['createCustomerFinal'](_0x529cb2,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0x214bb3,_0x82bd('0xdc'));}delete this[_0x82bd('0x66')][_0x73c194[_0x82bd('0xb5')]];break;case'19':_0x5b74cb[_0x82bd('0xdd')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut[_0x82bd('0x9b')](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0x13,_0x73c194['cause-txt']||_0x73c194[_0x82bd('0xde')]);ami[_0x82bd('0x24')](_0x82bd('0xda'),ut[_0x82bd('0xa9')](_0x214bb3,_0x82bd('0xdb')));rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xdf'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut[_0x82bd('0x9f')](_0x214bb3,0xf,'Global');rpcDb[_0x82bd('0x91')](_0x529cb2,_0x82bd('0xdf'));}else{rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xdf'));}delete this['actions'][_0x73c194[_0x82bd('0xb5')]];break;default:if(_0x214bb3['dialAnswer']){ut[_0x82bd('0x75')](_0x5b74cb,_0x82bd('0xe0'));ut['loggerError'](_0x82bd('0xe1')+_0x5b74cb[_0x82bd('0x27')],_0x73c194);}_0x5b74cb[_0x82bd('0xdd')]+=0x1;_0x214bb3[_0x82bd('0x9a')]=ut['totalGlobal'](_0x214bb3);ut[_0x82bd('0x89')](_0x214bb3,0xc,_0x73c194[_0x82bd('0xd9')]||_0x73c194['dialstatus']);rpcDb[_0x82bd('0x8d')](_0x214bb3,_0x82bd('0xe2'));if(ut[_0x82bd('0x9b')](_0x214bb3)>=_0x5b74cb[_0x82bd('0x9e')]){_0x529cb2=ut['cloneAction'](_0x214bb3,0xf,_0x82bd('0xb9'));rpcDb['createCustomerFinal'](_0x529cb2,_0x82bd('0xe3'));}else{rpcDb[_0x82bd('0x91')](_0x214bb3,_0x82bd('0xe3'));}delete this[_0x82bd('0x66')][_0x73c194['linkedid']];}if(!(_0x214bb3[_0x82bd('0x6b')]&&_0x1384b0==='16')){ut['updateOriginated'](_0x5b74cb,_0x82bd('0xe4'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x214bb3[_0x82bd('0xb4')],_0x82bd('0xa8'),_0x5b74cb['name'],'originated:\x20',_0x5b74cb['originated']);}if(_0x1384b0!==_0x82bd('0xa5')){delete this['actions'][_0x73c194['linkedid']];delete this[_0x82bd('0x66')][_0x73c194[_0x82bd('0xe5')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x522cd9,_0x474a90,_0x5420d7){if(_[_0x82bd('0xe6')](_0x474a90)&&_0x82bd('0xe7')!==typeof _0x474a90){return;}if(_[_0x82bd('0xe6')](_0x5420d7)&&_0x82bd('0xe7')!==typeof _0x5420d7){return;}switch(_0x5420d7['reason']){case'0':ut[_0x82bd('0xe8')](_0x522cd9,0x0,_0x82bd('0x9c'));rpcDb['createAgentHistory'](_0x522cd9,_0x82bd('0xe9'));break;case'3':ut[_0x82bd('0xe8')](_0x522cd9,0x3,_0x82bd('0xbd'));rpcDb[_0x82bd('0xea')](_0x522cd9,_0x82bd('0xeb'));break;case'5':ut['logAgent'](_0x522cd9,0x5,_0x82bd('0xb6'));rpcDb[_0x82bd('0xea')](_0x522cd9,_0x82bd('0xec'));break;case'8':ut[_0x82bd('0xe8')](_0x522cd9,0x8,'Congestion');rpcDb[_0x82bd('0xea')](_0x522cd9,_0x82bd('0xed'));break;case'22':ut[_0x82bd('0xe8')](_0x522cd9,0x16,_0x82bd('0xee'));rpcDb[_0x82bd('0xea')](_0x522cd9,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x82bd('0xe8')](_0x522cd9,0xc,_0x5420d7[_0x82bd('0xef')]);rpcDb[_0x82bd('0xea')](_0x522cd9,'[callProgressDetectingAgent][logCongestion]');}ut['updateOriginated'](_0x474a90,_0x82bd('0xf0'));logger[_0x82bd('0x56')]('[originated][decrement][callProgressDetectingAgent]',_0x522cd9[_0x82bd('0xb4')],_0x82bd('0xa8'),_0x474a90[_0x82bd('0x27')],'originated:\x20',_0x474a90['originated']);delete this['actions'][_0x522cd9[_0x82bd('0xb4')]];};Preview[_0x82bd('0x5f')]['checkInBlack']=function(_0x5b7ce7,_0x3d5989,_0x176619,_0x481be2,_0x4d4c4a){var _0xd4db5e=this;return new BPromise(function(_0x55e9f5,_0xb3dbc2){if(_[_0x82bd('0x7e')](_0x3d5989)||_[_0x82bd('0x7e')](_0x3d5989[_0x82bd('0xf1')])||_['isNil'](_0x3d5989[_0x82bd('0xf1')][_0x82bd('0xf2')])||_[_0x82bd('0x7e')](_0x3d5989['VoiceQueueId'])){_0xb3dbc2(ut[_0x82bd('0x4a')](_0x82bd('0xf3'),_0x481be2,_0x4d4c4a));return;}var _0x58cc4f=uuid['v4']();var _0x1efe45=_0xd4db5e[_0x82bd('0x23')][_0x3d5989['Queue'][_0x82bd('0x27')]];var _0xf5b6ff=_0x176619?_0xd4db5e[_0x82bd('0x14')][_0x176619]['id']:undefined;_0xd4db5e[_0x82bd('0x66')][_0x58cc4f]=new Action(_0x3d5989,_0x1efe45,_0x58cc4f,_0x176619,_0xf5b6ff);var _0x152529=_0xd4db5e[_0x82bd('0x66')][_0x58cc4f];_0x152529['unlockAgent']=_0x481be2;_0x152529[_0x82bd('0xc8')]=_0x4d4c4a;_0x152529['lookAgent']=_0x176619;if(_[_0x82bd('0xf4')](_0x5b7ce7)){_0xd4db5e[_0x82bd('0xf5')](_0x152529,_0x1efe45,_0x3d5989,_0x176619)[_0x82bd('0x7d')](function(_0x15f791){logger[_0x82bd('0x56')](_0x82bd('0xf6'),_0x82bd('0xf7')+_0x152529[_0x82bd('0x69')]+_0x82bd('0xf8')+_0x152529[_0x82bd('0xf9')],JSON[_0x82bd('0x54')](_0x15f791));ami[_0x82bd('0x24')](_0x82bd('0xfa'),ut[_0x82bd('0xa9')](_0x152529,_0x82bd('0xfb'),_0xd4db5e[_0x82bd('0x23')][_0x152529[_0x82bd('0x69')]]));_0x55e9f5(ut[_0x82bd('0x4a')]('Calling'));})[_0x82bd('0x72')](function(_0x5d8ecd){ut[_0x82bd('0x5c')](_0x82bd('0xfc'),_0x5d8ecd);_0xb3dbc2(ut[_0x82bd('0x4a')](_0x82bd('0xfd'),_0x481be2,_0x4d4c4a));});}else{_0x1efe45['outboundBlacklistCallsDay']+=0x1;ut[_0x82bd('0xfe')](_0x152529);rpcDb[_0x82bd('0xff')](_0x152529,_0x82bd('0x100'));delete _0xd4db5e[_0x82bd('0x66')][_0x58cc4f];_0xb3dbc2(ut[_0x82bd('0x4a')](_0x82bd('0x101'),_0x481be2,_0x4d4c4a));}});};Preview[_0x82bd('0x5f')][_0x82bd('0x95')]=function(_0x168321){return!_[_0x82bd('0x7e')](_0x168321)&&!_[_0x82bd('0x7e')](_0x168321[_0x82bd('0x27')])&&!_['isNil'](_0x168321[_0x82bd('0x51')])&&_0x168321['active']&&!_[_0x82bd('0x7e')](this[_0x82bd('0x13')][util['format'](_0x82bd('0x102'),_0x168321[_0x82bd('0x27')])])&&!_[_0x82bd('0x7e')](this[_0x82bd('0x13')][util[_0x82bd('0x55')](_0x82bd('0x102'),_0x168321['name'])]['status'])&&(this[_0x82bd('0x13')][util[_0x82bd('0x55')](_0x82bd('0x102'),_0x168321[_0x82bd('0x27')])][_0x82bd('0x71')]===_0x82bd('0x103')||this[_0x82bd('0x13')][util[_0x82bd('0x55')](_0x82bd('0x102'),_0x168321[_0x82bd('0x27')])][_0x82bd('0x71')]===_0x82bd('0x104'));};Preview['prototype'][_0x82bd('0x85')]=function(_0x57d59f,_0x34e5bc){var _0x120d2e=this;return new BPromise(function(_0x17d311,_0x2360ad){_0x120d2e['execRun'](_0x57d59f,_0x34e5bc)[_0x82bd('0x7d')](function(_0xc7c1e0){_0x17d311(_[_0x82bd('0x6c')](_0xc7c1e0,['message']));})[_0x82bd('0x72')](function(_0x185afc){if(_0x185afc[_0x82bd('0x105')]){rpcDb[_0x82bd('0x106')](_0x57d59f);}if(_0x185afc[_0x82bd('0x51')]){rpcDb[_0x82bd('0x88')](_0x57d59f);}_0x2360ad(_[_0x82bd('0x6c')](_0x185afc,[_0x82bd('0x4a')]));});});};Preview[_0x82bd('0x5f')][_0x82bd('0x107')]=function(_0x32c91b,_0x1041a4){var _0x363efd=this;return new BPromise(function(_0x27a6d1,_0x40d215){var _0x532402,_0x4c80f3;rpcDb[_0x82bd('0x108')](_0x32c91b)[_0x82bd('0x7d')](function(_0x53e7e3){if(!_[_0x82bd('0x7e')](_0x53e7e3[0x0])){_0x4c80f3=_0x53e7e3[0x0]['recallme']?![]:!![];_0x532402=_0x53e7e3[0x0]['recallme']?!![]:![];_0x532402=_0x1041a4?!![]:_0x532402;}var _0x3d8a55=_0x363efd['validateContact'](_0x53e7e3);if(_0x3d8a55['isValid']){rpcDb['checkIsBlackList'](_[_0x82bd('0x6c')](_0x53e7e3[0x0],[_0x82bd('0x6f'),_0x82bd('0x109')]))['then'](function(_0x4c68cc){_0x363efd[_0x82bd('0x10a')](_0x4c68cc,_0x53e7e3[0x0],_0x1041a4,_0x4c80f3,_0x532402)[_0x82bd('0x7d')](function(_0x4832bc){_0x27a6d1(_0x4832bc);})[_0x82bd('0x72')](function(_0x551565){_0x40d215(_0x551565);});})[_0x82bd('0x72')](function(_0x447d22){ut[_0x82bd('0x5c')]('[Preview][checkIsBlackList]',_0x447d22);_0x40d215(ut['message'](_0x82bd('0x10b'),_0x4c80f3,_0x532402));});}else{_0x40d215(ut[_0x82bd('0x4a')](_0x3d8a55[_0x82bd('0x4a')],_0x4c80f3,_0x532402));}})['catch'](function(_0x4b28f6){ut[_0x82bd('0x5c')](_0x82bd('0x10c'),_0x4b28f6);_0x40d215(ut['message'](_0x82bd('0x10b'),![],!![]));});});};Preview[_0x82bd('0x5f')][_0x82bd('0x10d')]=function(_0xc5ece9){if(_[_0x82bd('0x7e')](_0xc5ece9)||_[_0x82bd('0xf4')](_0xc5ece9)||!_[_0x82bd('0x7e')](_0xc5ece9[0x0][_0x82bd('0x83')])&&_[_0x82bd('0x7e')](_0xc5ece9[0x0][_0x82bd('0x83')][_0x82bd('0x27')])){ut[_0x82bd('0x5c')](_0x82bd('0x10e'),_0xc5ece9);return{'isValid':![],'message':_0x82bd('0x10f')};}var _0x5a6bea=this[_0x82bd('0x23')][_0xc5ece9[0x0][_0x82bd('0x68')][_0x82bd('0x27')]];_0x5a6bea[_0x82bd('0x4a')]=_0x82bd('0x97');if(_[_0x82bd('0x7e')](_0x5a6bea)){ut[_0x82bd('0x5c')]('[Preview][validateContact][Empty\x20Campaign]',_0x5a6bea);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x82bd('0x95')](_0x5a6bea[_0x82bd('0x50')])){ut[_0x82bd('0x5c')](_0x82bd('0x110'),_0x82bd('0x111')+_0x5a6bea[_0x82bd('0x27')]+_0x82bd('0x112'));if(!this[_0x82bd('0x95')](_0x5a6bea[_0x82bd('0x96')])){ut[_0x82bd('0x5c')](_0x82bd('0x110'),_0x5a6bea[_0x82bd('0x27')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x82bd('0x113')};}}if(!ut['isActive'](_0x5a6bea['dialActive'])){ut['logger'](_0x82bd('0x114'),_0x5a6bea['name']+_0x82bd('0x115'));return{'isValid':![],'message':_0x82bd('0x111')+_0x5a6bea['name']+_0x82bd('0x115')};}return{'isValid':!![],'message':_0x82bd('0x116')};};Preview[_0x82bd('0x5f')]['execCall']=function(_0x566239,_0x2b4787,_0x5cb7a5,_0x3ab38c){var _0x498b48=this;return new BPromise(function(_0xf6200a,_0x92c75e){var _0x2bfd3a=_0x566239[_0x82bd('0xb4')];var _0x442311=_0x498b48[_0x82bd('0x95')](_0x2b4787[_0x82bd('0x50')])?util['format'](_0x82bd('0x117'),_0x2b4787['Trunk'][_0x82bd('0x27')],_[_0x82bd('0x7e')](_0x2b4787['dialPrefix'])?'':_0x2b4787[_0x82bd('0x118')]['trim']()||'',_0x2b4787[_0x82bd('0x119')]>0x0?_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')][_0x82bd('0x11a')](_0x2b4787[_0x82bd('0x119')]):_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')]):util[_0x82bd('0x55')](_0x82bd('0x117'),_[_0x82bd('0x7e')](_0x2b4787[_0x82bd('0x96')])?_0x2b4787['Trunk'][_0x82bd('0x27')]:_0x2b4787[_0x82bd('0x96')][_0x82bd('0x27')],_[_0x82bd('0x7e')](_0x2b4787[_0x82bd('0x118')])?'':_0x2b4787[_0x82bd('0x118')]['trim']()||'',_0x2b4787[_0x82bd('0x119')]>0x0?_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')][_0x82bd('0x11a')](_0x2b4787[_0x82bd('0x119')]):_0x5cb7a5[_0x82bd('0xf1')][_0x82bd('0xf2')]);var _0xf046d4=_0x498b48[_0x82bd('0x95')](_0x2b4787[_0x82bd('0x50')])?ut[_0x82bd('0x11b')](_0x2b4787['Trunk'][_0x82bd('0x52')],_0x2b4787['dialOriginateCallerIdName'],_0x2b4787[_0x82bd('0x11c')]>0x0?ut[_0x82bd('0x11d')](_0x2b4787[_0x82bd('0x37')],_0x2b4787['dialRandomLastDigitCallerIdNumber']):_0x2b4787[_0x82bd('0x37')]):ut[_0x82bd('0x11b')](_[_0x82bd('0x7e')](_0x2b4787['TrunkBackup'])?_0x2b4787[_0x82bd('0x50')][_0x82bd('0x52')]:_0x2b4787[_0x82bd('0x96')][_0x82bd('0x52')],_0x2b4787[_0x82bd('0x36')],_0x2b4787[_0x82bd('0x11c')]>0x0?ut[_0x82bd('0x11d')](_0x2b4787[_0x82bd('0x37')],_0x2b4787[_0x82bd('0x11c')]):_0x2b4787[_0x82bd('0x37')]);if(_0xf046d4){_0x566239[_0x82bd('0x11e')]=ut[_0x82bd('0x11f')](_0xf046d4);_0x566239['originatecalleridnum']=ut[_0x82bd('0x120')](_0xf046d4);}var _0xd535fe=ut['addVariables'](_0x2b4787,_0x5cb7a5,_0x442311,_0xf046d4,_0x2bfd3a,_0x566239);_[_0x82bd('0x121')](_0x566239,ut[_0x82bd('0x122')](_0xd535fe));_0x566239[_0x82bd('0x123')]=moment()[_0x82bd('0x55')](_0x82bd('0xa6'));ami[_0x82bd('0x124')](ut['variablesAction'](_0x566239,_0x2b4787,_0xd535fe,_0x566239[_0x82bd('0xc8')],_0x3ab38c))[_0x82bd('0x7d')](function(_0x589d31){_0x2b4787[_0x82bd('0x59')]+=0x1;logger[_0x82bd('0x56')](_0x82bd('0x125'),_0x2bfd3a,_0x82bd('0xa8'),_0x2b4787['name'],_0x82bd('0x126'),_0x2b4787['originated']);_0xf6200a(_0x589d31);})[_0x82bd('0x72')](function(_0x492827){ut[_0x82bd('0xe8')](_0x566239,0xe,_0x82bd('0x127'));rpcDb[_0x82bd('0xea')](_0x566239,_0x82bd('0x128'));_0x92c75e(_0x492827);});});};Preview[_0x82bd('0x5f')][_0x82bd('0x1d')]=function(_0x107374){if(this['actions'][_0x107374[_0x82bd('0xb5')]]){this[_0x82bd('0x66')][_0x107374[_0x82bd('0xb5')]]['channel']=_0x107374[_0x82bd('0x129')];}};Preview[_0x82bd('0x5f')]['syncOriginateResponse']=function(_0x19b8c6){var _0x33fc4b=this;var _0x470919=this[_0x82bd('0x66')][_0x19b8c6[_0x82bd('0x12a')]];if(_0x470919){if(_0x470919['lookAgent']&&this['agents'][_0x470919['lookAgent']]){ut[_0x82bd('0x12b')](_0x470919,this['agents'][_0x470919[_0x82bd('0x12c')]][_0x82bd('0x27')],this[_0x82bd('0x14')][_0x470919['lookAgent']]['id']);}var _0x36b26c=_[_0x82bd('0x12d')](_0x470919);_0x36b26c[_0x82bd('0xa7')]=moment()[_0x82bd('0x55')](_0x82bd('0xa6'));var _0x4892fc=_0x33fc4b[_0x82bd('0x23')][_0x470919[_0x82bd('0x69')]];if(ut[_0x82bd('0x12e')](_0x19b8c6[_0x82bd('0x12f')])){if(_0x470919[_0x82bd('0xa4')]){rpcDb['unlockContact'](_0x470919[_0x82bd('0xf9')]);}if(_0x470919[_0x82bd('0xc8')]){rpcDb[_0x82bd('0x88')](_0x470919['idContact']);}ami[_0x82bd('0x24')](_0x82bd('0x130'),ut[_0x82bd('0xa9')](_0x470919,_0x82bd('0x131'),this[_0x82bd('0x23')][_0x470919[_0x82bd('0x69')]]));this['callProgressDetectingAgent'](_0x36b26c,_0x4892fc,_0x19b8c6);}else{_0x470919[_0x82bd('0x123')]=moment()[_0x82bd('0x55')](_0x82bd('0xa6'));ut[_0x82bd('0xe8')](_0x36b26c,0x4,_0x82bd('0x132'));rpcDb[_0x82bd('0xea')](_0x36b26c,_0x82bd('0x133'));}}};Preview[_0x82bd('0x5f')][_0x82bd('0x134')]=function(_0x23c7cd){var _0x4ae9f2=this;var _0x558860=this['actions'][_0x23c7cd[_0x82bd('0xb5')]];var _0x99351d;if(_0x558860){_0x99351d=this[_0x82bd('0x23')][_0x558860[_0x82bd('0x69')]];logger['info'](_0x82bd('0x135'),_0x23c7cd['linkedid'],_0x82bd('0xa8'),_0x99351d[_0x82bd('0x27')],_0x82bd('0x6a'),_0x99351d['pTalking']);}if(this[_0x82bd('0x66')][_0x23c7cd[_0x82bd('0xb5')]]&&_0x23c7cd['linkedid']!==_0x23c7cd[_0x82bd('0xb4')]){if(_0x23c7cd[_0x82bd('0x136')]==='16'&&this[_0x82bd('0x66')][_0x23c7cd[_0x82bd('0xb5')]][_0x82bd('0x6b')]){this['callProgressDetectingCustomer'](_0x23c7cd,_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')]);}else if(this['actions'][_0x23c7cd[_0x82bd('0xb5')]][_0x82bd('0x6b')]){logger[_0x82bd('0x56')](_0x82bd('0x137'),_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')],'\x20Queue',_0x99351d[_0x82bd('0x27')],_0x82bd('0x6a'),_0x99351d['pTalking']);this[_0x82bd('0x98')](_0x23c7cd,_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')]);}}else if(_0x558860&&_[_0x82bd('0x7e')](_0x558860[_0x82bd('0x138')])&&_0x99351d[_0x82bd('0x139')]&&_0x23c7cd['linkedid']===_0x23c7cd[_0x82bd('0xb4')]&&_[_0x82bd('0x7e')](_0x23c7cd[_0x82bd('0xef')])&&_0x23c7cd['cause']==='16'&&_0x23c7cd[_0x82bd('0x13a')]==='6'&&_[_0x82bd('0xe6')](_0x558860['transfer'])){if(_0x558860['unlockAgent']){rpcDb[_0x82bd('0x106')](_0x558860['idContact']);}if(_0x558860[_0x82bd('0xc8')]){rpcDb[_0x82bd('0x88')](_0x558860['idContact']);}_0x23c7cd[_0x82bd('0xef')]='22';this[_0x82bd('0x13b')](_0x558860,_0x99351d,_0x23c7cd);}else if(_0x558860&&_0x558860['transfer']){if(_0x23c7cd[_0x82bd('0x136')]==='16'&&this[_0x82bd('0x66')][_0x23c7cd[_0x82bd('0xb5')]]['dialAnswer']){logger[_0x82bd('0x56')](_0x82bd('0x13c'),_0x23c7cd['linkedid'],_0x23c7cd['cause'],_0x82bd('0xa8'),_0x99351d['name'],_0x82bd('0x6a'),_0x99351d[_0x82bd('0x2c')]);this[_0x82bd('0x98')](_0x23c7cd,_0x23c7cd['linkedid'],_0x23c7cd['cause']);}else if(this[_0x82bd('0x66')][_0x23c7cd['linkedid']]['dialAnswer']){logger[_0x82bd('0x56')]('[syncHangup][talking][cause]',_0x23c7cd['linkedid'],_0x23c7cd['cause'],_0x82bd('0xa8'),_0x99351d['name'],_0x82bd('0x6a'),_0x99351d[_0x82bd('0x2c')]);this[_0x82bd('0x98')](_0x23c7cd,_0x23c7cd[_0x82bd('0xb5')],_0x23c7cd[_0x82bd('0x136')]);}}};Preview[_0x82bd('0x5f')][_0x82bd('0x1b')]=function(_0x3aad63){if(this[_0x82bd('0x66')][_0x3aad63['destlinkedid']]&&_0x3aad63[_0x82bd('0xe5')]!==_0x3aad63[_0x82bd('0x13d')]){this[_0x82bd('0x98')](_0x3aad63,_0x3aad63[_0x82bd('0xe5')],_0x3aad63['dialstatus']);}};Preview[_0x82bd('0x5f')][_0x82bd('0x19')]=function(_0x39654c){if(this['actions'][_0x39654c['linkedid']]&&_0x39654c[_0x82bd('0xb5')]!==_0x39654c['uniqueid']&&!this[_0x82bd('0x66')][_0x39654c[_0x82bd('0xb5')]]['dialAnswer']){if(_0x39654c[_0x82bd('0x136')]==='1'){this['callProgressDetectingCustomer'](_0x39654c,_0x39654c[_0x82bd('0xb5')],_0x39654c[_0x82bd('0x136')]);}}};Preview[_0x82bd('0x5f')][_0x82bd('0x13e')]=function(_0x4b10b6,_0x31b15c,_0xf4de24){if(this[_0x82bd('0x66')][_0x4b10b6]){if(_[_0x82bd('0x7e')](this[_0x82bd('0x66')][_0x4b10b6]['variables'])){this[_0x82bd('0x66')][_0x4b10b6][_0x82bd('0x13f')]={};}this[_0x82bd('0x66')][_0x4b10b6][_0x82bd('0x13f')][_0x31b15c]=_0xf4de24;}};Preview['prototype'][_0x82bd('0x1f')]=function(_0x449a42){try{if(!_['isNil'](_0x449a42)){if(ut[_0x82bd('0x140')](_[_0x82bd('0x141')](_0x449a42[_0x82bd('0x142')])[0x0])){this['addVariable'](_0x449a42[_0x82bd('0xb4')],_[_0x82bd('0x141')](_0x449a42[_0x82bd('0x142')])[0x0],_0x449a42['value']);}}}catch(_0x2a6c02){logger[_0x82bd('0x143')](_0x82bd('0x144'),util[_0x82bd('0x145')](_0x2a6c02,{'showHidden':![],'depth':null}));}};Preview[_0x82bd('0x5f')]['syncAttendedTransfer']=function(_0x5b11b2){if(_0x5b11b2){if(this['actions'][_0x5b11b2['transfertargetlinkedid']]){this['actions'][_0x5b11b2['transfertargetlinkedid']][_0x82bd('0x146')]=!![];}}};Preview['prototype'][_0x82bd('0x147')]=function(_0x5208bb){if(_0x5208bb){if(this[_0x82bd('0x66')][_0x5208bb[_0x82bd('0x148')]]){this[_0x82bd('0x66')][_0x5208bb[_0x82bd('0x148')]][_0x82bd('0x146')]=!![];}}};module['exports']=Preview; \ No newline at end of file +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 diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 61b9d17..56432a9 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 _0xa1b7=['queue','answertime','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','exten','xcally-motion-preview','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','uniqueid','calleridnum','calleridname'];(function(_0xa72be2,_0x31307d){var _0x1616f8=function(_0xac6bf7){while(--_0xac6bf7){_0xa72be2['push'](_0xa72be2['shift']());}};_0x1616f8(++_0x31307d);}(_0xa1b7,0x11a));var _0x7a1b=function(_0x182bfc,_0x474a4b){_0x182bfc=_0x182bfc-0x0;var _0xd9e32a=_0xa1b7[_0x182bfc];return _0xd9e32a;};'use strict';var util=require('util');var BPromise=require(_0x7a1b('0x0'));var logger=require(_0x7a1b('0x1'))(_0x7a1b('0x2'));var _=require(_0x7a1b('0x3'));var cmHopper=require(_0x7a1b('0x4'));var cmHopperFinal=require(_0x7a1b('0x5'));var cmHopperHistory=require(_0x7a1b('0x6'));var cmHopperBlack=require(_0x7a1b('0x7'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x7a1b('0x8'));function loggerCatch(_0xb4b9fe){return function(_0x4084e6){logger['error'](_0xb4b9fe,util[_0x7a1b('0x9')](_0x4084e6,{'showHidden':![],'depth':null}));};}function create(_0x411c8c){return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](cmHopperHistory[_0x7a1b('0xc')](_0x411c8c))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0xe')));}function createAgent(_0x38afbf){return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](agentReportPreview[_0x7a1b('0xc')](_0x38afbf))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0xe')));}function moveContact(_0xf2c5b0){return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](cmHopper[_0x7a1b('0xf')](_0xf2c5b0,!![]))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x10')));}exports['checkIsBlackList']=function(_0x2acaad){return BPromise['resolve']()[_0x7a1b('0xb')](cmHopperBlack[_0x7a1b('0x11')](_0x2acaad))['catch'](loggerCatch(_0x7a1b('0x12')));};exports[_0x7a1b('0x13')]=function(_0xf58e5b){return BPromise['resolve']()[_0x7a1b('0xb')](cmHopper[_0x7a1b('0x13')](_0xf58e5b))[_0x7a1b('0xd')](loggerCatch('[getContactPreview]\x20'));};exports[_0x7a1b('0xc')]=function(_0x1bf3c8,_0x5f177d){create(_0x1bf3c8)[_0x7a1b('0xd')](loggerCatch(_0x5f177d));moveContact(_0x1bf3c8)['catch'](loggerCatch(_0x5f177d));};exports[_0x7a1b('0x14')]=function(_0x2fea1c,_0x3b290b){createAgent(_0x2fea1c)['catch'](loggerCatch(_0x3b290b));};exports[_0x7a1b('0x15')]=function(_0x1df3d4,_0x11843a){create(_0x1df3d4)[_0x7a1b('0xd')](loggerCatch(_0x11843a));};exports[_0x7a1b('0x16')]=function(_0x5ae002,_0x22d9cf){moveContact(_0x5ae002)['catch'](loggerCatch(_0x22d9cf));};exports['rescheduleContact']=function(_0x2f0db5,_0x43c2e5,_0x5881dc){if(_0x43c2e5){_0x2f0db5[_0x7a1b('0x17')]=null;}if(_0x5881dc){_0x2f0db5['active']=![];}return BPromise['resolve']()[_0x7a1b('0xb')](cmHopper[_0x7a1b('0x18')](_0x2f0db5))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x19')));};exports[_0x7a1b('0x1a')]=function(_0x515bda){return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](cmHopper[_0x7a1b('0x1a')](_0x515bda))['catch'](loggerCatch(_0x7a1b('0x1b')));};exports[_0x7a1b('0x1c')]=function(_0x1c4217){return BPromise['resolve']()[_0x7a1b('0xb')](cmHopper[_0x7a1b('0x1c')]({'UserId':null},_0x1c4217,0x1))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x1d')));};exports[_0x7a1b('0x1e')]=function(_0x5d141e){return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](cmHopper['unlockContact']({'active':![]},_0x5d141e,0x1))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x1f')));};exports[_0x7a1b('0x20')]=function(_0x2ceed1){var _0x379f2c={};_0x379f2c['type']=_0x2ceed1['type'];_0x379f2c[_0x7a1b('0x21')]=_0x2ceed1[_0x7a1b('0x21')];_0x379f2c['calleridnum']=_0x2ceed1[_0x7a1b('0x22')];_0x379f2c[_0x7a1b('0x23')]=_0x2ceed1[_0x7a1b('0x23')];_0x379f2c['queue']=_0x2ceed1[_0x7a1b('0x24')];_0x379f2c['queuecallerjoinAt']=_0x2ceed1[_0x7a1b('0x25')];_0x379f2c['queuecallerleaveAt']=_0x2ceed1[_0x7a1b('0x25')];_0x379f2c[_0x7a1b('0x26')]=0x1;_0x379f2c['queuecallercompleteAt']=_0x2ceed1[_0x7a1b('0x27')];_0x379f2c[_0x7a1b('0x28')]=_0x2ceed1[_0x7a1b('0x29')];_0x379f2c[_0x7a1b('0x2a')]=_0x7a1b('0x2b');_0x379f2c[_0x7a1b('0x2c')]=_0x7a1b('0x2d');_0x379f2c['holdtime']=0x0;_0x379f2c['assigned']=0x1;_0x379f2c['lastAssignedTo']=_0x2ceed1[_0x7a1b('0x29')];_0x379f2c['queuecallerexitreason']=_0x7a1b('0x2e');return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](voiceQueueReport[_0x7a1b('0x2f')](_0x379f2c))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x30')));};exports[_0x7a1b('0x31')]=function(_0x5f8bf6,_0xd3bee7){return BPromise[_0x7a1b('0xa')]()['then'](cmHopper[_0x7a1b('0x31')](_0x5f8bf6,_0xd3bee7))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x32')));};exports[_0x7a1b('0x33')]=function(_0x2b3f3d){return BPromise[_0x7a1b('0xa')]()[_0x7a1b('0xb')](cmHopper[_0x7a1b('0x18')](_0x2b3f3d,!![],!![]))[_0x7a1b('0xd')](loggerCatch(_0x7a1b('0x34')));}; \ No newline at end of file +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 diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 6daae00..434ad7a 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 _0x2ca2=['getDiff','createBody','CampaignId','idContact','type','dialAnswer','membername','calleridname','countcongestionretry','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosbridged','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','\x5cw{0,','pow','random','extractCalleridName','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','logger','info','inspect','error','logger2','message','getCallerId','isUndefined','string','isEmpty','format','isActive','isNil','addVariables','Queue','name','\x22%s\x22\x20<%s>','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','toUpper','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','logAgent','state','ringtime','logLookAgent','UserId','logCustomer','endtime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','calleridnum','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','queue','motionChannel','voice','mandatoryDisposition','buildAcw','interface','channelAgent','agentReadyId','status','reachable','push'];(function(_0x9f4cc3,_0x1d5cde){var _0x490ff9=function(_0x1d1459){while(--_0x1d1459){_0x9f4cc3['push'](_0x9f4cc3['shift']());}};_0x490ff9(++_0x1d5cde);}(_0x2ca2,0xb0));var _0x22ca=function(_0x90c5c,_0x55791f){_0x90c5c=_0x90c5c-0x0;var _0x576422=_0x2ca2[_0x90c5c];return _0x576422;};'use strict';var util=require(_0x22ca('0x0'));var _=require(_0x22ca('0x1'));var moment=require(_0x22ca('0x2'));var logger=require(_0x22ca('0x3'))('preview');var ipAgi=process[_0x22ca('0x4')][_0x22ca('0x5')]||_0x22ca('0x6');function getSeconds(_0x2981dd,_0x563986){var _0x220232=moment(_0x2981dd)['milliseconds'](0x0);var _0x2aee54=moment(_0x563986)[_0x22ca('0x7')](0x0);return _0x220232[_0x22ca('0x8')](_0x2aee54,_0x22ca('0x9'));}exports[_0x22ca('0xa')]=function(_0x1a0f10){return function(_0x14f10a){logger['error'](_0x1a0f10,util['inspect'](_0x14f10a,{'showHidden':![],'depth':null}));};};exports[_0x22ca('0xb')]=function(_0x535e38,_0x1fd2c7){logger[_0x22ca('0xc')](_0x535e38,util[_0x22ca('0xd')](_0x1fd2c7,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x57e9ae,_0x63f123){logger[_0x22ca('0xe')](_0x57e9ae,util[_0x22ca('0xd')](_0x63f123,{'showHidden':![],'depth':null}));};exports[_0x22ca('0xf')]=function(_0x4d1a53){return function(_0x427b5d){logger['info'](_0x4d1a53,util[_0x22ca('0xd')](_0x427b5d,{'showHidden':![],'depth':null}));};};exports[_0x22ca('0x10')]=function(_0x59fb20,_0x5eb646,_0x39d7ee){return{'message':_0x59fb20,'unlock':_0x5eb646,'active':_0x39d7ee};};exports[_0x22ca('0x11')]=function(_0x3c1979,_0x23af25,_0x564ea4){if(!_[_0x22ca('0x12')](_0x564ea4)&&_0x22ca('0x13')===typeof _0x564ea4&&!_[_0x22ca('0x14')](_0x564ea4)){if(!_['isUndefined'](_0x23af25)&&'string'===typeof _0x23af25&&!_[_0x22ca('0x14')](_0x23af25)){return util['format']('\x22%s\x22\x20<%s>',_0x23af25,_0x564ea4);}return util[_0x22ca('0x15')]('\x22%s\x22\x20<%s>',_0x564ea4,_0x564ea4);}if(!_[_0x22ca('0x12')](_0x3c1979)&&_0x22ca('0x13')===typeof _0x3c1979&&!_[_0x22ca('0x14')](_0x3c1979)){return _0x3c1979;}return'\x22\x22\x20<>';};exports[_0x22ca('0x16')]=function(_0x1a769d){if(_[_0x22ca('0x17')](_0x1a769d)){return![];}return _0x1a769d;};exports[_0x22ca('0x18')]=function(_0x45f817,_0x57fb8a,_0x1bc62f,_0x5bfa88,_0x6b991f,_0x4b92f5){var _0x4f2212={'XMD-QUEUE':_0x57fb8a[_0x22ca('0x19')]?_0x57fb8a['Queue'][_0x22ca('0x1a')]:'','XMD-CALLERID':_0x5bfa88,'XMD-CALLERID-PREVIEW':_0x4b92f5?util[_0x22ca('0x15')](_0x22ca('0x1b'),_0x4b92f5['calleridname'],_0x4b92f5['calleridnum']):_0x5bfa88,'XMD-DIALID':_0x6b991f,'XMD-CONTACTID':_0x57fb8a[_0x22ca('0x1c')],'XMD-CDRTYPE':_0x22ca('0x1d'),'CALLERID(all)':_0x5bfa88,'XMD-VOICEQUEUEID':_0x57fb8a[_0x22ca('0x1e')],'XMD-DIALCHANNEL':_0x1bc62f,'XMD-DIALTIMEOUT':_0x45f817[_0x22ca('0x1f')]||0x1e,'XMD-DIALOPTIONS':util[_0x22ca('0x15')](_0x22ca('0x20'),_0x45f817[_0x22ca('0x21')]?'g':'',_[_0x22ca('0x14')](_0x45f817[_0x22ca('0x22')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x45f817[_0x22ca('0x23')]||'','XMD-AGI':_0x45f817['dialQueueProject']?util[_0x22ca('0x15')](_0x22ca('0x24'),ipAgi,_0x45f817['dialQueueProject']):_0x22ca('0x25'),'XMD-AGIAFTER':_0x45f817[_0x22ca('0x21')]?util['format'](_0x22ca('0x24'),ipAgi,_0x45f817[_0x22ca('0x21')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x4b92f5?_0x4b92f5[_0x22ca('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x4b92f5?_0x4b92f5[_0x22ca('0x27')]:'','XMD-DESTINATION':_0x22ca('0x28'),'SIPADDHEADER':_0x22ca('0x29')};if(!_[_0x22ca('0x14')](_0x45f817[_0x22ca('0x22')])){_0x4f2212[util['format']('%s',_0x22ca('0x2a'))]=_0x45f817[_0x22ca('0x22')];_0x4f2212[util[_0x22ca('0x15')]('%s',_0x22ca('0x2b'))]=_0x6b991f;}if(_0x57fb8a&&_0x57fb8a[_0x22ca('0x2c')]){for(var _0x366594 in _0x57fb8a['Contact']){if(_0x57fb8a['Contact'][_0x22ca('0x2d')](_0x366594)){if(!_[_0x22ca('0x17')](_0x57fb8a['Contact'][_0x366594])&&_0x366594!=='id'&&_0x366594!==_0x22ca('0x2e')&&_0x366594!==_0x22ca('0x2f')&&_0x366594!=='updatedAt'){_0x4f2212[util[_0x22ca('0x15')]('%s%s','XMD-',_[_0x22ca('0x30')](_0x366594))]=_0x57fb8a[_0x22ca('0x2c')][_0x366594];}}}}return _0x4f2212;};exports[_0x22ca('0x31')]=function(_0x21ad02){var _0x17407b={};for(var _0x2306a1 in _0x21ad02){if(_0x21ad02[_0x22ca('0x2d')](_0x2306a1)){_0x17407b[util[_0x22ca('0x15')]('%s',_['toLower'](_0x2306a1))]=_0x21ad02[_0x2306a1];}}return{'variables':_0x17407b};};exports['updateOriginated']=function(_0x5cefae,_0x275543){if(!_[_0x22ca('0x17')](_0x5cefae)){if(_0x5cefae[_0x22ca('0x2d')](_0x22ca('0x32'))){if(_0x5cefae[_0x22ca('0x32')]>0x0){_0x5cefae[_0x22ca('0x32')]-=0x1;}else{logger[_0x22ca('0xe')](_0x22ca('0x33'),_0x275543);}}}else{logger[_0x22ca('0xe')](_0x22ca('0x34'),_0x275543);}};exports[_0x22ca('0x35')]=function(_0x488230){var _0x5a79f0=moment()[_0x22ca('0x15')](_0x22ca('0x36'));_0x488230['state']=0xd;_0x488230[_0x22ca('0x37')]=_0x22ca('0x38');_0x488230[_0x22ca('0x39')]=_0x5a79f0;_0x488230[_0x22ca('0x3a')]=_0x5a79f0;_0x488230['endtime']=_0x5a79f0;};exports[_0x22ca('0x3b')]=function(_0x1f4f34,_0xfd417e,_0x156668){var _0x43fb0b=moment()[_0x22ca('0x15')](_0x22ca('0x36'));_0x1f4f34[_0x22ca('0x3c')]=_0xfd417e;_0x1f4f34['statedesc']=_0x156668;_0x1f4f34[_0x22ca('0x3a')]=_0x43fb0b;_0x1f4f34[_0x22ca('0x3d')]=getSeconds(_0x1f4f34[_0x22ca('0x3a')],_0x1f4f34[_0x22ca('0x39')]);};exports[_0x22ca('0x3e')]=function(_0x204d0e,_0x3e586d,_0x33beeb){_0x204d0e['membername']=_0x3e586d;_0x204d0e[_0x22ca('0x3f')]=_0x33beeb;};exports[_0x22ca('0x40')]=function(_0x559599,_0x483a5e,_0x1b3b44){var _0x2cbae0=moment()[_0x22ca('0x15')](_0x22ca('0x36'));_0x559599['state']=_0x483a5e;_0x559599[_0x22ca('0x37')]=_0x1b3b44;_0x559599['responsetime']=_0x559599['responsetime']?_0x559599[_0x22ca('0x3a')]:_0x2cbae0;_0x559599[_0x22ca('0x41')]=_0x559599[_0x22ca('0x41')]?_0x559599['endtime']:_0x2cbae0;_0x559599[_0x22ca('0x3d')]=getSeconds(_0x559599[_0x22ca('0x3a')]||0x0,_0x559599[_0x22ca('0x39')]||0x0);_0x559599['talktime']=_0x559599[_0x22ca('0x42')]?getSeconds(_0x559599['endtime'],_0x559599[_0x22ca('0x42')]):0x0;};exports['isFailure']=function(_0x5cb9d4){return _0x5cb9d4===_0x22ca('0x43');};exports[_0x22ca('0x44')]=function(_0x562b59,_0x1f844d,_0x54faba,_0x371e02,_0x26f032){var _0x3b8085=_0x371e02?_0x22ca('0x45'):_0x562b59['calleridname'];_0x3b8085=_0x26f032?_0x22ca('0x46'):_0x3b8085;return{'actionid':_0x562b59[_0x22ca('0x47')],'action':_0x22ca('0x48'),'channel':_0x562b59['channelAgent'],'callerid':util[_0x22ca('0x15')](_0x22ca('0x1b'),_0x3b8085,_0x562b59[_0x22ca('0x49')]),'Exten':'xcally-motion-preview','Context':_0x22ca('0x4a'),'Priority':'1','variable':_0x54faba,'timeout':(_0x1f844d[_0x22ca('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x562b59[_0x22ca('0x47')]};};exports[_0x22ca('0x4c')]=function(_0x12edfa){return _0x12edfa[_0x22ca('0x4d')]+_0x12edfa['countcongestionretry']+_0x12edfa[_0x22ca('0x4e')]+_0x12edfa[_0x22ca('0x4f')]+_0x12edfa['countnosuchnumberretry'];};exports[_0x22ca('0x50')]=function(_0x387476){var _0x50fbcb=_[_0x22ca('0x51')](_0x387476);_0x50fbcb[_0x22ca('0x3c')]=0xf;_0x50fbcb[_0x22ca('0x37')]=_0x22ca('0x52');return _0x50fbcb;};exports[_0x22ca('0x53')]=function(_0x3bbb39,_0x1e1de6,_0x4dc8d0){var _0x4edb41={};_0x4edb41[_0x1e1de6]=_0x3bbb39[_0x1e1de6];_0x4edb41[_0x22ca('0x54')]=![];_0x4edb41[_0x22ca('0x55')]=moment()[_0x22ca('0x56')](_0x4dc8d0,_0x22ca('0x57'))[_0x22ca('0x15')]('YYYY-MM-DD\x20HH:mm:ss');_0x4edb41[_0x22ca('0x1c')]=_0x3bbb39[_0x22ca('0x1c')];_0x4edb41['ListId']=_0x3bbb39[_0x22ca('0x58')];_0x4edb41[_0x22ca('0x1e')]=_0x3bbb39[_0x22ca('0x1e')]||undefined;return _0x4edb41;};exports['decrementTalkink']=function(_0x56e08c,_0x134890){if(!_[_0x22ca('0x17')](_0x56e08c)){if(_0x56e08c[_0x22ca('0x59')]>0x0){_0x56e08c['pTalking']-=0x1;}else{logger[_0x22ca('0xe')](_0x134890,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x22ca('0xe')](_0x134890,_0x22ca('0x5a'));}};exports['IsNotLoggedIn']=function(_0x53cddc){if(_0x53cddc<=0x0){return!![];}return![];};exports[_0x22ca('0x5b')]=function(_0x5f3dbe,_0x1108a5,_0x396abf){_0x5f3dbe[_0x22ca('0x5c')]=_0x1108a5;_0x5f3dbe[_0x22ca('0x1a')]=_0x5f3dbe[_0x22ca('0x5d')];_0x5f3dbe['interface']=_0x5f3dbe['channelAgent'];_0x5f3dbe[_0x22ca('0x5e')]=_0x22ca('0x5f');if(_0x396abf){_0x5f3dbe[_0x22ca('0x60')]=_0x396abf['mandatoryDisposition'];}return _0x5f3dbe;};exports[_0x22ca('0x61')]=function(_0x29a356){var _0x88c472={};_0x88c472[_0x22ca('0x5d')]=_0x29a356[_0x22ca('0x5d')];_0x88c472[_0x22ca('0x62')]=_0x29a356[_0x22ca('0x63')];_0x88c472[_0x22ca('0x47')]=_0x29a356[_0x22ca('0x47')];return _0x88c472;};exports[_0x22ca('0x64')]=function(_0x56e480){var _0x4e318e=[];for(var _0xd38493 in _0x56e480){if(_0x56e480[_0x22ca('0x2d')](_0xd38493)){if(!_[_0x22ca('0x17')](_0x56e480[_0xd38493])&&_0x56e480[_0xd38493][_0x22ca('0x3c')]==='not_inuse'&&_0x56e480[_0xd38493][_0x22ca('0x65')]===_0x22ca('0x66')){_0x4e318e[_0x22ca('0x67')](_0x56e480[_0xd38493]['id']);}}}return _0x4e318e;};exports[_0x22ca('0x68')]=function(_0x5f40a3){var _0x1b41c6=moment()['milliseconds'](0x0);var _0x23d032=moment(_0x5f40a3)[_0x22ca('0x7')](0x0);return _0x1b41c6[_0x22ca('0x8')](_0x23d032,'seconds');};exports[_0x22ca('0x69')]=function(_0x1f33d9){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x1f33d9[_0x22ca('0x1c')],'ListId':_0x1f33d9[_0x22ca('0x58')],'VoiceQueueId':_0x1f33d9[_0x22ca('0x1e')]||undefined,'CampaignId':_0x1f33d9[_0x22ca('0x6a')]||undefined};};exports['filterKey']=function(_0x4c24fa){if(_0x4c24fa===_0x22ca('0x47')||_0x4c24fa===_0x22ca('0x6b')||_0x4c24fa==='queue'||_0x4c24fa===_0x22ca('0x6c')||_0x4c24fa==='campaigntype'||_0x4c24fa===_0x22ca('0x6d')||_0x4c24fa===_0x22ca('0x6e')||_0x4c24fa===_0x22ca('0x63')||_0x4c24fa===_0x22ca('0x6f')||_0x4c24fa===_0x22ca('0x54')||_0x4c24fa===_0x22ca('0x49')||_0x4c24fa===_0x22ca('0x55')||_0x4c24fa===_0x22ca('0x4d')||_0x4c24fa===_0x22ca('0x70')||_0x4c24fa===_0x22ca('0x4e')||_0x4c24fa===_0x22ca('0x71')||_0x4c24fa===_0x22ca('0x72')||_0x4c24fa===_0x22ca('0x73')||_0x4c24fa==='callbackat'||_0x4c24fa==='recallme'||_0x4c24fa===_0x22ca('0x1c')||_0x4c24fa==='ListId'||_0x4c24fa==='UserId'||_0x4c24fa==='VoiceQueueId'||_0x4c24fa===_0x22ca('0x74')||_0x4c24fa===_0x22ca('0x75')||_0x4c24fa===_0x22ca('0x76')||_0x4c24fa===_0x22ca('0x77')||_0x4c24fa===_0x22ca('0x78')||_0x4c24fa==='xmd-dialurl'||_0x4c24fa===_0x22ca('0x79')||_0x4c24fa==='xmd-dialoptions'||_0x4c24fa==='xmd-dialid'||_0x4c24fa===_0x22ca('0x7a')||_0x4c24fa===_0x22ca('0x7b')||_0x4c24fa==='xmd-cdrtype'||_0x4c24fa===_0x22ca('0x7c')||_0x4c24fa==='xmd-agiafter'||_0x4c24fa===_0x22ca('0x7d')||_0x4c24fa===_0x22ca('0x7e')||_0x4c24fa==='rtpaudioqosbridged'||_0x4c24fa===_0x22ca('0x7f')||_0x4c24fa===_0x22ca('0x80')||_0x4c24fa===_0x22ca('0x81')||_0x4c24fa==='rtpaudioqoslossbridged'||_0x4c24fa===_0x22ca('0x82')||_0x4c24fa===_0x22ca('0x83')||_0x4c24fa==='rtpaudioqos'||_0x4c24fa===_0x22ca('0x84')||_0x4c24fa==='rtpaudioqosjitter'||_0x4c24fa==='rtpaudioqosjitterbridged'||_0x4c24fa===_0x22ca('0x81')||_0x4c24fa===_0x22ca('0x85')||_0x4c24fa==='rtpaudioqosrtt'||_0x4c24fa==='rtpaudioqosrttbridged'||_0x4c24fa===_0x22ca('0x86')||_0x4c24fa===_0x22ca('0x87')||_0x4c24fa===_0x22ca('0x3c')||_0x4c24fa==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x310f6b,_0x2cba14){var _0x465904,_0x2b423a,_0x548892;if(_0x2cba14<=0x0){_0x2cba14=0x1;}_0x465904=new RegExp(_0x22ca('0x88')+_0x2cba14+'}$');_0x2b423a=Math['pow'](0xa,_0x2cba14-0x1);_0x548892=Math[_0x22ca('0x89')](0xa,_0x2cba14)-0x1;return util[_0x22ca('0x15')]('%s',_['replace'](_0x310f6b,_0x465904,_[_0x22ca('0x8a')](_0x2b423a,_0x548892)));};exports[_0x22ca('0x8b')]=function(_0x54aac6){var _0x231e43=_0x54aac6['match'](/"(.*?)"/);return _0x231e43?_0x231e43[0x1]:_0x54aac6;};exports['extractCalleridNumber']=function(_0x2a9265){var _0x4a8415=_0x2a9265['match'](/<(.*?)>/);return _0x4a8415?_0x4a8415[0x1]:_0x2a9265;}; \ No newline at end of file +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 diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 2218281..ae066cf 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 _0x1409=['voicequeuechannel','voicechannel','voicequeuechannelredirect','string','number','boolean'];(function(_0x1efb4a,_0x46acc8){var _0x30c4b9=function(_0x28f547){while(--_0x28f547){_0x1efb4a['push'](_0x1efb4a['shift']());}};_0x30c4b9(++_0x46acc8);}(_0x1409,0x177));var _0x9140=function(_0x214184,_0x4cf06b){_0x214184=_0x214184-0x0;var _0x198160=_0x1409[_0x214184];return _0x198160;};'use strict';exports['queueadd']={'queue':{'type':_0x9140('0x0'),'required':!![]},'interface':{'type':_0x9140('0x0'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x9140('0x1'),'required':![]},'paused':{'type':_0x9140('0x2'),'required':![]}};exports['queueremove']={'queue':{'type':_0x9140('0x0'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0x9140('0x0'),'required':!![]},'paused':{'type':_0x9140('0x2')},'reason':{'type':_0x9140('0x0'),'required':![]}};exports['reload']={'module':{'type':_0x9140('0x0'),'required':![]}};exports[_0x9140('0x3')]={'uniqueid':{'type':_0x9140('0x0'),'required':!![]}};exports[_0x9140('0x4')]={'uniqueid':{'type':_0x9140('0x0'),'required':!![]},'filename':{'type':_0x9140('0x0')},'format':{'type':_0x9140('0x0')},'mixmonitorid':{'type':_0x9140('0x0')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x9140('0x0'),'required':!![]}};exports[_0x9140('0x5')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x9140('0x0'),'required':!![]},'context':{'type':'string'}}; \ No newline at end of file +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 diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 9824882..7640e00 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 _0xdb6e=['servicenowAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','SIP/%s','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','format','isUndefined','initTelephones','telephones','length','initTrunks','trunks','voiceQueues','triggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','queuecallercompleteAt','queuecallerexitAt','diff','seconds','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','exports','util','lodash','moment','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','campaigns','outbound','voiceExtensions','queueChannels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts'];(function(_0x1ce89f,_0x3c3f80){var _0x5609f3=function(_0x28ec98){while(--_0x28ec98){_0x1ce89f['push'](_0x1ce89f['shift']());}};_0x5609f3(++_0x3c3f80);}(_0xdb6e,0x11b));var _0xedb6=function(_0x3d3394,_0x496f0e){_0x3d3394=_0x3d3394-0x0;var _0x1dc639=_0xdb6e[_0x3d3394];return _0x1dc639;};'use strict';var BPromise=require('bluebird');var util=require(_0xedb6('0x0'));var _=require(_0xedb6('0x1'));var moment=require(_0xedb6('0x2'));var Agent=require('../model/agent');var Telephone=require(_0xedb6('0x3'));var Trunk=require(_0xedb6('0x4'));var VoiceQueue=require(_0xedb6('0x5'));var Trigger=require(_0xedb6('0x6'));var Template=require(_0xedb6('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xedb6('0x8'));var ZendeskAccount=require(_0xedb6('0x9'));var SalesforceAccount=require(_0xedb6('0xa'));var FreshdeskAccount=require(_0xedb6('0xb'));var SugarcrmAccount=require(_0xedb6('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xedb6('0xd'));var VtigerAccount=require(_0xedb6('0xe'));var ServicenowAccount=require(_0xedb6('0xf'));var Dynamics365Account=require(_0xedb6('0x10'));var FreshsalesAccount=require(_0xedb6('0x11'));var FaxAccount=require(_0xedb6('0x12'));var Realtime=function(){this[_0xedb6('0x13')]={};this['telephones']={};this['trunks']={};this['voiceQueues']={};this['triggers']={};this[_0xedb6('0x14')]={};this['templates']={};this[_0xedb6('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xedb6('0x16')]={};this['channels']={};this[_0xedb6('0x17')]={};this[_0xedb6('0x18')]={};this['timers']={};this[_0xedb6('0x19')]={};this[_0xedb6('0x1a')]={};this[_0xedb6('0x1b')]={};this[_0xedb6('0x1c')]={};this['freshdeskAccounts']={};this[_0xedb6('0x1d')]={};this[_0xedb6('0x1e')]={};this[_0xedb6('0x1f')]={};this[_0xedb6('0x20')]={};this[_0xedb6('0x21')]={};this['freshsalesAccounts']={};this[_0xedb6('0x22')]={};};function freeIsNotKey(_0x372bd2,_0x5130c2,_0x5c60f3){var _0x14c828=_[_0xedb6('0x23')](_0x372bd2,function(_0x5b23e4,_0x14e425){return _0x5b23e4[_0x5c60f3];});for(var _0x16c15e in _0x5130c2){if(_0x5130c2['hasOwnProperty'](_0x16c15e)){if(!_0x14c828[_0x16c15e]){delete _0x5130c2[_0x16c15e];}}}}function freeIsNotKeySip(_0x125ffa,_0x402dc4){var _0x4e121a=_[_0xedb6('0x23')](_0x125ffa,function(_0x22db92,_0x3e9670){return util['format']('SIP/%s',_0x22db92[_0xedb6('0x24')]);});for(var _0x3f3cd2 in _0x402dc4){if(_0x402dc4[_0xedb6('0x25')](_0x3f3cd2)){if(!_0x4e121a[_0x3f3cd2]){delete _0x402dc4[_0x3f3cd2];}}}}function freeIsNotKeyAgent(_0x491151,_0x3a490a){var _0x1228d6=_[_0xedb6('0x23')](_0x491151,function(_0x4b15ea,_0x1f228a){var _0xe45188=_[_0xedb6('0x26')](_0x4b15ea[_0xedb6('0x27')])?util['format'](_0xedb6('0x28'),_0x4b15ea['name']):_0x4b15ea[_0xedb6('0x27')];return _0xe45188;});for(var _0x257f7d in _0x3a490a){if(_0x3a490a[_0xedb6('0x25')](_0x257f7d)){if(!_0x1228d6[_0x257f7d]){delete _0x3a490a[_0x257f7d];}}}}function clearVoiceCallReports(_0x443226){_0x443226[_0xedb6('0x29')]=0x0;_0x443226[_0xedb6('0x2a')]=0x0;_0x443226[_0xedb6('0x2b')]=0x0;_0x443226[_0xedb6('0x2c')]=0x0;_0x443226[_0xedb6('0x2d')]=0x0;}function clearCampaigns(_0x51e1f5){if(!_[_0xedb6('0x2e')](_0x51e1f5)){for(var _0x58ea0b in _0x51e1f5){if(_0x51e1f5[_0xedb6('0x25')](_0x58ea0b)){_0x51e1f5[_0x58ea0b][_0xedb6('0x2f')]=0x0;_0x51e1f5[_0x58ea0b][_0xedb6('0x30')]=0x0;}}}}function clearVoiceQueues(_0x4c5085){if(!_[_0xedb6('0x2e')](_0x4c5085)){for(var _0xd8fdb3 in _0x4c5085){if(_0x4c5085[_0xedb6('0x25')](_0xd8fdb3)){_0x4c5085[_0xd8fdb3]['total']=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x2a')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x31')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x32')]=0x0;_0x4c5085[_0xd8fdb3]['sumHoldTime']=0x0;_0x4c5085[_0xd8fdb3]['sumDuration']=0x0;_0x4c5085[_0xd8fdb3]['sumBillable']=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x33')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x34')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x35')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x36')]=0x0;_0x4c5085[_0xd8fdb3]['outboundNoSuchCallsDay']=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x37')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x38')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x39')]=0x0;_0x4c5085[_0xd8fdb3]['outboundBlacklistCallsDay']=0x0;_0x4c5085[_0xd8fdb3]['outboundOriginateFailureCallsDay']=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x3a')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x3b')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x33')]=0x0;_0x4c5085[_0xd8fdb3][_0xedb6('0x3c')]=0x0;_0x4c5085[_0xd8fdb3]['queueStatusComplete']=!![];}}}}Realtime[_0xedb6('0x3d')][_0xedb6('0x3e')]=function(_0x1690d0,_0x4ff1ad){for(var _0x11102d in _0x4ff1ad){if(_0x1690d0[_0xedb6('0x25')](_0x11102d)){_0x1690d0[_0x11102d]=_0x4ff1ad[_0x11102d];}}};Realtime[_0xedb6('0x3d')][_0xedb6('0x3f')]=function(){var _0x3a2e74=this;return function(_0x4b85dc){if(_0x4b85dc){freeIsNotKeyAgent(_0x4b85dc,_0x3a2e74[_0xedb6('0x13')]);for(var _0xda1d3e=0x0,_0x59de60={},_0x5be598={};_0xda1d3e<_0x4b85dc['length'];_0xda1d3e+=0x1){_0x59de60=_0x4b85dc[_0xda1d3e];var _0x48f5d1=_['isNil'](_0x59de60[_0xedb6('0x27')])?util[_0xedb6('0x40')](_0xedb6('0x28'),_0x59de60[_0xedb6('0x24')]):_0x59de60[_0xedb6('0x27')];if(_[_0xedb6('0x41')](_0x3a2e74['agents'][_0x48f5d1])){_0x3a2e74[_0xedb6('0x13')][_0x48f5d1]=new Agent(_0x59de60);}else{_0x3a2e74[_0xedb6('0x3e')](_0x3a2e74[_0xedb6('0x13')][_0x48f5d1],_0x59de60);}}}return _0x3a2e74[_0xedb6('0x13')];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x42')]=function(){var _0xa3ff70=this;return function(_0x524300){if(_0x524300){freeIsNotKeySip(_0x524300,_0xa3ff70[_0xedb6('0x43')]);for(var _0x46cbcf=0x0,_0x482fe3={},_0x51337e={};_0x46cbcf<_0x524300[_0xedb6('0x44')];_0x46cbcf+=0x1){_0x482fe3=_0x524300[_0x46cbcf];if(_['isUndefined'](_0xa3ff70[_0xedb6('0x43')][util['format']('SIP/%s',_0x482fe3[_0xedb6('0x24')])])){_0xa3ff70['telephones'][util[_0xedb6('0x40')](_0xedb6('0x28'),_0x482fe3[_0xedb6('0x24')])]=new Telephone(_0x482fe3);}else{_0xa3ff70['mergeFromDatabase'](_0xa3ff70[_0xedb6('0x43')][util[_0xedb6('0x40')](_0xedb6('0x28'),_0x482fe3[_0xedb6('0x24')])],_0x482fe3);}}}return _0xa3ff70[_0xedb6('0x43')];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x45')]=function(){var _0xea0d2=this;return function(_0x2f03c6){if(_0x2f03c6){freeIsNotKeySip(_0x2f03c6,_0xea0d2['trunks']);for(var _0x101ff3=0x0,_0x35e704={},_0x3ee826={};_0x101ff3<_0x2f03c6['length'];_0x101ff3+=0x1){_0x35e704=_0x2f03c6[_0x101ff3];if(_[_0xedb6('0x41')](_0xea0d2['trunks'][util[_0xedb6('0x40')](_0xedb6('0x28'),_0x35e704['name'])])){_0xea0d2[_0xedb6('0x46')][util[_0xedb6('0x40')](_0xedb6('0x28'),_0x35e704[_0xedb6('0x24')])]=new Trunk(_0x35e704);}else{_0xea0d2[_0xedb6('0x3e')](_0xea0d2['trunks'][util[_0xedb6('0x40')]('SIP/%s',_0x35e704[_0xedb6('0x24')])],_0x35e704);}}}return _0xea0d2[_0xedb6('0x46')];};};Realtime[_0xedb6('0x3d')]['initVoiceQueues']=function(){var _0x4052e7=this;return function(_0x45752d){if(_0x45752d){freeIsNotKey(_0x45752d,_0x4052e7['voiceQueues'],_0xedb6('0x24'));for(var _0x50f116=0x0,_0x5b1fad={},_0x21acc0={};_0x50f116<_0x45752d[_0xedb6('0x44')];_0x50f116+=0x1){_0x5b1fad=_0x45752d[_0x50f116];if(_[_0xedb6('0x41')](_0x4052e7[_0xedb6('0x47')][_0x5b1fad[_0xedb6('0x24')]])){_0x4052e7[_0xedb6('0x47')][_0x5b1fad['name']]=new VoiceQueue(_0x5b1fad);}else{_0x4052e7['mergeFromDatabase'](_0x4052e7[_0xedb6('0x47')][_0x5b1fad[_0xedb6('0x24')]],_0x5b1fad);}}}return _0x4052e7[_0xedb6('0x47')];};};Realtime[_0xedb6('0x3d')]['initTriggers']=function(){var _0x3c6c28=this;return function(_0x1c9885){if(_0x1c9885){freeIsNotKey(_0x1c9885,_0x3c6c28[_0xedb6('0x48')],'id');for(var _0x2ca457=0x0,_0xa9860d={},_0x26e969={};_0x2ca457<_0x1c9885[_0xedb6('0x44')];_0x2ca457+=0x1){_0xa9860d=_0x1c9885[_0x2ca457];if(_['isUndefined'](_0x3c6c28[_0xedb6('0x48')][_0xa9860d['id']])){_0x3c6c28[_0xedb6('0x48')][_0xa9860d['id']]=new Trigger(_0xa9860d);}else{_0x3c6c28['mergeFromDatabase'](_0x3c6c28['triggers'][_0xa9860d['id']],_0xa9860d);}}}return _0x3c6c28['triggers'];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x49')]=function(){var _0x4151b0=this;return function(_0x34c947){if(_0x34c947){freeIsNotKey(_0x34c947,_0x4151b0[_0xedb6('0x4a')],'id');for(var _0x495ff9=0x0,_0x137019={},_0x1aea0a={};_0x495ff9<_0x34c947[_0xedb6('0x44')];_0x495ff9+=0x1){_0x137019=_0x34c947[_0x495ff9];if(_[_0xedb6('0x41')](_0x4151b0[_0xedb6('0x4a')][_0x137019['id']])){_0x4151b0[_0xedb6('0x4a')][_0x137019['id']]=new Template(_0x137019);}else{_0x4151b0['mergeFromDatabase'](_0x4151b0['templates'][_0x137019['id']],_0x137019);}}}return _0x4151b0[_0xedb6('0x4a')];};};Realtime['prototype'][_0xedb6('0x4b')]=function(){var _0x3c833e=this;return function(_0xdc22db){if(_0xdc22db){freeIsNotKey(_0xdc22db,_0x3c833e['zendeskAccounts'],'id');for(var _0x7e4b77=0x0,_0x2b522f={},_0x2570e9={};_0x7e4b77<_0xdc22db['length'];_0x7e4b77+=0x1){_0x2b522f=_0xdc22db[_0x7e4b77];if(_[_0xedb6('0x41')](_0x3c833e['zendeskAccounts'][_0x2b522f['id']])){_0x3c833e[_0xedb6('0x1a')][_0x2b522f['id']]=new ZendeskAccount(_0x2b522f);}else{_0x3c833e[_0xedb6('0x3e')](_0x3c833e[_0xedb6('0x1a')][_0x2b522f['id']],_0x2b522f);}}}return _0x3c833e[_0xedb6('0x1a')];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x4c')]=function(){var _0x59100e=this;return function(_0x4a53ed){if(_0x4a53ed){freeIsNotKey(_0x4a53ed,_0x59100e[_0xedb6('0x1b')],'id');for(var _0x42d7e5=0x0,_0x3859b8={},_0x429fec={};_0x42d7e5<_0x4a53ed[_0xedb6('0x44')];_0x42d7e5+=0x1){_0x3859b8=_0x4a53ed[_0x42d7e5];if(_[_0xedb6('0x41')](_0x59100e[_0xedb6('0x1b')][_0x3859b8['id']])){_0x59100e[_0xedb6('0x1b')][_0x3859b8['id']]=new SalesforceAccount(_0x3859b8);}else{_0x59100e[_0xedb6('0x3e')](_0x59100e[_0xedb6('0x1b')][_0x3859b8['id']],_0x3859b8);}}}return _0x59100e[_0xedb6('0x1b')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x287c7d=this;return function(_0x281efe){if(_0x281efe){freeIsNotKey(_0x281efe,_0x287c7d['freshdeskAccounts'],'id');for(var _0x5a17ab=0x0,_0x5b66e7={},_0x6c8c93={};_0x5a17ab<_0x281efe[_0xedb6('0x44')];_0x5a17ab+=0x1){_0x5b66e7=_0x281efe[_0x5a17ab];if(_[_0xedb6('0x41')](_0x287c7d['freshdeskAccounts'][_0x5b66e7['id']])){_0x287c7d['freshdeskAccounts'][_0x5b66e7['id']]=new FreshdeskAccount(_0x5b66e7);}else{_0x287c7d[_0xedb6('0x3e')](_0x287c7d[_0xedb6('0x4d')][_0x5b66e7['id']],_0x5b66e7);}}}return _0x287c7d[_0xedb6('0x4d')];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x4e')]=function(){var _0x20dc86=this;return function(_0x4c93b6){if(_0x4c93b6){freeIsNotKey(_0x4c93b6,_0x20dc86['zohoAccounts'],'id');for(var _0x38cba4=0x0,_0x1b5093={},_0x2cf11c={};_0x38cba4<_0x4c93b6[_0xedb6('0x44')];_0x38cba4+=0x1){_0x1b5093=_0x4c93b6[_0x38cba4];if(_['isUndefined'](_0x20dc86['zohoAccounts'][_0x1b5093['id']])){_0x20dc86['zohoAccounts'][_0x1b5093['id']]=new ZohoAccount(_0x1b5093);}else{_0x20dc86[_0xedb6('0x3e')](_0x20dc86[_0xedb6('0x1d')][_0x1b5093['id']],_0x1b5093);}}}return _0x20dc86[_0xedb6('0x1d')];};};Realtime[_0xedb6('0x3d')]['initDeskAccounts']=function(){var _0x10ecaa=this;return function(_0x1dd4a6){if(_0x1dd4a6){freeIsNotKey(_0x1dd4a6,_0x10ecaa[_0xedb6('0x1e')],'id');for(var _0x1a03a6=0x0,_0x449b4d={},_0x266085={};_0x1a03a6<_0x1dd4a6[_0xedb6('0x44')];_0x1a03a6+=0x1){_0x449b4d=_0x1dd4a6[_0x1a03a6];if(_[_0xedb6('0x41')](_0x10ecaa['deskAccounts'][_0x449b4d['id']])){_0x10ecaa[_0xedb6('0x1e')][_0x449b4d['id']]=new DeskAccount(_0x449b4d);}else{_0x10ecaa[_0xedb6('0x3e')](_0x10ecaa[_0xedb6('0x1e')][_0x449b4d['id']],_0x449b4d);}}}return _0x10ecaa[_0xedb6('0x1e')];};};Realtime[_0xedb6('0x3d')]['initSugarcrmAccounts']=function(){var _0x52957d=this;return function(_0x208901){if(_0x208901){freeIsNotKey(_0x208901,_0x52957d[_0xedb6('0x1c')],'id');for(var _0x71720c=0x0,_0x356723={},_0x19763d={};_0x71720c<_0x208901['length'];_0x71720c+=0x1){_0x356723=_0x208901[_0x71720c];if(_[_0xedb6('0x41')](_0x52957d[_0xedb6('0x1c')][_0x356723['id']])){_0x52957d[_0xedb6('0x1c')][_0x356723['id']]=new SugarcrmAccount(_0x356723);}else{_0x52957d[_0xedb6('0x3e')](_0x52957d[_0xedb6('0x1c')][_0x356723['id']],_0x356723);}}}return _0x52957d[_0xedb6('0x1c')];};};Realtime[_0xedb6('0x3d')]['initVtigerAccounts']=function(){var _0x2e8274=this;return function(_0x393538){if(_0x393538){freeIsNotKey(_0x393538,_0x2e8274[_0xedb6('0x1f')],'id');for(var _0xe25829=0x0,_0x29cb2f={},_0x52c3fd={};_0xe25829<_0x393538[_0xedb6('0x44')];_0xe25829+=0x1){_0x29cb2f=_0x393538[_0xe25829];if(_[_0xedb6('0x41')](_0x2e8274['vtigerAccounts'][_0x29cb2f['id']])){_0x2e8274[_0xedb6('0x1f')][_0x29cb2f['id']]=new VtigerAccount(_0x29cb2f);}else{_0x2e8274[_0xedb6('0x3e')](_0x2e8274[_0xedb6('0x1f')][_0x29cb2f['id']],_0x29cb2f);}}}return _0x2e8274[_0xedb6('0x1f')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x4b2ed9=this;return function(_0x4df269){if(_0x4df269){freeIsNotKey(_0x4df269,_0x4b2ed9[_0xedb6('0x20')],'id');for(var _0x445aca=0x0,_0x3388a3={},_0x48f510={};_0x445aca<_0x4df269[_0xedb6('0x44')];_0x445aca+=0x1){_0x3388a3=_0x4df269[_0x445aca];if(_[_0xedb6('0x41')](_0x4b2ed9['servicenowAccounts'][_0x3388a3['id']])){_0x4b2ed9[_0xedb6('0x20')][_0x3388a3['id']]=new ServicenowAccount(_0x3388a3);}else{_0x4b2ed9[_0xedb6('0x3e')](_0x4b2ed9[_0xedb6('0x20')][_0x3388a3['id']],_0x3388a3);}}}return _0x4b2ed9[_0xedb6('0x20')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x3d8038=this;return function(_0x1a0170){if(_0x1a0170){freeIsNotKey(_0x1a0170,_0x3d8038[_0xedb6('0x21')],'id');for(var _0x581eae=0x0,_0x238de6={},_0x1d1c2c={};_0x581eae<_0x1a0170[_0xedb6('0x44')];_0x581eae+=0x1){_0x238de6=_0x1a0170[_0x581eae];if(_[_0xedb6('0x41')](_0x3d8038[_0xedb6('0x21')][_0x238de6['id']])){_0x3d8038[_0xedb6('0x21')][_0x238de6['id']]=new Dynamics365Account(_0x238de6);}else{_0x3d8038[_0xedb6('0x3e')](_0x3d8038[_0xedb6('0x21')][_0x238de6['id']],_0x238de6);}}}return _0x3d8038['dynamics365Accounts'];};};Realtime[_0xedb6('0x3d')]['initFreshsalesAccounts']=function(){var _0x587dba=this;return function(_0x40fdf4){if(_0x40fdf4){freeIsNotKey(_0x40fdf4,_0x587dba[_0xedb6('0x4f')],'id');for(var _0x376e3c=0x0,_0x220cf8={},_0x27d877={};_0x376e3c<_0x40fdf4[_0xedb6('0x44')];_0x376e3c+=0x1){_0x220cf8=_0x40fdf4[_0x376e3c];if(_[_0xedb6('0x41')](_0x587dba[_0xedb6('0x4f')][_0x220cf8['id']])){_0x587dba[_0xedb6('0x4f')][_0x220cf8['id']]=new FreshsalesAccount(_0x220cf8);}else{_0x587dba['mergeFromDatabase'](_0x587dba[_0xedb6('0x4f')][_0x220cf8['id']],_0x220cf8);}}}return _0x587dba[_0xedb6('0x4f')];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x50')]=function(){var _0x1dc0b1=this;return function(_0x408bc5){for(var _0x722809=0x0;_0x722809<_0x408bc5[_0xedb6('0x44')];_0x722809+=0x1){_[_0xedb6('0x51')](_0x1dc0b1[_0xedb6('0x47')][_0x408bc5[_0x722809][_0xedb6('0x24')]],_0x408bc5[_0x722809]);}return _0x1dc0b1[_0xedb6('0x47')];};};Realtime[_0xedb6('0x3d')]['initVoiceQueueReports']=function(){var _0x5a75c3=this;return function(_0x38db9a){clearVoiceQueues(_0x5a75c3[_0xedb6('0x47')]);if(_0x38db9a){_0x38db9a=_[_0xedb6('0x52')](_0x38db9a,_0xedb6('0x53'));for(var _0x419446 in _0x38db9a){if(_0x38db9a[_0xedb6('0x25')](_0x419446)){var _0x37d419={};for(var _0x156694=0x0;_0x156694<_0x38db9a[_0x419446][_0xedb6('0x44')];_0x156694+=0x1){var _0x2c8cbd=_0x38db9a[_0x419446][_0x156694][_0xedb6('0x54')];if(_0x5a75c3['voiceQueues'][_0x2c8cbd]){if(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x55')]){_0x5a75c3['voiceQueues'][_0x2c8cbd]['unmanaged']+=0x1;}if(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x56')]){_0x5a75c3[_0xedb6('0x47')][_0x2c8cbd][_0xedb6('0x32')]+=0x1;}_0x5a75c3['voiceQueues'][_0x2c8cbd]['sumHoldTime']+=moment(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x57')])['diff'](moment(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x58')]),'seconds')||0x0;if(_0x156694===_0x38db9a[_0x419446][_0xedb6('0x44')]-0x1){_0x5a75c3[_0xedb6('0x47')][_0x2c8cbd]['sumDuration']+=moment(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x59')]||_0x38db9a[_0x419446][_0x156694]['queuecallerabandonAt']||_0x38db9a[_0x419446][_0x156694][_0xedb6('0x5a')])[_0xedb6('0x5b')](moment(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x58')]),_0xedb6('0x5c'))||0x0;_0x5a75c3[_0xedb6('0x47')][_0x2c8cbd][_0xedb6('0x29')]+=0x1;if(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x5d')]){_0x5a75c3[_0xedb6('0x47')][_0x2c8cbd][_0xedb6('0x2a')]+=0x1;_0x5a75c3[_0xedb6('0x47')][_0x2c8cbd][_0xedb6('0x2d')]+=moment(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x59')])[_0xedb6('0x5b')](moment(_0x38db9a[_0x419446][_0x156694][_0xedb6('0x57')]),_0xedb6('0x5c'))||0x0;}}else{_0x5a75c3['voiceQueues'][_0x2c8cbd][_0xedb6('0x2c')]+=_0x5a75c3[_0xedb6('0x47')][_0x2c8cbd][_0xedb6('0x2b')]||0x0;}}}}}}return _0x5a75c3[_0xedb6('0x47')];};};Realtime['prototype'][_0xedb6('0x5e')]=function(){var _0x5a5ffc=this;return function(_0x29d5d3){clearVoiceCallReports(_0x5a5ffc[_0xedb6('0x15')]);if(_0x29d5d3){for(var _0x6751d5=0x0;_0x6751d5<_0x29d5d3[_0xedb6('0x44')];_0x6751d5+=0x1){_0x5a5ffc[_0xedb6('0x15')][_0xedb6('0x29')]+=0x1;_0x5a5ffc[_0xedb6('0x15')][_0xedb6('0x2c')]+=_0x29d5d3[_0x6751d5][_0xedb6('0x5f')];if(_0x29d5d3[_0x6751d5][_0xedb6('0x60')]===_0xedb6('0x61')){_0x5a5ffc['outbound'][_0xedb6('0x2a')]+=0x1;_0x5a5ffc[_0xedb6('0x15')]['sumHoldTime']+=_0x29d5d3[_0x6751d5][_0xedb6('0x5f')]-_0x29d5d3[_0x6751d5][_0xedb6('0x62')]||0x0;_0x5a5ffc[_0xedb6('0x15')][_0xedb6('0x2d')]+=_0x29d5d3[_0x6751d5]['billableseconds'];}}}return _0x5a5ffc[_0xedb6('0x15')];};};Realtime['prototype'][_0xedb6('0x63')]=function(){var _0x2ec21f=this;return function(_0x1f9f93){if(_0x1f9f93){freeIsNotKey(_0x1f9f93,_0x2ec21f[_0xedb6('0x14')],_0xedb6('0x24'));for(var _0x18ae2b=0x0,_0x347184={};_0x18ae2b<_0x1f9f93[_0xedb6('0x44')];_0x18ae2b+=0x1){_0x347184=_0x1f9f93[_0x18ae2b];if(_[_0xedb6('0x41')](_0x2ec21f[_0xedb6('0x14')][_0x347184[_0xedb6('0x24')]])){_0x2ec21f[_0xedb6('0x14')][_0x347184['name']]=new Campaign(_0x347184);}else{_0x2ec21f[_0xedb6('0x3e')](_0x2ec21f[_0xedb6('0x14')][_0x347184['name']],_0x347184);_0x2ec21f[_0xedb6('0x14')][_0x347184['name']][_0xedb6('0x64')]=_0x347184[_0xedb6('0x65')]?_0x347184[_0xedb6('0x65')]['name']:undefined;}}}return _0x2ec21f[_0xedb6('0x14')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x1c5d22=this;return function(_0x4557ef){if(_0x4557ef){freeIsNotKey(_0x4557ef,_0x1c5d22[_0xedb6('0x16')],'id');for(var _0x4b87d4=0x0,_0x52cea1={};_0x4b87d4<_0x4557ef[_0xedb6('0x44')];_0x4b87d4+=0x1){_0x52cea1=_0x4557ef[_0x4b87d4];if(_[_0xedb6('0x41')](_0x1c5d22[_0xedb6('0x16')][_0x52cea1['id']])){_0x1c5d22['voiceExtensions'][_0x52cea1['id']]=new VoiceExtension(_0x52cea1);}else{_0x1c5d22['mergeFromDatabase'](_0x1c5d22[_0xedb6('0x16')][_0x52cea1['id']],_0x52cea1);}}}return _0x1c5d22[_0xedb6('0x16')];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x66')]=function(){var _0x5badd3=this;return function(_0x4305f2){clearCampaigns(_0x5badd3['campaigns']);for(var _0x79756d=0x0;_0x79756d<_0x4305f2[_0xedb6('0x44')];_0x79756d+=0x1){_[_0xedb6('0x51')](_0x5badd3[_0xedb6('0x14')][_0x4305f2[_0x79756d][_0xedb6('0x24')]],_0x4305f2[_0x79756d]);}return _0x5badd3['campaigns'];};};Realtime[_0xedb6('0x3d')][_0xedb6('0x67')]=function(){var _0x11cdb1=this;return function(_0x3eec8d){if(_0x3eec8d){freeIsNotKey(_0x3eec8d,_0x11cdb1[_0xedb6('0x22')],'id');for(var _0x19d77d=0x0,_0x2e04b6={},_0x5e98d3={};_0x19d77d<_0x3eec8d['length'];_0x19d77d+=0x1){_0x2e04b6=_0x3eec8d[_0x19d77d];if(_[_0xedb6('0x41')](_0x11cdb1[_0xedb6('0x22')][_0x2e04b6['id']])){_0x11cdb1[_0xedb6('0x22')][_0x2e04b6['id']]=new FaxAccount(_0x2e04b6);}else{_0x11cdb1[_0xedb6('0x3e')](_0x11cdb1[_0xedb6('0x22')][_0x2e04b6['id']],_0x2e04b6);}}}return _0x11cdb1[_0xedb6('0x22')];};};module[_0xedb6('0x68')]=Realtime; \ No newline at end of file +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 diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 89a9149..1a6aeb0 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 _0x7add=['create','match','getAgentByInternal','keys','getCallType','channel','split','calleridnum','internal','destination','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','xcally-motion-preview','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','uniqueid','type','UserId','membername','monitor','monitors','createdAt','connectedlinename','xcally-motion-dialer','originatecalleridnum','isArray','substring','mobile','phone','indexOf','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','name','find','accountcode','interface','format','SIP/%s','length','connectedlinenum','assigned','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt'];(function(_0x119474,_0x28b89a){var _0x4970db=function(_0x2f48d1){while(--_0x2f48d1){_0x119474['push'](_0x119474['shift']());}};_0x4970db(++_0x28b89a);}(_0x7add,0x197));var _0xd7ad=function(_0x5d9989,_0x4b7826){_0x5d9989=_0x5d9989-0x0;var _0xec07d3=_0x7add[_0x5d9989];return _0xec07d3;};'use strict';var _=require(_0xd7ad('0x0'));var moment=require(_0xd7ad('0x1'));var util=require(_0xd7ad('0x2'));var config=require(_0xd7ad('0x3'));var ami=require(_0xd7ad('0x4'));var RpcVoiceAgentReport=require(_0xd7ad('0x5'));var RpcVoiceCallReport=require(_0xd7ad('0x6'));var RpcVoiceDialReport=require(_0xd7ad('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xd7ad('0x8'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0xd7ad('0x9'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0xd7ad('0xa'));var VoiceAgentReport=require(_0xd7ad('0xb'));var VoiceDialReport=require(_0xd7ad('0xc'));var UserReport=require('./userReport');function Report(_0x94aaa0){this[_0xd7ad('0xd')]=_0x94aaa0;this[_0xd7ad('0xe')]=_0x94aaa0[_0xd7ad('0xe')];this[_0xd7ad('0xf')]=_0x94aaa0[_0xd7ad('0xf')];}Report[_0xd7ad('0x10')][_0xd7ad('0x11')]=function(_0xe5239e){var _0x1b0cf8=new VoiceQueueReport(this[_0xd7ad('0xd')]);var _0x2fcd19=new VoiceAgentReport(this[_0xd7ad('0xd')]);var _0x18c9cf=new VoiceDialReport(this[_0xd7ad('0xd')]);var _0x1dba19=new VoiceCallReport(this[_0xd7ad('0xd')]);var _0x3c3d45=new UserReport(this[_0xd7ad('0xd')]);if(config['xdr']&&config[_0xd7ad('0x12')][_0xd7ad('0x13')]){ami['on'](_0xd7ad('0x14'),this[_0xd7ad('0x15')][_0xd7ad('0x16')](this));ami['on']('custom:voiceCallReport',this[_0xd7ad('0x17')][_0xd7ad('0x16')](this));ami['on'](_0xd7ad('0x18'),this[_0xd7ad('0x19')]['bind'](this));ami['on'](_0xd7ad('0x1a'),this[_0xd7ad('0x1b')][_0xd7ad('0x16')](this));ami['on'](_0xd7ad('0x1c'),this[_0xd7ad('0x1d')]['bind'](this));ami['on'](_0xd7ad('0x1e'),this[_0xd7ad('0x1f')][_0xd7ad('0x16')](this));}};Report['prototype'][_0xd7ad('0x20')]=function(_0x5ba29e){var _0x3a8cd0;_0x3a8cd0=_['find'](this['agents'],function(_0x3b3491){return _0x3b3491['accountcode']==_0x5ba29e||_0x3b3491[_0xd7ad('0x21')]==_0x5ba29e;});if(_['isNil'](_0x3a8cd0)){var _0x1ef62a=_[_0xd7ad('0x22')](this['telephones'],function(_0x4f2c2d){return _0x4f2c2d[_0xd7ad('0x23')]==_0x5ba29e||_0x4f2c2d[_0xd7ad('0x21')]==_0x5ba29e;});if(_0x1ef62a){_0x3a8cd0=_[_0xd7ad('0x22')](this[_0xd7ad('0xe')],function(_0x46ce64){return _0x46ce64[_0xd7ad('0x24')]==util[_0xd7ad('0x25')](_0xd7ad('0x26'),_0x1ef62a[_0xd7ad('0x21')]);});}}return _0x3a8cd0;};Report[_0xd7ad('0x10')][_0xd7ad('0x15')]=function(_0x346dda){for(var _0x51bbcf=0x0;_0x51bbcf<_0x346dda[_0xd7ad('0x27')];_0x51bbcf+=0x1){var _0x3f9f5a=this[_0xd7ad('0x20')](_0x346dda[_0x51bbcf][_0xd7ad('0x28')]);if(_0x3f9f5a){_0x346dda[_0x51bbcf][_0xd7ad('0x23')]=_0x3f9f5a[_0xd7ad('0x23')];_0x346dda[_0x51bbcf][_0xd7ad('0x29')]=!![];_0x346dda[_0x51bbcf]['lastAssignedTo']=_0x3f9f5a[_0xd7ad('0x21')];_0x346dda[_0x51bbcf][_0xd7ad('0x24')]=_[_0xd7ad('0x2a')](_0x3f9f5a[_0xd7ad('0x24')])?util[_0xd7ad('0x25')](_0xd7ad('0x26'),_0x3f9f5a[_0xd7ad('0x21')]):_0x3f9f5a['interface'];if(_0x346dda[_0x51bbcf][_0xd7ad('0x2b')]){_0x346dda[_0x51bbcf][_0xd7ad('0x2c')]=moment()['format'](_0xd7ad('0x2d'));}if(_0x346dda[_0x51bbcf][_0xd7ad('0x2e')]){_0x346dda[_0x51bbcf][_0xd7ad('0x2f')]=moment()[_0xd7ad('0x25')](_0xd7ad('0x2d'));}RpcMemberReport[_0xd7ad('0x15')](_0x346dda[_0x51bbcf]);}RpcVoiceQueueReport[_0xd7ad('0x30')](_0x346dda[_0x51bbcf]);}};function extractCalleridNumber(_0x3c6e69){var _0xff56fc=_0x3c6e69[_0xd7ad('0x31')](/<(.*?)>/);return _0xff56fc?_0xff56fc[0x1]:_0x3c6e69;}Report[_0xd7ad('0x10')][_0xd7ad('0x32')]=function(_0x26b48e){for(var _0x23323a=0x0;_0x23323a','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;_0x1f11b30x0?_0x1b3554:0x0;this[_0x360f('0x12')][_0x23fe5a[_0x360f('0x6b')]][_0x360f('0x30')]=this[_0x360f('0x12')][_0x23fe5a['queue']][_0x360f('0x30')]>_[_0x360f('0x6c')](_0x23fe5a[_0x360f('0x6e')])?_[_0x360f('0x6c')](_0x23fe5a[_0x360f('0x6e')]):this[_0x360f('0x12')][_0x23fe5a[_0x360f('0x6b')]][_0x360f('0x30')];this['emitVoiceQueueSummary'](this[_0x360f('0x12')][_0x23fe5a['queue']],_0x360f('0x16'));}logger[_0x360f('0x41')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x360f('0x3c')](this[_0x360f('0x12')][_0x23fe5a['queue']],{'showHidden':![],'depth':null}));ami[_0x360f('0x3f')](_0x360f('0x6f'),this[_0x360f('0x12')][_0x23fe5a[_0x360f('0x6b')]]);}}}catch(_0x3464ae){logger[_0x360f('0x39')](_0x360f('0x66'),util[_0x360f('0x3c')](_0x3464ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x360f('0xa')][_0x360f('0x1a')]=function(_0x56810d){logger[_0x360f('0x41')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x360f('0x3c')](_0x56810d,{'showHidden':![],'depth':null}));this[_0x360f('0x13')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x1c520b){try{if(this[_0x360f('0x67')](_0x1c520b)){logger[_0x360f('0x41')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1c520b[_0x360f('0x44')],util[_0x360f('0x3c')](_0x1c520b,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x360f('0xe')][_0x1c520b[_0x360f('0x44')]]))this[_0x360f('0xe')][_0x1c520b[_0x360f('0x44')]]=[];if(_[_0x360f('0x60')](this['channels'][_0x1c520b[_0x360f('0x44')]]))this['channels'][_0x1c520b[_0x360f('0x44')]]={};var _0x552c3f=new QueueReport();_0x552c3f[_0x360f('0x47')]=_0x1c520b[_0x360f('0x6b')];_0x552c3f[_0x360f('0x55')]=this['voiceQueues'][_0x552c3f[_0x360f('0x47')]]&&this[_0x360f('0x12')][_0x552c3f[_0x360f('0x47')]]['type']?this[_0x360f('0x12')][_0x552c3f[_0x360f('0x47')]][_0x360f('0x55')]||'inbound':'inbound';_0x552c3f['queue']=_0x1c520b[_0x360f('0x6b')];_0x552c3f[_0x360f('0x70')]=moment()[_0x360f('0x45')](_0x360f('0x71'));_0x552c3f[_0x360f('0x72')]=_0x1c520b[_0x360f('0x72')];_0x552c3f[_0x360f('0x73')]=_0x1c520b[_0x360f('0x73')];_0x552c3f[_0x360f('0x44')]=_0x1c520b[_0x360f('0x44')];_0x552c3f[_0x360f('0x74')]=this[_0x360f('0x10')][_0x1c520b[_0x360f('0x44')]][_0x360f('0x74')];logger['info'](_0x360f('0x75'),_0x552c3f[_0x360f('0x47')],_0x552c3f[_0x360f('0x55')]);_[_0x360f('0x76')](_0x552c3f,_[_0x360f('0x77')](_0x1c520b,_[_0x360f('0x78')](_0x552c3f)));this[_0x360f('0xe')][_0x1c520b[_0x360f('0x44')]]['push'](_0x552c3f);this[_0x360f('0x10')][_0x1c520b['uniqueid']]=_0x552c3f;this[_0x360f('0x40')](_0x552c3f,'queuecallerjoin');}}catch(_0x1e7fc1){logger[_0x360f('0x39')](_0x360f('0x79'),_0x1c520b[_0x360f('0x44')],util[_0x360f('0x3c')](_0x1e7fc1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x360f('0xa')][_0x360f('0x1d')]=function(_0x224ef4){try{if(this[_0x360f('0x67')](_0x224ef4)){logger['debug'](_0x360f('0x7a'),_0x224ef4[_0x360f('0x44')],util['inspect'](_0x224ef4,{'showHidden':![],'depth':null}));if(this[_0x360f('0xe')][_0x224ef4[_0x360f('0x44')]]){var _0xaa12a4=_[_0x360f('0x7b')](this[_0x360f('0xe')][_0x224ef4[_0x360f('0x44')]]);_0xaa12a4[_0x360f('0x7c')]=![];_0xaa12a4[_0x360f('0x7d')]=null;_0xaa12a4[_0x360f('0x7e')]=_0x224ef4[_0x360f('0x7e')];_0xaa12a4[_0x360f('0x7f')]=_0x224ef4[_0x360f('0x7f')];_0xaa12a4[_0x360f('0x1c')]=!![];_0xaa12a4[_0x360f('0x80')]=moment()[_0x360f('0x45')](_0x360f('0x71'));_0xaa12a4['queuecallerexitreason']=_0x360f('0x81');_0xaa12a4['lastAssignedTo']=null;logger[_0x360f('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0xaa12a4[_0x360f('0x47')],_0xaa12a4['type']);this[_0x360f('0x10')][_0x224ef4['uniqueid']]=_0xaa12a4;this[_0x360f('0x49')](_0xaa12a4,'queuecallerabandon');}}}catch(_0x5ced0a){logger[_0x360f('0x39')](_0x360f('0x7a'),_0x224ef4[_0x360f('0x44')],util[_0x360f('0x3c')](_0x5ced0a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x360f('0xa')]['syncQueueCallerLeave']=function(_0x29c199){try{if(this[_0x360f('0x67')](_0x29c199)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x29c199[_0x360f('0x44')],util[_0x360f('0x3c')](_0x29c199,{'showHidden':![],'depth':null}));if(this[_0x360f('0xe')][_0x29c199[_0x360f('0x44')]]){var _0x389c11=_[_0x360f('0x7b')](this[_0x360f('0xe')][_0x29c199[_0x360f('0x44')]]);_0x389c11[_0x360f('0x82')]=moment()[_0x360f('0x45')](_0x360f('0x71'));_0x389c11[_0x360f('0x83')]=_0x29c199[_0x360f('0x83')];_0x389c11[_0x360f('0x84')]=_0x29c199[_0x360f('0x84')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x389c11['name'],_0x389c11['type'],_0x29c199[_0x360f('0x83')],_0x29c199[_0x360f('0x84')]);this['channels'][_0x29c199['uniqueid']]=_0x389c11;this[_0x360f('0x40')](_0x389c11,_0x360f('0x1e'));}}}catch(_0x2b2cae){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x29c199[_0x360f('0x44')],util['inspect'](_0x2b2cae,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x1117ff){try{if(this[_0x360f('0x67')](_0x1117ff)){logger['debug'](_0x360f('0x85'),_0x1117ff[_0x360f('0x44')],util[_0x360f('0x3c')](_0x1117ff,{'showHidden':![],'depth':null}));if(this[_0x360f('0xe')][_0x1117ff[_0x360f('0x44')]]){var _0x33a09b=_[_0x360f('0x7b')](this[_0x360f('0xe')][_0x1117ff[_0x360f('0x44')]]);_0x33a09b[_0x360f('0x7c')]=!![];_0x33a09b['queuecallerexitreason']=_0x360f('0x86');logger[_0x360f('0x69')](_0x360f('0x87'),_0x33a09b[_0x360f('0x47')],_0x33a09b['type']);}}}catch(_0x12f1e4){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x1117ff[_0x360f('0x44')],util[_0x360f('0x3c')](_0x12f1e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x360f('0xa')]['syncAgentComplete']=function(_0x493848){try{if(this[_0x360f('0x67')](_0x493848)){logger[_0x360f('0x41')]('[%s][voiceQueueReport][agentcomplete]',_0x493848[_0x360f('0x44')],util[_0x360f('0x3c')](_0x493848,{'showHidden':![],'depth':null}));if(this[_0x360f('0xe')][_0x493848[_0x360f('0x44')]]){var _0x1ab25a=_[_0x360f('0x7b')](this[_0x360f('0xe')][_0x493848[_0x360f('0x44')]]);_0x1ab25a[_0x360f('0x1c')]=![];_0x1ab25a[_0x360f('0x80')]=null;_0x1ab25a['assigned']=!![];_0x1ab25a[_0x360f('0x88')]=_0x493848[_0x360f('0x89')];_0x1ab25a['holdtime']=_0x493848[_0x360f('0x7e')];_0x1ab25a[_0x360f('0x7c')]=!![];_0x1ab25a[_0x360f('0x8a')]=![];_0x1ab25a[_0x360f('0x8b')]=null;if(!_0x1ab25a[_0x360f('0x8c')]){if(_0x493848[_0x360f('0x8d')]=='transfer'){_0x1ab25a[_0x360f('0x8e')]='COMPLETED';logger[_0x360f('0x69')](_0x360f('0x8f'),_0x1ab25a[_0x360f('0x47')],_0x1ab25a['type']);}else{if(_[_0x360f('0x90')](_0x493848[_0x360f('0x35')][_0x360f('0x91')](),_0x360f('0x92'))){if(this[_0x360f('0xe')][_0x493848['linkedid']]){var _0x5daa49=_[_0x360f('0x7b')](this[_0x360f('0xe')][_0x493848['linkedid']]);_0x5daa49['queuecallercomplete']=![];_0x5daa49['queuecallerexit']=!![];_0x5daa49[_0x360f('0x8b')]=moment(_0x1ab25a[_0x360f('0x70')])[_0x360f('0x93')](_0x493848[_0x360f('0x7e')],_0x360f('0x94'))[_0x360f('0x45')](_0x360f('0x71'));_0x5daa49[_0x360f('0x8e')]=_0x360f('0x95');_0x5daa49[_0x360f('0x8c')]=!![];_0x5daa49['transfertype']='FORWARD';_0x5daa49['transferexten']=_0x493848['destexten'];_0x5daa49['transferuniqueid']=_0x493848[_0x360f('0x44')];logger['info'](_0x360f('0x96'),_0x5daa49['name'],_0x5daa49[_0x360f('0x55')]);var _0xd211c9=this['queueReports'][_0x493848[_0x360f('0x97')]];this['queueReports'][_0x493848[_0x360f('0x97')]]=this[_0x360f('0xe')][_0x493848[_0x360f('0x44')]];this[_0x360f('0xe')][_0x493848['uniqueid']]=_0xd211c9;}}else{_0x1ab25a['queuecallerexitreason']=_0x360f('0x98')+_0x493848[_0x360f('0x8d')][_0x360f('0x99')]();logger[_0x360f('0x69')](_0x360f('0x9a'),_0x1ab25a['name'],_0x1ab25a[_0x360f('0x55')],_0x1ab25a[_0x360f('0x8e')]);}}}this[_0x360f('0x10')][_0x493848[_0x360f('0x44')]]=_0x1ab25a;this[_0x360f('0x49')](_0x1ab25a,_0x360f('0x1f'));}}}catch(_0x28b26a){logger[_0x360f('0x39')](_0x360f('0x9b'),_0x493848[_0x360f('0x44')],util[_0x360f('0x3c')](_0x28b26a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x360f('0xa')][_0x360f('0x22')]=function(_0x163111){try{if(this['isNotNull'](_0x163111)){logger['debug'](_0x360f('0x9c'),_0x163111['uniqueid'],util[_0x360f('0x3c')](_0x163111,{'showHidden':![],'depth':null}));this['addVariable'](_0x163111[_0x360f('0x44')],_[_0x360f('0x78')](_0x163111[_0x360f('0x9d')])[0x0],_0x163111[_0x360f('0x9e')]);if(this['queueReports'][_0x163111[_0x360f('0x44')]]){var _0x440fa0=_['last'](this[_0x360f('0xe')][_0x163111[_0x360f('0x44')]]);if(_0x440fa0){if(this['isNotNull'](_0x163111[_0x360f('0x9d')])&&this['isNotNull'](_0x163111[_0x360f('0x9d')][_0x360f('0x9f')])){switch(_0x163111[_0x360f('0x9e')]){case _0x360f('0xa0'):_0x440fa0[_0x360f('0x8a')]=![];_0x440fa0['queuecallerexitAt']=null;break;case _0x360f('0xa1'):_0x440fa0[_0x360f('0xa2')]=_0x360f('0xa3');_0x440fa0[_0x360f('0x8a')]=!![];_0x440fa0['queuecallerexitAt']=moment()[_0x360f('0x45')](_0x360f('0x71'));_0x440fa0[_0x360f('0x82')]=moment()[_0x360f('0x45')](_0x360f('0x71'));logger[_0x360f('0x41')](_0x360f('0xa4'),_0x163111[_0x360f('0x44')],util['inspect'](_0x440fa0,{'showHidden':![],'depth':null}));ami[_0x360f('0x3f')](_0x360f('0xa5'),_0x440fa0);break;default:_0x440fa0[_0x360f('0x8a')]=!![];_0x440fa0[_0x360f('0x8b')]=moment()[_0x360f('0x45')](_0x360f('0x71'));_0x440fa0[_0x360f('0x82')]=moment()['format'](_0x360f('0x71'));}_0x440fa0[_0x360f('0x1c')]=![];_0x440fa0[_0x360f('0x80')]=null;_0x440fa0[_0x360f('0x8e')]=_0x163111[_0x360f('0x9e')];this['channels'][_0x163111[_0x360f('0x44')]]=_0x440fa0;this[_0x360f('0x49')](_0x440fa0,_0x360f('0xa6'));}else if(this[_0x360f('0x67')](_0x163111[_0x360f('0x9d')])&&this['isNotNull'](_0x163111['variable'][_0x360f('0xa7')])){if(!_0x440fa0[_0x360f('0x1c')]){_0x440fa0['queuecallerexit']=!![];_0x440fa0[_0x360f('0x8b')]=moment()[_0x360f('0x45')](_0x360f('0x71'));_0x440fa0[_0x360f('0x8e')]='EXITWITHKEY';_0x440fa0['queuecallerleaveAt']=moment()[_0x360f('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x360f('0x10')][_0x163111[_0x360f('0x44')]]=_0x440fa0;}}logger[_0x360f('0x69')](_0x360f('0xa8'),_0x163111[_0x360f('0x44')],_0x440fa0[_0x360f('0x47')],_0x440fa0[_0x360f('0x55')],_[_0x360f('0x78')](_0x163111[_0x360f('0x9d')])[0x0],_0x163111[_0x360f('0x9e')]);_0x440fa0[_0x360f('0x15')]=this[_0x360f('0x15')][_0x163111[_0x360f('0x44')]];}}}}catch(_0x2a2c9f){logger[_0x360f('0x39')](_0x360f('0x9c'),_0x163111[_0x360f('0x44')],util['inspect'](_0x2a2c9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x360f('0xa')][_0x360f('0xa9')]=function(_0x3c2c7c,_0x524ecb,_0xd81bce){var _0x22925e=[_0x360f('0xaa'),_0x360f('0xab'),'rtpaudioqosjitter',_0x360f('0xac'),_0x360f('0xad'),_0x360f('0xae'),_0x360f('0xaf'),_0x360f('0xb0'),_0x360f('0xb1'),'sipuri',_0x360f('0xb2'),_0x360f('0xb3'),_0x360f('0xb4'),_0x360f('0xb5'),_0x360f('0xb6'),_0x360f('0xb7'),'membername','memberpenalty',_0x360f('0xb8')];if(!_[_0x360f('0x34')](_0x524ecb)&&!_[_0x360f('0xb9')](_0x22925e,_0x524ecb)){if(_['isUndefined'](this[_0x360f('0x15')][_0x3c2c7c])){this['variables'][_0x3c2c7c]={};}this['variables'][_0x3c2c7c][_0x524ecb]=_0xd81bce;}};VoiceQueueReport[_0x360f('0xa')][_0x360f('0xba')]=function(_0x61d4b){try{if(this[_0x360f('0x67')](_0x61d4b)){logger['debug'](_0x360f('0xbb'),_0x61d4b[_0x360f('0x44')],util[_0x360f('0x3c')](_0x61d4b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x61d4b['uniqueid']]){for(var _0x18c7fb=0x0,_0x51da0d={};_0x18c7fb0x0?_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={};_0x46a979=0x0?moment(_0x4c8e69[_0x52f6('0x17')])[_0x52f6('0xe')](_0x4c8e69[_0x52f6('0x16')],_0x52f6('0x18')):null,'data1':_0x52f6('0x19'),'data2':_0x4c8e69[_0x52f6('0x12')],'data3':_0x4c8e69[_0x52f6('0x10')],'data4':_0x4c8e69[_0x52f6('0x1a')]||null,'role':_0x52f6('0x1b'),'internal':_0x4c8e69[_0x52f6('0x12')]?_[_0x52f6('0x13')](_0x4c8e69['accountcode']):undefined,'uniqueid':_0x4c8e69[_0x52f6('0x14')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xc696=['seconds','inbound','calleridnum','exten','agent','accountcode','toNumber','uniqueid','membername','endtime','starttime','dialstring','lodash','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','isNil','interface','SIP/%s','TALKING','queuecallerleaveAt','diff'];(function(_0x4aa32c,_0x489e19){var _0x5d5548=function(_0x3bbeb5){while(--_0x3bbeb5){_0x4aa32c['push'](_0x4aa32c['shift']());}};_0x5d5548(++_0x489e19);}(_0xc696,0x89));var _0x6c69=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xc696[_0x255d5b];return _0x3e141a;};'use strict';var moment=require('moment');var _=require(_0x6c69('0x0'));var util=require('util');var client=require(_0x6c69('0x1'));exports['voiceQueueReport']=function(_0x297263){var _0x5a9bcb=_0x297263[_0x6c69('0x2')]||_0x297263[_0x6c69('0x3')];return client[_0x6c69('0x4')](_0x6c69('0x5'),{'body':{'channel':'voice','membername':_0x297263[_0x6c69('0x6')],'interface':_[_0x6c69('0x7')](_0x297263[_0x6c69('0x8')])?util['format'](_0x6c69('0x9'),_0x297263[_0x6c69('0x6')]):_0x297263[_0x6c69('0x8')],'type':_0x6c69('0xa'),'enterAt':_0x297263[_0x6c69('0xb')],'exitAt':_0x5a9bcb,'duration':moment(_0x5a9bcb)[_0x6c69('0xc')](_0x297263[_0x6c69('0xb')],_0x6c69('0xd')),'data1':_0x6c69('0xe'),'data2':_0x297263[_0x6c69('0xf')],'data3':_0x297263[_0x6c69('0x10')],'data4':null,'data5':_0x297263['queue'],'role':_0x6c69('0x11'),'internal':_0x297263[_0x6c69('0x12')]?_[_0x6c69('0x13')](_0x297263['accountcode']):undefined,'uniqueid':_0x297263[_0x6c69('0x14')]},'log':_0x6c69('0x5')});};exports['voiceDialReport']=function(_0x34edf7){return client[_0x6c69('0x4')](_0x6c69('0x5'),{'body':{'channel':'voice','membername':_0x34edf7[_0x6c69('0x15')],'interface':_0x34edf7['interface'],'type':'TALKING','enterAt':_0x34edf7['starttime'],'exitAt':_0x34edf7['endtime'],'duration':moment(_0x34edf7['endtime'])[_0x6c69('0xc')](_0x34edf7['starttime'],'seconds')>=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 diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 2e2e6b7..a782541 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 _0x827a=['ShowSetting','stopRecordingOnTransfer','GetSettings','../client'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x827a,0x167));var _0xa827=function(_0x587377,_0xbff809){_0x587377=_0x587377-0x0;var _0x105242=_0x827a[_0x587377];return _0x105242;};'use strict';var client=require(_0xa827('0x0'));exports['getSettings']=function(){return client['Request'](_0xa827('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa827('0x2')]},'log':_0xa827('0x3')});}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 6518566..90448a0 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 _0xa94f=['../client','Request','GetTemplate','name'];(function(_0x590293,_0x2ed3e9){var _0x42d9ab=function(_0x46b6ba){while(--_0x46b6ba){_0x590293['push'](_0x590293['shift']());}};_0x42d9ab(++_0x2ed3e9);}(_0xa94f,0x1bc));var _0xfa94=function(_0xd202d5,_0x1e7556){_0xd202d5=_0xd202d5-0x0;var _0x2c8b68=_0xa94f[_0xd202d5];return _0x2c8b68;};'use strict';var client=require(_0xfa94('0x0'));exports['getTemplates']=function(_0x406f64){return function(_0x38ed42){return client[_0xfa94('0x1')](_0xfa94('0x2'),{'options':{'raw':!![],'attributes':['id',_0xfa94('0x3'),'html']},'log':'GetTemplate'});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 4a321f4..8a63b94 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 _0x5b7c=['getTriggers','Request','GetTrigger','name','channel','Condition','field','operator','value','AnyConditions','Action','action','data1','data3','data5','data6','data7','../client'];(function(_0xedd5a2,_0x331e9a){var _0x260bbb=function(_0x1cd14e){while(--_0x1cd14e){_0xedd5a2['push'](_0xedd5a2['shift']());}};_0x260bbb(++_0x331e9a);}(_0x5b7c,0x7d));var _0xc5b7=function(_0x3e9b40,_0x32c8eb){_0x3e9b40=_0x3e9b40-0x0;var _0x1b7230=_0x5b7c[_0x3e9b40];return _0x1b7230;};'use strict';var client=require(_0xc5b7('0x0'));exports[_0xc5b7('0x1')]=function(_0x2bb531){return function(_0x313d03){return client[_0xc5b7('0x2')](_0xc5b7('0x3'),{'options':{'raw':![],'attributes':['id',_0xc5b7('0x4'),_0xc5b7('0x5'),'status'],'include':[{'model':_0xc5b7('0x6'),'as':'AllConditions','attributes':['id',_0xc5b7('0x7'),_0xc5b7('0x8'),_0xc5b7('0x9')]},{'model':'Condition','as':_0xc5b7('0xa'),'attributes':['id',_0xc5b7('0x7'),_0xc5b7('0x8'),_0xc5b7('0x9')]},{'model':_0xc5b7('0xb'),'as':'Actions','attributes':['id',_0xc5b7('0xc'),_0xc5b7('0xd'),'data2',_0xc5b7('0xe'),'data4',_0xc5b7('0xf'),_0xc5b7('0x10'),_0xc5b7('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 23fb408..7e1d65a 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 _0x9957=['name','registry','defaultuser','../client','getTrunks','GetTrunk'];(function(_0x261c46,_0x224aa8){var _0x25af9b=function(_0x3e6466){while(--_0x3e6466){_0x261c46['push'](_0x261c46['shift']());}};_0x25af9b(++_0x224aa8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return function(_0x10a05d){return client['Request'](_0x7995('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7995('0x3'),_0x7995('0x4'),_0x7995('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index eac9fbe..0dfda4c 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 _0x70e0=['getAgents','Request','name','email','accountcode','fullname','lastLoginAt','lastPauseAt','interface','getTelephones','GetUser','telephone','savePause','PauseUser','saveUnpause','getAgent','agent','online','pauseType','../client'];(function(_0x2f11bd,_0x5a4221){var _0x168122=function(_0x33f14e){while(--_0x33f14e){_0x2f11bd['push'](_0x2f11bd['shift']());}};_0x168122(++_0x5a4221);}(_0x70e0,0x17b));var _0x070e=function(_0x18fadb,_0x50a366){_0x18fadb=_0x18fadb-0x0;var _0x23e294=_0x70e0[_0x18fadb];return _0x23e294;};'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 +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 diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index b676655..5479f0d 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 _0x7006=['create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x7006,0x159));var _0x6700=function(_0x231dda,_0x5b04cc){_0x231dda=_0x231dda-0x0;var _0x3f88cb=_0x7006[_0x231dda];return _0x3f88cb;};'use strict';var client=require('../client');exports[_0x6700('0x0')]=function(_0xbedfae){return client[_0x6700('0x1')](_0x6700('0x2'),{'body':_0xbedfae,'log':_0x6700('0x2')});};exports[_0x6700('0x3')]=function(_0x38764c,_0x4367f0,_0x53e615){return client['Request'](_0x6700('0x4'),{'body':_0x38764c,'options':{'where':{'uniqueid':_0x4367f0,'interface':_0x53e615,'agentcomplete':!![]}},'log':_0x6700('0x4')});}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index bfc0ca3..03d4c1a 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 _0xdfcc=['endOf','disposition','duration','billableseconds','GetVoiceCallReports','moment','lodash','../client','create','merge','calleridnum','context','callerid','CreateVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2b8077,_0x453634){var _0x308091=function(_0x426df7){while(--_0x426df7){_0x2b8077['push'](_0x2b8077['shift']());}};_0x308091(++_0x453634);}(_0xdfcc,0x122));var _0xcdfc=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0xdfcc[_0x48326a];return _0x466709;};'use strict';var moment=require(_0xcdfc('0x0'));var util=require('util');var _=require(_0xcdfc('0x1'));var client=require(_0xcdfc('0x2'));exports[_0xcdfc('0x3')]=function(_0x1b684c){return client['Request']('CreateVoiceCallReport',{'body':_[_0xcdfc('0x4')](_0x1b684c,{'source':_0x1b684c[_0xcdfc('0x5')],'destinationcontext':_0x1b684c[_0xcdfc('0x6')],'callerid':_0x1b684c[_0xcdfc('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0xcdfc('0x8')});};exports['getVoiceCallReports']=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0xcdfc('0x9')],'createdAt':{'$between':[moment()[_0xcdfc('0xa')](_0xcdfc('0xb'))[_0xcdfc('0xc')](_0xcdfc('0xd')),moment()[_0xcdfc('0xe')](_0xcdfc('0xb'))[_0xcdfc('0xc')](_0xcdfc('0xd'))]}},'attributes':['type',_0xcdfc('0xf'),_0xcdfc('0x10'),_0xcdfc('0x11')]},'log':_0xcdfc('0x12')});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 3441bb1..51026c4 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 _0xdc8b=['Request','../client'];(function(_0x4a6cf8,_0x5534ef){var _0x22205e=function(_0x3f4d0d){while(--_0x3f4d0d){_0x4a6cf8['push'](_0x4a6cf8['shift']());}};_0x22205e(++_0x5534ef);}(_0xdc8b,0x1ef));var _0xbdc8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdc8b[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0xbdc8('0x0'));exports['create']=function(_0x1ae7e7){return client[_0xbdc8('0x1')]('CreateVoiceDialReport',{'body':_0x1ae7e7,'log':'CreateVoiceDialReport'});}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index e0bb43b..9547d10 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 _0x3750=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x3fba41,_0x39825c){var _0x12e6a2=function(_0x5dda68){while(--_0x5dda68){_0x3fba41['push'](_0x3fba41['shift']());}};_0x12e6a2(++_0x39825c);}(_0x3750,0xbb));var _0x0375=function(_0x235f95,_0x2bf647){_0x235f95=_0x235f95-0x0;var _0x2348cb=_0x3750[_0x235f95];return _0x2348cb;};'use strict';var client=require(_0x0375('0x0'));exports[_0x0375('0x1')]=function(){return function(){return client[_0x0375('0x2')](_0x0375('0x3'),{'options':{'raw':!![],'attributes':['id',_0x0375('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x0375('0x1')});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 8f7fbce..d8d46f4 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 _0x29eb=['name','acw','acwTimeout','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','callerid','active','TrunkBackup','Interval','Intervals','../client','getVoiceQueues','Request'];(function(_0x562c21,_0x5a3736){var _0x11c70f=function(_0x3e4257){while(--_0x3e4257){_0x562c21['push'](_0x562c21['shift']());}};_0x11c70f(++_0x5a3736);}(_0x29eb,0x1c5));var _0xb29e=function(_0x487476,_0x1f226c){_0x487476=_0x487476-0x0;var _0x4a41d1=_0x29eb[_0x487476];return _0x4a41d1;};'use strict';var client=require(_0xb29e('0x0'));exports[_0xb29e('0x1')]=function(){return function(){return client[_0xb29e('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0xb29e('0x3'),_0xb29e('0x4'),_0xb29e('0x5'),'autopause',_0xb29e('0x6'),'type',_0xb29e('0x7'),_0xb29e('0x8'),_0xb29e('0x9'),_0xb29e('0xa'),_0xb29e('0xb'),_0xb29e('0xc'),'dialPredictiveOptimizationPercentage',_0xb29e('0xd'),_0xb29e('0xe'),_0xb29e('0xf'),'dialOriginateTimeout','dialQueueOptions',_0xb29e('0x10'),_0xb29e('0x11'),'dialCongestionMaxRetry',_0xb29e('0x12'),_0xb29e('0x13'),'dialBusyRetryFrequency',_0xb29e('0x14'),_0xb29e('0x15'),_0xb29e('0x16'),_0xb29e('0x17'),_0xb29e('0x18'),'dialPrefix',_0xb29e('0x19'),'dialAMDActive','dialAMDInitialSilence','dialAMDGreeting',_0xb29e('0x1a'),_0xb29e('0x1b'),_0xb29e('0x1c'),_0xb29e('0x1d'),_0xb29e('0x1e'),_0xb29e('0x1f'),'dialAMDMaximumWordLength',_0xb29e('0x20'),_0xb29e('0x21'),_0xb29e('0x22'),_0xb29e('0x23'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xb29e('0x24'),_0xb29e('0x6'),_0xb29e('0x25'),_0xb29e('0x26'),_0xb29e('0x27'),_0xb29e('0x28'),_0xb29e('0x29'),_0xb29e('0x2a'),_0xb29e('0x2b'),_0xb29e('0x2c'),'dialAbandonedRetryFrequency',_0xb29e('0x2d'),_0xb29e('0x2e'),_0xb29e('0x2f'),'dialAgentRejectRetryFrequency',_0xb29e('0x30'),'dialPredictiveIntervalMaxThreshold',_0xb29e('0x31'),_0xb29e('0x32')],'include':[{'model':_0xb29e('0x33'),'as':_0xb29e('0x33'),'attributes':['id',_0xb29e('0x3'),_0xb29e('0x34'),_0xb29e('0x35')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xb29e('0x3')]},{'model':_0xb29e('0x33'),'as':_0xb29e('0x36'),'attributes':['id',_0xb29e('0x3'),_0xb29e('0x34'),_0xb29e('0x35')]},{'model':_0xb29e('0x37'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0xb29e('0x37'),'as':_0xb29e('0x38'),'attributes':['id',_0xb29e('0x3'),'interval']}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 603b463..0f8d67d 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(_0x5d3a0f,_0xf84016){var _0x31135b=function(_0xe35183){while(--_0xe35183){_0x5d3a0f['push'](_0x5d3a0f['shift']());}};_0x31135b(++_0xf84016);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_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 diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index da7e64d..4867c48 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 _0x10da=['getVoiceQueueRtPauses','Request'];(function(_0x25538b,_0x4ca676){var _0xff83e5=function(_0x1d29fc){while(--_0x1d29fc){_0x25538b['push'](_0x25538b['shift']());}};_0xff83e5(++_0x4ca676);}(_0x10da,0x94));var _0xa10d=function(_0x5f100d,_0x10867a){_0x5f100d=_0x5f100d-0x0;var _0xcd9c0b=_0x10da[_0x5f100d];return _0xcd9c0b;};'use strict';var client=require('../client');exports[_0xa10d('0x0')]=function(_0x1512e4){return function(){return client[_0xa10d('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x1512e4,'paused':!![]},'raw':!![]},'log':_0xa10d('0x0')});};}; \ No newline at end of file +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 diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f84a66c..797c234 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0xe336f6,_0x5700b2){var _0x45b6d0=function(_0x1e587c){while(--_0x1e587c){_0xe336f6['push'](_0xe336f6['shift']());}};_0x45b6d0(++_0x5700b2);}(_0x7a54,0x106));var _0x47a5=function(_0x54181f,_0x1e7df4){_0x54181f=_0x54181f-0x0;var _0x40b3a4=_0x7a54[_0x54181f];return _0x40b3a4;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_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 diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index bfb4aed..a28ff2b 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 _0xe9de=['origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetlinkedid','origtransferercontext','attended','../client','transfers','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','attendedTransfer'];(function(_0x4ed9ef,_0x381176){var _0x2bb85b=function(_0x35c24d){while(--_0x35c24d){_0x4ed9ef['push'](_0x4ed9ef['shift']());}};_0x2bb85b(++_0x381176);}(_0xe9de,0x1c7));var _0xee9d=function(_0x551146,_0x272ebf){_0x551146=_0x551146-0x0;var _0x3894f6=_0xe9de[_0x551146];return _0x3894f6;};'use strict';var client=require(_0xee9d('0x0'));exports[_0xee9d('0x1')]={};exports[_0xee9d('0x2')]=function(_0x39c59e){return client['Request'](_0xee9d('0x3'),{'body':{'result':_0x39c59e[_0xee9d('0x4')],'transfererchannel':_0x39c59e[_0xee9d('0x5')],'transferercalleridnum':_0x39c59e[_0xee9d('0x6')],'transferercalleridname':_0x39c59e[_0xee9d('0x7')],'transfererconnectedlinenum':_0x39c59e[_0xee9d('0x8')],'transfererconnectedlinename':_0x39c59e[_0xee9d('0x9')],'transfereraccountcode':_0x39c59e[_0xee9d('0xa')],'transferercontext':_0x39c59e[_0xee9d('0xb')],'transfererexten':_0x39c59e[_0xee9d('0xc')],'transfererlinkedid':_0x39c59e[_0xee9d('0xd')],'transfereechannel':_0x39c59e[_0xee9d('0xe')],'transfereecalleridnum':_0x39c59e[_0xee9d('0xf')],'transfereecalleridname':_0x39c59e['transfereecalleridname'],'transfereeconnectedlinenum':_0x39c59e[_0xee9d('0x10')],'transfereeconnectedlinename':_0x39c59e['transfereeconnectedlinename'],'transfereeaccountcode':_0x39c59e[_0xee9d('0x11')],'transfereecontext':_0x39c59e['transfereecontext'],'transfereeexten':_0x39c59e[_0xee9d('0x12')],'transfereelinkedid':_0x39c59e[_0xee9d('0x13')],'isexternal':_0x39c59e[_0xee9d('0x14')],'context':_0x39c59e[_0xee9d('0x15')],'extension':_0x39c59e[_0xee9d('0x16')],'type':_0xee9d('0x17')},'log':_0xee9d('0x3')});};exports[_0xee9d('0x18')]=function(_0x335e21){return client['Request'](_0xee9d('0x3'),{'body':{'result':_0x335e21[_0xee9d('0x4')],'transfererchannel':_0x335e21['origtransfererchannel'],'transferercalleridnum':_0x335e21[_0xee9d('0x19')],'transferercalleridname':_0x335e21[_0xee9d('0x1a')],'transfererconnectedlinenum':_0x335e21['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x335e21[_0xee9d('0x1b')],'transfereraccountcode':_0x335e21[_0xee9d('0x1c')],'transferercontext':_0x335e21[_0xee9d('0x1d')],'transfererexten':_0x335e21[_0xee9d('0x1e')],'transfererlinkedid':_0x335e21[_0xee9d('0x1f')],'transfereechannel':_0x335e21[_0xee9d('0x20')],'transfereecalleridnum':_0x335e21['transfertargetcalleridnum'],'transfereecalleridname':_0x335e21[_0xee9d('0x21')],'transfereeconnectedlinenum':_0x335e21[_0xee9d('0x22')],'transfereeconnectedlinename':_0x335e21[_0xee9d('0x23')],'transfereeaccountcode':_0x335e21[_0xee9d('0x24')],'transfereecontext':_0x335e21['transfertargetcontext'],'transfereeexten':_0x335e21['transfertargetexten'],'transfereelinkedid':_0x335e21[_0xee9d('0x25')],'isexternal':_0x335e21['isexternal'],'context':_0x335e21[_0xee9d('0x26')],'extension':_0x335e21['origtransfererexten'],'type':_0xee9d('0x27')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +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 diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index ebc1e20..621b063 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 _0x6b1b=['join','Command','content','catch','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','type','unmanaged','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','omit','undefined','values','channels','voicechannel','map','uniqueid','channel','%s.%s','filename','ai(mixmonitorid)','find','monitors','toLowerCase','/var/spool/asterisk/monitor/','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','destinationchannel','StopMixMonitor','stop','wav','Hangup','queueChannels','exten','context','telephones','trunks','outboundChannels','campaigns','event','emit','custom:','send','server','http','127.0.0.1','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','format','SIP','timer','timers','agents','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','action','Reload','Action','then','message'];(function(_0x5f3cb2,_0x141f34){var _0x4da262=function(_0x3b558f){while(--_0x3b558f){_0x5f3cb2['push'](_0x5f3cb2['shift']());}};_0x4da262(++_0x141f34);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x6b1b[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require(_0xb6b1('0x0'));var jayson=require(_0xb6b1('0x1'));var schema=require(_0xb6b1('0x2'));var BPromise=require('bluebird');var moment=require(_0xb6b1('0x3'));var config=require(_0xb6b1('0x4'));var properties=require(_0xb6b1('0x5'));var ami=require(_0xb6b1('0x6'));exports[_0xb6b1('0x7')]=function(_0x345886,_0x41bf3e,_0x113a39){return new BPromise(function(_0x1ff716,_0x13334e){var _0x1a4cd0={'QueuePause':function(_0x5b440a){return new Promise(function(_0x2734cc,_0x52aa76){var _0x4da7d3=util[_0xb6b1('0x8')]('%s/%s',_0xb6b1('0x9'),_0x5b440a['name']);if(_0x345886['timers']&&_0x345886['timers'][_0x4da7d3]&&_0x345886['timers'][_0x4da7d3][_0xb6b1('0xa')]){_0x345886[_0xb6b1('0xb')][_0x4da7d3]['updateAcw']();}if(_0x345886[_0xb6b1('0xc')][_0x4da7d3]){_0x345886['agents'][_0x4da7d3]['updateStatusRealtime']({'statePause':_0x5b440a[_0xb6b1('0xd')]?!![]:![]});}_0x2734cc({'code':0xc8,'message':_0xb6b1('0xe')});});},'Reload':function(_0x12f3ff){var _0x327eee=this;return new Promise(function(_0x23881d,_0x18f6b5){if(ami[_0xb6b1('0xf')]()==![]){return _0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')]['join']('\x20')));}_0x12f3ff=_['pick'](_0x12f3ff,_['keys'](properties['module']));_0x12f3ff[_0xb6b1('0x14')]=_0xb6b1('0x15');return ami[_0xb6b1('0x16')](_0x12f3ff)[_0xb6b1('0x17')](function(_0x32e395){_0x23881d({'code':0xc8,'message':_0x32e395[_0xb6b1('0x18')]});})['catch'](function(_0x581e28){_0x18f6b5(_0x327eee[_0xb6b1('0x10')](0x1f5,_0x581e28[_0xb6b1('0x18')]));});});},'Command':function(_0x16d969){var _0x11e8ae=this;return new Promise(function(_0x45d9e6,_0x3fc9b1){if(ami['isConnected']()==![]){return _0x3fc9b1(_0x11e8ae['error'](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}_0x16d969=_['pick'](_0x16d969,'command');_0x16d969[_0xb6b1('0x14')]=_0xb6b1('0x1a');return ami[_0xb6b1('0x16')](_0x16d969)[_0xb6b1('0x17')](function(_0x164952){_0x45d9e6({'code':0xc8,'message':_0x164952[_0xb6b1('0x1b')]});})[_0xb6b1('0x1c')](function(_0x3b1ff7){_0x3fc9b1(_0x11e8ae[_0xb6b1('0x10')](0x1f5,_0x3b1ff7[_0xb6b1('0x18')]));});});},'VoiceQueues':function(_0x5069cd){return new Promise(function(_0x214cd0,_0x4f1e2e){var _0xd8e094=[];for(var _0x5864d6 in _0x345886[_0xb6b1('0x1d')]){if(_0x345886['voiceQueues'][_0xb6b1('0x1e')](_0x5864d6)){var _0x387603=_0x345886[_0xb6b1('0x1d')][_0x5864d6];var _0x178401={'id':_0x387603['id'],'name':_0x387603[_0xb6b1('0x1f')],'strategy':_0x387603[_0xb6b1('0x20')],'answered':_0x387603[_0xb6b1('0x21')],'available':_0x387603[_0xb6b1('0x22')],'loggedIn':_0x387603[_0xb6b1('0x23')],'pTalking':_0x387603['pTalking'],'sumBillable':_0x387603[_0xb6b1('0x24')],'sumDuration':_0x387603['sumDuration'],'sumHoldTime':_0x387603[_0xb6b1('0x25')]||0x0,'talking':_0x387603[_0xb6b1('0x26')],'total':_0x387603[_0xb6b1('0x27')],'type':_0x387603[_0xb6b1('0x28')],'unmanaged':_0x387603[_0xb6b1('0x29')],'abandoned':_0x387603[_0xb6b1('0x2a')],'waiting':_0x387603[_0xb6b1('0x2b')],'loggedInDb':_0x387603['loggedInDb']};if(_0x387603[_0xb6b1('0x28')]===_0xb6b1('0x2c')){_0x178401[_0xb6b1('0x2d')]=_0x387603['dialActive'];_0x178401[_0xb6b1('0x2e')]=_0x387603[_0xb6b1('0x2e')];_0x178401['dialOriginateCallerIdName']=_0x387603[_0xb6b1('0x2f')];_0x178401[_0xb6b1('0x30')]=_0x387603[_0xb6b1('0x30')];_0x178401[_0xb6b1('0x31')]=_0x387603[_0xb6b1('0x31')];_0x178401[_0xb6b1('0x32')]=_0x387603['dialPrefix'];_0x178401[_0xb6b1('0x33')]=_0x387603[_0xb6b1('0x33')];_0x178401['outboundAnswerAgiCallsDay']=_0x387603[_0xb6b1('0x34')];_0x178401['outboundAnswerCallsDay']=_0x387603[_0xb6b1('0x35')];_0x178401[_0xb6b1('0x36')]=_0x387603[_0xb6b1('0x36')];_0x178401[_0xb6b1('0x37')]=_0x387603[_0xb6b1('0x37')];_0x178401[_0xb6b1('0x38')]=_0x387603['outboundCongestionCallsDay'];_0x178401[_0xb6b1('0x39')]=_0x387603[_0xb6b1('0x39')];_0x178401[_0xb6b1('0x3a')]=_0x387603[_0xb6b1('0x3a')];_0x178401['outboundDropCallsDayTimeout']=_0x387603['outboundDropCallsDayTimeout'];_0x178401['outboundNoAnswerCallsDay']=_0x387603[_0xb6b1('0x3b')];_0x178401[_0xb6b1('0x3c')]=_0x387603[_0xb6b1('0x3c')];_0x178401[_0xb6b1('0x3d')]=_0x387603[_0xb6b1('0x3d')];_0x178401[_0xb6b1('0x3e')]=_0x387603[_0xb6b1('0x3e')];_0x178401[_0xb6b1('0x3f')]=_0x387603[_0xb6b1('0x3f')];_0x178401[_0xb6b1('0x40')]=_0x387603[_0xb6b1('0x40')];_0x178401[_0xb6b1('0x41')]=_0x387603['predictiveIntervalAnsweredCalls'];_0x178401[_0xb6b1('0x42')]=_0x387603[_0xb6b1('0x42')];_0x178401[_0xb6b1('0x43')]=_0x387603[_0xb6b1('0x43')];_0x178401[_0xb6b1('0x44')]=_0x387603[_0xb6b1('0x44')];_0x178401[_0xb6b1('0x45')]=_0x387603[_0xb6b1('0x45')];_0x178401[_0xb6b1('0x46')]=_0x387603[_0xb6b1('0x46')];_0x178401[_0xb6b1('0x47')]=_0x387603['predictiveIntervalErlangCallsDroppedCalls'];_0x178401[_0xb6b1('0x48')]=_0x387603[_0xb6b1('0x48')];_0x178401[_0xb6b1('0x49')]=_0x387603[_0xb6b1('0x49')];_0x178401[_0xb6b1('0x4a')]=_0x387603[_0xb6b1('0x4a')];_0x178401[_0xb6b1('0x4b')]=_0x387603[_0xb6b1('0x4b')];_0x178401['predictiveIntervalTotalCalls']=_0x387603['predictiveIntervalTotalCalls'];_0x178401[_0xb6b1('0x18')]=_0x387603[_0xb6b1('0x18')];_0x178401[_0xb6b1('0x4c')]=_0x387603['originated'];_0x178401[_0xb6b1('0x4d')]=_0x387603[_0xb6b1('0x4d')];_0x178401[_0xb6b1('0x4e')]=_0x387603[_0xb6b1('0x4e')];_0x178401[_0xb6b1('0x4f')]=_0x387603[_0xb6b1('0x4f')];_0x178401[_0xb6b1('0x50')]=_0x387603[_0xb6b1('0x50')];_0x178401['startPredictive']=_0x387603[_0xb6b1('0x51')];_0x178401['startProgressive']=_0x387603[_0xb6b1('0x52')];}if(_0x387603[_0xb6b1('0x53')]){_0x178401[_0xb6b1('0x53')]={'id':_0x387603[_0xb6b1('0x53')]['id'],'name':_0x387603[_0xb6b1('0x53')][_0xb6b1('0x1f')],'active':_0x387603['Trunk'][_0xb6b1('0x54')],'callerid':_0x387603[_0xb6b1('0x53')]['callerid']};}if(_0x387603[_0xb6b1('0x55')]){_0x178401['Interval']={'id':_0x387603[_0xb6b1('0x55')]['id'],'name':_0x387603[_0xb6b1('0x55')][_0xb6b1('0x1f')]};}_0xd8e094[_0xb6b1('0x56')](_0x178401);}}_0x214cd0({'count':_0xd8e094[_0xb6b1('0x57')],'rows':_0xd8e094});});},'UpdateVoiceQueue':function(_0x20489a){return new Promise(function(_0x19cc0f,_0x31a6c7){var _0x1d5b09=_['find'](_0x345886['voiceQueues'],{'id':parseInt(_0x20489a['id'])});var _0x3826bd=_[_0xb6b1('0x58')](_0x20489a,['id']);if(_0x1d5b09){for(var _0x5959ca in _0x3826bd){if(typeof _0x3826bd[_0x5959ca]!==_0xb6b1('0x59')&&typeof _0x1d5b09[_0x5959ca]!==_0xb6b1('0x59')){_0x1d5b09[_0x5959ca]=_0x3826bd[_0x5959ca];}}_0x19cc0f(_0x1d5b09);}else{_0x31a6c7();}});},'VoiceChannels':function(_0x6f7b41){return new Promise(function(_0x1a95cf,_0x7cebdc){var _0x505a80=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x5b')]);_0x1a95cf({'count':_0x505a80[_0xb6b1('0x57')],'rows':_0x505a80});});},'VoiceChannelMixMonitor':function(_0x3f02bc){var _0x4da826=this;return new Promise(function(_0x5bfd0e,_0x20e93b){if(ami['isConnected']()==![]){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config['asterisk'][_0xb6b1('0x12')],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x7d4763=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x3f02bc);if(_0x7d4763[_0xb6b1('0x57')]>0x0){return _0x20e93b(_0x4da826[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x7d4763,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x2700ed=_['find'](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x3f02bc[_0xb6b1('0x5e')]});if(_0x2700ed&&_0x2700ed[_0xb6b1('0x5f')]){var _0x39c0d9=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x3f02bc[_0xb6b1('0x61')]||_0x3f02bc[_0xb6b1('0x5e')],_0x3f02bc[_0xb6b1('0x8')]||'wav');return ami[_0xb6b1('0x16')]({'action':'MixMonitor','channel':_0x2700ed['channel'],'file':_0x39c0d9,'options':_0xb6b1('0x62')})[_0xb6b1('0x17')](function(_0x5be7bf){var _0x3b482b=_[_0xb6b1('0x63')](_0x2700ed[_0xb6b1('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x39c0d9[_0xb6b1('0x65')]()});if(_['isNil'](_0x3b482b)){_0x2700ed['monitors'][_0xb6b1('0x56')]({'filename':_0xb6b1('0x66')+_0x39c0d9['toLowerCase'](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5be7bf[_0xb6b1('0x67')],'status':'rec'});}else{_0x3b482b['mixmonitorid']=_0x5be7bf['mixmonitorid'];_0x3b482b[_0xb6b1('0x68')]=_0xb6b1('0x69');}_0x5bfd0e({'code':0xc8,'message':[_0x3f02bc[_0xb6b1('0x5e')],_0xb6b1('0x6a'),_0x5be7bf[_0xb6b1('0x67')]][_0xb6b1('0x19')]('\x20'),'mixmonitorid':_0x5be7bf['mixmonitorid']});})[_0xb6b1('0x1c')](function(_0x322e35){_0x20e93b(_0x4da826['error'](0x1f5,[_0x3f02bc['uniqueid'],_0x322e35[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')));});}else{return _0x20e93b(_0x4da826['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x484afc){var _0x463482=this;return new Promise(function(_0x1ce8a2,_0x4a07ed){if(ami[_0xb6b1('0xf')]()==![]){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,[config[_0xb6b1('0x11')]['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x35aae0=schema(properties[_0xb6b1('0x5c')])[_0xb6b1('0x2')](_0x484afc);if(_0x35aae0['length']>0x0){return _0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x35aae0,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x4a7796=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x5b')],{'uniqueid':_0x484afc[_0xb6b1('0x5e')]});if(_0x4a7796){return BPromise[_0xb6b1('0x6c')]()[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'StopMixMonitor','channel':_0x4a7796['channel'],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})['catch'](function(_0x2e91fa){});}})[_0xb6b1('0x17')](function(){if(_0x4a7796[_0xb6b1('0x6d')]){return ami['Action']({'action':_0xb6b1('0x6e'),'channel':_0x4a7796[_0xb6b1('0x6d')],'mixmonitorid':_0x484afc[_0xb6b1('0x67')]})[_0xb6b1('0x1c')](function(_0x463112){});}})['then'](function(_0x4ddcf3){var _0x11e94e=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'mixmonitorid':_0x484afc[_0xb6b1('0x67')]});if(_0x11e94e){_0x11e94e[_0xb6b1('0x68')]=_0xb6b1('0x6f');}})[_0xb6b1('0x17')](function(){var _0x3d6edf=util[_0xb6b1('0x8')](_0xb6b1('0x60'),_0x484afc[_0xb6b1('0x61')]||_0x484afc[_0xb6b1('0x5e')],_0x484afc['format']||_0xb6b1('0x70'));var _0x49ace7=_[_0xb6b1('0x63')](_0x4a7796[_0xb6b1('0x64')],{'filename':_0xb6b1('0x66')+_0x3d6edf['toLowerCase']()});if(_0x49ace7){_0x49ace7[_0xb6b1('0x68')]='stop';}})['then'](function(){_0x1ce8a2({'code':0xc8,'message':[_0x484afc[_0xb6b1('0x5e')],'StopMixMonitor\x20Success'][_0xb6b1('0x19')]('\x20')});})[_0xb6b1('0x1c')](function(_0x509667){_0x4a07ed(_0x463482[_0xb6b1('0x10')](0x1f5,[_0x484afc['uniqueid'],_0x509667[_0xb6b1('0x18')][_0xb6b1('0x65')]()][_0xb6b1('0x19')]('\x20')));});}else{return _0x4a07ed(_0x463482['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannels':function(_0x4ef26a){return new Promise(function(_0x20f2f2,_0x469f7f){var _0x3e1695=_[_0xb6b1('0x5a')](_0x345886['queueChannels']);_0x20f2f2({'count':_0x3e1695[_0xb6b1('0x57')],'rows':_0x3e1695});});},'VoiceQueuesChannel':function(_0x410fe6){var _0x3e663d=this;return new Promise(function(_0xb611fa,_0x381793){var _0x2aa294=schema(properties['voicequeuechannel'])[_0xb6b1('0x2')](_0x410fe6);if(_0x2aa294[_0xb6b1('0x57')]>0x0){return _0x381793(_0x3e663d[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x2aa294,'message')[_0xb6b1('0x19')](',\x20')));}var _0x1c4bde=_['find'](_0x345886['queueChannels'],{'uniqueid':_0x410fe6['uniqueid']});if(_0x1c4bde){_0xb611fa(_0x1c4bde);}else{return _0x381793(_0x3e663d['error'](0x1f5,_0xb6b1('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x439b23){var _0x17ce08=this;return new Promise(function(_0xc203ce,_0x1d039a){if(ami[_0xb6b1('0xf')]()==![]){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')]['username'],'ami\x20disconnected'][_0xb6b1('0x19')]('\x20')));}var _0x28213e=schema(properties['voicequeuechannelhangup'])[_0xb6b1('0x2')](_0x439b23);if(_0x28213e[_0xb6b1('0x57')]>0x0){return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x28213e,_0xb6b1('0x18'))['join'](',\x20')));}var _0x3d96c6=_[_0xb6b1('0x63')](_0x345886['queueChannels'],{'uniqueid':_0x439b23['uniqueid']});if(_0x3d96c6&&_0x3d96c6[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':_0xb6b1('0x71'),'channel':_0x3d96c6[_0xb6b1('0x5f')]})[_0xb6b1('0x17')](function(_0x28860e){_0xc203ce({'code':0xc8,'message':[_0x439b23[_0xb6b1('0x5e')],_0x28860e[_0xb6b1('0x18')][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x57fd39){_0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,[_0x439b23[_0xb6b1('0x5e')],_0x57fd39[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x1d039a(_0x17ce08[_0xb6b1('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x37c3e6){var _0x588390=this;return new Promise(function(_0x4c79dc,_0x955b9b){if(ami['isConnected']()==![]){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xb6b1('0x11')][_0xb6b1('0x12')],_0xb6b1('0x13')][_0xb6b1('0x19')]('\x20')));}var _0x3765ca=schema(properties['voicequeuechannelredirect'])[_0xb6b1('0x2')](_0x37c3e6);if(_0x3765ca[_0xb6b1('0x57')]>0x0){return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f4,_[_0xb6b1('0x5d')](_0x3765ca,_0xb6b1('0x18'))[_0xb6b1('0x19')](',\x20')));}var _0x19415a=_[_0xb6b1('0x63')](_0x345886[_0xb6b1('0x72')],{'uniqueid':_0x37c3e6[_0xb6b1('0x5e')]});if(_0x19415a&&_0x19415a[_0xb6b1('0x5f')]){return ami[_0xb6b1('0x16')]({'action':'Redirect','channel':_0x19415a[_0xb6b1('0x5f')],'exten':_0x37c3e6[_0xb6b1('0x73')],'context':_0x37c3e6['context']||_0x19415a[_0xb6b1('0x74')],'priority':0x1})[_0xb6b1('0x17')](function(_0x5b02b7){_0x4c79dc({'code':0xc8,'message':[_0x37c3e6[_0xb6b1('0x5e')],_0x5b02b7['message'][_0xb6b1('0x65')]()]['join']('\x20')});})[_0xb6b1('0x1c')](function(_0x5e1d5c){_0x955b9b(_0x588390['error'](0x1f5,[_0x37c3e6[_0xb6b1('0x5e')],_0x5e1d5c[_0xb6b1('0x18')]['toLowerCase']()][_0xb6b1('0x19')]('\x20')));});}else{return _0x955b9b(_0x588390[_0xb6b1('0x10')](0x1f5,_0xb6b1('0x6b')));}});},'Agents':function(_0xac8b8a){return new Promise(function(_0x292dbe,_0x6b6d3){var _0x3e7949=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0xc')]);_0x292dbe({'count':_0x3e7949[_0xb6b1('0x57')],'rows':_0x3e7949});});},'Telephones':function(_0x28231c){return new Promise(function(_0x18a71f,_0x521366){var _0x1d1e49=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x75')]);_0x18a71f({'count':_0x1d1e49[_0xb6b1('0x57')],'rows':_0x1d1e49});});},'Trunks':function(_0x489898){return new Promise(function(_0x1ee829,_0x2be41a){var _0x15818e=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x76')]);_0x1ee829({'count':_0x15818e[_0xb6b1('0x57')],'rows':_0x15818e});});},'OutboundChannels':function(_0x4872c7){return new Promise(function(_0x3954dd,_0x2c0509){var _0xe96200=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x77')]);_0x3954dd({'count':_0xe96200[_0xb6b1('0x57')],'rows':_0xe96200});});},'Outbound':function(_0x137c52){return new Promise(function(_0x433ce8,_0x400819){_0x433ce8(_0x345886[_0xb6b1('0x2c')]);});},'Campaigns':function(_0x3b9eb2){return new Promise(function(_0x54fa89,_0x5d3d77){var _0x2046e5=_[_0xb6b1('0x5a')](_0x345886[_0xb6b1('0x78')]);_0x54fa89({'count':_0x2046e5[_0xb6b1('0x57')],'rows':_0x2046e5});});},'VoiceQueuesPreview':function(_0x36d30b){var _0x32b89e=this;return new Promise(function(_0x43d32a,_0x3fbff1){_0x41bf3e['run'](_0x36d30b['id'])[_0xb6b1('0x17')](function(_0x1fa035){_0x43d32a({'code':0xc8,'message':_0x1fa035[_0xb6b1('0x18')]});})['catch'](function(_0x8f27ea){_0x3fbff1(_0x32b89e['error'](0x1f4,_0x8f27ea['message']));});});},'EventManager':function(_0x13f438){var _0x320c96=this;return new Promise(function(_0xa7b8d2,_0xf5dbf9){if(!_0x13f438[_0xb6b1('0x79')]){return _0xf5dbf9(_0x320c96[_0xb6b1('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xb6b1('0x7a')](_0xb6b1('0x7b')+_0x13f438[_0xb6b1('0x79')],_0x13f438[_0xb6b1('0x18')]);_0xa7b8d2({'code':0xc8,'message':_0x13f438});});},'FaxAccounts':function(_0x5712df){return new Promise(function(_0x4ea394,_0xdeaa28){var _0x5c8321=_[_0xb6b1('0x5a')](_0x345886['faxAccounts']);_0x4ea394({'count':_0x5c8321[_0xb6b1('0x57')],'rows':_0x5c8321});});},'SendFax':function(_0x516f87){var _0x58b209=this;return new Promise(function(_0x384595,_0x349feb){_0x113a39[_0xb6b1('0x7c')](_0x516f87)[_0xb6b1('0x17')](function(_0x3929e1){_0x384595({'code':0xc8,'message':_0x3929e1['message']});})[_0xb6b1('0x1c')](function(_0x170d5c){_0x349feb(_0x58b209[_0xb6b1('0x10')](0x1f4,_0x170d5c[_0xb6b1('0x18')]));});});},'CheckAfterSend':function(_0x523037){var _0xb668af=this;return new Promise(function(_0x5248c7,_0x3158cd){_0x113a39['checkAfterSend'](_0x523037)[_0xb6b1('0x17')](function(_0x554155){_0x5248c7({'code':0xc8,'message':_0x554155['message']});})['catch'](function(_0x4908ab){_0x3158cd(_0xb668af[_0xb6b1('0x10')](0x1f4,_0x4908ab['message']));});});}};var _0x25dbd6=jayson[_0xb6b1('0x7d')](_0x1a4cd0)[_0xb6b1('0x7e')]();_0x25dbd6['on'](_0xb6b1('0x10'),function(_0x5d1c1d){return _0x13334e(_0x5d1c1d);});_0x25dbd6[_0xb6b1('0x7')](0x232a,_0xb6b1('0x7f'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x1ff716('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 770dbf0..af442b1 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 _0x032e=['format','user:%s','name','trigger:%s','action','toLowerCase','merge','lodash','ioredis','util','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','routeId','destcalleridnum','calleridnum','firstName','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s',''];(function(_0x3a34d8,_0x293d9d){var _0x1986de=function(_0x6ce570){while(--_0x6ce570){_0x3a34d8['push'](_0x3a34d8['shift']());}};_0x1986de(++_0x293d9d);}(_0x032e,0x124));var _0xe032=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x032e[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xe032('0x0'));var BPromise=require('bluebird');var Redis=require(_0xe032('0x1'));var util=require(_0xe032('0x2'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xe032('0x3'));var cmContactRpc=require(_0xe032('0x4'));config[_0xe032('0x5')]=_[_0xe032('0x6')](config[_0xe032('0x5')],{'host':_0xe032('0x7'),'port':0x18eb});var io=require(_0xe032('0x8'))(new Redis(config[_0xe032('0x5')]));function emit(_0x37432f,_0x1576c8,_0x3289b0,_0xd84027,_0xaf3907){logger[_0xe032('0x9')](_0xe032('0xa'),_0x37432f,_0x1576c8['id'],_0x3289b0,_0xd84027,JSON[_0xe032('0xb')](_0xaf3907));io['to'](_0x3289b0)[_0xe032('0xc')](_0xd84027,_0xaf3907);}exports[_0xe032('0xd')]=function(_0x4aec53,_0x1382e1,_0x1ce2ae,_0x13c126){var _0x42e2ba,_0x244f93;var _0x21883b={};var _0x2194fc=Number(_0x1ce2ae['data1']);var _0x646979=_0x1ce2ae[_0xe032('0xe')]?Boolean(Number(_0x1ce2ae[_0xe032('0xe')])):![];var _0x1a53ab;var _0x4aee44=![];if(!_[_0xe032('0xf')](_0x1ce2ae[_0xe032('0x10')])){if(_0x1ce2ae[_0xe032('0x10')]=='1')_0x4aee44=!![];}if(!_0x4aee44){if(_0x13c126[_0xe032('0x11')]){_0x21883b['id']=_0x13c126[_0xe032('0x11')];}}if(!_0x21883b['id']){_0x21883b[_0xe032('0x12')]=_0x2194fc;_0x1a53ab=_0x1ce2ae[_0xe032('0x13')]&&_0x1ce2ae['data3']!=='0'?_0x1ce2ae[_0xe032('0x13')][_0xe032('0x14')](','):[_0xe032('0x15')];_0x21883b[_0xe032('0x16')]=_[_0xe032('0x17')](_0x1a53ab,function(_0x208b00){var _0x4cdab3={};_0x4cdab3[_0x208b00]=_0x13c126[_0xe032('0x18')]?_0x13c126[_0xe032('0x19')]:_0x13c126[_0xe032('0x1a')];return _0x4cdab3;});}var _0x41d2a5=['id',_0xe032('0x1b'),'lastName','phone','mobile',_0xe032('0x1c'),'ListId',_0xe032('0x1d'),_0xe032('0x1e'),_0xe032('0x1f')];var _0x2aa342=_[_0xe032('0x20')](_0x41d2a5,_0x1a53ab);BPromise[_0xe032('0x21')]()[_0xe032('0x22')](cmContactRpc['getContacts']({'attributes':_0x2aa342,'where':_0x21883b}))[_0xe032('0x22')](function(_0x866c81){_0x244f93=_0x866c81;if(!_[_0xe032('0x23')](_0x244f93)){if(_0x244f93[_0xe032('0x24')]===0x1){_0x42e2ba=_0x244f93[0x0];logger[_0xe032('0x9')](_0xe032('0x25'),_0x13c126[_0xe032('0x26')],_0x1382e1['id'],_0x42e2ba['id']);}else{logger[_0xe032('0x9')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x13c126['uniqueid'],_0x1382e1['id'],_['map'](_0x244f93,'id')[_0xe032('0x27')](','));}return;}else{logger[_0xe032('0x9')](_0xe032('0x28'),_0x13c126[_0xe032('0x26')],_0x1382e1['id']);var _0x2bfe8f={'ListId':_0x2194fc};var _0x200671=_0x1ce2ae[_0xe032('0x29')]&&_0x1ce2ae[_0xe032('0x29')]!=='0'?_0x1ce2ae[_0xe032('0x29')]:_0xe032('0x15');if(_0x646979){logger['info'](_0xe032('0x2a'),_0x13c126[_0xe032('0x26')],_0x1382e1['id']);_0x2bfe8f[_0x200671]=_[_0xe032('0xf')](_0x13c126[_0xe032('0x18')])?_0x13c126['calleridnum']:_0x13c126['destcalleridnum'];if(_[_0xe032('0xf')](_0x13c126[_0xe032('0x18')])){_0x2bfe8f[_0xe032('0x1b')]=_0x13c126[_0xe032('0x2b')]&&_0x13c126['calleridname']!==''?_0x13c126['calleridname']:_0xe032('0x2c');}else{_0x2bfe8f[_0xe032('0x1b')]=_0x13c126[_0xe032('0x2d')]&&_0x13c126[_0xe032('0x2d')]!==''?_0x13c126[_0xe032('0x2d')]:_0xe032('0x2c');}return BPromise[_0xe032('0x21')]()[_0xe032('0x22')](cmContactRpc[_0xe032('0x2e')](_0x2bfe8f))['then'](function(_0xd90bd5){_0x42e2ba=_0xd90bd5;_0x244f93[_0xe032('0x2f')](_0xd90bd5);if(_0x42e2ba){logger[_0xe032('0x9')](_0xe032('0x30'),_0x13c126['uniqueid'],_0x1382e1['id'],_0x42e2ba['id']);}return;});}else{logger[_0xe032('0x9')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x13c126[_0xe032('0x26')],_0x1382e1['id']);_0x2bfe8f[_0x200671]=_['isNil'](_0x13c126[_0xe032('0x18')])?_0x13c126['calleridnum']:_0x13c126[_0xe032('0x19')];if(_['isNil'](_0x13c126[_0xe032('0x18')])){_0x2bfe8f[_0xe032('0x1b')]=_0x13c126['calleridname']&&_0x13c126[_0xe032('0x2b')]!==_0xe032('0x31')?_0x13c126[_0xe032('0x2b')]:_0xe032('0x2c');}else{_0x2bfe8f['firstName']=_0x13c126[_0xe032('0x2d')]&&_0x13c126['destcalleridname']!==_0xe032('0x31')?_0x13c126[_0xe032('0x2d')]:'Unknown';}_0x42e2ba=_0x2bfe8f;_0x244f93[_0xe032('0x2f')](_0x2bfe8f);return;}}})[_0xe032('0x22')](function(){if(_0x4aec53){emit(_0x13c126['uniqueid'],_0x1382e1,util[_0xe032('0x32')](_0xe032('0x33'),_0x4aec53[_0xe032('0x34')]),util[_0xe032('0x32')](_0xe032('0x35'),_0x1ce2ae[_0xe032('0x36')][_0xe032('0x37')]()),{'evt':_[_0xe032('0x38')](_0x13c126,{'autoCreate':_0x646979}),'contact':_0x42e2ba===undefined?{}:_0x42e2ba,'contacts':_0x244f93[_0xe032('0x24')]===0x0?undefined:_0x244f93});}});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 715d20d..4d6dcc9 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 _0x1ef9=['defaults','localhost','socket.io-emitter','redis','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentconnect','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:dialbegin','syncAgentDial','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','info','stringify','emit','prototype','clone','undefined','motionChannel','voice','interface','checkTriggers','hasOwnProperty','status','checkTrigger','variables','Actions','action','toLowerCase','contactmanager','browser','data1','TemplateId','html','data2','template\x20not\x20found','buildUri','data3','isNil','location','uriLocation','data4','windowWidth','data5','800','600','data6','winApplication','render','format','user:%s','trigger:%s:%s','merge','name','trigger:%s','exec','queue','routeId','urlforward','script','parse','query','search','replace','AllConditions','length','every','checkConditions','some','AnyConditions','channel','field','account','ChatWebsiteId','operator','value','upperFirst','interaction','message','event','agent','membername','lastevent','mailSubstatus','null','substatus','exports','util','url','mustache','ioredis','./urlforward','./integration','../../../config/environment','trigger','../ami'];(function(_0x294901,_0x235a32){var _0x4126c7=function(_0x3f26c5){while(--_0x3f26c5){_0x294901['push'](_0x294901['shift']());}};_0x4126c7(++_0x235a32);}(_0x1ef9,0xeb));var _0x91ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1ef9[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x91ef('0x0'));var _=require('lodash');var url=require(_0x91ef('0x1'));var Mustache=require(_0x91ef('0x2'));var Redis=require(_0x91ef('0x3'));var urlforward=require(_0x91ef('0x4'));var integration=require(_0x91ef('0x5'));var cmContact=require('./cmContact');var script=require('./script');var config=require(_0x91ef('0x6'));var logger=require('../../../config/logger')(_0x91ef('0x7'));var ami=require(_0x91ef('0x8'));config['redis']=_[_0x91ef('0x9')](config['redis'],{'host':_0x91ef('0xa'),'port':0x18eb});var io=require(_0x91ef('0xb'))(new Redis(config[_0x91ef('0xc')]));var operators={'equals':function(_0x14ab08,_0xd62a7a){return _0x14ab08==_0xd62a7a;},'not_equals':function(_0x262f12,_0xd6fdf4){return _0x262f12!=_0xd6fdf4;}};var barAndWebActions=[_0x91ef('0xd'),_0x91ef('0x1'),_0x91ef('0xe')];function Trigger(_0x4ebcf8){this[_0x91ef('0xf')]=_0x4ebcf8[_0x91ef('0xf')];this['agents']=_0x4ebcf8[_0x91ef('0x10')];this[_0x91ef('0x11')]=_0x4ebcf8[_0x91ef('0x11')];this[_0x91ef('0x12')]=_0x4ebcf8[_0x91ef('0x12')];this[_0x91ef('0x13')]=_0x4ebcf8[_0x91ef('0x13')];this[_0x91ef('0x14')]=_0x4ebcf8[_0x91ef('0x14')];this[_0x91ef('0x15')]=_0x4ebcf8[_0x91ef('0x15')];this[_0x91ef('0x16')]=_0x4ebcf8[_0x91ef('0x16')];this[_0x91ef('0x17')]=_0x4ebcf8[_0x91ef('0x17')];this[_0x91ef('0x18')]=_0x4ebcf8[_0x91ef('0x18')];this[_0x91ef('0x19')]=_0x4ebcf8[_0x91ef('0x19')];this[_0x91ef('0x1a')]=_0x4ebcf8[_0x91ef('0x1a')];this[_0x91ef('0x1b')]=_0x4ebcf8[_0x91ef('0x1b')];this[_0x91ef('0x1c')]=_0x4ebcf8[_0x91ef('0x1c')];this['freshsalesAccounts']=_0x4ebcf8[_0x91ef('0x1d')];this[_0x91ef('0x1e')]={'zendesk':this[_0x91ef('0x14')],'salesforce':this[_0x91ef('0x16')],'freshdesk':this[_0x91ef('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x91ef('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x91ef('0x1a')],'dynamics365':this[_0x91ef('0x1c')],'freshsales':this[_0x91ef('0x1d')],'servicenow':this[_0x91ef('0x1b')]};ami['on']('custom:agentcalled',this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x21'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on']('custom:agentringnoanswer',this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x22'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x23'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on']('custom:agentnoanswer',this[_0x91ef('0x1f')]['bind'](this));ami['on'](_0x91ef('0x24'),this[_0x91ef('0x1f')]['bind'](this));ami['on'](_0x91ef('0x25'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on']('custom:agentreject',this[_0x91ef('0x1f')]['bind'](this));ami['on']('custom:amd',this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent']['bind'](this));ami['on']('custom:timeout',this['syncCustomEvent'][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x26'),this['syncAgentDial'][_0x91ef('0x20')](this));ami['on']('custom:dialconnect',this[_0x91ef('0x27')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x28'),this[_0x91ef('0x27')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x29'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x2a'),this['syncCustomEvent']['bind'](this));ami['on'](_0x91ef('0x2b'),this['syncCustomEvent']['bind'](this));ami['on'](_0x91ef('0x2c'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x91ef('0x1f')][_0x91ef('0x20')](this));ami['on'](_0x91ef('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0x91ef('0x2e'),this[_0x91ef('0x1f')][_0x91ef('0x20')](this));}Trigger['prototype']['emit']=function(_0x22f339,_0x14487e,_0x42c34f){logger[_0x91ef('0x2f')](_0x22f339,_0x14487e,JSON[_0x91ef('0x30')](_0x42c34f));io['to'](_0x22f339)[_0x91ef('0x31')](_0x14487e,_0x42c34f);};Trigger[_0x91ef('0x32')][_0x91ef('0x1f')]=function(_0x413071){var _0x2a2669=_[_0x91ef('0x33')](_0x413071);if(typeof _0x2a2669['motionChannel']===_0x91ef('0x34')){_0x2a2669[_0x91ef('0x35')]=_0x91ef('0x36');}this['checkTriggers'](_0x2a2669);};Trigger[_0x91ef('0x32')]['syncAgentDial']=function(_0x5506c4){if(this[_0x91ef('0x10')][_0x5506c4[_0x91ef('0x37')]]){this[_0x91ef('0x1f')](_0x5506c4);}};Trigger[_0x91ef('0x32')][_0x91ef('0x38')]=function(_0x5c35b2){var _0x489973;for(var _0x4fcb5f in this[_0x91ef('0xf')]){if(this['triggers'][_0x91ef('0x39')](_0x4fcb5f)){if(this[_0x91ef('0xf')][_0x4fcb5f][_0x91ef('0x3a')]){_0x489973=this[_0x91ef('0x3b')](this['triggers'][_0x4fcb5f],_0x5c35b2);if(_0x489973){_['merge'](_0x5c35b2,_0x5c35b2[_0x91ef('0x3c')]);for(var _0x37750b=0x0,_0x4ed4af,_0x2f51cf,_0x49c26c;_0x37750b0x0){_0x59bf34=_[_0xbe14('0x2b')](_0x16f884,_0x29fc64);}return _0x59bf34;}function getCustomFields(_0x1c7cc7,_0x19252f){var _0x34d648=[];var _0x36d4b2={'custom_fields':{}};if(_0x1c7cc7[_0xbe14('0x2a')]>0x0){_[_0xbe14('0x2c')](_0x1c7cc7,function(_0x4168c8){if(_[_0xbe14('0x2d')]([_0xbe14('0x2e'),_0xbe14('0x2f')],_0x4168c8[_0xbe14('0x30')])&&_0x4168c8[_0xbe14('0x31')]&&!_0x4168c8[_0xbe14('0x32')]){_0x36d4b2[_0x4168c8[_0xbe14('0x31')][_0xbe14('0x33')]()]=_0x4168c8[_0xbe14('0x34')][_0xbe14('0x35')]();}else if(_[_0xbe14('0x2d')](['string',_0xbe14('0x2f')],_0x4168c8['type'])&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x36d4b2['custom_fields'][_0x4168c8[_0xbe14('0x36')]]=_0x4168c8[_0xbe14('0x34')]['toString']();}else if(_0x4168c8['type']==='variable'&&_0x4168c8[_0xbe14('0x37')]&&_0x4168c8[_0xbe14('0x36')]&&_0x4168c8['customField']){_0x19252f[_0x4168c8[_0xbe14('0x37')]]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x37')]][_0xbe14('0x35')]());}else if(_0x4168c8['type']==='customVariable'&&_0x4168c8[_0xbe14('0x39')]&&_0x4168c8['Variable']['name']&&_0x4168c8['idField']&&_0x4168c8[_0xbe14('0x32')]){_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()]&&(_0x36d4b2[_0xbe14('0x38')][_0x4168c8[_0xbe14('0x36')]]=_0x19252f[_0x4168c8[_0xbe14('0x39')][_0xbe14('0x3a')][_0xbe14('0x33')]()][_0xbe14('0x35')]());}});}if(_0x36d4b2[_0xbe14('0x3b')]){_0x36d4b2[_0xbe14('0x3b')]=Number(_0x36d4b2['priority']);}return _0x36d4b2;}function getTicket(_0x4f51f8,_0x43cdaa,_0x2951e1,_0x13bfcf,_0x520e09){logger[_0xbe14('0x12')](_0xbe14('0x3c'));var _0xeda70e=_[_0xbe14('0x3d')]({'subject':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x3f')],_0x520e09,'\x20'),'type':_0xbe14('0x40'),'status':_0xbe14('0x41'),'labels':[_0xbe14('0x42'),'Motion',_0xbe14('0x43')][_0xbe14('0x44')](getTags(_0x13bfcf[_0xbe14('0x45')],_0xbe14('0x3a'))),'description':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0xbe14('0x47'),_0x43cdaa['id']),'class':_0xbe14('0x48')}},'message':{'direction':'in','body':intUtil[_0xbe14('0x3e')](_0x13bfcf[_0xbe14('0x46')],_0x520e09,'\x0a')}},getCustomFields(_0x13bfcf['Fields'],_0x520e09));return request({'uri':util['format'](_0xbe14('0x49'),_0x4f51f8[_0xbe14('0x28')],_0x2951e1['id']),'method':_0xbe14('0x29'),'body':_0xeda70e});}exports['queue']=function(_0x5d5318,_0x6b6aa8,_0x59ae4d,_0x5657fe,_0x3593f8,_0x1f0355){var _0x8216c3,_0x5051e4;_0x1f0355['remoteUri']=intUtil['stripTrailingSlash'](_0x1f0355[_0xbe14('0x28')]);_0x1f0355[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x1f0355['serverUrl']);if(_0x3593f8&&_0x3593f8[_0xbe14('0x4c')]){logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x4e'));_0x6b6aa8['recordingURL']=util['format'](_0xbe14('0x4f'),_0x1f0355[_0xbe14('0x4a')],_0x6b6aa8[_0xbe14('0x50')],md5(_0x6b6aa8[_0xbe14('0x50')]));}else{_0x6b6aa8[_0xbe14('0x51')]='';}headers['Authorization']=getAuth(_0x1f0355);return getUser(_0x1f0355,_0x5657fe['email'])[_0xbe14('0xd')](function(_0x2a3623){_0x8216c3=_0x2a3623;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x8216c3['id']);return getEndUser(_0x1f0355,_0x6b6aa8['calleridname'],_0x6b6aa8[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x53e8ab){_0x5051e4=_0x53e8ab;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x5051e4['id']);return getTicket(_0x1f0355,_0x8216c3,_0x5051e4,_0x59ae4d,_0x6b6aa8);})[_0xbe14('0xd')](function(_0x36c20c){if(_0x36c20c){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x36c20c['id']);switch(_0x1f0355['type']){case'integrationTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x36c20c['id']});break;case'newTab':logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x5657fe['name']),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')](_0xbe14('0x5b'),_0x36c20c['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x4d'),_0xbe14('0x5d'));}}})['catch'](function(_0x5aeea9){console[_0xbe14('0x5c')](_0x5aeea9);logger[_0xbe14('0x5c')](_0xbe14('0x4d'),JSON['stringify'](_0x5aeea9));});};exports['outbound']=function(_0x44fe0d,_0x134878,_0x50d78f,_0x339a86,_0x32496a,_0x50c2a0,_0x28f995){var _0x4a40d2,_0x41ba58;_0x50c2a0[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['remoteUri']);_0x50c2a0[_0xbe14('0x4a')]=intUtil[_0xbe14('0x4b')](_0x50c2a0['serverUrl']);if(_0x28f995&&_0x28f995[_0xbe14('0x5e')]&&_0x28f995[_0xbe14('0x5e')]!==_0xbe14('0x5f')){logger[_0xbe14('0x12')](_0xbe14('0x60'),'Recording\x20is\x20enabled!');_0x134878[_0xbe14('0x51')]=util[_0xbe14('0xb')](_0xbe14('0x4f'),_0x50c2a0[_0xbe14('0x4a')],_0x134878[_0xbe14('0x50')],md5(_0x134878[_0xbe14('0x50')]));}headers[_0xbe14('0x61')]=getAuth(_0x50c2a0);return getUser(_0x50c2a0,_0x339a86['email'])[_0xbe14('0xd')](function(_0x1b47a4){_0x4a40d2=_0x1b47a4;logger[_0xbe14('0x12')](_0xbe14('0x52'),_0x4a40d2['id']);return getEndUser(_0x50c2a0,_0x134878[_0xbe14('0x62')],_0x134878[_0xbe14('0x63')]);})[_0xbe14('0xd')](function(_0x32df3c){_0x41ba58=_0x32df3c;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x41ba58['id']);return getTicket(_0x50c2a0,_0x4a40d2,_0x41ba58,_0x50d78f,_0x134878);})[_0xbe14('0xd')](function(_0x4bccfc){if(_0x4bccfc){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x4bccfc['id']);switch(_0x50c2a0[_0xbe14('0x30')]){case _0xbe14('0x64'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x56'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x58'),{'recordId':_0x4bccfc['id']});break;case _0xbe14('0x65'):logger[_0xbe14('0x12')](_0xbe14('0x4d'),_0xbe14('0x59'));emit(util[_0xbe14('0xb')](_0xbe14('0x57'),_0x339a86[_0xbe14('0x3a')]),_0xbe14('0x5a'),{'uri':util[_0xbe14('0xb')]('%s/agent/tickets/%s',_0x50c2a0[_0xbe14('0x28')],_0x4bccfc['id'])});break;default:logger[_0xbe14('0x5c')](_0xbe14('0x60'),_0xbe14('0x5d'));}}})[_0xbe14('0x66')](function(_0x222944){logger[_0xbe14('0x5c')](_0xbe14('0x60'),JSON[_0xbe14('0x19')](_0x222944));});};exports[_0xbe14('0x67')]=function(_0x5917d5,_0x18be56,_0x442ec4,_0x2d4dd4,_0xfd32a3,_0x3ac6d8){var _0x5a1ea6,_0x42b341;_0x3ac6d8[_0xbe14('0x28')]=intUtil[_0xbe14('0x4b')](_0x3ac6d8[_0xbe14('0x28')]);_0x3ac6d8[_0xbe14('0x4a')]=intUtil['stripTrailingSlash'](_0x3ac6d8[_0xbe14('0x4a')]);if(_0xfd32a3&&_0xfd32a3[_0xbe14('0x4c')]){logger[_0xbe14('0x12')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',_0xbe14('0x4e'));_0x18be56[_0xbe14('0x51')]=util[_0xbe14('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3ac6d8[_0xbe14('0x4a')],_0x18be56[_0xbe14('0x50')],md5(_0x18be56[_0xbe14('0x50')]));}else{_0x18be56[_0xbe14('0x51')]='';}headers[_0xbe14('0x61')]=getAuth(_0x3ac6d8);return getUser(_0x3ac6d8)[_0xbe14('0xd')](function(_0x445302){_0x5a1ea6=_0x445302;logger['info']('The\x20User\x20ID\x20is:',_0x5a1ea6['id']);return getEndUser(_0x3ac6d8,_0x18be56[_0xbe14('0x6a')],_0x18be56[_0xbe14('0x53')]);})[_0xbe14('0xd')](function(_0x2510a0){_0x42b341=_0x2510a0;logger[_0xbe14('0x12')](_0xbe14('0x54'),_0x42b341['id']);return getTicket(_0x3ac6d8,_0x5a1ea6,_0x42b341,_0x442ec4,_0x18be56);})[_0xbe14('0xd')](function(_0x43511e){if(_0x43511e){logger['info']('Ticket\x20created!');logger[_0xbe14('0x12')](_0xbe14('0x55'),_0x43511e['id']);}})[_0xbe14('0x66')](function(_0x57729f){logger[_0xbe14('0x5c')]('['+_0x18be56[_0xbe14('0x68')][_0xbe14('0x69')]()+']',JSON[_0xbe14('0x19')](_0x57729f));});}; \ No newline at end of file +var _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x36f2b1,_0xda8101){var _0x5acb13=function(_0x1d4064){while(--_0x1d4064){_0x36f2b1['push'](_0x36f2b1['shift']());}};_0x5acb13(++_0xda8101);}(_0x55ca,0x126));var _0xa55c=function(_0x131fe7,_0x21fcdb){_0x131fe7=_0x131fe7-0x0;var _0x2eddf3=_0x55ca[_0x131fe7];return _0x2eddf3;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/dynamics365.js b/server/services/ami/trigger/integration/dynamics365.js index 8250ff2..1e0ea81 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 _0xd334=['includes','string','picklist','nameField','customField','indexOf','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecalls','queue','callDirection','ticketId','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','util','./util','ioredis','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','remoteUri','password','clientSecret','catch','error','toUpperCase','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','toLowerCase','outbound','calleridnum','contacts','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','replace','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach'];(function(_0x1dfa63,_0x362bd4){var _0x26f2a9=function(_0x31cc52){while(--_0x31cc52){_0x1dfa63['push'](_0x1dfa63['shift']());}};_0x26f2a9(++_0x362bd4);}(_0xd334,0x1b8));var _0x4d33=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xd334[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var BPromise=require(_0x4d33('0x0'));var rp=require(_0x4d33('0x1'));var util=require(_0x4d33('0x2'));var intUtil=require(_0x4d33('0x3'));var md5=require('md5');var Redis=require(_0x4d33('0x4'));var logger=require('../../../../config/logger')(_0x4d33('0x5'));var config=require(_0x4d33('0x6'));config[_0x4d33('0x7')]=_[_0x4d33('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x4d33('0x9'))(new Redis(config[_0x4d33('0x7')]));function getAuthToken(_0x128ede,_0x48eed7,_0x47d041){var _0x3afb36={'method':_0x4d33('0xa'),'uri':_0x48eed7,'form':{'client_id':_0x128ede[_0x4d33('0xb')],'resource':_0x128ede[_0x4d33('0xc')],'username':_0x128ede['username'],'password':_0x128ede[_0x4d33('0xd')],'grant_type':_0x4d33('0xd'),'client_secret':_0x128ede[_0x4d33('0xe')]},'json':!![]};return rp(_0x3afb36)['then'](function(_0x441908){return _0x441908['access_token'];})[_0x4d33('0xf')](function(_0x3d97ba){logger[_0x4d33('0x10')]('['+[_0x47d041[_0x4d33('0x11')]()]+']\x20Wrong\x20credentials!');return _0x3d97ba[_0x4d33('0x12')];});}function getUser(_0x399480,_0x4ac137,_0x43e97f,_0x29e079,_0x434131,_0x23b7cb){return new BPromise(function(_0x4e44f7,_0x34a746){return getAuthToken(_0x4ac137,_0x29e079,_0x23b7cb)[_0x4d33('0x13')](function(_0x594ce8){var _0x1f45e0={'method':_0x4d33('0x14'),'uri':_0x434131+_0x4d33('0x15'),'headers':{'Authorization':_0x4d33('0x16')+_0x594ce8,'OData-Version':_0x4d33('0x17')},'json':!![]};return rp(_0x1f45e0);})['then'](function(_0x44ee71){var _0xa637d2=_0x44ee71[_0x4d33('0x18')];var _0x17b65a=![];var _0x3ba4ca=null;if(!_[_0x4d33('0x19')](_0x43e97f)){if(intUtil[_0x4d33('0x1a')](_0x43e97f[_0x4d33('0x1b')])){_0x399480[_0x4d33('0x1c')]=_0x43e97f[_0x4d33('0x1b')];for(_0x3ba4ca=0x0;_0x3ba4ca<_0xa637d2['length'];_0x3ba4ca++){if(_0xa637d2[_0x3ba4ca][_0x4d33('0x1d')]===_0x43e97f['email']&&!_0xa637d2[_0x3ba4ca][_0x4d33('0x1e')]){_0x17b65a=!![];logger[_0x4d33('0x1f')]('['+[_0x23b7cb[_0x4d33('0x11')]()]+_0x4d33('0x20')+_0xa637d2[_0x3ba4ca][_0x4d33('0x21')]+'!');_0x399480[_0x4d33('0x22')]=_0xa637d2[_0x3ba4ca][_0x4d33('0x21')];}}}}if(!_0x17b65a){logger[_0x4d33('0x1f')]('['+[_0x23b7cb[_0x4d33('0x11')]()]+_0x4d33('0x23'));_0x399480['userEmail']=_0x4ac137[_0x4d33('0x24')];for(_0x3ba4ca=0x0;_0x3ba4ca<_0xa637d2[_0x4d33('0x25')];_0x3ba4ca++){if(_0xa637d2[_0x3ba4ca][_0x4d33('0x1d')]===_0x4ac137[_0x4d33('0x24')]){_0x399480[_0x4d33('0x22')]=_0xa637d2[_0x3ba4ca][_0x4d33('0x21')];}}}_0x4e44f7(_0x399480);})['catch'](function(_0x2e0d44){_0x34a746(_0x2e0d44[_0x4d33('0x12')]);});});}function createEndUser(_0x18b53b,_0x375afc,_0x468c66,_0x3af2fb,_0x2d4a58,_0x35b542){return new BPromise(function(_0x850d1a,_0x45429d){return getAuthToken(_0x375afc,_0x468c66,_0x35b542)[_0x4d33('0x13')](function(_0x5b6bf0){var _0x3f3e1c=_0x35b542[_0x4d33('0x26')]()===_0x4d33('0x27')?_0x2d4a58['destcalleridnum']:_0x2d4a58[_0x4d33('0x28')];var _0x592cfe={'method':'POST','uri':_0x3af2fb+_0x4d33('0x29'),'body':{'telephone1':_0x3f3e1c,'fullname':_0x3f3e1c,'firstname':_0x3f3e1c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4d33('0x2a')+_0x18b53b[_0x4d33('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x5b6bf0,'OData-Version':_0x4d33('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x592cfe);})[_0x4d33('0x13')](function(_0x432968){var _0x287253=_0x432968[_0x4d33('0x2b')][_0x4d33('0x2c')];var _0x4c2304=_0x287253[_0x4d33('0x2d')](_0x287253[_0x4d33('0x2e')]('(')+0x1,_0x287253[_0x4d33('0x2e')](')'));_0x18b53b[_0x4d33('0x2f')]=_0x4c2304;_0x850d1a(_0x18b53b);})[_0x4d33('0xf')](function(_0x6d1911){_0x45429d(_0x6d1911[_0x4d33('0x12')]);});});}function getEndUser(_0x554d1f,_0x5c1b23,_0x272847,_0x1a5c35,_0x3bbe69,_0x538e0f){return new BPromise(function(_0x404902,_0x1fa8e2){var _0x1b96fd=_0x538e0f['toLowerCase']()===_0x4d33('0x27')?_0x3bbe69[_0x4d33('0x30')]:_0x3bbe69['calleridnum'];return getAuthToken(_0x5c1b23,_0x272847,_0x538e0f)[_0x4d33('0x13')](function(_0x2e7571){var _0x538887={'method':'GET','uri':_0x1a5c35+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x1b96fd[_0x4d33('0x31')]('+','%2b')+'\x27','headers':{'Authorization':_0x4d33('0x16')+_0x2e7571,'If-None-Match':null,'OData-Version':_0x4d33('0x17')},'json':!![]};return rp(_0x538887);})[_0x4d33('0x13')](function(_0x11a466){var _0x350cae=null;if(_0x11a466){var _0x54ba7b=_0x11a466[_0x4d33('0x18')];var _0x132460=![];for(_0x350cae=0x0;_0x350cae<_0x54ba7b['length'];_0x350cae++){if(_0x54ba7b[_0x350cae][_0x4d33('0x32')]===_0x1b96fd){_0x132460=!![];_0x554d1f['enduserId']=_0x54ba7b[_0x350cae][_0x4d33('0x33')];}}if(_0x132460){_0x404902(_0x554d1f);}else{return createEndUser(_0x554d1f,_0x5c1b23,_0x272847,_0x1a5c35,_0x3bbe69,_0x538e0f)[_0x4d33('0x13')](function(_0x3458f2){logger['info']('['+[_0x538e0f['toUpperCase']()]+_0x4d33('0x34'),_0x3458f2[_0x4d33('0x2f')]);_0x404902(_0x3458f2);});}}else{return createEndUser(_0x554d1f,_0x5c1b23,_0x272847,_0x1a5c35,_0x3bbe69,_0x538e0f)[_0x4d33('0x13')](function(_0x538a65){logger[_0x4d33('0x1f')]('['+[_0x538e0f[_0x4d33('0x11')]()]+_0x4d33('0x35'),_0x538a65[_0x4d33('0x2f')]);_0x404902(_0x538a65);});}});});}function getCustomFields(_0x44068a,_0x3925ad,_0x31a012){var _0x237aaf={};if(_0x44068a['length']>0x0){_[_0x4d33('0x36')](_0x44068a,function(_0x5d5191){if(_[_0x4d33('0x37')]([_0x4d33('0x38'),_0x4d33('0x39')],_0x5d5191['type'])&&_0x5d5191[_0x4d33('0x3a')]&&!_0x5d5191[_0x4d33('0x3b')]){var _0x57cc87=_0x5d5191['idField'][_0x4d33('0x26')]();var _0x104fa7=_0x57cc87[_0x4d33('0x2d')](0x0,_0x57cc87[_0x4d33('0x3c')]('_'));var _0x2b7cab=_0x57cc87[_0x4d33('0x2d')](_0x57cc87[_0x4d33('0x3c')]('_')+0x1);if(_0x104fa7===_0x31a012){_0x237aaf[_0x2b7cab]=_0x5d5191['content'];}}});}return _0x237aaf;}function getTicket(_0x2d5bcc,_0x542464,_0x53d693,_0x9418f1,_0x3e3e1d,_0x386a0e,_0x451046){return new BPromise(function(_0x32762a,_0x372436){var _0x9f1126;return getAuthToken(_0x542464,_0x53d693,_0x451046)[_0x4d33('0x13')](function(_0x8eb3de){if(_0x386a0e[_0x4d33('0x3d')]===_0x4d33('0x3e')){_0x9f1126={'method':_0x4d33('0xa'),'uri':_0x9418f1+_0x4d33('0x3f'),'body':Object[_0x4d33('0x40')]({},{'title':intUtil[_0x4d33('0x41')](_0x386a0e[_0x4d33('0x42')],_0x3e3e1d,'\x20'),'description':intUtil[_0x4d33('0x41')](_0x386a0e[_0x4d33('0x43')],_0x3e3e1d,'\x0a'),'customerid_contact@odata.bind':_0x4d33('0x44')+_0x2d5bcc[_0x4d33('0x2f')]+')','ownerid@odata.bind':_0x4d33('0x2a')+_0x2d5bcc[_0x4d33('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x386a0e[_0x4d33('0x45')],_0x3e3e1d,_0x386a0e[_0x4d33('0x3d')])),'headers':{'Authorization':_0x4d33('0x16')+_0x8eb3de,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x386a0e['ticketType']==='phonecall'){_0x9f1126={'method':'POST','uri':_0x9418f1+_0x4d33('0x46'),'body':Object['assign']({},{'subject':intUtil[_0x4d33('0x41')](_0x386a0e[_0x4d33('0x42')],_0x3e3e1d,'\x20'),'phonenumber':String(_0x3e3e1d[_0x4d33('0x28')]),'description':intUtil['getString'](_0x386a0e['Descriptions'],_0x3e3e1d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4d33('0x44')+_0x2d5bcc[_0x4d33('0x2f')]+')','ownerid@odata.bind':_0x4d33('0x2a')+_0x2d5bcc[_0x4d33('0x22')]+')','directioncode':_0x2d5bcc['callDirection']===_0x4d33('0x47')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4d33('0x2a')+_0x2d5bcc[_0x4d33('0x22')]+')','participationtypemask':_0x2d5bcc[_0x4d33('0x48')]===_0x4d33('0x47')?0x2:0x1},{'partyid_contact@odata.bind':_0x4d33('0x44')+_0x2d5bcc[_0x4d33('0x2f')]+')','participationtypemask':_0x2d5bcc[_0x4d33('0x48')]===_0x4d33('0x47')?0x1:0x2}]},getCustomFields(_0x386a0e[_0x4d33('0x45')],_0x3e3e1d,_0x386a0e['ticketType'])),'headers':{'Authorization':_0x4d33('0x16')+_0x8eb3de,'OData-Version':_0x4d33('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x9f1126);})[_0x4d33('0x13')](function(_0x191e3f){var _0x372b5a=_0x191e3f[_0x4d33('0x2b')][_0x4d33('0x2c')];var _0x9473d6=_0x372b5a[_0x4d33('0x2d')](_0x372b5a[_0x4d33('0x2e')]('(')+0x1,_0x372b5a[_0x4d33('0x2e')](')'));_0x2d5bcc[_0x4d33('0x49')]=_0x9473d6;_0x32762a(_0x2d5bcc);})[_0x4d33('0xf')](function(_0x2e0868){_0x372436(_0x2e0868[_0x4d33('0x12')]);});});}function emit(_0x84f114,_0x4fa143,_0x5b7ef1,_0x2a85c1){var _0x4aecf8={'uri':util[_0x4d33('0x4a')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x84f114,_0x5b7ef1,_0x2a85c1)};io['to'](util['format'](_0x4d33('0x4b'),_0x4fa143))[_0x4d33('0x4c')](_0x4d33('0x4d'),_0x4aecf8);}exports['cs']=function(_0x16b491,_0x250f11,_0x25c660,_0x5b0ccb,_0x3d7260,_0x3e443e,_0x43cd02,_0x400228){var _0x4a2501={};_0x3e443e[_0x4d33('0xc')]=intUtil[_0x4d33('0x4e')](_0x3e443e[_0x4d33('0xc')]);_0x3e443e[_0x4d33('0x4f')]=intUtil['stripTrailingSlash'](_0x3e443e[_0x4d33('0x4f')]);_0x4a2501[_0x4d33('0x48')]=_0x400228===_0x4d33('0x47')||_0x400228===_0x4d33('0x50')?_0x4d33('0x47'):_0x4d33('0x27');var _0x90f06c=util['format'](_0x4d33('0x51'),_0x3e443e['remoteUri']);var _0x26f109=util[_0x4d33('0x4a')](_0x4d33('0x52'),_0x3e443e['tenantId']);var _0x3b008c=util['format'](_0x4d33('0x53'),_0x3e443e['serverUrl'],_0x250f11['uniqueid'],md5(_0x250f11[_0x4d33('0x54')]));if(_0x3d7260&&_0x3d7260[_0x4d33('0x55')]){logger[_0x4d33('0x1f')](_0x4d33('0x56'),_0x4d33('0x57'));_0x250f11[_0x4d33('0x58')]=_0x3b008c;}else if(_0x43cd02&&_0x43cd02['recordingFormat']&&_0x43cd02['recordingFormat']!=='none'){logger[_0x4d33('0x1f')](_0x4d33('0x59'),_0x4d33('0x57'));_0x250f11[_0x4d33('0x58')]=_0x3b008c;}else{_0x250f11[_0x4d33('0x58')]='';}return getUser(_0x4a2501,_0x3e443e,_0x5b0ccb,_0x26f109,_0x90f06c,_0x400228)[_0x4d33('0x13')](function(_0x5cb8b1){logger['info']('['+_0x400228[_0x4d33('0x11')]()+_0x4d33('0x5a'),_0x5cb8b1['userId']);logger[_0x4d33('0x1f')]('['+_0x400228[_0x4d33('0x11')]()+_0x4d33('0x5b'),_0x5cb8b1[_0x4d33('0x1c')]);return getEndUser(_0x5cb8b1,_0x3e443e,_0x26f109,_0x90f06c,_0x250f11,_0x400228);})[_0x4d33('0x13')](function(_0x3be7dc){logger[_0x4d33('0x1f')]('['+_0x400228[_0x4d33('0x11')]()+_0x4d33('0x5c'),_0x3be7dc[_0x4d33('0x2f')]);logger[_0x4d33('0x1f')]('['+_0x400228['toUpperCase']()+']\x20The\x20Enduser\x20phone\x20is:',_0x250f11[_0x4d33('0x28')]);return getTicket(_0x3be7dc,_0x3e443e,_0x26f109,_0x90f06c,_0x250f11,_0x25c660,_0x400228);})[_0x4d33('0x13')](function(_0xe1369c){logger['info'](util[_0x4d33('0x4a')]('['+_0x400228['toUpperCase']()+_0x4d33('0x5d'),_0x25c660[_0x4d33('0x3d')],_0xe1369c[_0x4d33('0x49')]));logger['info'](util[_0x4d33('0x4a')]('['+_0x400228['toUpperCase']()+_0x4d33('0x5e'),_0x400228));if(_0x400228!==_0x4d33('0x50')){logger[_0x4d33('0x1f')]('['+_0x400228['toUpperCase']()+']',_0x4d33('0x5f'));emit(_0x3e443e[_0x4d33('0xc')],_0x5b0ccb[_0x4d33('0x60')],_0x25c660[_0x4d33('0x3d')],_0xe1369c['ticketId']);}})[_0x4d33('0xf')](function(_0x47640c){logger[_0x4d33('0x10')]('['+_0x400228[_0x4d33('0x11')]()+_0x4d33('0x61'),util[_0x4d33('0x62')](_0x47640c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index fb25282..eb1db17 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 _0xc052=['contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','string','picklist','type','nameField','customField','toLowerCase','push','idField','content','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','uniqueid','Authorization','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','stringify','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','lastevent','toUpperCase','catch','lodash','md5','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','value','format','remoteUri','POST','then','info','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find'];(function(_0x37fd2e,_0x1c308c){var _0x36b938=function(_0x41360a){while(--_0x41360a){_0x37fd2e['push'](_0x37fd2e['shift']());}};_0x36b938(++_0x1c308c);}(_0xc052,0x1bf));var _0x2c05=function(_0x1de4ee,_0x15f9c0){_0x1de4ee=_0x1de4ee-0x0;var _0x98726b=_0xc052[_0x1de4ee];return _0x98726b;};'use strict';var _=require(_0x2c05('0x0'));var rp=require('request-promise');var md5=require(_0x2c05('0x1'));var util=require('util');var Redis=require(_0x2c05('0x2'));var intUtil=require('./util');var config=require(_0x2c05('0x3'));var logger=require(_0x2c05('0x4'))(_0x2c05('0x5'));config[_0x2c05('0x6')]=_[_0x2c05('0x7')](config[_0x2c05('0x6')],{'host':_0x2c05('0x8'),'port':0x18eb});var io=require(_0x2c05('0x9'))(new Redis(config[_0x2c05('0x6')]));var headers={'Content-Type':_0x2c05('0xa'),'Accept':_0x2c05('0xa')};function emit(_0x198a2b,_0x3ed3f1,_0x331fd2){io['to'](_0x198a2b)[_0x2c05('0xb')](_0x3ed3f1,_0x331fd2);}function getTicket(_0x371a4f,_0x3802bd,_0x13fab3,_0x472591,_0x316750){logger['info'](_0x2c05('0xc'));var _0xe85ecc=_[_0x2c05('0xd')]({'responder_id':_0x3802bd['id'],'requester_id':_0x13fab3['id'],'name':util['format'](_0x2c05('0xe'),_0x316750[_0x2c05('0xf')]),'phone':_0x316750[_0x2c05('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x2c05('0x11')](_0x472591[_0x2c05('0x12')],_0x316750,'\x20'),'description':intUtil[_0x2c05('0x11')](_0x472591[_0x2c05('0x13')],_0x316750,_0x2c05('0x14')),'tags':getTags(_0x472591[_0x2c05('0x15')],_0x2c05('0x16'))},getCustomFields(_0x472591[_0x2c05('0x17')],_0x316750));_0xe85ecc[_0x2c05('0x18')]=_[_0x2c05('0x19')](_[_0x2c05('0x1a')](_0xe85ecc['custom_fields'],'id'),_0x2c05('0x1b'));return request({'uri':util[_0x2c05('0x1c')]('%s/api/v2/tickets',_0x371a4f[_0x2c05('0x1d')]),'method':_0x2c05('0x1e'),'body':_0xe85ecc})[_0x2c05('0x1f')](function(_0x5600a4){logger[_0x2c05('0x20')]('Ticket\x20created!');return _0x5600a4;});}function getUser(_0x5b0b2e,_0x2c473f){if(intUtil[_0x2c05('0x21')](_0x2c473f)){return request({'uri':util['format'](_0x2c05('0x22'),_0x5b0b2e[_0x2c05('0x1d')]),'qs':{'email':_0x2c473f}})['then'](function(_0x91b57e){if(_0x91b57e[_0x2c05('0x23')]){logger[_0x2c05('0x20')](_0x2c05('0x24'));return _[_0x2c05('0x25')](_0x91b57e,function(_0x6fcbf0){return _0x6fcbf0[_0x2c05('0x26')][_0x2c05('0x27')]===_0x2c473f;});}else{logger['info'](_0x2c05('0x28'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x5b0b2e[_0x2c05('0x1d')])})[_0x2c05('0x1f')](function(_0x2b512d){logger[_0x2c05('0x20')]('Admin\x20account\x20selected.');return _0x2b512d;});}});}else{logger[_0x2c05('0x20')](_0x2c05('0x29'));return request({'uri':util['format'](_0x2c05('0x2a'),_0x5b0b2e['remoteUri'])})[_0x2c05('0x1f')](function(_0x1272da){logger[_0x2c05('0x20')](_0x2c05('0x2b'));return _0x1272da;});}}function getEndUser(_0x2f9fcb,_0x512e17,_0x3eb6d1){logger['info'](_0x2c05('0x2c'),_0x3eb6d1);return request({'uri':util[_0x2c05('0x1c')](_0x2c05('0x2d'),_0x2f9fcb['remoteUri']),'qs':{'phone':_0x3eb6d1}})[_0x2c05('0x1f')](function(_0x8d4153){if(_0x8d4153['length']){logger['info'](_0x2c05('0x2e'));return _['find'](_0x8d4153,{'phone':_0x3eb6d1});}else{logger['info'](_0x2c05('0x2f'));return request({'uri':util['format'](_0x2c05('0x2d'),_0x2f9fcb[_0x2c05('0x1d')]),'method':_0x2c05('0x1e'),'body':{'name':_0x512e17,'phone':_0x3eb6d1}})[_0x2c05('0x1f')](function(_0x30cad5){logger[_0x2c05('0x20')]('Enduser\x20created.');return _0x30cad5;});}});}function getAuth(_0x7800d9){return util[_0x2c05('0x1c')](_0x2c05('0x30'),new Buffer(_0x7800d9[_0x2c05('0x31')]+':X')[_0x2c05('0x32')](_0x2c05('0x33')));}function request(_0x298bed){logger[_0x2c05('0x34')](_0x2c05('0x35'),JSON['stringify'](_0x298bed));return rp(_[_0x2c05('0x7')](_0x298bed,{'method':_0x2c05('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x463747,_0x1f1863){var _0x493581=[];if(_0x463747&&_0x463747[_0x2c05('0x23')]>0x0){_0x493581=_[_0x2c05('0x37')](_0x463747,_0x1f1863);}return _0x493581;}function getCustomFields(_0x20fdec,_0x30ab65){var _0x477d7f=[];var _0x3769e7={'custom_fields':[]};if(_0x20fdec[_0x2c05('0x23')]>0x0){_['forEach'](_0x20fdec,function(_0x1f5936){if(_['includes']([_0x2c05('0x38'),_0x2c05('0x39')],_0x1f5936[_0x2c05('0x3a')])&&_0x1f5936[_0x2c05('0x3b')]&&!_0x1f5936[_0x2c05('0x3c')]){_0x3769e7[_0x1f5936[_0x2c05('0x3b')][_0x2c05('0x3d')]()]=_0x1f5936['content'][_0x2c05('0x32')]();}else if(_['includes']([_0x2c05('0x38'),_0x2c05('0x39')],_0x1f5936['type'])&&_0x1f5936['idField']&&_0x1f5936['customField']){_0x3769e7[_0x2c05('0x18')][_0x2c05('0x3e')]({'id':_0x1f5936[_0x2c05('0x3f')],'value':_0x1f5936[_0x2c05('0x40')][_0x2c05('0x32')]()});}else if(_0x1f5936[_0x2c05('0x3a')]===_0x2c05('0x41')&&_0x1f5936['variableName']&&_0x1f5936['idField']&&_0x1f5936['customField']){_0x30ab65[_0x1f5936[_0x2c05('0x42')]]&&_0x3769e7[_0x2c05('0x18')][_0x2c05('0x3e')]({'id':_0x1f5936[_0x2c05('0x3f')],'value':_0x30ab65[_0x1f5936[_0x2c05('0x42')]][_0x2c05('0x32')]()});}else if(_0x1f5936[_0x2c05('0x3a')]===_0x2c05('0x43')&&_0x1f5936[_0x2c05('0x44')]&&_0x1f5936[_0x2c05('0x44')][_0x2c05('0x16')]&&_0x1f5936[_0x2c05('0x3f')]&&_0x1f5936[_0x2c05('0x3c')]){_0x30ab65[_0x1f5936[_0x2c05('0x44')][_0x2c05('0x16')]['toLowerCase']()]&&_0x3769e7['custom_fields'][_0x2c05('0x3e')]({'id':_0x1f5936[_0x2c05('0x3f')],'value':_0x30ab65[_0x1f5936[_0x2c05('0x44')]['name'][_0x2c05('0x3d')]()][_0x2c05('0x32')]()});}});}return _0x3769e7;}exports[_0x2c05('0x45')]=function(_0x4ac76a,_0x2fb0e9,_0x34b066,_0x597e43,_0x425974,_0x269337){var _0x1f3137,_0xdd021e;_0x269337[_0x2c05('0x1d')]=intUtil['stripTrailingSlash'](_0x269337['remoteUri']);_0x269337['serverUrl']=intUtil[_0x2c05('0x46')](_0x269337[_0x2c05('0x47')]);if(_0x425974&&_0x425974[_0x2c05('0x48')]){logger[_0x2c05('0x20')](_0x2c05('0x49'),'Recording\x20is\x20enabled!');_0x2fb0e9['recordingURL']=util[_0x2c05('0x1c')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x269337[_0x2c05('0x47')],_0x2fb0e9[_0x2c05('0x4a')],md5(_0x2fb0e9[_0x2c05('0x4a')]));}else{_0x2fb0e9['recordingURL']='';}headers[_0x2c05('0x4b')]=getAuth(_0x269337);return getUser(_0x269337,_0x597e43[_0x2c05('0x27')])[_0x2c05('0x1f')](function(_0x50d9fc){_0x1f3137=_0x50d9fc;logger['info'](_0x2c05('0x4c'),_0x1f3137['id']);return getEndUser(_0x269337,_0x2fb0e9['calleridname'],_0x2fb0e9[_0x2c05('0x10')]);})['then'](function(_0x82ae0d){_0xdd021e=_0x82ae0d;logger[_0x2c05('0x20')]('The\x20Enduser\x20ID\x20is:',_0xdd021e['id']);return getTicket(_0x269337,_0x1f3137,_0xdd021e,_0x34b066,_0x2fb0e9);})[_0x2c05('0x1f')](function(_0x9d0947){if(_0x9d0947&&_0x9d0947['id']){logger[_0x2c05('0x20')](_0x2c05('0x4d'));logger[_0x2c05('0x20')](_0x2c05('0x4e'),_0x9d0947['id']);logger[_0x2c05('0x20')](_0x2c05('0x49'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2c05('0x1c')](_0x2c05('0x4f'),_0x597e43[_0x2c05('0x16')]),_0x2c05('0x50'),{'uri':util[_0x2c05('0x1c')](_0x2c05('0x51'),_0x269337['remoteUri'],_0x9d0947['id'])});}})['catch'](function(_0x483cf3){logger[_0x2c05('0x52')](_0x2c05('0x49'),JSON[_0x2c05('0x53')](_0x483cf3));});};exports[_0x2c05('0x54')]=function(_0x35cfd4,_0x4a8a38,_0x3304f9,_0x2b42a2,_0x141cd2,_0xd9d92f,_0x57740c){var _0xf31665,_0x48e238;_0xd9d92f[_0x2c05('0x1d')]=intUtil[_0x2c05('0x46')](_0xd9d92f[_0x2c05('0x1d')]);_0xd9d92f['serverUrl']=intUtil[_0x2c05('0x46')](_0xd9d92f[_0x2c05('0x47')]);if(_0x57740c&&_0x57740c[_0x2c05('0x55')]&&_0x57740c[_0x2c05('0x55')]!==_0x2c05('0x56')){logger[_0x2c05('0x20')](_0x2c05('0x57'),_0x2c05('0x58'));_0x4a8a38[_0x2c05('0x59')]=util[_0x2c05('0x1c')](_0x2c05('0x5a'),_0xd9d92f['serverUrl'],_0x4a8a38['uniqueid'],md5(_0x4a8a38[_0x2c05('0x4a')]));}headers[_0x2c05('0x4b')]=getAuth(_0xd9d92f);return getUser(_0xd9d92f,_0x2b42a2['email'])['then'](function(_0x437cec){_0xf31665=_0x437cec;logger['info'](_0x2c05('0x4c'),_0xf31665['id']);return getEndUser(_0xd9d92f,_0x4a8a38[_0x2c05('0x5b')],_0x4a8a38[_0x2c05('0x5c')]);})[_0x2c05('0x1f')](function(_0x1325b2){_0x48e238=_0x1325b2;logger[_0x2c05('0x20')](_0x2c05('0x5d'),_0x48e238['id']);return getTicket(_0xd9d92f,_0xf31665,_0x48e238,_0x3304f9,_0x4a8a38);})[_0x2c05('0x1f')](function(_0x22b7b2){if(_0x22b7b2&&_0x22b7b2['id']){logger[_0x2c05('0x20')](_0x2c05('0x4d'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x22b7b2['id']);logger[_0x2c05('0x20')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2c05('0x1c')](_0x2c05('0x4f'),_0x2b42a2['name']),'trigger:browser:url',{'uri':util['format'](_0x2c05('0x51'),_0xd9d92f[_0x2c05('0x1d')],_0x22b7b2['id'])});}})['catch'](function(_0x2fc142){logger[_0x2c05('0x52')](_0x2c05('0x57'),JSON[_0x2c05('0x53')](_0x2fc142));});};exports['unmanaged']=function(_0x405e93,_0x4dc02c,_0x3ae8f4,_0x9cfcd6,_0x5d9583,_0x515885){var _0x2d6d13,_0x9c8740;_0x515885['remoteUri']=intUtil[_0x2c05('0x46')](_0x515885[_0x2c05('0x1d')]);_0x515885['serverUrl']=intUtil[_0x2c05('0x46')](_0x515885[_0x2c05('0x47')]);if(_0x5d9583&&_0x5d9583['monitor_format']){logger[_0x2c05('0x20')]('['+_0x4dc02c[_0x2c05('0x5e')][_0x2c05('0x5f')]()+']','Recording\x20is\x20enabled!');_0x4dc02c[_0x2c05('0x59')]=util[_0x2c05('0x1c')](_0x2c05('0x5a'),_0x515885[_0x2c05('0x47')],_0x4dc02c[_0x2c05('0x4a')],md5(_0x4dc02c['uniqueid']));}else{_0x4dc02c[_0x2c05('0x59')]='';}headers[_0x2c05('0x4b')]=getAuth(_0x515885);return getUser(_0x515885,'')[_0x2c05('0x1f')](function(_0x225231){_0x2d6d13=_0x225231;logger[_0x2c05('0x20')](_0x2c05('0x4c'),_0x2d6d13['id']);return getEndUser(_0x515885,_0x4dc02c['calleridname'],_0x4dc02c[_0x2c05('0x10')]);})[_0x2c05('0x1f')](function(_0x38d759){_0x9c8740=_0x38d759;logger['info']('The\x20Enduser\x20ID\x20is:',_0x9c8740['id']);return getTicket(_0x515885,_0x2d6d13,_0x9c8740,_0x3ae8f4,_0x4dc02c);})[_0x2c05('0x1f')](function(_0x53b704){if(_0x53b704){logger[_0x2c05('0x20')]('Ticket\x20created!');logger[_0x2c05('0x20')](_0x2c05('0x4e'),_0x53b704['id']);}})[_0x2c05('0x60')](function(_0x5e7a3c){logger[_0x2c05('0x52')]('['+_0x4dc02c['lastevent'][_0x2c05('0x5f')]()+']',JSON[_0x2c05('0x53')](_0x5e7a3c));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 65bdbce..8866cd8 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 _0x31ca=['../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','info','Getting\x20admin\x20information','then','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','/api/selector/owners','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','length','userId','User\x20found:','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','contactNumber','Contact\x20found\x20mobile_number:','work_number','endUserId','Contact\x20found\x20work_number:','Contact\x20created:','/api/contacts','headers','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','stripTrailingSlash','username','toLowerCase','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','md5','util','moment','bluebird','ioredis'];(function(_0x256fb4,_0xbb9af6){var _0x96b793=function(_0x359a62){while(--_0x359a62){_0x256fb4['push'](_0x256fb4['shift']());}};_0x96b793(++_0xbb9af6);}(_0x31ca,0x19d));var _0xa31c=function(_0x16d79f,_0x48d1c9){_0x16d79f=_0x16d79f-0x0;var _0x5146e3=_0x31ca[_0x16d79f];return _0x5146e3;};'use strict';var _=require(_0xa31c('0x0'));var rp=require(_0xa31c('0x1'));var md5=require(_0xa31c('0x2'));var util=require(_0xa31c('0x3'));var moment=require(_0xa31c('0x4'));var Promise=require(_0xa31c('0x5'));var Redis=require(_0xa31c('0x6'));var intUtil=require('./util');var config=require(_0xa31c('0x7'));var logger=require(_0xa31c('0x8'))('freshsales');config[_0xa31c('0x9')]=_[_0xa31c('0xa')](config['redis'],{'host':_0xa31c('0xb'),'port':0x18eb});var io=require(_0xa31c('0xc'))(new Redis(config[_0xa31c('0x9')]));function getAdminId(_0x53f364,_0x4390a,_0x21163c,_0x505a30){return new Promise(function(_0x3d3d1d,_0x5a7acb){var _0x54166c=![];var _0x1159ab={'method':_0xa31c('0xd'),'uri':_0x505a30+'/api/selector/owners','json':!![]};_0x1159ab['headers']=_0x21163c;logger[_0xa31c('0xe')](_0xa31c('0xf'));return rp(_0x1159ab)[_0xa31c('0x10')](function(_0x486cfb){if(_0x486cfb){var _0x33ac08=_0x486cfb['users'];var _0x590f4b=null;for(_0x590f4b=0x0;_0x590f4b<_0x33ac08['length'];_0x590f4b++){if(_0x33ac08[_0x590f4b][_0xa31c('0x11')]===_0x53f364[_0xa31c('0x12')]){_0x53f364[_0xa31c('0x13')]=_0x33ac08[_0x590f4b]['id'];_0x54166c=!![];}}if(_0x54166c){logger['info'](_0xa31c('0x14'),_0x53f364['adminId']);_0x3d3d1d(_0x53f364);}else{_0x5a7acb({'statusCode':0x194,'message':_0xa31c('0x15')});}}else{_0x5a7acb({'statusCode':0x194,'message':_0xa31c('0x15')});}})[_0xa31c('0x16')](function(_0x25f842){logger[_0xa31c('0x17')]('['+[_0x4390a[_0xa31c('0x18')]()]+']',_0x25f842['message']);_0x5a7acb(_0x25f842);});});}function getUser(_0x5bf9e6,_0x56e010,_0x3d463d){return function(_0x35b8dd){return new Promise(function(_0xe3cc3b,_0x4cae8a){var _0x54830d={'method':_0xa31c('0xd'),'uri':_0x3d463d+_0xa31c('0x19'),'json':!![]};_0x54830d['headers']=_0x56e010;logger[_0xa31c('0xe')](_0xa31c('0x1a'));return rp(_0x54830d)[_0xa31c('0x10')](function(_0x57e375){if(_0x57e375){var _0x3bf208=_0x57e375['users'];var _0x49f4ca=![];var _0x3c74f6=null;if(_0x35b8dd[_0xa31c('0x1b')]!==null){logger[_0xa31c('0xe')](_0xa31c('0x1c'),_0x35b8dd[_0xa31c('0x1b')]);_0x35b8dd['userEmail']=_0x35b8dd[_0xa31c('0x1b')];for(_0x3c74f6=0x0;_0x3c74f6<_0x3bf208[_0xa31c('0x1d')];_0x3c74f6++){if(_0x3bf208[_0x3c74f6]['email']===_0x35b8dd['agentEmail']){_0x49f4ca=!![];_0x35b8dd[_0xa31c('0x1e')]=_0x3bf208[_0x3c74f6]['id'];logger[_0xa31c('0xe')](_0xa31c('0x1f'),_0x35b8dd[_0xa31c('0x1e')]);}}}if(!_0x49f4ca){logger[_0xa31c('0xe')]('Admin\x20selected');_0x35b8dd['userEmail']=_0x35b8dd[_0xa31c('0x12')];_0x35b8dd['userId']=_0x35b8dd['adminId'];_0x49f4ca=!![];}if(_0x49f4ca){_0xe3cc3b(_0x35b8dd);}else{_0x4cae8a({'statusCode':0x194,'message':_0xa31c('0x15')});}}else{_0x4cae8a({'statusCode':0x194,'message':_0xa31c('0x15')});}})['catch'](function(_0x2cd11f){logger[_0xa31c('0x17')]('['+[_0x5bf9e6[_0xa31c('0x18')]()]+']',_0x2cd11f[_0xa31c('0x20')]);_0x4cae8a(_0x2cd11f);});});};}function searchContact(_0x4e5fe4,_0x150fda,_0x2bbb56,_0x18d71a){return new Promise(function(_0x11f42b,_0x50496b){var _0x3c1160={'method':'GET','headers':_0x150fda,'uri':_0x4e5fe4+_0xa31c('0x21')+_0x18d71a+_0xa31c('0x22')+_0x2bbb56+_0xa31c('0x23'),'json':!![]};rp(_0x3c1160)[_0xa31c('0x10')](function(_0x192956){var _0x192264=_[_0xa31c('0x24')](_0x192956[_0xa31c('0x25')]['contacts'],[_0x2bbb56,_0x18d71a]);_0x11f42b(_0x192264);})[_0xa31c('0x16')](function(_0x44621d){_0x50496b(_0x44621d);});});}function getEndUser(_0x467da2,_0x175d23,_0x2d9615){return function(_0x5d31e3){return new Promise(function(_0x3ef9a2,_0xe408b1){logger['info'](util[_0xa31c('0x26')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5d31e3[_0xa31c('0x27')]));searchContact(_0x2d9615,_0x175d23,'mobile_number',_0x5d31e3['contactNumber'])['then'](function(_0x2f06f2){if(_0x2f06f2){_0x5d31e3['endUserId']=_0x2f06f2['id'];logger[_0xa31c('0xe')](_0xa31c('0x28'),_0x5d31e3['endUserId']);return _0x3ef9a2(_0x5d31e3);}searchContact(_0x2d9615,_0x175d23,_0xa31c('0x29'),_0x5d31e3[_0xa31c('0x27')])[_0xa31c('0x10')](function(_0x47f196){if(_0x47f196){_0x5d31e3[_0xa31c('0x2a')]=_0x47f196['id'];logger[_0xa31c('0xe')](_0xa31c('0x2b'),_0x5d31e3[_0xa31c('0x2a')]);return _0x3ef9a2(_0x5d31e3);}createEndUser(_0x5d31e3,_0x467da2,_0x175d23,_0x2d9615)['then'](function(_0x26f0ad){logger[_0xa31c('0xe')](_0xa31c('0x2c'),_0x26f0ad[_0xa31c('0x2a')]);return _0x3ef9a2(_0x26f0ad);});});})[_0xa31c('0x16')](function(_0x2da80c){_0xe408b1(_0x2da80c);});});};}function createEndUser(_0x6f6e03,_0x4e42a2,_0x29ce9,_0x4d2529){return new Promise(function(_0x260666,_0x586822){var _0x2db46b=moment();var _0x6e8f8f={'method':'POST','uri':_0x4d2529+_0xa31c('0x2d'),'body':{'contact':{'last_name':_0x6f6e03[_0xa31c('0x27')],'work_number':_0x6f6e03[_0xa31c('0x27')],'mobile_number':_0x6f6e03[_0xa31c('0x27')],'owner_id':_0x6f6e03[_0xa31c('0x1e')],'created_at':_0x2db46b[_0xa31c('0x26')]('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x6e8f8f[_0xa31c('0x2e')]=_0x29ce9;logger[_0xa31c('0xe')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x6e8f8f)[_0xa31c('0x10')](function(_0x47697c){_0x6f6e03[_0xa31c('0x2a')]=_0x47697c[_0xa31c('0x2f')]['id'];_0x260666(_0x6f6e03);})['catch'](function(_0x16d9ee){logger['error']('['+[_0x4e42a2[_0xa31c('0x18')]()]+']',_0x16d9ee[_0xa31c('0x20')]);_0x586822(_0x16d9ee[_0xa31c('0x20')]);});});}function getTicket(_0x4b8247,_0x241baa,_0x46828e,_0x2dd9c6,_0x2cf8a2){return function(_0x930d4c){logger[_0xa31c('0xe')](_0xa31c('0x30'));return new Promise(function(_0x1f1463,_0x16b679){var _0x4d683c=moment();var _0x10d326={'method':'POST','uri':_0x46828e+_0xa31c('0x31'),'body':{'title':intUtil[_0xa31c('0x32')](_0x2dd9c6[_0xa31c('0x33')],_0x2cf8a2,'\x20'),'description':intUtil[_0xa31c('0x32')](_0x2dd9c6[_0xa31c('0x34')],_0x2cf8a2,'\x0a'),'owner_id':_0x930d4c[_0xa31c('0x1e')],'creater_id':_0x930d4c[_0xa31c('0x13')],'targetable_id':_0x930d4c[_0xa31c('0x2a')],'targetable_type':'Contact','created_at':_0x4d683c[_0xa31c('0x26')](_0xa31c('0x35')),'due_date':_0x4d683c[_0xa31c('0x36')](0x1e,'m')[_0xa31c('0x26')](_0xa31c('0x35'))},'json':!![]};_0x10d326['headers']=_0x241baa;return rp(_0x10d326)[_0xa31c('0x10')](function(_0x2358cd){_0x930d4c[_0xa31c('0x37')]=_0x2358cd[_0xa31c('0x38')]['id'];logger['info']('Task\x20created:',_0x930d4c[_0xa31c('0x37')]);_0x1f1463(_0x930d4c);})[_0xa31c('0x16')](function(_0x433d54){logger['error']('['+[_0x4b8247[_0xa31c('0x18')]()]+']',_0x433d54[_0xa31c('0x20')]);_0x16b679(_0x433d54[_0xa31c('0x20')]);});});};}function emit(_0x25f3d7,_0x2d54ee,_0x2bccd8){var _0x3c34e5={'uri':_0x25f3d7+_0xa31c('0x39')+_0x2bccd8};io['to'](util[_0xa31c('0x26')](_0xa31c('0x3a'),_0x2d54ee))[_0xa31c('0x3b')](_0xa31c('0x3c'),_0x3c34e5);}exports['cs']=function(_0x33d62e,_0x245877,_0x264ebf,_0x59c687,_0x3b3912,_0x5872c9,_0x3d6b86,_0x3ec03b){var _0x1c5330={};var _0xe144b0={'Authorization':_0xa31c('0x3d')+_0x5872c9[_0xa31c('0x3e')]};_0x5872c9[_0xa31c('0x3f')]=intUtil['stripTrailingSlash'](_0x5872c9[_0xa31c('0x3f')]);_0x5872c9[_0xa31c('0x40')]=intUtil[_0xa31c('0x41')](_0x5872c9[_0xa31c('0x40')]);var _0x1b1e80=_0x5872c9['remoteUri'];_0x1c5330[_0xa31c('0x12')]=_0x5872c9[_0xa31c('0x42')];_0x1c5330[_0xa31c('0x27')]=_0x3ec03b[_0xa31c('0x43')]()===_0xa31c('0x44')?_0x245877['destcalleridnum']:_0x245877[_0xa31c('0x45')];_0x1c5330[_0xa31c('0x46')]=_0x3ec03b===_0xa31c('0x47')||_0x3ec03b===_0xa31c('0x48')?'queue':_0xa31c('0x44');if(_0x59c687){_0x1c5330['agentEmail']=_0x59c687[_0xa31c('0x11')];}var _0x286d54=util[_0xa31c('0x26')](_0xa31c('0x49'),_0x5872c9['serverUrl'],_0x245877[_0xa31c('0x4a')],md5(_0x245877[_0xa31c('0x4a')]));if(_0x3b3912&&_0x3b3912[_0xa31c('0x4b')]){logger[_0xa31c('0xe')](_0xa31c('0x4c'),'Recording\x20is\x20enabled!');_0x245877['recordingURL']=_0x286d54;}else if(_0x3d6b86&&_0x3d6b86[_0xa31c('0x4d')]&&_0x3d6b86['recordingFormat']!=='none'){logger[_0xa31c('0xe')](_0xa31c('0x4e'),_0xa31c('0x4f'));_0x245877['recordingURL']=_0x286d54;}else{_0x245877['recordingURL']='';}return getAdminId(_0x1c5330,_0x3ec03b,_0xe144b0,_0x1b1e80)[_0xa31c('0x10')](getUser(_0x3ec03b,_0xe144b0,_0x1b1e80))[_0xa31c('0x10')](getEndUser(_0x3ec03b,_0xe144b0,_0x1b1e80))[_0xa31c('0x10')](getTicket(_0x3ec03b,_0xe144b0,_0x1b1e80,_0x264ebf,_0x245877))['then'](function(_0xaeb2eb){logger[_0xa31c('0xe')](util[_0xa31c('0x26')](_0xa31c('0x50'),_0xaeb2eb['ticketId']));if(_0x3ec03b!==_0xa31c('0x48')){logger[_0xa31c('0xe')]('['+[_0x3ec03b['toUpperCase']()]+']',_0xa31c('0x51'));emit(_0x1b1e80,_0x59c687[_0xa31c('0x52')],_0xaeb2eb[_0xa31c('0x2a')]);}})[_0xa31c('0x16')](function(_0x198366){logger[_0xa31c('0x17')]('['+[_0x3ec03b[_0xa31c('0x18')]()]+_0xa31c('0x53'),util['inspect'](_0x198366,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 79026f5..7c67c86 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 _0x1025=['desk','vtiger','dynamics365','freshsales','servicenow','exec','data1','toLowerCase','find','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','unmanaged','log','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','zoho'];(function(_0x13e382,_0x3654ef){var _0x2beed8=function(_0x377466){while(--_0x377466){_0x13e382['push'](_0x13e382['shift']());}};_0x2beed8(++_0x3654ef);}(_0x1025,0x136));var _0x5102=function(_0x11acac,_0x37d55f){_0x11acac=_0x11acac-0x0;var _0x1daa7e=_0x1025[_0x11acac];return _0x1daa7e;};'use strict';var _=require(_0x5102('0x0'));var util=require(_0x5102('0x1'));var zendesk=require(_0x5102('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x5102('0x3'));var freshdesk=require(_0x5102('0x4'));var zoho=require(_0x5102('0x5'));var desk=require('./desk');var vtiger=require(_0x5102('0x6'));var servicenow=require(_0x5102('0x7'));var dynamics365=require(_0x5102('0x8'));var freshsales=require(_0x5102('0x9'));var integrations=['zendesk',_0x5102('0xa'),_0x5102('0xb'),_0x5102('0xc'),_0x5102('0xd'),_0x5102('0xe'),_0x5102('0xf'),_0x5102('0x10'),_0x5102('0x11'),_0x5102('0x12')];exports[_0x5102('0x13')]=function(_0x19074f,_0x21be93,_0x59c679,_0x3df310,_0x21184a,_0x4dd6a5){if(_0x59c679){if(_['includes'](integrations,_0x19074f[_0x5102('0x14')][_0x5102('0x15')]())){try{var _0x38c5fc=null;var _0x371f88='';var _0x4118b6=_0x59c679[_0x19074f['data1'][_0x5102('0x15')]()];if(_0x4118b6){var _0x1e9540=_0x4118b6[_0x19074f['data2']];if(_0x1e9540){var _0x166236=_[_0x5102('0x16')](_0x1e9540['Configurations'],{'id':parseInt(_0x19074f[_0x5102('0x17')],0xa)});if(_0x166236){if(_0x3df310){if(_0x21184a&&_0x21be93[_0x5102('0x18')]){_0x371f88=_0x5102('0x18');}else if(_0x21be93[_0x5102('0x19')]){_0x371f88=_0x5102('0x1a');}else{console['log'](_0x5102('0x1b'),_0x21be93);}}else{_0x371f88=_0x5102('0x1c');}switch(_0x19074f['data1']['toLowerCase']()){case'zendesk':zendesk[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case _0x5102('0xa'):salesforce[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case _0x5102('0xb'):sugarcrm[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case _0x5102('0xc'):freshdesk[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case'zoho':zoho[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case _0x5102('0xe'):desk[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case'vtiger':vtiger[_0x371f88](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5);break;case _0x5102('0x11'):freshsales['cs'](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5,_0x371f88);break;case'servicenow':servicenow['cs'](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5,_0x371f88);break;case _0x5102('0x10'):dynamics365['cs'](_0x19074f,_0x21be93,_0x166236,_0x3df310,_0x21184a,_0x1e9540,_0x4dd6a5,_0x371f88);break;default:console[_0x5102('0x1d')]('unknown\x20integration');}}else{_0x38c5fc=require(_0x5102('0x1e'))(_0x19074f[_0x5102('0x14')][_0x5102('0x15')]());_0x38c5fc[_0x5102('0x1f')](_0x5102('0x20'),util['format'](_0x5102('0x21'),_0x19074f['data1'][_0x5102('0x15')](),_0x19074f[_0x5102('0x17')]));}}else{_0x38c5fc=require(_0x5102('0x1e'))(_0x19074f[_0x5102('0x14')]['toLowerCase']());_0x38c5fc[_0x5102('0x1f')](_0x5102('0x20'),util[_0x5102('0x22')](_0x5102('0x23'),_0x19074f[_0x5102('0x14')]['toLowerCase'](),_0x19074f['data2']));}}else{}}catch(_0x347ffb){console[_0x5102('0x1f')](_0x347ffb);}}}}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index 5a57406..0587546 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 _0xf6de=['[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:browser:url','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','isNil','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','emit','assign','getString','Subjects','Descriptions','ActivityDate','IsRecurrence','contact','endUserType','WhoId','account','WhatId','Case','AccountId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','create','forEach','string','picklist','idField','toString','variable','variableName','Variable','name','concat','securityToken','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','user:%s','trigger:salesforce:display','newTab','%s/%s/e','error'];(function(_0x4d724b,_0x55eec7){var _0x395757=function(_0x2f2769){while(--_0x2f2769){_0x4d724b['push'](_0x4d724b['shift']());}};_0x395757(++_0x55eec7);}(_0xf6de,0x10a));var _0xef6d=function(_0x316904,_0x1e8b77){_0x316904=_0x316904-0x0;var _0xfa9a21=_0xf6de[_0x316904];return _0xfa9a21;};'use strict';var _=require(_0xef6d('0x0'));var rp=require('request-promise');var moment=require(_0xef6d('0x1'));var BPromise=require(_0xef6d('0x2'));var md5=require(_0xef6d('0x3'));var jsforce=require(_0xef6d('0x4'));var util=require('util');var Redis=require(_0xef6d('0x5'));var intUtil=require(_0xef6d('0x6'));var config=require(_0xef6d('0x7'));var logger=require(_0xef6d('0x8'))(_0xef6d('0x9'));config[_0xef6d('0xa')]=_[_0xef6d('0xb')](config[_0xef6d('0xa')],{'host':_0xef6d('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x3b876f,_0x55c93d,_0x429139){io['to'](_0x3b876f)[_0xef6d('0xd')](_0x55c93d,_0x429139);}function getTicket(_0x2bc419,_0x367f83,_0x3a4fa2,_0x14abb9,_0x35dd9d,_0x5e4854,_0x133fa3,_0x3d5176){var _0xa07b16=Object[_0xef6d('0xe')]({},{'OwnerId':_0x367f83['id'],'Subject':intUtil[_0xef6d('0xf')](_0x14abb9[_0xef6d('0x10')],_0x35dd9d,'\x20'),'Description':intUtil[_0xef6d('0xf')](_0x14abb9[_0xef6d('0x11')],_0x35dd9d,'\x0a')},getCustomFields(_0x5e4854,_0x35dd9d));if(_0x3a4fa2){if(_0x14abb9['ticketType']==='Task'){_0xa07b16[_0xef6d('0x12')]=moment['utc']();_0xa07b16['IsReminderSet']=![];_0xa07b16[_0xef6d('0x13')]=![];if(_0x3a4fa2['endUserType']===_0xef6d('0x14')||_0x3a4fa2[_0xef6d('0x15')]==='lead'){_0xa07b16[_0xef6d('0x16')]=_0x3a4fa2['id'];}else if(_0x3a4fa2[_0xef6d('0x15')]===_0xef6d('0x17')){_0xa07b16[_0xef6d('0x18')]=_0x3a4fa2['id'];}}else if(_0x14abb9['ticketType']===_0xef6d('0x19')){if(_0x3a4fa2[_0xef6d('0x15')]==='contact'){_0xa07b16['ContactId']=_0x3a4fa2['id'];}else if(_0x3a4fa2[_0xef6d('0x15')]===_0xef6d('0x17')){_0xa07b16[_0xef6d('0x1a')]=_0x3a4fa2['id'];}else if(_0x3a4fa2[_0xef6d('0x15')]===_0xef6d('0x1b')&&_0x14abb9[_0xef6d('0x1c')]){_0xa07b16[_0x14abb9[_0xef6d('0x1c')]]=_0x3a4fa2['id'];}else{logger[_0xef6d('0x1d')](_0xef6d('0x1e'));}}}return _0x133fa3[_0xef6d('0x1f')](_0x14abb9['ticketType'])['create'](_0xa07b16);}function getUser(_0x486712,_0x339e36,_0x5a16dc){if(!_['isNil'](_0x339e36)&&intUtil[_0xef6d('0x20')](_0x339e36)){var _0x3d1773={'Email':_0x339e36};var _0x193f7a={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5a16dc[_0xef6d('0x1f')](_0xef6d('0x21'))[_0xef6d('0x22')](_0x3d1773,_0x193f7a)[_0xef6d('0x23')]()[_0xef6d('0x24')](function(_0x3c51df){if(_0x3c51df[_0xef6d('0x25')]){var _0x2b8a85=_[_0xef6d('0x22')](_0x3c51df,function(_0x422eff){return _0x422eff[_0xef6d('0x26')]===_0x339e36;});if(_0x2b8a85){logger[_0xef6d('0x1d')](_0xef6d('0x27'),_0x339e36);return BPromise[_0xef6d('0x28')]({'id':_0x2b8a85['Id'],'name':_0x2b8a85[_0xef6d('0x29')]});}}else{logger['info'](_0xef6d('0x2a'),_0x339e36);return _0x5a16dc[_0xef6d('0x2b')]()[_0xef6d('0x24')](function(_0x3f2ad5){return BPromise[_0xef6d('0x28')]({'id':_0x3f2ad5[_0xef6d('0x2c')],'name':_0x3f2ad5[_0xef6d('0x2d')]});});}});}else{logger[_0xef6d('0x1d')](_0xef6d('0x2a'),_0x339e36);return _0x5a16dc[_0xef6d('0x2b')]()['then'](function(_0x280d5f){return BPromise['resolve']({'id':_0x280d5f[_0xef6d('0x2c')],'name':_0x280d5f['display_name']});});}}function getEndUser(_0x364f26,_0x38b9ce,_0x39f63b,_0x4524bd,_0xa4bb41){var _0x293156={'$or':{'Phone':_0x4524bd}};var _0xa73676={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xef6d('0x28')]()['then'](function(){logger[_0xef6d('0x1d')](_0xef6d('0x2e'),_0x4524bd,_0x38b9ce['moduleSearch']);switch(_0x38b9ce[_0xef6d('0x2f')]){case'contact_lead':var _0x354dc3=_[_0xef6d('0x30')](_0x293156);if(_0x38b9ce[_0xef6d('0x31')]){var _0x2cfb7d={};_0x2cfb7d[_0x38b9ce[_0xef6d('0x31')]]=_0x4524bd;_[_0xef6d('0x32')](_0x354dc3[_0xef6d('0x33')],_0x2cfb7d);}return _0xa4bb41[_0xef6d('0x1f')](_0xef6d('0x34'))[_0xef6d('0x22')](_0x354dc3,_0xa73676)[_0xef6d('0x23')]()['then'](function(_0x5d38da){if(_0x5d38da&&_0x5d38da[_0xef6d('0x25')]){return _0x5d38da;}else{var _0x4870fb=_['cloneDeep'](_0x293156);if(_0x38b9ce[_0xef6d('0x35')]){var _0x3271cb={};_0x3271cb[_0x38b9ce['additionalSearchLead']]=_0x4524bd;_[_0xef6d('0x32')](_0x4870fb[_0xef6d('0x33')],_0x3271cb);}return _0xa4bb41[_0xef6d('0x1f')]('Lead')['find'](_0x4870fb,_0xa73676);}});case'account_contact_lead':var _0x4d5919=_[_0xef6d('0x30')](_0x293156);if(_0x38b9ce[_0xef6d('0x36')]){var _0x2cfb7d={};_0x2cfb7d[_0x38b9ce[_0xef6d('0x36')]]=_0x4524bd;_[_0xef6d('0x32')](_0x4d5919[_0xef6d('0x33')],_0x2cfb7d);}return _0xa4bb41[_0xef6d('0x1f')](_0xef6d('0x37'))['find'](_0x4d5919,_0xa73676)[_0xef6d('0x23')]()[_0xef6d('0x24')](function(_0x154796){if(_0x154796&&_0x154796[_0xef6d('0x25')]){return _0x154796;}else{var _0x3d6194=_[_0xef6d('0x30')](_0x293156);if(_0x38b9ce[_0xef6d('0x31')]){var _0x49f3f2={};_0x49f3f2[_0x38b9ce[_0xef6d('0x31')]]=_0x4524bd;_['merge'](_0x3d6194[_0xef6d('0x33')],_0x49f3f2);}return _0xa4bb41[_0xef6d('0x1f')](_0xef6d('0x34'))[_0xef6d('0x22')](_0x3d6194,_0xa73676)['then'](function(_0x1abb0a){if(_0x1abb0a&&_0x1abb0a[_0xef6d('0x25')]){return _0x1abb0a;}else{var _0x8a021b=_[_0xef6d('0x30')](_0x293156);if(_0x38b9ce[_0xef6d('0x35')]){var _0x4894bd={};_0x4894bd[_0x38b9ce[_0xef6d('0x35')]]=_0x4524bd;_[_0xef6d('0x32')](_0x8a021b[_0xef6d('0x33')],_0x4894bd);}return _0xa4bb41[_0xef6d('0x1f')]('Lead')[_0xef6d('0x22')](_0x8a021b,_0xa73676);}});}});case _0xef6d('0x14'):var _0x354dc3=_['cloneDeep'](_0x293156);if(_0x38b9ce[_0xef6d('0x31')]){var _0x2cfb7d={};_0x2cfb7d[_0x38b9ce[_0xef6d('0x31')]]=_0x4524bd;_['merge'](_0x354dc3[_0xef6d('0x33')],_0x2cfb7d);}return _0xa4bb41['sobject'](_0xef6d('0x34'))[_0xef6d('0x22')](_0x354dc3,_0xa73676)[_0xef6d('0x23')]();case _0xef6d('0x1b'):var _0x3fa03c=_[_0xef6d('0x30')](_0x293156);if(_0x38b9ce['additionalSearchLead']){var _0x2cfb7d={};_0x2cfb7d[_0x38b9ce[_0xef6d('0x35')]]=_0x4524bd;_[_0xef6d('0x32')](_0x3fa03c[_0xef6d('0x33')],_0x2cfb7d);}return _0xa4bb41['sobject']('Lead')[_0xef6d('0x22')](_0x3fa03c,_0xa73676);case _0xef6d('0x17'):var _0x4d5919=_[_0xef6d('0x30')](_0x293156);if(_0x38b9ce['additionalSearchAccount']){var _0x2cfb7d={};_0x2cfb7d[_0x38b9ce[_0xef6d('0x36')]]=_0x4524bd;_[_0xef6d('0x32')](_0x4d5919[_0xef6d('0x33')],_0x2cfb7d);}return _0xa4bb41[_0xef6d('0x1f')]('Account')[_0xef6d('0x22')](_0x4d5919,_0xa73676);default:return null;}})[_0xef6d('0x24')](function(_0x8e148){if(_0x8e148&&_0x8e148['length']){var _0x26d9ca=_[_0xef6d('0x38')](_0x8e148);if(_0x26d9ca){return BPromise['resolve']({'id':_0x26d9ca['Id'],'name':_0x26d9ca['Name'],'phone':_0x26d9ca[_0xef6d('0x39')],'endUserType':_0x26d9ca[_0xef6d('0x3a')][_0xef6d('0x3b')][_0xef6d('0x3c')]()});}}})[_0xef6d('0x24')](function(_0x3c15f7){if(_0x3c15f7){logger[_0xef6d('0x1d')](_0xef6d('0x3d'),_0x3c15f7['endUserType'],_0x4524bd);return BPromise[_0xef6d('0x28')](_0x3c15f7);}else{logger[_0xef6d('0x1d')](_0xef6d('0x3e'),_0x4524bd);var _0x3b2164={'Phone':_0x4524bd};if(_0x38b9ce[_0xef6d('0x3f')]){if(_0x38b9ce[_0xef6d('0x3f')]===_0xef6d('0x14')){logger[_0xef6d('0x1d')](_0xef6d('0x40'),_0x4524bd,_0x38b9ce['moduleCreate']);_0x3b2164[_0xef6d('0x41')]=_0x39f63b!==_0xef6d('0x42')?_0x39f63b:util[_0xef6d('0x43')](_0xef6d('0x44'),_0x4524bd);}else if(_0x38b9ce['moduleCreate']==='lead'){logger[_0xef6d('0x1d')](_0xef6d('0x40'),_0x4524bd,_0x38b9ce[_0xef6d('0x3f')]);_0x3b2164['LastName']=_0x39f63b!==_0xef6d('0x42')?_0x39f63b:util['format']('Caller\x20-\x20%s',_0x4524bd);_0x3b2164['Company']='No\x20Company';}else if(_0x38b9ce[_0xef6d('0x3f')]===_0xef6d('0x17')){logger['info'](_0xef6d('0x40'),_0x4524bd,_0x38b9ce[_0xef6d('0x3f')]);_0x3b2164[_0xef6d('0x29')]=_0x39f63b!==_0xef6d('0x42')?_0x39f63b:util['format']('Caller\x20-\x20%s',_0x4524bd);}else{return null;}}return _0xa4bb41[_0xef6d('0x1f')](_['upperFirst'](_0x38b9ce[_0xef6d('0x3f')]))[_0xef6d('0x45')](_0x3b2164)[_0xef6d('0x24')](function(_0x2c7b30){return BPromise[_0xef6d('0x28')]({'id':_0x2c7b30['id'],'endUserType':_0x38b9ce[_0xef6d('0x3f')]});});}});}function getCustomFields(_0x26e422,_0x1f5fd9){var _0x37dc50={};if(_0x26e422[_0xef6d('0x25')]>0x0){_[_0xef6d('0x46')](_0x26e422,function(_0x9f232f){if(_['includes']([_0xef6d('0x47'),_0xef6d('0x48')],_0x9f232f[_0xef6d('0x3b')])&&_0x9f232f[_0xef6d('0x49')]){_0x37dc50[_0x9f232f[_0xef6d('0x49')]]=_0x9f232f['content'][_0xef6d('0x4a')]();}else if(_0x9f232f[_0xef6d('0x3b')]===_0xef6d('0x4b')&&_0x9f232f[_0xef6d('0x4c')]&&_0x9f232f['idField']){_0x1f5fd9[_0x9f232f[_0xef6d('0x4c')]]&&(_0x37dc50[_0x9f232f[_0xef6d('0x49')]]=_0x1f5fd9[_0x9f232f[_0xef6d('0x4c')]][_0xef6d('0x4a')]());}else if(_0x9f232f[_0xef6d('0x3b')]==='customVariable'&&_0x9f232f[_0xef6d('0x4d')]&&_0x9f232f[_0xef6d('0x4d')][_0xef6d('0x4e')]&&_0x9f232f[_0xef6d('0x49')]){_0x1f5fd9[_0x9f232f['Variable'][_0xef6d('0x4e')]['toLowerCase']()]&&(_0x37dc50[_0x9f232f[_0xef6d('0x49')]]=_0x1f5fd9[_0x9f232f[_0xef6d('0x4d')][_0xef6d('0x4e')][_0xef6d('0x3c')]()][_0xef6d('0x4a')]());}});}return _0x37dc50;}function getConnection(_0xd9b749){var _0x311795=_0xd9b749['password'][_0xef6d('0x4f')](_0xd9b749[_0xef6d('0x50')]);var _0x353865=new jsforce['Connection']({'oauth2':{'loginUrl':_0xd9b749[_0xef6d('0x51')]||_0xef6d('0x52'),'clientId':_0xd9b749[_0xef6d('0x53')],'clientSecret':_0xd9b749[_0xef6d('0x54')]}});return _0x353865[_0xef6d('0x55')](_0xd9b749[_0xef6d('0x56')],_0x311795)[_0xef6d('0x24')](function(){logger[_0xef6d('0x1d')](_0xef6d('0x57'));return _0x353865;});}exports['queue']=function(_0x28113b,_0x4a91b6,_0x49609b,_0x25fec1,_0x4238a0,_0x3d9d77){var _0x52ad42,_0x405b60,_0x35644a,_0x459505;_0x3d9d77[_0xef6d('0x58')]=intUtil['stripTrailingSlash'](_0x3d9d77[_0xef6d('0x58')]);_0x3d9d77[_0xef6d('0x51')]=intUtil[_0xef6d('0x59')](_0x3d9d77[_0xef6d('0x51')]);if(_0x4238a0&&_0x4238a0[_0xef6d('0x5a')]){logger['info'](_0xef6d('0x5b'),_0xef6d('0x5c'));_0x4a91b6['recordingURL']=util['format'](_0xef6d('0x5d'),_0x3d9d77[_0xef6d('0x58')],_0x4a91b6[_0xef6d('0x5e')],md5(_0x4a91b6['uniqueid']));}else{_0x4a91b6[_0xef6d('0x5f')]='';}return getConnection(_0x3d9d77)['then'](function(_0x129b93){_0x459505=_0x129b93;return getUser(_0x3d9d77,_0x25fec1[_0xef6d('0x60')],_0x459505);})[_0xef6d('0x24')](function(_0x4484f9){_0x52ad42=_0x4484f9;return getEndUser(_0x3d9d77,_0x49609b,_0x4a91b6[_0xef6d('0x61')],_0x4a91b6['calleridnum'],_0x459505);})['then'](function(_0x752c36){_0x405b60=_0x752c36;return getTicket(_0x3d9d77,_0x52ad42,_0x405b60,_0x49609b,_0x4a91b6,_0x49609b[_0xef6d('0x62')],_0x459505,'queue');})[_0xef6d('0x24')](function(_0x36df0f){_0x35644a=_0x36df0f;logger['info'](_0xef6d('0x63'),_0x35644a['id']);logger[_0xef6d('0x1d')](_0xef6d('0x64'),_0x35644a['id'],_0x25fec1['name'],_0x3d9d77[_0xef6d('0x3b')]);switch(_0x3d9d77[_0xef6d('0x3b')]){case'integrationTab':emit(util[_0xef6d('0x43')](_0xef6d('0x65'),_0x25fec1[_0xef6d('0x4e')]),_0xef6d('0x66'),{'recordId':_0x35644a['id']});break;case _0xef6d('0x67'):emit(util[_0xef6d('0x43')](_0xef6d('0x65'),_0x25fec1[_0xef6d('0x4e')]),'trigger:browser:url',{'uri':util['format'](_0xef6d('0x68'),_0x459505['instanceUrl'],_0x35644a['id'])});break;default:logger[_0xef6d('0x69')](_0xef6d('0x6a'));}})[_0xef6d('0x6b')](function(_0x2159cd){logger[_0xef6d('0x69')](_0xef6d('0x5b'),_0x2159cd);});};exports[_0xef6d('0x6c')]=function(_0x16c956,_0x49b339,_0x435aba,_0x17476e,_0x13d750,_0x44edb8,_0x2a2fd6){var _0x3e7d6c,_0x2b0887,_0x560bef,_0x529069;_0x44edb8[_0xef6d('0x58')]=intUtil['stripTrailingSlash'](_0x44edb8[_0xef6d('0x58')]);_0x44edb8[_0xef6d('0x51')]=intUtil[_0xef6d('0x59')](_0x44edb8[_0xef6d('0x51')]);if(_0x2a2fd6&&_0x2a2fd6[_0xef6d('0x6d')]&&_0x2a2fd6[_0xef6d('0x6d')]!==_0xef6d('0x6e')){logger[_0xef6d('0x1d')](_0xef6d('0x6f'),_0xef6d('0x5c'));_0x49b339['recordingURL']=util[_0xef6d('0x43')](_0xef6d('0x5d'),_0x44edb8[_0xef6d('0x58')],_0x49b339[_0xef6d('0x5e')],md5(_0x49b339[_0xef6d('0x5e')]));}return getConnection(_0x44edb8)['then'](function(_0x1b4137){_0x529069=_0x1b4137;return getUser(_0x44edb8,_0x17476e[_0xef6d('0x60')],_0x529069);})[_0xef6d('0x24')](function(_0x2e1dae){_0x3e7d6c=_0x2e1dae;return getEndUser(_0x44edb8,_0x435aba,_0x49b339[_0xef6d('0x70')],_0x49b339[_0xef6d('0x71')],_0x529069);})['then'](function(_0x5b87c6){_0x2b0887=_0x5b87c6;return getTicket(_0x44edb8,_0x3e7d6c,_0x2b0887,_0x435aba,_0x49b339,_0x435aba[_0xef6d('0x62')],_0x529069,'outbound');})['then'](function(_0x5c9a70){_0x560bef=_0x5c9a70;logger[_0xef6d('0x1d')](_0xef6d('0x72'),_0x560bef['id']);logger[_0xef6d('0x1d')](_0xef6d('0x73'),_0x560bef['id'],_0x17476e[_0xef6d('0x4e')],_0x44edb8[_0xef6d('0x3b')]);switch(_0x44edb8[_0xef6d('0x3b')]){case'integrationTab':emit(util[_0xef6d('0x43')](_0xef6d('0x65'),_0x17476e['name']),_0xef6d('0x66'),{'recordId':_0x560bef['id']});break;case _0xef6d('0x67'):emit(util[_0xef6d('0x43')](_0xef6d('0x65'),_0x17476e[_0xef6d('0x4e')]),_0xef6d('0x74'),{'uri':util[_0xef6d('0x43')](_0xef6d('0x68'),_0x529069[_0xef6d('0x75')],_0x560bef['id'])});break;default:logger['error'](_0xef6d('0x6f'),_0xef6d('0x76'));}})[_0xef6d('0x6b')](function(_0xf43928){logger['error']('[OUTBOUND]',_0xf43928);});};exports['unmanaged']=function(_0x40e3b4,_0x1287c6,_0x15f913,_0x7531f7,_0x28d848,_0x219e9d){var _0xec95a7,_0x49d6d6,_0x4b7b03,_0x516173;_0x219e9d[_0xef6d('0x58')]=intUtil[_0xef6d('0x59')](_0x219e9d['serverUrl']);_0x219e9d[_0xef6d('0x51')]=intUtil[_0xef6d('0x59')](_0x219e9d['remoteUri']);if(_0x28d848&&_0x28d848[_0xef6d('0x5a')]){logger[_0xef6d('0x1d')]('['+_0x1287c6[_0xef6d('0x77')]['toUpperCase']()+']',_0xef6d('0x5c'));_0x1287c6[_0xef6d('0x5f')]=util[_0xef6d('0x43')](_0xef6d('0x5d'),_0x219e9d[_0xef6d('0x58')],_0x1287c6['uniqueid'],md5(_0x1287c6[_0xef6d('0x5e')]));}else{_0x1287c6[_0xef6d('0x5f')]='';}return getConnection(_0x219e9d)[_0xef6d('0x24')](function(_0x445dd6){_0x516173=_0x445dd6;if(!_[_0xef6d('0x78')](_0x7531f7)){return getUser(_0x219e9d,_0x7531f7[_0xef6d('0x4e')],_0x516173);}else{return getUser(_0x219e9d,null,_0x516173);}})[_0xef6d('0x24')](function(_0x5a8743){_0xec95a7=_0x5a8743;return getEndUser(_0x219e9d,_0x15f913,_0x1287c6[_0xef6d('0x61')],_0x1287c6['calleridnum'],_0x516173);})['then'](function(_0x42064f){_0x49d6d6=_0x42064f;return getTicket(_0x219e9d,_0xec95a7,_0x49d6d6,_0x15f913,_0x1287c6,_0x15f913['Fields'],_0x516173);})['then'](function(_0x28d67){_0x4b7b03=_0x28d67;logger[_0xef6d('0x1d')]('['+_0x1287c6[_0xef6d('0x77')][_0xef6d('0x79')]()+_0xef6d('0x7a'),_0x4b7b03['id']);logger[_0xef6d('0x1d')]('['+_0x1287c6[_0xef6d('0x77')]['toUpperCase']()+_0xef6d('0x7b'),_0x219e9d[_0xef6d('0x3b')]);})['catch'](function(_0x41c800){logger[_0xef6d('0x69')]('['+_0x1287c6[_0xef6d('0x77')]['toUpperCase']()+']',_0x41c800);});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/servicenow.js b/server/services/ami/trigger/integration/servicenow.js index ab09122..6fa741d 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 _0x638d=['label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','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','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','util','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','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','sys_user?sysparm_query=email%3D','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','user','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','type','customField','toLowerCase','content','idField','toString','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','incident','assign','Subjects','getString','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketNumber','number'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x638d,0x99));var _0xd638=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x638d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd638('0x0'));var Promise=require(_0xd638('0x1'));var rp=require(_0xd638('0x2'));var util=require(_0xd638('0x3'));var md5=require(_0xd638('0x4'));var Redis=require(_0xd638('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xd638('0x6'))(_0xd638('0x7'));config[_0xd638('0x8')]=_[_0xd638('0x9')](config[_0xd638('0x8')],{'host':_0xd638('0xa'),'port':0x18eb});var io=require(_0xd638('0xb'))(new Redis(config[_0xd638('0x8')]));function getAdminUser(_0x1d2c98,_0x2f3794,_0x56e627,_0x159bb1,_0x3a02e7,_0x27ac3e){return new Promise(function(_0x3d2f03,_0x44d01f){var _0x203c8e={'method':_0xd638('0xc'),'uri':_0x159bb1+_0xd638('0xd')+'&'+_0x3a02e7+'&'+_0x27ac3e,'auth':_0x2f3794,'json':!![]};return rp(_0x203c8e)[_0xd638('0xe')](function(_0x280862){if(_0x280862[_0xd638('0xf')][_0xd638('0x10')]>0x0){_0x56e627[_0xd638('0x11')]=_0x280862[_0xd638('0xf')][0x0][_0xd638('0x12')];}logger[_0xd638('0x13')]('['+[_0x1d2c98['toUpperCase']()]+_0xd638('0x14'),_0x56e627);_0x3d2f03(_0x56e627);})[_0xd638('0x15')](function(_0x50e8bc){logger[_0xd638('0x16')]('['+[_0x1d2c98[_0xd638('0x17')]()]+']',_0x50e8bc['message']);_0x44d01f(_0x50e8bc[_0xd638('0x18')]);});});}function getUser(_0x3461b1,_0x20dd3e,_0x29a8c5,_0x4fc3f5,_0x1b93eb){return function(_0x6893e5){logger['info']('['+[_0x3461b1['toUpperCase']()]+'],\x20getUser\x20input\x20crm',_0x6893e5);return new Promise(function(_0x45a68e,_0x2322ec){if(intUtil['validateEmail'](_0x6893e5['userEmail'])){var _0x493b24={'method':_0xd638('0xc'),'uri':_0x29a8c5+_0xd638('0x19')+_0x6893e5[_0xd638('0x1a')]+'&'+_0x4fc3f5+'&'+_0x1b93eb,'auth':_0x20dd3e,'json':!![]};logger[_0xd638('0x13')]('['+[_0x3461b1[_0xd638('0x17')]()]+_0xd638('0x1b'),_0x493b24);return rp(_0x493b24)[_0xd638('0xe')](function(_0x511d92){logger[_0xd638('0x13')]('['+[_0x3461b1[_0xd638('0x17')]()]+_0xd638('0x1c'),_0x511d92);if(_0x511d92['result'][_0xd638('0x10')]>0x0&&String(_0x511d92[_0xd638('0xf')][0x0]['active'])===_0xd638('0x1d')){_0x6893e5[_0xd638('0x1e')]=_0x511d92[_0xd638('0xf')][0x0][_0xd638('0x12')];}else{_0x6893e5['userId']=_0x6893e5[_0xd638('0x11')];_0x6893e5['userEmail']=_0x6893e5[_0xd638('0x1f')];}logger[_0xd638('0x13')]('['+[_0x3461b1[_0xd638('0x17')]()]+_0xd638('0x20'),_0x6893e5);_0x45a68e(_0x6893e5);})[_0xd638('0x15')](function(_0x4fd709){logger[_0xd638('0x16')]('['+[_0x3461b1[_0xd638('0x17')]()]+']',_0x4fd709['message']);_0x2322ec(_0x4fd709['message']);});}else{logger[_0xd638('0x13')]('['+[_0x3461b1[_0xd638('0x17')]()]+_0xd638('0x21'));_0x6893e5[_0xd638('0x1e')]=_0x6893e5[_0xd638('0x11')];_0x6893e5['userEmail']=_0x6893e5[_0xd638('0x1f')];_0x45a68e(_0x6893e5);}});};}function createEndUser(_0x177282,_0xca7249,_0x46f388,_0x26deaf,_0x5adbf0){logger[_0xd638('0x13')]('['+[_0x177282[_0xd638('0x17')]()]+'],\x20createEndUser\x20input\x20crm',_0x46f388);return new Promise(function(_0x5c1d00,_0x1597bd){var _0x4b5845={'method':_0xd638('0x22'),'uri':_0x26deaf+_0xd638('0x23')+_0x5adbf0,'body':{'user_name':_0x46f388[_0xd638('0x24')],'roles':_0xd638('0x25'),'first_name':_0x46f388[_0xd638('0x24')],'active':_0xd638('0x1d'),'date_format':_0xd638('0x26'),'phone':_0x46f388[_0xd638('0x24')]},'auth':_0xca7249,'json':!![]};return rp(_0x4b5845)[_0xd638('0xe')](function(_0xfb52f6){logger[_0xd638('0x13')]('['+[_0x177282[_0xd638('0x17')]()]+_0xd638('0x27'),_0xfb52f6[_0xd638('0xf')]);_0x46f388[_0xd638('0x28')]=_0xfb52f6[_0xd638('0xf')][_0xd638('0x12')];_0x5c1d00(_0x46f388);})['catch'](function(_0x4bbe6e){logger[_0xd638('0x16')]('['+[_0x177282['toUpperCase']()]+']',_0x4bbe6e[_0xd638('0x18')]);_0x1597bd(_0x4bbe6e[_0xd638('0x18')]);});});}function getEndUser(_0x5c9fbf,_0x29ff99,_0x5d02f4,_0x43c788,_0x161908){return function(_0x361e24){logger[_0xd638('0x13')]('['+[_0x5c9fbf[_0xd638('0x17')]()]+_0xd638('0x29'),_0x361e24);return new Promise(function(_0x3fd95a,_0x5305ea){var _0x4f5431={'method':_0xd638('0xc'),'uri':_0x5d02f4+_0xd638('0x2a')+_0x361e24[_0xd638('0x24')]+'&'+_0x43c788+'&'+_0x161908,'auth':_0x29ff99,'json':!![]};return rp(_0x4f5431)[_0xd638('0xe')](function(_0x18980d){if(_0x18980d[_0xd638('0xf')][_0xd638('0x10')]>0x0){_0x361e24[_0xd638('0x28')]=_0x18980d[_0xd638('0xf')][0x0][_0xd638('0x12')];logger['info']('['+[_0x5c9fbf['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x361e24);_0x3fd95a(_0x361e24);}else{return createEndUser(_0x5c9fbf,_0x29ff99,_0x361e24,_0x5d02f4,_0x43c788)[_0xd638('0xe')](function(_0x39ac54){logger[_0xd638('0x13')]('['+[_0x5c9fbf['toUpperCase']()]+_0xd638('0x2b'),_0x39ac54);_0x3fd95a(_0x39ac54);});}})['catch'](function(_0x51e5c6){logger[_0xd638('0x16')]('['+[_0x5c9fbf[_0xd638('0x17')]()]+']',_0x51e5c6[_0xd638('0x18')]);_0x5305ea(_0x51e5c6[_0xd638('0x18')]);});});};}function getCustomFields(_0x3b75dc,_0x17e9da){var _0x2eef61={};if(_0x3b75dc[_0xd638('0x10')]>0x0){_[_0xd638('0x2c')](_0x3b75dc,function(_0x5c5bdc){if(_[_0xd638('0x2d')]([_0xd638('0x2e'),'picklist'],_0x5c5bdc[_0xd638('0x2f')])&&_0x5c5bdc['nameField']&&!_0x5c5bdc[_0xd638('0x30')]){_0x2eef61[_0x5c5bdc['nameField'][_0xd638('0x31')]()]=_0x5c5bdc[_0xd638('0x32')]['toString']();}else if(_[_0xd638('0x2d')]([_0xd638('0x2e'),'picklist'],_0x5c5bdc['type'])&&_0x5c5bdc[_0xd638('0x33')]&&_0x5c5bdc['customField']){_0x2eef61[_0x5c5bdc[_0xd638('0x33')][_0xd638('0x31')]()]=_0x5c5bdc['content'][_0xd638('0x34')]();}else if(_0x5c5bdc[_0xd638('0x2f')]===_0xd638('0x35')&&_0x5c5bdc[_0xd638('0x36')]&&_0x5c5bdc[_0xd638('0x33')]&&_0x5c5bdc[_0xd638('0x30')]){_0x2eef61[_0x5c5bdc[_0xd638('0x33')][_0xd638('0x31')]()]=_0x17e9da[_0x5c5bdc[_0xd638('0x36')]][_0xd638('0x34')]();}else if(_0x5c5bdc[_0xd638('0x2f')]===_0xd638('0x37')&&_0x5c5bdc[_0xd638('0x38')]&&_0x5c5bdc['Variable'][_0xd638('0x39')]&&_0x5c5bdc[_0xd638('0x33')]&&_0x5c5bdc[_0xd638('0x30')]){_0x2eef61[_0x5c5bdc[_0xd638('0x33')][_0xd638('0x31')]()]=_0x17e9da[_0x5c5bdc[_0xd638('0x38')][_0xd638('0x39')][_0xd638('0x31')]()]['toString']();}});}return _0x2eef61;}function getTicket(_0x55e00d,_0xf3a23a,_0x397371,_0x3d32ff,_0x36567a,_0x2234eb){return function(_0x50c89f){logger['info']('['+[_0x55e00d[_0xd638('0x17')]()]+_0xd638('0x3a'),_0x50c89f);return new Promise(function(_0x1d0acf,_0x3e5672){var _0x16e78f=_0x55e00d['toLowerCase']()==='outbound'?_0x50c89f[_0xd638('0x1e')]:_0x50c89f[_0xd638('0x28')];var _0x460e24={'method':_0xd638('0x22'),'uri':_0x397371+_0xd638('0x3b')+'?'+_0x2234eb,'body':Object[_0xd638('0x3c')]({},{'active':'true','caller_id':_0x16e78f,'assigned_to':_0x50c89f[_0xd638('0x1e')],'short_description':intUtil['getString'](_0x3d32ff[_0xd638('0x3d')],_0x36567a,'\x20'),'description':intUtil[_0xd638('0x3e')](_0x3d32ff['Descriptions'],_0x36567a,'\x0a')},getCustomFields(_0x3d32ff[_0xd638('0x3f')],_0x36567a)),'auth':_0xf3a23a,'json':!![]};return rp(_0x460e24)[_0xd638('0xe')](function(_0x3f7cb5){logger[_0xd638('0x13')]('['+[_0x55e00d[_0xd638('0x17')]()]+_0xd638('0x40'),_0x3f7cb5['result']);_0x50c89f['ticketId']=_0x3f7cb5[_0xd638('0xf')][_0xd638('0x12')];_0x50c89f[_0xd638('0x41')]=_0x3f7cb5[_0xd638('0xf')][_0xd638('0x42')];logger[_0xd638('0x13')]('['+[_0x55e00d[_0xd638('0x17')]()]+']\x20getTicket\x20crm',_0x50c89f);_0x1d0acf(_0x50c89f);})[_0xd638('0x15')](function(_0x746342){logger[_0xd638('0x16')]('['+[_0x55e00d[_0xd638('0x17')]()]+']',_0x746342[_0xd638('0x18')]);_0x3e5672(_0x746342[_0xd638('0x18')]);});});};}function createRemoteTag(_0x222754,_0x5c4a48,_0x8445cb,_0x3415da){return new Promise(function(_0x172f1e,_0x36fc83){var _0xc02f68={'method':_0xd638('0x22'),'uri':_0x8445cb+_0xd638('0x43')+'?'+_0x3415da,'body':{'short_description':_0x222754,'global':!![],'active':!![],'name':_0x222754},'auth':_0x5c4a48,'json':!![]};return rp(_0xc02f68)[_0xd638('0xe')](function(_0x203f45){var _0x2385ec=_0x203f45['result'][_0xd638('0x12')];_0x172f1e(_0x2385ec);});});}function getRemoteTag(_0x1dfbbf,_0x3f05a5,_0x229893,_0x24cc96,_0x201a78){return new Promise(function(_0x442765,_0x572157){var _0x2f91c6={'method':_0xd638('0xc'),'uri':_0x229893+_0xd638('0x43')+_0xd638('0x44')+_0x1dfbbf+'&'+_0x24cc96,'auth':_0x3f05a5,'json':!![]};return rp(_0x2f91c6)['then'](function(_0x505d48){if(_0x505d48['result'][_0xd638('0x10')]>0x0){var _0x1e641d=_0x505d48[_0xd638('0xf')][0x0][_0xd638('0x12')];_0x442765(_0x1e641d);}else{return createRemoteTag(_0x1dfbbf,_0x3f05a5,_0x229893,_0x24cc96)[_0xd638('0xe')](function(_0x5fe325){_0x442765(_0x5fe325);});}});});}function assignTagToIncident(_0x1182f4,_0x60b81b,_0x53071f,_0x33122b,_0x5e7d77){return new Promise(function(_0x2f9ffc,_0x214310){var _0x1f391e={'method':'POST','uri':_0x53071f+_0xd638('0x45')+'?'+_0x5e7d77,'body':{'label':_0x1182f4,'table':_0xd638('0x3b'),'id_type':_0xd638('0x46'),'table_key':_0x33122b[_0xd638('0x47')],'title':_0xd638('0x48')+_0x33122b['ticketNumber'],'id_display':_0x33122b[_0xd638('0x41')]},'auth':_0x60b81b,'json':!![]};return rp(_0x1f391e)[_0xd638('0xe')](function(_0x3296e1){_0x2f9ffc();})[_0xd638('0x15')](function(){_0x2f9ffc();});});}function manageTags(_0x286ee4,_0x41bb22,_0x24ffda,_0x1730f0,_0x3fc16f,_0x5befe2,_0x5a37a8){return new Promise(function(_0x3f55e3,_0x504b5e){var _0x523d71=[];_0x41bb22['forEach'](function(_0x285558){_0x523d71['push'](getRemoteTag(_0x285558,_0x24ffda,_0x1730f0,_0x5befe2,_0x5a37a8));});return Promise[_0xd638('0x49')](_0x523d71)[_0xd638('0xe')](function(_0x573f86){if(_0x573f86['length']){logger[_0xd638('0x13')]('['+[_0x286ee4[_0xd638('0x17')]()]+_0xd638('0x4a'),_0x573f86);var _0x597267=[];_0x573f86[_0xd638('0x2c')](function(_0x6e30c1){_0x597267['push'](assignTagToIncident(_0x6e30c1,_0x24ffda,_0x1730f0,_0x3fc16f,_0x5befe2));});return Promise[_0xd638('0x49')](_0x597267)['then'](function(){_0x3f55e3();})[_0xd638('0x15')](function(){_0x3f55e3();});}else{_0x3f55e3();}});});}function getTags(_0x160f21,_0x5db3db,_0x286a03,_0x509ea8,_0x5791d2,_0x1b2914){return function(_0x4092df){return new Promise(function(_0x519614,_0x4fcee9){var _0x190326=[];var _0x46bbfb=_0x509ea8[_0xd638('0x4b')];if(_0x46bbfb&&_0x46bbfb[_0xd638('0x10')]>0x0){_0x190326=_[_0xd638('0x4c')](_0x46bbfb,_0xd638('0x39'));}if(_0x190326[_0xd638('0x10')]>0x0){return manageTags(_0x160f21,_0x190326,_0x5db3db,_0x286a03,_0x4092df,_0x5791d2,_0x1b2914)[_0xd638('0xe')](function(){_0x519614(_0x4092df);});}else{_0x519614(_0x4092df);}});};}function emit(_0x3134ab,_0x38529c,_0x4817ed){var _0x1b89ec=_0xd638('0x4d')+_0xd638('0x4e')+_0xd638('0x4f')+_0xd638('0x50');var _0x117762={'uri':_0x3134ab+_0xd638('0x51')+_0x4817ed+_0x1b89ec};io['to'](util['format']('user:%s',_0x38529c))[_0xd638('0x52')](_0xd638('0x53'),_0x117762);}exports['cs']=function(_0x52a0b8,_0x4bf100,_0x5f59af,_0x4aa2b7,_0x297815,_0x19592e,_0x32d2c5,_0x3147a2){var _0x5a7fbd={};var _0x56b902={'user':_0x19592e[_0xd638('0x54')],'pass':_0x19592e[_0xd638('0x55')]};var _0x3226c1='sysparm_limit=1';var _0x2756ec=_0xd638('0x56');_0x19592e[_0xd638('0x57')]=intUtil[_0xd638('0x58')](_0x19592e['remoteUri']);_0x19592e[_0xd638('0x59')]=intUtil[_0xd638('0x58')](_0x19592e['serverUrl']);var _0xe9fa32=util[_0xd638('0x5a')](_0xd638('0x5b'),_0x19592e[_0xd638('0x57')]);_0x5a7fbd['userEmail']=!_[_0xd638('0x5c')](_0x4aa2b7)?_0x4aa2b7[_0xd638('0x5d')]:null;_0x5a7fbd[_0xd638('0x1f')]=_0x19592e[_0xd638('0x5d')];_0x5a7fbd['endUserNumber']=_0x3147a2[_0xd638('0x31')]()===_0xd638('0x5e')?_0x4bf100[_0xd638('0x5f')]:_0x4bf100[_0xd638('0x60')];_0x5a7fbd['callDirection']=_0x3147a2==='queue'||_0x3147a2===_0xd638('0x61')?'queue':_0xd638('0x5e');var _0x209897=util[_0xd638('0x5a')](_0xd638('0x62'),_0x19592e[_0xd638('0x59')],_0x4bf100[_0xd638('0x63')],md5(_0x4bf100[_0xd638('0x63')]));if(_0x297815&&_0x297815[_0xd638('0x64')]){logger['info'](_0xd638('0x65'),_0xd638('0x66'));_0x4bf100[_0xd638('0x67')]=_0x209897;}else if(_0x32d2c5&&_0x32d2c5[_0xd638('0x68')]&&_0x32d2c5[_0xd638('0x68')]!==_0xd638('0x69')){logger[_0xd638('0x13')](_0xd638('0x6a'),_0xd638('0x66'));_0x4bf100[_0xd638('0x67')]=_0x209897;}else{_0x4bf100['recordingURL']='';}return getAdminUser(_0x3147a2,_0x56b902,_0x5a7fbd,_0xe9fa32,_0x2756ec,_0x3226c1)[_0xd638('0xe')](getUser(_0x3147a2,_0x56b902,_0xe9fa32,_0x2756ec,_0x3226c1))[_0xd638('0xe')](getEndUser(_0x3147a2,_0x56b902,_0xe9fa32,_0x2756ec,_0x3226c1))['then'](getTicket(_0x3147a2,_0x56b902,_0xe9fa32,_0x5f59af,_0x4bf100,_0x2756ec))[_0xd638('0xe')](function(_0x5c9771){logger['info'](util[_0xd638('0x5a')](_0xd638('0x6b'),_0x5c9771['ticketId']));logger['info'](util[_0xd638('0x5a')](_0xd638('0x6c'),_0x3147a2));if(_0x3147a2!==_0xd638('0x61')){logger[_0xd638('0x13')]('['+[_0x3147a2[_0xd638('0x17')]()]+']',_0xd638('0x6d'));emit(_0x19592e[_0xd638('0x57')],_0x4aa2b7['name'],_0x5c9771[_0xd638('0x47')]);}})['catch'](function(_0x43000d){logger[_0xd638('0x16')]('['+[_0x3147a2[_0xd638('0x17')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x43000d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index 95aa62b..d814c07 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 _0x4623=['duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','variableName','push','idField','set_entry','JSON','Calls','format','Basic\x20%s','apiKey','toString','get_server_info','stringify','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','name_value_list','value','Agent\x20found!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','entry_list','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','forEach','customField','nameField','toLowerCase','content','custom_fields','variable','type','Variable','login','username','password','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Fields','version','user:%s','unmanaged','uri','lastevent','toUpperCase','isNil','calleridname','users','lodash','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','description','getString','date_start','replace'];(function(_0x4ba737,_0x1305ef){var _0x5b130c=function(_0x16be31){while(--_0x16be31){_0x4ba737['push'](_0x4ba737['shift']());}};_0x5b130c(++_0x1305ef);}(_0x4623,0x1c5));var _0x3462=function(_0x38a7d8,_0x157392){_0x38a7d8=_0x38a7d8-0x0;var _0x3f0f81=_0x4623[_0x38a7d8];return _0x3f0f81;};'use strict';var _=require(_0x3462('0x0'));var rp=require('request-promise');var BPromise=require(_0x3462('0x1'));var md5=require(_0x3462('0x2'));var util=require(_0x3462('0x3'));var Redis=require(_0x3462('0x4'));var intUtil=require(_0x3462('0x5'));var config=require(_0x3462('0x6'));var logger=require('../../../../config/logger')('sugarcrm');config[_0x3462('0x7')]=_[_0x3462('0x8')](config[_0x3462('0x7')],{'host':_0x3462('0x9'),'port':0x18eb});var io=require(_0x3462('0xa'))(new Redis(config['redis']));var def={'method':_0x3462('0xb'),'json':!![]};function emit(_0x3b4476,_0x304914,_0x3071ef){io['to'](_0x3b4476)[_0x3462('0xc')](_0x304914,_0x3071ef);}function getTicket(_0x2cfa00,_0xd46a49,_0x4f71f4,_0x4d7e32,_0x4ef7b3,_0x15785c,_0x6ce1e6,_0x38d627){logger[_0x3462('0xd')](_0x3462('0xe'));var _0x1f0d62=new Date();var _0x3686b3=[{'name':'name','value':intUtil['getString'](_0x4d7e32['Subjects'],_0x4ef7b3,'\x20')},{'name':'assigned_user_id','value':_0xd46a49['id']},{'name':'created_by','value':_0xd46a49['id']},{'name':_0x3462('0xf'),'value':intUtil[_0x3462('0x10')](_0x4d7e32['Descriptions'],_0x4ef7b3,'\x0a')},{'name':_0x3462('0x11'),'value':_0x1f0d62['toISOString']()['slice'](0x0,0x13)[_0x3462('0x12')]('T','\x20')},{'name':_0x3462('0x13'),'value':'0'},{'name':_0x3462('0x14'),'value':'15'},{'name':_0x3462('0x15'),'value':_0x4f71f4['id']},{'name':_0x3462('0x16'),'value':_0x3462('0x17')},{'name':_0x3462('0x18'),'value':_0x4f71f4[_0x3462('0x19')]},{'name':_0x3462('0x1a'),'value':_0x38d627}];if(_0x15785c['length']){_['forEach'](_0x15785c,function(_0xda0708){if(_0x4ef7b3[_0xda0708[_0x3462('0x1b')]]){_0x3686b3[_0x3462('0x1c')]({'name':_0xda0708[_0x3462('0x1d')],'value':_0x4ef7b3[_0xda0708[_0x3462('0x1b')]]});}});}return request({'form':{'method':_0x3462('0x1e'),'input_type':_0x3462('0x1f'),'response_type':_0x3462('0x1f'),'rest_data':JSON['stringify']({'session':_0x6ce1e6['id'],'module_name':_0x3462('0x20'),'name_value_list':_0x3686b3})}});}function getAuth(_0x6d0fc9){return util[_0x3462('0x21')](_0x3462('0x22'),new Buffer(_0x6d0fc9[_0x3462('0x23')]+':X')[_0x3462('0x24')]('base64'));}function getServerInfo(_0x58f8ef){return request({'form':{'method':_0x3462('0x25'),'input_type':_0x3462('0x1f'),'response_type':_0x3462('0x1f'),'rest_data':JSON[_0x3462('0x26')]({'session':_0x58f8ef['id']})}});}function getUser(_0x2d51ab,_0x2883dc,_0x3469f2){if(!_['isNil'](_0x2883dc)){logger[_0x3462('0xd')](_0x3462('0x27'),_0x2883dc);return request({'form':{'method':_0x3462('0x28'),'input_type':'JSON','response_type':_0x3462('0x1f'),'rest_data':JSON['stringify']({'session':_0x3469f2['id'],'module_name':'Employees','query':util[_0x3462('0x21')](_0x3462('0x29'),_0x2883dc),'order_by':'','offset':'0','select_fields':['id',_0x3462('0x19'),_0x3462('0x2a')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3462('0x2b')](function(_0x122699){if(_0x122699['entry_list']['length']){var _0x1c0e67=_['find'](_0x122699['entry_list'],function(_0x5e50bd){return _0x5e50bd[_0x3462('0x2c')][_0x3462('0x2a')][_0x3462('0x2d')]===_0x2883dc;});if(_0x1c0e67){logger['info'](_0x3462('0x2e'));return BPromise[_0x3462('0x2f')]({'id':_0x1c0e67[_0x3462('0x2c')]['id'][_0x3462('0x2d')],'name':_0x1c0e67[_0x3462('0x2c')][_0x3462('0x19')][_0x3462('0x2d')]});}}logger[_0x3462('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x3462('0x2f')]({'id':_0x3469f2[_0x3462('0x2c')][_0x3462('0x30')][_0x3462('0x2d')],'name':_0x3469f2[_0x3462('0x2c')][_0x3462('0x2a')]['value']});});}else{logger[_0x3462('0xd')](_0x3462('0x31'));return BPromise[_0x3462('0x2f')]({'id':_0x3469f2[_0x3462('0x2c')][_0x3462('0x30')]['value'],'name':_0x3469f2['name_value_list'][_0x3462('0x2a')][_0x3462('0x2d')]});}}function getEndUser(_0x1cf02e,_0x28f541,_0x37adb3,_0x172421){logger[_0x3462('0xd')](_0x3462('0x32'),_0x37adb3);return request({'form':{'method':'get_entry_list','input_type':_0x3462('0x1f'),'response_type':_0x3462('0x1f'),'rest_data':JSON[_0x3462('0x26')]({'session':_0x172421['id'],'module_name':_0x3462('0x17'),'query':util[_0x3462('0x21')](_0x3462('0x33'),_0x37adb3),'order_by':'','offset':'0','select_fields':['id','name',_0x3462('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x3462('0x2b')](function(_0x59caf1){if(_0x59caf1[_0x3462('0x35')][_0x3462('0x36')]){var _0x3a482a=_['find'](_0x59caf1[_0x3462('0x35')],function(_0x1ffde6){return _0x1ffde6[_0x3462('0x2c')][_0x3462('0x34')]['value']===_0x37adb3;});if(_0x3a482a){logger[_0x3462('0xd')]('Enduser\x20found!');return BPromise[_0x3462('0x2f')]({'id':_0x3a482a[_0x3462('0x2c')]['id'][_0x3462('0x2d')],'name':_0x3a482a[_0x3462('0x2c')][_0x3462('0x19')][_0x3462('0x2d')],'phone':_0x3a482a[_0x3462('0x2c')][_0x3462('0x34')][_0x3462('0x2d')]});}}else{logger['info'](_0x3462('0x37'));return request({'form':{'method':'set_entry','input_type':_0x3462('0x1f'),'response_type':_0x3462('0x1f'),'rest_data':JSON[_0x3462('0x26')]({'session':_0x172421['id'],'module_name':_0x3462('0x17'),'name_value_list':[{'name':_0x3462('0x38'),'value':_0x28f541!==_0x3462('0x39')?_0x28f541:util[_0x3462('0x21')](_0x3462('0x3a'),_0x37adb3)},{'name':_0x3462('0x34'),'value':_0x37adb3}]})}})['then'](function(_0x4f45a2){logger['info'](_0x3462('0x3b'));return BPromise['resolve']({'id':_0x4f45a2['id'],'name':_0x4f45a2[_0x3462('0x35')]['first_name'][_0x3462('0x2d')],'phone':_0x4f45a2[_0x3462('0x35')]['phone_home'][_0x3462('0x2d')]});});}});}function request(_0x19b6c2){logger[_0x3462('0x3c')](_0x3462('0x3d'),JSON[_0x3462('0x26')](_0x19b6c2));return rp(_['merge'](def,_0x19b6c2));}function getTags(_0x3bc823,_0x1a4bd6){var _0x128f98=[];if(_0x3bc823&&_0x3bc823[_0x3462('0x36')]>0x0){_0x128f98=_[_0x3462('0x3e')](_0x3bc823,_0x1a4bd6);}return _0x128f98;}function getCustomFields(_0x377c27,_0x5c3782){var _0x2b3ded=[];var _0x4dfb91={'custom_fields':[]};if(_0x377c27[_0x3462('0x36')]>0x0){_[_0x3462('0x3f')](_0x377c27,function(_0x12646e){if(_0x12646e['type']==='string'&&_0x12646e['nameField']&&!_0x12646e[_0x3462('0x40')]){_0x4dfb91[_0x12646e[_0x3462('0x41')][_0x3462('0x42')]()]=_0x12646e[_0x3462('0x43')][_0x3462('0x24')]();}else if(_0x12646e['type']==='string'&&_0x12646e[_0x3462('0x1d')]&&_0x12646e['customField']){_0x4dfb91[_0x3462('0x44')]['push']({'id':_0x12646e[_0x3462('0x1d')],'value':_0x12646e['content']['toString']()});}else if(_0x12646e['type']===_0x3462('0x45')&&_0x12646e['variableName']&&_0x12646e[_0x3462('0x1d')]&&_0x12646e[_0x3462('0x40')]){_0x5c3782[_0x12646e[_0x3462('0x1b')]]&&_0x4dfb91[_0x3462('0x44')]['push']({'id':_0x12646e[_0x3462('0x1d')],'value':_0x5c3782[_0x12646e['variableName']][_0x3462('0x24')]()});}else if(_0x12646e[_0x3462('0x46')]==='customVariable'&&_0x12646e[_0x3462('0x47')]&&_0x12646e[_0x3462('0x47')][_0x3462('0x19')]&&_0x12646e['idField']&&_0x12646e[_0x3462('0x40')]){_0x5c3782[_0x12646e[_0x3462('0x47')]['name'][_0x3462('0x42')]()]&&_0x4dfb91[_0x3462('0x44')][_0x3462('0x1c')]({'id':_0x12646e[_0x3462('0x1d')],'value':_0x5c3782[_0x12646e[_0x3462('0x47')][_0x3462('0x19')]['toLowerCase']()][_0x3462('0x24')]()});}});}return _0x4dfb91;}function getConnection(_0x5b34b4){return request({'method':_0x3462('0xb'),'form':{'method':_0x3462('0x48'),'input_type':_0x3462('0x1f'),'response_type':_0x3462('0x1f'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5b34b4[_0x3462('0x49')],'password':_0x5b34b4[_0x3462('0x4a')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x3462('0x2b')](function(_0x53a727){var _0x42d986=_0x53a727;if(_0x42d986['id']){def[_0x3462('0x4b')]=_0x42d986['id'];return BPromise[_0x3462('0x2f')](_0x42d986);}else{throw new Error(util[_0x3462('0x21')](_0x3462('0x4c'),_0x5b34b4['id']));}});}function setRelationship(_0x3d8298,_0x107c0c,_0x17701d,_0x4e9608){return request({'form':{'method':_0x3462('0x4d'),'input_type':_0x3462('0x1f'),'response_type':_0x3462('0x1f'),'rest_data':JSON[_0x3462('0x26')]({'session':_0x3d8298['id'],'module_name':_0x3462('0x20'),'module_id':_0x17701d['id'],'link_field_name':_0x4e9608,'related_ids':[_0x107c0c['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x3462('0x4e')]=function(_0x4d6a58,_0x3bae05,_0x3fb844,_0x9580a7,_0x28351c,_0xf632af){var _0x45277c,_0x1f1a36,_0x216889,_0x1c0bf6;_0xf632af[_0x3462('0x4f')]=intUtil[_0x3462('0x50')](_0xf632af[_0x3462('0x4f')]);_0xf632af[_0x3462('0x51')]=intUtil['stripTrailingSlash'](_0xf632af['serverUrl']);def['uri']=util[_0x3462('0x21')]('%s/service/v4_1/rest.php',_0xf632af[_0x3462('0x4f')]);if(_0x28351c&&_0x28351c[_0x3462('0x52')]){logger[_0x3462('0xd')](_0x3462('0x53'),_0x3462('0x54'));_0x3bae05[_0x3462('0x55')]=util['format'](_0x3462('0x56'),_0xf632af[_0x3462('0x51')],_0x3bae05[_0x3462('0x57')],md5(_0x3bae05[_0x3462('0x57')]));}else{_0x3bae05[_0x3462('0x55')]='';}return getConnection(_0xf632af)['then'](function(_0x230a8e){_0x1c0bf6=_0x230a8e;return getUser(_0xf632af,_0x9580a7[_0x3462('0x19')],_0x1c0bf6);})['then'](function(_0x21b7f7){_0x45277c=_0x21b7f7;logger[_0x3462('0xd')](_0x3462('0x58'),_0x45277c['id']);return getEndUser(_0xf632af,_0x3bae05['calleridname'],_0x3bae05[_0x3462('0x59')],_0x1c0bf6);})['then'](function(_0x1a03ec){_0x1f1a36=_0x1a03ec;logger[_0x3462('0xd')]('The\x20Enduser\x20ID\x20is:',_0x1f1a36['id']);return getTicket(_0xf632af,_0x45277c,_0x1f1a36,_0x3fb844,_0x3bae05,_0x3fb844['Fields'],_0x1c0bf6,_0x3462('0x5a'));})[_0x3462('0x2b')](function(_0x9b9ffb){_0x216889=_0x9b9ffb;logger['info'](_0x3462('0x5b'));logger['info'](_0x3462('0x5c'),_0x216889['id']);return setRelationship(_0x1c0bf6,_0x45277c,_0x216889,'users');})[_0x3462('0x2b')](function(){return setRelationship(_0x1c0bf6,_0x1f1a36,_0x216889,_0x3462('0x5d'));})[_0x3462('0x2b')](function(){return getServerInfo(_0x1c0bf6);})[_0x3462('0x2b')](function(_0x5e3684){var _0x2a6ab2=parseInt(_0x5e3684['version'][_0x3462('0x5e')](0x0));var _0x13eb28=util['format'](_0x3462('0x5f'),_0xf632af[_0x3462('0x4f')],_0x216889['id']);if(_0x2a6ab2>0x6){_0x13eb28=util[_0x3462('0x21')](_0x3462('0x60'),_0xf632af[_0x3462('0x4f')],_0x216889['id']);}logger['info'](_0x3462('0x53'),_0x3462('0x61'));emit(util[_0x3462('0x21')]('user:%s',_0x9580a7[_0x3462('0x19')]),_0x3462('0x62'),{'uri':_0x13eb28});})[_0x3462('0x63')](function(_0x48d4d6){logger[_0x3462('0x64')](_0x3462('0x53'),JSON[_0x3462('0x26')](_0x48d4d6));});};exports[_0x3462('0x65')]=function(_0x42d3fe,_0x1e8bb9,_0x44f0a3,_0x3b013b,_0x3f2e5a,_0x5410b9,_0x19fcb9){var _0x5813d8,_0x1a2de1,_0xa5a047,_0x46ec23;_0x5410b9[_0x3462('0x4f')]=intUtil['stripTrailingSlash'](_0x5410b9['remoteUri']);_0x5410b9[_0x3462('0x51')]=intUtil[_0x3462('0x50')](_0x5410b9[_0x3462('0x51')]);def['uri']=util[_0x3462('0x21')](_0x3462('0x66'),_0x5410b9[_0x3462('0x4f')]);if(_0x19fcb9&&_0x19fcb9[_0x3462('0x67')]&&_0x19fcb9[_0x3462('0x67')]!=='none'){logger[_0x3462('0xd')](_0x3462('0x68'),_0x3462('0x54'));_0x1e8bb9[_0x3462('0x55')]=util[_0x3462('0x21')](_0x3462('0x56'),_0x5410b9[_0x3462('0x51')],_0x1e8bb9[_0x3462('0x57')],md5(_0x1e8bb9[_0x3462('0x57')]));}return getConnection(_0x5410b9)[_0x3462('0x2b')](function(_0x250420){_0x46ec23=_0x250420;return getUser(_0x5410b9,_0x3b013b[_0x3462('0x19')],_0x46ec23);})[_0x3462('0x2b')](function(_0x3077f2){_0x5813d8=_0x3077f2;logger[_0x3462('0xd')](_0x3462('0x58'),_0x5813d8['id']);return getEndUser(_0x5410b9,_0x1e8bb9[_0x3462('0x69')],_0x1e8bb9[_0x3462('0x6a')],_0x46ec23);})['then'](function(_0x1e5b2a){_0x1a2de1=_0x1e5b2a;logger[_0x3462('0xd')](_0x3462('0x6b'),_0x1a2de1['id']);return getTicket(_0x5410b9,_0x5813d8,_0x1a2de1,_0x44f0a3,_0x1e8bb9,_0x44f0a3[_0x3462('0x6c')],_0x46ec23,'Outbound');})[_0x3462('0x2b')](function(_0x59b7d5){_0xa5a047=_0x59b7d5;logger['info'](_0x3462('0x5b'));logger[_0x3462('0xd')](_0x3462('0x5c'),_0xa5a047['id']);return setRelationship(_0x46ec23,_0x5813d8,_0xa5a047,'users');})[_0x3462('0x2b')](function(){return setRelationship(_0x46ec23,_0x1a2de1,_0xa5a047,_0x3462('0x5d'));})[_0x3462('0x2b')](function(){return getServerInfo(_0x46ec23);})[_0x3462('0x2b')](function(_0x1f57a1){var _0x250d90=parseInt(_0x1f57a1[_0x3462('0x6d')][_0x3462('0x5e')](0x0));var _0x1b136b=util[_0x3462('0x21')](_0x3462('0x5f'),_0x5410b9[_0x3462('0x4f')],_0xa5a047['id']);if(_0x250d90>0x6){_0x1b136b=util[_0x3462('0x21')](_0x3462('0x60'),_0x5410b9[_0x3462('0x4f')],_0xa5a047['id']);}logger[_0x3462('0xd')](_0x3462('0x68'),_0x3462('0x61'));emit(util[_0x3462('0x21')](_0x3462('0x6e'),_0x3b013b[_0x3462('0x19')]),_0x3462('0x62'),{'uri':_0x1b136b});})[_0x3462('0x63')](function(_0x426026){logger['error'](_0x3462('0x68'),JSON[_0x3462('0x26')](_0x426026));});};exports[_0x3462('0x6f')]=function(_0x17aa84,_0x4144b9,_0x4dc513,_0x43f026,_0x5c0140,_0x2db9a0){var _0x5cc28d,_0x45ccba,_0x3cb9c8,_0x21d8d2;_0x2db9a0[_0x3462('0x4f')]=intUtil['stripTrailingSlash'](_0x2db9a0[_0x3462('0x4f')]);_0x2db9a0[_0x3462('0x51')]=intUtil[_0x3462('0x50')](_0x2db9a0[_0x3462('0x51')]);def[_0x3462('0x70')]=util[_0x3462('0x21')](_0x3462('0x66'),_0x2db9a0['remoteUri']);if(_0x5c0140&&_0x5c0140[_0x3462('0x52')]){logger[_0x3462('0xd')]('['+_0x4144b9[_0x3462('0x71')][_0x3462('0x72')]()+']',_0x3462('0x54'));_0x4144b9['recordingURL']=util['format'](_0x3462('0x56'),_0x2db9a0[_0x3462('0x51')],_0x4144b9[_0x3462('0x57')],md5(_0x4144b9['uniqueid']));}else{_0x4144b9[_0x3462('0x55')]='';}return getConnection(_0x2db9a0)['then'](function(_0x22b380){_0x21d8d2=_0x22b380;if(!_[_0x3462('0x73')](_0x43f026)){return getUser(_0x2db9a0,_0x43f026[_0x3462('0x19')],_0x21d8d2);}else{return getUser(_0x2db9a0,null,_0x21d8d2);}})[_0x3462('0x2b')](function(_0x1d0bb2){_0x5cc28d=_0x1d0bb2;logger['info'](_0x3462('0x58'),_0x5cc28d['id']);return getEndUser(_0x2db9a0,_0x4144b9[_0x3462('0x74')],_0x4144b9[_0x3462('0x59')],_0x21d8d2);})['then'](function(_0x44f707){_0x45ccba=_0x44f707;logger[_0x3462('0xd')](_0x3462('0x6b'),_0x45ccba['id']);return getTicket(_0x2db9a0,_0x5cc28d,_0x45ccba,_0x4dc513,_0x4144b9,_0x4dc513['Fields'],_0x21d8d2,_0x3462('0x5a'));})['then'](function(_0x3a2388){_0x3cb9c8=_0x3a2388;logger[_0x3462('0xd')](_0x3462('0x5b'));logger[_0x3462('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3cb9c8['id']);return setRelationship(_0x21d8d2,_0x5cc28d,_0x3cb9c8,_0x3462('0x75'));})[_0x3462('0x2b')](function(){return setRelationship(_0x21d8d2,_0x45ccba,_0x3cb9c8,_0x3462('0x5d'));})[_0x3462('0x2b')](function(){return getServerInfo(_0x21d8d2);})[_0x3462('0x63')](function(_0x1bf9bf){logger['error']('['+_0x4144b9[_0x3462('0x71')][_0x3462('0x72')]()+']',JSON[_0x3462('0x26')](_0x1bf9bf));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/util.js b/server/services/ami/trigger/integration/util.js index 28d1f1a..2bcabd1 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 _0x482f=['variableName','customVariable','Variable','name','toLowerCase','toString','keyValue','string','key','format','keyContent','keyType','%s:\x20%s','stripTrailingSlash','slice','substring','validateEmail','isNil','test','lodash','util','length','type','push','variable'];(function(_0x186855,_0x337203){var _0x401037=function(_0xd9f35a){while(--_0xd9f35a){_0x186855['push'](_0x186855['shift']());}};_0x401037(++_0x337203);}(_0x482f,0x158));var _0xf482=function(_0x313d4c,_0x31e690){_0x313d4c=_0x313d4c-0x0;var _0x3d49ca=_0x482f[_0x313d4c];return _0x3d49ca;};'use strict';var _=require(_0xf482('0x0'));var util=require(_0xf482('0x1'));exports['getString']=function(_0x2816f7,_0x2952a6,_0x5ddbc3){var _0x1234a3=[];if(_0x2816f7[_0xf482('0x2')]>0x0){var _0x1b4fd8=_['sortBy'](_0x2816f7,['id']);for(var _0xea373e=0x0;_0xea373e<_0x1b4fd8[_0xf482('0x2')];_0xea373e++){var _0x479586=_0x1b4fd8[_0xea373e];if(_0x479586[_0xf482('0x3')]==='string'){_0x1234a3[_0xf482('0x4')](_0x479586['content']);}else if(_0x479586[_0xf482('0x3')]===_0xf482('0x5')&&_0x479586['variableName']){_0x2952a6[_0x479586[_0xf482('0x6')]]&&_0x1234a3['push'](_0x2952a6[_0x479586['variableName']]['toString']());}else if(_0x479586[_0xf482('0x3')]===_0xf482('0x7')&&_0x479586[_0xf482('0x8')]&&_0x479586[_0xf482('0x8')][_0xf482('0x9')]){_0x2952a6[_0x479586[_0xf482('0x8')]['name'][_0xf482('0xa')]()]&&_0x1234a3[_0xf482('0x4')](_0x2952a6[_0x479586['Variable']['name'][_0xf482('0xa')]()][_0xf482('0xb')]());}else if(_0x479586[_0xf482('0x3')]===_0xf482('0xc')){if(_0x479586['keyType']===_0xf482('0xd')&&_0x479586[_0xf482('0xe')]){_0x1234a3[_0xf482('0x4')](util[_0xf482('0xf')]('%s:\x20%s',_0x479586[_0xf482('0xe')],_0x479586[_0xf482('0x10')]));}else if(_0x479586[_0xf482('0x11')]===_0xf482('0x5')&&_0x479586[_0xf482('0x6')]&&_0x479586[_0xf482('0xe')]){_0x2952a6[_0x479586[_0xf482('0x6')]]&&_0x1234a3[_0xf482('0x4')](util[_0xf482('0xf')](_0xf482('0x12'),_0x479586[_0xf482('0xe')],_0x2952a6[_0x479586[_0xf482('0x6')]]));}else if(_0x479586[_0xf482('0x11')]==='customVariable'&&_0x479586['Variable']&&_0x479586[_0xf482('0x8')][_0xf482('0x9')]&&_0x479586[_0xf482('0xe')]){_0x2952a6[_0x479586[_0xf482('0x8')][_0xf482('0x9')][_0xf482('0xa')]()]&&_0x1234a3[_0xf482('0x4')](util[_0xf482('0xf')](_0xf482('0x12'),_0x479586[_0xf482('0xe')],_0x2952a6[_0x479586[_0xf482('0x8')][_0xf482('0x9')]['toLowerCase']()]));}}}}return _0x1234a3['join'](_0x5ddbc3);};exports[_0xf482('0x13')]=function(_0x113fa1){var _0x255a74=_0x113fa1[_0xf482('0x14')](-0x1);if(_0x255a74==='/'){_0x113fa1=_0x113fa1[_0xf482('0x15')](0x0,_0x113fa1['lastIndexOf'](_0x255a74));}return _0x113fa1;};exports[_0xf482('0x16')]=function(_0x889dbf){if(!_[_0xf482('0x17')](_0x889dbf)&&_0x889dbf!==''){var _0x5d6e0f=/^(([^<>()\[\]\\.,;:\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 _0x5d6e0f[_0xf482('0x18')](String(_0x889dbf)[_0xf482('0xa')]());}else{return![];}}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 38b9f08..bf68406 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file +var _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 diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index cc538dd..052895b 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 _0x82ef=['\x20Error\x20running\x20Zendesk\x20integration','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','password','%s:%s','authType','token','username','Basic\x20%s','toString','base64','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','content','includes','custom_fields','idField','variable','variableName','push','Variable','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','catch','unmanaged','lastevent'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x82ef,0x1c1));var _0xf82e=function(_0x1b01f6,_0x8a722){_0x1b01f6=_0x1b01f6-0x0;var _0x40d06c=_0x82ef[_0x1b01f6];return _0x40d06c;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require('util');var Redis=require(_0xf82e('0x0'));var intUtil=require(_0xf82e('0x1'));var config=require(_0xf82e('0x2'));var logger=require(_0xf82e('0x3'))(_0xf82e('0x4'));config[_0xf82e('0x5')]=_['defaults'](config['redis'],{'host':_0xf82e('0x6'),'port':0x18eb});var io=require(_0xf82e('0x7'))(new Redis(config['redis']));function emit(_0x57dd50,_0x32bc2b,_0x4eafb9){io['to'](_0x57dd50)[_0xf82e('0x8')](_0x32bc2b,_0x4eafb9);}var headers={'Content-Type':'application/json','Accept':_0xf82e('0x9')};function getTicket(_0x158a81,_0x523010,_0x223273,_0x418985,_0x150bd7){logger[_0xf82e('0xa')](_0xf82e('0xb'));return request({'uri':util[_0xf82e('0xc')](_0xf82e('0xd'),_0x158a81[_0xf82e('0xe')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x223273['id'],'submitter_id':_0x523010?_0x523010['id']:undefined,'assignee_id':_0x523010?_0x523010['id']:undefined,'tags':getTags(_0x418985[_0xf82e('0xf')],_0xf82e('0x10')),'subject':intUtil[_0xf82e('0x11')](_0x418985[_0xf82e('0x12')],_0x150bd7,'\x20'),'description':intUtil[_0xf82e('0x11')](_0x418985['Descriptions'],_0x150bd7,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x418985[_0xf82e('0x13')],_0x150bd7,'\x0a')}},getCustomFields(_0x418985[_0xf82e('0x14')],_0x150bd7))}})[_0xf82e('0x15')](function(_0x48eb71){logger['info'](_0xf82e('0x16'));return _0x48eb71[_0xf82e('0x17')];});}function getUser(_0x1dca4b,_0x4f9392){if(intUtil[_0xf82e('0x18')](_0x4f9392)){logger[_0xf82e('0xa')](_0xf82e('0x19'),_0x4f9392);return request({'uri':util['format'](_0xf82e('0x1a'),_0x1dca4b[_0xf82e('0xe')]),'qs':{'query':util[_0xf82e('0xc')](_0xf82e('0x1b'),_0x4f9392)}})[_0xf82e('0x15')](function(_0x1fcc14){if(_0x1fcc14[_0xf82e('0x1c')]){logger['info'](_0xf82e('0x1d'));return _[_0xf82e('0x1e')](_0x1fcc14[_0xf82e('0x1f')],{'email':_0x4f9392,'role':_0xf82e('0x20')});}else{logger[_0xf82e('0xa')](_0xf82e('0x21'));return request({'uri':util['format'](_0xf82e('0x22'),_0x1dca4b[_0xf82e('0xe')])})[_0xf82e('0x15')](function(_0x3847f3){logger[_0xf82e('0xa')](_0xf82e('0x23'));return _0x3847f3[_0xf82e('0x24')];});}});}else{logger[_0xf82e('0xa')](_0xf82e('0x21'));return request({'uri':util[_0xf82e('0xc')]('%s/users/me.json',_0x1dca4b['remoteUri'])})[_0xf82e('0x15')](function(_0x4cfb9d){logger[_0xf82e('0xa')](_0xf82e('0x23'));return _0x4cfb9d[_0xf82e('0x24')];});}}function getEndUser(_0x314b48,_0x5f0ee3,_0x5bf51b){logger[_0xf82e('0xa')](_0xf82e('0x25'),_0x5bf51b);return request({'uri':util[_0xf82e('0xc')](_0xf82e('0x1a'),_0x314b48[_0xf82e('0xe')]),'qs':{'query':util[_0xf82e('0xc')](_0xf82e('0x26'),_0x5bf51b)}})[_0xf82e('0x15')](function(_0x5d023f){var _0x4feab9;if(_0x5d023f[_0xf82e('0x1f')][_0xf82e('0x27')]){_0x5d023f[_0xf82e('0x1f')]=_[_0xf82e('0x28')](_0x5d023f[_0xf82e('0x1f')],{'suspended':![],'role':_0xf82e('0x29')});if(_0x5d023f[_0xf82e('0x1f')][_0xf82e('0x27')]){_0x4feab9=_[_0xf82e('0x2a')](_0x5d023f[_0xf82e('0x1f')]);}}if(_0x4feab9){logger[_0xf82e('0xa')](_0xf82e('0x2b'));return _0x4feab9;}else{logger[_0xf82e('0xa')](_0xf82e('0x2c'));return request({'uri':util[_0xf82e('0xc')](_0xf82e('0x2d'),_0x314b48[_0xf82e('0xe')]),'method':_0xf82e('0x2e'),'body':{'user':{'role':_0xf82e('0x29'),'name':util[_0xf82e('0xc')](_0xf82e('0x2f'),_0x5f0ee3||_0x5bf51b),'phone':_0x5bf51b}}})['then'](function(_0x40d237){logger[_0xf82e('0xa')]('Enduser\x20created.');return _0x40d237['user'];});}});}function getAuth(_0x4e9cd6){var _0x41c2df;if(_0x4e9cd6['authType']===_0xf82e('0x30')){_0x41c2df=util['format'](_0xf82e('0x31'),_0x4e9cd6['username'],_0x4e9cd6[_0xf82e('0x30')]);}else if(_0x4e9cd6[_0xf82e('0x32')]===_0xf82e('0x33')){_0x41c2df=util[_0xf82e('0xc')]('%s/token:%s',_0x4e9cd6[_0xf82e('0x34')],_0x4e9cd6[_0xf82e('0x33')]);}return util[_0xf82e('0xc')](_0xf82e('0x35'),new Buffer(_0x41c2df)[_0xf82e('0x36')](_0xf82e('0x37')));}function request(_0x10bd5e){logger['debug']('[HTTP]',JSON[_0xf82e('0x38')](_0x10bd5e));return rp(_['defaults'](_0x10bd5e,{'method':_0xf82e('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x8b50a5,_0x2ff5f4){var _0x3a454f=[];if(_0x8b50a5&&_0x8b50a5[_0xf82e('0x27')]>0x0){_0x3a454f=_[_0xf82e('0x3a')](_0x8b50a5,_0x2ff5f4);}return _0x3a454f;}function getCustomFields(_0x1da66b,_0x44fd13){var _0x10711e=[];var _0x2b4aa8={'custom_fields':[]};if(_0x1da66b['length']>0x0){_[_0xf82e('0x3b')](_0x1da66b,function(_0x2f8dd1){if(_['includes']([_0xf82e('0x3c'),_0xf82e('0x3d')],_0x2f8dd1[_0xf82e('0x3e')])&&_0x2f8dd1[_0xf82e('0x3f')]&&!_0x2f8dd1[_0xf82e('0x40')]){_0x2b4aa8[_0x2f8dd1[_0xf82e('0x3f')][_0xf82e('0x41')]()]=_0x2f8dd1[_0xf82e('0x42')]['toString']();}else if(_[_0xf82e('0x43')]([_0xf82e('0x3c'),_0xf82e('0x3d')],_0x2f8dd1[_0xf82e('0x3e')])&&_0x2f8dd1['idField']&&_0x2f8dd1['customField']){_0x2b4aa8[_0xf82e('0x44')]['push']({'id':_0x2f8dd1[_0xf82e('0x45')],'value':_0x2f8dd1[_0xf82e('0x42')]['toString']()});}else if(_0x2f8dd1[_0xf82e('0x3e')]===_0xf82e('0x46')&&_0x2f8dd1['variableName']&&_0x2f8dd1[_0xf82e('0x45')]&&_0x2f8dd1[_0xf82e('0x40')]){_0x44fd13[_0x2f8dd1[_0xf82e('0x47')]]&&_0x2b4aa8['custom_fields'][_0xf82e('0x48')]({'id':_0x2f8dd1[_0xf82e('0x45')],'value':_0x44fd13[_0x2f8dd1['variableName']][_0xf82e('0x36')]()});}else if(_0x2f8dd1[_0xf82e('0x3e')]==='customVariable'&&_0x2f8dd1['Variable']&&_0x2f8dd1['Variable'][_0xf82e('0x10')]&&_0x2f8dd1['idField']&&_0x2f8dd1[_0xf82e('0x40')]){_0x44fd13[_0x2f8dd1[_0xf82e('0x49')]['name'][_0xf82e('0x41')]()]&&_0x2b4aa8[_0xf82e('0x44')][_0xf82e('0x48')]({'id':_0x2f8dd1['idField'],'value':_0x44fd13[_0x2f8dd1['Variable'][_0xf82e('0x10')][_0xf82e('0x41')]()][_0xf82e('0x36')]()});}});}return _0x2b4aa8;}exports[_0xf82e('0x4a')]=function(_0x46bf14,_0x26cbd3,_0x1d4bf8,_0x350a85,_0x436f24,_0x9a5793){var _0x398165,_0x364069;_0x9a5793[_0xf82e('0xe')]=intUtil['stripTrailingSlash'](_0x9a5793[_0xf82e('0xe')]);_0x9a5793[_0xf82e('0x4b')]=intUtil[_0xf82e('0x4c')](_0x9a5793[_0xf82e('0x4b')]);if(_0x436f24&&_0x436f24[_0xf82e('0x4d')]){logger[_0xf82e('0xa')](_0xf82e('0x4e'),_0xf82e('0x4f'));_0x26cbd3[_0xf82e('0x50')]=util[_0xf82e('0xc')](_0xf82e('0x51'),_0x9a5793[_0xf82e('0x4b')],_0x26cbd3[_0xf82e('0x52')],md5(_0x26cbd3[_0xf82e('0x52')]));}else{_0x26cbd3[_0xf82e('0x50')]='';}headers[_0xf82e('0x53')]=getAuth(_0x9a5793);return getUser(_0x9a5793,_0x350a85[_0xf82e('0x54')])[_0xf82e('0x15')](function(_0x5d0fb2){_0x398165=_0x5d0fb2;logger['info'](_0xf82e('0x55'),_0x398165['id']);return getEndUser(_0x9a5793,_0x26cbd3[_0xf82e('0x56')],_0x26cbd3[_0xf82e('0x57')]);})['then'](function(_0xbbdf02){_0x364069=_0xbbdf02;logger[_0xf82e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x364069['id']);return getTicket(_0x9a5793,_0x398165,_0x364069,_0x1d4bf8,_0x26cbd3);})['then'](function(_0x5759fa){if(_0x5759fa){logger[_0xf82e('0xa')](_0xf82e('0x58'),_0x5759fa['id']);switch(_0x9a5793[_0xf82e('0x3e')]){case _0xf82e('0x59'):logger[_0xf82e('0xa')](_0xf82e('0x4e'),_0xf82e('0x5a'));return request({'uri':util[_0xf82e('0xc')](_0xf82e('0x5b'),_0x9a5793[_0xf82e('0xe')],_0x398165['id'],_0x5759fa['id']),'method':'POST'});case _0xf82e('0x5c'):logger[_0xf82e('0xa')]('[QUEUE]',_0xf82e('0x5d'));emit(util['format'](_0xf82e('0x5e'),_0x350a85['name']),_0xf82e('0x5f'),{'uri':util[_0xf82e('0xc')](_0xf82e('0x60'),_0x9a5793[_0xf82e('0xe')][_0xf82e('0x61')](_0xf82e('0x62'),''),_0x5759fa['id'])});break;default:logger[_0xf82e('0x63')](_0xf82e('0x4e'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x340ed6){logger[_0xf82e('0x63')](_0xf82e('0x64'),util[_0xf82e('0x65')](_0x340ed6,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x12934c,_0x49cb5e,_0x31732a,_0x160493,_0x2254e6,_0x306ffe,_0x391c84){var _0x19ae9a,_0x1fd491;_0x306ffe[_0xf82e('0xe')]=intUtil[_0xf82e('0x4c')](_0x306ffe[_0xf82e('0xe')]);_0x306ffe[_0xf82e('0x4b')]=intUtil[_0xf82e('0x4c')](_0x306ffe[_0xf82e('0x4b')]);if(_0x391c84&&_0x391c84[_0xf82e('0x66')]&&_0x391c84[_0xf82e('0x66')]!==_0xf82e('0x67')){logger[_0xf82e('0xa')](_0xf82e('0x68'),_0xf82e('0x4f'));_0x49cb5e[_0xf82e('0x50')]=util[_0xf82e('0xc')](_0xf82e('0x51'),_0x306ffe[_0xf82e('0x4b')],_0x49cb5e[_0xf82e('0x52')],md5(_0x49cb5e[_0xf82e('0x52')]));}headers[_0xf82e('0x53')]=getAuth(_0x306ffe);return getUser(_0x306ffe,_0x160493[_0xf82e('0x54')])[_0xf82e('0x15')](function(_0x5ba3d5){_0x19ae9a=_0x5ba3d5;logger[_0xf82e('0xa')](_0xf82e('0x55'),_0x19ae9a['id']);return getEndUser(_0x306ffe,_0x49cb5e[_0xf82e('0x69')],_0x49cb5e[_0xf82e('0x6a')]);})[_0xf82e('0x15')](function(_0x304bb5){_0x1fd491=_0x304bb5;logger[_0xf82e('0xa')](_0xf82e('0x6b'),_0x1fd491['id']);return getTicket(_0x306ffe,_0x19ae9a,_0x1fd491,_0x31732a,_0x49cb5e);})['then'](function(_0x12ccbd){if(_0x12ccbd){logger[_0xf82e('0xa')](_0xf82e('0x58'),_0x12ccbd['id']);switch(_0x306ffe[_0xf82e('0x3e')]){case _0xf82e('0x59'):logger[_0xf82e('0xa')](_0xf82e('0x68'),_0xf82e('0x5a'));return request({'uri':util['format'](_0xf82e('0x5b'),_0x306ffe[_0xf82e('0xe')],_0x19ae9a['id'],_0x12ccbd['id']),'method':_0xf82e('0x2e')});case _0xf82e('0x5c'):logger[_0xf82e('0xa')]('[OUTBOUND]',_0xf82e('0x5d'));emit(util[_0xf82e('0xc')](_0xf82e('0x5e'),_0x160493[_0xf82e('0x10')]),_0xf82e('0x5f'),{'uri':util[_0xf82e('0xc')](_0xf82e('0x60'),_0x306ffe['remoteUri'][_0xf82e('0x61')]('/api/v2',''),_0x12ccbd['id'])});break;default:logger['error'](_0xf82e('0x68'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xf82e('0x6c')](function(_0x23bebf){logger[_0xf82e('0x63')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x23bebf,{'showHidden':!![],'depth':null}));});};exports[_0xf82e('0x6d')]=function(_0x4c9b60,_0x469f29,_0x103bf6,_0x1f28fd,_0x4fd069,_0x1d34a9){var _0x167c00,_0x4a1d7c;_0x1d34a9[_0xf82e('0xe')]=intUtil[_0xf82e('0x4c')](_0x1d34a9[_0xf82e('0xe')]);_0x1d34a9['serverUrl']=intUtil[_0xf82e('0x4c')](_0x1d34a9[_0xf82e('0x4b')]);if(_0x4fd069&&_0x4fd069[_0xf82e('0x4d')]){logger['info']('['+_0x469f29['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x469f29[_0xf82e('0x50')]=util[_0xf82e('0xc')](_0xf82e('0x51'),_0x1d34a9[_0xf82e('0x4b')],_0x469f29['uniqueid'],md5(_0x469f29[_0xf82e('0x52')]));}else{_0x469f29[_0xf82e('0x50')]='';}headers[_0xf82e('0x53')]=getAuth(_0x1d34a9);return getUser(_0x1d34a9)[_0xf82e('0x15')](function(_0x176196){_0x167c00=_0x176196;logger[_0xf82e('0xa')](_0xf82e('0x55'),_0x167c00['id']);return getEndUser(_0x1d34a9,_0x469f29[_0xf82e('0x56')],_0x469f29[_0xf82e('0x57')]);})['then'](function(_0x66756c){_0x4a1d7c=_0x66756c;logger[_0xf82e('0xa')]('The\x20Enduser\x20ID\x20is:',_0x4a1d7c['id']);return getTicket(_0x1d34a9,_0x167c00,_0x4a1d7c,_0x103bf6,_0x469f29);})[_0xf82e('0x15')](function(_0x4b6f39){if(_0x4b6f39){logger[_0xf82e('0xa')]('The\x20Ticket\x20ID\x20is:',_0x4b6f39['id']);}})[_0xf82e('0x6c')](function(_0x4fd2fb){logger['error']('['+_0x469f29[_0xf82e('0x6e')]['toUpperCase']()+']'+_0xf82e('0x6f'),util['inspect'](_0x4fd2fb,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/integration/zoho.js b/server/services/ami/trigger/integration/zoho.js index 90dba5a..353b076 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 _0xcd6d=['stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','then','users','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','catch','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','first_name','last_name','data','code','details','enduserType','Error:\x20','CREATE\x20ERROR','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','lead','Creating\x20new\x20call...','Owner','administrator','role','Subject','getString','Subjects','Description','Full_Name','First_Name','Last_Name','$se_module','utc','talktime','mm:ss','answertime','Call_Duration','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','log','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','uniqueid','/downloads?type=uniqueid&token=','recordingURL','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','user:%s','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','zoho.eu','destcalleridname','destcalleridnum','Outbound','trigger:browser:url','unmanaged','toUpperCase','calleridnum','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','debug','[HTTP]','forEach','includes','string','idField','content','type','variable','variableName','toString','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','add','seconds','error','Failing\x20creating\x20the\x20access_token'];(function(_0xb24b6d,_0x49f15e){var _0xc88ebd=function(_0x310bd5){while(--_0x310bd5){_0xb24b6d['push'](_0xb24b6d['shift']());}};_0xc88ebd(++_0x49f15e);}(_0xcd6d,0x1b0));var _0xdcd6=function(_0x2ce7,_0x42de64){_0x2ce7=_0x2ce7-0x0;var _0x3465bf=_0xcd6d[_0x2ce7];return _0x3465bf;};'use strict';var _=require(_0xdcd6('0x0'));var rp=require('request-promise');var md5=require(_0xdcd6('0x1'));var util=require(_0xdcd6('0x2'));var intUtil=require(_0xdcd6('0x3'));var moment=require(_0xdcd6('0x4'));var Redis=require(_0xdcd6('0x5'));var BPromise=require(_0xdcd6('0x6'));var config=require(_0xdcd6('0x7'));var logger=require(_0xdcd6('0x8'))(_0xdcd6('0x9'));config['redis']=_[_0xdcd6('0xa')](config[_0xdcd6('0xb')],{'host':_0xdcd6('0xc'),'port':0x18eb});var io=require(_0xdcd6('0xd'))(new Redis(config[_0xdcd6('0xb')]));function emit(_0x5d3d17,_0x4d65a7,_0x446e1e){io['to'](_0x5d3d17)[_0xdcd6('0xe')](_0x4d65a7,_0x446e1e);}function request(_0xc662ad){logger[_0xdcd6('0xf')](_0xdcd6('0x10'),JSON['stringify'](_0xc662ad));return rp(_0xc662ad);}function getCustomFields(_0x43d750,_0x4bc89){var _0x2db8fc={};if(_0x43d750['length']>0x0){_[_0xdcd6('0x11')](_0x43d750,function(_0xd6be58){if(_[_0xdcd6('0x12')]([_0xdcd6('0x13'),'picklist'],_0xd6be58['type'])&&_0xd6be58[_0xdcd6('0x14')]){_0x2db8fc[_0xd6be58[_0xdcd6('0x14')]]=_0xd6be58[_0xdcd6('0x15')]['toString']();}else if(_0xd6be58[_0xdcd6('0x16')]===_0xdcd6('0x17')&&_0xd6be58[_0xdcd6('0x18')]&&_0xd6be58[_0xdcd6('0x14')]&&_0x4bc89[_0xd6be58[_0xdcd6('0x18')]]){_0x2db8fc[_0xd6be58[_0xdcd6('0x14')]]=_0x4bc89[_0xd6be58[_0xdcd6('0x18')]][_0xdcd6('0x19')]();}else if(_0xd6be58[_0xdcd6('0x16')]==='customVariable'&&_0xd6be58[_0xdcd6('0x1a')]&&_0xd6be58[_0xdcd6('0x1a')][_0xdcd6('0x1b')]&&_0xd6be58['idField']&&_0x4bc89[_0xd6be58[_0xdcd6('0x1a')][_0xdcd6('0x1b')][_0xdcd6('0x1c')]()]){_0x2db8fc[_0xd6be58[_0xdcd6('0x14')]]=_0x4bc89[_0xd6be58[_0xdcd6('0x1a')][_0xdcd6('0x1b')][_0xdcd6('0x1c')]()]['toString']();}});}return _0x2db8fc;}function getName(_0x1ae1d9){if(_0x1ae1d9[_0xdcd6('0x1d')]('\x20')>0x0){var _0x10474a=_0x1ae1d9[_0xdcd6('0x1e')](/ (.+)/);if(_0x10474a[0x1]){return _0x10474a;}}return[_0x1ae1d9,_0x1ae1d9];}var accountsTokens={};function getAccessToken(_0x3dbec2){return new Promise(function(_0x1f0494,_0x47fa90){if(!_['isNil'](accountsTokens[_0x3dbec2['id']])&&!_[_0xdcd6('0x1f')](accountsTokens[_0x3dbec2['id']][_0xdcd6('0x20')])){if(moment()[_0xdcd6('0x21')](accountsTokens[_0x3dbec2['id']][_0xdcd6('0x22')])){_0x1f0494(accountsTokens[_0x3dbec2['id']]['access_token']);}}var _0x24aaed;switch(_0x3dbec2[_0xdcd6('0x23')]){case'US':_0x24aaed=_0xdcd6('0x24');break;case'AU':_0x24aaed=_0xdcd6('0x25');break;case'EU':_0x24aaed='https://accounts.zoho.eu';break;case'IN':_0x24aaed=_0xdcd6('0x26');break;case'CN':_0x24aaed=_0xdcd6('0x27');break;default:_0x24aaed=_0xdcd6('0x28');break;}var _0x4cc760={'method':_0xdcd6('0x29'),'uri':_0x24aaed+_0xdcd6('0x2a'),'qs':{'refresh_token':_0x3dbec2[_0xdcd6('0x2b')],'client_id':_0x3dbec2[_0xdcd6('0x2c')],'client_secret':_0x3dbec2[_0xdcd6('0x2d')],'grant_type':_0xdcd6('0x2e')},'json':!![]};return rp(_0x4cc760)['then'](function(_0x5a3e0b){accountsTokens[_0x3dbec2['id']]={'access_token':_0x5a3e0b[_0xdcd6('0x20')],'expires_in':moment()[_0xdcd6('0x2f')](_0x5a3e0b[_0xdcd6('0x22')],_0xdcd6('0x30'))};_0x1f0494(_0x5a3e0b[_0xdcd6('0x20')]);})['catch'](function(_0x49eced){logger[_0xdcd6('0x31')](_0xdcd6('0x32'),_0x49eced[_0xdcd6('0x33')]);_0x47fa90(_0x49eced);});});}function getUser(_0x12b952,_0x4571bb,_0x175035,_0x8762e6){logger[_0xdcd6('0x34')]('Search\x20user');return request({'method':_0xdcd6('0x35'),'uri':util[_0xdcd6('0x36')](_0xdcd6('0x37'),_0x4571bb),'qs':{'type':_0xdcd6('0x38')},'headers':{'Authorization':_0xdcd6('0x39')+_0x12b952},'json':!![]})[_0xdcd6('0x3a')](function(_0x53f929){if(_0x53f929['users']){var _0x39b620=-0x1;if(_['isArrayLikeObject'](_0x53f929[_0xdcd6('0x3b')])){if(!_[_0xdcd6('0x1f')](_0x8762e6)){_0x39b620=_[_0xdcd6('0x3c')](_0x53f929['users'],function(_0x419fbb){return _0x419fbb[_0xdcd6('0x3d')]===_0x8762e6;});}if(_0x39b620>=0x0){logger['info']('Agent\x20found!');}else{logger[_0xdcd6('0x34')](_0xdcd6('0x3e'));_0x39b620=_[_0xdcd6('0x3c')](_0x53f929[_0xdcd6('0x3b')],function(_0x1e4d8b){return _0x1e4d8b[_0xdcd6('0x3f')][_0xdcd6('0x1b')]===_0xdcd6('0x40');});}return _0x53f929[_0xdcd6('0x3b')][_0x39b620];}else{if(_0x53f929[_0xdcd6('0x41')][_0xdcd6('0x3f')][_0xdcd6('0x1b')]===_0xdcd6('0x40')){logger[_0xdcd6('0x34')]('Using\x20the\x20admin\x20account!');user=_0x53f929[_0xdcd6('0x41')];return user;}else{logger['error'](_0xdcd6('0x42'),JSON['stringify'](_0x53f929));throw new Error(_0xdcd6('0x43')+JSON[_0xdcd6('0x44')](_0x53f929));}}}else{logger[_0xdcd6('0x31')](_0xdcd6('0x42'),JSON['stringify'](_0x53f929));throw new Error(_0xdcd6('0x43')+JSON['stringify'](_0x53f929));}})[_0xdcd6('0x45')](function(_0x1aba29){console[_0xdcd6('0x31')](_0x1aba29);});}function getZohoUser(_0x223770,_0x26bc33){return new BPromise(function(_0x3aa769,_0x22b855){request(_0x223770)[_0xdcd6('0x3a')](function(_0x2aa851){var _0x57acf6=null;if(_0x2aa851){_0x57acf6=_0x2aa851['data'][0x0];_0x57acf6['enduserType']=_0x26bc33;}_0x3aa769(_0x57acf6);})[_0xdcd6('0x45')](function(_0x4845ee){_0x22b855(_0x4845ee);});});}function createEndUser(_0x499f36,_0x27df45,_0x2113e3,_0x17985c,_0x243d12,_0x36c40f){var _0x2113e3=getName(_0x2113e3);return request({'method':'POST','uri':_0xdcd6('0x46')+_0x27df45+_0xdcd6('0x47')+_[_0xdcd6('0x48')](_0x36c40f[_0xdcd6('0x49')])+'s','body':{'data':[{'Last_Name':_0x2113e3[0x1],'First_Name':_0x2113e3[0x0],'Phone':_0x17985c,'Owner':{'name':!_[_0xdcd6('0x1f')](_0x243d12['role'][_0xdcd6('0x1b')])?_0x243d12['role'][_0xdcd6('0x1b')]:!_[_0xdcd6('0x1f')](_0x243d12[_0xdcd6('0x4a')])?_0x243d12[_0xdcd6('0x4a')]+'\x20'+_0x243d12['last_name']:_0x243d12[_0xdcd6('0x4b')],'id':_0x243d12['id']}}]},'headers':{'Authorization':_0xdcd6('0x39')+_0x499f36},'json':!![]})[_0xdcd6('0x3a')](function(_0x2bd4c6){if(_0x2bd4c6&&_0x2bd4c6[_0xdcd6('0x4c')][0x0][_0xdcd6('0x4d')]==='SUCCESS'){var _0x49699f=_0x2bd4c6['data'][0x0][_0xdcd6('0x4e')];_0x49699f[_0xdcd6('0x4f')]=_[_0xdcd6('0x48')](_0x36c40f[_0xdcd6('0x49')])+'s';return _0x49699f;}logger['error'](_0xdcd6('0x42'),JSON[_0xdcd6('0x44')](data));throw new Error(_0xdcd6('0x50')+JSON[_0xdcd6('0x44')](data));})[_0xdcd6('0x45')](function(_0x2cb42a){console['log'](_0xdcd6('0x51'),_0x2cb42a);});}function getEndUser(_0x4b5f28,_0x2cb80f,_0x1b5335,_0xe31a1,_0xcd911d,_0x5a6f86,_0x1858d3){var _0x5c5d05={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4b5f28},'json':!![]};switch(_0x1858d3[_0xdcd6('0x52')]){case'contact_lead':_0x5c5d05['uri']=_0xdcd6('0x46')+_0x2cb80f+_0xdcd6('0x53')+_0xcd911d+'))';return getZohoUser(_0x5c5d05,_0xdcd6('0x54'))['then'](function(_0x16ec4a){if(_0x16ec4a)return _0x16ec4a;_0x5c5d05[_0xdcd6('0x55')]=_0xdcd6('0x46')+_0x2cb80f+_0xdcd6('0x56')+_0xcd911d+'))';return getZohoUser(_0x5c5d05,_0xdcd6('0x57'))[_0xdcd6('0x3a')](function(_0x374c1b){if(_0x374c1b)return _0x374c1b;if(_0x1858d3[_0xdcd6('0x49')]!='nothing'){return createEndUser(_0x4b5f28,_0x2cb80f,_0xe31a1,_0xcd911d,_0x5a6f86,_0x1858d3);}else{return{};}});});break;case _0xdcd6('0x58'):_0x5c5d05[_0xdcd6('0x55')]=_0xdcd6('0x46')+_0x2cb80f+_0xdcd6('0x53')+_0xcd911d+'))';return getZohoUser(_0x5c5d05,'Contacts')[_0xdcd6('0x3a')](function(_0x1d3060){if(_0x1d3060)return _0x1d3060;if(_0x1858d3[_0xdcd6('0x49')]!=_0xdcd6('0x59')){return createEndUser(_0x4b5f28,_0x2cb80f,_0xe31a1,_0xcd911d,_0x5a6f86,_0x1858d3);}else{return{};}});break;case _0xdcd6('0x5a'):_0x5c5d05[_0xdcd6('0x55')]='https://www.zohoapis.'+_0x2cb80f+_0xdcd6('0x56')+_0xcd911d+'))';return getZohoUser(_0x5c5d05,'Leads')[_0xdcd6('0x3a')](function(_0x471cc7){if(_0x471cc7)return _0x471cc7;if(_0x1858d3[_0xdcd6('0x49')]!='nothing'){return createEndUser(_0x4b5f28,_0x2cb80f,_0xe31a1,_0xcd911d,_0x5a6f86,_0x1858d3);}else{return{};}});break;}}function getCall(_0x44e122,_0x42dc45,_0x4163e9,_0xe50ff9,_0x490756,_0x1d8c8f,_0x3eb48c,_0x1f093d){logger[_0xdcd6('0x34')](_0xdcd6('0x5b'));var _0x27919d={};_0x27919d[_0xdcd6('0x5c')]={'name':!_[_0xdcd6('0x1f')](_0xe50ff9['role']['name'])&&!_['isNil'](_0xe50ff9[_0xdcd6('0x3f')][_0xdcd6('0x1b')])&&_0xe50ff9[_0xdcd6('0x3f')][_0xdcd6('0x1b')]===_0xdcd6('0x5d')?_0xe50ff9[_0xdcd6('0x5e')][_0xdcd6('0x1b')]:!_[_0xdcd6('0x1f')](_0xe50ff9['first_name'])?_0xe50ff9['first_name']+'\x20'+_0xe50ff9['last_name']:_0xe50ff9['last_name'],'id':_0xe50ff9['id']};_0x27919d[_0xdcd6('0x5f')]=intUtil[_0xdcd6('0x60')](_0x1d8c8f[_0xdcd6('0x61')],_0x3eb48c,'\x20');_0x27919d[_0xdcd6('0x62')]=intUtil[_0xdcd6('0x60')](_0x1d8c8f['Descriptions'],_0x3eb48c,'\x0a');if(_0x490756[_0xdcd6('0x4f')]===_0xdcd6('0x54')){_0x27919d['Who_Id']={'name':!_[_0xdcd6('0x1f')](_0x490756[_0xdcd6('0x63')])?_0x490756[_0xdcd6('0x63')]:!_[_0xdcd6('0x1f')](_0x490756[_0xdcd6('0x64')])?_0x490756['First_Name']+'\x20'+_0x490756['Last_Name']:_0x490756['Last_Name'],'id':_0x490756['id']};}if(_0x490756[_0xdcd6('0x4f')]==='Leads'){_0x27919d['What_Id']={'name':!_[_0xdcd6('0x1f')](_0x490756[_0xdcd6('0x63')])?_0x490756[_0xdcd6('0x63')]:!_[_0xdcd6('0x1f')](_0x490756[_0xdcd6('0x64')])?_0x490756['First_Name']+'\x20'+_0x490756[_0xdcd6('0x65')]:_0x490756[_0xdcd6('0x65')],'id':_0x490756['id']};_0x27919d[_0xdcd6('0x66')]=_[_0xdcd6('0x48')](_0x490756[_0xdcd6('0x4f')]);}if(_0x3eb48c['talktime']){_0x27919d['Call_Duration']=moment[_0xdcd6('0x67')](parseInt(_0x3eb48c[_0xdcd6('0x68')])*0x3e8)['format'](_0xdcd6('0x69'));}else if(_0x3eb48c[_0xdcd6('0x6a')]&&_0x3eb48c['endtime']){_0x27919d[_0xdcd6('0x6b')]=moment[_0xdcd6('0x67')](moment(_0x3eb48c[_0xdcd6('0x6c')],'YYYY-MM-DDTHH:mm:ss')[_0xdcd6('0x6d')](moment(_0x3eb48c[_0xdcd6('0x6e')],_0xdcd6('0x6f'))))['format'](_0xdcd6('0x69'));}switch(_0x3eb48c[_0xdcd6('0x70')]){case _0xdcd6('0x71'):_0x27919d[_0xdcd6('0x72')]=_0xdcd6('0x73');break;case _0xdcd6('0x74'):case _0xdcd6('0x75'):_0x27919d['Call_Result']='Answered';break;case _0xdcd6('0x76'):_0x27919d['Call_Result']=_0xdcd6('0x77');break;case'abandoned':_0x27919d[_0xdcd6('0x72')]=_0xdcd6('0x78');break;case _0xdcd6('0x79'):_0x27919d[_0xdcd6('0x72')]=_0xdcd6('0x7a');default:}_0x27919d[_0xdcd6('0x7b')]=(_0x1f093d===_0xdcd6('0x7c')?moment(_0x3eb48c['starttime'])[_0xdcd6('0x36')](_0xdcd6('0x6f')):moment(_0x3eb48c[_0xdcd6('0x7d')])[_0xdcd6('0x36')](_0xdcd6('0x6f')))||moment()[_0xdcd6('0x36')](_0xdcd6('0x6f'));_0x27919d[_0xdcd6('0x7e')]=_0x1f093d||_0xdcd6('0x7f');_0x27919d=_['merge'](_0x27919d,getCustomFields(_0x1d8c8f[_0xdcd6('0x80')],_0x3eb48c));return request({'method':_0xdcd6('0x29'),'uri':'https://www.zohoapis.'+_0x42dc45+_0xdcd6('0x81'),'headers':{'Authorization':_0xdcd6('0x39')+_0x44e122},'body':{'data':[_0x27919d]},'json':!![]})[_0xdcd6('0x3a')](function(_0x1d9383){if(_0x1d9383&&_0x1d9383[_0xdcd6('0x4c')][0x0][_0xdcd6('0x4d')]===_0xdcd6('0x82')){logger[_0xdcd6('0x34')](_0xdcd6('0x83'));return{'id':_0x1d9383[_0xdcd6('0x4c')][0x0][_0xdcd6('0x4e')]['id']};}})[_0xdcd6('0x45')](function(_0x2bb848){logger[_0xdcd6('0x34')](_0xdcd6('0x84'),_0x2bb848[_0xdcd6('0x33')]);console[_0xdcd6('0x85')]('err',_0x2bb848);});}exports['queue']=function(_0x3783ce,_0x55deec,_0xeaa75d,_0x752d36,_0x37c542,_0x504a8d){var _0xa044d2,_0xb72d06,_0x32032f;_0x504a8d[_0xdcd6('0x86')]=intUtil[_0xdcd6('0x87')](_0x504a8d[_0xdcd6('0x86')]);_0x504a8d[_0xdcd6('0x88')]=intUtil[_0xdcd6('0x87')](_0x504a8d[_0xdcd6('0x88')]);if(_0x37c542&&_0x37c542[_0xdcd6('0x89')]){logger[_0xdcd6('0x34')]('[QUEUE]',_0xdcd6('0x8a'));_0x55deec['recordingURL']=_0x504a8d[_0xdcd6('0x88')]+'/api/voice/recordings/'+_0x55deec[_0xdcd6('0x8b')]+_0xdcd6('0x8c')+md5(_0x55deec[_0xdcd6('0x8b')]);}else{_0x55deec[_0xdcd6('0x8d')]='';}var _0x2f6e61=_0x504a8d['host']==='zoho.eu'?'eu':_0xdcd6('0x8e');return getAccessToken(_0x504a8d)[_0xdcd6('0x3a')](function(_0xa7e872){_0x32032f=_0xa7e872;return getUser(_0x32032f,_0x2f6e61,_0x504a8d,_0x752d36[_0xdcd6('0x3d')]);})['then'](function(_0x104a56){_0xa044d2=_0x104a56;logger[_0xdcd6('0x34')](_0xdcd6('0x8f'),_0xa044d2['id']);return getEndUser(_0x32032f,_0x2f6e61,_0x504a8d,_0x55deec[_0xdcd6('0x90')],_0x55deec['calleridnum'],_0xa044d2,_0xeaa75d);})[_0xdcd6('0x3a')](function(_0x19db13){_0xb72d06=_0x19db13;return getCall(_0x32032f,_0x2f6e61,_0x504a8d,_0xa044d2,_0xb72d06,_0xeaa75d,_0x55deec,_0xdcd6('0x7f'));})[_0xdcd6('0x3a')](function(_0x2d216b){if(_0x2d216b){logger[_0xdcd6('0x34')](_0xdcd6('0x91'),_0x2d216b['id']);logger[_0xdcd6('0x34')]('[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdcd6('0x36')](_0xdcd6('0x92'),_0x752d36[_0xdcd6('0x1b')]),'trigger:browser:url',{'uri':'https://crm.'+_0x504a8d[_0xdcd6('0x86')]+_0xdcd6('0x93')+_0x2d216b['id']});}})['catch'](function(_0x5a46a3){logger[_0xdcd6('0x31')](_0xdcd6('0x94'),JSON[_0xdcd6('0x44')](_0x5a46a3));});};exports[_0xdcd6('0x7c')]=function(_0x5c37b6,_0x2b3aaa,_0x298f93,_0x20d5b9,_0x249b22,_0x3bddfe,_0xad7c99){var _0x205d98,_0x4cfc7b,_0x2e2e4c;_0x3bddfe['host']=intUtil[_0xdcd6('0x87')](_0x3bddfe[_0xdcd6('0x86')]);_0x3bddfe[_0xdcd6('0x88')]=intUtil[_0xdcd6('0x87')](_0x3bddfe[_0xdcd6('0x88')]);if(_0xad7c99&&_0xad7c99[_0xdcd6('0x95')]&&_0xad7c99['recordingFormat']!==_0xdcd6('0x96')){logger['info'](_0xdcd6('0x97'),_0xdcd6('0x8a'));_0x2b3aaa['recordingURL']=_0x3bddfe[_0xdcd6('0x88')]+_0xdcd6('0x98')+_0x2b3aaa[_0xdcd6('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x2b3aaa[_0xdcd6('0x8b')]);}var _0x334155=_0x3bddfe[_0xdcd6('0x86')]===_0xdcd6('0x99')?'eu':'com';return getAccessToken(_0x3bddfe)[_0xdcd6('0x3a')](function(_0x36d067){_0x2e2e4c=_0x36d067;return getUser(_0x2e2e4c,_0x334155,_0x3bddfe,_0x20d5b9[_0xdcd6('0x3d')]);})['then'](function(_0x53c468){_0x205d98=_0x53c468;logger[_0xdcd6('0x34')](_0xdcd6('0x8f'),_0x205d98['id']);return getEndUser(_0x2e2e4c,_0x334155,_0x3bddfe,_0x2b3aaa[_0xdcd6('0x9a')],_0x2b3aaa[_0xdcd6('0x9b')],_0x205d98,_0x298f93);})['then'](function(_0x19b640){_0x4cfc7b=_0x19b640;return getCall(_0x2e2e4c,_0x334155,_0x3bddfe,_0x205d98,_0x4cfc7b,_0x298f93,_0x2b3aaa,_0xdcd6('0x9c'));})['then'](function(_0x124ab2){if(_0x124ab2){logger[_0xdcd6('0x34')](_0xdcd6('0x91'),_0x124ab2['id']);logger['info']('[OUTBOUND]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xdcd6('0x36')](_0xdcd6('0x92'),_0x20d5b9[_0xdcd6('0x1b')]),_0xdcd6('0x9d'),{'uri':'https://crm.'+_0x3bddfe['host']+_0xdcd6('0x93')+_0x124ab2['id']});}})[_0xdcd6('0x45')](function(_0x4bca93){logger[_0xdcd6('0x31')](_0xdcd6('0x97'),JSON[_0xdcd6('0x44')](_0x4bca93));});};exports[_0xdcd6('0x9e')]=function(_0x1113b8,_0x1df574,_0x44a102,_0x218c00,_0x1b06ad,_0x3e33f8){var _0x42e0d6,_0x3b3aab,_0x5e1a3c;_0x3e33f8['host']=intUtil[_0xdcd6('0x87')](_0x3e33f8[_0xdcd6('0x86')]);_0x3e33f8[_0xdcd6('0x88')]=intUtil['stripTrailingSlash'](_0x3e33f8[_0xdcd6('0x88')]);if(_0x1b06ad&&_0x1b06ad['monitor_format']){logger[_0xdcd6('0x34')]('['+_0x1df574[_0xdcd6('0x70')][_0xdcd6('0x9f')]()+']',_0xdcd6('0x8a'));_0x1df574[_0xdcd6('0x8d')]=_0x3e33f8['serverUrl']+_0xdcd6('0x98')+_0x1df574[_0xdcd6('0x8b')]+_0xdcd6('0x8c')+md5(_0x1df574[_0xdcd6('0x8b')]);}else{_0x1df574[_0xdcd6('0x8d')]='';}var _0x3409b6=_0x3e33f8['host']==='zoho.eu'?'eu':_0xdcd6('0x8e');return getAccessToken(_0x3e33f8)['then'](function(_0x59c4a4){_0x5e1a3c=_0x59c4a4;return getUser(_0x5e1a3c,_0x3409b6,_0x3e33f8);})[_0xdcd6('0x3a')](function(_0x575c1d){_0x42e0d6=_0x575c1d;logger[_0xdcd6('0x34')](_0xdcd6('0x8f'),_0x42e0d6['id']);return getEndUser(_0x5e1a3c,_0x3409b6,_0x3e33f8,_0x1df574[_0xdcd6('0x90')],_0x1df574[_0xdcd6('0xa0')],_0x42e0d6,_0x44a102);})[_0xdcd6('0x3a')](function(_0x1375f4){_0x3b3aab=_0x1375f4;return getCall(_0x5e1a3c,_0x3409b6,_0x3e33f8,_0x42e0d6,_0x3b3aab,_0x44a102,_0x1df574,_0xdcd6('0x7f'));})[_0xdcd6('0x3a')](function(_0x308d4f){if(_0x308d4f){logger[_0xdcd6('0x34')]('The\x20Call\x20ID\x20is:',_0x308d4f['id']);}})[_0xdcd6('0x45')](function(_0x45b2a3){logger[_0xdcd6('0x31')]('['+_0x1df574[_0xdcd6('0x70')][_0xdcd6('0x9f')]()+']',JSON[_0xdcd6('0x44')](_0x45b2a3));});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 01aa8da..d1574fb 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 _0x2fc1=['trigger','exec','data2','Script','render','data3','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','mustache','../../../../config/logger'];(function(_0x574617,_0x42eccc){var _0x29de90=function(_0x367aff){while(--_0x367aff){_0x574617['push'](_0x574617['shift']());}};_0x29de90(++_0x42eccc);}(_0x2fc1,0x89));var _0x12fc=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2fc1[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0x12fc('0x0'));var sh=require('shelljs');var Mustache=require(_0x12fc('0x1'));var logger=require(_0x12fc('0x2'))(_0x12fc('0x3'));exports[_0x12fc('0x4')]=function(_0x1faf41,_0x3f20f2){var _0x4ee671=_0x1faf41['data2']?_0x1faf41[_0x12fc('0x5')]:_0x12fc('0x6');var _0x2023f2=_0x1faf41['data3']?Mustache[_0x12fc('0x7')](_0x1faf41[_0x12fc('0x8')],_0x3f20f2):_0x3f20f2;sh[_0x12fc('0x4')](_0x2023f2,function(_0x36bb43,_0x538d75,_0x3afd79){if(_0x36bb43!==0x0){logger[_0x12fc('0x9')](util['format'](_0x12fc('0xa'),_0x4ee671,_0x2023f2,_0x36bb43,_0x3afd79));}else{logger[_0x12fc('0xb')](util[_0x12fc('0xc')](_0x12fc('0xd'),_0x4ee671,_0x2023f2,_0x538d75));}});}; \ No newline at end of file +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 diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index ec7bf06..cd536d8 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 _0xd69c=['error','toUpperCase','GET','DELETE','PUT','data7','body','info','then','isNil','stringify','format','%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','lodash','../../../../config/logger','trigger','exec','data1','data2','data5','number','headers','data6','parse','render'];(function(_0x361b39,_0x3774db){var _0x508d68=function(_0x4c464a){while(--_0x4c464a){_0x361b39['push'](_0x361b39['shift']());}};_0x508d68(++_0x3774db);}(_0xd69c,0x6f));var _0xcd69=function(_0x27b8d6,_0x322e28){_0x27b8d6=_0x27b8d6-0x0;var _0x586cdd=_0xd69c[_0x27b8d6];return _0x586cdd;};'use strict';var rp=require(_0xcd69('0x0'));var util=require('util');var _=require(_0xcd69('0x1'));var Mustache=require('mustache');var logger=require(_0xcd69('0x2'))(_0xcd69('0x3'));exports[_0xcd69('0x4')]=function(_0x70443d,_0x5c66eb){var _0x2475d4,_0x486632;var _0x1f3f20={'method':_0x70443d[_0xcd69('0x5')]['toUpperCase'](),'uri':Mustache['render'](_0x70443d[_0xcd69('0x6')],_0x5c66eb),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x70443d[_0xcd69('0x7')])===_0xcd69('0x8')&&parseInt(_0x70443d[_0xcd69('0x7')])>=0x1&&parseInt(_0x70443d[_0xcd69('0x7')])<=0xa?parseInt(_0x70443d['data5'])*0x3e8:0x5*0x3e8};try{_0x1f3f20[_0xcd69('0x9')]=_0x70443d[_0xcd69('0xa')]?JSON[_0xcd69('0xb')](Mustache[_0xcd69('0xc')](_0x70443d[_0xcd69('0xa')],_0x5c66eb)):{};}catch(_0x46cff3){logger[_0xcd69('0xd')](_0x46cff3['stack']);}switch(_0x70443d[_0xcd69('0x5')][_0xcd69('0xe')]()){case _0xcd69('0xf'):case _0xcd69('0x10'):_0x2475d4=null;_0x1f3f20['qs']=_0x5c66eb;break;case'POST':case _0xcd69('0x11'):if(_0x70443d[_0xcd69('0x12')]){try{_0x2475d4=JSON[_0xcd69('0xb')](Mustache['render'](_0x70443d[_0xcd69('0x12')],_0x5c66eb));_0x1f3f20[_0xcd69('0x13')]=_0x2475d4;}catch(_0x3b68fa){logger[_0xcd69('0xd')](_0x3b68fa['stack']);logger[_0xcd69('0xd')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x2475d4=_0x5c66eb;_0x1f3f20['body']=_0x2475d4;}break;}logger[_0xcd69('0x14')](util['format']('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x70443d['data1'],_0x70443d[_0xcd69('0x6')],JSON['stringify'](_0x1f3f20)));rp(_0x1f3f20)[_0xcd69('0x15')](function(_0x30a388){_0x2475d4=!_[_0xcd69('0x16')](_0x2475d4)?',\x20request\x20body:\x20'+_0x2475d4:'';_0x486632=typeof _0x30a388[_0xcd69('0x13')]==='object'?JSON[_0xcd69('0x17')](_0x30a388['body']):_0x30a388[_0xcd69('0x13')];logger[_0xcd69('0x14')](util[_0xcd69('0x18')](_0xcd69('0x19'),_0x70443d[_0xcd69('0x5')],_0x70443d[_0xcd69('0x6')],_0x30a388[_0xcd69('0x1a')],_0x486632));})[_0xcd69('0x1b')](function(_0x3eb823){logger['error'](util['format'](_0xcd69('0x1c'),_0x70443d['data1'],_0x70443d['data2'],_0x3eb823[_0xcd69('0x1a')],_0x3eb823[_0xcd69('0x1d')],_0x3eb823[_0xcd69('0x1e')]));});}; \ No newline at end of file +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 diff --git a/server/services/email/client.js b/server/services/email/client.js index 3dce8cd..10ddc02 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 _0x0604=['routing','http','Request','request','then','debug','rpc','error','message','result','exports','bluebird','../../config/logger'];(function(_0x1ee7e4,_0x4ba132){var _0x4a99aa=function(_0x115d2d){while(--_0x115d2d){_0x1ee7e4['push'](_0x1ee7e4['shift']());}};_0x4a99aa(++_0x4ba132);}(_0x0604,0x16a));var _0x4060=function(_0x5d92f3,_0x291379){_0x5d92f3=_0x5d92f3-0x0;var _0x1cef86=_0x0604[_0x5d92f3];return _0x1cef86;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4060('0x0'));var logger=require(_0x4060('0x1'))(_0x4060('0x2'));var client=jayson['client'][_0x4060('0x3')]({'port':0x2329});client[_0x4060('0x4')]=function(_0x111799,_0x33e6ca){return new BPromise(function(_0x4d7528,_0x1e18b8){return client[_0x4060('0x5')](_0x111799,_0x33e6ca)[_0x4060('0x6')](function(_0x500638){logger[_0x4060('0x7')](_0x4060('0x8'),_0x4060('0x2'),_0x111799,_0x33e6ca,_0x500638);if(_0x500638[_0x4060('0x9')]){logger[_0x4060('0x9')](_0x4060('0x8'),_0x4060('0x2'),_0x111799,_0x500638[_0x4060('0x9')][_0x4060('0xa')],_0x33e6ca);return _0x1e18b8(_0x500638[_0x4060('0x9')]['message']);}else{return _0x4d7528(_0x500638[_0x4060('0xb')]);}})['catch'](function(_0x83919a){logger[_0x4060('0x9')](_0x4060('0x8'),_0x4060('0x2'),_0x111799,_0x83919a,_0x33e6ca);return _0x1e18b8(_0x83919a);});});};module[_0x4060('0xc')]=client; \ No newline at end of file +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 diff --git a/server/services/email/index.js b/server/services/email/index.js index fd91140..4d6cf1e 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 _0xaa71=['initMailAccounts','refresh','listen','getSettings','catch','log','./server','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts'];(function(_0x5e8b4d,_0x4e5ba1){var _0x5d0091=function(_0x53d632){while(--_0x53d632){_0x5e8b4d['push'](_0x5e8b4d['shift']());}};_0x5d0091(++_0x4e5ba1);}(_0xaa71,0x17f));var _0x1aa7=function(_0x3dda2a,_0x401cd3){_0x3dda2a=_0x3dda2a-0x0;var _0x472d97=_0xaa71[_0x3dda2a];return _0x472d97;};'use strict';var BPromise=require('bluebird');var server=require(_0x1aa7('0x0'));var Realtime=require('./realtime');var EmailChannel=require(_0x1aa7('0x1'));var mailAccount=require(_0x1aa7('0x2'));var setting=require(_0x1aa7('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x1aa7('0x4')]()[_0x1aa7('0x5')](mailAccount[_0x1aa7('0x6')]())[_0x1aa7('0x5')](realtime[_0x1aa7('0x7')]())[_0x1aa7('0x5')](function(){email[_0x1aa7('0x8')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x1aa7('0x9')](realtime,email)[_0x1aa7('0x5')](function(){return initRealtime();})[_0x1aa7('0x5')](function(){return setting[_0x1aa7('0xa')]();})[_0x1aa7('0x5')](function(_0x1f1595){return setInterval(initRealtime,_0x1f1595['loginMailFrequency']*0x3e8);})[_0x1aa7('0xb')](function(_0x3f49db){console[_0x1aa7('0xc')](_0x3f49db);});}main(); \ No newline at end of file +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 diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 64b9051..1bc3395 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 _0x6681=['../../../config/logger','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','stringify','md5','mailAccount:update','refresh','hasOwnProperty','email','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','handleImapError','disabled','connected','messages','lastName','from','then','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','catch','exports','moment','bluebird'];(function(_0x2efe86,_0x4b6c3f){var _0x48e01c=function(_0x5b1412){while(--_0x5b1412){_0x2efe86['push'](_0x2efe86['shift']());}};_0x48e01c(++_0x4b6c3f);}(_0x6681,0xce));var _0x1668=function(_0x121422,_0x5eab90){_0x121422=_0x121422-0x0;var _0x1ade17=_0x6681[_0x121422];return _0x1ade17;};'use strict';var _=require('lodash');var moment=require(_0x1668('0x0'));var BPromise=require(_0x1668('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x1668('0x2'))('email');config[_0x1668('0x3')]=_[_0x1668('0x4')](config[_0x1668('0x3')],{'host':_0x1668('0x5'),'port':0x18eb});var io=require(_0x1668('0x6'))(new Redis(config[_0x1668('0x3')]));var EmailImap=require(_0x1668('0x7'));var EmailSmtp=require(_0x1668('0x8'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5cf0a2){logger[_0x1668('0x9')]('start\x20email\x20channel');this[_0x1668('0xa')]=_0x5cf0a2['mailAccounts'];this[_0x1668('0xb')]={};this[_0x1668('0xc')]=new EmailSmtp();}EmailChannel[_0x1668('0xd')][_0x1668('0xe')]=function(_0x344133){var _0x2157f9=this[_0x1668('0xa')][_0x344133];var _0x45c8d6={'id':_0x2157f9['id'],'name':_0x2157f9[_0x1668('0xf')],'key':_0x2157f9[_0x1668('0x10')],'active':_0x2157f9[_0x1668('0x11')],'Imap':{'status':_0x2157f9[_0x1668('0x12')][_0x1668('0x13')],'messageStatus':_0x2157f9[_0x1668('0x12')][_0x1668('0x14')],'total':_0x2157f9[_0x1668('0x12')][_0x1668('0x15')]}};if(_[_0x1668('0x16')](md5Accounts[_0x344133])){md5Accounts[_0x344133]={};}var _0x355d3f=md5(JSON[_0x1668('0x17')](_0x45c8d6));if(md5Accounts[_0x344133][_0x1668('0x18')]!==_0x355d3f){md5Accounts[_0x344133]['md5']=_0x355d3f;io[_0x1668('0xe')](_0x1668('0x19'),_0x45c8d6);}};EmailChannel[_0x1668('0xd')][_0x1668('0x1a')]=function(_0x5dc34b){for(var _0x523d43 in _0x5dc34b){if(_0x5dc34b['hasOwnProperty'](_0x523d43)){if(_0x5dc34b[_0x523d43][_0x1668('0x12')]&&_0x5dc34b[_0x523d43][_0x1668('0x11')]){var _0xf18a1=_0x5dc34b[_0x523d43]['Imap'];if(!this[_0x1668('0xb')][_0x1668('0x1b')](_0xf18a1['id'])){this['imapAccounts'][_0xf18a1['id']]=new EmailImap(_0xf18a1,_0x5dc34b[_0x523d43][_0x1668('0x1c')]);this[_0x1668('0xb')][_0xf18a1['id']]['on'](_0x1668('0x1d'),this[_0x1668('0x1e')][_0x1668('0x1f')](this,_0x523d43));this[_0x1668('0xb')][_0xf18a1['id']]['on'](_0x1668('0x1c'),this[_0x1668('0x20')][_0x1668('0x1f')](this,_0x523d43));this['imapAccounts'][_0xf18a1['id']]['on']('end',this[_0x1668('0x21')][_0x1668('0x1f')](this,_0x523d43));this['imapAccounts'][_0xf18a1['id']]['on'](_0x1668('0x22'),this[_0x1668('0x23')][_0x1668('0x1f')](this,_0x523d43));}}else{if(_[_0x1668('0x16')](this['mailAccounts'][_0x523d43][_0x1668('0x12')])){this['mailAccounts'][_0x523d43]['Imap']={};}this[_0x1668('0xa')][_0x523d43][_0x1668('0x12')][_0x1668('0x13')]=_0x1668('0x24');this[_0x1668('0xa')][_0x523d43][_0x1668('0x12')]['messageStatus']='';this[_0x1668('0xe')](_0x523d43);}}}};EmailChannel[_0x1668('0xd')][_0x1668('0x1e')]=function(_0x4bb845,_0x31d13a){if(this[_0x1668('0xa')][_0x4bb845]){this[_0x1668('0xa')][_0x4bb845][_0x1668('0x12')][_0x1668('0x13')]=_0x1668('0x25');this['mailAccounts'][_0x4bb845][_0x1668('0x12')][_0x1668('0x14')]=_0x31d13a[_0x1668('0xf')];if(_0x31d13a[_0x1668('0x26')]){this[_0x1668('0xa')][_0x4bb845][_0x1668('0x12')][_0x1668('0x15')]=_0x31d13a['messages'][_0x1668('0x15')];}return this[_0x1668('0xe')](_0x4bb845);}};EmailChannel[_0x1668('0xd')][_0x1668('0x20')]=function(_0x136da3,_0x6e1142){logger[_0x1668('0x9')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x6e1142['firstName'],_0x6e1142[_0x1668('0x27')],_0x6e1142[_0x1668('0x28')],_0x136da3);if(this[_0x1668('0xa')][_0x136da3]){return mailAccount['notify'](_0x136da3,_0x6e1142)[_0x1668('0x29')](function(_0x14b145){if(_0x14b145){logger[_0x1668('0x9')]('Mail\x20accepted\x20from\x20routing');}})['catch'](function(_0x39a917){logger['error'](_0x1668('0x2a'),JSON['stringify'](_0x39a917));});}};EmailChannel[_0x1668('0xd')][_0x1668('0x21')]=function(_0xdd57a1){if(this[_0x1668('0xa')][_0xdd57a1]&&this[_0x1668('0xa')][_0xdd57a1][_0x1668('0x12')]){if(this[_0x1668('0xb')][this[_0x1668('0xa')][_0xdd57a1][_0x1668('0x12')]['id']]){delete this[_0x1668('0xb')][this['mailAccounts'][_0xdd57a1]['Imap']['id']];}this[_0x1668('0xa')][_0xdd57a1][_0x1668('0x12')][_0x1668('0x2b')]=moment();this[_0x1668('0xe')](_0xdd57a1);}};EmailChannel[_0x1668('0xd')][_0x1668('0x23')]=function(_0xeaeae9,_0x2ddafe){if(this[_0x1668('0xa')][_0xeaeae9]){this[_0x1668('0xa')][_0xeaeae9][_0x1668('0x12')]['status']='error';this[_0x1668('0xa')][_0xeaeae9][_0x1668('0x12')][_0x1668('0x14')]=_0x2ddafe;return this[_0x1668('0xe')](_0xeaeae9);}};EmailChannel[_0x1668('0xd')][_0x1668('0x2c')]=function(_0x1c7951,_0x57bf12){return this['smtp'][_0x1668('0x2d')](_0x1c7951,_0x57bf12);};EmailChannel[_0x1668('0xd')][_0x1668('0x2e')]=function(_0x5693de){var _0x685f2=this;if(this[_0x1668('0xa')][_0x5693de['id']]){if(_[_0x1668('0x16')](this[_0x1668('0xa')][_0x5693de['id']]['Smtp'])){this['mailAccounts'][_0x5693de['id']][_0x1668('0x2f')]={};}this[_0x1668('0xa')][_0x5693de['id']][_0x1668('0x2f')]['lastSync']=moment();return new BPromise(function(_0x5830f3,_0x24bcbd){return _0x685f2[_0x1668('0xc')][_0x1668('0x30')](_0x5693de)['then'](function(_0x22f32b){_0x685f2[_0x1668('0xa')][_0x5693de['id']][_0x1668('0x2f')]['status']=_0x1668('0x31');_0x685f2['mailAccounts'][_0x5693de['id']][_0x1668('0x2f')][_0x1668('0x14')]='';_0x685f2['emit'](_0x5693de['id']);_0x5830f3(_0x22f32b);})[_0x1668('0x32')](function(_0x4b5231){_0x685f2[_0x1668('0xa')][_0x5693de['id']][_0x1668('0x2f')][_0x1668('0x13')]=_0x1668('0x22');_0x685f2[_0x1668('0xa')][_0x5693de['id']][_0x1668('0x2f')][_0x1668('0x14')]=_0x4b5231;_0x685f2[_0x1668('0xe')](_0x5693de['id']);_0x24bcbd(_0x4b5231);});});}return this[_0x1668('0xc')][_0x1668('0x30')](_0x5693de);};module[_0x1668('0x33')]=EmailChannel; \ No newline at end of file +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 diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 66d28de..b41eade 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 _0xafec=['./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','handleReady','bind','once','end','handleEnd','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','search','UNSEEN','handleReadUnseen','length','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','randomstring','mailparser','simpleParser','iconv','Iconv','EventEmitter'];(function(_0x22fd9b,_0x496b11){var _0x2dad7d=function(_0x1c2e77){while(--_0x1c2e77){_0x22fd9b['push'](_0x22fd9b['shift']());}};_0x2dad7d(++_0x496b11);}(_0xafec,0x1b7));var _0xcafe=function(_0x2315d3,_0x18bd79){_0x2315d3=_0x2315d3-0x0;var _0x278e62=_0xafec[_0x2315d3];return _0x278e62;};'use strict';var fs=require('fs');var path=require(_0xcafe('0x0'));var util=require(_0xcafe('0x1'));var Imap=require(_0xcafe('0x2'));var _=require('lodash');var rs=require(_0xcafe('0x3'));var simpleParser=require(_0xcafe('0x4'))[_0xcafe('0x5')];var Iconv=require(_0xcafe('0x6'))[_0xcafe('0x7')];var EventEmitter=require('events')[_0xcafe('0x8')];var utils=require(_0xcafe('0x9'));var logger=require(_0xcafe('0xa'))(_0xcafe('0xb'));function EmailImap(_0x3e0298,_0x540c18){this[_0xcafe('0xc')]=_0xcafe('0xd');this[_0xcafe('0xe')]=this[_0xcafe('0xf')](_0x3e0298,_0x540c18);this[_0xcafe('0x2')]=new Imap(this[_0xcafe('0xe')]);this['imap']['once']('ready',this[_0xcafe('0x10')][_0xcafe('0x11')](this));this[_0xcafe('0x2')][_0xcafe('0x12')](_0xcafe('0x13'),this[_0xcafe('0x14')][_0xcafe('0x11')](this));this[_0xcafe('0x2')]['on'](_0xcafe('0x15'),this[_0xcafe('0x16')][_0xcafe('0x11')](this));this[_0xcafe('0x2')][_0xcafe('0x17')]();}util[_0xcafe('0x18')](EmailImap,EventEmitter);EmailImap[_0xcafe('0x19')]['getAccount']=function(_0x343cce,_0x451504){var _0xdd5a11={'connTimeout':_0x343cce[_0xcafe('0x1a')]?_0x343cce[_0xcafe('0x1a')]*0x3e8:0x2710,'authTimeout':_0x343cce[_0xcafe('0x1b')]?_0x343cce[_0xcafe('0x1b')]*0x3e8:0x1388};if(_[_0xcafe('0x1c')](_0x343cce[_0xcafe('0x1d')])){if(_0x343cce['authentication']){_0xdd5a11[_0xcafe('0x1e')]=_0x343cce[_0xcafe('0x1e')];_0xdd5a11[_0xcafe('0x1f')]=_0x343cce[_0xcafe('0x1f')];}_0xdd5a11[_0xcafe('0x20')]=_0x343cce[_0xcafe('0x20')];_0xdd5a11[_0xcafe('0x21')]=_0x343cce[_0xcafe('0x21')]||0x3e1;if(_0x343cce[_0xcafe('0x22')]){_0xdd5a11[_0xcafe('0x22')]=!![];}else{_0xdd5a11[_0xcafe('0x22')]=![];_0xdd5a11['autotls']=_0xcafe('0x23');}}else{_0xdd5a11[_0xcafe('0x1e')]=_0x343cce[_0xcafe('0x1e')];_0xdd5a11[_0xcafe('0x1f')]=_0x343cce[_0xcafe('0x1f')];_0xdd5a11[_0xcafe('0x20')]=utils[_0xcafe('0x24')](_0x343cce[_0xcafe('0x1d')]);_0xdd5a11[_0xcafe('0x21')]=0x3e1;_0xdd5a11['tls']=!![];}_0xdd5a11[_0xcafe('0xb')]=_0x451504||_0x343cce[_0xcafe('0x1e')]||_0xcafe('0x25');return _0xdd5a11;};EmailImap[_0xcafe('0x19')][_0xcafe('0x10')]=function(){this['imap'][_0xcafe('0x26')](this[_0xcafe('0xc')],![],this[_0xcafe('0x27')]['bind'](this));};EmailImap[_0xcafe('0x19')][_0xcafe('0x27')]=function(_0x35b70d,_0x179e1c){if(_0x35b70d){this[_0xcafe('0x16')](_0x35b70d,!![]);}else{this[_0xcafe('0x28')](_0xcafe('0x29'),_0x179e1c);this[_0xcafe('0x2a')]();}};EmailImap[_0xcafe('0x19')]['handleCloseBox']=function(_0x50377a){if(_0x50377a){this[_0xcafe('0x16')](_0x50377a,!![]);}else{this[_0xcafe('0x2')][_0xcafe('0x13')]();}};EmailImap[_0xcafe('0x19')][_0xcafe('0x2a')]=function(){this['imap'][_0xcafe('0x2b')]([_0xcafe('0x2c')],this[_0xcafe('0x2d')][_0xcafe('0x11')](this));};EmailImap[_0xcafe('0x19')][_0xcafe('0x2d')]=function(_0x4aac11,_0x240e09){if(_0x4aac11){this[_0xcafe('0x16')](_0x4aac11,!![]);}else{if(_0x240e09[_0xcafe('0x2e')]){try{var _0x3988ed=this[_0xcafe('0x2')]['fetch'](_0x240e09,{'bodies':'','markSeen':!![]});_0x3988ed['on'](_0xcafe('0x2f'),this[_0xcafe('0x30')][_0xcafe('0x11')](this));_0x3988ed['once']('error',this[_0xcafe('0x31')]['bind'](this));_0x3988ed[_0xcafe('0x12')](_0xcafe('0x13'),this[_0xcafe('0x32')][_0xcafe('0x11')](this));}catch(_0x26e05d){logger[_0xcafe('0x15')](_0x26e05d);}}else{this[_0xcafe('0x2')][_0xcafe('0x33')](!![],this[_0xcafe('0x34')][_0xcafe('0x11')](this));}}};EmailImap[_0xcafe('0x19')][_0xcafe('0x30')]=function(_0xd4fe14,_0x166407){_0xd4fe14['on'](_0xcafe('0x35'),this[_0xcafe('0x36')][_0xcafe('0x11')](this));_0xd4fe14[_0xcafe('0x12')](_0xcafe('0x37'),this['handleMessageAttributes'][_0xcafe('0x11')](this));_0xd4fe14[_0xcafe('0x12')](_0xcafe('0x13'),this[_0xcafe('0x38')]['bind'](this));};EmailImap[_0xcafe('0x19')][_0xcafe('0x36')]=function(_0x146246,_0x2006c4){simpleParser(_0x146246,{'Iconv':Iconv},this['handleSimpleParser'][_0xcafe('0x11')](this));};EmailImap[_0xcafe('0x19')]['handleMessageAttributes']=function(_0x37109d){};EmailImap[_0xcafe('0x19')][_0xcafe('0x38')]=function(){};EmailImap['prototype'][_0xcafe('0x39')]=function(_0x37206b,_0x177297){if(_0x37206b){logger['error'](_0x37206b);}else{var _0x4fb388=this;utils[_0xcafe('0x3a')](this[_0xcafe('0xe')],_0x177297,function(_0x3914fe){_0x4fb388[_0xcafe('0x28')](_0xcafe('0xb'),_0x3914fe);});}};EmailImap[_0xcafe('0x19')][_0xcafe('0x32')]=function(){this[_0xcafe('0x2')][_0xcafe('0x33')](!![],this[_0xcafe('0x34')][_0xcafe('0x11')](this));};EmailImap['prototype'][_0xcafe('0x31')]=function(_0x6a363f){this[_0xcafe('0x16')](_0x6a363f);this[_0xcafe('0x2')]['closeBox'](!![],this[_0xcafe('0x34')][_0xcafe('0x11')](this));};EmailImap[_0xcafe('0x19')][_0xcafe('0x14')]=function(){this['emit']('end');};EmailImap[_0xcafe('0x19')][_0xcafe('0x16')]=function(_0x2e9106,_0x4bdb67){logger['error'](_0xcafe('0x16'),this[_0xcafe('0xe')][_0xcafe('0xb')],JSON[_0xcafe('0x3b')](_0x2e9106));var _0x1e8cac='';if(_0x2e9106){if(_0x2e9106['textCode']){_0x1e8cac=_0x2e9106[_0xcafe('0x3c')];}else{for(var _0x1930ee in _0x2e9106){if(_0x2e9106[_0xcafe('0x3d')](_0x1930ee)){_0x1e8cac+=_[_0xcafe('0x3e')](_0x1930ee)+':\x20'+_0x2e9106[_0x1930ee]+'\x0a';}}}}if(_0x4bdb67){this['imap'][_0xcafe('0x13')]();}else{this[_0xcafe('0x28')](_0xcafe('0x15'),_0x1e8cac);this['emit'](_0xcafe('0x13'));}};module[_0xcafe('0x3f')]=EmailImap; \ No newline at end of file +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 diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 2f26c53..9a81c75 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 _0x2839=['createTransport','use','compile','toString','verify','Not\x20verifired','exports','bluebird','nodemailer-plugin-inline-base64','prototype','send'];(function(_0x19e476,_0x43c63a){var _0x4fce42=function(_0x262977){while(--_0x262977){_0x19e476['push'](_0x19e476['shift']());}};_0x4fce42(++_0x43c63a);}(_0x2839,0xe3));var _0x9283=function(_0x4e4a5d,_0x4cccfc){_0x4e4a5d=_0x4e4a5d-0x0;var _0x36c694=_0x2839[_0x4e4a5d];return _0x36c694;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x9283('0x0'));var inlineBase64=require(_0x9283('0x1'));function EmailSmtp(){}EmailSmtp[_0x9283('0x2')][_0x9283('0x3')]=function(_0x2326b4,_0x4c8775){return new BPromise(function(_0x5330b6,_0x3d95e7){var _0x1699ac=nodemailer[_0x9283('0x4')](_0x2326b4);_0x1699ac[_0x9283('0x5')](_0x9283('0x6'),inlineBase64());_0x1699ac['sendMail'](_0x4c8775,function(_0x3fc3ba,_0x2d3f7b){if(_0x3fc3ba){_0x3d95e7(_0x3fc3ba[_0x9283('0x7')]());}else{_0x5330b6(_0x2d3f7b);}});});};EmailSmtp[_0x9283('0x2')][_0x9283('0x8')]=function(_0x91a200){return new BPromise(function(_0x1f613f,_0x264792){var _0xccf7f0=nodemailer[_0x9283('0x4')](_0x91a200);_0xccf7f0[_0x9283('0x8')](function(_0x47f8bc,_0x43d220){if(_0x47f8bc){_0x264792(_0x47f8bc[_0x9283('0x7')]());}else{if(_0x43d220){_0x1f613f(_0x43d220);}else{_0x264792(_0x9283('0x9'));}}});});};module[_0x9283('0xa')]=EmailSmtp; \ No newline at end of file +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 diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index ec501d5..34864db 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 _0x6337=['imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','split','length','slice','Anonymous','pop','isEmpty','generate','html','replace','includes','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo'];(function(_0x454b7e,_0x39b2aa){var _0x4e466e=function(_0x5af331){while(--_0x5af331){_0x454b7e['push'](_0x454b7e['shift']());}};_0x4e466e(++_0x39b2aa);}(_0x6337,0x18a));var _0x7633=function(_0x32f2eb,_0x5cbe90){_0x32f2eb=_0x32f2eb-0x0;var _0x278e76=_0x6337[_0x32f2eb];return _0x278e76;};'use strict';var _=require('lodash');var moment=require(_0x7633('0x0'));var random=require(_0x7633('0x1'));var fs=require('fs');var path=require(_0x7633('0x2'));var util=require(_0x7633('0x3'));var tnef=require(_0x7633('0x4'));var logger=require(_0x7633('0x5'))(_0x7633('0x6'));var config=require(_0x7633('0x7'));function getAddress(_0x2ccc60){var _0x56f3ba=_[_0x7633('0x8')](_0x2ccc60[_0x7633('0x9')]);return _0x56f3ba&&_0x56f3ba[_0x7633('0xa')]?_0x56f3ba['address']:_0x7633('0xb')+random['generate'](0x6)+_0x7633('0xc');}function getFirstName(_0x14742c){var _0x54cc0e=_[_0x7633('0x8')](_0x14742c['value']);if(_0x54cc0e&&_0x54cc0e[_0x7633('0xd')]){if(_0x54cc0e['name']==_0x54cc0e[_0x7633('0xa')]){return _0x54cc0e[_0x7633('0xd')]['substring'](0x0,_0x54cc0e[_0x7633('0xd')][_0x7633('0xe')]('@'));}var _0x332283=_0x54cc0e['name'][_0x7633('0xf')](/\s+/);return _0x332283[_0x7633('0x10')]>0x1?_0x332283[_0x7633('0x11')](0x0,-0x1)['join']('\x20'):_0x54cc0e[_0x7633('0xd')];}return _0x7633('0x12');}function getLastName(_0x304a67){var _0x5ce87a=_['head'](_0x304a67['value']);if(_0x5ce87a&&_0x5ce87a[_0x7633('0xd')]){var _0x1be0ab=_0x5ce87a[_0x7633('0xd')][_0x7633('0xf')](/\s+/);return _0x1be0ab[_0x7633('0x10')]>0x1?_0x1be0ab[_0x7633('0x13')]():'';}return'';}function getMails(_0x47e212,_0x45ded1){var _0x1528b4='';for(var _0x5cbd62=0x0;_0x5cbd62<_0x45ded1[_0x7633('0x9')][_0x7633('0x10')];_0x5cbd62+=0x1){if(_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]!==_0x47e212){if(!_[_0x7633('0x14')](_0x1528b4)){_0x1528b4+=',';}_0x1528b4+=_0x45ded1['value'][_0x5cbd62][_0x7633('0xd')]||_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]||'';_0x1528b4+='\x20<';_0x1528b4+=_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]?_0x45ded1[_0x7633('0x9')][_0x5cbd62][_0x7633('0xa')]:_0x7633('0xb')+random[_0x7633('0x15')](0x6)+'@xcally.com';_0x1528b4+='>';}}return _0x1528b4;}function parseEmail(_0xdb0809,_0x1140cd,_0x1eb32e){if(_0x1140cd[_0x7633('0x16')]){var _0x1c8efc=/)<[^<]*)*<\/script>/gi;while(_0x1c8efc['test'](_0x1140cd[_0x7633('0x16')])){_0x1140cd[_0x7633('0x16')]=_0x1140cd[_0x7633('0x16')][_0x7633('0x17')](_0x1c8efc,'');}if(_0x1140cd['html'][_0x7633('0x18')](_0x7633('0x19'))){var _0x29177d=[];_0x1140cd[_0x7633('0x1a')]['forEach'](_0x2c2bdd=>{_0x29177d[_0x7633('0x1b')](_0x2c2bdd['filename']);});var _0x1eb275=/]+>/g;var _0x4e73c4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x47f2cb=_0x1140cd[_0x7633('0x16')][_0x7633('0x17')](_0x4e73c4,_0x7633('0x1c'));var _0x407053=_0x47f2cb[_0x7633('0x17')](_0x1eb275,_0x7633('0x1d'));for(let _0x22a817=0x0;_0x22a817<_0x29177d['length'];_0x22a817++){var _0x380f38=_0x407053[_0x7633('0x17')](_0x7633('0x1d'),_0x7633('0x1e')+_0x29177d[_0x22a817]+_0x7633('0x1f'));_0x407053=_0x380f38;}_0x1140cd[_0x7633('0x16')]=_0x407053;}_0x1eb32e['body']=_0x1140cd[_0x7633('0x16')];}else{_0x1eb32e[_0x7633('0x20')]=_0x1140cd['textAsHtml'];}if(_0x1eb32e[_0x7633('0x20')]){_0x1eb32e[_0x7633('0x20')]=_0x1eb32e['body']['replace'](/0x0){var _0x1ede5b=[_0x7633('0x32'),_0x7633('0x33'),'Precedence:\x20auto_reply'];for(var _0x295f72=0x0;_0x295f72<_0x1140cd['headerLines'][_0x7633('0x10')];_0x295f72++){var _0x548285=_[_0x7633('0xe')](_0x1ede5b,_0x1140cd[_0x7633('0x31')][_0x295f72]['line']);if(_0x548285>=0x0){_0x1eb32e[_0x7633('0x34')]=!![];}}}return _0x1eb32e;}exports[_0x7633('0x35')]=function(_0x3f24b2,_0x79c2d0,_0x18dd27){var _0x263290={'from':getAddress(_0x79c2d0[_0x7633('0x36')]),'firstName':getFirstName(_0x79c2d0['from']),'lastName':getLastName(_0x79c2d0['from']),'mapKey':_0x7633('0x6'),'message':{'from':getMails(_0x3f24b2['email'],_0x79c2d0[_0x7633('0x36')]),'to':_0x3f24b2[_0x7633('0x6')],'cc':'','subject':_0x79c2d0[_0x7633('0x37')]||'','messageId':_0x79c2d0[_0x7633('0x38')],'inReplyTo':_0x79c2d0[_0x7633('0x39')],'sentAt':moment(_0x79c2d0[_0x7633('0x3a')])[_0x7633('0x2a')](_0x7633('0x3b')),'attach':![],'attachments':[]}};if(!_0x79c2d0[_0x7633('0x16')]&&!_0x79c2d0[_0x7633('0x3c')]){var _0x806350=_[_0x7633('0x3d')](_0x79c2d0[_0x7633('0x1a')],{'contentType':'application/ms-tnef'});if(_0x806350['length']){logger[_0x7633('0x3e')](util[_0x7633('0x2a')](_0x7633('0x3f'),_0x79c2d0[_0x7633('0x38')]));tnef[_0x7633('0x40')](_[_0x7633('0x41')](_0x806350)['content'],function(_0x5b4902,_0x3a0201){if(_0x3a0201){_0x79c2d0[_0x7633('0x16')]=_0x3a0201[_0x7633('0x42')]||_0x7633('0x43');if(_0x3a0201['Attachments']){for(var _0x5d9a0d=0x0;_0x5d9a0d<_0x3a0201[_0x7633('0x44')][_0x7633('0x10')];_0x5d9a0d++){var _0x238c1f=_0x3a0201['Attachments'][_0x5d9a0d];_0x263290[_0x7633('0x23')][_0x7633('0x1a')][_0x7633('0x1b')]({'filename':_0x238c1f[_0x7633('0x45')],'content':Buffer[_0x7633('0x36')](_0x238c1f[_0x7633('0x46')])});}}}_0x18dd27(parseEmail(_0x3f24b2,_0x79c2d0,_0x263290));});}else{_0x79c2d0['html']=_0x7633('0x43');_0x18dd27(parseEmail(_0x3f24b2,_0x79c2d0,_0x263290));}}else{_0x18dd27(parseEmail(_0x3f24b2,_0x79c2d0,_0x263290));}};exports[_0x7633('0x47')]=function(_0x362c72){switch(_0x362c72){case'gmail':return _0x7633('0x48');case _0x7633('0x49'):return _0x7633('0x4a');case'hotmail':return'imap-mail.outlook.com';case _0x7633('0x4b'):return _0x7633('0x4c');}return _0x7633('0x4d');}; \ No newline at end of file +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 diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 81d81cd..e315033 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 _0x79ed=['exports','lodash','name','key','SERV','active','Imap','Smtp'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x79ed,0x169));var _0xd79e=function(_0x35dc86,_0x4e6a95){_0x35dc86=_0x35dc86-0x0;var _0x20375c=_0x79ed[_0x35dc86];return _0x20375c;};'use strict';var _=require(_0xd79e('0x0'));function MailAccount(_0x2ffc90){this['id']=_0x2ffc90['id']||0x0;this[_0xd79e('0x1')]=_0x2ffc90[_0xd79e('0x1')]||'Service';this[_0xd79e('0x2')]=_0x2ffc90[_0xd79e('0x2')]||_0xd79e('0x3');this[_0xd79e('0x4')]=_0x2ffc90['active']||![];this[_0xd79e('0x5')]=_0x2ffc90[_0xd79e('0x5')]||[];this[_0xd79e('0x6')]=_0x2ffc90[_0xd79e('0x6')]||[];}module[_0xd79e('0x7')]=MailAccount; \ No newline at end of file +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 diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index cced567..940768c 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 _0x8cf5=['prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty'];(function(_0xfd9ffb,_0x1d0606){var _0x399fa1=function(_0x3e7a81){while(--_0x3e7a81){_0xfd9ffb['push'](_0xfd9ffb['shift']());}};_0x399fa1(++_0x1d0606);}(_0x8cf5,0x130));var _0x58cf=function(_0x5e25d4,_0x48eb7f){_0x5e25d4=_0x5e25d4-0x0;var _0x35a37a=_0x8cf5[_0x5e25d4];return _0x35a37a;};'use strict';var _=require('lodash');var MailAccount=require(_0x58cf('0x0'));var Realtime=function(){this[_0x58cf('0x1')]={};};function freeIsNotKey(_0x49851f,_0xa1a9c,_0x5b26f7){var _0x7ebe5c=_[_0x58cf('0x2')](_0x49851f,function(_0x232026,_0x36f3aa){return _0x232026[_0x5b26f7];});for(var _0x1a24eb in _0xa1a9c){if(_0xa1a9c[_0x58cf('0x3')](_0x1a24eb)){if(!_0x7ebe5c[_0x1a24eb]){delete _0xa1a9c[_0x1a24eb];}}}}Realtime[_0x58cf('0x4')][_0x58cf('0x5')]=function(_0x7ea93,_0x38ad8d){for(var _0x439028 in _0x38ad8d){if(_0x7ea93[_0x58cf('0x3')](_0x439028)){_0x7ea93[_0x439028]=_0x38ad8d[_0x439028];}}};Realtime[_0x58cf('0x4')][_0x58cf('0x6')]=function(){var _0x551c7d=this;return function(_0x5c042b){if(_0x5c042b){freeIsNotKey(_0x5c042b,_0x551c7d[_0x58cf('0x1')],'id');for(var _0x6dfa0f=0x0,_0xa84086={},_0x107f7e={};_0x6dfa0f<_0x5c042b[_0x58cf('0x7')];_0x6dfa0f+=0x1){_0xa84086=_0x5c042b[_0x6dfa0f];if(_[_0x58cf('0x8')](_0x551c7d['mailAccounts'][_0xa84086['id']])){_0x551c7d[_0x58cf('0x1')][_0xa84086['id']]=new MailAccount(_0xa84086);}else{_[_0x58cf('0x9')](_0x551c7d[_0x58cf('0x1')][_0xa84086['id']],_0xa84086);}}}return _0x551c7d[_0x58cf('0x1')];};};module[_0x58cf('0xa')]=Realtime; \ No newline at end of file +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 diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 2fb4955..f8b177e 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 _0x14a0=['active','key','TemplateId','MailServerIn','MailServerOut','Smtp','getMailAccount','notify','NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','service','email'];(function(_0x4c7d49,_0x284cdf){var _0x212fb0=function(_0x12e185){while(--_0x12e185){_0x4c7d49['push'](_0x4c7d49['shift']());}};_0x212fb0(++_0x284cdf);}(_0x14a0,0x109));var _0x014a=function(_0xcb92bf,_0x4782b2){_0xcb92bf=_0xcb92bf-0x0;var _0x234c84=_0x14a0[_0xcb92bf];return _0x234c84;};'use strict';var client=require(_0x014a('0x0'));exports[_0x014a('0x1')]=function(){return function(){return client[_0x014a('0x2')](_0x014a('0x3'),{'options':{'attributes':['id',_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),_0x014a('0x7'),_0x014a('0x8'),'ListId',_0x014a('0x9')],'raw':![],'include':[{'model':_0x014a('0xa'),'as':'Imap'},{'model':_0x014a('0xb'),'as':_0x014a('0xc')}]},'log':_0x014a('0xd')});};};exports[_0x014a('0xe')]=function(_0x1b3caa,_0x4e9ed6){return client[_0x014a('0x2')](_0x014a('0xf'),{'account':{'id':_0x1b3caa},'body':_0x4e9ed6,'log':_0x014a('0xf')});}; \ No newline at end of file +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 diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index fabf8bc..b5f6383 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 _0xf942=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x11c573,_0x9e7c6e){var _0x6b72de=function(_0x2e8a61){while(--_0x2e8a61){_0x11c573['push'](_0x11c573['shift']());}};_0x6b72de(++_0x9e7c6e);}(_0xf942,0x1e9));var _0x2f94=function(_0x2f70b8,_0x52ada3){_0x2f70b8=_0x2f70b8-0x0;var _0x24d3e5=_0xf942[_0x2f70b8];return _0x24d3e5;};'use strict';var client=require(_0x2f94('0x0'));exports[_0x2f94('0x1')]=function(){return client[_0x2f94('0x2')](_0x2f94('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2f94('0x4')]},'log':_0x2f94('0x5')});}; \ No newline at end of file +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 diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index e39e54d..a14ed3c 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(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_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 diff --git a/server/services/express/index.js b/server/services/express/index.js index c2ecb61..91710b0 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 _0x666a=['redis','defaults','adapter','socket.io-redis','default','../../config/socketio','../../config/express','once','listening','log','exports','lodash','http','ioredis','createServer','timeout','listen','port','socket.io'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x666a,0x14e));var _0xa666=function(_0x72ff03,_0x32eeed){_0x72ff03=_0x72ff03-0x0;var _0x19cc36=_0x666a[_0x72ff03];return _0x19cc36;};'use strict';var _=require(_0xa666('0x0'));var http=require(_0xa666('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0xa666('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0xa666('0x3')](app);server[_0xa666('0x4')]=0xdbba0;if(sticky[_0xa666('0x5')](server,config[_0xa666('0x6')])){var socketio=require(_0xa666('0x7'))(server,{'transports':['websocket','polling']});config[_0xa666('0x8')]=_[_0xa666('0x9')](config['redis'],{'host':'localhost','port':0x18eb});socketio[_0xa666('0xa')](require(_0xa666('0xb'))({'pubClient':new Redis(config[_0xa666('0x8')]),'subClient':new Redis(config[_0xa666('0x8')])}));require('../../config/triggers')[_0xa666('0xc')]();require(_0xa666('0xd'))[_0xa666('0xc')](socketio);require(_0xa666('0xe'))[_0xa666('0xc')](app);require('../../routes')[_0xa666('0xc')](app);}else{server[_0xa666('0xf')](_0xa666('0x10'),function(){console[_0xa666('0x11')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xa666('0x6')]);});}exports=module[_0xa666('0x12')]=app; \ No newline at end of file +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 diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e9adb8f..3c0ad1a 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 _0x2423=['debug','rpc','error','message','exports','jayson/promise','routing','client','http','Request'];(function(_0xbb27ec,_0xb45f75){var _0x418403=function(_0x6b63ae){while(--_0x6b63ae){_0xbb27ec['push'](_0xbb27ec['shift']());}};_0x418403(++_0xb45f75);}(_0x2423,0x131));var _0x3242=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2423[_0x20a584];return _0x4b41a8;};'use strict';var jayson=require(_0x3242('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0x3242('0x1'));var client=jayson[_0x3242('0x2')][_0x3242('0x3')]({'port':0x2329});client[_0x3242('0x4')]=function(_0x27f355,_0x41df9b){return new BPromise(function(_0x5c6669,_0x3b6d0f){return client['request'](_0x27f355,_0x41df9b)['then'](function(_0x4f850b){logger[_0x3242('0x5')](_0x3242('0x6'),'routing',_0x27f355,_0x41df9b,_0x4f850b);if(_0x4f850b[_0x3242('0x7')]){logger[_0x3242('0x7')](_0x3242('0x6'),_0x3242('0x1'),_0x27f355,_0x4f850b['error'][_0x3242('0x8')],_0x41df9b);return _0x3b6d0f(_0x4f850b['error'][_0x3242('0x8')]);}else{return _0x5c6669(_0x4f850b['result']);}})['catch'](function(_0x2cb9bd){logger[_0x3242('0x7')](_0x3242('0x6'),_0x3242('0x1'),_0x27f355,_0x2cb9bd,_0x41df9b);return _0x3b6d0f(_0x2cb9bd);});});};module[_0x3242('0x9')]=client; \ No newline at end of file +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 diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 5f81fba..9836881 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 _0xd8ac=['getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd8ac,0x1d2));var _0xcd8a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd8ac[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0xcd8a('0x0'));var server=require(_0xcd8a('0x1'));var Realtime=require(_0xcd8a('0x2'));var user=require(_0xcd8a('0x3'));var interval=require(_0xcd8a('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xcd8a('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xcd8a('0x6'));var whatsappQueue=require(_0xcd8a('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()['then'](user['getAgents']())[_0xcd8a('0x8')](realtime[_0xcd8a('0x9')]())['then'](interval['getIntervals']())[_0xcd8a('0x8')](realtime[_0xcd8a('0xa')]())['then'](openchannelQueue[_0xcd8a('0xb')]())[_0xcd8a('0x8')](realtime[_0xcd8a('0xc')]())['then'](chatQueue[_0xcd8a('0xd')]())[_0xcd8a('0x8')](realtime['initChatQueues']())[_0xcd8a('0x8')](smsQueue['getSmsQueues']())[_0xcd8a('0x8')](realtime[_0xcd8a('0xe')]())['then'](mailQueue[_0xcd8a('0xf')]())[_0xcd8a('0x8')](realtime[_0xcd8a('0x10')]())[_0xcd8a('0x8')](faxQueue[_0xcd8a('0x11')]())[_0xcd8a('0x8')](realtime[_0xcd8a('0x12')]())['then'](whatsappQueue['getWhatsappQueues']())[_0xcd8a('0x8')](realtime[_0xcd8a('0x13')]())['then'](function(){return realtime;});}function main(){return server[_0xcd8a('0x14')](realtime)[_0xcd8a('0x8')](function(_0x4db200){return initRealtime();})['then'](function(_0x4f8b53){return setInterval(initRealtime,0x1388);})[_0xcd8a('0x15')](function(_0x24ea48){console[_0xcd8a('0x16')](_0x24ea48);});}main(); \ No newline at end of file +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 diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index 67633e1..2f0196c 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 _0x2ef3=['next','isEqual','restart','condition','matches','filter','turn','prioritize','findRules','length','priority','toJSON','map','toString','fromJSON','parse','object','exports','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','rules','activeRules','prototype','isArray','concat','push','sync','orderBy','result','clone','consequence','name','index_','nextTick','ruleRef','call'];(function(_0x547009,_0x5577e2){var _0xf733a5=function(_0x30b13b){while(--_0x30b13b){_0x547009['push'](_0x547009['shift']());}};_0xf733a5(++_0x5577e2);}(_0x2ef3,0xba));var _0x32ef=function(_0x2c0f2e,_0x4f4b0e){_0x2c0f2e=_0x2c0f2e-0x0;var _0x5e440f=_0x2ef3[_0x2c0f2e];return _0x5e440f;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var EventEmitter=require(_0x32ef('0x2'))[_0x32ef('0x3')];function RuleEngine(_0x3944df,_0x38047b){this['init']();if(!_[_0x32ef('0x4')](_0x3944df)){this[_0x32ef('0x5')](_0x3944df);}if(_0x38047b){this['ignoreFactChanges']=_0x38047b[_0x32ef('0x6')];}return this;}util[_0x32ef('0x7')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x2c0089){this[_0x32ef('0x8')]=[];this[_0x32ef('0x9')]=[];};RuleEngine[_0x32ef('0xa')][_0x32ef('0x5')]=function(_0x298066){if(Array[_0x32ef('0xb')](_0x298066)){this[_0x32ef('0x8')]=this[_0x32ef('0x8')][_0x32ef('0xc')](_0x298066);}else if(_0x298066!==null&&_['isObject'](_0x298066)){this['rules'][_0x32ef('0xd')](_0x298066);}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0xe')]=function(){this['activeRules']=this[_0x32ef('0x8')]['filter'](function(_0x1a5106){if(_['isNil'](_0x1a5106['on'])){_0x1a5106['on']=!![];}if(_0x1a5106['on']===!![]){return _0x1a5106;}});this[_0x32ef('0x9')]=_[_0x32ef('0xf')](this['activeRules'],['p'],['asc']);};RuleEngine[_0x32ef('0xa')]['execute']=function(_0x326fce,_0x40a6e6){var _0x93d492=![];_0x326fce[_0x32ef('0x10')]=!![];var _0x57aff1=_['clone'](_0x326fce);var _0x531e30=_[_0x32ef('0x11')](_0x326fce);var _0x3950e6=this[_0x32ef('0x9')];var _0x53a5ca=[];var _0x5d559b=this[_0x32ef('0x6')];(function FnRuleLoop(_0x1a9476){var _0x286bfb={'rules':function(){return _0x3950e6;},'rule':function(){return _0x3950e6[_0x1a9476];},'when':function(_0x57863c){if(_0x57863c){var _0xbe37f6=_0x3950e6[_0x1a9476][_0x32ef('0x12')];_0xbe37f6['ruleRef']=_0x3950e6[_0x1a9476]['id']||_0x3950e6[_0x1a9476][_0x32ef('0x13')]||_0x32ef('0x14')+_0x1a9476;process[_0x32ef('0x15')](function(){_0x53a5ca[_0x32ef('0xd')](_0xbe37f6[_0x32ef('0x16')]);_0xbe37f6[_0x32ef('0x17')](_0x57aff1,_0x286bfb);});}else{process['nextTick'](function(){_0x286bfb[_0x32ef('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x93d492=!![];return FnRuleLoop(0x0);},'next':function(_0x5cc3ef){if(!_0x5d559b&&!_[_0x32ef('0x19')](_0x531e30,_0x57aff1)){_0x531e30=_[_0x32ef('0x11')](_0x57aff1);process['nextTick'](function(){_0x286bfb[_0x32ef('0x1a')]();});}else{process[_0x32ef('0x15')](function(){if(_[_0x32ef('0x4')](_0x5cc3ef)){return FnRuleLoop(_0x1a9476+0x1);}else{return FnRuleLoop(_0x5cc3ef);}});}}};if(_0x1a9476<_0x3950e6['length']&&_0x93d492===![]){var _0x57f5e5=_0x3950e6[_0x1a9476][_0x32ef('0x1b')];_0x57f5e5[_0x32ef('0x17')](_0x57aff1,_0x286bfb);}else{process[_0x32ef('0x15')](function(){_0x57aff1['matchPath']=_0x53a5ca;return _0x40a6e6?_0x40a6e6(_0x57aff1):_['noop']();});}}(0x0));};RuleEngine[_0x32ef('0xa')]['findRules']=function(_0x51a412){if(_[_0x32ef('0x4')](_0x51a412)){return this[_0x32ef('0x8')];}else{var _0x371540=_[_0x32ef('0x1c')](_0x51a412);return _[_0x32ef('0x1d')](this[_0x32ef('0x8')],_0x371540);}};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1e')]=function(_0x338f19,_0x2f52d7){var _0x1335e2=_0x338f19==='on'||_0x338f19==='ON'?!![]:![];var _0xba4b3f=this['findRules'](_0x2f52d7);for(var _0xd65fde=0x0,_0x2f5d06=_0xba4b3f['length'];_0xd65fde<_0x2f5d06;_0xd65fde+=0x1){_0xba4b3f[_0xd65fde]['on']=_0x1335e2;}this[_0x32ef('0xe')]();};RuleEngine[_0x32ef('0xa')][_0x32ef('0x1f')]=function(_0x26e207,_0x50a95b){_0x26e207=parseInt(_0x26e207,0xa);var _0x10e38c=this[_0x32ef('0x20')](_0x50a95b);for(var _0x31dbc3=0x0,_0x2ac686=_0x10e38c[_0x32ef('0x21')];_0x31dbc3<_0x2ac686;_0x31dbc3+=0x1){_0x10e38c[_0x31dbc3][_0x32ef('0x22')]=_0x26e207;}this[_0x32ef('0xe')]();};RuleEngine['prototype'][_0x32ef('0x23')]=function(){var _0x537214=this[_0x32ef('0x8')];if(_0x537214 instanceof Array){_0x537214=_0x537214[_0x32ef('0x24')](function(_0x5a9565){_0x5a9565[_0x32ef('0x1b')]=_0x5a9565[_0x32ef('0x1b')][_0x32ef('0x25')]();_0x5a9565[_0x32ef('0x12')]=_0x5a9565[_0x32ef('0x12')]['toString']();return _0x5a9565;});}else if(!_['isNil'](_0x537214)){_0x537214[_0x32ef('0x1b')]=_0x537214['condition'][_0x32ef('0x25')]();_0x537214[_0x32ef('0x12')]=_0x537214[_0x32ef('0x12')][_0x32ef('0x25')]();}return _0x537214;};RuleEngine[_0x32ef('0xa')][_0x32ef('0x26')]=function(_0x566b56){this['init']();if(_['isString'](_0x566b56)){_0x566b56=JSON[_0x32ef('0x27')](_0x566b56);}if(_0x566b56 instanceof Array){_0x566b56=_0x566b56[_0x32ef('0x24')](function(_0x136b02){_0x136b02['condition']=eval('('+_0x136b02['condition']+')');_0x136b02[_0x32ef('0x12')]=eval('('+_0x136b02[_0x32ef('0x12')]+')');return _0x136b02;});}else if(_0x566b56!==null&&typeof _0x566b56==_0x32ef('0x28')){_0x566b56['condition']=eval('('+_0x566b56['condition']+')');_0x566b56[_0x32ef('0x12')]=eval('('+_0x566b56[_0x32ef('0x12')]+')');}this[_0x32ef('0x5')](_0x566b56);};module[_0x32ef('0x29')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1261,0x144));var _0x1126=function(_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 diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 8d8ee46..6c616cb 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 _0x3186=['bluebird','client','http','then','error','message','result','sendMailMessage','SendMail'];(function(_0xc7b7e1,_0x619406){var _0x13082f=function(_0x5d01bc){while(--_0x5d01bc){_0xc7b7e1['push'](_0xc7b7e1['shift']());}};_0x13082f(++_0x619406);}(_0x3186,0x105));var _0x6318=function(_0x282be7,_0x411cdf){_0x282be7=_0x282be7-0x0;var _0x443b36=_0x3186[_0x282be7];return _0x443b36;};'use strict';var BPromise=require(_0x6318('0x0'));var jayson=require('jayson/promise');var client=jayson[_0x6318('0x1')][_0x6318('0x2')]({'port':0x232b});function request(_0x336cab,_0x2d0c9b){return new BPromise(function(_0x4134a2,_0x4c95b4){return client['request'](_0x336cab,_0x2d0c9b)[_0x6318('0x3')](function(_0xeac4bf){if(_0xeac4bf['error']){return _0x4c95b4(_0xeac4bf[_0x6318('0x4')][_0x6318('0x5')]);}else{return _0x4134a2(_0xeac4bf[_0x6318('0x6')]);}})['catch'](function(_0x4cafd7){return _0x4c95b4(_0x4cafd7);});});}exports[_0x6318('0x7')]=function(_0x3fcbe7,_0x47b767){return request(_0x6318('0x8'),{'account':_0x3fcbe7,'message':_0x47b767});}; \ No newline at end of file +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 diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index e961be9..c4d2b82 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 _0xb0ca=['openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','md5','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','format','faxStatus','openchannelCurrentCapacity','stringify','emit','user:save','exports','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb0ca,0x1b2));var _0xab0c=function(_0x5c0373,_0x21fd2e){_0x5c0373=_0x5c0373-0x0;var _0x240ec2=_0xb0ca[_0x5c0373];return _0x240ec2;};'use strict';var _=require('lodash');var moment=require(_0xab0c('0x0'));var md5=require('md5');var Redis=require(_0xab0c('0x1'));var config=require(_0xab0c('0x2'));config[_0xab0c('0x3')]=_[_0xab0c('0x4')](config[_0xab0c('0x3')],{'host':_0xab0c('0x5'),'port':0x18eb});var io=require(_0xab0c('0x6'))(new Redis(config['redis']));function Agent(_0x40cabc){this['id']=_0x40cabc['id']||0x0;this[_0xab0c('0x7')]=_0x40cabc[_0xab0c('0x7')]||'';this[_0xab0c('0x8')]=_0x40cabc[_0xab0c('0x8')]||!![];this[_0xab0c('0x9')]=_0x40cabc[_0xab0c('0x9')]||![];this[_0xab0c('0xa')]=_0x40cabc[_0xab0c('0xa')]||![];this['mailPause']=_0x40cabc[_0xab0c('0xb')]||![];this[_0xab0c('0xc')]=_0x40cabc[_0xab0c('0xc')]||![];this[_0xab0c('0xd')]=_0x40cabc[_0xab0c('0xd')]||![];this[_0xab0c('0xe')]=_0x40cabc['openchannelPause']||![];this[_0xab0c('0xf')]='unknown';this[_0xab0c('0x10')]=0x0;this[_0xab0c('0x11')]=_0x40cabc[_0xab0c('0x11')]||0x0;this[_0xab0c('0x12')]=0x0;this[_0xab0c('0x13')]=_0xab0c('0x14');this[_0xab0c('0x15')]=0x0;this[_0xab0c('0x16')]=_0x40cabc[_0xab0c('0x16')]||0x0;this[_0xab0c('0x17')]=0x0;this['faxStatus']='unknown';this[_0xab0c('0x18')]=0x0;this[_0xab0c('0x19')]=_0x40cabc[_0xab0c('0x19')]||0x0;this[_0xab0c('0x1a')]=0x0;this[_0xab0c('0x1b')]=_0xab0c('0x14');this[_0xab0c('0x1c')]=0x0;this[_0xab0c('0x1d')]=_0x40cabc[_0xab0c('0x1d')]||0x0;this[_0xab0c('0x1e')]=0x0;this[_0xab0c('0x1f')]=_0xab0c('0x14');this[_0xab0c('0x20')]=0x0;this[_0xab0c('0x21')]=_0x40cabc[_0xab0c('0x21')]||0x0;this[_0xab0c('0x22')]=0x0;this[_0xab0c('0x23')]=_0xab0c('0x14');this[_0xab0c('0x24')]=0x0;this['openchannelCapacity']=_0x40cabc[_0xab0c('0x25')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xab0c('0x26')]=![];this[_0xab0c('0x27')]=undefined;this[_0xab0c('0x28')]='';this[_0xab0c('0x29')]();}Agent[_0xab0c('0x2a')][_0xab0c('0x2b')]=function(_0x59e31b){if(this[_0x59e31b+_0xab0c('0x2c')]>0x0){if(this[_0x59e31b+_0xab0c('0x2d')]>0x0&&this[_0x59e31b+_0xab0c('0x2c')]>=this[_0x59e31b+'Capacity']){return _0xab0c('0x2e');}else{return'working';}}else{return _0xab0c('0x2f');}};Agent[_0xab0c('0x2a')][_0xab0c('0x29')]=function(){var _0x5a734a=[_0xab0c('0x30'),_0xab0c('0x31'),'openchannel',_0xab0c('0x32'),_0xab0c('0x33'),_0xab0c('0x34')];for(var _0x3a2e3d=0x0;_0x3a2e3d<_0x5a734a[_0xab0c('0x35')];_0x3a2e3d+=0x1){var _0xee8cbd=this[_0xab0c('0x2b')](_0x5a734a[_0x3a2e3d]);if(this[_0x5a734a[_0x3a2e3d]+_0xab0c('0x36')]!==_0xee8cbd){this[_0x5a734a[_0x3a2e3d]+_0xab0c('0x37')]=_[_0xab0c('0x38')](moment()[_0xab0c('0x39')]('x'));}this[_0x5a734a[_0x3a2e3d]+_0xab0c('0x36')]=_0xee8cbd;}var _0x18cc07={'id':this['id'],'name':this['name'],'online':this[_0xab0c('0x8')],'voicePause':this[_0xab0c('0x9')],'chatPause':this[_0xab0c('0xa')],'mailPause':this[_0xab0c('0xb')],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this['openchannelPause'],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xab0c('0x10')],'chatCapacity':this[_0xab0c('0x11')],'chatCurrentCapacity':this[_0xab0c('0x12')],'mailStatus':this[_0xab0c('0x13')],'mailStatusTime':this[_0xab0c('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xab0c('0x3a')],'faxStatusTime':this[_0xab0c('0x18')],'faxCapacity':this[_0xab0c('0x19')],'faxCurrentCapacity':this[_0xab0c('0x1a')],'smsStatus':this[_0xab0c('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xab0c('0x1f')],'whatsappStatusTime':this[_0xab0c('0x20')],'whatsappCapacity':this[_0xab0c('0x21')],'whatsappCurrentCapacity':this[_0xab0c('0x22')],'openchannelStatus':this[_0xab0c('0x23')],'openchannelStatusTime':this[_0xab0c('0x24')],'openchannelCapacity':this[_0xab0c('0x25')],'openchannelCurrentCapacity':this[_0xab0c('0x3b')],'busy':this[_0xab0c('0x26')],'busyQueue':this[_0xab0c('0x27')]};var _0x186947=md5(JSON[_0xab0c('0x3c')](_0x18cc07));if(this[_0xab0c('0x28')]!==_0x186947){this['md5']=_0x186947;io[_0xab0c('0x3d')](_0xab0c('0x3e'),_0x18cc07);}};module[_0xab0c('0x3f')]=Agent; \ No newline at end of file +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 diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index cb52942..e3b88a0 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 _0x0b89=['redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','map','updateRealtime','loggedIn','paused','length','online','chatPause','available','stringify','md5','format','chat:queue:%s','emit','exports','lodash','util','ioredis','../../../config/environment','defaults','socket.io-emitter'];(function(_0x3b68fa,_0x45299a){var _0x49deda=function(_0x3f9b56){while(--_0x3f9b56){_0x3b68fa['push'](_0x3b68fa['shift']());}};_0x49deda(++_0x45299a);}(_0x0b89,0x1ea));var _0x90b8=function(_0x843f41,_0x569a4a){_0x843f41=_0x843f41-0x0;var _0xa8bf7d=_0x0b89[_0x843f41];return _0xa8bf7d;};'use strict';var _=require(_0x90b8('0x0'));var md5=require('md5');var util=require(_0x90b8('0x1'));var Redis=require(_0x90b8('0x2'));var config=require(_0x90b8('0x3'));config['redis']=_[_0x90b8('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x90b8('0x5'))(new Redis(config[_0x90b8('0x6')]));function ChatQueue(_0x162739){this['id']=_0x162739['id']||0x0;this[_0x90b8('0x7')]=_0x162739[_0x90b8('0x7')]||'';this[_0x90b8('0x8')]=_0x162739[_0x90b8('0x8')]||0xa;this[_0x90b8('0x9')]=_0x162739[_0x90b8('0x9')]||_0x90b8('0xa');this[_0x90b8('0xb')]=_0x162739['Agents'];this[_0x90b8('0xc')]={};this[_0x90b8('0xd')]=0x0;this['md5']='';this[_0x90b8('0xe')]();this['updateRealtime']();}ChatQueue[_0x90b8('0xf')][_0x90b8('0xe')]=function(){var _0x173dbd=this[_0x90b8('0xc')][_0x90b8('0x10')];this[_0x90b8('0xc')]=_[_0x90b8('0x11')](this[_0x90b8('0xb')],'id');this['mapAgentsId'][_0x90b8('0x10')]=_0x173dbd;};ChatQueue['prototype'][_0x90b8('0x12')]=function(){this[_0x90b8('0x13')]=0x0;this[_0x90b8('0x14')]=0x0;for(var _0x346129=0x0;_0x346129=0x0?this[_0x90b8('0x18')]:0x0;var _0x146572={'id':this['id'],'available':this[_0x90b8('0x18')],'loggedIn':this[_0x90b8('0x13')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x90b8('0xd')]};var _0x3ed0b0=md5(JSON[_0x90b8('0x19')](_0x146572));if(this[_0x90b8('0x1a')]!==_0x3ed0b0){this[_0x90b8('0x1a')]=_0x3ed0b0;io['to'](util[_0x90b8('0x1b')](_0x90b8('0x1c'),_0x146572[_0x90b8('0x7')]))[_0x90b8('0x1d')]('chat_queue:save',_0x146572);}};module[_0x90b8('0x1e')]=ChatQueue; \ No newline at end of file +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 diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 011b387..3f499a9 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 _0x583b=['timeout','strategy','Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn','available','stringify','format','emit','fax_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','name'];(function(_0x2033a5,_0x47e854){var _0x1394b1=function(_0x2939c7){while(--_0x2939c7){_0x2033a5['push'](_0x2033a5['shift']());}};_0x1394b1(++_0x47e854);}(_0x583b,0xdb));var _0xb583=function(_0x4bcdf6,_0x459695){_0x4bcdf6=_0x4bcdf6-0x0;var _0x1ad0fe=_0x583b[_0x4bcdf6];return _0x1ad0fe;};'use strict';var _=require(_0xb583('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xb583('0x1'));var config=require(_0xb583('0x2'));config[_0xb583('0x3')]=_[_0xb583('0x4')](config[_0xb583('0x3')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb583('0x3')]));function FaxQueue(_0x5118e9){this['id']=_0x5118e9['id']||0x0;this[_0xb583('0x5')]=_0x5118e9[_0xb583('0x5')]||'';this[_0xb583('0x6')]=_0x5118e9[_0xb583('0x6')]||0xa;this[_0xb583('0x7')]=_0x5118e9[_0xb583('0x7')]||'beepall';this[_0xb583('0x8')]=_0x5118e9[_0xb583('0x8')];this[_0xb583('0x9')]={};this[_0xb583('0xa')]=0x0;this[_0xb583('0xb')]='';this[_0xb583('0xc')]();this[_0xb583('0xd')]();}FaxQueue[_0xb583('0xe')][_0xb583('0xc')]=function(){var _0x31e79d=this[_0xb583('0x9')]['_rr'];this[_0xb583('0x9')]=_['map'](this['Agents'],'id');this['mapAgentsId'][_0xb583('0xf')]=_0x31e79d;};FaxQueue[_0xb583('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this[_0xb583('0x10')]=0x0;for(var _0x231693=0x0;_0x231693=0x0?this[_0xb583('0x13')]:0x0;var _0x5e4b4b={'id':this['id'],'available':this[_0xb583('0x13')],'loggedIn':this[_0xb583('0x12')],'name':this['name'],'paused':this[_0xb583('0x10')],'waiting':this[_0xb583('0xa')]};var _0x34e775=md5(JSON[_0xb583('0x14')](_0x5e4b4b));if(this[_0xb583('0xb')]!==_0x34e775){this[_0xb583('0xb')]=_0x34e775;io['to'](util[_0xb583('0x15')]('fax:queue:%s',_0x5e4b4b[_0xb583('0x5')]))[_0xb583('0x16')](_0xb583('0x17'),_0x5e4b4b);}};module[_0xb583('0x18')]=FaxQueue; \ No newline at end of file +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 diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 0181344..992f20a 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 _0x6356=['exports','Intervals'];(function(_0x1852a1,_0x14bf04){var _0x40cfa1=function(_0x4d83b7){while(--_0x4d83b7){_0x1852a1['push'](_0x1852a1['shift']());}};_0x40cfa1(++_0x14bf04);}(_0x6356,0x191));var _0x6635=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0x6356[_0x48cb1f];return _0x172c4d;};'use strict';function Interval(_0x5561a1){this['id']=_0x5561a1['id']||0x0;this['name']=_0x5561a1['name']||'';this[_0x6635('0x0')]=_0x5561a1[_0x6635('0x0')]||{};}module[_0x6635('0x1')]=Interval; \ No newline at end of file +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 diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 86ea95a..7ba9fbb 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 _0xef22=['name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x5300b,_0x40bea3){var _0x15e957=function(_0x4c11e8){while(--_0x4c11e8){_0x5300b['push'](_0x5300b['shift']());}};_0x15e957(++_0x40bea3);}(_0xef22,0x117));var _0x2ef2=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xef22[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x2ef2('0x0'));var md5=require(_0x2ef2('0x1'));var util=require(_0x2ef2('0x2'));var Redis=require(_0x2ef2('0x3'));var config=require(_0x2ef2('0x4'));config[_0x2ef2('0x5')]=_[_0x2ef2('0x6')](config[_0x2ef2('0x5')],{'host':_0x2ef2('0x7'),'port':0x18eb});var io=require(_0x2ef2('0x8'))(new Redis(config['redis']));function MailQueue(_0x38fe8a){this['id']=_0x38fe8a['id']||0x0;this[_0x2ef2('0x9')]=_0x38fe8a['name']||'';this[_0x2ef2('0xa')]=_0x38fe8a['timeout']||0xa;this[_0x2ef2('0xb')]=_0x38fe8a[_0x2ef2('0xb')]||_0x2ef2('0xc');this[_0x2ef2('0xd')]=_0x38fe8a[_0x2ef2('0xd')];this[_0x2ef2('0xe')]={};this[_0x2ef2('0xf')]=0x0;this[_0x2ef2('0x1')]='';this[_0x2ef2('0x10')]();this[_0x2ef2('0x11')]();}MailQueue[_0x2ef2('0x12')][_0x2ef2('0x10')]=function(){var _0x31d2a2=this[_0x2ef2('0xe')][_0x2ef2('0x13')];this['mapAgentsId']=_[_0x2ef2('0x14')](this[_0x2ef2('0xd')],'id');this[_0x2ef2('0xe')][_0x2ef2('0x13')]=_0x31d2a2;};MailQueue[_0x2ef2('0x12')]['updateRealtime']=function(){this[_0x2ef2('0x15')]=0x0;this[_0x2ef2('0x16')]=0x0;for(var _0x5006e1=0x0;_0x5006e1=0x0?this[_0x2ef2('0x1a')]:0x0;var _0x2d807b={'id':this['id'],'available':this[_0x2ef2('0x1a')],'loggedIn':this[_0x2ef2('0x15')],'name':this[_0x2ef2('0x9')],'paused':this[_0x2ef2('0x16')],'waiting':this['waiting']};var _0x1c6196=md5(JSON[_0x2ef2('0x1b')](_0x2d807b));if(this['md5']!==_0x1c6196){this[_0x2ef2('0x1')]=_0x1c6196;io['to'](util[_0x2ef2('0x1c')](_0x2ef2('0x1d'),_0x2d807b[_0x2ef2('0x9')]))[_0x2ef2('0x1e')](_0x2ef2('0x1f'),_0x2d807b);}};module['exports']=MailQueue; \ No newline at end of file +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 diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 31c69ba..77c3860 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x13e972,_0x3bdbac){var _0x52711a=function(_0x44f121){while(--_0x44f121){_0x13e972['push'](_0x13e972['shift']());}};_0x52711a(++_0x3bdbac);}(_0x814b,0x1a2));var _0xb814=function(_0x12c280,_0x51dd07){_0x12c280=_0x12c280-0x0;var _0x3638d3=_0x814b[_0x12c280];return _0x3638d3;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _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 diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index d1687ca..d9b711a 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 _0xc831=['ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','map','_rr','loggedIn','length','online','smsPause','paused','available','stringify','format','emit','md5','util'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0xc831,0x103));var _0x1c83=function(_0x11bda4,_0x608de6){_0x11bda4=_0x11bda4-0x0;var _0x42110e=_0xc831[_0x11bda4];return _0x42110e;};'use strict';var _=require('lodash');var md5=require(_0x1c83('0x0'));var util=require(_0x1c83('0x1'));var Redis=require(_0x1c83('0x2'));var config=require(_0x1c83('0x3'));config[_0x1c83('0x4')]=_[_0x1c83('0x5')](config[_0x1c83('0x4')],{'host':_0x1c83('0x6'),'port':0x18eb});var io=require(_0x1c83('0x7'))(new Redis(config[_0x1c83('0x4')]));function SmsQueue(_0x4fb4c3){this['id']=_0x4fb4c3['id']||0x0;this['name']=_0x4fb4c3[_0x1c83('0x8')]||'';this['timeout']=_0x4fb4c3[_0x1c83('0x9')]||0xa;this[_0x1c83('0xa')]=_0x4fb4c3[_0x1c83('0xa')]||_0x1c83('0xb');this[_0x1c83('0xc')]=_0x4fb4c3['Agents'];this[_0x1c83('0xd')]={};this[_0x1c83('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0x1c83('0xf')]();}SmsQueue[_0x1c83('0x10')][_0x1c83('0x11')]=function(){var _0x5db682=this[_0x1c83('0xd')]['_rr'];this['mapAgentsId']=_[_0x1c83('0x12')](this[_0x1c83('0xc')],'id');this[_0x1c83('0xd')][_0x1c83('0x13')]=_0x5db682;};SmsQueue[_0x1c83('0x10')][_0x1c83('0xf')]=function(){this[_0x1c83('0x14')]=0x0;this['paused']=0x0;for(var _0x43f74e=0x0;_0x43f74e=0x0?this[_0x1c83('0x19')]:0x0;var _0x1d6027={'id':this['id'],'available':this[_0x1c83('0x19')],'loggedIn':this[_0x1c83('0x14')],'name':this['name'],'paused':this[_0x1c83('0x18')],'waiting':this['waiting']};var _0x2d387d=md5(JSON[_0x1c83('0x1a')](_0x1d6027));if(this['md5']!==_0x2d387d){this[_0x1c83('0x0')]=_0x2d387d;io['to'](util[_0x1c83('0x1b')]('sms:queue:%s',_0x1d6027['name']))[_0x1c83('0x1c')]('sms_queue:save',_0x1d6027);}};module['exports']=SmsQueue; \ No newline at end of file +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 diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 8be0106..2c318d0 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 _0x8138=['../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','md5','util'];(function(_0x101be8,_0x1ea713){var _0x32fb9c=function(_0x375ad3){while(--_0x375ad3){_0x101be8['push'](_0x101be8['shift']());}};_0x32fb9c(++_0x1ea713);}(_0x8138,0x76));var _0x8813=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0x8138[_0x2ff739];return _0x12dc13;};'use strict';var _=require('lodash');var md5=require(_0x8813('0x0'));var util=require(_0x8813('0x1'));var Redis=require('ioredis');var config=require(_0x8813('0x2'));config[_0x8813('0x3')]=_[_0x8813('0x4')](config[_0x8813('0x3')],{'host':_0x8813('0x5'),'port':0x18eb});var io=require(_0x8813('0x6'))(new Redis(config[_0x8813('0x3')]));function WhatsappQueue(_0x1619a0){this['id']=_0x1619a0['id']||0x0;this['name']=_0x1619a0[_0x8813('0x7')]||'';this[_0x8813('0x8')]=_0x1619a0[_0x8813('0x8')]||0xa;this[_0x8813('0x9')]=_0x1619a0[_0x8813('0x9')]||_0x8813('0xa');this[_0x8813('0xb')]=_0x1619a0[_0x8813('0xb')];this[_0x8813('0xc')]={};this['waiting']=0x0;this[_0x8813('0x0')]='';this[_0x8813('0xd')]();this[_0x8813('0xe')]();}WhatsappQueue[_0x8813('0xf')]['updateRouting']=function(){var _0x58a2b2=this[_0x8813('0xc')][_0x8813('0x10')];this['mapAgentsId']=_[_0x8813('0x11')](this[_0x8813('0xb')],'id');this[_0x8813('0xc')][_0x8813('0x10')]=_0x58a2b2;};WhatsappQueue[_0x8813('0xf')][_0x8813('0xe')]=function(){this[_0x8813('0x12')]=0x0;this[_0x8813('0x13')]=0x0;for(var _0x45c2ff=0x0;_0x45c2ff=0x0?this['available']:0x0;var _0x47b810={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8813('0x12')],'name':this['name'],'paused':this[_0x8813('0x13')],'waiting':this[_0x8813('0x18')]};var _0x173dcf=md5(JSON[_0x8813('0x19')](_0x47b810));if(this[_0x8813('0x0')]!==_0x173dcf){this['md5']=_0x173dcf;io['to'](util[_0x8813('0x1a')](_0x8813('0x1b'),_0x47b810['name']))[_0x8813('0x1c')](_0x8813('0x1d'),_0x47b810);}};module['exports']=WhatsappQueue; \ No newline at end of file +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 diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 1f4b7b6..e45590d 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(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_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 diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index a6b0995..366f7f7 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 _0xa4d5=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x4c2905,_0x3c9401){var _0x5595f5=function(_0x3d396f){while(--_0x3d396f){_0x4c2905['push'](_0x4c2905['shift']());}};_0x5595f5(++_0x3c9401);}(_0xa4d5,0x1b8));var _0x5a4d=function(_0x189406,_0x3ce38d){_0x189406=_0x189406-0x0;var _0x180d41=_0xa4d5[_0x189406];return _0x180d41;};'use strict';var client=require('../client');exports[_0x5a4d('0x0')]=function(_0x215cee,_0x2cdb16){return client[_0x5a4d('0x1')](_0x5a4d('0x2'),{'body':_0x2cdb16,'options':{'where':{'id':_0x215cee}},'log':'updateChatInteraction'});};exports[_0x5a4d('0x3')]=function(_0xf66291,_0x41bf17){return client[_0x5a4d('0x1')](_0x5a4d('0x4'),{'body':_0x41bf17,'options':{'where':{'id':_0xf66291}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 099c44c..9b45925 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 _0x4b0c=['createChatMessage','create','CreateChatMessage'];(function(_0x367bb1,_0xb4fffc){var _0x4fbdf6=function(_0x53f430){while(--_0x53f430){_0x367bb1['push'](_0x367bb1['shift']());}};_0x4fbdf6(++_0xb4fffc);}(_0x4b0c,0x109));var _0xc4b0=function(_0x2638c6,_0x545a1d){_0x2638c6=_0x2638c6-0x0;var _0xd9071a=_0x4b0c[_0x2638c6];return _0xd9071a;};'use strict';var client=require('../client');exports[_0xc4b0('0x0')]=function(_0x13637f){return client['Request'](_0xc4b0('0x1'),{'body':_0x13637f,'log':_0xc4b0('0x2')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 57f0a5a..223c4d6 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 _0x10dc=['name','online','chatPause','../client','getChatQueues','GetChatQueue','timeout','strategy','User','Agents'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0x10dc,0x107));var _0xc10d=function(_0x5b734b,_0x486a7f){_0x5b734b=_0x5b734b-0x0;var _0x2a15a3=_0x10dc[_0x5b734b];return _0x2a15a3;};'use strict';var client=require(_0xc10d('0x0'));exports[_0xc10d('0x1')]=function(){return function(){return client['Request'](_0xc10d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xc10d('0x3'),_0xc10d('0x4')],'include':[{'model':_0xc10d('0x5'),'as':_0xc10d('0x6'),'attributes':['id',_0xc10d('0x7'),_0xc10d('0x8'),_0xc10d('0x9')]}]},'log':_0xc10d('0x1')});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 0a53215..71123e2 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 _0xa631=['create','Request','CreateChatQueueReport','UpdateChatQueueReport'];(function(_0x4271ce,_0x4d943c){var _0x8af6a6=function(_0x16fb42){while(--_0x16fb42){_0x4271ce['push'](_0x4271ce['shift']());}};_0x8af6a6(++_0x4d943c);}(_0xa631,0xe4));var _0x1a63=function(_0x1cd023,_0x4fde23){_0x1cd023=_0x1cd023-0x0;var _0x1b3277=_0xa631[_0x1cd023];return _0x1b3277;};'use strict';var client=require('../client');exports[_0x1a63('0x0')]=function(_0x1e771b){return client[_0x1a63('0x1')]('CreateChatQueueReport',{'body':_0x1e771b,'log':_0x1a63('0x2')});};exports['update']=function(_0x536c8d,_0x2d36b7){return client[_0x1a63('0x1')](_0x1a63('0x3'),{'body':_0x2d36b7,'options':{'where':{'uniqueid':_0x536c8d},'order':[['id','DESC']],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index fd71b77..5e337cb 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(_0x4aefa0,_0x242eaa){var _0x17086c=function(_0xbcec1a){while(--_0xbcec1a){_0x4aefa0['push'](_0x4aefa0['shift']());}};_0x17086c(++_0x242eaa);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'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 _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 diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index fbea41b..fd2ef79 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 _0xd2c2=['createFaxMessage','create','Request','CreateFaxMessage'];(function(_0x34bc94,_0x74f0fd){var _0xee41e7=function(_0x424111){while(--_0x424111){_0x34bc94['push'](_0x34bc94['shift']());}};_0xee41e7(++_0x74f0fd);}(_0xd2c2,0xb5));var _0x2d2c=function(_0x56f4f5,_0x126d76){_0x56f4f5=_0x56f4f5-0x0;var _0x3e429f=_0xd2c2[_0x56f4f5];return _0x3e429f;};'use strict';var client=require('../client');exports[_0x2d2c('0x0')]=function(_0x3700f1){return client[_0x2d2c('0x1')](_0x2d2c('0x2'),{'body':_0x3700f1,'log':_0x2d2c('0x3')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 5d32f0d..70949ff 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 _0x50bb=['faxPause','../client','getFaxQueues','Request','GetFaxQueue','timeout','User','Agents','name','online'];(function(_0x3daa8c,_0x388a87){var _0x2b1bd7=function(_0xdb2963){while(--_0xdb2963){_0x3daa8c['push'](_0x3daa8c['shift']());}};_0x2b1bd7(++_0x388a87);}(_0x50bb,0x83));var _0xb50b=function(_0x49f5bc,_0x787382){_0x49f5bc=_0x49f5bc-0x0;var _0x27cc91=_0x50bb[_0x49f5bc];return _0x27cc91;};'use strict';var client=require(_0xb50b('0x0'));exports[_0xb50b('0x1')]=function(){return function(){return client[_0xb50b('0x2')](_0xb50b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xb50b('0x4'),'strategy'],'include':[{'model':_0xb50b('0x5'),'as':_0xb50b('0x6'),'attributes':['id',_0xb50b('0x7'),_0xb50b('0x8'),_0xb50b('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index f367240..1706977 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 _0x99fb=['DESC','UpdateFaxQueueReport','../client','Request','CreateFaxQueueReport','update'];(function(_0x514260,_0x1891e1){var _0x4ac81b=function(_0x53cab1){while(--_0x53cab1){_0x514260['push'](_0x514260['shift']());}};_0x4ac81b(++_0x1891e1);}(_0x99fb,0x92));var _0xb99f=function(_0x3b7c02,_0xdc52bf){_0x3b7c02=_0x3b7c02-0x0;var _0xba2a10=_0x99fb[_0x3b7c02];return _0xba2a10;};'use strict';var client=require(_0xb99f('0x0'));exports['create']=function(_0x18fd1e){return client[_0xb99f('0x1')](_0xb99f('0x2'),{'body':_0x18fd1e,'log':_0xb99f('0x2')});};exports[_0xb99f('0x3')]=function(_0x5891ab,_0x23a1ef){return client[_0xb99f('0x1')]('UpdateFaxQueueReport',{'body':_0x23a1ef,'options':{'where':{'uniqueid':_0x5891ab},'order':[['id',_0xb99f('0x4')]],'limit':0x1},'log':_0xb99f('0x5')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index fe21a3d..c7cf4ab 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 _0x21f8=['Interval','Intervals','interval','../client','getIntervals','GetInterval','name'];(function(_0x538eac,_0x510c4e){var _0x57c447=function(_0x14f5fc){while(--_0x14f5fc){_0x538eac['push'](_0x538eac['shift']());}};_0x57c447(++_0x510c4e);}(_0x21f8,0x11b));var _0x821f=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x21f8[_0x516ffb];return _0x319667;};'use strict';var client=require(_0x821f('0x0'));exports[_0x821f('0x1')]=function(){return function(){return client['Request'](_0x821f('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x821f('0x3')],'include':[{'model':_0x821f('0x4'),'as':_0x821f('0x5'),'attributes':['id','name',_0x821f('0x6')]}]},'log':_0x821f('0x1')});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index f60b37a..8a4e765 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 _0x8aad=['addTagsToChatInteraction','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x2fc5db,_0x2253b1){var _0x1ef11b=function(_0x2846a5){while(--_0x2846a5){_0x2fc5db['push'](_0x2fc5db['shift']());}};_0x1ef11b(++_0x2253b1);}(_0x8aad,0x146));var _0xd8aa=function(_0x5bdac8,_0x17dd0e){_0x5bdac8=_0x5bdac8-0x0;var _0x2b5ddb=_0x8aad[_0x5bdac8];return _0x2b5ddb;};'use strict';var client=require(_0xd8aa('0x0'));exports[_0xd8aa('0x1')]=function(_0x54a6de,_0x11554c){return client['Request'](_0xd8aa('0x2'),{'body':_0x11554c,'options':{'where':{'id':_0x54a6de}},'log':_0xd8aa('0x3')});};exports['addTags']=function(_0x4a4235,_0x401aef){return client['Request']('AddTagsToMailInteraction',{'body':_0x401aef,'options':{'where':{'id':_0x4a4235}},'log':_0xd8aa('0x4')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 6b566fa..e6c514b 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 _0xbb21=['create','Request','CreateMailMessage','createMailMessage','../client'];(function(_0x545e41,_0x55830d){var _0x20ee17=function(_0xac9b17){while(--_0xac9b17){_0x545e41['push'](_0x545e41['shift']());}};_0x20ee17(++_0x55830d);}(_0xbb21,0xa4));var _0x1bb2=function(_0x3ce324,_0x4d5181){_0x3ce324=_0x3ce324-0x0;var _0x4fef6b=_0xbb21[_0x3ce324];return _0x4fef6b;};'use strict';var client=require(_0x1bb2('0x0'));exports[_0x1bb2('0x1')]=function(_0x22f194){return client[_0x1bb2('0x2')](_0x1bb2('0x3'),{'body':_0x22f194,'log':_0x1bb2('0x4')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 2d640cb..1456f41 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 _0xac90=['User','Agents','online','mailPause','../client','getMailQueues','Request','name','timeout','strategy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xac90,0xf4));var _0x0ac9=function(_0x2707ec,_0x537e68){_0x2707ec=_0x2707ec-0x0;var _0x44462b=_0xac90[_0x2707ec];return _0x44462b;};'use strict';var client=require(_0x0ac9('0x0'));exports[_0x0ac9('0x1')]=function(){return function(){return client[_0x0ac9('0x2')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x0ac9('0x3'),_0x0ac9('0x4'),_0x0ac9('0x5')],'include':[{'model':_0x0ac9('0x6'),'as':_0x0ac9('0x7'),'attributes':['id','name',_0x0ac9('0x8'),_0x0ac9('0x9')]}]},'log':_0x0ac9('0x1')});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 8930bb8..5ef7b77 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 _0x6ec8=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x10daa6,_0x25ac90){var _0x548741=function(_0x1712e2){while(--_0x1712e2){_0x10daa6['push'](_0x10daa6['shift']());}};_0x548741(++_0x25ac90);}(_0x6ec8,0x146));var _0x86ec=function(_0xf7a9cf,_0x2cfa33){_0xf7a9cf=_0xf7a9cf-0x0;var _0x7fdc45=_0x6ec8[_0xf7a9cf];return _0x7fdc45;};'use strict';var client=require(_0x86ec('0x0'));exports[_0x86ec('0x1')]=function(_0x10e923){return client[_0x86ec('0x2')](_0x86ec('0x3'),{'body':_0x10e923,'log':_0x86ec('0x3')});};exports[_0x86ec('0x4')]=function(_0x144b76,_0x4b2c27){return client[_0x86ec('0x2')](_0x86ec('0x5'),{'body':_0x4b2c27,'options':{'where':{'uniqueid':_0x144b76},'order':[['id',_0x86ec('0x6')]],'limit':0x1},'log':_0x86ec('0x5')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index b7d2808..db4414a 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 _0xa1f3=['Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xa1f3,0x1b6));var _0x3a1f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa1f3[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x3a1f('0x0'));exports[_0x3a1f('0x1')]=function(_0x5778ed,_0x5611aa){return client[_0x3a1f('0x2')](_0x3a1f('0x3'),{'body':_0x5611aa,'options':{'where':{'id':_0x5778ed}},'log':_0x3a1f('0x4')});};exports[_0x3a1f('0x5')]=function(_0x6c8300,_0x2d1c2e){return client[_0x3a1f('0x2')](_0x3a1f('0x6'),{'body':_0x2d1c2e,'options':{'where':{'id':_0x6c8300}},'log':_0x3a1f('0x7')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 7722cc3..445d323 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 _0xd5d1=['CreateOpenchannelMessage','createOpenchannelMessage','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5d1,0x9e));var _0x1d5d=function(_0x441737,_0x407640){_0x441737=_0x441737-0x0;var _0x44a04f=_0xd5d1[_0x441737];return _0x44a04f;};'use strict';var client=require('../client');exports[_0x1d5d('0x0')]=function(_0x327630){return client[_0x1d5d('0x1')](_0x1d5d('0x2'),{'body':_0x327630,'log':_0x1d5d('0x3')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 014cef4..9bd0af9 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 _0x4433=['strategy','User','name','online','openchannelPause','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0xf0265c,_0x342b49){var _0x3f0494=function(_0x171e61){while(--_0x171e61){_0xf0265c['push'](_0xf0265c['shift']());}};_0x3f0494(++_0x342b49);}(_0x4433,0x17d));var _0x3443=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4433[_0x122ef9];return _0x42fba0;};'use strict';var client=require('../client');exports[_0x3443('0x0')]=function(){return function(){return client[_0x3443('0x1')](_0x3443('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x3443('0x3')],'include':[{'model':_0x3443('0x4'),'as':'Agents','attributes':['id',_0x3443('0x5'),_0x3443('0x6'),_0x3443('0x7')]}]},'log':_0x3443('0x0')});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index aa15b46..67ff66a 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 _0x78bd=['UpdateOpenchannelQueueReport','../client','create','CreateOpenchannelQueueReport','update'];(function(_0x319cb9,_0x4b8d35){var _0x1735fc=function(_0x43b061){while(--_0x43b061){_0x319cb9['push'](_0x319cb9['shift']());}};_0x1735fc(++_0x4b8d35);}(_0x78bd,0x1f0));var _0xd78b=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x78bd[_0x68ee8b];return _0x5148f7;};'use strict';var client=require(_0xd78b('0x0'));exports[_0xd78b('0x1')]=function(_0x475a40){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x475a40,'log':_0xd78b('0x2')});};exports[_0xd78b('0x3')]=function(_0x1e51e5,_0x173577){return client['Request'](_0xd78b('0x4'),{'body':_0x173577,'options':{'where':{'uniqueid':_0x1e51e5},'order':[['id','DESC']],'limit':0x1},'log':_0xd78b('0x4')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 396ca94..1062ded 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 _0x8ccb=['updateSmsInteraction','AddTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x113853,_0x370f6d){var _0x3ff32e=function(_0x4216ae){while(--_0x4216ae){_0x113853['push'](_0x113853['shift']());}};_0x3ff32e(++_0x370f6d);}(_0x8ccb,0x1c4));var _0xb8cc=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x8ccb[_0x5ddaac];return _0x2a9c58;};'use strict';var client=require(_0xb8cc('0x0'));exports[_0xb8cc('0x1')]=function(_0x5e1dc3,_0x1fe9e0){return client[_0xb8cc('0x2')](_0xb8cc('0x3'),{'body':_0x1fe9e0,'options':{'where':{'id':_0x5e1dc3}},'log':_0xb8cc('0x4')});};exports['addTags']=function(_0x4e1ed7,_0x115fdc){return client[_0xb8cc('0x2')](_0xb8cc('0x5'),{'body':_0x115fdc,'options':{'where':{'id':_0x4e1ed7}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 84b1530..396a753 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 _0x932b=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x932b,0x1b3));var _0xb932=function(_0x1a9bdf,_0x43130a){_0x1a9bdf=_0x1a9bdf-0x0;var _0x61a042=_0x932b[_0x1a9bdf];return _0x61a042;};'use strict';var client=require(_0xb932('0x0'));exports[_0xb932('0x1')]=function(_0x5b150b){return client[_0xb932('0x2')](_0xb932('0x3'),{'body':_0x5b150b,'log':_0xb932('0x4')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index a78c1d4..d39c14e 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(_0x242aa3,_0x472c15){var _0x12c5b3=function(_0xe5f0af){while(--_0xe5f0af){_0x242aa3['push'](_0x242aa3['shift']());}};_0x12c5b3(++_0x472c15);}(_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 _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 diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 25adfeb..28cf0e7 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(_0x36d103,_0x221a6c){var _0x37716d=function(_0x57d44a){while(--_0x57d44a){_0x36d103['push'](_0x36d103['shift']());}};_0x37716d(++_0x221a6c);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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(_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 diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 2a64d7a..d50c11e 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(_0x13d58b,_0x4ed10e){var _0x40eca1=function(_0x19b101){while(--_0x19b101){_0x13d58b['push'](_0x13d58b['shift']());}};_0x40eca1(++_0x4ed10e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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(_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 diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index 3cabc4a..7b08267 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 _0x81c6=['update','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction'];(function(_0x1dbeab,_0x1c9ce0){var _0x3bab4d=function(_0x1068d3){while(--_0x1068d3){_0x1dbeab['push'](_0x1dbeab['shift']());}};_0x3bab4d(++_0x1c9ce0);}(_0x81c6,0x1d5));var _0x681c=function(_0x5dfe9b,_0x318b85){_0x5dfe9b=_0x5dfe9b-0x0;var _0x3bb0f4=_0x81c6[_0x5dfe9b];return _0x3bb0f4;};'use strict';var client=require('../client');exports[_0x681c('0x0')]=function(_0x5e54d4,_0x59c03c){return client['Request'](_0x681c('0x1'),{'body':_0x59c03c,'options':{'where':{'id':_0x5e54d4}},'log':_0x681c('0x2')});};exports[_0x681c('0x3')]=function(_0x5566e5,_0x44c18e){return client[_0x681c('0x4')](_0x681c('0x5'),{'body':_0x44c18e,'options':{'where':{'id':_0x5566e5}},'log':_0x681c('0x6')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index c95c9d9..8b84bf7 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 _0xd5b2=['createWhatsappMessage','../client','create','CreateWhatsappMessage'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0xd5b2,0x16d));var _0x2d5b=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xd5b2[_0x433a86];return _0x23000c;};'use strict';var client=require(_0x2d5b('0x0'));exports[_0x2d5b('0x1')]=function(_0x144179){return client['Request'](_0x2d5b('0x2'),{'body':_0x144179,'log':_0x2d5b('0x3')});}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 206b3f4..afcbff4 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 _0xf301=['online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout'];(function(_0x5b3384,_0x1c1da0){var _0x19a2dc=function(_0x5533eb){while(--_0x5533eb){_0x5b3384['push'](_0x5b3384['shift']());}};_0x19a2dc(++_0x1c1da0);}(_0xf301,0x162));var _0x1f30=function(_0x59e020,_0x50991a){_0x59e020=_0x59e020-0x0;var _0x1c2b4b=_0xf301[_0x59e020];return _0x1c2b4b;};'use strict';var client=require(_0x1f30('0x0'));exports[_0x1f30('0x1')]=function(){return function(){return client[_0x1f30('0x2')](_0x1f30('0x3'),{'options':{'raw':![],'attributes':['id',_0x1f30('0x4'),_0x1f30('0x5'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x1f30('0x4'),_0x1f30('0x6'),_0x1f30('0x7')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +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 diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index a486e08..0297ec2 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 _0x55cf=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x55cf,0x19f));var _0xf55c=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0x55cf[_0x1cd674];return _0x27928f;};'use strict';var client=require(_0xf55c('0x0'));exports[_0xf55c('0x1')]=function(_0x490536){return client[_0xf55c('0x2')](_0xf55c('0x3'),{'body':_0x490536,'log':'CreateWhatsappQueueReport'});};exports[_0xf55c('0x4')]=function(_0x4e280e,_0x29f75d){return client[_0xf55c('0x2')](_0xf55c('0x5'),{'body':_0x29f75d,'options':{'where':{'uniqueid':_0x4e280e},'order':[['id',_0xf55c('0x6')]],'limit':0x1},'log':_0xf55c('0x5')});}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 5f8ff3d..6467ab5 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 _0x6780=['message','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','complete','[%s][AGENT]\x20ROUTING\x20END','close','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','routing','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','error','[%s][AGENT]\x20%s','map'];(function(_0x44d502,_0x4f2399){var _0x49c856=function(_0x17f04f){while(--_0x17f04f){_0x44d502['push'](_0x44d502['shift']());}};_0x49c856(++_0x4f2399);}(_0x6780,0x1e6));var _0x0678=function(_0x1f76ac,_0x476dbd){_0x1f76ac=_0x1f76ac-0x0;var _0x155353=_0x6780[_0x1f76ac];return _0x155353;};'use strict';var schema=require(_0x0678('0x0'));var _=require(_0x0678('0x1'));var util=require(_0x0678('0x2'));var seqqueue=require(_0x0678('0x3'));var logger=require(_0x0678('0x4'))(_0x0678('0x5'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x0678('0x6'),'required':!![],'message':_0x0678('0x7')},'timeout':{'type':'number','message':_0x0678('0x8')}});function writeLog(_0x15fc97,_0x1fe05a,_0x5760ba){return logger[_0x0678('0x9')](util[_0x0678('0xa')](_0x0678('0xb'),_0x15fc97,_0x1fe05a[_0x0678('0xc')],_0x5760ba));}function handleFindAgent(_0xbf27ea){return function(_0x17e60a){return _0x17e60a[_0x0678('0xc')][_0x0678('0xd')]()===_0xbf27ea[_0x0678('0xd')]();};}exports[_0x0678('0xe')]=function(_0x13b4d2,_0x1fbb37,_0x3c7236,_0x58451b){return function(_0x2c644c){try{var _0xc1de99={'name':_0x1fbb37[0x0],'timeout':_0x1fbb37[0x1]};var _0xc0275e=queue[_0x0678('0x0')](_0xc1de99,{'typecast':!![]});if(_0xc0275e['length']){logger[_0x0678('0xf')](_0x0678('0x10'),_0x13b4d2,_[_0x0678('0x11')](_0xc0275e,_0x0678('0x12'))['join'](',\x20'));_0x2c644c[_0x0678('0x13')]();}else{var _0x3164c7=_[_0x0678('0x14')](_0x3c7236[_0x0678('0x15')],handleFindAgent(_0xc1de99[_0x0678('0xc')]));if(_0x3164c7){var _0x3c51c0=(_0xc1de99[_0x0678('0x16')]||0xa)*0x3e8;var _0x347b39,_0x327af9;var _0x453876=seqqueue[_0x0678('0x17')](_0x3c51c0);_0x453876['id']=_0x13b4d2;_0x453876[_0x0678('0x18')]=_0x3c51c0;_0x453876[_0x0678('0x19')]=_0x58451b['channel'];writeLog(_0x13b4d2,_0x3164c7,util[_0x0678('0xa')](_0x0678('0x1a'),_0x3c51c0));_0x3c7236[_0x0678('0x1b')][_0x13b4d2]['on']('end',function(){logger[_0x0678('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x13b4d2);clearTimeout(_0x327af9);_0x327af9=undefined;_0x453876['close']();if(_0x3c7236[_0x0678('0x1b')][_0x13b4d2]){delete _0x3c7236[_0x0678('0x1b')][_0x13b4d2];}_0x2c644c[_0x0678('0x13')]();});_0x3c7236[_0x0678('0x1b')][_0x13b4d2]['on'](_0x0678('0x1c'),function(){if(_0x3c7236['rules'][_0x13b4d2]){delete _0x3c7236[_0x0678('0x1b')][_0x13b4d2];}});_0x327af9=setTimeout(function(){logger[_0x0678('0x9')](_0x0678('0x1d'),_0x13b4d2);clearTimeout(_0x327af9);_0x453876[_0x0678('0x1e')]();_0x2c644c['next']();},_0x3c51c0);strategy[_0x0678('0x1f')](_0x453876,_0x3164c7,_0x3c7236,_0x58451b);}else{logger[_0x0678('0xf')](_0x0678('0x20'),_0x13b4d2,_0xc1de99[_0x0678('0xc')]);_0x2c644c[_0x0678('0x13')]();}}}catch(_0x2ff341){console[_0x0678('0x21')](_0x2ff341);logger[_0x0678('0xf')](_0x0678('0x22'),_0x13b4d2,_0x2ff341[_0x0678('0x23')]);_0x2c644c[_0x0678('0x13')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index e5d538c..c4bfdcd 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 _0xf1f1=['routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','Message','create','info','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerName','providerResponse','then','dialogState','moment','aws-sdk','./utils','../../../../config/logger'];(function(_0x1ef936,_0x213311){var _0x3a3a58=function(_0x40d56c){while(--_0x40d56c){_0x1ef936['push'](_0x1ef936['shift']());}};_0x3a3a58(++_0x213311);}(_0xf1f1,0x1d0));var _0x1f1f=function(_0x122565,_0x125500){_0x122565=_0x122565-0x0;var _0x53f3a5=_0xf1f1[_0x122565];return _0x53f3a5;};'use strict';var _=require('lodash');var moment=require(_0x1f1f('0x0'));var AWS=require(_0x1f1f('0x1'));var utils=require(_0x1f1f('0x2'));var logger=require(_0x1f1f('0x3'))(_0x1f1f('0x4'));var rpc={'chatMessage':require(_0x1f1f('0x5')),'openchannelMessage':require(_0x1f1f('0x6')),'mailMessage':require(_0x1f1f('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x1f1f('0x8')),'whatsappMessage':require(_0x1f1f('0x9'))};exports[_0x1f1f('0xa')]=function(_0x17a159,_0x3fd110){return function(_0x502c6d){try{if(!_['isNil'](this[_0x1f1f('0xb')][_0x1f1f('0xc')])){logger['info'](_0x1f1f('0xd'),_0x17a159,_0x1f1f('0xe'));return _0x502c6d[_0x1f1f('0xf')]();}var _0x1d4896={'ContactId':this[_0x1f1f('0x10')]['id'],'sentAt':moment()[_0x1f1f('0x11')](_0x1f1f('0x12')),'direction':_0x1f1f('0x13')};if(this[_0x1f1f('0x14')]===_0x1f1f('0x15')||this[_0x1f1f('0x14')]===_0x1f1f('0x16')){_0x1d4896[_0x1f1f('0x17')]=this[_0x1f1f('0xb')][_0x1f1f('0x17')];}var _0x2eb186=this['channel'];if(_0x2eb186===_0x1f1f('0x18')){_0x1d4896[_0x1f1f('0x19')]=this['account']['id'];}else{_0x1d4896[_['upperFirst'](_0x2eb186)+_0x1f1f('0x1a')]=this[_0x1f1f('0x1b')]['id'];}_0x1d4896[_[_0x1f1f('0x1c')](_0x2eb186)+_0x1f1f('0x1d')]=this['interaction']['id'];if(this[_0x1f1f('0xb')]['created']){var _0x3e5877=_0x3fd110[0x4];if(!_[_0x1f1f('0x1e')](_0x3e5877)){_0x1d4896[_0x1f1f('0x1f')]=utils[_0x1f1f('0x20')](_0x3e5877,this);return rpc[_0x2eb186+_0x1f1f('0x21')][_0x1f1f('0x22')](_0x1d4896)['then'](function(_0x54018b){logger[_0x1f1f('0x23')](_0x1f1f('0xd'),_0x17a159,_0x1d4896['body']);})[_0x1f1f('0x24')](function(_0x40cabd){logger[_0x1f1f('0x25')](_0x1f1f('0xd'),_0x17a159,JSON[_0x1f1f('0x26')](_0x40cabd));})[_0x1f1f('0x27')](function(){logger[_0x1f1f('0x23')](_0x1f1f('0x28'),_0x17a159);_0x502c6d[_0x1f1f('0x29')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x17a159);_0x502c6d['stop']();}}else{var _0x5d1e78=this;var _0x2cb3c0=new AWS[(_0x1f1f('0x2a'))]({'accessKeyId':_0x3fd110[0x0],'secretAccessKey':_0x3fd110[0x1],'region':_0x3fd110[0x2]});var _0x49d64d={'botAlias':_0x1f1f('0x2b'),'botName':_0x3fd110[0x3],'inputText':this[_0x1f1f('0x2c')][_0x1f1f('0x1f')],'userId':this['channel']+':'+this[_0x1f1f('0xb')]['id'][_0x1f1f('0x2d')]()};_0x2cb3c0[_0x1f1f('0x2e')](_0x49d64d,function(_0x4e800d,_0x5d8596){if(_0x4e800d){logger[_0x1f1f('0x25')](_0x1f1f('0xd'),_0x17a159,_0x4e800d[_0x1f1f('0x2c')]);_0x502c6d[_0x1f1f('0xf')]();}else if(_0x5d8596&&_0x5d8596[_0x1f1f('0x2c')]){_0x5d1e78[_0x1f1f('0x1f')][_0x1f1f('0x2f')]=_0x5d8596;_0x1d4896[_0x1f1f('0x1f')]=_0x5d8596[_0x1f1f('0x2c')];_0x1d4896[_0x1f1f('0x30')]=_0x1f1f('0x2f');_0x1d4896[_0x1f1f('0x31')]=JSON['stringify'](_0x5d8596);return rpc[_0x2eb186+_0x1f1f('0x21')][_0x1f1f('0x22')](_0x1d4896)[_0x1f1f('0x32')](function(_0x21653c){logger['info'](_0x1f1f('0xd'),_0x17a159,_0x1d4896['body']);if(_0x5d8596[_0x1f1f('0x33')]=='Failed'){_0x502c6d[_0x1f1f('0xf')]();}else{_0x502c6d[_0x1f1f('0x29')]();}})[_0x1f1f('0x24')](function(_0x15a288){logger[_0x1f1f('0x25')](_0x1f1f('0xd'),_0x17a159,JSON[_0x1f1f('0x26')](_0x15a288));_0x502c6d[_0x1f1f('0xf')]();});}else{_0x502c6d['next']();}});}}catch(_0x98f264){logger[_0x1f1f('0x25')](_0x1f1f('0xd'),_0x17a159,JSON[_0x1f1f('0x26')](_0x98f264));_0x502c6d['stop']();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/autoreply.js b/server/services/routing/server/applications/autoreply.js index 9a058e1..9897e5b 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 _0x028c=['../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','YYYY-MM-DD\x20HH:mm:ss','out','mail','getMustacheRender','message','from','subject','startsWith','Re:','Re:\x20','chat','AccountId','upperFirst','InteractionId','Message','account','Smtp','service','host','port','secure','authentication','auth','inReplyTo','messageId','html','','','headers','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction'];(function(_0xde5fa,_0x42d542){var _0x4f4387=function(_0x8d3090){while(--_0x8d3090){_0xde5fa['push'](_0xde5fa['shift']());}};_0x4f4387(++_0x42d542);}(_0x028c,0x91));var _0xc028=function(_0x5a7d41,_0x4447e2){_0x5a7d41=_0x5a7d41-0x0;var _0x98d8fa=_0x028c[_0x5a7d41];return _0x98d8fa;};'use strict';var _=require(_0xc028('0x0'));var moment=require(_0xc028('0x1'));var utils=require(_0xc028('0x2'));var logger=require(_0xc028('0x3'))(_0xc028('0x4'));var rpc={'chatMessage':require(_0xc028('0x5')),'openchannelMessage':require(_0xc028('0x6')),'mailMessage':require(_0xc028('0x7')),'smsMessage':require(_0xc028('0x8')),'faxMessage':require(_0xc028('0x9')),'whatsappMessage':require(_0xc028('0xa')),'chatInteraction':require(_0xc028('0xb')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xc028('0xc')),'smsInteraction':require(_0xc028('0xd')),'faxInteraction':require(_0xc028('0xe')),'whatsappInteraction':require(_0xc028('0xf'))};var mailRpc=require(_0xc028('0x10'));exports[_0xc028('0x11')]=function(_0x5aa67b,_0x223e78,_0x23f268,_0x549cdd){return function(_0x4d3a2b){try{var _0x10dfb8=this[_0xc028('0x12')];if(_0x10dfb8==='mail'&&_0x549cdd[_0xc028('0x13')][_0xc028('0x14')]){logger[_0xc028('0x15')](_0xc028('0x16'),_0x5aa67b,_0xc028('0x17'));return _0x4d3a2b['next']();}if(_0x223e78[0x0]==='1'&&(_[_0xc028('0x18')](this[_0xc028('0x19')]['created'])||!this['interaction'][_0xc028('0x1a')])){logger[_0xc028('0x15')](_0xc028('0x16'),_0x5aa67b,_0xc028('0x1b'));return _0x4d3a2b[_0xc028('0x1c')]();}if(_0x223e78[0x0]==='2'&&this[_0xc028('0x19')][_0xc028('0x1d')]){logger[_0xc028('0x15')](_0xc028('0x1e'),_0x5aa67b,_0xc028('0x1f'));return _0x4d3a2b[_0xc028('0x1c')]();}var _0x5dc3b1={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xc028('0x20')),'direction':_0xc028('0x21')};if(this['channel']===_0xc028('0x22')){_0x5dc3b1[_0xc028('0x13')]=utils[_0xc028('0x23')](_0x223e78[0x2],this);}else{_0x5dc3b1['body']=utils[_0xc028('0x23')](_0x223e78[0x1],this);}if(this[_0xc028('0x24')]){_0x5dc3b1['to']=this[_0xc028('0x24')]['from']||'';if(this[_0xc028('0x12')]===_0xc028('0x22')&&_0x223e78[0x1]==='1'){_0x5dc3b1['cc']=this['message']['cc']||'';}_0x5dc3b1[_0xc028('0x25')]=this[_0xc028('0x24')]['to']||'';_0x5dc3b1['phone']=this['message']['phone']||'';_0x5dc3b1['read']=!![];if(this[_0xc028('0x24')][_0xc028('0x26')]){_0x5dc3b1['subject']='';_0x5dc3b1[_0xc028('0x26')]+=_[_0xc028('0x27')](this['message'][_0xc028('0x26')],_0xc028('0x28'))?'':_0xc028('0x29');_0x5dc3b1[_0xc028('0x26')]+=this[_0xc028('0x24')][_0xc028('0x26')];}}if(this[_0xc028('0x12')]===_0xc028('0x2a')){_0x5dc3b1['ChatWebsiteId']=this['account']['id'];}else{_0x5dc3b1[_['upperFirst'](this[_0xc028('0x12')])+_0xc028('0x2b')]=this['account']['id'];}_0x5dc3b1[_[_0xc028('0x2c')](this[_0xc028('0x12')])+_0xc028('0x2d')]=this[_0xc028('0x19')]['id'];var _0x22fb34=this[_0xc028('0x19')];if(rpc[this[_0xc028('0x12')]+_0xc028('0x2e')]){if(this['channel']===_0xc028('0x22')){var _0x17cf7a={'tls':{'rejectUnauthorized':![]}};if(this[_0xc028('0x2f')][_0xc028('0x30')]['service']){_0x17cf7a[_0xc028('0x31')]=this[_0xc028('0x2f')][_0xc028('0x30')][_0xc028('0x31')];}else{_0x17cf7a[_0xc028('0x32')]=this[_0xc028('0x2f')][_0xc028('0x30')][_0xc028('0x32')];_0x17cf7a[_0xc028('0x33')]=this[_0xc028('0x2f')]['Smtp'][_0xc028('0x33')];_0x17cf7a[_0xc028('0x34')]=this[_0xc028('0x2f')][_0xc028('0x30')][_0xc028('0x34')];}if(this[_0xc028('0x2f')][_0xc028('0x30')][_0xc028('0x35')]){_0x17cf7a[_0xc028('0x36')]={'user':this[_0xc028('0x2f')][_0xc028('0x30')]['user'],'pass':this['account'][_0xc028('0x30')]['pass']};}_0x5dc3b1[_0xc028('0x37')]=this[_0xc028('0x24')][_0xc028('0x38')];_0x5dc3b1[_0xc028('0x39')]=_0xc028('0x3a')+_['replace'](_0x5dc3b1[_0xc028('0x13')],_0xc028('0x3b'),_0xc028('0x3c'))+_0xc028('0x3d');_0x5dc3b1[_0xc028('0x3e')]={'Auto-Submitted':_0xc028('0x3f'),'X-Auto-Response-Suppress':_0xc028('0x40'),'Precedence':_0xc028('0x41')};return mailRpc[_0xc028('0x42')](_0x17cf7a,_0x5dc3b1)[_0xc028('0x43')](function(_0x21ad27){logger[_0xc028('0x15')](_0xc028('0x44'),_0x5aa67b);_0x5dc3b1['messageId']=_0x21ad27['message'][_0xc028('0x38')];return rpc[_0x10dfb8+'Message'][_0xc028('0x45')](_0x5dc3b1);})[_0xc028('0x43')](function(_0x2cca4b){logger[_0xc028('0x15')](_0xc028('0x16'),_0x5aa67b,JSON[_0xc028('0x46')](_0x2cca4b));})[_0xc028('0x47')](function(_0x210544){logger[_0xc028('0x48')](_0xc028('0x49'),_0x5aa67b,JSON[_0xc028('0x46')](_0x210544));})[_0xc028('0x4a')](function(){Promise[_0xc028('0x4b')]()[_0xc028('0x43')](function(){if(_0x223e78[0x0]!=='2'||_0x22fb34[_0xc028('0x1d')])return;return rpc[_0x10dfb8+_0xc028('0x4c')][_0xc028('0x4d')](_0x22fb34['id'],{'autoreplyExecuted':!![]})[_0xc028('0x43')](function(_0x34bcd5){logger[_0xc028('0x15')](_0xc028('0x1e'),_0x5aa67b,JSON[_0xc028('0x46')](_0x34bcd5));})[_0xc028('0x47')](function(_0x39b0f0){logger[_0xc028('0x48')](_0xc028('0x4e'),_0x5aa67b,JSON[_0xc028('0x46')](_0x39b0f0));});})[_0xc028('0x43')](function(){_0x4d3a2b[_0xc028('0x1c')]();});});}else{return rpc[this[_0xc028('0x12')]+_0xc028('0x2e')][_0xc028('0x45')](_0x5dc3b1)[_0xc028('0x43')](function(_0xed6240){logger['info'](_0xc028('0x16'),_0x5aa67b,_0x5dc3b1[_0xc028('0x13')]);})['catch'](function(_0x5b8fa5){logger[_0xc028('0x48')]('[%s][AUTOREPLY]\x20%s',_0x5aa67b,JSON[_0xc028('0x46')](_0x5b8fa5));})[_0xc028('0x4a')](function(){Promise[_0xc028('0x4b')]()['then'](function(){if(_0x223e78[0x0]!=='2'||_0x22fb34[_0xc028('0x1d')])return;return rpc[_0x10dfb8+_0xc028('0x4c')][_0xc028('0x4d')](_0x22fb34['id'],{'autoreplyExecuted':!![]})[_0xc028('0x43')](function(_0xfa3962){logger[_0xc028('0x15')](_0xc028('0x1e'),_0x5aa67b,JSON[_0xc028('0x46')](_0xfa3962));})[_0xc028('0x47')](function(_0x81c350){logger[_0xc028('0x48')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5aa67b,JSON['stringify'](_0x81c350));});})[_0xc028('0x43')](function(){_0x4d3a2b[_0xc028('0x1c')]();});});}}}catch(_0x52e413){logger[_0xc028('0x48')](_0xc028('0x16'),_0x5aa67b,JSON[_0xc028('0x46')](_0x52e413));_0x4d3a2b[_0xc028('0x4f')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 608f29e..9ad10e2 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe46e=['../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','stop','error','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction'];(function(_0x5e57d4,_0x43f851){var _0x5a8e10=function(_0x2336b9){while(--_0x2336b9){_0x5e57d4['push'](_0x5e57d4['shift']());}};_0x5a8e10(++_0x43f851);}(_0xe46e,0x104));var _0xee46=function(_0x23671d,_0x1e786c){_0x23671d=_0x23671d-0x0;var _0x543a7f=_0xe46e[_0x23671d];return _0x543a7f;};'use strict';var moment=require('moment');var logger=require(_0xee46('0x0'))('routing');var rpc={'chatInteraction':require(_0xee46('0x1')),'openchannelInteraction':require(_0xee46('0x2')),'smsInteraction':require(_0xee46('0x3')),'mailInteraction':require(_0xee46('0x4')),'faxInteraction':require(_0xee46('0x5')),'whatsappInteraction':require(_0xee46('0x6'))};exports[_0xee46('0x7')]=function(_0x20624e,_0x150145,_0x2c3033,_0x466511){return function(_0x4ecb66){try{logger[_0xee46('0x8')](_0xee46('0x9'),_0x20624e,_0x150145[0x0]);var _0x24cd15={'closed':0x1,'closedAt':moment()[_0xee46('0xa')](_0xee46('0xb')),'closeReason':_0xee46('0xc'),'disposition':_0x150145[0x0]};if(rpc[_0x466511['channel']+_0xee46('0xd')]){rpc[_0x466511['channel']+_0xee46('0xd')]['update'](_0x466511[_0xee46('0xe')]['id'],_0x24cd15)['then'](function(_0x1ccf97){logger[_0xee46('0x8')](_0xee46('0xf'),_0x20624e,_0x466511[_0xee46('0xe')]['id']);})[_0xee46('0x10')](function(_0x11eee1){logger['error'](_0xee46('0x11'),_0x20624e,JSON[_0xee46('0x12')](_0x11eee1));})[_0xee46('0x13')](function(){_0x4ecb66[_0xee46('0x14')]();});}}catch(_0x3bf751){logger[_0xee46('0x15')](_0xee46('0x11'),_0x20624e,JSON[_0xee46('0x12')](_0x3bf751));_0x4ecb66['stop']();}};}; \ No newline at end of file +var _0xc636=['channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','../../rpc/smsInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system'];(function(_0x405bb2,_0x4d6e95){var _0x44d0c3=function(_0x26a8a5){while(--_0x26a8a5){_0x405bb2['push'](_0x405bb2['shift']());}};_0x44d0c3(++_0x4d6e95);}(_0xc636,0x8f));var _0x6c63=function(_0x5921d0,_0x3b343f){_0x5921d0=_0x5921d0-0x0;var _0x312844=_0xc636[_0x5921d0];return _0x312844;};'use strict';var moment=require(_0x6c63('0x0'));var logger=require(_0x6c63('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x6c63('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x6c63('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x3728f7,_0x4f6a74,_0x37b06d,_0x9c9f7f){return function(_0x1fc125){try{logger[_0x6c63('0x4')](_0x6c63('0x5'),_0x3728f7,_0x4f6a74[0x0]);var _0x3eb8b7={'closed':0x1,'closedAt':moment()[_0x6c63('0x6')](_0x6c63('0x7')),'closeReason':_0x6c63('0x8'),'disposition':_0x4f6a74[0x0]};if(rpc[_0x9c9f7f[_0x6c63('0x9')]+_0x6c63('0xa')]){rpc[_0x9c9f7f['channel']+'Interaction'][_0x6c63('0xb')](_0x9c9f7f['interaction']['id'],_0x3eb8b7)[_0x6c63('0xc')](function(_0x1a6aa0){logger[_0x6c63('0x4')](_0x6c63('0xd'),_0x3728f7,_0x9c9f7f[_0x6c63('0xe')]['id']);})[_0x6c63('0xf')](function(_0x2cb1e7){logger[_0x6c63('0x10')]('[%s][CLOSE]\x20%s',_0x3728f7,JSON['stringify'](_0x2cb1e7));})['finally'](function(){_0x1fc125[_0x6c63('0x11')]();});}}catch(_0x1989ac){logger[_0x6c63('0x10')](_0x6c63('0x12'),_0x3728f7,JSON['stringify'](_0x1989ac));_0x1fc125['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index fd3a2c1..0b4bd94 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb073=['md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','chat','account','upperFirst','AccountId','InteractionId','created','Message','create','catch','error','stringify','finally','info','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','body','then','fulfillment','providerName','dialogflow','providerResponse','result','metadata','endConversation','message','moment'];(function(_0x122520,_0x57ff93){var _0x176d87=function(_0x333edf){while(--_0x333edf){_0x122520['push'](_0x122520['shift']());}};_0x176d87(++_0x57ff93);}(_0xb073,0x187));var _0x3b07=function(_0x4238b7,_0x385810){_0x4238b7=_0x4238b7-0x0;var _0x4e9ccc=_0xb073[_0x4238b7];return _0x4e9ccc;};'use strict';var _=require('lodash');var moment=require(_0x3b07('0x0'));var apiai=require('apiai-promise');var md5=require(_0x3b07('0x1'));var utils=require(_0x3b07('0x2'));var logger=require(_0x3b07('0x3'))('routing');var rpc={'chatMessage':require(_0x3b07('0x4')),'openchannelMessage':require(_0x3b07('0x5')),'mailMessage':require(_0x3b07('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3b07('0x7')),'whatsappMessage':require(_0x3b07('0x8'))};exports[_0x3b07('0x9')]=function(_0x2c1ac2,_0x46ac51){return function(_0x3f8b8f){try{if(!_[_0x3b07('0xa')](this[_0x3b07('0xb')]['UserId'])){logger['info'](_0x3b07('0xc'),_0x2c1ac2,_0x3b07('0xd'));return _0x3f8b8f[_0x3b07('0xe')]();}var _0xf22a0d={'ContactId':this[_0x3b07('0xf')]['id'],'sentAt':moment()[_0x3b07('0x10')](_0x3b07('0x11')),'direction':_0x3b07('0x12')};if(this[_0x3b07('0x13')]===_0x3b07('0x14')||this[_0x3b07('0x13')]==='whatsapp'){_0xf22a0d['phone']=this[_0x3b07('0xb')][_0x3b07('0x15')];}var _0x277bc6=this['channel'];if(_0x277bc6===_0x3b07('0x16')){_0xf22a0d['ChatWebsiteId']=this[_0x3b07('0x17')]['id'];}else{_0xf22a0d[_[_0x3b07('0x18')](_0x277bc6)+_0x3b07('0x19')]=this[_0x3b07('0x17')]['id'];}_0xf22a0d[_[_0x3b07('0x18')](_0x277bc6)+_0x3b07('0x1a')]=this[_0x3b07('0xb')]['id'];if(this[_0x3b07('0xb')][_0x3b07('0x1b')]){var _0x268f0b=_0x46ac51[0x2];if(!_['isEmpty'](_0x268f0b)){_0xf22a0d['body']=utils['getMustacheRender'](_0x268f0b,this);return rpc[_0x277bc6+_0x3b07('0x1c')][_0x3b07('0x1d')](_0xf22a0d)['then'](function(_0x56a531){logger['info'](_0x3b07('0xc'),_0x2c1ac2,_0xf22a0d['body']);})[_0x3b07('0x1e')](function(_0x3c5e7d){logger[_0x3b07('0x1f')](_0x3b07('0xc'),_0x2c1ac2,JSON[_0x3b07('0x20')](_0x3c5e7d));})[_0x3b07('0x21')](function(){logger[_0x3b07('0x22')](_0x3b07('0x23'),_0x2c1ac2);_0x3f8b8f[_0x3b07('0x24')]();});}else{logger[_0x3b07('0x22')](_0x3b07('0x25'),_0x2c1ac2);_0x3f8b8f['stop']();}}else{var _0x31bd0f=this;var _0x4c7117=apiai(_0x46ac51[0x0],{'language':_0x46ac51[0x1]||'en'});return _0x4c7117[_0x3b07('0x26')](this['message'][_0x3b07('0x27')],{'sessionId':md5(this['interaction']['id'])})[_0x3b07('0x28')](function(_0x1e9d62){_0x31bd0f[_0x3b07('0x27')]['dialogflow']=_0x1e9d62;_0xf22a0d[_0x3b07('0x27')]=_0x1e9d62['result'][_0x3b07('0x29')]['speech'];_0xf22a0d[_0x3b07('0x2a')]=_0x3b07('0x2b');_0xf22a0d[_0x3b07('0x2c')]=JSON[_0x3b07('0x20')](_0x1e9d62);return rpc[_0x277bc6+_0x3b07('0x1c')][_0x3b07('0x1d')](_0xf22a0d)[_0x3b07('0x28')](function(_0x4a67c3){logger[_0x3b07('0x22')](_0x3b07('0xc'),_0x2c1ac2,_0xf22a0d[_0x3b07('0x27')]);if(_0x1e9d62[_0x3b07('0x2d')][_0x3b07('0x2e')][_0x3b07('0x2f')]){_0x3f8b8f['next']();}else{_0x3f8b8f['stop']();}})['catch'](function(_0x527ac9){logger[_0x3b07('0x1f')](_0x3b07('0xc'),_0x2c1ac2,JSON[_0x3b07('0x20')](_0x527ac9));_0x3f8b8f[_0x3b07('0xe')]();});})[_0x3b07('0x1e')](function(_0x4491f2){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x2c1ac2,_0x4491f2[_0x3b07('0x30')]);_0x3f8b8f[_0x3b07('0xe')]();});}}catch(_0xf1c54){logger['error'](_0x3b07('0xc'),_0x2c1ac2,JSON[_0x3b07('0x20')](_0xf1c54));_0x3f8b8f[_0x3b07('0x24')]();}};}; \ No newline at end of file +var _0xed54=['finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','dialogflow','result','fulfillment','speech','providerResponse','next','catch','message','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','error','stringify'];(function(_0xbb3ccc,_0x38dee5){var _0x1535c4=function(_0x5d8238){while(--_0x5d8238){_0xbb3ccc['push'](_0xbb3ccc['shift']());}};_0x1535c4(++_0x38dee5);}(_0xed54,0xfc));var _0x4ed5=function(_0x33e8fb,_0x108f88){_0x33e8fb=_0x33e8fb-0x0;var _0x4cd11b=_0xed54[_0x33e8fb];return _0x4cd11b;};'use strict';var _=require('lodash');var moment=require(_0x4ed5('0x0'));var apiai=require(_0x4ed5('0x1'));var md5=require(_0x4ed5('0x2'));var utils=require(_0x4ed5('0x3'));var logger=require('../../../../config/logger')(_0x4ed5('0x4'));var rpc={'chatMessage':require(_0x4ed5('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4ed5('0x6')),'faxMessage':require(_0x4ed5('0x7')),'whatsappMessage':require(_0x4ed5('0x8'))};exports[_0x4ed5('0x9')]=function(_0x32b0b3,_0x406871){return function(_0x499db9){try{if(!_['isNil'](this[_0x4ed5('0xa')][_0x4ed5('0xb')])){logger[_0x4ed5('0xc')](_0x4ed5('0xd'),_0x32b0b3,_0x4ed5('0xe'));return _0x499db9['next']();}var _0x23f1db={'ContactId':this[_0x4ed5('0xf')]['id'],'sentAt':moment()[_0x4ed5('0x10')](_0x4ed5('0x11')),'direction':_0x4ed5('0x12')};if(this['channel']===_0x4ed5('0x13')||this[_0x4ed5('0x14')]===_0x4ed5('0x15')){_0x23f1db[_0x4ed5('0x16')]=this[_0x4ed5('0xa')][_0x4ed5('0x16')];}var _0x2faa29=this[_0x4ed5('0x14')];if(_0x2faa29==='chat'){_0x23f1db['ChatWebsiteId']=this[_0x4ed5('0x17')]['id'];}else{_0x23f1db[_[_0x4ed5('0x18')](_0x2faa29)+_0x4ed5('0x19')]=this[_0x4ed5('0x17')]['id'];}_0x23f1db[_[_0x4ed5('0x18')](_0x2faa29)+_0x4ed5('0x1a')]=this[_0x4ed5('0xa')]['id'];if(this[_0x4ed5('0xa')][_0x4ed5('0x1b')]){var _0x218134=_0x406871[0x2];if(!_[_0x4ed5('0x1c')](_0x218134)){_0x23f1db[_0x4ed5('0x1d')]=utils[_0x4ed5('0x1e')](_0x218134,this);return rpc[_0x2faa29+_0x4ed5('0x1f')][_0x4ed5('0x20')](_0x23f1db)[_0x4ed5('0x21')](function(_0x584745){logger[_0x4ed5('0xc')](_0x4ed5('0xd'),_0x32b0b3,_0x23f1db[_0x4ed5('0x1d')]);})['catch'](function(_0x347bda){logger[_0x4ed5('0x22')](_0x4ed5('0xd'),_0x32b0b3,JSON[_0x4ed5('0x23')](_0x347bda));})[_0x4ed5('0x24')](function(){logger[_0x4ed5('0xc')](_0x4ed5('0x25'),_0x32b0b3);_0x499db9[_0x4ed5('0x26')]();});}else{logger['info'](_0x4ed5('0x27'),_0x32b0b3);_0x499db9[_0x4ed5('0x26')]();}}else{var _0x4f59d2=this;var _0x32d181=apiai(_0x406871[0x0],{'language':_0x406871[0x1]||'en'});return _0x32d181['textRequest'](this['message']['body'],{'sessionId':md5(this[_0x4ed5('0xa')]['id'])})['then'](function(_0x367593){_0x4f59d2[_0x4ed5('0x1d')][_0x4ed5('0x28')]=_0x367593;_0x23f1db[_0x4ed5('0x1d')]=_0x367593[_0x4ed5('0x29')][_0x4ed5('0x2a')][_0x4ed5('0x2b')];_0x23f1db['providerName']=_0x4ed5('0x28');_0x23f1db[_0x4ed5('0x2c')]=JSON[_0x4ed5('0x23')](_0x367593);return rpc[_0x2faa29+_0x4ed5('0x1f')][_0x4ed5('0x20')](_0x23f1db)['then'](function(_0x1dc880){logger[_0x4ed5('0xc')](_0x4ed5('0xd'),_0x32b0b3,_0x23f1db['body']);if(_0x367593[_0x4ed5('0x29')]['metadata']['endConversation']){_0x499db9[_0x4ed5('0x2d')]();}else{_0x499db9[_0x4ed5('0x26')]();}})['catch'](function(_0x3cfcb1){logger[_0x4ed5('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x32b0b3,JSON['stringify'](_0x3cfcb1));_0x499db9[_0x4ed5('0x2d')]();});})[_0x4ed5('0x2e')](function(_0x46fb07){logger[_0x4ed5('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x32b0b3,_0x46fb07[_0x4ed5('0x2f')]);_0x499db9[_0x4ed5('0x2d')]();});}}catch(_0x207673){logger[_0x4ed5('0x22')]('[%s][DIALOGFLOW]\x20%s',_0x32b0b3,JSON[_0x4ed5('0x23')](_0x207673));_0x499db9['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index e3b2e15..b8ec73a 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9658=['sms','channel','whatsapp','phone','interaction','chat','ChatWebsiteId','InteractionId','created','isEmpty','getMustacheRender','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','SessionsClient','sessionPath','queryResult','diagnosticInfo','fields','end_conversation','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','DIALOGFLOWV2_INTENTNAME','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','length','all','message','lodash','md5','moment','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x2a9eee,_0x2b1e2f){var _0x8da729=function(_0xea8a05){while(--_0xea8a05){_0x2a9eee['push'](_0x2a9eee['shift']());}};_0x8da729(++_0x2b1e2f);}(_0x9658,0x6f));var _0x8965=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x9658[_0x5a6644];return _0x3a2a5d;};'use strict';var _=require(_0x8965('0x0'));var dialogflow=require('dialogflow');var md5=require(_0x8965('0x1'));var moment=require(_0x8965('0x2'));var Promise=require('bluebird');var logger=require(_0x8965('0x3'))('routing');var utils=require(_0x8965('0x4'));var rpc={'chatMessage':require(_0x8965('0x5')),'openchannelMessage':require(_0x8965('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x8965('0x7')),'faxMessage':require(_0x8965('0x8')),'whatsappMessage':require(_0x8965('0x9'))};function createMessage(_0x290f30,_0x271060,_0x27b334,_0x1e7d61){return new Promise(function(_0xe14503,_0x353c14){var _0x28ccb1=_[_0x8965('0xa')](_0x27b334);_0x28ccb1[_0x8965('0xb')]=_0x1e7d61;return rpc[_0x271060+_0x8965('0xc')][_0x8965('0xd')](_0x28ccb1)[_0x8965('0xe')](function(){logger[_0x8965('0xf')](_0x8965('0x10'),_0x290f30,_0x28ccb1[_0x8965('0xb')]);_0xe14503();})[_0x8965('0x11')](function(_0x59a810){logger[_0x8965('0x12')](_0x8965('0x10'),_0x290f30,JSON[_0x8965('0x13')](_0x59a810));_0x353c14(_0x59a810);});});}exports[_0x8965('0x14')]=function(_0x1c921d,_0x1697e8){return function(_0x33663d){try{if(!_[_0x8965('0x15')](this['interaction'][_0x8965('0x16')])){logger[_0x8965('0xf')](_0x8965('0x10'),_0x1c921d,_0x8965('0x17'));return _0x33663d[_0x8965('0x18')]();}var _0x5a7a43={'ContactId':this[_0x8965('0x19')]['id'],'sentAt':moment()[_0x8965('0x1a')](_0x8965('0x1b')),'direction':_0x8965('0x1c')};if(this['channel']===_0x8965('0x1d')||this[_0x8965('0x1e')]===_0x8965('0x1f')){_0x5a7a43[_0x8965('0x20')]=this[_0x8965('0x21')][_0x8965('0x20')];}var _0x579fe6=this['channel'];if(_0x579fe6===_0x8965('0x22')){_0x5a7a43[_0x8965('0x23')]=this['account']['id'];}else{_0x5a7a43[_['upperFirst'](_0x579fe6)+'AccountId']=this['account']['id'];}_0x5a7a43[_['upperFirst'](_0x579fe6)+_0x8965('0x24')]=this['interaction']['id'];if(this[_0x8965('0x21')][_0x8965('0x25')]){var _0x7213f1=_0x1697e8[0x4];if(!_[_0x8965('0x26')](_0x7213f1)){_0x5a7a43['body']=utils[_0x8965('0x27')](_0x7213f1,this);return rpc[_0x579fe6+_0x8965('0xc')][_0x8965('0xd')](_0x5a7a43)[_0x8965('0xe')](function(_0x2f8d55){logger[_0x8965('0xf')](_0x8965('0x10'),_0x1c921d,_0x5a7a43[_0x8965('0xb')]);})[_0x8965('0x11')](function(_0x295134){logger['error'](_0x8965('0x10'),_0x1c921d,JSON[_0x8965('0x13')](_0x295134));})['finally'](function(){logger[_0x8965('0xf')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1c921d);_0x33663d['stop']();});}else{logger[_0x8965('0xf')](_0x8965('0x28'),_0x1c921d);_0x33663d[_0x8965('0x29')]();}}else{var _0x10c701=this;var _0x5abd14=_0x1697e8[0x2]['replace'](/\\n/g,'\x0a');var _0x2d69e1={'credentials':{'private_key':_0x5abd14,'client_email':_0x1697e8[0x1]}};var _0x290148=new dialogflow[(_0x8965('0x2a'))](_0x2d69e1);var _0x3e7f44=_0x290148[_0x8965('0x2b')](_0x1697e8[0x0],md5(_0x10c701[_0x8965('0x21')]['id']));var _0x552b7a={'session':_0x3e7f44,'queryInput':{'text':{'text':_0x10c701['message'][_0x8965('0xb')],'languageCode':_0x1697e8[0x3]||'en'}}};return _0x290148['detectIntent'](_0x552b7a)['then'](function(_0x227ef3){if(_0x227ef3&&_0x227ef3['length']){_0x10c701[_0x8965('0xb')]['dialogflowV2']=_0x227ef3;var _0x4ad940=_0x227ef3[0x0];var _0x2d7da9=_0x4ad940[_0x8965('0x2c')][_0x8965('0x2d')]&&_0x4ad940[_0x8965('0x2c')][_0x8965('0x2d')][_0x8965('0x2e')]?_0x4ad940['queryResult'][_0x8965('0x2d')][_0x8965('0x2e')][_0x8965('0x2f')]['boolValue']:![];_0x10c701[_0x8965('0xb')][_0x8965('0x30')]=_0x4ad940[_0x8965('0x2c')][_0x8965('0x31')];_0x10c701[_0x8965('0xb')][_0x8965('0x32')]=_0x4ad940[_0x8965('0x2c')][_0x8965('0x33')];_0x10c701[_0x8965('0xb')][_0x8965('0x34')]=_0x4ad940[_0x8965('0x2c')][_0x8965('0x2d')]&&_0x4ad940[_0x8965('0x2c')]['diagnosticInfo'][_0x8965('0x2e')]?_0x4ad940[_0x8965('0x2c')]['diagnosticInfo']['fields'][_0x8965('0x2f')][_0x8965('0x35')]:![];_0x10c701[_0x8965('0xb')][_0x8965('0x36')]=_0x4ad940['queryResult']['intent'][_0x8965('0x37')];_0x10c701['body'][_0x8965('0x38')]=_0x4ad940[_0x8965('0x2c')][_0x8965('0x39')][_0x8965('0x3a')];_0x10c701[_0x8965('0xb')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x4ad940[_0x8965('0x2c')]['intent'][_0x8965('0x3b')];_0x10c701[_0x8965('0xb')][_0x8965('0x3c')]=_0x4ad940[_0x8965('0x2c')][_0x8965('0x3d')];_0x10c701[_0x8965('0xb')][_0x8965('0x3e')]=_0x4ad940[_0x8965('0x2c')]['queryText'];_0x10c701[_0x8965('0xb')][_0x8965('0x3f')]=_0x4ad940['queryResult']['intentDetectionConfidence'];_0x5a7a43[_0x8965('0x40')]=_0x8965('0x41');_0x5a7a43[_0x8965('0x42')]=JSON['stringify'](_0x227ef3);var _0x28a6da=[];for(var _0x176690=0x0;_0x176690<_0x227ef3[_0x8965('0x43')];_0x176690++){var _0x19fed3=_0x227ef3[_0x176690];if(_0x19fed3&&_0x19fed3[_0x8965('0x2c')]&&_0x19fed3[_0x8965('0x2c')]['fulfillmentText']){_0x28a6da['push'](createMessage(_0x1c921d,_0x579fe6,_0x5a7a43,_0x19fed3[_0x8965('0x2c')]['fulfillmentText']));}}return Promise[_0x8965('0x44')](_0x28a6da)[_0x8965('0xe')](function(){if(_0x2d7da9){_0x33663d[_0x8965('0x18')]();}else{_0x33663d[_0x8965('0x29')]();}})[_0x8965('0x11')](function(_0x364c23){logger['error'](_0x8965('0x10'),_0x1c921d,JSON[_0x8965('0x13')](_0x364c23));_0x33663d['next']();});}})[_0x8965('0x11')](function(_0x5d9261){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1c921d,_0x5d9261[_0x8965('0x45')]);_0x33663d[_0x8965('0x18')]();});}}catch(_0x3038c6){logger[_0x8965('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x1c921d,JSON['stringify'](_0x3038c6));_0x33663d['stop']();}};}; \ No newline at end of file +var _0x7511=['Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','error','stringify','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','catch','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','all','next','lodash','dialogflow','md5','moment','../../../../config/logger','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body'];(function(_0x3aae4b,_0x48de0c){var _0x55c9ce=function(_0x4384e9){while(--_0x4384e9){_0x3aae4b['push'](_0x3aae4b['shift']());}};_0x55c9ce(++_0x48de0c);}(_0x7511,0x86));var _0x1751=function(_0x26ce19,_0x56cb79){_0x26ce19=_0x26ce19-0x0;var _0x3b923e=_0x7511[_0x26ce19];return _0x3b923e;};'use strict';var _=require(_0x1751('0x0'));var dialogflow=require(_0x1751('0x1'));var md5=require(_0x1751('0x2'));var moment=require(_0x1751('0x3'));var Promise=require('bluebird');var logger=require(_0x1751('0x4'))('routing');var utils=require(_0x1751('0x5'));var rpc={'chatMessage':require(_0x1751('0x6')),'openchannelMessage':require(_0x1751('0x7')),'mailMessage':require(_0x1751('0x8')),'smsMessage':require(_0x1751('0x9')),'faxMessage':require(_0x1751('0xa')),'whatsappMessage':require(_0x1751('0xb'))};function createMessage(_0x3d4060,_0x52af3a,_0x56d63f,_0x5d691b){return new Promise(function(_0x58d219,_0x4969a8){var _0xf162dc=_[_0x1751('0xc')](_0x56d63f);_0xf162dc[_0x1751('0xd')]=_0x5d691b;return rpc[_0x52af3a+_0x1751('0xe')][_0x1751('0xf')](_0xf162dc)[_0x1751('0x10')](function(){logger[_0x1751('0x11')](_0x1751('0x12'),_0x3d4060,_0xf162dc[_0x1751('0xd')]);_0x58d219();})['catch'](function(_0x22dcd6){logger[_0x1751('0x13')]('[%s][DIALOGFLOWV2]\x20%s',_0x3d4060,JSON[_0x1751('0x14')](_0x22dcd6));_0x4969a8(_0x22dcd6);});});}exports['consequence']=function(_0x3e12c5,_0x1cc4b4){return function(_0x11a152){try{if(!_['isNil'](this[_0x1751('0x15')][_0x1751('0x16')])){logger[_0x1751('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x3e12c5,_0x1751('0x17'));return _0x11a152['next']();}var _0xa5095c={'ContactId':this[_0x1751('0x18')]['id'],'sentAt':moment()[_0x1751('0x19')](_0x1751('0x1a')),'direction':_0x1751('0x1b')};if(this['channel']==='sms'||this[_0x1751('0x1c')]===_0x1751('0x1d')){_0xa5095c[_0x1751('0x1e')]=this[_0x1751('0x15')]['phone'];}var _0x49fcae=this[_0x1751('0x1c')];if(_0x49fcae===_0x1751('0x1f')){_0xa5095c[_0x1751('0x20')]=this['account']['id'];}else{_0xa5095c[_[_0x1751('0x21')](_0x49fcae)+_0x1751('0x22')]=this[_0x1751('0x23')]['id'];}_0xa5095c[_[_0x1751('0x21')](_0x49fcae)+_0x1751('0x24')]=this[_0x1751('0x15')]['id'];if(this[_0x1751('0x15')][_0x1751('0x25')]){var _0x2c009c=_0x1cc4b4[0x4];if(!_[_0x1751('0x26')](_0x2c009c)){_0xa5095c['body']=utils[_0x1751('0x27')](_0x2c009c,this);return rpc[_0x49fcae+_0x1751('0xe')][_0x1751('0xf')](_0xa5095c)[_0x1751('0x10')](function(_0x225dd0){logger['info'](_0x1751('0x12'),_0x3e12c5,_0xa5095c['body']);})[_0x1751('0x28')](function(_0x457661){logger[_0x1751('0x13')](_0x1751('0x12'),_0x3e12c5,JSON[_0x1751('0x14')](_0x457661));})[_0x1751('0x29')](function(){logger[_0x1751('0x11')](_0x1751('0x2a'),_0x3e12c5);_0x11a152['stop']();});}else{logger[_0x1751('0x11')](_0x1751('0x2b'),_0x3e12c5);_0x11a152[_0x1751('0x2c')]();}}else{var _0x4ef9dc=this;var _0x1f25d6=_0x1cc4b4[0x2][_0x1751('0x2d')](/\\n/g,'\x0a');var _0x4c0e7c={'credentials':{'private_key':_0x1f25d6,'client_email':_0x1cc4b4[0x1]}};var _0xfe9f7a=new dialogflow['SessionsClient'](_0x4c0e7c);var _0x3bbe6e=_0xfe9f7a['sessionPath'](_0x1cc4b4[0x0],md5(_0x4ef9dc['interaction']['id']));var _0x3e3e0d={'session':_0x3bbe6e,'queryInput':{'text':{'text':_0x4ef9dc[_0x1751('0x2e')]['body'],'languageCode':_0x1cc4b4[0x3]||'en'}}};return _0xfe9f7a[_0x1751('0x2f')](_0x3e3e0d)['then'](function(_0x240d1e){if(_0x240d1e&&_0x240d1e[_0x1751('0x30')]){_0x4ef9dc[_0x1751('0xd')][_0x1751('0x31')]=_0x240d1e;var _0x2b1c3c=_0x240d1e[0x0];var _0xd8a458=_0x2b1c3c[_0x1751('0x32')]['diagnosticInfo']&&_0x2b1c3c[_0x1751('0x32')][_0x1751('0x33')][_0x1751('0x34')]?_0x2b1c3c[_0x1751('0x32')]['diagnosticInfo'][_0x1751('0x34')][_0x1751('0x35')][_0x1751('0x36')]:![];_0x4ef9dc[_0x1751('0xd')][_0x1751('0x37')]=_0x2b1c3c[_0x1751('0x32')][_0x1751('0x38')];_0x4ef9dc[_0x1751('0xd')][_0x1751('0x39')]=_0x2b1c3c[_0x1751('0x32')][_0x1751('0x3a')];_0x4ef9dc[_0x1751('0xd')][_0x1751('0x3b')]=_0x2b1c3c[_0x1751('0x32')][_0x1751('0x33')]&&_0x2b1c3c[_0x1751('0x32')]['diagnosticInfo']['fields']?_0x2b1c3c[_0x1751('0x32')][_0x1751('0x33')]['fields']['end_conversation'][_0x1751('0x36')]:![];_0x4ef9dc[_0x1751('0xd')]['DIALOGFLOWV2_INTENTNAME']=_0x2b1c3c[_0x1751('0x32')][_0x1751('0x3c')]['name'];_0x4ef9dc[_0x1751('0xd')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x2b1c3c[_0x1751('0x32')]['intent'][_0x1751('0x3d')];_0x4ef9dc[_0x1751('0xd')][_0x1751('0x3e')]=_0x2b1c3c['queryResult'][_0x1751('0x3c')]['isFallback'];_0x4ef9dc[_0x1751('0xd')][_0x1751('0x3f')]=_0x2b1c3c['queryResult'][_0x1751('0x40')];_0x4ef9dc[_0x1751('0xd')][_0x1751('0x41')]=_0x2b1c3c[_0x1751('0x32')]['queryText'];_0x4ef9dc['body'][_0x1751('0x42')]=_0x2b1c3c['queryResult'][_0x1751('0x43')];_0xa5095c[_0x1751('0x44')]=_0x1751('0x31');_0xa5095c[_0x1751('0x45')]=JSON[_0x1751('0x14')](_0x240d1e);var _0x2e6887=[];for(var _0x7c11f8=0x0;_0x7c11f8<_0x240d1e[_0x1751('0x30')];_0x7c11f8++){var _0x28b705=_0x240d1e[_0x7c11f8];if(_0x28b705&&_0x28b705[_0x1751('0x32')]&&_0x28b705[_0x1751('0x32')][_0x1751('0x46')]){_0x2e6887[_0x1751('0x47')](createMessage(_0x3e12c5,_0x49fcae,_0xa5095c,_0x28b705[_0x1751('0x32')][_0x1751('0x46')]));}}return Promise[_0x1751('0x48')](_0x2e6887)[_0x1751('0x10')](function(){if(_0xd8a458){_0x11a152['next']();}else{_0x11a152['stop']();}})['catch'](function(_0x76f982){logger[_0x1751('0x13')](_0x1751('0x12'),_0x3e12c5,JSON[_0x1751('0x14')](_0x76f982));_0x11a152[_0x1751('0x49')]();});}})[_0x1751('0x28')](function(_0x2a04e6){logger[_0x1751('0x13')](_0x1751('0x12'),_0x3e12c5,_0x2a04e6[_0x1751('0x2e')]);_0x11a152[_0x1751('0x49')]();});}}catch(_0x4e622d){logger[_0x1751('0x13')](_0x1751('0x12'),_0x3e12c5,JSON[_0x1751('0x14')](_0x4e622d));_0x11a152['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 53c3b66..29f8e8a 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0ecd=['next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','lodash','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','message','join','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0ecd,0x99));var _0xd0ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ecd[_0x3dd15e];return _0x231fd0;};'use strict';var schema=require('validate');var _=require(_0xd0ec('0x0'));var htmlToText=require('html-to-text');var utils=require(_0xd0ec('0x1'));var logger=require(_0xd0ec('0x2'))(_0xd0ec('0x3'));var gotoif=schema({'condition':{'type':_0xd0ec('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xd0ec('0x5'),'message':_0xd0ec('0x6')},'priorityFalse':{'type':'number','message':_0xd0ec('0x7')}});exports[_0xd0ec('0x8')]=function(_0x2eefe1,_0x1c1765){return function(_0x46c536){try{var _0x5348f7={'condition':htmlToText[_0xd0ec('0x9')](utils[_0xd0ec('0xa')](_0x1c1765[0x0],this),{'wordwrap':![]})[_0xd0ec('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1c1765[0x1],'priorityFalse':_0x1c1765[0x2]};var _0xe1a36e=gotoif['validate'](_0x5348f7,{'typecast':!![]});if(_0xe1a36e[_0xd0ec('0xc')]){logger[_0xd0ec('0xd')]('[%s][GOTOIF]\x20%s',_0x2eefe1,_['map'](_0xe1a36e,_0xd0ec('0xe'))[_0xd0ec('0xf')](',\x20'));_0x46c536[_0xd0ec('0x10')]();}else{try{var _0x3aa7df=eval('('+_0x5348f7[_0xd0ec('0x11')]+')');var _0x7a3f97=_0x3aa7df?_0x5348f7['priorityTrue']:_0x5348f7[_0xd0ec('0x12')];logger[_0xd0ec('0x13')](_0xd0ec('0x14'),_0x2eefe1,_0x5348f7[_0xd0ec('0x11')],_0x3aa7df,_0x7a3f97||_0xd0ec('0x15'));if(_0x7a3f97){var _0x58ff8b=_[_0xd0ec('0x16')](_0x46c536[_0xd0ec('0x17')](),{'p':_0x7a3f97});if(_0x58ff8b>=0x0){logger[_0xd0ec('0x13')](_0xd0ec('0x18'),_0x2eefe1,_0x7a3f97||_0xd0ec('0x15'),_0x58ff8b);_0x46c536[_0xd0ec('0x15')](_0x58ff8b);}else{logger[_0xd0ec('0x13')](_0xd0ec('0x19'),_0x2eefe1,_0x7a3f97||_0xd0ec('0x15'));_0x46c536['stop']();}}else{_0x46c536[_0xd0ec('0x15')]();}}catch(_0xb58be5){logger[_0xd0ec('0xd')](_0xd0ec('0x1a'),_0x2eefe1,_0xb58be5[_0xd0ec('0xe')]);_0x46c536[_0xd0ec('0x10')]();}}}catch(_0x21699c){logger[_0xd0ec('0xd')](_0xd0ec('0x1b'),_0x2eefe1,JSON[_0xd0ec('0x1c')](_0x21699c));_0x46c536[_0xd0ec('0x10')]();}};}; \ No newline at end of file +var _0x6f7a=['validate','lodash','html-to-text','./utils','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify'];(function(_0x347471,_0x1c9a02){var _0x422b6a=function(_0x2b6f88){while(--_0x2b6f88){_0x347471['push'](_0x347471['shift']());}};_0x422b6a(++_0x1c9a02);}(_0x6f7a,0x1a0));var _0xa6f7=function(_0x3dd2f9,_0x2f3b1e){_0x3dd2f9=_0x3dd2f9-0x0;var _0x38d652=_0x6f7a[_0x3dd2f9];return _0x38d652;};'use strict';var schema=require(_0xa6f7('0x0'));var _=require(_0xa6f7('0x1'));var htmlToText=require(_0xa6f7('0x2'));var utils=require(_0xa6f7('0x3'));var logger=require('../../../../config/logger')('routing');var gotoif=schema({'condition':{'type':_0xa6f7('0x4'),'required':!![],'message':_0xa6f7('0x5')},'priorityTrue':{'type':_0xa6f7('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0xa6f7('0x6'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xa6f7('0x7')]=function(_0x139e3e,_0x40d66e){return function(_0x5587d0){try{var _0x3d05f2={'condition':htmlToText[_0xa6f7('0x8')](utils['getMustacheRender'](_0x40d66e[0x0],this),{'wordwrap':![]})[_0xa6f7('0x9')](/<\/?[^>]+(>|$)/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 diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 2b7514d..c0cbd61 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 _0x458d=['stop','validate','lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x44a519,_0xbf9f81){var _0x48b271=function(_0x3186b4){while(--_0x3186b4){_0x44a519['push'](_0x44a519['shift']());}};_0x48b271(++_0xbf9f81);}(_0x458d,0x79));var _0xd458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x458d[_0x20a584];return _0x4b41a8;};'use strict';var schema=require(_0xd458('0x0'));var _=require(_0xd458('0x1'));var logger=require(_0xd458('0x2'))(_0xd458('0x3'));var gotop=schema({'priority':{'type':_0xd458('0x4'),'required':!![],'message':_0xd458('0x5')}});exports[_0xd458('0x6')]=function(_0x3f2128,_0x23bd5e){return function(_0x591420){try{var _0x23a3fe={'priority':_0x23bd5e[0x0]};var _0x19797e=gotop[_0xd458('0x0')](_0x23a3fe,{'typecast':!![]});if(_0x19797e[_0xd458('0x7')]){logger[_0xd458('0x8')](_0xd458('0x9'),_0x3f2128,_[_0xd458('0xa')](_0x19797e,_0xd458('0xb'))[_0xd458('0xc')](',\x20'));_0x591420['stop']();}else{logger[_0xd458('0xd')](_0xd458('0xe'),_0x3f2128,_0x23a3fe[_0xd458('0xf')]);if(_0x23a3fe[_0xd458('0xf')]){var _0x273d15=_['findIndex'](_0x591420[_0xd458('0x10')](),{'p':_0x23a3fe[_0xd458('0xf')]});if(_0x273d15>=0x0){logger['info']('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3f2128,_0x23a3fe['priority']||_0xd458('0x11'),_0x273d15);_0x591420['next'](_0x273d15);}else{logger[_0xd458('0xd')](_0xd458('0x12'),_0x3f2128,_0x23a3fe[_0xd458('0xf')]||'next');_0x591420[_0xd458('0x13')]();}}else{_0x591420[_0xd458('0x11')]();}}}catch(_0x1cf660){logger[_0xd458('0x8')](_0xd458('0x9'),_0x3f2128,JSON['stringify'](_0x1cf660));_0x591420[_0xd458('0x13')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 0c19571..a0c39b7 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 _0x4708=['contact','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','create','info','[%s][MESSAGE]\x20%s','next','catch','error','stop','stringify','lodash','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender'];(function(_0x19c938,_0x1d6e4b){var _0x407331=function(_0x465cbc){while(--_0x465cbc){_0x19c938['push'](_0x19c938['shift']());}};_0x407331(++_0x1d6e4b);}(_0x4708,0xa7));var _0x8470=function(_0x277aa2,_0x407703){_0x277aa2=_0x277aa2-0x0;var _0x108358=_0x4708[_0x277aa2];return _0x108358;};'use strict';var _=require(_0x8470('0x0'));var utils=require(_0x8470('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x8470('0x2')),'mailMessage':require(_0x8470('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x8470('0x4')),'whatsappMessage':require(_0x8470('0x5'))};exports[_0x8470('0x6')]=function(_0xc40dc,_0x310710){return function(_0x45206e){try{var _0x35934b={'body':utils[_0x8470('0x7')](_0x310710[0x0],this),'ContactId':this[_0x8470('0x8')]['id']};if(this[_0x8470('0x9')]==='chat'){_0x35934b[_0x8470('0xa')]=this[_0x8470('0xb')]['id'];}else{_0x35934b[_[_0x8470('0xc')](this['channel'])+_0x8470('0xd')]=this['account']['id'];}_0x35934b[_[_0x8470('0xc')](this[_0x8470('0x9')])+_0x8470('0xe')]=this[_0x8470('0xf')]['id'];if(rpc[this[_0x8470('0x9')]+'Message']){return rpc[this['channel']+_0x8470('0x10')][_0x8470('0x11')](_0x35934b)['then'](function(_0xd3af2b){logger[_0x8470('0x12')](_0x8470('0x13'),_0xc40dc,_0x35934b['body']);_0x45206e[_0x8470('0x14')]();})[_0x8470('0x15')](function(_0xc4e83){logger[_0x8470('0x16')](_0x8470('0x13'),_0xc40dc,JSON['stringify'](_0xc4e83));_0x45206e[_0x8470('0x17')]();});}}catch(_0x55271a){logger[_0x8470('0x16')](_0x8470('0x13'),_0xc40dc,JSON[_0x8470('0x18')](_0x55271a));_0x45206e[_0x8470('0x17')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/noop.js b/server/services/routing/server/applications/noop.js index aec7404..e4ac9d4 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 _0xb713=['info','[%s][NOOP]\x20%s','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0xf2251e,_0x32a4ae){var _0x40effa=function(_0x3d699b){while(--_0x3d699b){_0xf2251e['push'](_0xf2251e['shift']());}};_0x40effa(++_0x32a4ae);}(_0xb713,0x9c));var _0x3b71=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xb713[_0x3203a1];return _0x24215e;};'use strict';var utils=require(_0x3b71('0x0'));var logger=require(_0x3b71('0x1'))(_0x3b71('0x2'));exports[_0x3b71('0x3')]=function(_0x2db225,_0x493c7a){return function(_0x2e2f5a){try{logger[_0x3b71('0x4')](_0x3b71('0x5'),_0x2db225,utils['getMustacheRender'](_0x493c7a[0x0],this));_0x2e2f5a[_0x3b71('0x6')]();}catch(_0x1843ed){logger[_0x3b71('0x7')](_0x3b71('0x5'),_0x2db225,JSON[_0x3b71('0x8')](_0x1843ed));_0x2e2f5a[_0x3b71('0x9')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 195125c..07aea3d 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 _0xdfda=['../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','body','YYYY-MM-DD\x20HH:mm:ss','contact','channel','QueueId','upperFirst','InteractionId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','waiting','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','[%s][QUEUE]\x20%s','join','stop','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','ioredis','routing','./strategy','redis','defaults','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','remove'];(function(_0x3dc499,_0x3fb1a0){var _0x92dd42=function(_0x291a9c){while(--_0x291a9c){_0x3dc499['push'](_0x3dc499['shift']());}};_0x92dd42(++_0x3fb1a0);}(_0xdfda,0x10a));var _0xadfd=function(_0x925867,_0x2b426d){_0x925867=_0x925867-0x0;var _0x373455=_0xdfda[_0x925867];return _0x373455;};'use strict';var schema=require(_0xadfd('0x0'));var _=require('lodash');var util=require('util');var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0xadfd('0x1'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0xadfd('0x2'));var strategy=require(_0xadfd('0x3'));config[_0xadfd('0x4')]=_[_0xadfd('0x5')](config[_0xadfd('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xadfd('0x6'))(new Redis(config[_0xadfd('0x4')]));var attributes=['id',_0xadfd('0x7'),_0xadfd('0x8'),_0xadfd('0x9'),_0xadfd('0xa'),_0xadfd('0xb')];function emit(_0x447c0a,_0x2b5808,_0x239ec8){io['to'](_0x447c0a)['emit'](_0x2b5808,_0x239ec8);}function emitChannelQueueInteraction(_0x317067,_0x67cc02,_0x1eec52,_0x4055f4,_0x1ece24,_0x1f6699,_0x49a588,_0x306bb3){var _0x161514=_[_0xadfd('0xc')](_0x1eec52);_0x161514[_0xadfd('0x7')]=_0x306bb3;_0x161514[_0xadfd('0x9')]=_0x67cc02;_0x161514[_0xadfd('0x8')]=_0x4055f4;_0x161514['id']=_0x1ece24;if(_0x1f6699){_0x49a588[util[_0xadfd('0xd')](_0xadfd('0xe'),_0x317067)][_0x1ece24]=_[_0xadfd('0xf')](_0x161514,attributes);}else{delete _0x49a588[util[_0xadfd('0xd')](_0xadfd('0xe'),_0x317067)][_0x1ece24];}emit(util['format'](_0xadfd('0x10'),_0x317067,_0x67cc02),util[_0xadfd('0xd')]('%s_queue_waiting_interaction:%s',_0x317067,_0x1f6699?'save':_0xadfd('0x11')),_[_0xadfd('0xf')](_0x161514,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xadfd('0x12')),'chatQueueReport':require(_0xadfd('0x13')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xadfd('0x14')),'whatsappQueueReport':require(_0xadfd('0x15'))};var queue=schema({'name':{'type':_0xadfd('0x16'),'required':!![],'message':_0xadfd('0x17')},'timeout':{'type':_0xadfd('0x18'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x184a7b,_0x36ec42,_0x4ba4ab,_0x4716b3){if(_0x184a7b&&_0x36ec42&&_0x4ba4ab){_0x36ec42['waiting']+=0x1;var _0xdcfd2f={'uniqueid':_0x184a7b,'from':_0x4ba4ab[_0xadfd('0x19')]?_0x4ba4ab['body']['from']:'','joinAt':moment()[_0xadfd('0xd')](_0xadfd('0x1a')),'ContactId':_0x4ba4ab[_0xadfd('0x1b')]?_0x4ba4ab[_0xadfd('0x1b')]['id']:null,'ListId':_0x4ba4ab['list']?_0x4ba4ab['list']['id']:null};_0xdcfd2f[_['upperFirst'](_0x4ba4ab[_0xadfd('0x1c')])+_0xadfd('0x1d')]=_0x36ec42['id']||null;_0xdcfd2f[_[_0xadfd('0x1e')](_0x4ba4ab[_0xadfd('0x1c')])+_0xadfd('0x1f')]=_0x4ba4ab[_0xadfd('0x20')]?_0x4ba4ab[_0xadfd('0x20')]['id']:null;_0xdcfd2f[_[_0xadfd('0x1e')](_0x4ba4ab[_0xadfd('0x1c')])+_0xadfd('0x21')]=_0x4ba4ab[_0xadfd('0x22')]?_0x4ba4ab[_0xadfd('0x22')]['id']:null;_0xdcfd2f[_[_0xadfd('0x1e')](_0x4ba4ab['channel'])+(_0x4ba4ab[_0xadfd('0x1c')]!==_0xadfd('0x23')?_0xadfd('0x24'):'WebsiteId')]=_0x4ba4ab[_0xadfd('0x8')]?_0x4ba4ab[_0xadfd('0x8')]['id']:null;logger[_0xadfd('0x25')](util['format'](_0xadfd('0x26'),_0x184a7b,_0x36ec42[_0xadfd('0x27')]));emitChannelQueueInteraction(_0x4ba4ab['channel'],_0x36ec42[_0xadfd('0x27')],_0xdcfd2f,_0x4ba4ab[_0xadfd('0x8')][_0xadfd('0x27')],_0x4ba4ab[_0xadfd('0x22')]['id'],!![],_0x4716b3,_0x36ec42['id']);if(rpc[_0x4ba4ab['channel']+'QueueReport']){return rpc[_0x4ba4ab[_0xadfd('0x1c')]+_0xadfd('0x28')][_0xadfd('0x29')](_0xdcfd2f)[_0xadfd('0x2a')](function(_0x36af7b){logger['error'](_0xadfd('0x2b'));});}}}function stopRouting(_0x8516fd,_0x198ec3,_0x56cb62,_0x55afbf){if(_0x8516fd&&_0x198ec3){_0x198ec3['waiting']-=0x1;var _0x2e7150={'leaveAt':moment()[_0xadfd('0xd')](_0xadfd('0x1a')),'acceptAt':moment()['format'](_0xadfd('0x1a')),'reason':_0xadfd('0x2c')};logger[_0xadfd('0x25')](util[_0xadfd('0xd')](_0xadfd('0x2d'),_0x8516fd,_0x198ec3[_0xadfd('0x27')]));emitChannelQueueInteraction(_0x56cb62['channel'],_0x198ec3[_0xadfd('0x27')],_0x56cb62[_0xadfd('0x19')],_0x56cb62[_0xadfd('0x8')][_0xadfd('0x27')],_0x56cb62[_0xadfd('0x22')]['id'],![],_0x55afbf,_0x198ec3['id']);if(rpc[_0x56cb62[_0xadfd('0x1c')]+_0xadfd('0x28')]){return rpc[_0x56cb62[_0xadfd('0x1c')]+_0xadfd('0x28')][_0xadfd('0x2e')](_0x8516fd,_0x2e7150)[_0xadfd('0x2a')](function(_0x2ea672){logger[_0xadfd('0x2f')](_0xadfd('0x30'));});}}}function endRouting(_0x5a8db6,_0x3829a4,_0x12c9e1,_0x84a8c5){if(_0x5a8db6&&_0x3829a4){_0x3829a4[_0xadfd('0x31')]-=0x1;var _0x5a4b9d={'leaveAt':moment()[_0xadfd('0xd')](_0xadfd('0x1a')),'exitAt':moment()['format'](_0xadfd('0x1a')),'reason':_0xadfd('0x32')};logger[_0xadfd('0x25')](util[_0xadfd('0xd')](_0xadfd('0x33'),_0x5a8db6,_0x3829a4['name']));emitChannelQueueInteraction(_0x12c9e1[_0xadfd('0x1c')],_0x3829a4['name'],_0x12c9e1['body'],_0x12c9e1['account'][_0xadfd('0x27')],_0x12c9e1['message']['id'],![],_0x84a8c5);if(rpc[_0x12c9e1[_0xadfd('0x1c')]+_0xadfd('0x28')]){return rpc[_0x12c9e1[_0xadfd('0x1c')]+'QueueReport'][_0xadfd('0x2e')](_0x5a8db6,_0x5a4b9d)['catch'](function(_0x3d1d96){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x5bc1ed){return function(_0x3fe29e){return _0x3fe29e[_0xadfd('0x27')]['toLowerCase']()===_0x5bc1ed[_0xadfd('0x34')]();};}exports[_0xadfd('0x35')]=function(_0x2e02dd,_0x648bce,_0x5b2c1c,_0xce6892){return function(_0x2015af){try{var _0x14a912={'name':_0x648bce[0x0],'timeout':_0x648bce[0x1]};var _0x300c59=queue[_0xadfd('0x0')](_0x14a912,{'typecast':!![]});if(_0x300c59['length']){logger[_0xadfd('0x2f')](_0xadfd('0x36'),_0x2e02dd,_['map'](_0x300c59,_0xadfd('0x22'))[_0xadfd('0x37')](',\x20'));_0x2015af[_0xadfd('0x38')]();}else{var _0x438792=_['find'](_0x5b2c1c[_0xce6892[_0xadfd('0x1c')]+'Queues'],handleFindQueue(_0x14a912['name']));if(_0x438792){startRouting(_0x2e02dd,_0x438792,_0xce6892,_0x5b2c1c);var _0x220165=(_0x438792[_0xadfd('0x32')]||0xa)*0x3e8;var _0x37c053=(_0x14a912[_0xadfd('0x32')]||0x14)*0x3e8;var _0x4fe1d6,_0x3f52bd;if(_0x220165>_0x37c053){_0x37c053=_0x220165;}var _0x54db42=seqqueue[_0xadfd('0x39')](_0x220165);_0x54db42['id']=_0x2e02dd;_0x54db42['atimeout']=_0x220165;_0x54db42[_0xadfd('0x3a')]=_0x37c053;_0x54db42[_0xadfd('0x1c')]=_0xce6892[_0xadfd('0x1c')];_0x5b2c1c[_0xadfd('0x3b')][_0x2e02dd]['on'](_0xadfd('0x3c'),function(){logger[_0xadfd('0x25')](_0xadfd('0x3d'),_0x2e02dd);stopRouting(_0x2e02dd,_0x438792,_0xce6892,_0x5b2c1c);clearTimeout(_0x4fe1d6);_0x4fe1d6=undefined;_0x54db42[_0xadfd('0x3e')](!![]);if(_0x5b2c1c['rules'][_0x2e02dd]){delete _0x5b2c1c[_0xadfd('0x3b')][_0x2e02dd];}_0x2015af[_0xadfd('0x38')]();});_0x5b2c1c['rules'][_0x2e02dd]['on']('complete',function(){if(_0x5b2c1c[_0xadfd('0x3b')][_0x2e02dd]){delete _0x5b2c1c[_0xadfd('0x3b')][_0x2e02dd];}});_0x4fe1d6=setTimeout(function(){logger[_0xadfd('0x25')](_0xadfd('0x3f'),_0x2e02dd);endRouting(_0x2e02dd,_0x438792,_0xce6892,_0x5b2c1c);clearTimeout(_0x4fe1d6);_0x54db42[_0xadfd('0x3e')](!![]);_0x2015af[_0xadfd('0x40')]();},_0x37c053);switch(_0x438792[_0xadfd('0x41')]){case _0xadfd('0x42'):strategy['rrmemory'](_0x54db42,_0x438792,_0x5b2c1c,_0xce6892);break;default:strategy[_0xadfd('0x43')](_0x54db42,_0x438792,_0x5b2c1c,_0xce6892);}}else{logger[_0xadfd('0x2f')](_0xadfd('0x44'),_0x2e02dd,_0x14a912[_0xadfd('0x27')]);_0x2015af[_0xadfd('0x38')]();}}}catch(_0x4e2265){console[_0xadfd('0x45')](_0x4e2265);logger['error'](_0xadfd('0x36'),_0x2e02dd,_0x4e2265[_0xadfd('0x46')]);_0x2015af[_0xadfd('0x38')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index eef093d..5cee3f4 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 _0x2c3e=['prototype','info','[%s][AGENT]\x20try\x20with\x20%s','agent','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained'];(function(_0x19babd,_0x1d4ef7){var _0x314eaf=function(_0x24ea35){while(--_0x24ea35){_0x19babd['push'](_0x19babd['shift']());}};_0x314eaf(++_0x1d4ef7);}(_0x2c3e,0xb1));var _0xe2c3=function(_0x1feefe,_0x2018ad){_0x1feefe=_0x1feefe-0x0;var _0x56471a=_0x2c3e[_0x1feefe];return _0x56471a;};'use strict';var _=require(_0xe2c3('0x0'));var uuid=require(_0xe2c3('0x1'));var util=require(_0xe2c3('0x2'));var logger=require(_0xe2c3('0x3'))(_0xe2c3('0x4'));var Agent=function(_0x16a4f2,_0x5a644d,_0x1eb795,_0x586866){this[_0xe2c3('0x5')]=uuid['v4']();this[_0xe2c3('0x6')]=_0x16a4f2;this['agent']=_0x5a644d;this[_0xe2c3('0x7')]=_0x1eb795;this['routing']=_0x586866;this[_0xe2c3('0x6')][_0xe2c3('0x8')](this[_0xe2c3('0x9')][_0xe2c3('0xa')](this),this[_0xe2c3('0xb')][_0xe2c3('0xa')](this));this['squeue']['on'](_0xe2c3('0xc'),this[_0xe2c3('0xb')]['bind'](this));this[_0xe2c3('0x6')]['on'](_0xe2c3('0xd'),this[_0xe2c3('0xe')][_0xe2c3('0xa')](this));};Agent[_0xe2c3('0xf')][_0xe2c3('0x8')]=function(){this['squeue'][_0xe2c3('0x8')](this[_0xe2c3('0x9')][_0xe2c3('0xa')](this),this['handleTimeout'][_0xe2c3('0xa')](this));};Agent[_0xe2c3('0xf')][_0xe2c3('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0xe2c3('0xf')][_0xe2c3('0x9')]=function(_0x33b99e){logger[_0xe2c3('0x10')](_0xe2c3('0x11'),this['squeue']['id'],this[_0xe2c3('0x12')]['id']);if(_['isNil'](this['realtime'][_0xe2c3('0x13')][this['agent']['id']])){logger['info'](_0xe2c3('0x14'),this[_0xe2c3('0x6')]['id'],this[_0xe2c3('0x12')]['id']);setTimeout(this[_0xe2c3('0x8')][_0xe2c3('0xa')](this),0x3e8);}else{if(this[_0xe2c3('0x4')][_0xe2c3('0x15')]||util['isAgentAvailable'](this[_0xe2c3('0x6')]['id'],this[_0xe2c3('0x7')]['agents'][this[_0xe2c3('0x12')]['id']],this[_0xe2c3('0x6')]['channel'],![])){this[_0xe2c3('0x7')][_0xe2c3('0x13')][this['agent']['id']][_0xe2c3('0x16')]=!![];this['realtime'][_0xe2c3('0x13')][this[_0xe2c3('0x12')]['id']][_0xe2c3('0x17')]=undefined;util[_0xe2c3('0x18')](this['notificationId'],this['squeue']['id'],this[_0xe2c3('0x7')][_0xe2c3('0x13')][this[_0xe2c3('0x12')]['id']],null,this[_0xe2c3('0x4')]);util[_0xe2c3('0x19')](this[_0xe2c3('0x6')]['id'],this[_0xe2c3('0x7')][_0xe2c3('0x13')][this[_0xe2c3('0x12')]['id']],_0xe2c3('0x1a')+(this[_0xe2c3('0x4')][_0xe2c3('0x15')]?_0xe2c3('0x1b'):''));}else{logger[_0xe2c3('0x10')](_0xe2c3('0x1c'),this['squeue']['id'],this[_0xe2c3('0x12')]['id']);setTimeout(this['push'][_0xe2c3('0xa')](this),0x3e8);}}};Agent['prototype'][_0xe2c3('0xb')]=function(_0x440342){if(_['isNil'](this['realtime'][_0xe2c3('0x13')][this[_0xe2c3('0x12')]['id']])){return logger['info'](_0xe2c3('0x14'),this[_0xe2c3('0x6')]['id'],this[_0xe2c3('0x12')]['id']);}else{logger[_0xe2c3('0x10')]('[%s][AGENT]\x20timeout\x20with\x20%s',this['squeue']['id'],this['agent']['id']);util[_0xe2c3('0x1d')](this[_0xe2c3('0x5')],this[_0xe2c3('0x6')]['id'],this[_0xe2c3('0x7')][_0xe2c3('0x13')][this[_0xe2c3('0x12')]['id']],null,this[_0xe2c3('0x4')]);this[_0xe2c3('0x7')][_0xe2c3('0x13')][this['agent']['id']][_0xe2c3('0x16')]=![];this[_0xe2c3('0x7')]['agents'][this[_0xe2c3('0x12')]['id']][_0xe2c3('0x17')]=undefined;util['writeLog'](this[_0xe2c3('0x6')]['id'],this[_0xe2c3('0x7')]['agents'][this[_0xe2c3('0x12')]['id']],_0x440342?_0xe2c3('0x1e'):'TIMEOUT');}if(!_0x440342){setTimeout(this[_0xe2c3('0x8')][_0xe2c3('0xa')](this),0x3e8);}};function agent(_0x102db3,_0x4c8782,_0xf2cbc5,_0x86a6b){return new Agent(_0x102db3,_0x4c8782,_0xf2cbc5,_0x86a6b);}module[_0xe2c3('0x1f')]=agent; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 52f4570..0c3038b 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 _0xa631=['isNil','queue','Agents','length','agents','info','isAgentAvailable','realtime','channel','RINGING','busy','busyQueue','showNotification','routing','[%s][QUEUE]\x20EMPTY','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','STOP','uuid','./util','../../../../../config/logger','notificationId','squeue','push','handleRun','bind','timeout','handleTimeout','handleDrained','prototype'];(function(_0x4b481c,_0x37f9d5){var _0x593eb4=function(_0x3a998b){while(--_0x3a998b){_0x4b481c['push'](_0x4b481c['shift']());}};_0x593eb4(++_0x37f9d5);}(_0xa631,0xe4));var _0x1a63=function(_0x263ac0,_0x4f4433){_0x263ac0=_0x263ac0-0x0;var _0x2bc88f=_0xa631[_0x263ac0];return _0x2bc88f;};'use strict';var _=require('lodash');var uuid=require(_0x1a63('0x0'));var util=require(_0x1a63('0x1'));var logger=require(_0x1a63('0x2'))('routing');var Beepall=function(_0x265d0d,_0x584ab0,_0x536c8d,_0x2d36b7){this[_0x1a63('0x3')]=uuid['v4']();this[_0x1a63('0x4')]=_0x265d0d;this['queue']=_0x584ab0;this['realtime']=_0x536c8d;this['routing']=_0x2d36b7;this['squeue'][_0x1a63('0x5')](this[_0x1a63('0x6')][_0x1a63('0x7')](this),this['handleTimeout']['bind'](this));this[_0x1a63('0x4')]['on'](_0x1a63('0x8'),this[_0x1a63('0x9')][_0x1a63('0x7')](this));this[_0x1a63('0x4')]['on']('drained',this[_0x1a63('0xa')][_0x1a63('0x7')](this));};Beepall[_0x1a63('0xb')][_0x1a63('0x5')]=function(){this['squeue'][_0x1a63('0x5')](this[_0x1a63('0x6')][_0x1a63('0x7')](this),this['handleTimeout'][_0x1a63('0x7')](this));};Beepall['prototype'][_0x1a63('0xa')]=function(_0x4485ea){this[_0x1a63('0x9')](!![]);};Beepall['prototype']['handleRun']=function(_0x2bf124){var _0x1cd772=!![];if(!_[_0x1a63('0xc')](this[_0x1a63('0xd')])&&!_[_0x1a63('0xc')](this['queue'][_0x1a63('0xe')])&&this['queue'][_0x1a63('0xe')][_0x1a63('0xf')]>0x0){for(var _0x6a72c1=0x0,_0xd136d9;_0x6a72c10x0){for(var _0x30b187=0x0,_0x22c104;_0x30b1870x0&&_0x541292[_0x46bb1c+'CurrentCapacity']>=_0x541292[_0x46bb1c+_0x3f2e('0x23')]){writeLog(_0x5a66d6,_0x541292,_0x46bb1c[_0x3f2e('0x24')]()+_0x3f2e('0x25'));return![];}}return!![];};exports[_0x3f2e('0x26')]=function(_0x11bad1,_0x4799d3,_0x426d68,_0x28ef64,_0x5eab38){return sendNotification(!![],_0x11bad1,_0x4799d3,_0x426d68,_0x28ef64,_0x5eab38);};exports['hideNotification']=function(_0x2b9fda,_0x1e5db4,_0x35f421,_0x22e6ad,_0x5452f5){return sendNotification(![],_0x2b9fda,_0x1e5db4,_0x35f421,_0x22e6ad,_0x5452f5);};exports[_0x3f2e('0x27')]=writeLog; \ No newline at end of file +var _0x1883=['[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','online','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','format','user:%s','name','user:save','\x20interaction','account','notificationSound','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','emit'];(function(_0x5cfc9f,_0x2d202a){var _0x2444c0=function(_0x46b525){while(--_0x46b525){_0x5cfc9f['push'](_0x5cfc9f['shift']());}};_0x2444c0(++_0x2d202a);}(_0x1883,0xab));var _0x3188=function(_0x32cc36,_0x16f24e){_0x32cc36=_0x32cc36-0x0;var _0x50120a=_0x1883[_0x32cc36];return _0x50120a;};'use strict';var _=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var utils=require(_0x3188('0x2'));var Mustache=require(_0x3188('0x3'));var Redis=require(_0x3188('0x4'));var config=require(_0x3188('0x5'));var logger=require(_0x3188('0x6'))(_0x3188('0x7'));config[_0x3188('0x8')]=_[_0x3188('0x9')](config[_0x3188('0x8')],{'host':_0x3188('0xa'),'port':0x18eb});var io=require(_0x3188('0xb'))(new Redis(config[_0x3188('0x8')]));function emit(_0x24f2f1,_0x3ce7fd,_0x3e3afb){io['to'](_0x24f2f1)['emit'](_0x3ce7fd,_0x3e3afb);}function sendNotification(_0x446ab7,_0x2a2f07,_0x53f5c0,_0x2213b5,_0x5b7f47,_0xc6040){io['to'](util[_0x3188('0xc')](_0x3188('0xd'),_0x2213b5[_0x3188('0xe')]))['emit'](_0x3188('0xf'),_0x2213b5);var _0x2cdcb2=_0xc6040||{};var _0x4dcadb=_0x53f5c0['split']('.');var _0x339b4a={'uniqueid':_0x2a2f07,'channel':_0x4dcadb[0x0],'id':_0x4dcadb[0x1],'title':_0x4dcadb[0x0]+_0x3188('0x10'),'interactionId':_0x4dcadb[0x2],'queue':_0x5b7f47?_0x5b7f47[_0x3188('0xe')]:null,'sound':_0x2cdcb2[_0x3188('0x11')][_0x3188('0x12')],'shake':_0x2cdcb2[_0x3188('0x11')]['notificationShake']};try{if(!_0x2cdcb2[_0x3188('0x13')]){_0x2cdcb2['body']={};}if(_0x5b7f47){_0x2cdcb2['body'][_0x3188('0x14')]=_0x5b7f47;}else if(_0x2cdcb2['body']['queue']){delete _0x2cdcb2[_0x3188('0x13')][_0x3188('0x14')];}_0x339b4a[_0x3188('0x15')]=utils[_0x3188('0x16')](_0x2cdcb2[_0x3188('0x11')][_0x3188('0x17')],_0x2cdcb2);}catch(_0x56e302){_0x339b4a[_0x3188('0x15')]=_0x3188('0x18');logger[_0x3188('0x19')](util[_0x3188('0xc')](_0x3188('0x1a'),_0x2a2f07,_0x56e302[_0x3188('0x1b')]));}io['to'](util[_0x3188('0xc')](_0x3188('0xd'),_0x2213b5['name']))[_0x3188('0x1c')](util[_0x3188('0xc')]('notification:%s',_0x446ab7?'save':'remove'),_0x339b4a);}function writeLog(_0x46a318,_0x8b207,_0xd292b5){return logger['info'](util['format'](_0x3188('0x1d'),_0x46a318,_0x8b207[_0x3188('0xe')],_0xd292b5));}exports[_0x3188('0x1e')]=function(_0xaf6a8e,_0xb61717,_0x4bd5ee,_0x30cf2c){if(_0xb61717[_0x3188('0x1f')]){writeLog(_0xaf6a8e,_0xb61717,'BUSY');return![];}if(!_0xb61717[_0x3188('0x20')]){writeLog(_0xaf6a8e,_0xb61717,'OFFLINE');return![];}if(_0xb61717[_0x4bd5ee+'Pause']){writeLog(_0xaf6a8e,_0xb61717,_0x3188('0x21'));return![];}if(_0x30cf2c&&_0xb61717[_0x3188('0x22')](_0x4bd5ee+_0x3188('0x23'))&&_0xb61717[_0x3188('0x22')](_0x4bd5ee+_0x3188('0x24'))){if(_0xb61717[_0x4bd5ee+_0x3188('0x23')]>0x0&&_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 diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index 663ae96..85ba09e 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 _0x8c58=['[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','isObject','stringify','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','message','join','info','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','body'];(function(_0xae282f,_0x2d9368){var _0x5f46d4=function(_0x4f703e){while(--_0x4f703e){_0xae282f['push'](_0xae282f['shift']());}};_0x5f46d4(++_0x2d9368);}(_0x8c58,0xba));var _0x88c5=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0x8c58[_0x37b7b6];return _0x10c4c3;};'use strict';var schema=require(_0x88c5('0x0'));var sh=require(_0x88c5('0x1'));var _=require('lodash');var utils=require(_0x88c5('0x2'));var logger=require(_0x88c5('0x3'))(_0x88c5('0x4'));var system=schema({'command':{'type':_0x88c5('0x5'),'required':!![],'message':_0x88c5('0x6')}});exports[_0x88c5('0x7')]=function(_0x3d8c12,_0xf92be5){return function(_0x122087){try{var _0x201139={'command':_0xf92be5[0x0]};var _0x2b6206=system[_0x88c5('0x0')](_0x201139,{'typecast':!![]});if(_0x2b6206[_0x88c5('0x8')]){logger[_0x88c5('0x9')]('[%s][SYSTEM]\x20%s',_0x3d8c12,_['map'](_0x2b6206,_0x88c5('0xa'))[_0x88c5('0xb')](',\x20'));logger[_0x88c5('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3d8c12);_0x122087[_0x88c5('0xd')]();}else{var _0xa4b0fd=this;var _0x48ef23=utils[_0x88c5('0xe')](_0xf92be5[0x0],this);logger[_0x88c5('0xc')](_0x88c5('0xf'),_0x3d8c12,_0x48ef23);sh[_0x88c5('0x10')](_['trim'](_0x48ef23),function(_0x34dfa0,_0x2ba0ad){logger['info'](_0x88c5('0x11'),_0x3d8c12,_0x34dfa0);if(_0x34dfa0==0x0){var _0x172809=_0x2ba0ad[_0x88c5('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x88c5('0x13')](_0xf92be5[0x1])||_[_0x88c5('0x14')](_0xf92be5[0x1])){logger[_0x88c5('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x3d8c12);_0xa4b0fd[_0x88c5('0x15')][_0xf92be5[0x1]]=_0x172809;}else{logger[_0x88c5('0xc')](_0x88c5('0x16'),_0x3d8c12,_0xf92be5[0x1],_0x172809);_0xa4b0fd[_0x88c5('0x15')][_0xf92be5[0x1]]=_0x172809;}}_0x122087['next']();});}}catch(_0x34a3c7){logger[_0x88c5('0x9')](_0x88c5('0x17'),_0x3d8c12,_[_0x88c5('0x18')](_0x34a3c7)?JSON[_0x88c5('0x19')](_0x34a3c7):_0x34a3c7);logger[_0x88c5('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3d8c12);_0x122087[_0x88c5('0xd')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index c6ea878..644b615 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 _0x2ac0=['../../rpc/whatsappInteraction','../../../../config/logger','routing','number','length','error','map','message','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','info','finally','next','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2ac0,0xd2));var _0x02ac=function(_0xd22d6,_0x29969c){_0xd22d6=_0xd22d6-0x0;var _0x34d4a2=_0x2ac0[_0xd22d6];return _0x34d4a2;};'use strict';var schema=require(_0x02ac('0x0'));var _=require(_0x02ac('0x1'));var rpc={'chatInteraction':require(_0x02ac('0x2')),'openchannelInteraction':require(_0x02ac('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x02ac('0x4')),'faxInteraction':require(_0x02ac('0x5')),'whatsappInteraction':require(_0x02ac('0x6'))};var logger=require(_0x02ac('0x7'))(_0x02ac('0x8'));var tag=schema({'tag':{'type':_0x02ac('0x9'),'required':!![],'message':'TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x8739f8,_0x52fa6e,_0x66f3de,_0xbf7243){return function(_0x38bd9c){try{var _0x32e14f={'tag':_0x52fa6e[0x0]};var _0x124d94=tag[_0x02ac('0x0')](_0x32e14f,{'typecast':!![]});if(_0x124d94[_0x02ac('0xa')]){logger[_0x02ac('0xb')]('[%s][TAG]\x20%s',_0x8739f8,_[_0x02ac('0xc')](_0x124d94,_0x02ac('0xd'))['join'](',\x20'));logger['info'](_0x02ac('0xe'),_0x8739f8);_0x38bd9c['next']();}else{var _0x4d552b={'ids':[_0x52fa6e[0x0]]};if(rpc[_0xbf7243[_0x02ac('0xf')]+_0x02ac('0x10')]){rpc[_0xbf7243[_0x02ac('0xf')]+_0x02ac('0x10')][_0x02ac('0x11')](_0xbf7243[_0x02ac('0x12')]['id'],_0x4d552b)[_0x02ac('0x13')](function(_0x353de6){logger['info'](_0x02ac('0x14'),_0x8739f8,_0x52fa6e[0x1],_0xbf7243['channel'],_0xbf7243['interaction']['id']);})[_0x02ac('0x15')](function(_0xbf6cf3){logger[_0x02ac('0xb')](_0x02ac('0x16'),_0x8739f8,JSON[_0x02ac('0x17')](_0xbf6cf3));logger[_0x02ac('0x18')](_0x02ac('0xe'),_0x8739f8);})[_0x02ac('0x19')](function(){_0x38bd9c[_0x02ac('0x1a')]();});}}}catch(_0x14d3d2){logger[_0x02ac('0xb')](_0x02ac('0x16'),_0x8739f8,_['isObject'](_0x14d3d2)?JSON[_0x02ac('0x17')](_0x14d3d2):_0x14d3d2);logger['info'](_0x02ac('0xe'),_0x8739f8);_0x38bd9c['next']();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 75b57b5..1d9deb4 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 _0x7bd5=['[%s][TVOX]\x20%s','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','urlOnRing','title','jsonrpc','2.0','method','login','push','params','stringify','utf8','POST','application/json-rpc','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','then','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch'];(function(_0x108a04,_0x3ee8da){var _0x1edc76=function(_0x285315){while(--_0x285315){_0x108a04['push'](_0x108a04['shift']());}};_0x1edc76(++_0x3ee8da);}(_0x7bd5,0xdb));var _0x57bd=function(_0x4aada6,_0x420b99){_0x4aada6=_0x4aada6-0x0;var _0x4f66fb=_0x7bd5[_0x4aada6];return _0x4f66fb;};'use strict';var rp=require(_0x57bd('0x0'));var logger=require('../../../../config/logger')(_0x57bd('0x1'));var _=require(_0x57bd('0x2'));var arr=[];exports[_0x57bd('0x3')]=function(_0x24d2ad,_0x320ed1){return function(_0x590589){var _0x1b6d0=_0x320ed1[0xa];var _0x359c27=_0x320ed1[0xb];var _0x93bf0e=_0x320ed1[0xc];var _0x27d15b=_0x320ed1[0xd];var _0x51bfe0=_0x320ed1[0xe];var _0x5240b9=_0x320ed1[0xf][_0x57bd('0x4')](/\n/g,_0x57bd('0x5'));var _0x396c3d=_0x320ed1[0x10]['replace'](/\n/g,'\x20');if(!arr[_0x57bd('0x6')](_0x359c27)){arr['push'](_0x359c27);var _0x144c4a=_0x320ed1[0x3];var _0x422de2=_0x320ed1[0x4];var _0x2ef8ae=_0x320ed1[0x1];var _0x490912=_0x320ed1[0x0];var _0x105e23={};_0x105e23[_0x57bd('0x7')]=_0x320ed1[0x8]+_0x57bd('0x8')+_0x93bf0e+'|'+_0x1b6d0+'|'+_0x27d15b+'|'+_0x359c27+'|'+_0x51bfe0;_0x105e23[_0x57bd('0x9')]=_0x320ed1[0x7]+'?params='+_0x93bf0e+'|'+_0x1b6d0+'|'+_0x27d15b+'|'+_0x359c27+'|'+_0x51bfe0+'|'+_0x5240b9+'|'+_0x396c3d;_0x105e23[_0x57bd('0xa')]=_0x320ed1[0x9];var _0x211d4f={};_0x211d4f[_0x57bd('0xb')]=_0x57bd('0xc');_0x211d4f[_0x57bd('0xd')]=_0x57bd('0xe');var _0x123050=[];_0x123050['push'](_0x320ed1[0x2]);_0x123050[_0x57bd('0xf')](_0x320ed1[0x5]);_0x123050['push'](_0x320ed1[0x6]);_0x211d4f[_0x57bd('0x10')]=_0x123050;_0x211d4f['id']=0x1;var _0x4be9d0=JSON[_0x57bd('0x11')](_0x211d4f);var _0x13c3d9={'encoding':_0x57bd('0x12'),'method':_0x57bd('0x13'),'timeout':0x2710,'url':_0x144c4a,'headers':{'Content-Type':_0x57bd('0x14')},'body':_0x4be9d0};return rp(_0x13c3d9)['then'](function(_0x473115){const _0x12d281=JSON[_0x57bd('0x15')](_0x473115);if(!_0x12d281[_0x57bd('0x16')]['logged']){throw new Error(_0x57bd('0x17'));}var _0x5d8299=_0x359c27;var _0x32dcd6=_0x57bd('0x18')+_0x2ef8ae+_0x57bd('0x19')+_0x490912+_0x57bd('0x1a')+_0x5d8299+_0x57bd('0x1b')+JSON[_0x57bd('0x11')](_0x105e23);var _0x35f66a=_0x422de2+'?'+_0x32dcd6;return rp(_0x35f66a);})[_0x57bd('0x1c')](function(_0x4aff06){logger[_0x57bd('0x1d')](_0x57bd('0x1e'),_0x24d2ad,_0x4aff06);_0x590589[_0x57bd('0x1f')]();})[_0x57bd('0x20')](function(_0x2ae9d5){logger['error'](_0x57bd('0x21'),_0x24d2ad,_['isObject'](_0x2ae9d5)?JSON[_0x57bd('0x11')](_0x2ae9d5):_0x2ae9d5);_0x590589[_0x57bd('0x1f')]();});}else{logger['info'](_0x57bd('0x22'),_0x24d2ad);_0x590589[_0x57bd('0x23')]();}};}; \ No newline at end of file +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 diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index fd4f6a6..2e3ff0e 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 _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x415c03,_0x4bb522){var _0x48baf6=function(_0x4d27e3){while(--_0x4d27e3){_0x415c03['push'](_0x415c03['shift']());}};_0x48baf6(++_0x4bb522);}(_0xe706,0xa3));var _0x6e70=function(_0x5abb00,_0x342d70){_0x5abb00=_0x5abb00-0x0;var _0xf9b854=_0xe706[_0x5abb00];return _0xf9b854;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +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 diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 1d136e3..55fd78a 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 _0xd845=['available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','format','IntervalId','isNil','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','appdata','mail','push','slice','split','dialogflowv2','tag','tvox','getMustacheRender','account','notificationTemplate','ChatWebsiteId','body','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','agent','agents','busy','end','QueueReport','update','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues'];(function(_0x143c73,_0x24f842){var _0x4ad747=function(_0x314211){while(--_0x314211){_0x143c73['push'](_0x143c73['shift']());}};_0x4ad747(++_0x24f842);}(_0xd845,0x135));var _0x5d84=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xd845[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x5d84('0x0'));var util=require(_0x5d84('0x1'));var path=require(_0x5d84('0x2'));var fs=require('fs');var jayson=require(_0x5d84('0x3'));var BPromise=require('bluebird');var uuid=require(_0x5d84('0x4'));var utils=require(_0x5d84('0x5'));var config=require(_0x5d84('0x6'));var logger=require(_0x5d84('0x7'))('routing');var rpc={'openchannelQueueReport':require(_0x5d84('0x8')),'mailQueueReport':require(_0x5d84('0x9')),'chatQueueReport':require(_0x5d84('0xa')),'smsQueueReport':require(_0x5d84('0xb')),'faxQueueReport':require(_0x5d84('0xc')),'whatsappQueueReport':require(_0x5d84('0xd'))};var RuleEngine=require('../lib/rule-engine');function getId(_0x135c45,_0x493231,_0x8958eb){return util[_0x5d84('0xe')]('%s.%s.%s',_0x135c45,_0x493231||0x0,_0x8958eb||0x0);}function getIntervals(_0x13dfc9,_0x2cf40d){var _0x5a377b=[];if(!_['isNil'](_0x2cf40d[_0x5d84('0xf')])&&!_[_0x5d84('0x10')](_0x13dfc9[_0x2cf40d[_0x5d84('0xf')]])&&!_[_0x5d84('0x10')](_0x13dfc9[_0x2cf40d[_0x5d84('0xf')]]['Intervals'])){_0x5a377b=_[_0x5d84('0x11')](_0x13dfc9[_0x2cf40d[_0x5d84('0xf')]][_0x5d84('0x12')],_0x5d84('0x13'));}else if(!_[_0x5d84('0x10')](_0x2cf40d[_0x5d84('0x13')])){_0x5a377b=[_0x2cf40d['interval']];}return _0x5a377b;}exports[_0x5d84('0x14')]=function(_0x56aa9c){_0x56aa9c[_0x5d84('0x15')]={};return new BPromise(function(_0x2b6ca3,_0x2d1325){var _0x47c2bb={'Start':function(_0x25e6b5){var _0x153244=this;return new Promise(function(_0x206c31,_0x3a73ed){if(_0x25e6b5){try{var _0x474937=[];var _0x4c4dc6=getId(_0x25e6b5[_0x5d84('0x16')],_0x25e6b5['message']?_0x25e6b5[_0x5d84('0x17')]['id']:0x0,_0x25e6b5['interaction']?_0x25e6b5[_0x5d84('0x18')]['id']:0x0);if(_0x25e6b5[_0x5d84('0x19')]&&_[_0x5d84('0x1a')](_0x25e6b5[_0x5d84('0x19')])&&_0x25e6b5[_0x5d84('0x19')][_0x5d84('0x1b')]){for(var _0x4a6b43=0x0;_0x4a6b43<_0x25e6b5['applications']['length'];_0x4a6b43+=0x1){var _0x4e1247=_0x25e6b5[_0x5d84('0x19')][_0x4a6b43];if(fs[_0x5d84('0x1c')](path[_0x5d84('0x1d')](__dirname,_0x5d84('0x19'),_0x4e1247[_0x5d84('0x1e')]+_0x5d84('0x1f')))){var _0xcd46ce=[];switch(_0x4e1247['app']['toLowerCase']()){case'autoreply':var _0x5a08c9=_0x4e1247[_0x5d84('0x20')]['split'](',');if(_0x25e6b5[_0x5d84('0x16')]===_0x5d84('0x21')){_0xcd46ce[_0x5d84('0x22')](_0x5a08c9[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x5a08c9[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x5a08c9['slice'](0x2,_0x5a08c9[_0x5d84('0x1b')])[_0x5d84('0x1d')](','));}else{_0xcd46ce['push'](_0x5a08c9[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x5a08c9[_0x5d84('0x23')](0x1,_0x5a08c9['length'])[_0x5d84('0x1d')](','));}break;case'dialogflow':var _0x290cce=_0x4e1247[_0x5d84('0x20')][_0x5d84('0x24')](',');_0xcd46ce['push'](_0x290cce[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x290cce[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x290cce[_0x5d84('0x23')](0x2,_0x290cce[_0x5d84('0x1b')])['join'](','));break;case _0x5d84('0x25'):var _0x1a533e=_0x4e1247[_0x5d84('0x20')]['split'](',');_0xcd46ce[_0x5d84('0x22')](_0x1a533e[0x0]);_0xcd46ce['push'](_0x1a533e[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x1a533e[0x2]);_0xcd46ce['push'](_0x1a533e[0x3]);_0xcd46ce[_0x5d84('0x22')](_0x1a533e[_0x5d84('0x23')](0x4,_0x1a533e[_0x5d84('0x1b')])[_0x5d84('0x1d')](','));break;case'amazonlex':var _0x805a12=_0x4e1247[_0x5d84('0x20')][_0x5d84('0x24')](',');_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x1]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x2]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[0x3]);_0xcd46ce[_0x5d84('0x22')](_0x805a12[_0x5d84('0x23')](0x4,_0x805a12[_0x5d84('0x1b')])[_0x5d84('0x1d')](','));break;case _0x5d84('0x17'):_0xcd46ce[_0x5d84('0x22')](_0x4e1247['appdata']);break;case _0x5d84('0x26'):_0xcd46ce[_0x5d84('0x22')](_0x4e1247['TagId']);_0xcd46ce[_0x5d84('0x22')](_0x4e1247['appdata']);break;case _0x5d84('0x27'):var _0x385060=utils[_0x5d84('0x28')](_0x25e6b5[_0x5d84('0x29')][_0x5d84('0x2a')],_0x25e6b5);var _0x304966=_0x4e1247[_0x5d84('0x20')][_0x5d84('0x24')](',');_0xcd46ce[_0x5d84('0x22')](_0x304966[0x0]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x1]);_0xcd46ce['push'](_0x304966[0x2]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x3]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x4]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x5]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x6]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x7]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x8]);_0xcd46ce[_0x5d84('0x22')](_0x304966[0x9]);_0xcd46ce['push'](_0x304966[0xa]);_0xcd46ce['push'](_0x25e6b5[_0x5d84('0x18')]['id']);_0xcd46ce[_0x5d84('0x22')](_0x25e6b5[_0x5d84('0x17')]['id']);_0xcd46ce[_0x5d84('0x22')](_0x4e1247[_0x5d84('0x2b')]);_0xcd46ce[_0x5d84('0x22')](_0x25e6b5[_0x5d84('0x18')]['ContactId']);_0xcd46ce['push'](_0x25e6b5[_0x5d84('0x2c')]['body']);_0xcd46ce[_0x5d84('0x22')](_0x385060);break;default:_0xcd46ce=_[_0x5d84('0x10')](_0x4e1247[_0x5d84('0x20')])?[]:_0x4e1247[_0x5d84('0x20')]['split'](',');}var _0x3e6be8={'id':util[_0x5d84('0xe')]('%s:%s:%s',_0x4c4dc6,_0x4e1247['id'],_0x4e1247[_0x5d84('0x1e')]),'condition':require(_0x5d84('0x2d'))[_0x5d84('0x2e')](_0x4c4dc6,getIntervals(_0x56aa9c[_0x5d84('0x2f')],_0x4e1247),_0x56aa9c),'consequence':require(_0x5d84('0x30')+_0x4e1247[_0x5d84('0x1e')])[_0x5d84('0x31')](_0x4c4dc6,_0xcd46ce,_0x56aa9c,_0x25e6b5),'p':_0x4e1247[_0x5d84('0x32')]||0x0};logger[_0x5d84('0x33')](_0x5d84('0x34'),_0x3e6be8['id'],_0x5d84('0x35'),getIntervals(_0x56aa9c[_0x5d84('0x2f')],_0x4e1247)[_0x5d84('0x1d')](_0x5d84('0x36')));_0x474937[_0x5d84('0x22')](_0x3e6be8);}else{logger[_0x5d84('0x37')](_0x5d84('0x38'),path[_0x5d84('0x1d')](__dirname,_0x5d84('0x19'),_0x4e1247[_0x5d84('0x1e')]+'.js'));}}_0x56aa9c['rules'][_0x4c4dc6]=new RuleEngine(_0x474937);_0x56aa9c[_0x5d84('0x15')][_0x4c4dc6]['execute'](_0x25e6b5,function(_0x5223a2){logger[_0x5d84('0x33')]('Applications\x20executed',JSON[_0x5d84('0x39')](_0x5223a2[_0x5d84('0x3a')]));if(_0x56aa9c['rules'][_0x4c4dc6]){_0x56aa9c[_0x5d84('0x15')][_0x4c4dc6][_0x5d84('0x3b')](_0x5d84('0x3c'));}});return _0x206c31({'code':0xc8,'message':_0x25e6b5});}else{logger['info'](_0x5d84('0x3d'));return _0x206c31({'code':0xc8,'message':_0x25e6b5});}}catch(_0x5aaf63){logger[_0x5d84('0x37')](_0x5aaf63[_0x5d84('0x3e')]);return _0x3a73ed(_0x153244[_0x5d84('0x37')](0x1f4,_0x5aaf63));}}return _0x3a73ed('routing\x20is\x20empty');});},'AcceptMessage':function(_0x1114ac){var _0x3f2044=this;return new Promise(function(_0x403bf4,_0x47743d){if(_0x1114ac[_0x5d84('0x3f')]&&_0x1114ac['agent']['id']){if(_0x56aa9c[_0x5d84('0x40')][_0x1114ac[_0x5d84('0x3f')]['id']]){_0x56aa9c[_0x5d84('0x40')][_0x1114ac[_0x5d84('0x3f')]['id']][_0x5d84('0x41')]=![];_0x56aa9c[_0x5d84('0x40')][_0x1114ac[_0x5d84('0x3f')]['id']]['busyQueue']=undefined;}}if(_0x1114ac[_0x5d84('0x17')]&&_0x1114ac[_0x5d84('0x17')]['id']){try{var _0x125d95=getId(_0x1114ac[_0x5d84('0x16')],_0x1114ac[_0x5d84('0x17')]?_0x1114ac['message']['id']:0x0,_0x1114ac['interaction']?_0x1114ac[_0x5d84('0x18')]['id']:0x0);if(_0x56aa9c[_0x5d84('0x15')][_0x125d95]){_0x56aa9c[_0x5d84('0x15')][_0x125d95][_0x5d84('0x3b')](_0x5d84('0x42'));if(rpc[_0x1114ac[_0x5d84('0x16')]+'QueueReport']){rpc[_0x1114ac[_0x5d84('0x16')]+_0x5d84('0x43')][_0x5d84('0x44')](_0x125d95,{'UserId':_0x1114ac[_0x5d84('0x17')]['UserId']})['catch'](function(_0x2f900c){logger[_0x5d84('0x37')](_0x5d84('0x45'));});}}return _0x403bf4({'code':0xc8,'message':_0x1114ac});}catch(_0x1df997){logger[_0x5d84('0x37')](_0x1df997[_0x5d84('0x3e')]);return _0x47743d(_0x3f2044[_0x5d84('0x37')](0x1f4,_0x1df997));}}logger[_0x5d84('0x37')](_0x5d84('0x46'));return _0x47743d(_0x3f2044[_0x5d84('0x37')](0x1f4,_0x5d84('0x46')));});},'RejectMessage':function(_0x111cd6){var _0xc528f2=this;return new Promise(function(_0x41257c,_0x3c99fc){if(_0x111cd6[_0x5d84('0x3f')]&&_0x111cd6['agent']['id']){try{if(_0x56aa9c['agents'][_0x111cd6[_0x5d84('0x3f')]['id']]){_0x56aa9c[_0x5d84('0x40')][_0x111cd6[_0x5d84('0x3f')]['id']]['busy']=![];_0x56aa9c[_0x5d84('0x40')][_0x111cd6['agent']['id']][_0x5d84('0x47')]=undefined;}return _0x41257c({'code':0xc8,'message':_0x111cd6});}catch(_0x4547d4){logger[_0x5d84('0x37')](_0x4547d4[_0x5d84('0x3e')]);return _0x3c99fc(_0xc528f2[_0x5d84('0x37')](0x1f4,_0x4547d4));}}logger['error'](_0x5d84('0x46'));return _0x3c99fc(_0xc528f2[_0x5d84('0x37')](0x1f4,_0x5d84('0x46')));});},'AbandonInteraction':function(_0x1cc197){var _0x36247e=this;return new Promise(function(_0x578ad2,_0x229af9){if(_0x1cc197[_0x5d84('0x16')]&&_0x1cc197['interaction']&&_0x1cc197['interaction']['id']){try{var _0x11bf89=getId(_0x1cc197[_0x5d84('0x16')],_0x1cc197[_0x5d84('0x17')]?_0x1cc197['message']['id']:0x0,_0x1cc197[_0x5d84('0x18')]?_0x1cc197['interaction']['id']:0x0);if(_0x56aa9c[_0x5d84('0x15')][_0x11bf89]){_0x56aa9c[_0x5d84('0x15')][_0x11bf89]['emit'](_0x5d84('0x42'));}return _0x578ad2({'code':0xc8,'message':_0x1cc197});}catch(_0x4f6314){logger[_0x5d84('0x37')](_0x4f6314['stack']);return _0x229af9(_0x36247e[_0x5d84('0x37')](0x1f4,_0x4f6314));}}logger[_0x5d84('0x37')](_0x5d84('0x46'));return _0x229af9(_0x36247e[_0x5d84('0x37')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x384f73){var _0x141322=this;return new Promise(function(_0x17817d,_0x2abc72){if(_0x56aa9c[_0x5d84('0x40')]['hasOwnProperty'](_0x384f73['id'])){for(var _0x885b11 in _0x384f73[_0x5d84('0x48')]){if(_0x384f73[_0x5d84('0x48')][_0x5d84('0x49')](_0x885b11)){if(_0x56aa9c[_0x5d84('0x40')][_0x384f73['id']][_0x5d84('0x49')](_0x885b11+_0x5d84('0x4a'))){_0x56aa9c[_0x5d84('0x40')][_0x384f73['id']][_0x885b11+_0x5d84('0x4a')]=parseInt(_0x384f73[_0x5d84('0x48')][_0x885b11],0xa);}}}_0x56aa9c['agents'][_0x384f73['id']][_0x5d84('0x4b')]();return _0x17817d({'code':0xc8,'message':_0x56aa9c[_0x5d84('0x40')][_0x384f73['id']]});}else{return _0x2abc72(_0x141322['error'](0x1f4,_0x5d84('0x4c')));}});},'Agents':function(_0x2cb0c4){return new Promise(function(_0x20d4f9,_0x3a1b40){var _0xed003d=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x40')]);_0x20d4f9({'count':_0xed003d[_0x5d84('0x1b')],'rows':_0xed003d});});},'ChatQueues':function(_0x476361){return new Promise(function(_0x50d80a,_0x37851){var _0x3b4f40=[];for(var _0x10ea4b in _0x56aa9c[_0x5d84('0x4e')]){if(_0x56aa9c[_0x5d84('0x4e')]['hasOwnProperty'](_0x10ea4b)){var _0x4b945c=_0x56aa9c['chatQueues'][_0x10ea4b];var _0x1a2cd4={'id':_0x4b945c['id'],'available':_0x4b945c[_0x5d84('0x4f')],'loggedIn':_0x4b945c[_0x5d84('0x50')],'name':_0x4b945c[_0x5d84('0x51')],'paused':_0x4b945c[_0x5d84('0x52')],'waiting':_0x4b945c[_0x5d84('0x53')]};_0x3b4f40[_0x5d84('0x22')](_0x1a2cd4);}}_0x50d80a({'count':_0x3b4f40[_0x5d84('0x1b')],'rows':_0x3b4f40});});},'MailQueues':function(_0x342301){return new Promise(function(_0x2ca687,_0x24e31a){var _0x3b12d2=[];for(var _0x52a10e in _0x56aa9c[_0x5d84('0x54')]){if(_0x56aa9c['mailQueues']['hasOwnProperty'](_0x52a10e)){var _0x104575=_0x56aa9c[_0x5d84('0x54')][_0x52a10e];var _0x535c88={'id':_0x104575['id'],'available':_0x104575[_0x5d84('0x4f')],'loggedIn':_0x104575[_0x5d84('0x50')],'name':_0x104575[_0x5d84('0x51')],'paused':_0x104575['paused'],'waiting':_0x104575['waiting']};_0x3b12d2[_0x5d84('0x22')](_0x535c88);}}_0x2ca687({'count':_0x3b12d2['length'],'rows':_0x3b12d2});});},'OpenchannelQueues':function(_0x929b49){return new Promise(function(_0x231b8c,_0x5610cd){var _0x75420e=[];for(var _0x3a4a5 in _0x56aa9c['openchannelQueues']){if(_0x56aa9c[_0x5d84('0x55')][_0x5d84('0x49')](_0x3a4a5)){var _0x437c56=_0x56aa9c['openchannelQueues'][_0x3a4a5];var _0x3a4df0={'id':_0x437c56['id'],'available':_0x437c56[_0x5d84('0x4f')],'loggedIn':_0x437c56['loggedIn'],'name':_0x437c56[_0x5d84('0x51')],'paused':_0x437c56[_0x5d84('0x52')],'waiting':_0x437c56[_0x5d84('0x53')]};_0x75420e[_0x5d84('0x22')](_0x3a4df0);}}_0x231b8c({'count':_0x75420e[_0x5d84('0x1b')],'rows':_0x75420e});});},'SmsQueues':function(_0x1c2887){return new Promise(function(_0x48378c,_0x562f75){var _0x47e8ac=[];for(var _0x1a89a4 in _0x56aa9c[_0x5d84('0x56')]){if(_0x56aa9c['smsQueues'][_0x5d84('0x49')](_0x1a89a4)){var _0x5af93c=_0x56aa9c[_0x5d84('0x56')][_0x1a89a4];var _0x2fa97f={'id':_0x5af93c['id'],'available':_0x5af93c[_0x5d84('0x4f')],'loggedIn':_0x5af93c[_0x5d84('0x50')],'name':_0x5af93c['name'],'paused':_0x5af93c[_0x5d84('0x52')],'waiting':_0x5af93c[_0x5d84('0x53')]};_0x47e8ac[_0x5d84('0x22')](_0x2fa97f);}}_0x48378c({'count':_0x47e8ac[_0x5d84('0x1b')],'rows':_0x47e8ac});});},'FaxQueues':function(_0x587e11){return new Promise(function(_0x2a96c3,_0x598a10){var _0x4e4b67=[];for(var _0x334463 in _0x56aa9c[_0x5d84('0x57')]){if(_0x56aa9c[_0x5d84('0x57')][_0x5d84('0x49')](_0x334463)){var _0x320668=_0x56aa9c[_0x5d84('0x57')][_0x334463];var _0x38752f={'id':_0x320668['id'],'available':_0x320668['available'],'loggedIn':_0x320668[_0x5d84('0x50')],'name':_0x320668[_0x5d84('0x51')],'paused':_0x320668['paused'],'waiting':_0x320668[_0x5d84('0x53')]};_0x4e4b67[_0x5d84('0x22')](_0x38752f);}}_0x2a96c3({'count':_0x4e4b67['length'],'rows':_0x4e4b67});});},'WhatsappQueues':function(_0x4f21d3){return new Promise(function(_0xf6b8cf,_0x3e1b7a){var _0x1eea3b=[];for(var _0x305068 in _0x56aa9c['whatsappQueues']){if(_0x56aa9c[_0x5d84('0x58')][_0x5d84('0x49')](_0x305068)){var _0x1ec85a=_0x56aa9c[_0x5d84('0x58')][_0x305068];var _0x1f24e1={'id':_0x1ec85a['id'],'available':_0x1ec85a[_0x5d84('0x4f')],'loggedIn':_0x1ec85a[_0x5d84('0x50')],'name':_0x1ec85a[_0x5d84('0x51')],'paused':_0x1ec85a[_0x5d84('0x52')],'waiting':_0x1ec85a[_0x5d84('0x53')]};_0x1eea3b[_0x5d84('0x22')](_0x1f24e1);}}_0xf6b8cf({'count':_0x1eea3b[_0x5d84('0x1b')],'rows':_0x1eea3b});});},'ChatQueuesWaitingInteractions':function(_0xd4586b){return new Promise(function(_0x39c70b,_0x415ee0){var _0x34c034=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x59')]);_0x39c70b({'count':_0x34c034['length'],'rows':_0x34c034});});},'MailQueuesWaitingInteractions':function(_0x225cb7){return new Promise(function(_0x1d41d2,_0x254231){var _0x19a59b=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x5a')]);_0x1d41d2({'count':_0x19a59b[_0x5d84('0x1b')],'rows':_0x19a59b});});},'OpenchannelQueuesWaitingInteractions':function(_0x28fd0b){return new Promise(function(_0x29996e,_0x4d56a7){var _0x324739=_[_0x5d84('0x4d')](_0x56aa9c[_0x5d84('0x5b')]);_0x29996e({'count':_0x324739[_0x5d84('0x1b')],'rows':_0x324739});});},'SmsQueuesWaitingInteractions':function(_0x12a48d){return new Promise(function(_0x21e907,_0x53368f){var _0x29294f=_[_0x5d84('0x4d')](_0x56aa9c['smsQueuesWaitingInteractions']);_0x21e907({'count':_0x29294f[_0x5d84('0x1b')],'rows':_0x29294f});});},'FaxQueuesWaitingInteractions':function(_0x344aab){return new Promise(function(_0x47646c,_0x43ad34){var _0x5ecd12=_['values'](_0x56aa9c[_0x5d84('0x5c')]);_0x47646c({'count':_0x5ecd12[_0x5d84('0x1b')],'rows':_0x5ecd12});});},'WhatsappQueuesWaitingInteractions':function(_0x1a7562){return new Promise(function(_0x1a8dd4,_0x3fcd63){var _0x5b7cb4=_['values'](_0x56aa9c[_0x5d84('0x5d')]);_0x1a8dd4({'count':_0x5b7cb4[_0x5d84('0x1b')],'rows':_0x5b7cb4});});}};var _0x3cf87e=jayson['server'](_0x47c2bb)['http']();_0x3cf87e['on'](_0x5d84('0x37'),function(_0x4189ec){logger['error'](JSON[_0x5d84('0x39')](_0x4189ec));return _0x2d1325(_0x4189ec);});_0x3cf87e[_0x5d84('0x14')](0x232c,_0x5d84('0x5e'),function(){console['log'](_0x5d84('0x5f'),0x232c);return _0x2b6ca3(_0x5d84('0x60')+0x232c);});});}; \ No newline at end of file +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 diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index d8256d9..ea50d61 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 _0x792b=['[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','stack','util','jayson/promise','../../../config/logger','routing','client','http','request','error','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','push','iftime\x20%s','then','message','indexOf','true','[%s][INTERVAL]\x20%s','all','some'];(function(_0x58aedb,_0x739073){var _0x2942ef=function(_0x4df428){while(--_0x4df428){_0x58aedb['push'](_0x58aedb['shift']());}};_0x2942ef(++_0x739073);}(_0x792b,0x1f2));var _0xb792=function(_0x387603,_0x5a2d1){_0x387603=_0x387603-0x0;var _0x55ea9e=_0x792b[_0x387603];return _0x55ea9e;};'use strict';var util=require(_0xb792('0x0'));var BPromise=require('bluebird');var jayson=require(_0xb792('0x1'));var _=require('lodash');var logger=require(_0xb792('0x2'))(_0xb792('0x3'));var client=jayson[_0xb792('0x4')][_0xb792('0x5')]({'port':0x232a});function request(_0x5bd87e,_0x50ebcd){return new BPromise(function(_0x5938fb,_0x24069e){return client[_0xb792('0x6')](_0x5bd87e,_0x50ebcd)['then'](function(_0x45a4cb){if(_0x45a4cb[_0xb792('0x7')]){return _0x24069e(_0x45a4cb['error']['message']);}else{return _0x5938fb(_0x45a4cb[_0xb792('0x8')]);}})[_0xb792('0x9')](function(_0xbcfc68){return _0x24069e(_0xbcfc68);});});}exports[_0xb792('0xa')]=function(_0x2ce106,_0x175de8,_0x284847){return function(_0x5803cc){if(_0x284847['rules']&&!_0x284847[_0xb792('0xb')][_0x2ce106]){logger[_0xb792('0xc')](_0xb792('0xd'),_0x2ce106);return _0x5803cc['stop']();}var _0x3aed3f=[];for(var _0x1ea5cd=0x0;_0x1ea5cd<_0x175de8[_0xb792('0xe')];_0x1ea5cd+=0x1){_0x3aed3f[_0xb792('0xf')](request('Command',{'command':util['format'](_0xb792('0x10'),_0x175de8[_0x1ea5cd])})[_0xb792('0x11')](function(_0x49a79e){return _0x49a79e&&_0x49a79e[_0xb792('0x12')]&&_0x49a79e[_0xb792('0x12')][_0xb792('0x13')](_0xb792('0x14'))>=0x0?!![]:![];})[_0xb792('0x9')](function(_0x458e75){logger['error'](_0xb792('0x15'),_0x2ce106,_0x175de8[_0x1ea5cd]);}));}BPromise[_0xb792('0x16')](_0x3aed3f)['then'](function(_0x1d90cb){var _0x4db60b=_[_0xb792('0x17')](_0x1d90cb);logger[_0xb792('0xc')](_0xb792('0x18'),_0x2ce106,_0x175de8[_0xb792('0x19')](_0xb792('0x1a')),_0x4db60b);_0x5803cc['when'](_0x4db60b);})[_0xb792('0x9')](function(_0x238b75){console[_0xb792('0x1b')](_0x238b75);logger[_0xb792('0x7')](_0xb792('0x18'),_0x2ce106,_0x175de8[_0xb792('0x19')](_0xb792('0x1a')),_0x238b75[_0xb792('0x1c')]);_0x5803cc['stop']();});};}; \ No newline at end of file +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 diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 72f9c25..7f2d6d5 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 _0xf4eb=['request','debug','format','[%s][agents][agentcalled]','destuniqueid','now','lastevent','connectedlinename','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','push','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentconnect]','agentcompleteAt','diffTime','complete','[%s][agents][agentcomplete]','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','agentcalledAt','agententerreason','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','lodash','info','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','then','type','agentacw','agentcomplete','acw','acwTimeout','CreateVoiceAgentReport'];(function(_0x1a9bdf,_0x43130a){var _0x61a042=function(_0x13fdf5){while(--_0x13fdf5){_0x1a9bdf['push'](_0x1a9bdf['shift']());}};_0x61a042(++_0x43130a);}(_0xf4eb,0xec));var _0xbf4e=function(_0x128f5b,_0x3dbd01){_0x128f5b=_0x128f5b-0x0;var _0x82aed6=_0xf4eb[_0x128f5b];return _0x82aed6;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x479210,_0x5ed5b9){utils[_0xbf4e('0x1')](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x479210[_0xbf4e('0x2')],_0x479210[_0xbf4e('0x3')],_0x479210[_0xbf4e('0x4')],_0x479210[_0xbf4e('0x5')],_0x479210[_0xbf4e('0x6')],_0x479210[_0xbf4e('0x7')],_0x479210[_0xbf4e('0x8')],_0x479210['lastevent']));if(_0x479210[_0xbf4e('0x4')]){utils['getVoiceQueueByName'](_0x479210['queue'])[_0xbf4e('0x9')](function(_0x3761c1){if(_0x3761c1){_0x479210[_0xbf4e('0xa')]=_0x3761c1[_0xbf4e('0xa')];_0x479210[_0xbf4e('0xb')]=_0x479210[_0xbf4e('0xc')]?_0x3761c1[_0xbf4e('0xd')]:![];_0x479210['acwtime']=_0x479210['agentacw']?_0x3761c1[_0xbf4e('0xe')]:0x0;}utils['request'](_0xbf4e('0xf'),_0x479210);});}else{utils[_0xbf4e('0x10')]('CreateVoiceAgentReport',_0x479210);}if(_0x5ed5b9){delete transfers[_0x479210[_0xbf4e('0x2')]];}else{delete agents[_0x479210['destuniqueid']];}}exports['agentcalled']=function(_0x209b25){try{utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x13'),_0x209b25[_0xbf4e('0x2')]),_0x209b25);agents[_0x209b25[_0xbf4e('0x14')]]=_0x209b25;agents[_0x209b25['destuniqueid']]['agentcalledAt']=utils[_0xbf4e('0x15')]();agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x16')]='called';agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x8')]=null;agents[_0x209b25[_0xbf4e('0x14')]][_0xbf4e('0x17')]=null;utils['info'](util[_0xbf4e('0x12')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x209b25['uniqueid'],agents[_0x209b25['destuniqueid']]['membername'],_0x209b25[_0xbf4e('0x14')]));}catch(_0x1ca73c){utils[_0xbf4e('0x18')](util['format']('[%s][agents][agentcalled]',_0x209b25[_0xbf4e('0x2')]),_0x1ca73c);}};exports[_0xbf4e('0x19')]=function(_0x3be138){try{if(!_[_0xbf4e('0x1a')](agents[_0x3be138[_0xbf4e('0x14')]])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x1b'),_0x3be138[_0xbf4e('0x2')]),_0x3be138);utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x3be138[_0xbf4e('0x2')],agents[_0x3be138[_0xbf4e('0x14')]]['membername'],_0x3be138[_0xbf4e('0x14')]));agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x19')]=!![];agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x1c')]=utils['now']();agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x1d');agents[_0x3be138['destuniqueid']][_0xbf4e('0x1e')]='timeout';agents[_0x3be138['destuniqueid']][_0xbf4e('0x1f')]=_0x3be138['ringtime']?parseInt(_0x3be138[_0xbf4e('0x20')])/0x3e8:0x0;agents[_0x3be138[_0xbf4e('0x14')]][_0xbf4e('0x21')]=0x0;unanswered[_0xbf4e('0x22')](_0x3be138['destuniqueid']);}}catch(_0x2d4686){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][agentringnoanswer]',_0x3be138[_0xbf4e('0x2')]),_0x2d4686);}};exports['queuecallerabandon']=function(_0x1dfa81){try{_[_0xbf4e('0x23')](agents,function(_0xb8b58e,_0x498dbd){if(_0xb8b58e[_0xbf4e('0x2')]==_0x1dfa81[_0xbf4e('0x2')]&&!_[_0xbf4e('0x24')](unanswered,_0xb8b58e[_0xbf4e('0x14')])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')]('[%s][agents][queuecallerabandon]',_0x1dfa81[_0xbf4e('0x2')]),_0x1dfa81);utils[_0xbf4e('0x1')](util['format'](_0xbf4e('0x25'),_0x1dfa81[_0xbf4e('0x2')],_0xb8b58e['membername'],_0xb8b58e[_0xbf4e('0x14')]));_0xb8b58e['agentringnoanswer']=!![];_0xb8b58e[_0xbf4e('0x1c')]=utils['now']();_0xb8b58e[_0xbf4e('0x16')]=_0xbf4e('0x26');_0xb8b58e[_0xbf4e('0x1e')]='abandoned';_0xb8b58e[_0xbf4e('0x1f')]=_0x1dfa81[_0xbf4e('0x1f')];_0xb8b58e[_0xbf4e('0x21')]=0x0;writeDB(_0xb8b58e);}});}catch(_0x29d6aa){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][queuecallerabandon]',_0x1dfa81[_0xbf4e('0x2')]),_0x29d6aa);}};exports[_0xbf4e('0x27')]=function(_0x25b837){try{if(agents[_0x25b837[_0xbf4e('0x14')]]){utils[_0xbf4e('0x11')](util['format']('[%s][agents][agentconnect]',_0x25b837['uniqueid']),_0x25b837);utils['info'](util[_0xbf4e('0x12')](_0xbf4e('0x28'),_0x25b837[_0xbf4e('0x2')],agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x5')],_0x25b837[_0xbf4e('0x14')]));agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x29')]=utils[_0xbf4e('0x15')]();agents[_0x25b837['destuniqueid']]['connectedlinenum']=_0x25b837[_0xbf4e('0x8')];agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x17')]=_0x25b837['connectedlinename'];agents[_0x25b837[_0xbf4e('0x14')]]['holdtime']=_0x25b837[_0xbf4e('0x20')];agents[_0x25b837[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x2a');_['forIn'](agents,function(_0x31d8dc,_0x78ab2d){if(_0x31d8dc[_0xbf4e('0x14')]!=_0x25b837[_0xbf4e('0x14')]&&_0x31d8dc['uniqueid']==_0x25b837[_0xbf4e('0x2')]){_0x31d8dc[_0xbf4e('0x21')]=0x0;_0x31d8dc[_0xbf4e('0x1f')]=_0x25b837[_0xbf4e('0x20')];_0x31d8dc[_0xbf4e('0x19')]=!![];_0x31d8dc[_0xbf4e('0x1c')]=utils[_0xbf4e('0x15')]();_0x31d8dc['lastevent']=_0xbf4e('0x2b');_0x31d8dc[_0xbf4e('0x1e')]='answered_elsewhere';_0x31d8dc['answeredelsewheredestinationuniqueid']=_0x25b837[_0xbf4e('0x14')];_0x31d8dc[_0xbf4e('0x2c')]=_0x25b837['membername'];writeDB(_0x31d8dc);}});}}catch(_0x5bfc4d){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x2d'),_0x25b837[_0xbf4e('0x2')]),_0x5bfc4d);}};exports[_0xbf4e('0xc')]=function(_0x3ad0a4){try{if(!_['isNil'](agents[_0x3ad0a4[_0xbf4e('0x14')]])){utils[_0xbf4e('0x11')](util['format']('[%s][agents][agentcomplete]',_0x3ad0a4['uniqueid']),_0x3ad0a4);utils['info'](util[_0xbf4e('0x12')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x3ad0a4[_0xbf4e('0x2')],agents[_0x3ad0a4[_0xbf4e('0x14')]]['membername'],_0x3ad0a4['destuniqueid']));agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0xc')]=!![];agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();agents[_0x3ad0a4['destuniqueid']][_0xbf4e('0x21')]=utils[_0xbf4e('0x2f')](agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x2e')],agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x29')]);agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x1e')]=_0x3ad0a4['reason'];agents[_0x3ad0a4[_0xbf4e('0x14')]][_0xbf4e('0x16')]=_0xbf4e('0x30');writeDB(agents[_0x3ad0a4[_0xbf4e('0x14')]]);}}catch(_0x9bc1fe){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x31'),_0x3ad0a4[_0xbf4e('0x2')]),_0x9bc1fe);}};exports[_0xbf4e('0x32')]=function(_0x2fdba9){try{if(!_[_0xbf4e('0x1a')](agents[_0x2fdba9[_0xbf4e('0x33')]])){utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x34'),_0x2fdba9[_0xbf4e('0x2')]),_0x2fdba9);utils['info'](util[_0xbf4e('0x12')](_0xbf4e('0x35'),_0x2fdba9[_0xbf4e('0x2')],agents[_0x2fdba9['transfereruniqueid']][_0xbf4e('0x5')],agents[_0x2fdba9['transfereruniqueid']]['uniqueid']));agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x36')]=!![];agents[_0x2fdba9['transfereruniqueid']][_0xbf4e('0x37')]=_0xbf4e('0x38');agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x39')]=_0x2fdba9[_0xbf4e('0x3a')];agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x3b')]=agents[_0x2fdba9[_0xbf4e('0x33')]][_0xbf4e('0x2')];}}catch(_0xc058e1){utils[_0xbf4e('0x18')](util['format']('[%s][agents][blindtransfer]',_0x2fdba9[_0xbf4e('0x2')]),_0xc058e1);}};exports[_0xbf4e('0x3c')]=function(_0x3d0b4a){try{utils['debug'](util[_0xbf4e('0x12')](_0xbf4e('0x3d'),_0x3d0b4a['origtransfereruniqueid']),_0x3d0b4a);if(_0x3d0b4a['origtransfereruniqueid']==_0x3d0b4a[_0xbf4e('0x3e')]){if(!_['isNil'](agents[_0x3d0b4a['secondtransfereruniqueid']])){utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x3f'),_0x3d0b4a[_0xbf4e('0x40')],agents[_0x3d0b4a[_0xbf4e('0x41')]]['membername']));agents[_0x3d0b4a[_0xbf4e('0x41')]]['transfer']=!![];agents[_0x3d0b4a[_0xbf4e('0x41')]]['transfertype']=_0xbf4e('0x42');agents[_0x3d0b4a['secondtransfereruniqueid']][_0xbf4e('0x39')]=_0x3d0b4a[_0xbf4e('0x43')];agents[_0x3d0b4a[_0xbf4e('0x41')]][_0xbf4e('0x3b')]=_0x3d0b4a[_0xbf4e('0x40')];}if(_0x3d0b4a['transfereeuniqueid']&&agents[_0x3d0b4a['transfereeuniqueid']]){agents[_0x3d0b4a['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x3d0b4a[_0xbf4e('0x44')]]=_[_0xbf4e('0x45')](agents[_0x3d0b4a['transfereeuniqueid']]);transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x7')]=agents[_0x3d0b4a[_0xbf4e('0x41')]][_0xbf4e('0x7')];transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x46')]=agents[_0x3d0b4a[_0xbf4e('0x41')]]['calleridname'];transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x47')]=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a['transfereeuniqueid']]['agentconnectAt']=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a[_0xbf4e('0x44')]][_0xbf4e('0x1f')]=0x0;transfers[_0x3d0b4a['transfereeuniqueid']][_0xbf4e('0x48')]=0x2;}}else if(_0x3d0b4a[_0xbf4e('0x41')]==_0x3d0b4a[_0xbf4e('0x49')]){if(!_[_0xbf4e('0x1a')](agents[_0x3d0b4a[_0xbf4e('0x40')]])){utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x3f'),_0x3d0b4a[_0xbf4e('0x40')],agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x5')]));agents[_0x3d0b4a[_0xbf4e('0x40')]]['transfer']=!![];agents[_0x3d0b4a[_0xbf4e('0x40')]]['transfertype']=_0xbf4e('0x42');agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x39')]=_0x3d0b4a[_0xbf4e('0x4a')];agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x3b')]=_0x3d0b4a[_0xbf4e('0x41')];}if(_0x3d0b4a[_0xbf4e('0x4b')]&&agents[_0x3d0b4a['transfertargetuniqueid']]){agents[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x48')]=0x1;transfers[_0x3d0b4a[_0xbf4e('0x4b')]]=_[_0xbf4e('0x45')](agents[_0x3d0b4a[_0xbf4e('0x4b')]]);transfers[_0x3d0b4a['transfertargetuniqueid']][_0xbf4e('0x7')]=agents[_0x3d0b4a[_0xbf4e('0x40')]][_0xbf4e('0x7')];transfers[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x46')]=agents[_0x3d0b4a[_0xbf4e('0x40')]]['calleridname'];transfers[_0x3d0b4a[_0xbf4e('0x4b')]]['agentcalledAt']=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a[_0xbf4e('0x4b')]][_0xbf4e('0x29')]=utils[_0xbf4e('0x15')]();transfers[_0x3d0b4a['transfertargetuniqueid']][_0xbf4e('0x1f')]=0x0;transfers[_0x3d0b4a['transfertargetuniqueid']]['agententerreason']=0x2;}}}catch(_0x2c0dbd){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')]('[%s][agents][attendedtransfer]',_0x3d0b4a[_0xbf4e('0x40')]),_0x2c0dbd);}};exports[_0xbf4e('0x4c')]=function(_0x4d7241){try{utils[_0xbf4e('0x11')](util[_0xbf4e('0x12')](_0xbf4e('0x4d'),_0x4d7241[_0xbf4e('0x2')]),_0x4d7241);if(agents[_0x4d7241[_0xbf4e('0x2')]]&&agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]===_0xbf4e('0x1d')){if(_0x4d7241[_0xbf4e('0x4e')]==='21'){agents[_0x4d7241['uniqueid']][_0xbf4e('0x1e')]=_0xbf4e('0x4f');agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]='rejected';}utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')](_0xbf4e('0x50'),_0x4d7241[_0xbf4e('0x2')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x5')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],agents[_0x4d7241[_0xbf4e('0x2')]]['lastevent']));writeDB(agents[_0x4d7241[_0xbf4e('0x2')]]);var _0x47ef56=unanswered[_0xbf4e('0x51')](_0x4d7241[_0xbf4e('0x2')]);if(_0x47ef56>-0x1){unanswered[_0xbf4e('0x52')](_0x47ef56,0x1);}}if(transfers[_0x4d7241[_0xbf4e('0x2')]]){transfers[_0x4d7241[_0xbf4e('0x2')]]['agentcomplete']=!![];transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();transfers[_0x4d7241['uniqueid']][_0xbf4e('0x21')]=utils[_0xbf4e('0x2f')](transfers[_0x4d7241[_0xbf4e('0x2')]]['agentcompleteAt'],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x29')]);transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]=_0xbf4e('0x53');transfers[_0x4d7241['uniqueid']][_0xbf4e('0x16')]='complete';utils[_0xbf4e('0x1')](util['format'](_0xbf4e('0x50'),_0x4d7241['uniqueid'],transfers[_0x4d7241[_0xbf4e('0x2')]]['membername'],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],transfers[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]));writeDB(transfers[_0x4d7241[_0xbf4e('0x2')]],!![]);}if(agents[_0x4d7241[_0xbf4e('0x2')]]&&agents[_0x4d7241[_0xbf4e('0x2')]]['agentconnectAt']){agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0xc')]=!![];agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x2e')]=utils[_0xbf4e('0x15')]();agents[_0x4d7241[_0xbf4e('0x2')]]['talktime']=utils[_0xbf4e('0x2f')](agents[_0x4d7241[_0xbf4e('0x2')]]['agentcompleteAt'],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x29')]);agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')]=agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x36')]?_0xbf4e('0x36'):_0xbf4e('0x53');agents[_0x4d7241[_0xbf4e('0x2')]]['lastevent']=_0xbf4e('0x30');utils[_0xbf4e('0x1')](util[_0xbf4e('0x12')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4d7241[_0xbf4e('0x2')],agents[_0x4d7241[_0xbf4e('0x2')]]['membername'],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x1e')],agents[_0x4d7241[_0xbf4e('0x2')]][_0xbf4e('0x16')]));writeDB(agents[_0x4d7241[_0xbf4e('0x2')]]);}}catch(_0x1cc939){utils[_0xbf4e('0x18')](util[_0xbf4e('0x12')](_0xbf4e('0x4d'),_0x4d7241[_0xbf4e('0x2')]),_0x1cc939);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 983609e..32529d5 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 _0xd0db=['[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','outboundrouteid','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','lastIndexOf','includes','execif','gotoif','[%s][calls][newexten]','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','calleridnum','connectedlinenum','lastevent','accountcode','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','DOCUMENTATION','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','now','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','error','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype'];(function(_0x1d2cdb,_0x485cd9){var _0x51edda=function(_0x3e0904){while(--_0x3e0904){_0x1d2cdb['push'](_0x1d2cdb['shift']());}};_0x51edda(++_0x485cd9);}(_0xd0db,0x15a));var _0xbd0d=function(_0x55c572,_0x144e40){_0x55c572=_0x55c572-0x0;var _0x5a5ec9=_0xd0db[_0x55c572];return _0x5a5ec9;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xbd0d('0x0'));var transfers=require(_0xbd0d('0x1'));var dispositions=[_0xbd0d('0x2'),_0xbd0d('0x3'),'FAILED',_0xbd0d('0x2'),_0xbd0d('0x2'),'NO\x20ANSWER',_0xbd0d('0x4'),_0xbd0d('0x5'),_0xbd0d('0x3'),_0xbd0d('0x3'),'FAILED'];var channels={};function writeDB(_0x10d42d){var _0x434e85;if(transfers[_0xbd0d('0x6')][_0x10d42d[_0xbd0d('0x7')]]){_0x434e85=_0x10d42d[_0xbd0d('0x7')];_0x10d42d[_0xbd0d('0x7')]=transfers[_0xbd0d('0x6')][_0x10d42d['uniqueid']][_0xbd0d('0x8')];}utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0xb'),_0x10d42d[_0xbd0d('0x7')],_0x10d42d[_0xbd0d('0xc')],_0x10d42d[_0xbd0d('0xd')],_0x10d42d['membername'],_0x10d42d[_0xbd0d('0xe')],_0x10d42d[_0xbd0d('0xf')],_0x10d42d[_0xbd0d('0x10')],_0x10d42d[_0xbd0d('0x11')]));if(_0x10d42d[_0xbd0d('0x12')]){utils['getUserByInternal'](_0x10d42d[_0xbd0d('0x12')])[_0xbd0d('0x13')](function(_0x4e5012){if(_0x4e5012){_0x10d42d[_0xbd0d('0x14')]=_0x4e5012['id'];}utils[_0xbd0d('0x15')]('CreateVoiceCallReport',_0x10d42d);});}else{utils[_0xbd0d('0x15')](_0xbd0d('0x16'),_0x10d42d);}if(channels[_0x10d42d[_0xbd0d('0x7')]]){delete channels[_0x10d42d[_0xbd0d('0x7')]];}else if(_0x434e85&&channels[_0x434e85]){delete transfers['blinds'][_0x434e85];delete channels[_0x434e85];}}exports[_0xbd0d('0x17')]=function(_0x491c9c){try{utils[_0xbd0d('0x18')](util['format'](_0xbd0d('0x19'),_0x491c9c[_0xbd0d('0x7')]),_0x491c9c);if(_0x491c9c['uniqueid']==_0x491c9c[_0xbd0d('0x1a')]&&_0x491c9c['channel']!=_0xbd0d('0x1b')){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x1c'),_0x491c9c[_0xbd0d('0x7')],_0x491c9c[_0xbd0d('0x1d')],_0x491c9c[_0xbd0d('0x1e')]));channels[_0x491c9c[_0xbd0d('0x7')]]={'uniqueid':_0x491c9c[_0xbd0d('0x7')],'accountcode':_0x491c9c[_0xbd0d('0x12')],'source':_0x491c9c[_0xbd0d('0xf')],'destination':_0x491c9c[_0xbd0d('0x1e')],'destinationcontext':_0x491c9c[_0xbd0d('0x1d')],'channel':_0x491c9c[_0xbd0d('0xc')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xbd0d('0x2'),'amaflags':_0xbd0d('0x1f')};}}catch(_0x300bed){utils['error'](util[_0xbd0d('0xa')](_0xbd0d('0x19'),_0x491c9c['uniqueid']),_0x300bed);}};exports['newstate']=function(_0x5768ef){try{utils['debug'](util[_0xbd0d('0xa')](_0xbd0d('0x20'),_0x5768ef[_0xbd0d('0x7')]),_0x5768ef);if(!_[_0xbd0d('0x21')](channels[_0x5768ef[_0xbd0d('0x7')]])&&_0x5768ef[_0xbd0d('0x22')]==0x6){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x23'),_0x5768ef[_0xbd0d('0x7')],_0x5768ef[_0xbd0d('0x1d')],_0x5768ef[_0xbd0d('0xc')]));if(_[_0xbd0d('0x21')](channels[_0x5768ef[_0xbd0d('0x7')]][_0xbd0d('0x24')])){channels[_0x5768ef[_0xbd0d('0x7')]]['systemanswertime']=utils['now']();}}else if(!_[_0xbd0d('0x21')](channels[_0x5768ef[_0xbd0d('0x1a')]])&&_0x5768ef[_0xbd0d('0x22')]==0x6&&_0x5768ef[_0xbd0d('0x1d')]!=_0xbd0d('0x25')){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x26'),_0x5768ef[_0xbd0d('0x7')],_0x5768ef[_0xbd0d('0x1a')],_0x5768ef[_0xbd0d('0x1d')],_0x5768ef[_0xbd0d('0xc')]));channels[_0x5768ef['linkedid']][_0xbd0d('0x12')]=_0x5768ef[_0xbd0d('0x12')];channels[_0x5768ef[_0xbd0d('0x1a')]][_0xbd0d('0x27')]=_0x5768ef[_0xbd0d('0xc')];if(_[_0xbd0d('0x21')](channels[_0x5768ef['linkedid']][_0xbd0d('0x28')])){channels[_0x5768ef[_0xbd0d('0x1a')]][_0xbd0d('0x28')]=utils[_0xbd0d('0x29')]();}channels[_0x5768ef[_0xbd0d('0x1a')]][_0xbd0d('0x2a')]=dispositions[_[_0xbd0d('0x2b')](_0x5768ef[_0xbd0d('0x22')])]||_0xbd0d('0x4');}}catch(_0x3bb0d8){utils['error'](util['format']('[%s][calls][newstate]',_0x5768ef[_0xbd0d('0x7')]),_0x3bb0d8);}};exports[_0xbd0d('0x2c')]=function(_0x70840a){try{if(!_['isNil'](channels[_0x70840a['uniqueid']])){utils[_0xbd0d('0x18')](util[_0xbd0d('0xa')](_0xbd0d('0x2d'),_0x70840a[_0xbd0d('0x7')]),_0x70840a);if(_[_0xbd0d('0x21')](channels[_0x70840a[_0xbd0d('0x7')]]['callerid'])){channels[_0x70840a['uniqueid']][_0xbd0d('0x2e')]=_0x70840a['calleridname']+'\x20<'+_0x70840a[_0xbd0d('0xf')]+'>';}utils['info'](util[_0xbd0d('0xa')](_0xbd0d('0x2f'),_0x70840a[_0xbd0d('0x7')],channels[_0x70840a['uniqueid']][_0xbd0d('0x2e')],_0x70840a['cause-txt']));channels[_0x70840a['uniqueid']][_0xbd0d('0x30')]=utils[_0xbd0d('0x29')]();channels[_0x70840a[_0xbd0d('0x7')]][_0xbd0d('0x31')]=utils[_0xbd0d('0x32')](channels[_0x70840a[_0xbd0d('0x7')]][_0xbd0d('0x30')],channels[_0x70840a['uniqueid']][_0xbd0d('0x33')]);channels[_0x70840a[_0xbd0d('0x7')]]['billableseconds']=channels[_0x70840a['uniqueid']][_0xbd0d('0x28')]?utils[_0xbd0d('0x32')](channels[_0x70840a[_0xbd0d('0x7')]][_0xbd0d('0x30')],channels[_0x70840a[_0xbd0d('0x7')]][_0xbd0d('0x28')]):0x0;writeDB(channels[_0x70840a[_0xbd0d('0x7')]]);}}catch(_0x221c96){utils[_0xbd0d('0x34')](util[_0xbd0d('0xa')](_0xbd0d('0x2d'),_0x70840a[_0xbd0d('0x7')]),_0x221c96);}};exports[_0xbd0d('0x35')]=function(_0x2733b9){try{if(!_[_0xbd0d('0x21')](channels[_0x2733b9[_0xbd0d('0x36')]])){utils['debug'](util[_0xbd0d('0xa')](_0xbd0d('0x37'),_0x2733b9[_0xbd0d('0x38')]),_0x2733b9);if(channels[_0x2733b9[_0xbd0d('0x36')]][_0xbd0d('0xc')]==_0x2733b9[_0xbd0d('0x39')]){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x3a'),_0x2733b9[_0xbd0d('0x38')],_0x2733b9[_0xbd0d('0x36')],_0x2733b9[_0xbd0d('0x3b')]));channels[_0x2733b9[_0xbd0d('0x36')]][_0xbd0d('0x27')]=_0x2733b9[_0xbd0d('0x3b')];channels[_0x2733b9['localtwolinkedid']][_0xbd0d('0x3c')]=_0xbd0d('0x3d');}else if(channels[_0x2733b9['localtwolinkedid']][_0xbd0d('0xc')]=_0x2733b9[_0xbd0d('0x3e')]){utils['info'](util[_0xbd0d('0xa')](_0xbd0d('0x3a'),_0x2733b9['origtransfereruniqueid'],_0x2733b9['localtwolinkedid'],_0x2733b9[_0xbd0d('0x3f')]));channels[_0x2733b9[_0xbd0d('0x36')]][_0xbd0d('0x27')]=_0x2733b9[_0xbd0d('0x3f')];channels[_0x2733b9[_0xbd0d('0x36')]][_0xbd0d('0x3c')]=_0xbd0d('0x3d');}}}catch(_0x8356d6){utils['error'](util[_0xbd0d('0xa')](_0xbd0d('0x37'),_0x2733b9[_0xbd0d('0x38')]),_0x8356d6);}};exports[_0xbd0d('0x40')]=function(_0x3edb9c){try{if(!_[_0xbd0d('0x21')](channels[_0x3edb9c['uniqueid']])){utils[_0xbd0d('0x18')](util['format'](_0xbd0d('0x41'),_0x3edb9c[_0xbd0d('0x7')]),_0x3edb9c);channels[_0x3edb9c[_0xbd0d('0x7')]][_0xbd0d('0x42')]=utils['now']();utils[_0xbd0d('0x9')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x3edb9c['uniqueid'],channels[_0x3edb9c[_0xbd0d('0x7')]][_0xbd0d('0x42')]));}}catch(_0x30d5f1){utils[_0xbd0d('0x34')](util[_0xbd0d('0xa')](_0xbd0d('0x41'),_0x3edb9c[_0xbd0d('0x7')]),_0x30d5f1);}};exports[_0xbd0d('0x43')]=function(_0x73b644){try{if(!_[_0xbd0d('0x21')](channels[_0x73b644[_0xbd0d('0x7')]])){utils['debug'](util[_0xbd0d('0xa')](_0xbd0d('0x44'),_0x73b644['uniqueid']),_0x73b644);if(!_['isNil'](channels[_0x73b644[_0xbd0d('0x7')]]['musiconholdstartAt'])){channels[_0x73b644[_0xbd0d('0x7')]]['mohtime']+=utils[_0xbd0d('0x32')](utils[_0xbd0d('0x29')](),channels[_0x73b644[_0xbd0d('0x7')]][_0xbd0d('0x42')]);utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x45'),_0x73b644[_0xbd0d('0x7')],channels[_0x73b644[_0xbd0d('0x7')]][_0xbd0d('0x46')]));delete channels[_0x73b644['uniqueid']][_0xbd0d('0x42')];}}}catch(_0x3d5ea2){utils[_0xbd0d('0x34')](util[_0xbd0d('0xa')](_0xbd0d('0x44'),_0x73b644[_0xbd0d('0x7')]),_0x3d5ea2);}};exports['varset']=function(_0x19fd85){try{if(!_[_0xbd0d('0x21')](channels[_0x19fd85[_0xbd0d('0x7')]])){utils[_0xbd0d('0x18')](util['format'](_0xbd0d('0x47'),_0x19fd85['uniqueid']),_0x19fd85);if(!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x49')])){utils['info'](util[_0xbd0d('0xa')](_0xbd0d('0x4a'),_0x19fd85[_0xbd0d('0x7')],_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85['uniqueid']][_0xbd0d('0x4c')]=_0x19fd85[_0xbd0d('0x4b')];}if(!_['isNil'](_0x19fd85[_0xbd0d('0x48')]['xmd-phone'])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x19fd85[_0xbd0d('0x7')],_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85[_0xbd0d('0x7')]][_0xbd0d('0x4d')]=_0x19fd85[_0xbd0d('0x4b')];channels[_0x19fd85[_0xbd0d('0x7')]][_0xbd0d('0x2e')]='\x22'+_0x19fd85[_0xbd0d('0x4b')]+_0xbd0d('0x4e')+_0x19fd85[_0xbd0d('0x4b')]+'>';}if(!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x4f')])||!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x50')])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x51'),_0x19fd85[_0xbd0d('0x7')],!_['isNil'](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x4f')])?_0xbd0d('0x4f'):_0xbd0d('0x50'),_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85[_0xbd0d('0x7')]][_0xbd0d('0x2e')]=_0x19fd85[_0xbd0d('0x4b')];}if(!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x52')])||!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x53')])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x51'),_0x19fd85['uniqueid'],!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x52')])?_0xbd0d('0x52'):_0xbd0d('0x53'),_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85[_0xbd0d('0x7')]][_0xbd0d('0x54')]='Queue';channels[_0x19fd85[_0xbd0d('0x7')]][_0xbd0d('0x55')]=_0x19fd85[_0xbd0d('0x4b')];channels[_0x19fd85[_0xbd0d('0x7')]]['queue']=!![];}if(!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x56')])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x57'),_0x19fd85['uniqueid'],_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85[_0xbd0d('0x7')]][_0xbd0d('0x58')]=_0x19fd85[_0xbd0d('0x4b')];}if(!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x59')])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x5a'),_0x19fd85[_0xbd0d('0x7')],_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85[_0xbd0d('0x7')]]['type']=_0x19fd85[_0xbd0d('0x4b')];}if(!_[_0xbd0d('0x21')](_0x19fd85['variable'][_0xbd0d('0x5b')])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')]('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x19fd85[_0xbd0d('0x7')],_0x19fd85[_0xbd0d('0x4b')]));channels[_0x19fd85['uniqueid']][_0xbd0d('0x5c')]=_0x19fd85[_0xbd0d('0x4b')];}if(!_[_0xbd0d('0x21')](_0x19fd85[_0xbd0d('0x48')][_0xbd0d('0x5d')])){utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x19fd85[_0xbd0d('0x7')],_0x19fd85['value']));channels[_0x19fd85['uniqueid']][_0xbd0d('0x5d')]=_0x19fd85[_0xbd0d('0x4b')];}}}catch(_0x2577de){utils['error'](util['format'](_0xbd0d('0x47'),_0x19fd85[_0xbd0d('0x7')]),_0x2577de);}};exports[_0xbd0d('0x5e')]=function(_0x39fefa){try{if(!_[_0xbd0d('0x21')](channels[_0x39fefa[_0xbd0d('0x7')]])){utils['debug'](util['format']('[%s][calls][newexten]',_0x39fefa[_0xbd0d('0x7')]),_0x39fefa);utils[_0xbd0d('0x9')](util[_0xbd0d('0xa')](_0xbd0d('0x5f'),_0x39fefa[_0xbd0d('0x7')],_0x39fefa[_0xbd0d('0x60')],_0x39fefa[_0xbd0d('0x61')]));if(_0x39fefa[_0xbd0d('0x60')][_0xbd0d('0x62')]()==_0xbd0d('0x63')&&_[_0xbd0d('0x64')](_0x39fefa[_0xbd0d('0x61')][_0xbd0d('0x62')](),_0xbd0d('0x65'))){var _0x460f32=_0x39fefa[_0xbd0d('0x61')][_0xbd0d('0x66')]('=');var _0x1beaa4=_0x460f32[0x0][_0xbd0d('0x67')](_0x460f32[0x0][_0xbd0d('0x68')]('(')+0x1,_0x460f32[0x0][_0xbd0d('0x68')](')'));var _0x3d9495=_0x460f32[0x1];channels[_0x39fefa[_0xbd0d('0x7')]][_0x1beaa4]=_0x3d9495;}if(!_[_0xbd0d('0x69')]([_0xbd0d('0x2c'),'noop',_0xbd0d('0x6a'),_0xbd0d('0x63'),_0xbd0d('0x6b')],_0x39fefa[_0xbd0d('0x60')][_0xbd0d('0x62')]())){channels[_0x39fefa[_0xbd0d('0x7')]][_0xbd0d('0x54')]=_0x39fefa[_0xbd0d('0x60')];channels[_0x39fefa[_0xbd0d('0x7')]][_0xbd0d('0x55')]=_0x39fefa['appdata'];}}}catch(_0x2d573e){utils['error'](util[_0xbd0d('0xa')](_0xbd0d('0x6c'),_0x39fefa[_0xbd0d('0x7')]),_0x2d573e);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 0c129ea..27a3731 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 _0x36ad=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown'];(function(_0x5b50f2,_0x35a265){var _0x5d967d=function(_0x23c8f2){while(--_0x23c8f2){_0x5b50f2['push'](_0x5b50f2['shift']());}};_0x5d967d(++_0x35a265);}(_0x36ad,0xea));var _0xd36a=function(_0x281c26,_0x4a4892){_0x281c26=_0x281c26-0x0;var _0x31c9eb=_0x36ad[_0x281c26];return _0x31c9eb;};'use strict';var utils=require(_0xd36a('0x0'));exports[_0xd36a('0x1')]=function(){utils[_0xd36a('0x2')](_0xd36a('0x3'));};exports[_0xd36a('0x4')]=function(){utils[_0xd36a('0x2')](_0xd36a('0x5'));};exports['fullybooted']=function(){utils[_0xd36a('0x2')](_0xd36a('0x6'));};exports[_0xd36a('0x7')]=function(_0x1753e9){utils[_0xd36a('0x7')](_0xd36a('0x8'),_0x1753e9);};exports[_0xd36a('0x9')]=function(){utils[_0xd36a('0x2')](_0xd36a('0xa'));};exports[_0xd36a('0xb')]=function(_0x55932a){}; \ No newline at end of file +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 diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index a48646a..417e955 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 _0xcd82=['CreateVoiceDialReport','newexten','debug','format','[%s][dials][newexten]','info','application','appdata','toLowerCase','set','split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','isNil','[%s][dials][dialbegin]','starttime','called','dialend','[%s][dials][dialend]','dialstatus','ANSWER','assign','answertime','now','lastevent','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','cause-txt','complete','diffTime','endtime','holdtime','lodash','./utils','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','connectedlinenum','request'];(function(_0x157e6d,_0x102c92){var _0x542210=function(_0x1cbdcd){while(--_0x1cbdcd){_0x157e6d['push'](_0x157e6d['shift']());}};_0x542210(++_0x102c92);}(_0xcd82,0xb4));var _0x2cd8=function(_0x233949,_0x5db8d9){_0x233949=_0x233949-0x0;var _0x35ce7b=_0xcd82[_0x233949];return _0x35ce7b;};'use strict';var _=require(_0x2cd8('0x0'));var util=require('util');var utils=require(_0x2cd8('0x1'));var dials={};function writeDB(_0x1847f6){utils['info'](util['format'](_0x2cd8('0x2'),_0x1847f6[_0x2cd8('0x3')],_0x1847f6[_0x2cd8('0x4')],_0x1847f6[_0x2cd8('0x5')],_0x1847f6['calleridnum'],_0x1847f6[_0x2cd8('0x6')],_0x1847f6['dialstatus']));utils[_0x2cd8('0x7')](_0x2cd8('0x8'),_0x1847f6);delete dials[_0x1847f6[_0x2cd8('0x3')]];}exports[_0x2cd8('0x9')]=function(_0x440968){try{utils[_0x2cd8('0xa')](util[_0x2cd8('0xb')](_0x2cd8('0xc'),_0x440968[_0x2cd8('0x3')]),_0x440968);utils[_0x2cd8('0xd')](util[_0x2cd8('0xb')]('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x440968['uniqueid'],_0x440968[_0x2cd8('0xe')],_0x440968[_0x2cd8('0xf')]));if(_0x440968[_0x2cd8('0xe')][_0x2cd8('0x10')]()==_0x2cd8('0x11')&&_['startsWith'](_0x440968[_0x2cd8('0xf')][_0x2cd8('0x10')](),'cdr(routeid)')){var _0x169212=_0x440968[_0x2cd8('0xf')][_0x2cd8('0x12')]('=');dials[_0x440968['uniqueid']]={'routeId':_0x169212[0x1]};}}catch(_0x481e15){utils[_0x2cd8('0x13')](util[_0x2cd8('0xb')](_0x2cd8('0xc'),_0x440968['uniqueid']),_0x481e15);}};exports[_0x2cd8('0x14')]=function(_0x7a3f19){try{utils['debug'](util[_0x2cd8('0xb')](_0x2cd8('0x15'),_0x7a3f19['uniqueid']),_0x7a3f19);if(!_['isNil'](_0x7a3f19[_0x2cd8('0x16')][_0x2cd8('0x17')])){utils[_0x2cd8('0xd')](util['format'](_0x2cd8('0x18'),_0x7a3f19[_0x2cd8('0x3')],_0x7a3f19[_0x2cd8('0x19')]));dials[_0x7a3f19[_0x2cd8('0x3')]]={'routeId':_0x7a3f19[_0x2cd8('0x19')]};}}catch(_0x1aa2ff){utils[_0x2cd8('0x13')](util['format'](_0x2cd8('0x15'),_0x7a3f19[_0x2cd8('0x3')]),_0x1aa2ff);}};exports['dialbegin']=function(_0x1ad8e3){try{if(!_[_0x2cd8('0x1a')](dials[_0x1ad8e3['uniqueid']])){utils[_0x2cd8('0xa')](util['format'](_0x2cd8('0x1b'),_0x1ad8e3['uniqueid']),_0x1ad8e3);dials[_0x1ad8e3['uniqueid']]=_['assign'](dials[_0x1ad8e3[_0x2cd8('0x3')]],_0x1ad8e3);dials[_0x1ad8e3[_0x2cd8('0x3')]][_0x2cd8('0x1c')]=utils['now']();dials[_0x1ad8e3[_0x2cd8('0x3')]]['lastevent']=_0x2cd8('0x1d');utils['info'](util['format']('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x1ad8e3[_0x2cd8('0x3')],dials[_0x1ad8e3[_0x2cd8('0x3')]][_0x2cd8('0x1c')]));}}catch(_0x68c379){utils[_0x2cd8('0x13')](util[_0x2cd8('0xb')](_0x2cd8('0x1b'),_0x1ad8e3[_0x2cd8('0x3')]),_0x68c379);}};exports[_0x2cd8('0x1e')]=function(_0x3eac92){try{if(!_[_0x2cd8('0x1a')](dials[_0x3eac92['uniqueid']])){utils[_0x2cd8('0xa')](util['format'](_0x2cd8('0x1f'),_0x3eac92['uniqueid']),_0x3eac92);dials[_0x3eac92[_0x2cd8('0x3')]][_0x2cd8('0x20')]=_0x3eac92['dialstatus'];if(_0x3eac92[_0x2cd8('0x20')]==_0x2cd8('0x21')){dials[_0x3eac92[_0x2cd8('0x3')]]=_[_0x2cd8('0x22')](dials[_0x3eac92[_0x2cd8('0x3')]],_0x3eac92);dials[_0x3eac92[_0x2cd8('0x3')]][_0x2cd8('0x23')]=utils[_0x2cd8('0x24')]();dials[_0x3eac92[_0x2cd8('0x3')]][_0x2cd8('0x25')]='connect';utils[_0x2cd8('0xd')](util[_0x2cd8('0xb')](_0x2cd8('0x26'),_0x3eac92[_0x2cd8('0x3')],_0x3eac92[_0x2cd8('0x20')],dials[_0x3eac92['uniqueid']][_0x2cd8('0x23')]));}else{utils[_0x2cd8('0xd')](util[_0x2cd8('0xb')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3eac92[_0x2cd8('0x3')],_0x3eac92[_0x2cd8('0x20')]));}}}catch(_0x5ea426){utils['error'](util['format'](_0x2cd8('0x1f'),_0x3eac92[_0x2cd8('0x3')]),_0x5ea426);}};exports[_0x2cd8('0x27')]=function(_0x51423b){try{if(!_[_0x2cd8('0x1a')](dials[_0x51423b['uniqueid']])){utils[_0x2cd8('0xa')](util['format'](_0x2cd8('0x28'),_0x51423b[_0x2cd8('0x3')]),_0x51423b);utils[_0x2cd8('0xd')](util[_0x2cd8('0xb')](_0x2cd8('0x29'),_0x51423b[_0x2cd8('0x3')],_0x51423b['calleridnum'],_0x51423b['calleridname'],_0x51423b[_0x2cd8('0x2a')]));dials[_0x51423b[_0x2cd8('0x3')]]=_['assign'](dials[_0x51423b[_0x2cd8('0x3')]],{'endtime':utils[_0x2cd8('0x24')](),'lastevent':_0x2cd8('0x2b')});dials[_0x51423b[_0x2cd8('0x3')]]['duration']=utils[_0x2cd8('0x2c')](dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x2d')],dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x1c')]);dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x2e')]=utils[_0x2cd8('0x2c')](dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x23')]||dials[_0x51423b[_0x2cd8('0x3')]]['endtime'],dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x1c')]);dials[_0x51423b['uniqueid']]['billableseconds']=dials[_0x51423b['uniqueid']][_0x2cd8('0x23')]?utils[_0x2cd8('0x2c')](dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x2d')],dials[_0x51423b[_0x2cd8('0x3')]][_0x2cd8('0x23')]):0x0;writeDB(dials[_0x51423b[_0x2cd8('0x3')]]);}}catch(_0x5a32a3){utils[_0x2cd8('0x13')](util[_0x2cd8('0xb')](_0x2cd8('0x28'),_0x51423b[_0x2cd8('0x3')]),_0x5a32a3);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index e4341ef..369666e 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 _0xbccd=['[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','../../config/environment','util','asterisk','port','xdr','disabled','info','./agents.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbccd,0x14a));var _0xdbcc=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xbccd[_0xdea41a];return _0x15d0d8;};var AsteriskManager=require(_0xdbcc('0x0'));var config=require(_0xdbcc('0x1'));var utils=require('./utils');var util=require(_0xdbcc('0x2'));var ami=new AsteriskManager(config[_0xdbcc('0x3')][_0xdbcc('0x4')],config[_0xdbcc('0x3')]['ip'],config[_0xdbcc('0x3')]['username'],config[_0xdbcc('0x3')]['password'],!![]);ami['keepConnected']();if(config[_0xdbcc('0x5')]&&config[_0xdbcc('0x5')][_0xdbcc('0x6')]){utils[_0xdbcc('0x7')]('XDR\x20DISABLED');}else{var agents=require(_0xdbcc('0x8'));var calls=require('./calls.controller');var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0xdbcc('0x9'));var transfers=require(_0xdbcc('0xa'));var core=require(_0xdbcc('0xb'));ami['on'](_0xdbcc('0xc'),core[_0xdbcc('0xc')]);ami['on'](_0xdbcc('0xd'),core[_0xdbcc('0xd')]);ami['on'](_0xdbcc('0xe'),core['fullybooted']);ami['on'](_0xdbcc('0xf'),core[_0xdbcc('0xf')]);ami['on']('close',core[_0xdbcc('0x10')]);ami['on'](_0xdbcc('0x11'),core[_0xdbcc('0x11')]);ami['on'](_0xdbcc('0x12'),function(_0x4597e5){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')](_0xdbcc('0x15'),_0x4597e5[_0xdbcc('0x16')]),_0x4597e5);members[_0xdbcc('0x12')](_0x4597e5);}catch(_0x287092){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x15'),_0x4597e5[_0xdbcc('0x16')]),_0x287092);}});ami['on'](_0xdbcc('0x17'),function(_0x5e00e0){try{utils[_0xdbcc('0x13')](util['format'](_0xdbcc('0x18'),_0x5e00e0[_0xdbcc('0x19')]),_0x5e00e0);agents[_0xdbcc('0x17')](_0x5e00e0);}catch(_0x85152d){utils['error'](util[_0xdbcc('0x14')](_0xdbcc('0x18'),_0x5e00e0[_0xdbcc('0x19')]),_0x85152d);}});ami['on'](_0xdbcc('0x1a'),function(_0x25a4c6){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')]('[%s][index][agentringnoanswer]',_0x25a4c6[_0xdbcc('0x19')]),_0x25a4c6);agents[_0xdbcc('0x1a')](_0x25a4c6);}catch(_0x485519){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x1b'),_0x25a4c6['uniqueid']),_0x485519);}});ami['on']('agentconnect',function(_0x55cf32){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')]('[%s][index][agentconnect]',_0x55cf32[_0xdbcc('0x19')]),_0x55cf32);agents[_0xdbcc('0x1c')](_0x55cf32);queues['agentconnect'](_0x55cf32);}catch(_0x3be036){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x1d'),_0x55cf32[_0xdbcc('0x19')]),_0x3be036);}});ami['on']('agentcomplete',function(_0x123998){try{utils['debug'](util[_0xdbcc('0x14')]('[%s][index][agentcomplete]',_0x123998[_0xdbcc('0x19')]),_0x123998);agents[_0xdbcc('0x1e')](_0x123998);queues[_0xdbcc('0x1e')](_0x123998);members['agentcomplete'](_0x123998);}catch(_0x5b6712){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')]('[%s][index][agentcomplete]',_0x123998[_0xdbcc('0x19')]),_0x5b6712);}});ami['on'](_0xdbcc('0x1f'),function(_0xcdfc47){try{utils[_0xdbcc('0x13')](util['format'](_0xdbcc('0x20'),_0xcdfc47[_0xdbcc('0x19')]),_0xcdfc47);agents['queuecallerabandon'](_0xcdfc47);queues[_0xdbcc('0x1f')](_0xcdfc47);}catch(_0x8d79e9){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x20'),_0xcdfc47[_0xdbcc('0x19')]),_0x8d79e9);}});ami['on'](_0xdbcc('0x21'),function(_0x150d14){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')](_0xdbcc('0x22'),_0x150d14['uniqueid']),_0x150d14);queues['queuecallerjoin'](_0x150d14);recordings[_0xdbcc('0x21')](_0x150d14);}catch(_0x17872d){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x22'),_0x150d14[_0xdbcc('0x19')]),_0x17872d);}});ami['on']('queuecallerleave',function(_0x219443){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')](_0xdbcc('0x23'),_0x219443[_0xdbcc('0x19')]),_0x219443);queues['queuecallerleave'](_0x219443);}catch(_0x24715b){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')]('[%s][index][queuecallerleave]',_0x219443[_0xdbcc('0x19')]),_0x24715b);}});ami['on'](_0xdbcc('0x24'),function(_0x400e72){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')](_0xdbcc('0x25'),_0x400e72[_0xdbcc('0x19')]),_0x400e72);queues[_0xdbcc('0x24')](_0x400e72);calls[_0xdbcc('0x24')](_0x400e72);}catch(_0x5a9410){utils['error'](util[_0xdbcc('0x14')]('[%s][index][musiconholdstart]',_0x400e72[_0xdbcc('0x19')]),_0x5a9410);}});ami['on'](_0xdbcc('0x26'),function(_0x1d0a0e){try{utils[_0xdbcc('0x13')](util['format']('[%s][index][musiconholdstop]',_0x1d0a0e[_0xdbcc('0x19')]),_0x1d0a0e);queues[_0xdbcc('0x26')](_0x1d0a0e);calls[_0xdbcc('0x26')](_0x1d0a0e);}catch(_0x51a019){utils['error'](util[_0xdbcc('0x14')](_0xdbcc('0x27'),_0x1d0a0e[_0xdbcc('0x19')]),_0x51a019);}});ami['on'](_0xdbcc('0x28'),function(_0xc3064e){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')](_0xdbcc('0x29'),_0xc3064e[_0xdbcc('0x19')]),_0xc3064e);calls[_0xdbcc('0x28')](_0xc3064e);recordings[_0xdbcc('0x28')](_0xc3064e);}catch(_0x3aa511){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x29'),_0xc3064e[_0xdbcc('0x19')]),_0x3aa511);}});ami['on'](_0xdbcc('0x2a'),function(_0x2be93b){try{utils['debug'](util['format'](_0xdbcc('0x2b'),_0x2be93b[_0xdbcc('0x19')]),_0x2be93b);calls[_0xdbcc('0x2a')](_0x2be93b);recordings[_0xdbcc('0x2a')](_0x2be93b);dials['hangup'](_0x2be93b);agents[_0xdbcc('0x2a')](_0x2be93b);queues['hangup'](_0x2be93b);}catch(_0xf8b987){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x2b'),_0x2be93b[_0xdbcc('0x19')]),_0xf8b987);}});ami['on']('cdr',function(_0x5353a8){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')]('[%s][index][cdr]',_0x5353a8['uniqueid']),_0x5353a8);members['cdr'](_0x5353a8);}catch(_0x48a68c){utils[_0xdbcc('0xf')](util['format']('[%s][index][cdr]',_0x5353a8[_0xdbcc('0x19')]),_0x48a68c);}});ami['on'](_0xdbcc('0x2c'),function(_0xe29951){try{utils[_0xdbcc('0x13')](util['format'](_0xdbcc('0x2d'),_0xe29951[_0xdbcc('0x19')]),_0xe29951);queues[_0xdbcc('0x2c')](_0xe29951);agents['blindtransfer'](_0xe29951);transfers['blindtransfer'](_0xe29951);}catch(_0x207ad0){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x2d'),_0xe29951['uniqueid']),_0x207ad0);}});ami['on'](_0xdbcc('0x2e'),function(_0x1f548a){try{utils['debug'](util['format'](_0xdbcc('0x2f'),_0x1f548a[_0xdbcc('0x30')]),_0x1f548a);queues['attendedtransfer'](_0x1f548a);transfers[_0xdbcc('0x2e')](_0x1f548a);agents['attendedtransfer'](_0x1f548a);calls[_0xdbcc('0x2e')](_0x1f548a);}catch(_0x5968aa){utils['error'](util[_0xdbcc('0x14')](_0xdbcc('0x2f'),_0x1f548a[_0xdbcc('0x30')]),_0x5968aa);}});ami['on'](_0xdbcc('0x31'),function(_0x5d4e0c){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')]('[%s][index][varset]',_0x5d4e0c['uniqueid']),_0x5d4e0c);queues[_0xdbcc('0x31')](_0x5d4e0c);recordings[_0xdbcc('0x31')](_0x5d4e0c);calls[_0xdbcc('0x31')](_0x5d4e0c);dials[_0xdbcc('0x31')](_0x5d4e0c);}catch(_0x3b64c6){utils['error'](util[_0xdbcc('0x14')](_0xdbcc('0x32'),_0x5d4e0c['uniqueid']),_0x3b64c6);}});ami['on'](_0xdbcc('0x33'),function(_0x54a226){try{utils[_0xdbcc('0x13')](util['format'](_0xdbcc('0x34'),_0x54a226[_0xdbcc('0x19')]),_0x54a226);calls[_0xdbcc('0x33')](_0x54a226);recordings['newexten'](_0x54a226);dials['newexten'](_0x54a226);}catch(_0xc47b06){utils['error'](util['format'](_0xdbcc('0x34'),_0x54a226[_0xdbcc('0x19')]),_0xc47b06);}});ami['on'](_0xdbcc('0x35'),function(_0x3d7310){try{utils[_0xdbcc('0x13')](util['format'](_0xdbcc('0x36'),_0x3d7310[_0xdbcc('0x19')]),_0x3d7310);calls[_0xdbcc('0x35')](_0x3d7310);recordings['newchannel'](_0x3d7310);}catch(_0x578e81){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x36'),_0x3d7310['uniqueid']),_0x578e81);}});ami['on']('dialbegin',function(_0x279094){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')]('[%s][index][dialbegin]',_0x279094['uniqueid']),_0x279094);dials[_0xdbcc('0x37')](_0x279094);}catch(_0x1ac892){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x38'),_0x279094[_0xdbcc('0x19')]),_0x1ac892);}});ami['on'](_0xdbcc('0x39'),function(_0x45c8a8){try{utils[_0xdbcc('0x13')](util[_0xdbcc('0x14')](_0xdbcc('0x3a'),_0x45c8a8[_0xdbcc('0x19')]),_0x45c8a8);dials[_0xdbcc('0x39')](_0x45c8a8);}catch(_0x4fd46b){utils[_0xdbcc('0xf')](util[_0xdbcc('0x14')](_0xdbcc('0x3a'),_0x45c8a8[_0xdbcc('0x19')]),_0x4fd46b);}});} \ No newline at end of file +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 diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index d9adccc..1e0089a 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 _0x98d9=['catch','some','startsWith','devicestatechange','debug','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','voice','TALKING','agent','exitAt','now','duration','diffTime','error','[%s][members][devicestatechange]','agentcomplete','isNil','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','[%s][members][cdr]','channel','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','getUserByInterface','name','internal','request','getUserByName','split','then','CreateMemberReport'];(function(_0x27fe6a,_0x15f8dc){var _0x592132=function(_0x5a96f6){while(--_0x5a96f6){_0x27fe6a['push'](_0x27fe6a['shift']());}};_0x592132(++_0x15f8dc);}(_0x98d9,0x12b));var _0x998d=function(_0x3079f6,_0x4ad349){_0x3079f6=_0x3079f6-0x0;var _0x2b7687=_0x98d9[_0x3079f6];return _0x2b7687;};'use strict';var _=require(_0x998d('0x0'));var util=require(_0x998d('0x1'));var utils=require(_0x998d('0x2'));var members={};var exclude=[_0x998d('0x3'),_0x998d('0x4')];function writeDB(_0x21b60e){utils['info'](util[_0x998d('0x5')](_0x998d('0x6'),_0x21b60e[_0x998d('0x7')],_0x21b60e[_0x998d('0x8')],_0x21b60e['channel'],_0x21b60e[_0x998d('0x9')],_0x21b60e[_0x998d('0xa')],_0x21b60e['type']));if(_0x21b60e[_0x998d('0x8')]){utils[_0x998d('0xb')](_0x21b60e[_0x998d('0x8')])['then'](function(_0xb4e664){if(_0xb4e664){_0x21b60e[_0x998d('0xa')]=_0xb4e664[_0x998d('0xc')];_0x21b60e['internal']=_0xb4e664[_0x998d('0xd')];utils[_0x998d('0xe')]('CreateMemberReport',_0x21b60e);}else{utils[_0x998d('0xf')](_0x21b60e[_0x998d('0x8')][_0x998d('0x10')]('/')[0x1])[_0x998d('0x11')](function(_0x271240){if(_0x271240){_0x21b60e[_0x998d('0xa')]=_0x271240[_0x998d('0xc')];_0x21b60e[_0x998d('0xd')]=_0x271240[_0x998d('0xd')];utils['request'](_0x998d('0x12'),_0x21b60e);}});}})[_0x998d('0x13')](function(_0x197295){utils['error'](util[_0x998d('0x5')]('[%s][members][writeDB]',_0x21b60e[_0x998d('0x7')]),_0x197295);});}delete members[_0x21b60e[_0x998d('0x8')]];}function startsWith(_0x4b92e7,_0x53c8ac){return _[_0x998d('0x14')](_0x4b92e7,function(_0xb11b89){return _[_0x998d('0x15')](_0x53c8ac,_0xb11b89);});}exports[_0x998d('0x16')]=function(_0x5445a5){try{utils[_0x998d('0x17')](util[_0x998d('0x5')]('[%s][members][devicestatechange]',members[_0x5445a5['device']]?members[_0x5445a5[_0x998d('0x18')]][_0x998d('0x7')]:_0x5445a5[_0x998d('0x18')]),_0x5445a5);utils['info'](util[_0x998d('0x5')](_0x998d('0x19'),members[_0x5445a5['device']]?members[_0x5445a5[_0x998d('0x18')]]['uniqueid']:_0x5445a5[_0x998d('0x18')],_0x5445a5[_0x998d('0x1a')],_0x5445a5['device']));switch(_0x5445a5[_0x998d('0x1a')]){case _0x998d('0x1b'):case'BUSY':if(!startsWith(exclude,_0x5445a5[_0x998d('0x18')])){members[_0x5445a5[_0x998d('0x18')]]={'channel':_0x998d('0x1c'),'interface':_0x5445a5['device'],'type':_0x998d('0x1d'),'enterAt':utils['now'](),'role':_0x998d('0x1e')};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x5445a5['device']])){members[_0x5445a5[_0x998d('0x18')]][_0x998d('0x1f')]=utils[_0x998d('0x20')]();members[_0x5445a5[_0x998d('0x18')]][_0x998d('0x21')]=utils[_0x998d('0x22')](members[_0x5445a5[_0x998d('0x18')]][_0x998d('0x1f')],members[_0x5445a5[_0x998d('0x18')]]['enterAt']);if(members[_0x5445a5[_0x998d('0x18')]]['uniqueid']){writeDB(members[_0x5445a5[_0x998d('0x18')]]);}}break;default:break;}}catch(_0x17fb89){utils[_0x998d('0x23')](util['format'](_0x998d('0x24'),members[_0x5445a5[_0x998d('0x18')]]?members[_0x5445a5[_0x998d('0x18')]][_0x998d('0x7')]:_0x5445a5[_0x998d('0x18')]),_0x17fb89);}};exports[_0x998d('0x25')]=function(_0x278bae){try{if(!_[_0x998d('0x26')](members[_0x278bae[_0x998d('0x8')]])){utils['debug'](util['format'](_0x998d('0x27'),_0x278bae['uniqueid']),_0x278bae);utils[_0x998d('0x28')](util['format'](_0x998d('0x29'),_0x278bae[_0x998d('0x7')],_0x278bae['interface'],_0x278bae[_0x998d('0x2a')]));members[_0x278bae['interface']]=_[_0x998d('0x2b')](members[_0x278bae['interface']],{'data4':_0x278bae['queue'],'uniqueid':_0x278bae[_0x998d('0x7')]});}}catch(_0x36d4bf){utils[_0x998d('0x23')](util[_0x998d('0x5')]('[%s][members][agentcomplete]',_0x278bae[_0x998d('0x7')]),_0x36d4bf);}};exports['cdr']=function(_0xb4bc53){try{utils[_0x998d('0x17')](util[_0x998d('0x5')](_0x998d('0x2c'),_0xb4bc53[_0x998d('0x7')]),_0xb4bc53);if(_0xb4bc53[_0x998d('0x2d')]){var _0x28277d=_0xb4bc53[_0x998d('0x2d')][_0x998d('0x10')]('-')[0x0];if(!_['isNil'](members[_0x28277d])){members[_0x28277d]=_['assign'](members[_0x28277d],{'data1':members[_0x28277d][_0x998d('0x2e')]||_0xb4bc53[_0x998d('0x2f')],'data2':members[_0x28277d]['data2']||_0xb4bc53[_0x998d('0x30')],'data3':members[_0x28277d][_0x998d('0x31')]||_0xb4bc53[_0x998d('0x32')],'uniqueid':members[_0x28277d][_0x998d('0x7')]||_0xb4bc53[_0x998d('0x7')]});utils[_0x998d('0x28')](util[_0x998d('0x5')](_0x998d('0x33'),_0xb4bc53[_0x998d('0x7')],members[_0x28277d][_0x998d('0x2e')],members[_0x28277d][_0x998d('0x9')],members[_0x28277d][_0x998d('0x31')]));if(members[_0x28277d][_0x998d('0x1f')]){writeDB(members[_0x28277d]);}}}if(_0xb4bc53['destinationchannel']){var _0x5f01d2=_0xb4bc53[_0x998d('0x34')][_0x998d('0x10')]('-')[0x0];if(!_['isNil'](members[_0x5f01d2])){members[_0x5f01d2]=_[_0x998d('0x2b')](members[_0x5f01d2],{'data1':members[_0x5f01d2][_0x998d('0x2e')]||_0xb4bc53['type'],'data2':members[_0x5f01d2][_0x998d('0x9')]||_0xb4bc53['source'],'data3':members[_0x5f01d2]['data3']||_0xb4bc53['destination'],'uniqueid':members[_0x5f01d2]['uniqueid']||_0xb4bc53['uniqueid']});utils[_0x998d('0x28')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0xb4bc53[_0x998d('0x7')],members[_0x5f01d2]['data1'],members[_0x5f01d2]['data2'],members[_0x5f01d2][_0x998d('0x31')]));if(members[_0x5f01d2][_0x998d('0x1f')]){writeDB(members[_0x5f01d2]);}}}}catch(_0xf6ec2f){utils[_0x998d('0x23')](util['format'](_0x998d('0x2c'),_0xb4bc53[_0x998d('0x7')]),_0xf6ec2f);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 73c5935..b34721d 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 _0xc6f0=['secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','queuecallerjoinAt','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][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','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','now','hangup','isNil','debug','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][varset]','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','error','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','holdtime','diffTime','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid'];(function(_0x1c25ef,_0x4311a2){var _0x3d1735=function(_0x1f3478){while(--_0x1f3478){_0x1c25ef['push'](_0x1c25ef['shift']());}};_0x3d1735(++_0x4311a2);}(_0xc6f0,0x154));var _0x0c6f=function(_0x4eb3f7,_0x281bfb){_0x4eb3f7=_0x4eb3f7-0x0;var _0x2c28e3=_0xc6f0[_0x4eb3f7];return _0x2c28e3;};'use strict';var _=require(_0x0c6f('0x0'));var util=require(_0x0c6f('0x1'));var utils=require(_0x0c6f('0x2'));var queues={};function writeDB(_0x29bc4e){utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x5'),_0x29bc4e[_0x0c6f('0x6')],_0x29bc4e[_0x0c6f('0x7')],_0x29bc4e[_0x0c6f('0x8')],_0x29bc4e[_0x0c6f('0x9')],_0x29bc4e[_0x0c6f('0xa')],_0x29bc4e[_0x0c6f('0xb')],_0x29bc4e[_0x0c6f('0xc')]));if(_0x29bc4e[_0x0c6f('0x8')]){utils[_0x0c6f('0xd')](_0x29bc4e[_0x0c6f('0x8')])['then'](function(_0x2d3f96){if(_0x2d3f96){_0x29bc4e[_0x0c6f('0xe')]=_0x2d3f96['type'];}utils[_0x0c6f('0xf')](_0x0c6f('0x10'),_0x29bc4e);});}else{utils[_0x0c6f('0xf')](_0x0c6f('0x10'),_0x29bc4e);}if(_0x29bc4e[_0x0c6f('0x11')]){delete queues[_0x29bc4e['transfereduniqueid']];}else{delete queues[_0x29bc4e[_0x0c6f('0x6')]];}}exports['queuecallerjoin']=function(_0x3e9b3b){try{utils['debug'](util[_0x0c6f('0x4')](_0x0c6f('0x12'),_0x3e9b3b[_0x0c6f('0x6')]),_0x3e9b3b);utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x13'),_0x3e9b3b[_0x0c6f('0x6')],_0x3e9b3b[_0x0c6f('0x8')],_0x3e9b3b[_0x0c6f('0x14')]));queues[_0x3e9b3b[_0x0c6f('0x6')]]=_['assign'](_0x3e9b3b,{'originalposition':_0x3e9b3b[_0x0c6f('0x14')],'queuecallerjoinAt':utils[_0x0c6f('0x15')](),'mohtime':0x0});}catch(_0x4c1cad){utils['error'](util[_0x0c6f('0x4')](_0x0c6f('0x12'),_0x3e9b3b[_0x0c6f('0x6')]),_0x4c1cad);}};exports[_0x0c6f('0x16')]=function(_0x56d818){try{if(!_[_0x0c6f('0x17')](queues[_0x56d818['uniqueid']])){utils[_0x0c6f('0x18')](util[_0x0c6f('0x4')]('[%s][queues][hangup]',_0x56d818[_0x0c6f('0x6')]),_0x56d818);if(queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0x19')]){if(!queues[_0x56d818['uniqueid']][_0x0c6f('0x1a')]&&!queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0x1b')]){queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0x1c')]=!![];queues[_0x56d818['uniqueid']][_0x0c6f('0x1d')]=utils['now']();queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0xc')]='COMPLETEDBYAGENT';}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x56d818[_0x0c6f('0x6')],queues[_0x56d818['uniqueid']][_0x0c6f('0x1e')],queues[_0x56d818['uniqueid']][_0x0c6f('0xc')]));writeDB(queues[_0x56d818[_0x0c6f('0x6')]]);}else if(queues[_0x56d818['uniqueid']][_0x0c6f('0x11')]){utils[_0x0c6f('0x3')](util['format'](_0x0c6f('0x1f'),_0x56d818[_0x0c6f('0x6')],queues[_0x56d818['uniqueid']][_0x0c6f('0x1e')],queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0x11')]));queues[queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0x11')]]=queues[_0x56d818[_0x0c6f('0x6')]];queues[queues[_0x56d818[_0x0c6f('0x6')]][_0x0c6f('0x11')]][_0x0c6f('0x20')]=0x2;delete queues[_0x56d818[_0x0c6f('0x6')]];}}}catch(_0x246368){utils['error'](util[_0x0c6f('0x4')]('[%s][queues][hangup]',_0x56d818['uniqueid']),_0x246368);}};exports['varset']=function(_0x10b807){try{utils[_0x0c6f('0x18')](util['format'](_0x0c6f('0x21'),_0x10b807['uniqueid']),_0x10b807);if(!_[_0x0c6f('0x17')](_0x10b807[_0x0c6f('0x22')]['queuestatus'])&&_0x10b807[_0x0c6f('0x23')][_0x0c6f('0x24')]()!==_0x0c6f('0x25')){if(!_[_0x0c6f('0x17')](queues[_0x10b807['uniqueid']])){queues[_0x10b807[_0x0c6f('0x6')]]['queuecallerabandon']=![];queues[_0x10b807['uniqueid']][_0x0c6f('0x26')]=null;queues[_0x10b807[_0x0c6f('0x6')]][_0x0c6f('0x1b')]=!![];queues[_0x10b807[_0x0c6f('0x6')]][_0x0c6f('0x27')]=utils[_0x0c6f('0x15')]();queues[_0x10b807[_0x0c6f('0x6')]][_0x0c6f('0xc')]=_0x10b807['value'][_0x0c6f('0x24')]();utils[_0x0c6f('0x3')](util['format'](_0x0c6f('0x28'),_0x10b807[_0x0c6f('0x6')],queues[_0x10b807[_0x0c6f('0x6')]]['name'],_0x10b807['value'],queues[_0x10b807[_0x0c6f('0x6')]][_0x0c6f('0xc')]));writeDB(queues[_0x10b807[_0x0c6f('0x6')]]);}}else if(!_[_0x0c6f('0x17')](_0x10b807['variable']['queueposition'])){if(!_[_0x0c6f('0x17')](queues[_0x10b807['uniqueid']])&&!queues[_0x10b807[_0x0c6f('0x6')]]['queuecallerabandon']){queues[_0x10b807[_0x0c6f('0x6')]][_0x0c6f('0x1a')]=![];queues[_0x10b807[_0x0c6f('0x6')]][_0x0c6f('0x26')]=null;queues[_0x10b807['uniqueid']][_0x0c6f('0x1b')]=!![];queues[_0x10b807[_0x0c6f('0x6')]]['queuecallerexitAt']=utils[_0x0c6f('0x15')]();queues[_0x10b807[_0x0c6f('0x6')]]['queuecallerexitreason']=_0x0c6f('0x29');utils['info'](util['format'](_0x0c6f('0x2a'),_0x10b807[_0x0c6f('0x6')],queues[_0x10b807[_0x0c6f('0x6')]]['name'],_0x10b807[_0x0c6f('0x23')],queues[_0x10b807[_0x0c6f('0x6')]]['queuecallerexitreason']));}}}catch(_0x3eb495){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')](_0x0c6f('0x21'),_0x10b807[_0x0c6f('0x6')]),_0x3eb495);}};exports[_0x0c6f('0x1a')]=function(_0x1236e9){try{if(!_[_0x0c6f('0x17')](queues[_0x1236e9[_0x0c6f('0x6')]])){utils['debug'](util[_0x0c6f('0x4')](_0x0c6f('0x2c'),_0x1236e9[_0x0c6f('0x6')]),_0x1236e9);queues[_0x1236e9[_0x0c6f('0x6')]][_0x0c6f('0x1b')]=![];queues[_0x1236e9['uniqueid']][_0x0c6f('0x27')]=null;queues[_0x1236e9[_0x0c6f('0x6')]]['queuecallerabandon']=!![];queues[_0x1236e9[_0x0c6f('0x6')]]['queuecallerabandonAt']=utils[_0x0c6f('0x15')]();queues[_0x1236e9[_0x0c6f('0x6')]][_0x0c6f('0xc')]=_0x0c6f('0x2d');utils['info'](util[_0x0c6f('0x4')](_0x0c6f('0x2e'),_0x1236e9[_0x0c6f('0x6')],queues[_0x1236e9[_0x0c6f('0x6')]][_0x0c6f('0x1e')],queues[_0x1236e9[_0x0c6f('0x6')]]['queuecallerexitreason']));}}catch(_0x28cc9a){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')](_0x0c6f('0x2c'),_0x1236e9[_0x0c6f('0x6')]),_0x28cc9a);}};exports['queuecallerleave']=function(_0x124072){try{if(!_[_0x0c6f('0x17')](queues[_0x124072[_0x0c6f('0x6')]])){utils[_0x0c6f('0x18')](util[_0x0c6f('0x4')](_0x0c6f('0x2f'),_0x124072['uniqueid']),_0x124072);utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x30'),_0x124072['uniqueid'],queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x1e')],_0x124072[_0x0c6f('0x31')],_0x124072[_0x0c6f('0x32')]));queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x33')]=!![];queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x19')]=utils[_0x0c6f('0x15')]();queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x34')]=utils[_0x0c6f('0x35')](queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x19')],queues[_0x124072['uniqueid']]['queuecallerjoinAt']);queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x14')]=_0x124072[_0x0c6f('0x14')];queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x36')]=_0x124072[_0x0c6f('0x36')];queues[_0x124072['uniqueid']][_0x0c6f('0x31')]=_0x124072[_0x0c6f('0x31')];queues[_0x124072[_0x0c6f('0x6')]][_0x0c6f('0x32')]=_0x124072[_0x0c6f('0x32')];}}catch(_0xfc0c4){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')](_0x0c6f('0x2f'),_0x124072[_0x0c6f('0x6')]),_0xfc0c4);}};exports[_0x0c6f('0x37')]=function(_0x4b6d0c){try{if(!_[_0x0c6f('0x17')](queues[_0x4b6d0c[_0x0c6f('0x6')]])){utils['debug'](util[_0x0c6f('0x4')](_0x0c6f('0x38'),_0x4b6d0c[_0x0c6f('0x6')]),_0x4b6d0c);utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x39'),_0x4b6d0c[_0x0c6f('0x6')],queues[_0x4b6d0c[_0x0c6f('0x6')]][_0x0c6f('0x1e')],_0x4b6d0c[_0x0c6f('0x3a')],_0x4b6d0c[_0x0c6f('0x3b')]));queues[_0x4b6d0c[_0x0c6f('0x6')]][_0x0c6f('0x1a')]=![];queues[_0x4b6d0c[_0x0c6f('0x6')]][_0x0c6f('0x1a')]=![];queues[_0x4b6d0c[_0x0c6f('0x6')]]['queuecallerabandonAt']=null;queues[_0x4b6d0c[_0x0c6f('0x6')]][_0x0c6f('0x1b')]=![];queues[_0x4b6d0c[_0x0c6f('0x6')]][_0x0c6f('0xc')]=null;queues[_0x4b6d0c['uniqueid']][_0x0c6f('0x27')]=null;queues[_0x4b6d0c['uniqueid']][_0x0c6f('0x3c')]=!![];queues[_0x4b6d0c['uniqueid']][_0x0c6f('0xb')]=_0x4b6d0c[_0x0c6f('0x3b')];queues[_0x4b6d0c[_0x0c6f('0x6')]][_0x0c6f('0x9')]=_0x4b6d0c[_0x0c6f('0x3a')];}}catch(_0x4a7f30){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')](_0x0c6f('0x38'),_0x4b6d0c['uniqueid']),_0x4a7f30);}};exports[_0x0c6f('0x3d')]=function(_0x2c085d){try{if(!_[_0x0c6f('0x17')](queues[_0x2c085d['uniqueid']])){if(queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x19')]){utils['debug'](util['format'](_0x0c6f('0x3e'),_0x2c085d['uniqueid']),_0x2c085d);queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x1a')]=![];queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x1a')]=![];queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x26')]=null;queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x1b')]=![];queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x27')]=null;queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x3c')]=!![];queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x9')]=_0x2c085d[_0x0c6f('0x3a')];queues[_0x2c085d['uniqueid']][_0x0c6f('0x1c')]=!![];queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0x1d')]=utils[_0x0c6f('0x15')]();if(_0x2c085d[_0x0c6f('0x3f')]==_0x0c6f('0x40')){if(!queues[_0x2c085d['uniqueid']][_0x0c6f('0x40')]){queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0xc')]=_0x0c6f('0x41');}}else{queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0xc')]='COMPLETEDBY'+_0x2c085d[_0x0c6f('0x3f')][_0x0c6f('0x24')]();}utils['info'](util[_0x0c6f('0x4')](_0x0c6f('0x42'),_0x2c085d['uniqueid'],queues[_0x2c085d[_0x0c6f('0x6')]]['name'],_0x2c085d[_0x0c6f('0x3a')],queues[_0x2c085d[_0x0c6f('0x6')]][_0x0c6f('0xc')]));writeDB(queues[_0x2c085d[_0x0c6f('0x6')]]);}}}catch(_0x3e51db){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')]('[%s][queues][agentcomplete]',_0x2c085d[_0x0c6f('0x6')]),_0x3e51db);}};exports[_0x0c6f('0x43')]=function(_0x1a11f7){try{if(!_[_0x0c6f('0x17')](queues[_0x1a11f7[_0x0c6f('0x44')]])){utils[_0x0c6f('0x18')](util['format'](_0x0c6f('0x45'),_0x1a11f7[_0x0c6f('0x6')]),_0x1a11f7);queues[_0x1a11f7['transfereeuniqueid']][_0x0c6f('0x40')]=!![];queues[_0x1a11f7[_0x0c6f('0x44')]][_0x0c6f('0x46')]=_0x0c6f('0x47');queues[_0x1a11f7[_0x0c6f('0x44')]][_0x0c6f('0x48')]=_0x1a11f7[_0x0c6f('0x49')];queues[_0x1a11f7[_0x0c6f('0x44')]][_0x0c6f('0x4a')]=_0x1a11f7[_0x0c6f('0x44')];queues[_0x1a11f7[_0x0c6f('0x44')]][_0x0c6f('0xc')]=_0x0c6f('0x4b');utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x4c'),_0x1a11f7[_0x0c6f('0x6')],queues[_0x1a11f7[_0x0c6f('0x44')]][_0x0c6f('0x1e')],_0x1a11f7[_0x0c6f('0x44')],_0x1a11f7['extension']));}}catch(_0x4a89d6){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')](_0x0c6f('0x45'),_0x1a11f7['uniqueid']),_0x4a89d6);}};exports[_0x0c6f('0x4d')]=function(_0x1e7ec8){try{utils[_0x0c6f('0x18')](util[_0x0c6f('0x4')](_0x0c6f('0x4e'),_0x1e7ec8[_0x0c6f('0x4f')]),_0x1e7ec8);if(_0x1e7ec8[_0x0c6f('0x4f')]==_0x1e7ec8['origtransfererlinkedid']){if(!_[_0x0c6f('0x17')](queues[_0x1e7ec8[_0x0c6f('0x50')]])){utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x51'),_0x1e7ec8[_0x0c6f('0x4f')],queues[_0x1e7ec8[_0x0c6f('0x50')]][_0x0c6f('0x1e')],_0x1e7ec8[_0x0c6f('0x52')]));queues[_0x1e7ec8[_0x0c6f('0x50')]][_0x0c6f('0x40')]=!![];queues[_0x1e7ec8['secondtransfererlinkedid']][_0x0c6f('0x46')]=_0x0c6f('0x53');queues[_0x1e7ec8['secondtransfererlinkedid']][_0x0c6f('0x48')]=_0x1e7ec8['origtransfererexten'];queues[_0x1e7ec8[_0x0c6f('0x50')]][_0x0c6f('0x4a')]=_0x1e7ec8[_0x0c6f('0x4f')];queues[_0x1e7ec8['secondtransfererlinkedid']][_0x0c6f('0xc')]=_0x0c6f('0x54');}if(!_[_0x0c6f('0x17')](queues[_0x1e7ec8[_0x0c6f('0x55')]])){if(_0x1e7ec8[_0x0c6f('0x56')]&&queues[_0x1e7ec8['transfereelinkedid']]){queues[_0x1e7ec8['transfereelinkedid']][_0x0c6f('0x20')]=0x1;queues[_0x1e7ec8[_0x0c6f('0x44')]]=_[_0x0c6f('0x57')](queues[_0x1e7ec8[_0x0c6f('0x56')]]);queues[_0x1e7ec8[_0x0c6f('0x44')]][_0x0c6f('0x11')]=_0x1e7ec8[_0x0c6f('0x58')];queues[_0x1e7ec8['transfereeuniqueid']][_0x0c6f('0x20')]=0x2;queues[_0x1e7ec8[_0x0c6f('0x44')]][_0x0c6f('0xa')]=queues[_0x1e7ec8[_0x0c6f('0x50')]][_0x0c6f('0xa')];queues[_0x1e7ec8[_0x0c6f('0x44')]]['calleridname']=queues[_0x1e7ec8['secondtransfererlinkedid']][_0x0c6f('0x59')];queues[_0x1e7ec8['transfereeuniqueid']]['queuecallerjoinAt']=utils[_0x0c6f('0x15')]();queues[_0x1e7ec8[_0x0c6f('0x44')]][_0x0c6f('0x19')]=utils['now']();queues[_0x1e7ec8[_0x0c6f('0x44')]][_0x0c6f('0x34')]=0x0;queues[_0x1e7ec8['transfereeuniqueid']][_0x0c6f('0x5a')]=0x0;utils['info'](util[_0x0c6f('0x4')](_0x0c6f('0x5b'),_0x1e7ec8[_0x0c6f('0x4f')],queues[_0x1e7ec8[_0x0c6f('0x44')]]['name'],queues[_0x1e7ec8[_0x0c6f('0x44')]][_0x0c6f('0xa')],queues[_0x1e7ec8[_0x0c6f('0x44')]][_0x0c6f('0x59')]));}else{utils[_0x0c6f('0x3')](util['format'](_0x0c6f('0x5c'),_0x1e7ec8[_0x0c6f('0x4f')],queues[_0x1e7ec8[_0x0c6f('0x55')]][_0x0c6f('0x1e')],_0x1e7ec8[_0x0c6f('0x50')]));queues[_0x1e7ec8[_0x0c6f('0x55')]][_0x0c6f('0x11')]=_0x1e7ec8[_0x0c6f('0x50')];}}}else if(_0x1e7ec8[_0x0c6f('0x5d')]==_0x1e7ec8[_0x0c6f('0x50')]){if(!_[_0x0c6f('0x17')](queues[_0x1e7ec8[_0x0c6f('0x55')]])){utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1e7ec8[_0x0c6f('0x4f')],queues[_0x1e7ec8[_0x0c6f('0x55')]]['name'],_0x1e7ec8[_0x0c6f('0x5d')],_0x1e7ec8[_0x0c6f('0x5e')]));queues[_0x1e7ec8[_0x0c6f('0x55')]][_0x0c6f('0x40')]=!![];queues[_0x1e7ec8['origtransfererlinkedid']][_0x0c6f('0x46')]=_0x0c6f('0x53');queues[_0x1e7ec8['origtransfererlinkedid']]['transferexten']=_0x1e7ec8[_0x0c6f('0x5e')];queues[_0x1e7ec8[_0x0c6f('0x55')]][_0x0c6f('0x4a')]=_0x1e7ec8[_0x0c6f('0x5d')];queues[_0x1e7ec8[_0x0c6f('0x55')]][_0x0c6f('0xc')]=_0x0c6f('0x54');}if(!_[_0x0c6f('0x17')](queues[_0x1e7ec8[_0x0c6f('0x50')]])){if(_0x1e7ec8[_0x0c6f('0x5f')]&&queues[_0x1e7ec8['transfertargetlinkedid']]){queues[_0x1e7ec8[_0x0c6f('0x5f')]][_0x0c6f('0x20')]=0x1;queues[_0x1e7ec8['transfertargetuniqueid']]=_[_0x0c6f('0x57')](queues[_0x1e7ec8[_0x0c6f('0x5f')]]);queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x11')]=_0x1e7ec8[_0x0c6f('0x58')];queues[_0x1e7ec8['transfertargetuniqueid']][_0x0c6f('0x20')]=0x2;queues[_0x1e7ec8['transfertargetuniqueid']][_0x0c6f('0xa')]=queues[_0x1e7ec8['origtransfererlinkedid']][_0x0c6f('0xa')];queues[_0x1e7ec8[_0x0c6f('0x58')]]['calleridname']=queues[_0x1e7ec8['origtransfererlinkedid']][_0x0c6f('0x59')];queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x60')]=utils[_0x0c6f('0x15')]();queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x19')]=utils[_0x0c6f('0x15')]();queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x34')]=0x0;queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x5a')]=0x0;utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x61'),_0x1e7ec8[_0x0c6f('0x4f')],queues[_0x1e7ec8['transfertargetuniqueid']][_0x0c6f('0x1e')],queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x11')],queues[_0x1e7ec8[_0x0c6f('0x58')]]['calleridnum'],queues[_0x1e7ec8[_0x0c6f('0x58')]][_0x0c6f('0x59')]));}else{utils[_0x0c6f('0x3')](util['format'](_0x0c6f('0x5c'),_0x1e7ec8[_0x0c6f('0x4f')],queues[_0x1e7ec8[_0x0c6f('0x50')]][_0x0c6f('0x1e')],_0x1e7ec8[_0x0c6f('0x55')]));queues[_0x1e7ec8[_0x0c6f('0x50')]][_0x0c6f('0x11')]=_0x1e7ec8[_0x0c6f('0x55')];}}}}catch(_0x3ce6b4){utils[_0x0c6f('0x2b')](util[_0x0c6f('0x4')](_0x0c6f('0x4e'),_0x1e7ec8[_0x0c6f('0x4f')]),_0x3ce6b4);}};exports[_0x0c6f('0x62')]=function(_0x19286a){try{if(!_[_0x0c6f('0x17')](queues[_0x19286a[_0x0c6f('0x6')]])){utils[_0x0c6f('0x18')](util[_0x0c6f('0x4')](_0x0c6f('0x63'),_0x19286a[_0x0c6f('0x6')]),_0x19286a);queues[_0x19286a['uniqueid']][_0x0c6f('0x64')]=utils['now']();utils[_0x0c6f('0x3')](util[_0x0c6f('0x4')](_0x0c6f('0x65'),_0x19286a[_0x0c6f('0x6')],queues[_0x19286a[_0x0c6f('0x6')]]['name'],queues[_0x19286a[_0x0c6f('0x6')]][_0x0c6f('0x64')]));}}catch(_0x1bb7c4){utils['error'](util[_0x0c6f('0x4')](_0x0c6f('0x63'),_0x19286a[_0x0c6f('0x6')]),_0x1bb7c4);}};exports[_0x0c6f('0x66')]=function(_0x39a733){try{if(!_[_0x0c6f('0x17')](queues[_0x39a733[_0x0c6f('0x6')]])){if(!_[_0x0c6f('0x17')](queues[_0x39a733['uniqueid']][_0x0c6f('0x64')])){utils[_0x0c6f('0x18')](util[_0x0c6f('0x4')](_0x0c6f('0x67'),_0x39a733[_0x0c6f('0x6')]),_0x39a733);queues[_0x39a733[_0x0c6f('0x6')]]['mohtime']+=utils[_0x0c6f('0x35')](utils['now'](),queues[_0x39a733[_0x0c6f('0x6')]]['musiconholdstartAt']);utils[_0x0c6f('0x3')](util['format'](_0x0c6f('0x68'),_0x39a733[_0x0c6f('0x6')],queues[_0x39a733[_0x0c6f('0x6')]][_0x0c6f('0x1e')],queues[_0x39a733[_0x0c6f('0x6')]][_0x0c6f('0x5a')]));delete queues[_0x39a733[_0x0c6f('0x6')]][_0x0c6f('0x64')];}}}catch(_0x141386){utils[_0x0c6f('0x2b')](util['format'](_0x0c6f('0x67'),_0x39a733[_0x0c6f('0x6')]),_0x141386);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index b8850e3..d22c814 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 _0xc478=['lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','variable','mixmonitor_filename','[%s][recordings][varset]','value','endsWith','.wav49','replace','find','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','application','appdata','toLowerCase','startsWith','split'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc478,0x80));var _0x8c47=function(_0x3ec3f0,_0x9d0224){_0x3ec3f0=_0x3ec3f0-0x0;var _0x337473=_0xc478[_0x3ec3f0];return _0x337473;};'use strict';var _=require(_0x8c47('0x0'));var util=require('util');var utils=require(_0x8c47('0x1'));var recordings={};function writeDB(_0x215990){utils[_0x8c47('0x2')](util[_0x8c47('0x3')](_0x8c47('0x4'),_0x215990[_0x8c47('0x5')]));if(_0x215990['accountcode']){utils[_0x8c47('0x6')](_0x215990[_0x8c47('0x7')])[_0x8c47('0x8')](function(_0x3ab3a9){if(_0x3ab3a9){_0x215990[_0x8c47('0x9')]=_0x3ab3a9[_0x8c47('0xa')];_0x215990[_0x8c47('0xb')]=_0x3ab3a9['id'];}utils[_0x8c47('0xc')](_0x8c47('0xd'),_0x215990);});}else{utils[_0x8c47('0xc')]('CreateVoiceRecording',_0x215990);}}exports[_0x8c47('0xe')]=function(_0x38cf29){try{utils['debug'](util['format'](_0x8c47('0xf'),_0x38cf29['uniqueid']),_0x38cf29);if(_0x38cf29[_0x8c47('0x5')]==_0x38cf29[_0x8c47('0x10')]){utils[_0x8c47('0x2')](util[_0x8c47('0x3')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x38cf29['uniqueid'],_0x38cf29[_0x8c47('0x11')],_0x38cf29[_0x8c47('0x12')]));recordings[_0x38cf29[_0x8c47('0x5')]]={'uniqueid':_0x38cf29[_0x8c47('0x5')],'accountcode':_0x38cf29['accountcode'],'exten':_0x38cf29[_0x8c47('0x12')],'context':_0x38cf29[_0x8c47('0x11')],'channel':_0x38cf29[_0x8c47('0x13')],'monitors':[]};}}catch(_0x49508e){utils[_0x8c47('0x14')](util[_0x8c47('0x3')](_0x8c47('0xf'),_0x38cf29[_0x8c47('0x5')]),_0x49508e);}};exports[_0x8c47('0x15')]=function(_0x3fb6c7){try{utils[_0x8c47('0x16')](util[_0x8c47('0x3')](_0x8c47('0x17'),_0x3fb6c7[_0x8c47('0x5')]),_0x3fb6c7);if(!_[_0x8c47('0x18')](recordings[_0x3fb6c7[_0x8c47('0x5')]])&&_0x3fb6c7[_0x8c47('0x19')]==0x6){utils['info'](util[_0x8c47('0x3')](_0x8c47('0x1a'),_0x3fb6c7[_0x8c47('0x5')],_0x3fb6c7[_0x8c47('0x11')],_0x3fb6c7[_0x8c47('0x13')]));}else if(!_[_0x8c47('0x18')](recordings[_0x3fb6c7[_0x8c47('0x10')]])&&_0x3fb6c7['channelstate']==0x6&&_0x3fb6c7[_0x8c47('0x11')]!=_0x8c47('0x1b')){utils[_0x8c47('0x2')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x3fb6c7[_0x8c47('0x5')],_0x3fb6c7[_0x8c47('0x10')],_0x3fb6c7[_0x8c47('0x11')],_0x3fb6c7[_0x8c47('0x13')]));recordings[_0x3fb6c7[_0x8c47('0x10')]][_0x8c47('0x7')]=_0x3fb6c7['accountcode'];}}catch(_0x1fc79d){utils[_0x8c47('0x14')](util['format'](_0x8c47('0x17'),_0x3fb6c7[_0x8c47('0x5')]),_0x1fc79d);}};exports['varset']=function(_0x2e56d0){try{if(!_[_0x8c47('0x18')](_0x2e56d0[_0x8c47('0x1c')])&&!_[_0x8c47('0x18')](_0x2e56d0[_0x8c47('0x1c')][_0x8c47('0x1d')])){utils[_0x8c47('0x16')](util[_0x8c47('0x3')](_0x8c47('0x1e'),_0x2e56d0[_0x8c47('0x5')]),_0x2e56d0);utils[_0x8c47('0x2')](util['format']('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x2e56d0[_0x8c47('0x5')],_0x2e56d0[_0x8c47('0x1c')],_0x2e56d0[_0x8c47('0x1f')]));if(_[_0x8c47('0x20')](_0x2e56d0[_0x8c47('0x1f')],_0x8c47('0x21'))){_0x2e56d0[_0x8c47('0x1f')]=_0x2e56d0[_0x8c47('0x1f')][_0x8c47('0x22')](_0x8c47('0x21'),'.WAV');}if(recordings[_0x2e56d0[_0x8c47('0x10')]]){var _0x49ae46=_[_0x8c47('0x23')](recordings[_0x2e56d0['linkedid']][_0x8c47('0x24')],{'value':_0x2e56d0[_0x8c47('0x1f')]});if(_[_0x8c47('0x18')](_0x49ae46)){recordings[_0x2e56d0[_0x8c47('0x10')]][_0x8c47('0x24')][_0x8c47('0x25')]({'value':_0x2e56d0[_0x8c47('0x1f')]});}}}}catch(_0xc89fc5){utils['error'](util['format'](_0x8c47('0x1e'),_0x2e56d0[_0x8c47('0x5')]),_0xc89fc5);}};exports[_0x8c47('0x26')]=function(_0x17a150){try{if(!_[_0x8c47('0x18')](recordings[_0x17a150[_0x8c47('0x5')]])){utils[_0x8c47('0x16')](util[_0x8c47('0x3')](_0x8c47('0x27'),_0x17a150[_0x8c47('0x5')]),_0x17a150);utils[_0x8c47('0x2')](util['format'](_0x8c47('0x28'),_0x17a150['uniqueid'],_0x17a150[_0x8c47('0x29')],_0x17a150[_0x8c47('0x2a')],_0x17a150[_0x8c47('0x2b')]));recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x29')]=_0x17a150[_0x8c47('0x29')];recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x2a')]=_0x17a150[_0x8c47('0x2a')];recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x2c')]=_0x17a150[_0x8c47('0x2c')];recordings[_0x17a150['uniqueid']][_0x8c47('0x2d')]=_0x17a150['connectedlinename'];if(recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x2e')]==_0x8c47('0x2f')&&recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x7')]){recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x2c')]=recordings[_0x17a150[_0x8c47('0x5')]][_0x8c47('0x7')];recordings[_0x17a150['uniqueid']][_0x8c47('0x2d')]='';}recordings[_0x17a150['uniqueid']][_0x8c47('0x24')][_0x8c47('0x30')](function(_0x1a5ea7){var _0x173f91=_[_0x8c47('0x31')](recordings[_0x17a150[_0x8c47('0x5')]]);_0x173f91[_0x8c47('0x1f')]=_0x1a5ea7[_0x8c47('0x1f')];writeDB(_0x173f91);});delete recordings[_0x17a150['uniqueid']];}}catch(_0x5831d0){utils['error'](util[_0x8c47('0x3')](_0x8c47('0x27'),_0x17a150[_0x8c47('0x5')]),_0x5831d0);}};exports[_0x8c47('0x32')]=function(_0x19d961){try{if(!_[_0x8c47('0x18')](recordings[_0x19d961[_0x8c47('0x5')]])){utils['debug'](util[_0x8c47('0x3')](_0x8c47('0x33'),_0x19d961[_0x8c47('0x5')]),_0x19d961);utils[_0x8c47('0x2')](util[_0x8c47('0x3')](_0x8c47('0x34'),_0x19d961[_0x8c47('0x5')],_0x19d961[_0x8c47('0x35')],_0x19d961[_0x8c47('0x36')]));if(_0x19d961['application'][_0x8c47('0x37')]()=='set'&&_[_0x8c47('0x38')](_0x19d961[_0x8c47('0x36')][_0x8c47('0x37')](),'cdr')){var _0x2e8454=_0x19d961[_0x8c47('0x36')][_0x8c47('0x39')]('=');var _0x38578f=_0x2e8454[0x0]['substring'](_0x2e8454[0x0][_0x8c47('0x3a')]('(')+0x1,_0x2e8454[0x0]['lastIndexOf'](')'));var _0x535794=_0x2e8454[0x1];recordings[_0x19d961[_0x8c47('0x5')]][_0x38578f]=_0x535794;}}}catch(_0xd673f8){utils[_0x8c47('0x14')](util[_0x8c47('0x3')](_0x8c47('0x33'),_0x19d961[_0x8c47('0x5')]),_0xd673f8);}};exports[_0x8c47('0x3b')]=function(_0x535476){try{if(!_[_0x8c47('0x18')](recordings[_0x535476[_0x8c47('0x5')]])){utils[_0x8c47('0x16')](util[_0x8c47('0x3')]('[%s][recordings][queuecallerjoin]',_0x535476[_0x8c47('0x5')]),_0x535476);utils[_0x8c47('0x2')](util[_0x8c47('0x3')](_0x8c47('0x3c'),_0x535476[_0x8c47('0x5')],_0x535476[_0x8c47('0x3d')]));recordings[_0x535476[_0x8c47('0x5')]][_0x8c47('0x3d')]=_0x535476['queue'];}}catch(_0x2938b7){utils['error'](util['format']('[%s][recordings][queuecallerjoin]',_0x535476[_0x8c47('0x5')]),_0x2938b7);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3dfa01f..370fa10 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 _0xcb85=['attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','debug','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]'];(function(_0x260d47,_0x437f65){var _0x3af3ff=function(_0x22e57f){while(--_0x22e57f){_0x260d47['push'](_0x260d47['shift']());}};_0x3af3ff(++_0x437f65);}(_0xcb85,0x190));var _0x5cb8=function(_0x4dab14,_0x164ea0){_0x4dab14=_0x4dab14-0x0;var _0xf41aa=_0xcb85[_0x4dab14];return _0xf41aa;};'use strict';var _=require('lodash');var util=require(_0x5cb8('0x0'));var utils=require(_0x5cb8('0x1'));function writeDB(_0x1b5aae){utils[_0x5cb8('0x2')](util[_0x5cb8('0x3')](_0x5cb8('0x4'),_0x1b5aae[_0x5cb8('0x5')]===_0x5cb8('0x6')?_0x1b5aae[_0x5cb8('0x7')]:_0x1b5aae[_0x5cb8('0x8')],_0x1b5aae[_0x5cb8('0x5')]));utils[_0x5cb8('0x9')]('CreateVoiceTransferReport',_0x1b5aae);}exports['blinds']={};exports['blindtransfer']=function(_0x14d594){try{utils[_0x5cb8('0xa')](util['format']('[%s][transfers][blindtransfer]',_0x14d594[_0x5cb8('0x8')]),_0x14d594);utils['info'](util['format'](_0x5cb8('0xb'),_0x14d594[_0x5cb8('0x8')],_0x14d594['transferercalleridnum'],_0x14d594[_0x5cb8('0xc')],_0x14d594['transfereecalleridnum'],_0x14d594[_0x5cb8('0xd')]));_0x14d594[_0x5cb8('0x5')]=_0x5cb8('0xe');exports['blinds'][_0x14d594[_0x5cb8('0xf')]]=_0x14d594;writeDB(_0x14d594);}catch(_0x1a7eff){utils[_0x5cb8('0x10')](util[_0x5cb8('0x3')](_0x5cb8('0x11'),_0x14d594['uniqueid']),_0x1a7eff);}};exports[_0x5cb8('0x12')]=function(_0x340d23){try{utils[_0x5cb8('0xa')](util[_0x5cb8('0x3')](_0x5cb8('0x13'),_0x340d23['origtransfereruniqueid']),_0x340d23);utils[_0x5cb8('0x2')](util[_0x5cb8('0x3')](_0x5cb8('0x14'),_0x340d23[_0x5cb8('0x7')],_0x340d23['origtransferercalleridnum'],_0x340d23[_0x5cb8('0x15')],_0x340d23[_0x5cb8('0x16')],_0x340d23['transfertargetcalleridname']));_0x340d23=_[_0x5cb8('0x17')](_0x340d23,{'transfererchannel':_0x340d23[_0x5cb8('0x18')],'transferercalleridnum':_0x340d23['origtransferercalleridnum'],'transferercalleridname':_0x340d23[_0x5cb8('0x15')],'transfererconnectedlinenum':_0x340d23['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x340d23[_0x5cb8('0x19')],'transfereraccountcode':_0x340d23[_0x5cb8('0x1a')],'transferercontext':_0x340d23[_0x5cb8('0x1b')],'transfererexten':_0x340d23[_0x5cb8('0x1c')],'transfererlinkedid':_0x340d23['origtransfererlinkedid'],'context':_0x340d23[_0x5cb8('0x1d')],'extension':_0x340d23[_0x5cb8('0x1e')],'type':_0x5cb8('0x6')});if(_[_0x5cb8('0x1f')](_0x340d23[_0x5cb8('0x20')])){_0x340d23=_[_0x5cb8('0x17')](_0x340d23,{'transfereechannel':_0x340d23[_0x5cb8('0x21')],'transfereecalleridnum':_0x340d23[_0x5cb8('0x16')],'transfereecalleridname':_0x340d23['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x340d23[_0x5cb8('0x22')],'transfereeconnectedlinename':_0x340d23['transfertargetconnectedlinename'],'transfereeaccountcode':_0x340d23['transfertargetaccountcode'],'transfereecontext':_0x340d23[_0x5cb8('0x23')],'transfereeexten':_0x340d23[_0x5cb8('0x24')],'transfereelinkedid':_0x340d23[_0x5cb8('0x25')]});}writeDB(_0x340d23);}catch(_0x40d682){utils['error'](util[_0x5cb8('0x3')](_0x5cb8('0x13'),_0x340d23[_0x5cb8('0x7')]),_0x40d682);}}; \ No newline at end of file +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 diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 1accf87..1cc89b5 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 _0x6deb=['info','debug','inspect','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','length','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','xdr'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6deb,0x8c));var _0xb6de=function(_0x13cd33,_0x40f3dc){_0x13cd33=_0x13cd33-0x0;var _0x2326f6=_0x6deb[_0x13cd33];return _0x2326f6;};'use strict';var BPromise=require(_0xb6de('0x0'));var jayson=require(_0xb6de('0x1'));var moment=require('moment');var util=require(_0xb6de('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require('../../config/logger')(_0xb6de('0x3'));exports[_0xb6de('0x4')]=function(_0x4ac172,_0x16d25a){logger[_0xb6de('0x4')](_0x4ac172,_0x16d25a?util['inspect'](_0x16d25a,{'showHidden':![],'depth':null}):'');};exports[_0xb6de('0x5')]=function(_0x3d21bf,_0x29ed8a){logger[_0xb6de('0x5')](_0x3d21bf,_0x29ed8a?util[_0xb6de('0x6')](_0x29ed8a,{'showHidden':![],'depth':null}):'');};exports[_0xb6de('0x7')]=function(_0x319ffc,_0x2cc1b0){logger[_0xb6de('0x7')](_0x319ffc,_0x2cc1b0?util['inspect'](_0x2cc1b0,{'showHidden':![],'depth':null}):'');};exports[_0xb6de('0x8')]=function(_0xc9553e,_0x156ddc){return client[_0xb6de('0x8')](_0xc9553e,{'body':_0x156ddc})[_0xb6de('0x9')](function(_0x153e8e){logger[_0xb6de('0x5')]('[utils][request]\x20name:%s',_0xc9553e,_0x153e8e?util[_0xb6de('0x6')](_0x153e8e,{'showHidden':![],'depth':null}):'');})[_0xb6de('0xa')](function(_0x5abf75){logger['error'](_0xb6de('0xb'),_0xc9553e,_0x5abf75?util[_0xb6de('0x6')](_0x5abf75,{'showHidden':![],'depth':null}):'');});};function getUser(_0x202468){return client['request'](_0xb6de('0xc'),{'options':{'raw':!![],'attributes':['id',_0xb6de('0xd'),_0xb6de('0xe'),_0xb6de('0xf')],'where':_0x202468,'limit':0x1}})['then'](function(_0x26a30a){logger[_0xb6de('0x5')](_0xb6de('0x10'),JSON[_0xb6de('0x11')](_0x202468),_0x26a30a?util['inspect'](_0x26a30a,{'showHidden':![],'depth':null}):'');return _0x26a30a['result'][_0xb6de('0x12')]?_0x26a30a[_0xb6de('0x13')][0x0]:null;});}exports[_0xb6de('0x14')]=function(_0xc9c8d6){return new BPromise(function(_0x3deafc,_0x2a70e0){if(_0xc9c8d6){return getUser({'internal':_0xc9c8d6})[_0xb6de('0x9')](function(_0x5910e0){logger[_0xb6de('0x4')](_0xb6de('0x15'),_0xc9c8d6,_0x5910e0?_0xb6de('0x16'):_0xb6de('0x17'));return _0x3deafc(_0x5910e0);})['catch'](function(_0xeb2861){logger['error']('[utils][getUserByInternal]',_0xeb2861?util[_0xb6de('0x6')](_0xeb2861,{'showHidden':![],'depth':null}):'');return _0x3deafc(null);});}return _0x3deafc(null);});};exports[_0xb6de('0x18')]=function(_0x3b6aa7){return new BPromise(function(_0x2b8385,_0x35755f){if(_0x3b6aa7){return getUser({'interface':_0x3b6aa7})[_0xb6de('0x9')](function(_0x3f4ea9){logger[_0xb6de('0x4')](_0xb6de('0x19'),_0x3b6aa7,_0x3f4ea9?_0xb6de('0x16'):_0xb6de('0x17'));return _0x2b8385(_0x3f4ea9);})[_0xb6de('0xa')](function(_0xeb8ef2){logger[_0xb6de('0x7')](_0xb6de('0x1a'),_0xeb8ef2?util[_0xb6de('0x6')](_0xeb8ef2,{'showHidden':![],'depth':null}):'');return _0x2b8385(null);});}return _0x2b8385(null);});};exports['getUserByName']=function(_0x4abcf9){return new BPromise(function(_0x14c729,_0x453c31){if(_0x4abcf9){return getUser({'name':_0x4abcf9})[_0xb6de('0x9')](function(_0x47acfa){logger[_0xb6de('0x4')]('[utils][getUserByName]\x20name:%s\x20%s',_0x4abcf9,_0x47acfa?'found':'notfound');return _0x14c729(_0x47acfa);})[_0xb6de('0xa')](function(_0x5ae36a){logger['error'](_0xb6de('0x1b'),_0x5ae36a?util[_0xb6de('0x6')](_0x5ae36a,{'showHidden':![],'depth':null}):'');return _0x14c729(null);});}return _0x14c729(null);});};exports[_0xb6de('0x1c')]=function(_0x26edbf){return new BPromise(function(_0x30d057,_0x5d03e0){if(_0x26edbf){return client[_0xb6de('0x8')](_0xb6de('0x1d'),{'options':{'raw':!![],'attributes':['id',_0xb6de('0xe'),_0xb6de('0x1e'),_0xb6de('0x1f'),_0xb6de('0x20')],'where':{'name':_0x26edbf},'limit':0x1}})[_0xb6de('0x9')](function(_0x56ee1d){logger[_0xb6de('0x5')](_0xb6de('0x21'),_0x26edbf,_0x56ee1d?util['inspect'](_0x56ee1d,{'showHidden':![],'depth':null}):'');logger['info'](_0xb6de('0x22'),_0x26edbf,_0x56ee1d?_0xb6de('0x16'):_0xb6de('0x17'));return _0x30d057(_0x56ee1d['result']['length']?_0x56ee1d[_0xb6de('0x13')][0x0]:null);})[_0xb6de('0xa')](function(_0x21aaa8){logger[_0xb6de('0x7')](_0xb6de('0x23'),_0x21aaa8?util[_0xb6de('0x6')](_0x21aaa8,{'showHidden':![],'depth':null}):'');return _0x30d057(null);});}return _0x30d057(null);});};exports['addTime']=function(_0x44b393,_0x1bec74){return moment(_0x44b393)[_0xb6de('0x24')](_0x1bec74,_0xb6de('0x25'))['format'](_0xb6de('0x26'));};exports[_0xb6de('0x27')]=function(_0x3312a8,_0x45890a){return moment(_0x3312a8)[_0xb6de('0x28')](_0x45890a,'seconds')[_0xb6de('0x29')](_0xb6de('0x26'));};exports[_0xb6de('0x2a')]=function(_0x17f5ed,_0x1ebf45){return moment(_0x17f5ed)[_0xb6de('0x2b')](moment(_0x1ebf45),_0xb6de('0x25'));};exports[_0xb6de('0x2c')]=function(_0x580a09,_0xd27e4c){return parseInt(_0x580a09,0xa)+parseInt(_0xd27e4c,0xa);};exports[_0xb6de('0x2d')]=function(){return moment()[_0xb6de('0x29')](_0xb6de('0x26'));};exports[_0xb6de('0x2e')]=function(_0x482d20,_0x315ced){if(_0x315ced){return moment(_0x482d20)[_0xb6de('0x2e')](_0x315ced);}return!![];};exports[_0xb6de('0x2f')]=function(_0x3cb175,_0x202952){if(_0x202952){return moment(_0x3cb175)[_0xb6de('0x2f')](_0x202952);}else if(_0x3cb175){return!![];}return![];}; \ No newline at end of file +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 -- 1.7.1